body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background-color 0.3s, color 0.3s;
}

.story-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bs-card-bg);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.story-cover {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
}

.story-header {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
}

.story-info {
    flex: 1;
}

.story-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.story-meta {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.4rem;
}

.genre-badge {
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    margin-right: 0.4rem;
}

.story-desc {
    font-size: 0.92rem;
    color: var(--bs-body-color);
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}


.sidebar-sticky {
    position: sticky;
    top: 76px;
}

.top-list .list-group-item {
    border: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.top-list .list-group-item:last-child {
    border-bottom: none;
}

.top-list .badge {
    font-size: 0.8rem;
    min-width: 50px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--bs-secondary-color);
}

.nav-tabs .nav-link.active {
    border-bottom: 2px solid var(--bs-primary);
    color: var(--bs-primary);
    background: transparent;
}

.genre-modal .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}

.genre-modal .modal-content {
    border-radius: 0.75rem;
}

.genre-modal .modal-body {
    max-height: 75vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.genre-col .list-group-item {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    border: none;
    border-bottom: 1px solid var(--bs-border-color);
}

.genre-col .list-group-item:last-child {
    border-bottom: none;
}

.genre-col .list-group-item:hover {
    background-color: var(--bs-tertiary-bg);
}

footer {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 2rem 0;
    margin-top: 4rem;
}

[data-bs-theme="dark"] footer {
    background-color: rgba(255, 255, 255, 0.03);
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.4rem;
}

.chapter-content {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background 0.3s, color 0.3s;
}

/* Class nền tùy chọn từ setting */
.bg-white {
    background: #ffffff !important;
    color: #000 !important;
}

.bg-kem {
    background: #fdf6e3 !important;
    color: #000 !important;
}

.bg-black {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

.bg-xanh-dam {
    background: #0f2b3a !important;
    color: #e0e0e0 !important;
}


/* Form auth luôn dễ đọc */
.auth-form .card {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.auth-form .form-label,
.auth-form .form-control,
.auth-form .input-group-text,
.auth-form .alert {
    color: var(--bs-body-color);
}

.auth-form .form-control {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.auth-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

/* Gradient header luôn đẹp */
.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd, #6610f2) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #198754, #0dcaf0) !important;
}

/* Dark mode tinh chỉnh */
[data-bs-theme="dark"] .auth-form .card {
    background: #1e1e1e;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .auth-form .input-group-text {
    background: #2c2c2c;
    border-color: #444;
}

[data-bs-theme="dark"] .auth-form .form-control {
    background: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}


html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    /* Nội dung chính đẩy footer xuống */
}

footer {
    flex-shrink: 0;
    /* Footer không bị co lại */
}


/* ===== BOX WRAPPER ===== */

    .categories-box {
        border-radius: 16px;
        transition: .2s ease;
    }

    /* ================= DARK MODE ================= */

    [data-bs-theme="dark"] .categories-box {
        background: none !important;
        border: none !important;
        box-shadow: none;
    }