:root {
    --bg: #0d0f16;
    --bg-soft: #131722;
    --bg-card: #181d2a;
    --bg-card-2: #202638;
    --border: #2b3245;
    --text: #f4f6fb;
    --muted: #9ca6bd;
    --muted-2: #6f7a91;
    --primary: #ffcc4d;
    --primary-dark: #d9a51f;
    --purple: #8b5cf6;
    --blue: #38bdf8;
    --green: #22c55e;
    --red: #ef4444;
    --radius: 20px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    
    min-height: 100vh;font-family: 'Roboto', Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 32%), radial-gradient(circle at top right, rgba(255, 204, 77, 0.12), transparent 30%), var(--bg);
    color: var(--text);
}

    body.light-mode {
        --bg: #f5f7fb;
        --bg-soft: #ffffff;
        --bg-card: #ffffff;
        --bg-card-2: #eef2ff;
        --border: #dde3f0;
        --text: #141824;
        --muted: #5d6677;
        --muted-2: #7d8798;
        --shadow: 0 18px 50px rgba(20, 24, 36, 0.12);
        background: #f5f7fb;
    }

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input {
    font-family: inherit;
}
#readerContent img,
#previewContent img{
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
}
.container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 15, 22, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.88);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.logo img{
    max-width:190px;
}

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #111827;
    background: linear-gradient(135deg, var(--primary), #ff8a00);
    box-shadow: 0 12px 30px rgba(255, 204, 77, 0.25);
    font-size: 20px;
}

.logo span:last-child {
    font-size: 21px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
}

    .main-nav a {
        transition: 0.2s;
    }

        .main-nav a:hover,
        .main-nav a.active {
            color: var(--primary);
        }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    position: relative;
    width: 280px;
}

    .search-box input {
        width: 100%;
        height: 42px;
        padding: 0 42px 0 15px;
        border-radius: 999px;
        border: 1px solid var(--border);
        outline: none;
        color: var(--text);
        background: var(--bg-soft);
    }

    .search-box button {
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: var(--primary);
        color: #111827;
        cursor: pointer;
        font-weight: 900;
    }

.icon-btn,
.theme-btn,
.login-btn,
.mobile-menu-btn {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    transition: 0.2s;
}

.icon-btn,
.theme-btn {
    width: 42px;
}

.login-btn {
    padding: 0 18px;
    background: var(--primary);
    color: #111827;
    border-color: transparent;
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    font-size: 21px;
}

    .icon-btn:hover,
    .theme-btn:hover,
    .login-btn:hover,
    .mobile-menu-btn:hover {
        transform: translateY(-1px);
    }

.mobile-nav {
    display: none;
    border-top: 1px solid var(--border);
    padding: 14px 0 18px;
}

    .mobile-nav.open {
        display: block;
    }

    .mobile-nav a {
        display: block;
        padding: 12px 4px;
        color: var(--muted);
        font-weight: 800;
        border-bottom: 1px solid rgba(127, 127, 127, 0.12);
    }

.hero {
    padding: 38px 0 24px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: stretch;
}

.hero-main {
    min-height: 420px;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: linear-gradient(90deg, rgba(13, 15, 22, 0.96), rgba(13, 15, 22, 0.48), rgba(13, 15, 22, 0.2)), radial-gradient(circle at 70% 25%, rgba(139, 92, 246, 0.85), transparent 26%), radial-gradient(circle at 82% 68%, rgba(255, 204, 77, 0.55), transparent 24%), linear-gradient(135deg, #171b2a, #24263a 48%, #3a225d);
}

body.light-mode .hero-main {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2)), radial-gradient(circle at 70% 25%, rgba(139, 92, 246, 0.55), transparent 26%), radial-gradient(circle at 82% 68%, rgba(255, 204, 77, 0.45), transparent 24%), linear-gradient(135deg, #f8fafc, #eef2ff 48%, #ddd6fe);
}

.hero-main::before {
    content: "";
    position: absolute;
    right: 42px;
    bottom: -40px;
    width: 250px;
    height: 360px;
    border-radius: 120px 120px 30px 30px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.18), transparent), linear-gradient(145deg, #1d2438, #4c2f7e 52%, #f0b429);
    transform: rotate(8deg);
    box-shadow: 0 40px 100px rgba(0,0,0,0.32);
    opacity: 0.9;
}

.hero-main::after {
    content: "WEBTOON";
    position: absolute;
    right: -48px;
    top: 74px;
    font-size: 78px;
    font-weight: 900;
    letter-spacing: 10px;
    color: rgba(255, 255, 255, 0.06);
    transform: rotate(90deg);
    pointer-events: none;
}

body.light-mode .hero-main::after {
    color: rgba(15, 23, 42, 0.07);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    padding: 58px 48px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    font-size: 14px;
    font-weight: 900;
    border: 1px solid rgba(255, 204, 77, 0.25);
}

.hero h1 {
    margin: 18px 0 16px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.04;
    letter-spacing: -2px;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
}

.hero-buttons {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: 0.2s;
}

    .btn:hover {
        transform: translateY(-2px);
        background: var(--primary);
        color: #111827;
        border-color: transparent;
    }

.btn-primary
{
    background: var(--primary);
    color: #111827;
    border-color: transparent;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

body.light-mode .btn-secondary {
    background: #ffffff;
}

.hero-stats {
    display: flex;
    gap: 18px;
    margin-top: 34px;
    flex-wrap: wrap;
}

.stat-item strong {
    display: block;
    font-size: 24px;
    color: var(--text);
}

.stat-item span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

.hero-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
}

.feature-card {
    border-radius: 28px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

    .feature-card::after {
        content: "";
        position: absolute;
        right: -30px;
        top: -30px;
        width: 160px;
        height: 160px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255,204,77,0.28), transparent 70%);
    }

    .feature-card.purple::after {
        background: radial-gradient(circle, rgba(139,92,246,0.32), transparent 70%);
    }

    .feature-card h3 {
        margin: 12px 0 10px;
        font-size: 24px;
    }

    .feature-card p {
        color: var(--muted);
        line-height: 1.65;
        margin: 0 0 18px;
    }

.section {
    padding: 30px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.section-kicker {
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.section-title {
    margin: 6px 0 0;
    font-size: clamp(25px, 3vw, 36px);
    letter-spacing: -1px;
}

.section-desc {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.view-more {
    color: var(--primary);
    font-weight: 900;
    white-space: nowrap;
}

.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tab-btn {
    min-height: 40px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
}

    .tab-btn.active,
    .tab-btn:hover {
        background: var(--primary);
        color: #111827;
        border-color: transparent;
    }

.story-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.16);
    transition: 0.22s;
    cursor: pointer;
}

    .story-card:hover {
        transform: translateY(-6px);
        border-color: rgba(255, 204, 77, 0.55);
    }

.cover {
    height: 250px;
    position: relative;
    overflow: hidden;
    background-repeat:no-repeat !important;
    background-size:cover !important;
    background: linear-gradient(135deg, #30384d, #151823);
}

    .cover::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 45% 25%, rgba(255,255,255,0.22), transparent 22%), linear-gradient(to top, rgba(0,0,0,0.72), transparent 55%);
    }

    /*.cover::after {
        content: attr(data-title);
        position: absolute;
        left: 14px;
        right: 14px;
        bottom: 14px;
        font-size: 20px;
        line-height: 1.1;
        font-weight: 900;
        color: #fff;
        text-shadow: 0 5px 18px rgba(0,0,0,0.4);
    }*/

    .cover.tone-1 {
        background: linear-gradient(135deg, #101827, #4c1d95 55%, #f59e0b);
    }

    .cover.tone-2 {
        background: linear-gradient(135deg, #0f172a, #075985 55%, #22c55e);
    }

    .cover.tone-3 {
        background: linear-gradient(135deg, #111827, #7f1d1d 55%, #fb7185);
    }

    .cover.tone-4 {
        background: linear-gradient(135deg, #172554, #312e81 55%, #38bdf8);
    }

    .cover.tone-5 {
        background: linear-gradient(135deg, #1c1917, #78350f 55%, #facc15);
    }

    .cover.tone-6 {
        background: linear-gradient(135deg, #052e16, #14532d 55%, #86efac);
    }

    .cover.tone-7 {
        background: linear-gradient(135deg, #312e81, #581c87 55%, #f0abfc);
    }

    .cover.tone-8 {
        background: linear-gradient(135deg, #020617, #334155 55%, #94a3b8);
    }

.story-body {
    padding: 15px;
}

.story-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.type-comic {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
}

.type-novel {
    background: rgba(255, 204, 77, 0.16);
    color: var(--primary);
}

body.light-mode .type-comic {
    color: #6d28d9;
}

body.light-mode .type-novel {
    color: #9a6700;
}

.score {
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 800;
}

.story-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.story-body p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.story-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 800;
}

.layout-2col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 22px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.14);
}

.update-list {
    display: grid;
    gap: 14px;
}

.update-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
    transition: 0.2s;
}

    .update-item:hover {
        transform: translateX(4px);
        border-color: rgba(255, 204, 77, 0.45);
    }

.mini-cover {
    width: 76px;
    height: 96px;
    border-radius: 14px;
    background: linear-gradient(135deg, #22283a, #4c1d95);
    position: relative;
    overflow: hidden;
}

    .mini-cover::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    }

.update-info h3 {
    margin: 0 0 7px;
    font-size: 17px;
}

.update-info p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.chapter-badge {
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255,204,77,0.14);
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.novel-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

    .novel-table tr {
        border-bottom: 1px solid rgba(127,127,127,0.16);
    }

        .novel-table tr:last-child {
            border-bottom: 0;
        }

    .novel-table td {
        padding: 15px 8px;
        color: var(--muted);
        font-size: 14px;
    }

        .novel-table td:first-child {
            color: var(--text);
            font-size: 15px;
            font-weight: 900;
        }

        .novel-table td:nth-child(2) {
            color: var(--primary);
            font-weight: 900;
            width:15%;
        }

        .novel-table td:last-child {
            text-align: right;
            white-space: nowrap;
        }

.sidebar {
    display: grid;
    gap: 22px;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
}

.rank-no {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--bg-card-2);
    font-weight: 900;
    color: var(--muted);
}

.ranking-item:nth-child(1) .rank-no {
    background: linear-gradient(135deg, var(--primary), #ff8a00);
    color: #111827;
}

.ranking-item:nth-child(2) .rank-no {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: #111827;
}

.ranking-item:nth-child(3) .rank-no {
    background: linear-gradient(135deg, #f59e0b, #92400e);
    color: #111827;
}

.rank-title {
    min-width: 0;
}

    .rank-title strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }

    .rank-title span {
        display: block;
        margin-top: 4px;
        color: var(--muted-2);
        font-size: 12px;
        font-weight: 800;
    }

.rank-views {
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.genre-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    .genre-cloud a {
        padding: 10px 12px;
        border-radius: 999px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.13);
        color: var(--muted);
        font-weight: 900;
        font-size: 13px;
        transition: 0.2s;
    }

        .genre-cloud a:hover {
            background: var(--primary);
            color: #111827;
            border-color: transparent;
        }

.author-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.author-card {
    padding: 22px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 14px;
    align-items: center;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 22px;
}

.author-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.author-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.cta {
    padding: 36px 0 58px;
}

.cta-box {
    position: relative;
    overflow: hidden;
    padding: 46px;
    border-radius: 32px;
    border: 1px solid rgba(255, 204, 77, 0.3);
    background: radial-gradient(circle at 80% 30%, rgba(255, 204, 77, 0.22), transparent 30%), linear-gradient(135deg, #221b10, var(--bg-card));
    box-shadow: var(--shadow);
}

body.light-mode .cta-box {
    background: radial-gradient(circle at 80% 30%, rgba(255, 204, 77, 0.26), transparent 30%), linear-gradient(135deg, #fff7ed, #ffffff);
}

.cta-box h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -1px;
}

.cta-box p {
    margin: 0 0 24px;
    color: var(--muted);
    max-width: 680px;
    line-height: 1.7;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.12);
    padding: 34px 0;
    color: var(--muted);
}

body.light-mode .site-footer {
    background: #ffffff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 24px;
}

    .footer-grid h3,
    .footer-grid h4 {
        color: var(--text);
        margin: 0 0 12px;
    }

    .footer-grid p {
        margin: 0;
        line-height: 1.7;
    }

    .footer-grid a {
        display: block;
        margin: 10px 0;
        font-weight: 800;
    }

.search-result-box {
    display: none;
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

    .search-result-box.show {
        display: block;
    }

    .search-result-box strong {
        color: var(--primary);
    }

@media (max-width: 1060px) {
    .main-nav,
    .search-box,
    .login-btn {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .hero-grid,
    .layout-2col {
        grid-template-columns: 1fr;
    }

    .hero-side {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .story-grid {
        grid-template-columns: repeat(3, 1fr);
    }
   
    .main-nav {
        display: none
    }

    .mobile-menu-btn {
        display: inline-grid;
        place-items: center
    }

    .story-card {
        grid-template-columns: 220px minmax(0,1fr)
    }

    .story-side {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2,1fr)
    }

    .content-layout {
        grid-template-columns: 1fr
    }

    .sidebar {
        position: static
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 22px, var(--container));
    }

    .header-inner {
        min-height: 66px;
    }

    .hero {
        padding-top: 20px;
    }

    .hero-main {
        min-height: auto;
        border-radius: 24px;
    }

        .hero-main::before {
            opacity: 0.35;
            right: -40px;
        }

    .hero-content {
        padding: 34px 24px;
    }

    .hero-side {
        grid-template-columns: 1fr;
    }

    .story-grid,
    .author-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sidebar {
        position: static !important;
    }
    .cover {
        height: 220px;
    }

    .update-item {
        grid-template-columns: 64px 1fr;
    }

    .mini-cover {
        width: 64px;
        height: 84px;
    }

    .chapter-badge {
        grid-column: 2;
        width: fit-content;
    }

    .novel-table td:nth-child(3) {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cta-box {
        padding: 32px 24px;
    }
    .chapter-row {
        grid-template-columns: 1fr
    }

    .chapter-title a {
        white-space: normal
    }

    .chapter-time {
        white-space: normal
    }

    .pagination-wrap {
        align-items: stretch
    }

    .pagination, .jump-box {
        width: 100%
    }

    .jump-box {
        justify-content: space-between
    }

        .jump-box input {
            flex: 1
        }
    .container {
        width: min(100% - 22px,var(--container))
    }

    .header-inner {
        min-height: 66px
    }

    .logo span:last-child {
        display: none
    }

    .story-card {
        grid-template-columns: 1fr;
        border-radius: 24px
    }

    .cover {
        min-height: 420px
    }

    .story-side {
        grid-template-columns: 1fr
    }

    .story-meta, .stat-grid, .chapter-tools {
        grid-template-columns: 1fr
    }

    .chapter-row {
        grid-template-columns: 1fr
    }

    .chapter-title a {
        white-space: normal
    }

    .chapter-time {
        white-space: normal
    }

    .pagination-wrap {
        align-items: stretch
    }

    .pagination, .jump-box {
        width: 100%
    }

    .jump-box {
        justify-content: space-between
    }

        .jump-box input {
            flex: 1
        }

    .hero-actions .btn {
        width: 100%
    }

    .user-dropdown {
        right: -56px
    }
    .chapter-hero {
        padding-top: 18px;
    }

    .reader-content {
        padding: 24px 18px;
    }

    .reader-bottom-nav {
        grid-template-columns: 1fr;
    }

        .reader-bottom-nav .btn,
        .reader-bottom-nav .btn:first-child,
        .reader-bottom-nav .btn:last-child {
            width: 100%;
            justify-self: stretch;
        }

    .float-tools {
        right: 10px;
        bottom: 10px;
    }

    .float-btn {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }
}

@media (max-width: 520px) {
    .story-grid,
    .author-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .cover {
        height: 260px;
    }

    .section-head {
        align-items: start;
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .header-actions {
        gap: 6px;
    }

    .logo span:last-child {
        font-size: 18px;
    }
}
.thongbao-do {
    background: #fff;
    display: block;
    line-height: 32px;
    color: #a00;
    font-weight: bold;
    font-family: 'Roboto';
    text-indent: 10px;
}
/* ==============================
   AUTH / LOGIN PAGE
   Merged from login.css without duplicated root, body, header, footer styles
   ============================== */

/* Auth-page feature cards reuse .feature-card, so reset homepage card effects here. */
.auth-hero .feature-card::after {
    content: none;
}

.auth-page {
    min-height: calc(100vh - 74px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 32px;
    align-items: start;
    padding: 44px 0;
}

.auth-hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    border-radius: 34px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, rgba(24, 29, 42, 0.92), rgba(13, 15, 22, 0.86)), radial-gradient(circle at 70% 18%, rgba(255, 204, 77, 0.24), transparent 26%), radial-gradient(circle at 84% 78%, rgba(139, 92, 246, 0.36), transparent 32%);
    padding: clamp(30px, 5vw, 54px);
}

body.light-mode .auth-hero {
    background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(245,247,251,0.88)), radial-gradient(circle at 70% 18%, rgba(255, 204, 77, 0.24), transparent 26%), radial-gradient(circle at 84% 78%, rgba(139, 92, 246, 0.20), transparent 32%);
}

.auth-hero::after {
    content: "LOGIN";
    position: absolute;
    right: -26px;
    bottom: 14px;
    font-size: clamp(70px, 15vw, 170px);
    font-weight: 900;
    letter-spacing: 10px;
    color: rgba(255,255,255,0.04);
    pointer-events: none;
}

body.light-mode .auth-hero::after {
    color: rgba(15, 23, 42, 0.06);
}

.kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    border: 1px solid rgba(255, 204, 77, 0.24);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.3px;
}

.auth-hero h1 {
    margin: 18px 0 14px;
    max-width: 720px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -2px;
}

.auth-hero p {
    margin: 0;
    max-width: 680px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
    position: relative;
    z-index: 2;
}

.auth-hero .feature-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
}

body.light-mode .auth-hero .feature-card {
    background: rgba(255,255,255,0.78);
    border-color: var(--border);
}

.auth-hero .feature-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
}

.auth-hero .feature-card span {
    display: block;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
    font-weight: 700;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-card-head {
    margin-bottom: 18px;
    text-align: center;
}

    .auth-card-head h2 {
        margin: 0 0 8px;
        font-size: 30px;
        letter-spacing: -0.8px;
    }

    .auth-card-head p {
        margin: 0;
        color: var(--muted);
        line-height: 1.6;
        font-size: 14px;
    }

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 7px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
}

.auth-tab {
    min-height: 42px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
    transition: 0.2s;
}

    .auth-tab.active {
        background: var(--primary);
        color: #111827;
    }

.social-login {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.social-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
}

    .social-btn:hover {
        transform: translateY(-2px);
        border-color: rgba(255, 204, 77, 0.55);
    }

.social-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 14px;
}

.google-icon {
    background: #ffffff;
    color: #111827;
}

.apple-icon {
    background: #ffffff;
    color: #111827;
    font-size: 18px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 800;
}

    .divider::before,
    .divider::after {
        content: "";
        height: 1px;
        flex: 1;
        background: var(--border);
    }

.auth-form {
    display: grid;
    gap: 14px;
}

.field-group {
    display: grid;
    gap: 8px;
    margin-bottom:15px;
}

.field-label {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.field-wrap {
    position: relative;
}

.field {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 14px;
    border-radius: 15px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    transition: 0.2s;
}

    .field:focus {
        border-color: rgba(255, 204, 77, 0.65);
        box-shadow: 0 0 0 4px rgba(255, 204, 77, 0.10);
    }

    .field::placeholder {
        color: var(--muted-2);
    }

.toggle-password {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

    .check-label input {
        width: 17px;
        height: 17px;
        accent-color: var(--primary);
    }

.text-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
}

.submit-btn {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 16px;
    background: var(--primary);
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
}

    .submit-btn:hover {
        transform: translateY(-2px);
    }

    .submit-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

.auth-note {
    margin: 16px 0 0;
    color: var(--muted-2);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

    .auth-note a {
        color: var(--primary);
        font-weight: 900;
    }

.hidden {
    display: none !important;
}

.forgot-box {
    display: none;
    padding: 14px;
    margin-bottom: 16px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--primary) 9%, var(--bg-soft));
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
}

    .forgot-box.show {
        display: grid;
        gap: 10px;
    }

    .forgot-box strong {
        display: block;
        font-size: 15px;
    }

    .forgot-box span {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.55;
        font-weight: 700;
    }

.message-box {
    display: none;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 800;
}

    .message-box.show {
        display: block;
    }

    .message-box.success {
        background: rgba(34, 197, 94, 0.14);
        color: #86efac;
        border: 1px solid rgba(34, 197, 94, 0.24);
    }

    .message-box.error {
        background: rgba(239, 68, 68, 0.14);
        color: #fecaca;
        border: 1px solid rgba(239, 68, 68, 0.24);
    }

body.light-mode .message-box.success {
    color: #15803d;
}

body.light-mode .message-box.error {
    color: #b91c1c;
}

.toast {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    right: auto;
    bottom: auto;
    z-index: 99999;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #22c55e;
    border-radius: 16px;
    background: linear-gradient( 135deg, #14532d, #166534 );
    box-shadow: 0 12px 35px rgba(34, 197, 94, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #f0fdf4;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -15px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

    /* Dấu tích */

    .toast::before {
        content: "✓";
        width: 25px;
        height: 25px;
        flex: 0 0 25px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #22c55e;
        color: #052e16;
        font-size: 16px;
        font-weight: 900;
    }

    .toast.show {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
    }

@media (max-width: 520px) {
    .toast {
        top: max(12px, env(safe-area-inset-top));
        width: calc(100vw - 24px);
        max-width: none;
        padding: 12px 14px;
        border-radius: 13px;
        font-size: 13px;
        left: 1%;
        right: unset !important;
        bottom: unset !important;
    }
}

@media (max-width: 1020px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: auto;
    }

    .auth-card {
        max-width: 520px;
        width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .auth-page {
        padding: 24px 0;
    }

    .auth-hero {
        border-radius: 24px;
        padding: 24px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        border-radius: 24px;
        padding: 18px;
    }

    .form-row {
        align-items: start;
        flex-direction: column;
    }
}
.text-2-line {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 20px;
    max-height: 40px; /* line-height x 2 */
    word-break: break-word;
}


.notification-wrap,
.user-wrap {
    position: relative;
}

.badge-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--red);
    border: 2px solid var(--bg-soft);
}

.avatar-btn {
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    border-color: transparent;
}

.notification-panel {
    width: min(360px, calc(100vw - 24px));
    padding: 14px;
}

.dropdown-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 4px 4px 12px;
    border-bottom: 1px solid rgba(127,127,127,0.12);
    margin-bottom: 10px;
}

    .dropdown-head strong {
        font-size: 18px;
    }

    .dropdown-head button {
        border: 0;
        background: transparent;
        color: var(--primary);
        cursor: pointer;
        font-weight: 900;
    }

.notification-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: var(--bg-soft);
    margin-bottom: 8px;
}
.notification-item-empty {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: var(--bg-soft);
    margin-bottom: 8px;
}
.notif-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    font-weight: 900;
}

.notification-item p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    font-size: 14px;
    font-weight: 800;
}

.notification-item small {
    display: block;
    margin-top: 5px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 700;
}

.user-dropdown {
    min-width: 290px;
}

.user-box {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: var(--bg-soft);
    margin-bottom: 10px;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;position:relative;
    overflow:hidden;
    font-weight: 900;
}

.user-box strong {
    display: block;
    margin-bottom: 4px;
}

.user-box span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.coin-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

    .coin-mini div {
        padding: 10px;
        border-radius: 14px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
    }

    .coin-mini strong {
        display: block;
        color: var(--primary);
        font-size: 17px;
    }

    .coin-mini span {
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }

.mobile-nav {
    display: none;
    border-top: 1px solid var(--border);
    padding: 14px 0 18px;
}
.more-menu-btn {
    height: 38px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.more-dropdown,
.notification-panel,
.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 260px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    padding: 10px;
    display: none;
    z-index: 160;
}

    .more-dropdown.open,
    .notification-panel.open,
    .user-dropdown.open {
        display: block;
    }

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 800;
    transition: 0.18s;
}

    .dropdown-link:hover {
        background: var(--bg-soft);
        color: var(--primary);
    }


.breadcrumb {
    padding: 22px 0 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

    .breadcrumb a {
        color: var(--muted);
    }

        .breadcrumb a:hover {
            color: var(--primary);
        }

.story-hero {
    position: relative;
    overflow: hidden;
    border-radius: 34px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: linear-gradient(90deg, rgba(13, 15, 22, 0.96), rgba(13, 15, 22, 0.72), rgba(13, 15, 22, 0.38)), radial-gradient(circle at 78% 28%, rgba(255, 204, 77, 0.28), transparent 24%), radial-gradient(circle at 84% 70%, rgba(139, 92, 246, 0.36), transparent 28%), linear-gradient(135deg, #161b2b, #37250c 50%, #4c1d95);
    padding: 34px;
}

body.light-mode .story-hero {
    background: linear-gradient(90deg, rgba(255,255,255,0.96), rgba(255,255,255,0.82), rgba(255,255,255,0.55)), radial-gradient(circle at 78% 28%, rgba(255, 204, 77, 0.34), transparent 24%), radial-gradient(circle at 84% 70%, rgba(139, 92, 246, 0.26), transparent 28%), linear-gradient(135deg, #ffffff, #fff7ed 50%, #ede9fe);
}

.story-hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.story-cover-wrap {
    position: sticky;
    top: 96px;
}

.story-cover {
    width: 250px;
    aspect-ratio: 2 / 3;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: radial-gradient(circle at 48% 20%, rgba(255,255,255,0.26), transparent 24%), linear-gradient(135deg, #24160b, #7c2d12 45%, #f59e0b);
    box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}
    .story-cover img,
    .library-item .cover img,
    .user-avatar-large img,
    .novel-card .cover img {
        object-position: center;
        object-fit: cover;
        position: absolute;
        max-width: none;
        display: block;
        width: 100%;
        height: 100%;
    }

    .story-cover::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.76), transparent 55%), radial-gradient(circle at 55% 40%, rgba(255,204,77,0.36), transparent 22%);
    }

    .story-cover::after {
   
        white-space: pre;
        position: absolute;
        left: 18px;
        right: 18px;
        bottom: 22px;
        color: #fff;
        font-size: 27px;
        line-height: 1.05;
        font-weight: 900;
        letter-spacing: -0.8px;
        text-shadow: 0 8px 24px rgba(0,0,0,0.5);
    }

.story-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    font-size: 13px;
    font-weight: 900;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

body.light-mode .story-status {
    color: #15803d;
}

.story-info {
    min-width: 0;
}

.story-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    border: 1px solid rgba(255, 204, 77, 0.24);
    font-size: 13px;
    font-weight: 900;
}

    .pill.secondary {
        background: rgba(139, 92, 246, 0.16);
        color: #c4b5fd;
        border-color: rgba(139, 92, 246, 0.24);
    }

body.light-mode .pill.secondary {
    color: #6d28d9;
}

.story-title {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -1.8px;
}

.story-subtitle {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
    max-width: 780px;
}

.story-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.meta-card {
    min-width: 132px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.light-mode .meta-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--border);
}

.meta-card strong {
    display: block;
    color: var(--text);
    font-size: 21px;
    line-height: 1;
}

.meta-card span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 15px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 900;
    transition: 0.2s;
    font-size: 15px;
}

    .btn:hover {
        transform: translateY(-2px);
    }

.btn-primary {
    background: var(--primary);
    color: #111827;
    border-color: transparent;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

body.light-mode .btn-secondary {
    background: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--text);
}

.btn.saved {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.26);
}

body.light-mode .btn.saved {
    color: #b91c1c;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    padding: 26px 0 54px;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.13);
}


.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-kicker {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
}

.section-title {
    margin: 6px 0 0;
    font-size: 28px;
    letter-spacing: -0.8px;
}

.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
    margin-bottom: 20px;
}

.tab-btn {
    min-height: 40px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
}

    .tab-btn.active,
    .tab-btn:hover {
        background: var(--primary);
        color: #111827;
    }

.tab-panel {
    display: none;
}

    .tab-panel.active {
        display: block;
    }

.description-text {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
    margin: 0;
}
.hide{
    display:none;
}
    .description-text strong {
        color: var(--text);
    }

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 22px;
}

.info-row {
    padding: 14px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
}

    .info-row span {
        display: block;
        color: var(--muted-2);
        font-size: 13px;
        font-weight: 800;
        margin-bottom: 6px;
    }

    .info-row strong {
        display: block;
        font-size: 15px;
    }

.chapter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.chapter-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

    .chapter-search input {
        width: 100%;
        height: 44px;
        padding: 0 14px;
        border-radius: 14px;
        border: 1px solid var(--border);
        outline: none;
        background: var(--bg-soft);
        color: var(--text);
    }

.select-sort {
    height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    outline: none;
    color: var(--text);
    background: var(--bg-soft);
    font-weight: 800;
}

.chapter-list {
    display: grid;
    gap: 10px;
}
.chapter-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, .12);
    transition: .2s;
}
.chapter-no {
    color: var(--primary);
    font-weight: 900;
    white-space: nowrap;
}
.chapter-title {
    min-width: 0;
}
.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}
    .pill.vip {
        background: rgba(239, 68, 68, .14);
        color: #fecaca;
        border: 1px solid rgba(239, 68, 68, .22);
    }

.chapter-title a {
    display: block;
    font-weight: 900;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-title span {
    display: block;
    margin-top: 4px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 800;
}
.chapter-time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.comment-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

    .comment-form textarea {
        width: 100%;
        min-height: 110px;
        resize: vertical;
        padding: 14px;
        border-radius: 16px;
        border: 1px solid var(--border);
        outline: none;
        background: var(--bg-soft);
        color: var(--text);
        line-height: 1.6;
    }

.comment-list {
    display: grid;
    gap: 12px;
}
.comment-reactions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.reaction-btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--muted);
    cursor: pointer;
    line-height:32px;
    font-size: 13px;
    font-weight: 800;
}
    .reaction-btn:hover,
    .reaction-btn.active {
        background: var(--primary);
        color: #111827;
        border-color: transparent;
    }
.comment-body small {
    display: block;
    margin-bottom: 8px;
    text-transform:capitalize;
    color: var(--muted-2);
    font-weight: 700;
}
.comment-body small.name {
   
}
    .comment-body small.time {
    }
.hint-cmt {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}
.comment-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    font-weight: 900;
}

.comment-body strong {
    display: block;
    margin-bottom: 5px;
}

.comment-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

.sidebar {
    display: grid;
    gap: 24px;
    position: sticky;
    top: 96px;
}

.author-box {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 14px;
    align-items: center;
}
.reply-form {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: grid;
    gap: 10px;
}
.comment-replies {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
    display: grid;
    gap: 10px;
}
.reply-context {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 13%, transparent);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.reply-form textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--bg-soft);
    color: var(--text);
    line-height: 1.55;
}
.reply-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.author-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f59e0b, #7c2d12);
    color: #fff;
    font-size: 23px;
    font-weight: 900;
}

.author-box h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.author-box p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    .tag-cloud a {
        padding: 9px 11px;
        border-radius: 999px;
        background: var(--bg-soft);
        color: var(--muted);
        border: 1px solid rgba(127,127,127,0.12);
        font-size: 13px;
        font-weight: 900;
        transition: 0.2s;
    }

        .tag-cloud a:hover {
            background: var(--primary);
            color: #111827;
            border-color: transparent;
        }

.recommend-list {
    display: grid;
    gap: 12px;
}

.recommend-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
}
.comment-reply {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(127, 127, 127, 0.12);
}
    .comment-reply .comment-avatar {
        width: 38px;
        height: 38px;
        border-radius: 13px;
        font-size: 14px;
    }
.mini-cover {
    width: 54px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e293b, #7c2d12 60%, #f59e0b);
}

.recommend-item h4 {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.35;
}

.recommend-item p {
    margin: 0;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 700;
}

.reading-box {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,204,77,0.16), rgba(139,92,246,0.12));
    border: 1px solid rgba(255,204,77,0.2);
}

    .reading-box h3 {
        margin: 0 0 8px;
        font-size: 18px;
    }

    .reading-box p {
        margin: 0 0 14px;
        color: var(--muted);
        line-height: 1.55;
        font-size: 14px;
    }



.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(127, 127, 127, .12);
}
.pagination {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    transition: .18s;
    line-height:40px;text-align:center;
}
    .page-btn:hover:not(:disabled), .page-btn.active {
        background: var(--primary);
        color: #111827;
        border-color: transparent;
        transform: translateY(-2px);
    }
.jump-box {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
    .jump-box input {
        width: 74px;
        height: 40px;
        text-align: center;
    }
.pagination .field, .pagination .select {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 14px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    transition: .2s;
}

/*TRANG ĐỌC TRUYỆN TIỂU THUYẾT*/
:root {
    --bg: #0d0f16;
    --bg-soft: #131722;
    --bg-card: #181d2a;
    --border: #2b3245;
    
    --text: #f4f6fb;
    --reading-text: #e9edf7;
    --muted: #9ca6bd;
    --muted-2: #707b92;
    --primary: #ffcc4d;
    --primary-dark: #b87900;
    --danger: #ef4444;
    --reader-width: 820px;
    --reader-font-size: 20px;
    --reader-line-height: 1.9;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}
.chapter-hero {
    width: min(var(--reader-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 16px;
    text-align: center;
}

.story-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    border: 1px solid rgba(255, 204, 77, 0.24);
    font-weight: 900;
    font-size: 13px;
}
.chapter-hero h1 {
    margin: 16px 0 10px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.18;
    text-transform:capitalize;
    letter-spacing: -1.2px;
}

.chapter-meta {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.chapter-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.reading-shell {
    padding: 22px 0 48px;
}

.reader-card {
    width: min(var(--reader-width), calc(100% - 32px));
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.reader-toolbar {
    position: relative;
    top: auto;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.toolbar-select {
    height: 40px;
    min-width: 330px;
    max-width: 420px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 800;
    outline: none;
}
.small-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 11px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    transition: 0.2s;
}
.locked-preview-content {
    position: relative;
    max-height: 430px;
    overflow: hidden;
}
.reader-content,
.locked-preview-content {
    padding: clamp(24px, 5vw, 54px);
    font-size: var(--reader-font-size);
    line-height: var(--reader-line-height);
    color: var(--reading-text);
}

    .reader-content p {
        margin: 0 0 1.25em;
    }
.reader-note {
    margin: 28px 0;
    padding: 18px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--primary) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
    color: var(--muted);
    font-size: 0.9em;
    line-height: 1.65;
}
.reader-bottom-nav {
    width: min(var(--reader-width), calc(100% - 32px));
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}
    .reader-bottom-nav .btn:first-child {
        justify-self: start;
    }
.reader-comments {
    width: min(var(--reader-width), calc(100% - 32px));
    margin: 24px auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: clamp(18px, 4vw, 30px);
}
.reader-comments-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.float-tools {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    display: grid;
    gap: 10px;
}


.float-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    transition: 0.2s;
}

    .float-btn:hover {
        transform: translateY(-2px);
        background: var(--primary);
        color: #111827;
    }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(0,0,0,0.48);
    opacity: 0;
    pointer-events: none;
    transition: 0.22s;
}

    .drawer-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

.chapter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 220;
    width: min(420px, 100%);
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: 0.24s;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

    .chapter-drawer.open {
        transform: translateX(0);
    }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

    .drawer-head h2 {
        margin: 0;
        font-size: 22px;
        letter-spacing: -0.4px;
    }

.drawer-search {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

    .drawer-search input {
        width: 100%;
        height: 44px;
        padding: 0 13px;
        border-radius: 14px;
        border: 1px solid var(--border);
        outline: none;
        background: var(--bg-soft);
        color: var(--text);
        font-weight: 700;
    }

.drawer-list {
    overflow: auto;
    padding: 12px 18px 20px;
    display: grid;
    gap: 9px;
    align-content: start;
}

.drawer-chapter {
    display: block;
    padding: 13px;
    border-radius: 14px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
    color: var(--muted);
    font-weight: 800;
    line-height: 1.45;
    transition: 0.2s;
}

    .drawer-chapter:hover,
    .drawer-chapter.current {
        color: #111827;
        background: var(--primary);
        border-color: transparent;
    }
.background_doctruyen {
    background: var(--bg);
}

.loading-box {
    padding: 20px;
    text-align: center;
    color: #9ca6bd;
    font-weight: 700;
}


.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 3px solid #2b3245;
    border-top-color: #ffcc4d;
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

body.reader-focus .site-header,
body.reader-focus .breadcrumb,
body.reader-focus .chapter-hero,
body.reader-focus .reader-bottom-nav,
body.reader-focus .site-footer {
    display: none;
}

.locked-chapter-box {
    padding: clamp(24px, 5vw, 54px);
    text-align: center;
    border-top: 1px solid var(--border);
    background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 32%), var(--bg-card);
}

.lock-icon {
    width: 86px;
    height: 86px;
    margin: 0 auto 18px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff8a00);
    color: #111827;
    font-size: 40px;
    box-shadow: 0 20px 55px rgba(255, 204, 77, 0.22);
}
.locked-chapter-box h2 {
    margin: 0 0 10px;
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: -0.8px;
}

.locked-chapter-box p {
    margin: 0 auto;
    max-width: 660px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 16px;
}
.chapter-price-card {
    max-width: 560px;
    margin: 24px auto 0;
    padding: 18px;
    border-radius: 22px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    text-align: left;
}

.price-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(127, 127, 127, 0.16);
    color: var(--muted);
    font-weight: 800;
}

    .price-row strong {
        color: var(--text);
        text-align: right;
    }

.unlock-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}
.auto-unlock-option {
    max-width: 560px;
    margin: 16px auto 0;
    padding: 14px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--primary) 9%, var(--bg-soft));
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    text-align: left;
    cursor: pointer;
}
    .auto-unlock-option input {
        width: 18px;
        height: 18px;
        margin-top: 3px;
        accent-color: var(--primary);
        cursor: pointer;
    }

    .auto-unlock-option strong {
        display: block;
        color: var(--text);
        font-size: 15px;
        margin-bottom: 4px;
    }
.price-row .coin {
    color: var(--primary);
    font-weight: 900;
}

.unlocked-badge {
    display: none;
    width: fit-content;
    margin: 24px auto 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.24);
    font-size: 13px;
    font-weight: 900;
}

/* TRANG DANH SÁCH TRUYỆN */
.page-hero {
    padding: 20px 0 26px;
}
.container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}
.hero-box {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 48px);
    border-radius: 32px;
    border: 1px solid var(--border);
    background: radial-gradient(circle at 78% 22%, rgba(255, 204, 77, 0.22), transparent 26%), radial-gradient(circle at 86% 72%, rgba(139, 92, 246, 0.28), transparent 28%), linear-gradient(135deg, var(--bg-card), var(--bg-soft));
    box-shadow: var(--shadow);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
}
.hero-box::after {
    content: "SEARCH";
    position: absolute;
    right: -30px;
    bottom: 12px;
    font-size: clamp(54px, 12vw, 130px);
    font-weight: 900;
    letter-spacing: 8px;
    color: rgba(255, 255, 255, 0.035);
    pointer-events: none;
}

.kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    border: 1px solid rgba(255, 204, 77, 0.24);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.3px;
}
.page-title {
    margin: 16px 0 12px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -1.6px;
}
.page-desc {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
}
.layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 0 0 56px;
}
.filter-panel {
    position: sticky;
    top: 94px;
    padding: 22px;
}
.panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.panel-title {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.5px;
}
.filter-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.filter-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}
.filter-group {
    padding: 16px 0;
    border-top: 1px solid rgba(127, 127, 127, 0.14);
}
.field, .select-field {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 15px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip:hover, .chip.active {
    background: var(--primary);
    color: #111827;
    border-color: transparent;
}
.chip {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    transition: 0.18s;
}
.check-row {
    display: grid;
    gap: 9px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

    .check-item input {
        accent-color: var(--primary);
    }

.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}
.result-summary {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.5;
}
    .result-summary strong {
        color: var(--primary);
    }

.view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
}
.view-btn {
    width: 38px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
}
    .view-btn.active {
        background: var(--primary);
        color: #111827;
    }

.active-filters.show {
    display: flex;
}
.active-filters {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.active-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    border: 1px solid rgba(255, 204, 77, 0.24);
    font-size: 13px;
    font-weight: 900;
}

.result-list {
    display: grid;
    gap: 14px;
}
.story-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    transition: 0.2s;
}
.story-item .cover {
    width: 96px;
    height: 132px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b, #7c2d12 55%, #f59e0b);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}
    .story-item .cover::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.25), transparent 22%), linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 55%);
    }
    .story-item .cover::after {
        content: attr(data-short);
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 10px;
        color: #fff;
        font-weight: 900;
        font-size: 15px;
        line-height: 1.1;
        text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    }
.story-info {
    min-width: 0;
}
.story-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.type-pill, .status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}
    .type-pill.novel {
        background: rgba(255, 204, 77, 0.15);
        color: var(--primary);
    }
    .status-pill.ongoing {
        background: rgba(34, 197, 94, 0.14);
        color: #86efac;
    }
    .status-pill.completed {
        background: rgba(56, 189, 248, 0.14);
        color: #7dd3fc;
    }
.story-title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}
.story-desc {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}
.story-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 800;
}
    .story-meta strong {
        color: var(--text);
    }

.result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.empty-state {
    display: none;
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}
.story-item:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 204, 77, 0.45);
}
    .empty-state.show {
        display: block;
    }

    .empty-state strong {
        display: block;
        color: var(--text);
        font-size: 22px;
        margin-bottom: 8px;
    }
.type-pill.comic {
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
}

.reader-content, .locked-preview-content {
    padding: clamp(24px, 5vw, 54px);
    font-size: var(--reader-font-size);
    line-height: var(--reader-line-height);
    color: var(--reading-text);
}
.comic-reader br{
    display:none;
}

.search-suggest-box {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
    overflow: hidden;
}

    .search-suggest-box.show {
        display: block;
    }

.suggest-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
    border-radius: 13px;
    color: var(--text);
    transition: 0.18s;
}

    .suggest-item:hover,
    .suggest-item:focus {
        background: var(--bg-soft);
        outline: none;
    }

.suggest-cover {
    width: 44px;
    height: 58px;
    border-radius: 9px;
    overflow: hidden;
    background: linear-gradient(135deg, #30384d, #151823);
    position: relative;
}

    .suggest-cover::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    }

.suggest-content {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 4px;
}

.suggest-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 900;
}

.suggest-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

    .suggest-meta b {
        color: var(--primary);
    }

.suggest-empty {
    padding: 12px 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.suggest-more {
    display: block;
    margin-top: 6px;
    padding: 10px;
    border-top: 1px solid rgba(127,127,127,0.13);
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}


/* TRANG NẠP XU */
.trang_nap_xu .topup-hero {
    padding: 18px 0 26px;
}
.trang_nap_xu .topup-hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: stretch;
    border-radius: 34px;
    border: 1px solid var(--border);
    background: radial-gradient(circle at 76% 22%, rgba(255, 204, 77, 0.24), transparent 26%), radial-gradient(circle at 88% 75%, rgba(34, 197, 94, 0.20), transparent 30%), linear-gradient(135deg, var(--bg-card), var(--bg-soft));
    box-shadow: var(--shadow);
    padding: clamp(24px, 5vw, 38px);
}
.trang_nap_xu .hero-content {
    position: relative;
    z-index: 2;
    padding:0 !important;
}
    .trang_nap_xu .hero-content .badge {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 0 11px;
        border-radius: 999px;
        background: rgba(255, 204, 77, 0.14);
        color: var(--primary);
        border: 1px solid rgba(255, 204, 77, 0.24);
        font-size: 13px;
        font-weight: 900;
    }
    .trang_nap_xu .hero-content h1 {
        margin: 16px 0 12px;
        font-size: clamp(34px, 5vw, 58px);
        line-height: 1.08;
        letter-spacing: -1.6px;
    }
    .trang_nap_xu .hero-content p {
        margin: 0;
        max-width: 700px;
        color: var(--muted);
        line-height: 1.7;
        font-size: 16px;
    }

.trang_nap_xu .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}
.trang_nap_xu .btn-green {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.24);
}

.trang_nap_xu .balance-card {
    position: relative;
    z-index: 2;
    padding: 20px;
    border-radius: 26px;
    background: color-mix(in srgb, var(--bg-card) 74%, transparent);
    border: 1px solid rgba(127, 127, 127, 0.16);
    display: grid;
    gap: 14px;
    align-content: space-between;
}
.trang_nap_xu .balance-top {
    display: grid;
    gap: 8px;
}
    .trang_nap_xu .balance-top span {
        color: var(--muted);
        font-weight: 800;
    }
    .trang_nap_xu .balance-top strong {
        color: var(--primary);
        font-size: 46px;
        letter-spacing: -1.5px;
        line-height: 1;
    }
.trang_nap_xu .balance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.trang_nap_xu .balance-tile {
    padding: 13px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
}
    .trang_nap_xu .balance-tile strong {
        display: block;
        color: var(--text);
        font-size: 19px;
    }
    .trang_nap_xu .balance-tile span {
        display: block;
        margin-top: 6px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }

.topup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
    padding-bottom: 56px;
}
.trang_nap_xu .panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.13);
    padding: 22px;
}
.trang_nap_xu .section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.trang_nap_xu .section-kicker {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
}
.trang_nap_xu .section-title {
    margin: 6px 0 0;
    font-size: 28px;
    letter-spacing: -0.8px;
}
.trang_nap_xu .message-box {
    display: none;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 800;
}

.trang_nap_xu .package-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.trang_nap_xu .package-card {
    position: relative;
    min-height: 190px;
    padding: 18px;
    border-radius: 22px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.14);
    cursor: pointer;
    transition: 0.2s;
    overflow: hidden;
}

    .trang_nap_xu .package-card:hover,
    .trang_nap_xu .package-card.active {
        transform: translateY(-4px);
        border-color: rgba(255, 204, 77, 0.55);
        box-shadow: 0 20px 60px rgba(255, 204, 77, 0.08);
    }

    .trang_nap_xu .package-card.active {
        background: radial-gradient(circle at 80% 10%, rgba(255, 204, 77, 0.18), transparent 32%), var(--bg-soft);
    }

.trang_nap_xu .coin-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff8a00);
    color: #111827;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 14px;
}
.trang_nap_xu .package-card h3 {
    margin: 0 0 8px;
    font-size: 24px;
    letter-spacing: -0.6px;
}
.trang_nap_xu .package-card p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 14px;
    font-weight: 700;
}

.trang_nap_xu .price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
    .trang_nap_xu .price strong {
        color: var(--primary);
        font-size: 22px;
    }

.trang_nap_xu .best-tag {
    background: var(--primary);
    color: #111827;
}
.trang_nap_xu .best-tag, .bonus-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 900;
}
.trang_nap_xu .bonus-tag {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.22);
}
.trang_nap_xu .payment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.trang_nap_xu .payment-card:hover, .payment-card.active {
    transform: translateY(-2px);
    border-color: rgba(255, 204, 77, 0.55);
}
.trang_nap_xu .payment-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.14);
    cursor: pointer;
    transition: 0.2s;
}
.trang_nap_xu .pay-icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: rgba(255, 204, 77, 0.14);
    color: var(--primary);
    font-size: 18px;
    font-weight: 900;
}
.trang_nap_xu .payment-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.trang_nap_xu .payment-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}
.trang_nap_xu .radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid var(--border);
    position: relative;
}
.trang_nap_xu .payment-card.active .radio-dot, .trang_nap_xu .package-card.active .radio-dot {
    border-color: var(--primary);
}
    .trang_nap_xu .payment-card.active .radio-dot::after, .trang_nap_xu .package-card.active .radio-dot::after {
        content: "";
        position: absolute;
        inset: 4px;
        border-radius: 999px;
        background: var(--primary);
    }
.trang_nap_xu .invoice-card {
    overflow: hidden;
}

.trang_nap_xu .invoice-total {
    padding: 18px;
    border-radius: 20px;
    background: radial-gradient(circle at 90% 20%, rgba(255, 204, 77, 0.18), transparent 34%), var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
    margin-bottom: 14px;
}

    .trang_nap_xu .invoice-total span {
        display: block;
        color: var(--muted);
        font-weight: 800;
        margin-bottom: 8px;
    }

    .trang_nap_xu .invoice-total strong {
        display: block;
        color: var(--primary);
        font-size: 34px;
        letter-spacing: -1px;
    }

.trang_nap_xu .summary-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.trang_nap_xu .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
    color: var(--muted);
    font-weight: 800;
}

    .trang_nap_xu .summary-row strong {
        color: var(--text);
        text-align: right;
    }

    .trang_nap_xu .summary-row .coin {
        color: var(--primary);
    }

    .trang_nap_xu .summary-row .green {
        color: #86efac;
    }

.trang_nap_xu body.light-mode .summary-row .green {
    color: #15803d;
}

.trang_nap_xu .warning-box {
    padding: 13px;
    border-radius: 16px;
    background: rgba(255, 204, 77, 0.10);
    border: 1px solid rgba(255, 204, 77, 0.20);
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}


   

.message-box {
    display: none;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 800;
}

    .message-box.show {
        display: block;
    }

    .message-box.success {
        background: rgba(34, 197, 94, 0.14);
        color: #86efac;
        border: 1px solid rgba(34, 197, 94, 0.24);
    }

    .message-box.error {
        background: rgba(239, 68, 68, 0.14);
        color: #fecaca;
        border: 1px solid rgba(239, 68, 68, 0.24);
    }

body.light-mode .message-box.success {
    color: #15803d;
}

body.light-mode .message-box.error {
    color: #b91c1c;
}


.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    padding: 18px;
    align-items: center;
    justify-content: center;
}

    .payment-modal.open {
        display: flex;
    }

.payment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
}

.payment-modal-card {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px;
}

.payment-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

    .payment-modal-head h2 {
        margin: 0 0 7px;
        font-size: 26px;
        letter-spacing: -0.7px;
    }

    .payment-modal-head p {
        margin: 0;
        color: var(--muted);
        font-weight: 700;
        line-height: 1.55;
    }

.modal-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
}

.bank-pay-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 16px;
    align-items: start;
}

.bank-fields {
    display: grid;
    gap: 10px;
}

.bank-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
}

    .bank-field span {
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: .45px;
    }

    .bank-field strong {
        display: block;
        color: var(--text);
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

.copy-btn {
    align-self: center;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 12px;
    border: 1px solid rgba(255, 204, 77, 0.28);
    background: rgba(255, 204, 77, 0.13);
    color: var(--primary);
    cursor: pointer;
    font-weight: 900;
}

.qr-box {
    padding: 12px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(127,127,127,0.16);
    text-align: center;
}

    .qr-box img {
        display: block;
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        border-radius: 12px;
        background: #fff;
    }

    .qr-box small {
        display: block;
        margin-top: 8px;
        color: #4b5563;
        font-weight: 800;
        line-height: 1.35;
    }

.payment-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.payment-note {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.20);
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
    font-weight: 700;
}

.toast-error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border-color: #ef4444;
    color: #fef2f2;
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

    .toast-error::before {
        content: "✕";
        background: #ef4444;
        color: #ffffff;
    }

/* Icon chung */

.toast::before {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 900;
}

@media (max-width: 700px) {
    .trang_nap_xu .package-card p{
        display:none;
    }
    .trang_nap_xu .payment-card p {
        display: none;
    }
    .payment-modal-card {
        border-radius: 22px;
        padding: 16px;
    }

    .bank-pay-layout {
        grid-template-columns: 1fr;
    }

    .qr-box {
        max-width: 260px;
        margin: 0 auto;
    }

    .payment-modal-actions .btn {
        width: 100%;
    }

    .bank-field {
        grid-template-columns: 1fr;
    }

    .copy-btn {
        width: 100%;
    }
}


@media (max-width: 1080px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .topup-hero-card,
    .topup-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 22px, var(--container));
    }

    .header-inner {
        min-height: 66px;
    }

    .logo span:last-child {
        display: none;
    }

    .package-grid,
    .payment-grid {
        grid-template-columns: 1fr;
    }

    .balance-grid {
        grid-template-columns: 1fr;
    }

    .coupon-row {
        grid-template-columns: 1fr;
    }

    .summary-row {
        display: grid;
    }

        .summary-row strong {
            text-align: left;
        }
}
@media (max-width: 1020px) {
    .story-hero-grid, .content-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 720px) {
    .comic-cover-wrap {
        display: block;
    }
}
@media (max-width: 720px) {
    .story-hero {
        border-radius: 24px;
        padding: 22px;
    }
}
@media (max-width: 720px) {
    .story-cover-wrap {
        display: block;
        text-align:center
    }
    .story-cover-wrap .story-cover {
        margin:0 auto;
    }
}
@media (max-width: 1020px) {
    .story-cover-wrap, .sidebar {
        position: static;
    }
}
@media (max-width: 520px) {
    .topup-hero-card {
        border-radius: 24px;
    }

    .hero-actions .btn,
    .invoice-card .btn {
        width: 100%;
    }

    .user-dropdown {
        right: -56px;
    }
}

.member-hero {
    padding: 18px 0 26px;
}
.member-hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: stretch;
    border-radius: 34px;
    border: 1px solid var(--border);
    background: radial-gradient(circle at 76% 22%, rgba(255, 204, 77, 0.22), transparent 26%), radial-gradient(circle at 88% 75%, rgba(139, 92, 246, 0.30), transparent 30%), linear-gradient(135deg, var(--bg-card), var(--bg-soft));
    box-shadow: var(--shadow);
    padding: clamp(24px, 5vw, 38px);
}

.member-profile {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 20px;
    align-items: center;
}
.profile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 34px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff8a00 48%, var(--purple));
    color: #fff;
    font-size: 44px;
    overflow:hidden;
    position:relative;
    font-weight: 900;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}
    .profile-avatar img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-position: center;
        object-fit: cover;
    }
    .profile-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }
.profile-info h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.06;
    letter-spacing: -1.4px;
}
.profile-info p {
    margin: 12px 0 0;
    max-width: 700px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 16px;
}
.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}
.wallet-card {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 12px;
    align-content: space-between;
    padding: 20px;
    border-radius: 26px;
    background: color-mix(in srgb, var(--bg-card) 74%, transparent);
    border: 1px solid rgba(127, 127, 127, 0.16);
}
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.wallet-tile {
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
}
.btn-green {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.24);
}

.wallet-tile strong {
    display: block;
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}
.wallet-tile span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.member-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding-bottom: 56px;
}
.sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 18px;
}
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.13);
    padding: 22px;
}
.side-menu {
    display: grid;
    gap: 8px;
}
.side-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border-radius: 16px;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    cursor: pointer;
    font-weight: 900;
    transition: 0.2s;
    text-align: left;
}
    .side-link:hover, .side-link.active {
        color: #111827;
        background: var(--primary);
        border-color: transparent;
    }

    .side-link b {
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.10);
    }
.library-list {
    display: grid;
    gap: 12px;
}
@media (max-width: 760px) {
    .member-hero{
        display:none;
    }
    .library-item {
        grid-template-columns: 1fr !important;
    }
        .library-item  .cover {
            width: 100% !important;
            height: 240px !important;
        }
        .library-item .item-actions {
            grid-template-columns: 1fr 1fr !important;
        }
    .member-profile {
        grid-template-columns: 1fr;
    }
    .profile-avatar {
        width: 96px;
        height: 96px;
        border-radius: 30px;
    }
    .container {
        width: min(100% - 22px, var(--container));
    }
    .wallet-grid, .library-toolbar, .settings-grid {
        grid-template-columns: 1fr !important;
    }
    .section-head {
        align-items: start;
    }
}
@media (max-width: 1080px) {
    .member-hero-card, .member-layout {
        grid-template-columns: 1fr;
    }
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.setting-card {
    padding: 16px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
}
    .setting-card strong {
        display: block;
        margin-bottom: 8px;
    }
    .setting-card p {
        margin: 0 0 12px;
        color: var(--muted);
        line-height: 1.55;
        font-size: 14px;
    }
.library-search, .library-select {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border-radius: 14px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 800;margin-bottom:10px;
}
.library-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    transition: 0.2s;
}

    .library-item .cover {
        width: 92px;
        height: 124px;
        border-radius: 16px;
        position: relative;
        overflow: hidden;
        background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
    }
    .library-item .cover img {
        
    }
        .library-item  .cover::before {
            content: "";
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.25), transparent 22%), linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 55%);
        }
        .library-item  .cover::after {
            content: "";
            position: absolute;
            left: 9px;
            right: 9px;
            bottom: 9px;
            color: #fff;
            font-weight: 900;
            font-size: 12px;
            line-height: 1.12;
            text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
        }
    .library-item  .item-info {
        min-width: 0;
    }
    .library-item .item-topline {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }
    .library-item .item-info h3 {
        margin: 0 0 7px;
        font-size: 19px;
        line-height: 1.3;
        letter-spacing: -0.2px;
    }
    .library-item .item-info p {
        margin: 0 0 10px;
        color: var(--muted);
        line-height: 1.55;
        font-size: 14px;
    }
    .library-item .item-meta {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        color: var(--muted-2);
        font-size: 13px;
        font-weight: 800;
    }
        .library-item .item-meta strong {
            color: var(--text);
        }
    .library-item .item-actions {
        display: grid;
        gap: 8px;
        min-width: 128px;
    }

.notification-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.notify-filter {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--muted);
    cursor: pointer;
    line-height:38px;   
    font-weight: 900;
    transition: 0.18s;
}
    .notify-filter:hover, .notify-filter.active {
        background: var(--primary);
        color: #111827;
        border-color: transparent;
    }
.notification-list {
    display: grid;
    gap: 10px;
}
.notification-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    transition: 0.2s;
}

    .notification-item.unread {
        border-color: rgba(255, 204, 77, 0.42);
        background: color-mix(in srgb, var(--bg-soft) 82%, var(--primary));
    }
.notify-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
    background: var(--bg-card-2);
}

    .notify-icon.system {
        color: var(--blue);
        background: rgba(56, 189, 248, 0.13);
    }
.item-topline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pill.system {
    background: rgba(56, 189, 248, 0.13);
    color: #7dd3fc;
}
.pill.free {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.notification-body h3 {
    margin: 0 0 7px;
    font-size: 18px;
    line-height: 1.35;
}

.notification-body p {
    margin: 0 0 9px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}
.item-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 800;
}
.pill.topup {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}
.chuongdamua-item {
    display: grid;
    grid-template-columns: 92px minmax(1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    transition: 0.2s;
}
    .chuongdamua-item:hover {
        transform: translateX(4px);
        border-color: rgba(255, 204, 77, 0.45);
    }
    .chuongdamua-item .item-info p {
        margin: 0 0 10px;
        color: var(--muted);
        line-height: 1.55;
        font-size: 14px;
    }
    .chuongdamua-item .item-info h3 {
        
        font-size: 15px;
    }
.text-center {
    text-align: center;
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    font-size: 14px;
    font-weight: 800;
}


<!-- CSS chỉ áp dụng bên trong #trang_chu_truyen_chu -->
<style >
#trang_chu_truyen_chu {
    display: block;
    min-height: 100vh;
    isolation: isolate;
}

#trang_chu_truyen_chu img {
    max-width: 100%;
}

#trang_chu_truyen_chu {
    --bg: #0d0f16;
    --bg-soft: #131722;
    --bg-card: #181d2a;
    --bg-card-2: #202638;
    --border: #2b3245;
    --text: #f4f6fb;
    --muted: #9ca6bd;
    --muted-2: #707b92;
    --primary: #ffcc4d;
    --purple: #8b5cf6;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #38bdf8;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
    --container: 1180px;
}

    body.light-mode #trang_chu_truyen_chu,
    #trang_chu_truyen_chu.light-mode {
        --bg: #f5f7fb;
        --bg-soft: #ffffff;
        --bg-card: #ffffff;
        --bg-card-2: #eef2ff;
        --border: #dde3f0;
        --text: #141824;
        --muted: #5d6677;
        --muted-2: #7d8798;
        --shadow: 0 16px 44px rgba(20, 24, 36, 0.12);
    }

    #trang_chu_truyen_chu,
    #trang_chu_truyen_chu * {
        box-sizing: border-box;
    }

#trang_chu_truyen_chu {
    margin: 0;
    font-family: "Roboto", Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top left, rgba(255, 204, 77, 0.12), transparent 28%), radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent 32%), radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.08), transparent 26%), var(--bg);
    color: var(--text);
}

    #trang_chu_truyen_chu a {
        color: inherit;
        text-decoration: none;
    }

    #trang_chu_truyen_chu button,
    #trang_chu_truyen_chu input,
    #trang_chu_truyen_chu select {
        font-family: inherit;
    }

    #trang_chu_truyen_chu .container {
        width: min(var(--container), calc(100% - 32px));
        margin: 0 auto;
    }

    #trang_chu_truyen_chu .main-nav a.active {
        color: var(--primary);
    }

    #trang_chu_truyen_chu .novel-hero {
        padding: 28px 0 24px;
    }

    #trang_chu_truyen_chu .badge {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 0 11px;
        border-radius: 999px;
        background: rgba(255, 204, 77, 0.14);
        color: var(--primary);
        border: 1px solid rgba(255, 204, 77, 0.24);
        font-size: 13px;
        font-weight: 900;
    }

        #trang_chu_truyen_chu .badge.green {
            background: rgba(34, 197, 94, 0.14);
            color: #86efac;
            border-color: rgba(34, 197, 94, 0.24);
        }

        #trang_chu_truyen_chu .badge.purple {
            background: rgba(139, 92, 246, 0.16);
            color: #c4b5fd;
            border-color: rgba(139, 92, 246, 0.24);
        }

    body.light-mode #trang_chu_truyen_chu .badge.green,
    #trang_chu_truyen_chu.light-mode .badge.green {
        color: #15803d;
    }

    body.light-mode #trang_chu_truyen_chu .badge.purple,
    #trang_chu_truyen_chu.light-mode .badge.purple {
        color: #6d28d9;
    }

    #trang_chu_truyen_chu .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 46px;
        padding: 0 16px;
        border-radius: 15px;
        border: 1px solid var(--border);
        background: var(--bg-soft);
        color: var(--text);
        cursor: pointer;
        font-weight: 900;
        transition: 0.2s;
        font-size: 14px;
    }

        #trang_chu_truyen_chu .btn:hover {
            transform: translateY(-2px);
        }

    #trang_chu_truyen_chu .btn-primary {
        background: var(--primary);
        color: #111827;
        border-color: transparent;
    }

    #trang_chu_truyen_chu .quick-genres {
        padding-bottom: 26px;
    }

    #trang_chu_truyen_chu .genre-grid {
        display: grid;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 12px;
    }

    #trang_chu_truyen_chu .genre-card {
        min-height: 92px;
        padding: 14px;
        border-radius: 20px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        box-shadow: 0 12px 34px rgba(0,0,0,0.10);
        transition: 0.2s;
    }

        #trang_chu_truyen_chu .genre-card:hover {
            transform: translateY(-4px);
            border-color: rgba(255, 204, 77, 0.45);
        }

        #trang_chu_truyen_chu .genre-card strong {
            display: block;
            margin-bottom: 6px;
            font-size: 15px;
        }

        #trang_chu_truyen_chu .genre-card span {
            color: var(--muted);
            font-size: 12px;
            font-weight: 800;
        }

    #trang_chu_truyen_chu .content-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 24px;
        align-items: start;
        padding-bottom: 56px;
    }

    #trang_chu_truyen_chu .panel {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 26px;
        box-shadow: 0 15px 45px rgba(0,0,0,0.13);
        padding: 22px;
    }

       

    #trang_chu_truyen_chu .section-head {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 18px;
    }

    #trang_chu_truyen_chu .section-kicker {
        color: var(--primary);
        text-transform: uppercase;
        font-size: 13px;
        font-weight: 900;
        letter-spacing: 1px;
    }

    #trang_chu_truyen_chu .section-title {
        margin: 6px 0;
        font-size: 28px;
        letter-spacing: -0.8px;
    }

    #trang_chu_truyen_chu .tabs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        padding: 8px;
        border-radius: 18px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        margin-bottom: 18px;
    }

    #trang_chu_truyen_chu .tab-btn,
    #trang_chu_truyen_chu .chip-btn {
        min-height: 40px;
        padding: 0 15px;
        border-radius: 999px;
        border: 1px solid transparent;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        font-weight: 900;
        transition: 0.2s;
    }

    #trang_chu_truyen_chu .chip-btn {
        border-color: var(--border);
        background: var(--bg-soft);
    }

        #trang_chu_truyen_chu .tab-btn.active,
        #trang_chu_truyen_chu .tab-btn:hover,
        #trang_chu_truyen_chu .chip-btn.active,
        #trang_chu_truyen_chu .chip-btn:hover {
            background: var(--primary);
            color: #111827;
            border-color: transparent;
        }

    .novel-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }

    .novel-card {

        border-radius: 20px;
       
        transition: 0.2s;
    }

        .novel-card:hover {
            transform: translateY(-4px);
            border-color: rgba(255, 204, 77, 0.45);
        }

        .novel-card .cover {
            width: 100%;
            height: 230px;
            border-radius: 16px;
            position: relative;
            display: block;
            overflow: hidden;
            background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
            box-shadow: 0 12px 24px rgba(0,0,0,0.16);
            margin-bottom: 12px;
        }

            .novel-card .cover.small {
                width: 72px;
                height: 98px !important;
                margin-bottom: 0;
                flex: 0 0 auto;
            }

            .novel-card .cover::before {
                content: "";
                position: absolute;
                inset: 0;
                background: radial-gradient(circle at 50% 22%, rgba(255,255,255,0.25), transparent 22%), linear-gradient(to top, rgba(0,0,0,0.72), transparent 55%);
            }

            .novel-card .cover::after {
                content: attr(data-short);
                position: absolute;
                left: 9px;
                right: 9px;
                bottom: 9px;
                color: #fff;
                font-weight: 900;
                font-size: 12px;
                line-height: 1.12;
                text-shadow: 0 6px 18px rgba(0,0,0,0.45);
            }

    #trang_chu_truyen_chu .tone-1 {
        background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
    }

    #trang_chu_truyen_chu .tone-2 {
        background: linear-gradient(135deg, #052e16, #14532d 55%, #86efac);
    }

    #trang_chu_truyen_chu .tone-3 {
        background: linear-gradient(135deg, #312e81, #581c87 55%, #f0abfc);
    }

    #trang_chu_truyen_chu .tone-4 {
        background: linear-gradient(135deg, #020617, #334155 55%, #94a3b8);
    }

    #trang_chu_truyen_chu .tone-5 {
        background: linear-gradient(135deg, #020617, #1e3a8a 55%, #38bdf8);
    }

    #trang_chu_truyen_chu .tone-6 {
        background: linear-gradient(135deg, #450a0a, #7f1d1d 55%, #f97316);
    }

    .novel-card h3 {
        margin: 0 0 7px;
        font-size: 16px;
        line-height: 1.35;
    }

        .novel-card h3 a:hover,
        .update-row a:hover,
        .rank-row h4 a:hover {
            color: var(--primary);
        }

    .novel-card p {
        margin: 0;
        color: var(--muted);
        font-size: 13px;
        line-height: 1.45;
        font-weight: 700;
    }

    .novel-meta {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 10px;
        color: var(--muted-2);
        font-size: 12px;
        font-weight: 800;
    }

    #trang_chu_truyen_chu .pill {
        display: inline-flex;
        align-items: center;
        min-height: 24px;
        padding: 0 8px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 900;
    }

        #trang_chu_truyen_chu .pill.vip {
            background: rgba(239,68,68,0.14);
            color: #fecaca;
        }

        #trang_chu_truyen_chu .pill.free {
            background: rgba(34,197,94,0.14);
            color: #86efac;
        }

        #trang_chu_truyen_chu .pill.hot {
            background: rgba(255,204,77,0.14);
            color: var(--primary);
        }

    body.light-mode #trang_chu_truyen_chu .pill.vip,
    #trang_chu_truyen_chu.light-mode .pill.vip {
        color: #b91c1c;
    }

    body.light-mode #trang_chu_truyen_chu .pill.free,
    #trang_chu_truyen_chu.light-mode .pill.free {
        color: #15803d;
    }

    #trang_chu_truyen_chu .update-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 170px;
        gap: 12px;
        margin-bottom: 16px;
    }

    #trang_chu_truyen_chu .field,
    #trang_chu_truyen_chu .select {
        width: 100%;
        min-height: 44px;
        padding: 0 13px;
        border-radius: 14px;
        border: 1px solid var(--border);
        outline: none;
        background: var(--bg-soft);
        color: var(--text);
        font-size: 14px;
        font-weight: 800;
        transition: 0.2s;
    }

        #trang_chu_truyen_chu .field:focus,
        #trang_chu_truyen_chu .select:focus {
            border-color: rgba(255, 204, 77, 0.65);
            box-shadow: 0 0 0 4px rgba(255, 204, 77, 0.10);
        }

    #trang_chu_truyen_chu .update-list {
        display: grid;
        gap: 10px;
    }

    #trang_chu_truyen_chu .update-row {
        display: grid;
        grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        padding: 13px;
        border-radius: 16px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        color: var(--muted);
        font-weight: 800;
        transition: 0.2s;
    }

        #trang_chu_truyen_chu .update-row:hover {
            border-color: rgba(255, 204, 77, 0.45);
            transform: translateX(4px);
        }

        #trang_chu_truyen_chu .update-row a {
            color: var(--text);
            font-weight: 900;
            line-height: 1.35;
        }

        #trang_chu_truyen_chu .update-row b {
            color: var(--primary);
            overflow: hidden;
            text-overflow: ellipsis;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            white-space: normal;
            display: -webkit-box;
        }

        #trang_chu_truyen_chu .update-row small {
            color: var(--muted-2);
            font-weight: 800;
            white-space: nowrap;
           
        }

    #trang_chu_truyen_chu .sidebar {
        display: grid;
        gap: 24px;
        position: sticky;
        top: 96px;
    }

    #trang_chu_truyen_chu .rank-tabs {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 14px;
    }

    #trang_chu_truyen_chu .rank-list {
        display: grid;
        gap: 10px;
    }

    #trang_chu_truyen_chu .rank-row {
        display: grid;
        grid-template-columns: 34px 1fr auto;
        gap: 10px;
        align-items: center;
        padding: 11px;
        border-radius: 16px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
    }

    #trang_chu_truyen_chu .rank-no {
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border-radius: 10px;
        background: rgba(255, 204, 77, 0.14);
        color: var(--primary);
        font-weight: 900;
    }

    #trang_chu_truyen_chu .rank-row h4 {
        margin: 0 0 4px;
        font-size: 14px;
        line-height: 1.3;
    }

    #trang_chu_truyen_chu .rank-row p {
        margin: 0;
        color: var(--muted-2);
        font-size: 12px;
        font-weight: 700;
    }

    #trang_chu_truyen_chu .rank-row span:last-child {
        color: var(--primary);
        font-weight: 900;
        font-size: 13px;
        white-space: nowrap;
    }

    #trang_chu_truyen_chu .continue-row {
        display: grid;
        grid-template-columns: 72px 1fr;
        gap: 12px;
        align-items: center;
        padding: 12px;
        border-radius: 16px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        margin-bottom: 10px;
    }

        #trang_chu_truyen_chu .continue-row h4 {
            margin: 0 0 6px;
            font-size: 15px;
            line-height: 1.35;
        }
        #trang_chu_truyen_chu .continue-row .cover {
            width: 72px;
            height: 98px;
            margin-bottom: 0;
            flex: 0 0 auto;
        }
        #trang_chu_truyen_chu .continue-row p {
            margin: 0 0 9px;
            color: var(--muted);
            font-size: 12px;
            font-weight: 700;
        }
#pagertruyen #pagination{
    margin:0 auto;
}

#trang_chu_truyen_chu .progress-line {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-card-2);
}

    #trang_chu_truyen_chu .progress-fill {
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--primary), #ff8a00);
    }

    #trang_chu_truyen_chu .tag-cloud {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

        #trang_chu_truyen_chu .tag-cloud a {
            padding: 9px 11px;
            border-radius: 999px;
            background: var(--bg-soft);
            color: var(--muted);
            border: 1px solid rgba(127,127,127,0.12);
            font-size: 13px;
            font-weight: 900;
            transition: 0.2s;
        }

            #trang_chu_truyen_chu .tag-cloud a:hover {
                background: var(--primary);
                color: #111827;
                border-color: transparent;
            }

@media (max-width: 1120px) {
    #trang_chu_truyen_chu .content-layout {
        grid-template-columns: 1fr;
    }

    #trang_chu_truyen_chu .sidebar {
        position: static;
    }

    #trang_chu_truyen_chu .genre-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

     .novel-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    #trang_chu_truyen_chu .container {
        width: min(100% - 22px, var(--container));
    }

    #trang_chu_truyen_chu .genre-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

     .novel-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #trang_chu_truyen_chu .update-toolbar {
        grid-template-columns: 1fr;
    }

    #trang_chu_truyen_chu .update-row {
        grid-template-columns: 1fr;
    }

        #trang_chu_truyen_chu .update-row b,
        #trang_chu_truyen_chu .update-row small {
            white-space: normal;
        }
}

@media (max-width: 520px) {
    #trang_chu_truyen_chu .hero-actions .btn {
        width: 100%;
    }

    #trang_chu_truyen_chu .genre-grid {
        grid-template-columns: 1fr;
    }

    .novel-card .cover {
        
    }
}

#trang_chu_truyen_chu .hot-gallery {
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 34px;
    background: radial-gradient(circle at 5% 0%, rgba(255, 204, 77, 0.12), transparent 28%), radial-gradient(circle at 95% 100%, rgba(139, 92, 246, 0.14), transparent 32%), var(--bg-card);
    box-shadow: var(--shadow);
}

#trang_chu_truyen_chu .hot-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

#trang_chu_truyen_chu .hot-gallery-heading {
    min-width: 0;
}

    #trang_chu_truyen_chu .hot-gallery-heading h1 {
        margin: 10px 0 6px;
        font-size: clamp(28px, 4vw, 42px);
        line-height: 1.08;
        letter-spacing: -1.2px;
    }

    #trang_chu_truyen_chu .hot-gallery-heading p {
        margin: 0;
        color: var(--muted);
        font-size: 14px;
        font-weight: 700;
        line-height: 1.6;
    }

#trang_chu_truyen_chu .hot-gallery-controls {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

#trang_chu_truyen_chu .gallery-arrow {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    transition: 0.2s;
}

    #trang_chu_truyen_chu .gallery-arrow:hover {
        color: #111827;
        background: var(--primary);
        border-color: transparent;
        transform: translateY(-2px);
    }

#trang_chu_truyen_chu .hot-gallery-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    min-height: 462px;
}

#trang_chu_truyen_chu .hot-main {
    position: relative;
    min-height: 462px;
    overflow: hidden;
    border-radius: 28px;
    isolation: isolate;
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.25s ease;
}

    #trang_chu_truyen_chu .hot-main::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(90deg, rgba(7, 10, 18, 0.97) 0%, rgba(7, 10, 18, 0.88) 48%, rgba(7, 10, 18, 0.32) 100%), radial-gradient(circle at 82% 22%, rgba(255,255,255,0.24), transparent 24%);
    }

body.light-mode #trang_chu_truyen_chu .hot-main::before,
#trang_chu_truyen_chu.light-mode .hot-main::before {
    background: linear-gradient(90deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.88) 50%, rgba(255,255,255,0.30) 100%), radial-gradient(circle at 82% 22%, rgba(255,255,255,0.35), transparent 24%);
}

#trang_chu_truyen_chu .hot-main-inner {
    min-height: 462px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 30px;
}

#trang_chu_truyen_chu .hot-book-cover {
    position: relative;
    width: 210px;
    height: 310px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 24px 60px rgba(0,0,0,0.34);
    transform: rotate(-1.5deg);
}

    #trang_chu_truyen_chu .hot-book-cover::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 50% 18%, rgba(255,255,255,0.30), transparent 22%), linear-gradient(to top, rgba(0,0,0,0.84), rgba(0,0,0,0.06) 68%);
    }

    #trang_chu_truyen_chu .hot-book-cover::after {
        content: attr(data-short);
        position: absolute;
        left: 18px;
        right: 18px;
        bottom: 18px;
        color: #fff;
        font-size: 25px;
        line-height: 1.08;
        font-weight: 900;
        text-shadow: 0 8px 24px rgba(0,0,0,0.52);
    }

#trang_chu_truyen_chu .hot-main-content {
    min-width: 0;
    max-width: 650px;
}

#trang_chu_truyen_chu .hot-main-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

#trang_chu_truyen_chu .hot-main-content h2 {
    margin: 0;
    font-size: clamp(32px, 4.3vw, 54px);
    line-height: 1.05;
    letter-spacing: -1.7px;
}

#trang_chu_truyen_chu .hot-main-content > p {
    display: -webkit-box;
    margin: 16px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

#trang_chu_truyen_chu .hot-main-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

    #trang_chu_truyen_chu .hot-main-meta strong {
        color: var(--text);
    }

#trang_chu_truyen_chu .hot-main-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

#trang_chu_truyen_chu .hot-thumbs {
    display: grid;
    gap: 10px;
    align-content: stretch;
}

#trang_chu_truyen_chu .hot-thumb {
    width: 100%;
    min-height: 102px;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(127,127,127,0.15);
    border-radius: 18px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
}

    #trang_chu_truyen_chu .hot-thumb:hover {
        transform: translateX(-3px);
        border-color: rgba(255, 204, 77, 0.46);
    }

    #trang_chu_truyen_chu .hot-thumb.active {
        border-color: var(--primary);
        box-shadow: inset 0 0 0 1px var(--primary), 0 12px 30px rgba(0,0,0,0.12);
        background: color-mix(in srgb, var(--primary) 8%, var(--bg-soft));
    }

#trang_chu_truyen_chu .hot-thumb-cover {
    position: relative;
    width: 66px;
    height: 82px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

    #trang_chu_truyen_chu .hot-thumb-cover::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.72), transparent 62%);
    }

#trang_chu_truyen_chu .hot-thumb-copy {
    min-width: 0;
}

    #trang_chu_truyen_chu .hot-thumb-copy strong {
        display: -webkit-box;
        overflow: hidden;
        font-size: 14px;
        line-height: 1.34;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    #trang_chu_truyen_chu .hot-thumb-copy span {
        display: block;
        margin-top: 7px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }

#trang_chu_truyen_chu .hot-gallery-progress {
    height: 3px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-card-2);
}

    #trang_chu_truyen_chu .hot-gallery-progress span {
        display: block;
        width: 0;
        height: 100%;
        border-radius: inherit;
        background: var(--primary);
        animation: hotGalleryProgress 6s linear forwards;
    }

@keyframes hotGalleryProgress {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@media (max-width: 1120px) {
    #trang_chu_truyen_chu .hot-gallery-body {
        grid-template-columns: 1fr;
    }

    #trang_chu_truyen_chu .hot-thumbs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    #trang_chu_truyen_chu .hot-gallery {
        padding: 14px;
        border-radius: 24px;
    }

    #trang_chu_truyen_chu .hot-gallery-head {
        align-items: flex-end;
    }

    #trang_chu_truyen_chu .hot-gallery-heading p {
        display: none;
    }
    .novel-card .cover {
        min-height: unset !important;
        height: auto !important;
        padding-bottom: 150%;
        overflow: hidden;
    }
    #trang_chu_truyen_chu .hot-main,
    #trang_chu_truyen_chu .hot-main-inner {
        min-height: 410px;
    }

    #trang_chu_truyen_chu .hot-main-inner {
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 18px;
        padding: 22px;
    }

    #trang_chu_truyen_chu .hot-book-cover {
        width: 150px;
        height: 224px;
        border-radius: 17px;
    }

        #trang_chu_truyen_chu .hot-book-cover::after {
            left: 12px;
            right: 12px;
            bottom: 13px;
            font-size: 18px;
        }
    #trang_chu_truyen_chu .gallery-content {
        height:auto !important;
    }
    #trang_chu_truyen_chu .hot-main-content h2 {
        font-size: 31px;
    }

    #trang_chu_truyen_chu .hot-main-content > p {
        -webkit-line-clamp: 2;
    }
  
}
.gallery-content{
    height:450px;
    overflow:hidden;
    position:relative;
}
#trang_chu_truyen_chu .tab-panel {
    display: none;
}

    #trang_chu_truyen_chu .tab-panel.active {
        display: block !important;
    }
    .owl-carousel .owl-nav,
    .owl-carousel .owl-dots {
        display: none !important;
    }
@media (max-width: 580px) {
    #trang_chu_truyen_chu .hot-gallery-head {
        align-items: center;
    }

    #trang_chu_truyen_chu .hot-gallery-heading h1 {
        font-size: 25px;
    }

    #trang_chu_truyen_chu .gallery-arrow {
        width: 40px;
        height: 40px;
    }

    #trang_chu_truyen_chu .hot-main,
    #trang_chu_truyen_chu .hot-main-inner {
        min-height: auto;
    }

    #trang_chu_truyen_chu .hot-main-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 22px 18px 24px;
        text-align: center;
    }

    #trang_chu_truyen_chu .hot-book-cover {
        width: 142px;
        height: 210px;
    }

    #trang_chu_truyen_chu .hot-main-badges,
    #trang_chu_truyen_chu .hot-main-meta,
    #trang_chu_truyen_chu .hot-main-actions {
        justify-content: center;
    }

    #trang_chu_truyen_chu .hot-main-content h2 {
        font-size: 29px;
    }

    #trang_chu_truyen_chu .hot-main-content > p {
        font-size: 14px;
    }

    #trang_chu_truyen_chu .hot-main-actions .btn {
        flex: 1 1 140px;
    }

    #trang_chu_truyen_chu .hot-thumbs {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: 82%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

        #trang_chu_truyen_chu .hot-thumbs::-webkit-scrollbar {
            display: none;
        }

    #trang_chu_truyen_chu .hot-thumb:hover {
        transform: none;
    }
}

#trang_bxh {
    --bg: #0d0f16;
    --bg-soft: #131722;
    --bg-card: #181d2a;
    --bg-card-2: #202638;
    --border: #2b3245;
    --text: #f4f6fb;
    --muted: #9ca6bd;
    --muted-2: #707b92;
    --primary: #ffcc4d;
    --purple: #8b5cf6;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #38bdf8;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
    --container: 1180px;
    width: 100%;
    min-height: 100vh;
    font-family: "Roboto", Arial, Helvetica, sans-serif;
    color: var(--text);
    background: radial-gradient( circle at top left, rgba(255, 204, 77, 0.12), transparent 28% ), radial-gradient( circle at top right, rgba(139, 92, 246, 0.16), transparent 32% ), var(--bg);
}

    #trang_bxh.light-mode {
        --bg: #f5f7fb;
        --bg-soft: #ffffff;
        --bg-card: #ffffff;
        --bg-card-2: #eef2ff;
        --border: #dde3f0;
        --text: #141824;
        --muted: #5d6677;
        --muted-2: #7d8798;
        --shadow: 0 16px 44px rgba(20, 24, 36, 0.12);
    }

    #trang_bxh,
    #trang_bxh *,
    #trang_bxh *::before,
    #trang_bxh *::after {
        box-sizing: border-box;
    }

        #trang_bxh a {
            color: inherit;
            text-decoration: none;
        }

        #trang_bxh button,
        #trang_bxh input,
        #trang_bxh select {
            font-family: inherit;
        }

        #trang_bxh button,
        #trang_bxh select {
            cursor: pointer;
        }

        #trang_bxh .container {
            width: min(var(--container), calc(100% - 32px));
            margin-right: auto;
            margin-left: auto;
        }

        /* Breadcrumb */

        #trang_bxh .breadcrumb {
            padding: 22px 0 18px;
            color: var(--muted);
            font-size: 14px;
            font-weight: 700;
        }

            #trang_bxh .breadcrumb a {
                transition: color 0.2s;
            }

                #trang_bxh .breadcrumb a:hover {
                    color: var(--primary);
                }

        /* Layout chính */

        #trang_bxh .rank-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 340px;
            gap: 24px;
            align-items: start;
            padding: 0 0 56px;
        }

        #trang_bxh .main-column {
            min-width: 0;
        }

        #trang_bxh .panel {
            padding: 22px;
            border: 1px solid var(--border);
            border-radius: 26px;
            background: var(--bg-card);
            box-shadow: 0 15px 45px rgba(0, 0, 0, 0.13);
        }

           

        /* Tiêu đề section */

        #trang_bxh .section-head {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 18px;
        }

        #trang_bxh .section-kicker {
            color: var(--primary);
            font-size: 13px;
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        #trang_bxh .section-title {
            margin: 6px 0 0;
            color: var(--text);
            font-size: 28px;
            line-height: 1.25;
            letter-spacing: -0.8px;
        }

        /* Bộ lọc */

        #trang_bxh .rank-filter-panel {
            margin-bottom: 24px;
        }

        #trang_bxh .rank-tabs,
        #trang_bxh .chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 14px;
        }

            #trang_bxh .rank-tabs:last-child,
            #trang_bxh .chip-row:last-child {
                margin-bottom: 0;
            }

        #trang_bxh .tab-btn,
        #trang_bxh .chip-btn {
            min-height: 40px;
            padding: 0 15px;
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--muted);
            background: var(--bg-soft);
            font-size: 14px;
            font-weight: 900;
            transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
        }

            #trang_bxh .tab-btn:hover,
            #trang_bxh .chip-btn:hover {
                transform: translateY(-1px);
            }

            #trang_bxh .tab-btn.active,
            #trang_bxh .tab-btn:hover,
            #trang_bxh .chip-btn.active,
            #trang_bxh .chip-btn:hover {
                border-color: transparent;
                color: #111827;
                background: var(--primary);
            }

        /* Top 3 */

        #trang_bxh .podium {
            display: grid;
            grid-template-columns: 1fr 1.16fr 1fr;
            gap: 14px;
            align-items: end;
            margin-bottom: 24px;
        }

        #trang_bxh .podium-card {
            position: relative;
            min-width: 0;
            min-height: 300px;
            padding: 18px;
            overflow: hidden;
            border: 1px solid rgba(127, 127, 127, 0.14);
            border-radius: 24px;
            background: radial-gradient( circle at 50% 0%, rgba(255, 204, 77, 0.16), transparent 30% ), var(--bg-soft);
            text-align: center;
            transition: transform 0.2s, border-color 0.2s;
        }

            #trang_bxh .podium-card:hover {
                transform: translateY(-4px);
            }

            #trang_bxh .podium-card.top-1 {
                min-height: 350px;
                border-color: rgba(255, 204, 77, 0.35);
                box-shadow: 0 20px 60px rgba(255, 204, 77, 0.12);
            }

        #trang_bxh .rank-crown {
            display: inline-grid;
            place-items: center;
            width: 44px;
            height: 44px;
            margin-bottom: 12px;
            border-radius: 16px;
            color: #111827;
            background: linear-gradient(135deg, var(--primary), #ff8a00);
            font-size: 22px;
            font-weight: 900;
        }

        #trang_bxh .podium-cover {
            position: relative;
            display: block;
            width: 110px;
            height: 150px;
            margin: 0 auto 14px;
            overflow: hidden;
            border-radius: 17px;
            background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
        }

        #trang_bxh .top-1 .podium-cover {
            width: 128px;
            height: 172px;
        }

        #trang_bxh .podium-cover::before {
            position: absolute;
            inset: 0;
            content: "";
            background: radial-gradient( circle at 50% 22%, rgba(255, 255, 255, 0.25), transparent 22% ), linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 55%);
        }

        #trang_bxh .podium-cover::after {
            position: absolute;
            right: 10px;
            bottom: 10px;
            left: 10px;
            content: attr(data-short);
            color: #fff;
            font-size: 14px;
            font-weight: 900;
            line-height: 1.1;
            text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
        }

        #trang_bxh .tone-1 {
            background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
        }

        #trang_bxh .tone-2 {
            background: linear-gradient(135deg, #020617, #581c87 55%, #ef4444);
        }

        #trang_bxh .tone-3 {
            background: linear-gradient(135deg, #052e16, #14532d 55%, #86efac);
        }

        #trang_bxh .tone-4 {
            background: linear-gradient(135deg, #312e81, #581c87 55%, #f0abfc);
        }

        #trang_bxh .tone-5 {
            background: linear-gradient(135deg, #020617, #334155 55%, #94a3b8);
        }

        #trang_bxh .tone-6 {
            background: linear-gradient(135deg, #0f172a, #075985 55%, #22c55e);
        }

        #trang_bxh .podium-card h3 {
            display: -webkit-box;
            margin: 0 0 8px;
            overflow: hidden;
            color: var(--text);
            font-size: 17px;
            line-height: 1.3;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

            #trang_bxh .podium-card h3 a {
                transition: color 0.2s;
            }

                #trang_bxh .podium-card h3 a:hover {
                    color: var(--primary);
                }

        #trang_bxh .podium-card p {
            display: -webkit-box;
            margin: 0;
            overflow: hidden;
            color: var(--muted);
            font-size: 13px;
            font-weight: 700;
            line-height: 1.45;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

        #trang_bxh .podium-score {
            display: inline-flex;
            align-items: center;
            min-height: 30px;
            margin-top: 12px;
            padding: 0 10px;
            border-radius: 999px;
            color: var(--primary);
            background: rgba(255, 204, 77, 0.14);
            font-size: 13px;
            font-weight: 900;
        }

        /* Thanh sắp xếp */

        #trang_bxh .rank-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 16px;
        }

        #trang_bxh .rank-summary {
            color: var(--muted);
            font-weight: 800;
            line-height: 1.5;
        }

            #trang_bxh .rank-summary strong {
                color: var(--primary);
            }

        #trang_bxh .sort-select {
            height: 42px;
            padding: 0 36px 0 12px;
            border: 1px solid var(--border);
            border-radius: 14px;
            outline: none;
            color: var(--text);
            background: var(--bg-soft);
            font-weight: 800;
        }

        /* Danh sách bảng xếp hạng */

        #trang_bxh .rank-list {
            display: grid;
            gap: 12px;
        }

        #trang_bxh .rank-item {
            display: grid;
            grid-template-columns: 58px 76px minmax(0, 1fr) auto;
            gap: 14px;
            align-items: center;
            padding: 14px;
            border: 1px solid rgba(127, 127, 127, 0.12);
            border-radius: 20px;
            background: var(--bg-soft);
            transition: transform 0.2s, border-color 0.2s;
        }

            #trang_bxh .rank-item:hover {
                transform: translateX(4px);
                border-color: rgba(255, 204, 77, 0.45);
            }

        #trang_bxh .rank-number {
            display: grid;
            place-items: center;
            width: 48px;
            height: 48px;
            border: 1px solid rgba(127, 127, 127, 0.14);
            border-radius: 16px;
            color: var(--muted);
            background: var(--bg-card);
            font-size: 20px;
            font-weight: 900;
        }

            #trang_bxh .rank-number.gold {
                border-color: transparent;
                color: #111827;
                background: linear-gradient(135deg, var(--primary), #ff8a00);
            }

            #trang_bxh .rank-number.silver {
                border-color: transparent;
                color: #111827;
                background: linear-gradient(135deg, #e5e7eb, #94a3b8);
            }

            #trang_bxh .rank-number.bronze {
                border-color: transparent;
                color: #fff;
                background: linear-gradient(135deg, #f97316, #92400e);
            }

        #trang_bxh .rank-cover {
            position: relative;
            display: block;
            width: 76px;
            height: 102px;
            overflow: hidden;
            border-radius: 14px;
            background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
        }

            #trang_bxh .rank-cover::before {
                position: absolute;
                inset: 0;
                content: "";
                background: radial-gradient( circle at 50% 22%, rgba(255, 255, 255, 0.25), transparent 22% ), linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 55%);
            }

            #trang_bxh .rank-cover::after {
                position: absolute;
                right: 8px;
                bottom: 8px;
                left: 8px;
                content: attr(data-short);
                color: #fff;
                font-size: 12px;
                font-weight: 900;
                line-height: 1.1;
                text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
            }

        #trang_bxh .rank-info {
            min-width: 0;
        }

        #trang_bxh .rank-topline {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 8px;
        }

        #trang_bxh .type-pill,
        #trang_bxh .status-pill {
            display: inline-flex;
            align-items: center;
            min-height: 26px;
            padding: 0 9px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 900;
        }

            #trang_bxh .type-pill.novel {
                color: var(--primary);
                background: rgba(255, 204, 77, 0.15);
            }

            #trang_bxh .type-pill.comic {
                color: #c4b5fd;
                background: rgba(139, 92, 246, 0.16);
            }

        #trang_bxh.light-mode .type-pill.comic {
            color: #6d28d9;
        }

        #trang_bxh .status-pill.ongoing {
            color: #86efac;
            background: rgba(34, 197, 94, 0.14);
        }

        #trang_bxh .status-pill.completed {
            color: #7dd3fc;
            background: rgba(56, 189, 248, 0.14);
        }

        #trang_bxh.light-mode .status-pill.ongoing {
            color: #15803d;
        }

        #trang_bxh.light-mode .status-pill.completed {
            color: #0369a1;
        }

        #trang_bxh .rank-info h3 {
            display: -webkit-box;
            margin: 0 0 7px;
            overflow: hidden;
            color: var(--text);
            font-size: 19px;
            line-height: 1.3;
            letter-spacing: -0.25px;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

            #trang_bxh .rank-info h3 a {
                transition: color 0.2s;
            }

                #trang_bxh .rank-info h3 a:hover {
                    color: var(--primary);
                }

        #trang_bxh .rank-desc {
            display: -webkit-box;
            margin: 0 0 10px;
            overflow: hidden;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.55;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

        #trang_bxh .rank-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px 12px;
            color: var(--muted-2);
            font-size: 13px;
            font-weight: 800;
        }

            #trang_bxh .rank-meta strong {
                color: var(--text);
            }

        #trang_bxh .rank-action {
            display: grid;
            gap: 8px;
            min-width: 128px;
        }

        #trang_bxh .trend {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 32px;
            padding: 0 10px;
            border-radius: 999px;
            color: #86efac;
            background: rgba(34, 197, 94, 0.14);
            font-size: 13px;
            font-weight: 900;
        }

            #trang_bxh .trend.down {
                color: #fecaca;
                background: rgba(239, 68, 68, 0.14);
            }

            #trang_bxh .trend.same {
                color: #cbd5e1;
                background: rgba(148, 163, 184, 0.14);
            }

        #trang_bxh.light-mode .trend {
            color: #15803d;
        }

            #trang_bxh.light-mode .trend.down {
                color: #b91c1c;
            }

            #trang_bxh.light-mode .trend.same {
                color: #475569;
            }

        /* Nút đọc ngay */

        #trang_bxh .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 38px;
            padding: 0 14px;
            border: 1px solid transparent;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 900;
            text-align: center;
            transition: transform 0.2s, filter 0.2s;
        }

            #trang_bxh .btn:hover {
                transform: translateY(-1px);
                filter: brightness(1.05);
            }

        #trang_bxh .btn-primary {
            color: #111827;
            background: var(--primary);
        }

        /* Sidebar */

        #trang_bxh .sidebar {
            position: sticky;
            top: 96px;
            display: grid;
            gap: 24px;
        }

            #trang_bxh .sidebar .panel + .panel {
                margin-top: 0;
            }

        #trang_bxh .side-list {
            display: grid;
            gap: 10px;
            margin-top: 18px;
        }

        #trang_bxh .side-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px;
            border: 1px solid rgba(127, 127, 127, 0.12);
            border-radius: 16px;
            color: var(--muted);
            background: var(--bg-soft);
            font-weight: 800;
        }

            #trang_bxh .side-row span {
                min-width: 0;
            }

            #trang_bxh .side-row strong {
                flex-shrink: 0;
                color: var(--text);
            }

        #trang_bxh .mini-rank {
            display: grid;
            grid-template-columns: 34px minmax(0, 1fr) auto;
            gap: 10px;
            align-items: center;
            padding: 11px;
            border: 1px solid rgba(127, 127, 127, 0.12);
            border-radius: 16px;
            background: var(--bg-soft);
            transition: transform 0.2s, border-color 0.2s;
        }

            #trang_bxh .mini-rank:hover {
                transform: translateX(3px);
                border-color: rgba(255, 204, 77, 0.4);
            }

            #trang_bxh .mini-rank .no {
                display: grid;
                place-items: center;
                width: 30px;
                height: 30px;
                border-radius: 10px;
                color: var(--primary);
                background: rgba(255, 204, 77, 0.14);
                font-weight: 900;
            }

            #trang_bxh .mini-rank > span:nth-child(2) {
                min-width: 0;
            }

            #trang_bxh .mini-rank h4 {
                display: -webkit-box;
                margin: 0 0 4px;
                overflow: hidden;
                color: var(--text);
                font-size: 14px;
                line-height: 1.3;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                line-clamp: 2;
            }

            #trang_bxh .mini-rank p {
                margin: 0;
                overflow: hidden;
                color: var(--muted-2);
                font-size: 12px;
                font-weight: 700;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            #trang_bxh .mini-rank span:last-child {
                color: var(--primary);
                font-size: 13px;
                font-weight: 900;
                white-space: nowrap;
            }

        /* Thể loại hot */

        #trang_bxh .tag-cloud {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 18px;
        }

            #trang_bxh .tag-cloud a {
                padding: 9px 11px;
                border: 1px solid rgba(127, 127, 127, 0.12);
                border-radius: 999px;
                color: var(--muted);
                background: var(--bg-soft);
                font-size: 13px;
                font-weight: 900;
                transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
            }

                #trang_bxh .tag-cloud a:hover {
                    transform: translateY(-1px);
                }

                #trang_bxh .tag-cloud a:hover,
                #trang_bxh .tag-cloud a.active {
                    border-color: transparent;
                    color: #111827;
                    background: var(--primary);
                }

        /* Trạng thái không có dữ liệu */

        #trang_bxh .empty-state {
            display: none;
            padding: 50px 20px;
            color: var(--muted);
            text-align: center;
        }

            #trang_bxh .empty-state.show {
                display: block;
            }

            #trang_bxh .empty-state strong {
                display: block;
                margin-bottom: 8px;
                color: var(--text);
                font-size: 22px;
            }

        /* Toast */

        #trang_bxh .toast {
            position: fixed;
            bottom: 22px;
            left: 50%;
            z-index: 300;
            padding: 14px 16px;
            border: 1px solid var(--border);
            border-radius: 16px;
            color: var(--text);
            background: var(--bg-card);
            box-shadow: var(--shadow);
            font-weight: 900;
            text-align: center;
            opacity: 0;
            pointer-events: none;
            transform: translate(-50%, 12px);
            transition: opacity 0.22s, transform 0.22s;
        }

            #trang_bxh .toast.show {
                opacity: 1;
                transform: translate(-50%, 0);
            }

/* Tablet */

@media (max-width: 1080px) {
    #trang_bxh .rank-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #trang_bxh .sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        #trang_bxh .sidebar .panel:last-child {
            grid-column: 1 / -1;
        }
}

@media (max-width: 820px) {
    #trang_bxh .podium {
        grid-template-columns: minmax(0, 1fr);
    }

    #trang_bxh .podium-card,
    #trang_bxh .podium-card.top-1 {
        min-height: auto;
    }

    #trang_bxh .rank-item {
        grid-template-columns: 50px 70px minmax(0, 1fr);
    }

    #trang_bxh .rank-action {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    #trang_bxh .sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

        #trang_bxh .sidebar .panel:last-child {
            grid-column: auto;
        }
}

/* Mobile */

@media (max-width: 620px) {
    #trang_bxh .container {
        width: min(calc(100% - 22px), var(--container));
    }

    #trang_bxh .breadcrumb {
        padding-top: 16px;
    }

    #trang_bxh .rank-layout {
        gap: 18px;
        padding-bottom: 34px;
    }

    #trang_bxh .panel {
        padding: 16px;
        border-radius: 20px;
    }

    #trang_bxh .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    #trang_bxh .section-title {
        font-size: 23px;
    }

    #trang_bxh .tab-btn,
    #trang_bxh .chip-btn {
        min-height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }

    #trang_bxh .rank-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    #trang_bxh .sort-select {
        width: 100%;
    }

    #trang_bxh .rank-item {
        grid-template-columns: minmax(0, 1fr);
    }

        #trang_bxh .rank-item:hover {
            transform: none;
        }

    #trang_bxh .rank-number {
        width: 100%;
        height: 42px;
    }

    #trang_bxh .rank-cover {
        width: 100%;
        height: 220px;
    }

    #trang_bxh .rank-action {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    #trang_bxh .rank-meta {
        flex-direction: column;
        gap: 6px;
    }

    #trang_bxh .side-row {
        align-items: flex-start;
    }
}

#trang_dang_truyen_chu {
    --bg: #0d0f16;
    --bg-soft: #131722;
    --bg-card: #181d2a;
    --bg-card-2: #202638;
    --border: #2b3245;
    --text: #f4f6fb;
    --muted: #9ca6bd;
    --muted-2: #707b92;
    --primary: #ffcc4d;
    --purple: #8b5cf6;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #38bdf8;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
    --container: 1240px;
}

    #trang_dang_truyen_chu.light-mode {
        --bg: #f5f7fb;
        --bg-soft: #ffffff;
        --bg-card: #ffffff;
        --bg-card-2: #eef2ff;
        --border: #dde3f0;
        --text: #141824;
        --muted: #5d6677;
        --muted-2: #7d8798;
        --shadow: 0 16px 44px rgba(20, 24, 36, 0.12);
    }

    #trang_dang_truyen_chu, #trang_dang_truyen_chu * {
        box-sizing: border-box;
    }

#trang_dang_truyen_chu {
    scroll-behavior: smooth;
}

#trang_dang_truyen_chu {
    margin: 0;
    font-family: "Roboto", Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top left, rgba(255, 204, 77, 0.12), transparent 28%), radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 32%), radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.08), transparent 28%), var(--bg);
    color: var(--text);
}

    #trang_dang_truyen_chu a {
        color: inherit;
        text-decoration: none;
    }

    #trang_dang_truyen_chu button,
    #trang_dang_truyen_chu input,
    #trang_dang_truyen_chu select,
    #trang_dang_truyen_chu textarea {
        font-family: inherit;
    }

    #trang_dang_truyen_chu .container {
        width: min(var(--container), calc(100% - 32px));
        margin: 0 auto;
    }

    #trang_dang_truyen_chu .breadcrumb {
        padding: 22px 0 10px;
        color: var(--muted);
        font-size: 14px;
        font-weight: 700;
    }

        #trang_dang_truyen_chu .breadcrumb a:hover {
            color: var(--primary);
        }

    #trang_dang_truyen_chu .creator-hero {
        padding: 18px 0 26px;
    }

    #trang_dang_truyen_chu .hero-card {
        position: relative;
        overflow: hidden;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 24px;
        align-items: stretch;
        border-radius: 34px;
        border: 1px solid var(--border);
        background: radial-gradient(circle at 76% 22%, rgba(255, 204, 77, 0.22), transparent 26%), radial-gradient(circle at 88% 75%, rgba(139, 92, 246, 0.30), transparent 30%), linear-gradient(135deg, var(--bg-card), var(--bg-soft));
        box-shadow: var(--shadow);
        padding: clamp(24px, 5vw, 38px);
    }

        #trang_dang_truyen_chu .hero-card::after {
            content: "PUBLISH";
            position: absolute;
            right: -42px;
            bottom: 8px;
            font-size: clamp(56px, 13vw, 144px);
            font-weight: 900;
            letter-spacing: 9px;
            color: rgba(255,255,255,0.035);
            pointer-events: none;
        }

    #trang_dang_truyen_chu.light-mode .hero-card::after {
        color: rgba(15, 23, 42, 0.06);
    }

    #trang_dang_truyen_chu .hero-content {
        position: relative;
        z-index: 2;
    }

    #trang_dang_truyen_chu .badge {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 0 11px;
        border-radius: 999px;
        background: rgba(255, 204, 77, 0.14);
        color: var(--primary);
        border: 1px solid rgba(255, 204, 77, 0.24);
        font-size: 13px;
        font-weight: 900;
    }

        #trang_dang_truyen_chu .badge.green {
            background: rgba(34, 197, 94, 0.14);
            color: #86efac;
            border-color: rgba(34, 197, 94, 0.24);
        }

        #trang_dang_truyen_chu .badge.purple {
            background: rgba(139, 92, 246, 0.16);
            color: #c4b5fd;
            border-color: rgba(139, 92, 246, 0.24);
        }

    #trang_dang_truyen_chu.light-mode .badge.green {
        color: #15803d;
    }

    #trang_dang_truyen_chu.light-mode .badge.purple {
        color: #6d28d9;
    }

    #trang_dang_truyen_chu .hero-content h1 {
        margin: 16px 0 12px;
        font-size: clamp(34px, 5vw, 58px);
        line-height: 1.08;
        letter-spacing: -1.6px;
    }

    #trang_dang_truyen_chu .hero-content p {
        margin: 0;
        max-width: 720px;
        color: var(--muted);
        line-height: 1.7;
        font-size: 16px;
    }

    #trang_dang_truyen_chu .hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 24px;
    }

    #trang_dang_truyen_chu .hero-side {
        position: relative;
        z-index: 2;
        display: grid;
        gap: 12px;
        align-content: space-between;
        padding: 20px;
        border-radius: 26px;
        background: color-mix(in srgb, var(--bg-card) 74%, transparent);
        border: 1px solid rgba(127,127,127,0.16);
    }

    #trang_dang_truyen_chu .hero-stat-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #trang_dang_truyen_chu .hero-stat {
        padding: 14px;
        border-radius: 18px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
    }

        #trang_dang_truyen_chu .hero-stat strong {
            display: block;
            color: var(--primary);
            font-size: 24px;
            line-height: 1;
        }

        #trang_dang_truyen_chu .hero-stat span {
            display: block;
            margin-top: 7px;
            color: var(--muted);
            font-size: 13px;
            font-weight: 800;
        }

    #trang_dang_truyen_chu .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 46px;
        padding: 0 16px;
        border-radius: 15px;
        border: 1px solid var(--border);
        background: var(--bg-soft);
        color: var(--text);
        cursor: pointer;
        font-weight: 900;
        transition: 0.2s;
        font-size: 14px;
    }

        #trang_dang_truyen_chu .btn:hover {
            transform: translateY(-2px);
        }

    #trang_dang_truyen_chu .btn-primary {
        background: var(--primary);
        color: #111827;
        border-color: transparent;
    }

    #trang_dang_truyen_chu .btn-green {
        background: rgba(34, 197, 94, 0.14);
        color: #86efac;
        border-color: rgba(34, 197, 94, 0.24);
    }

    #trang_dang_truyen_chu .btn-danger {
        background: rgba(239, 68, 68, 0.14);
        color: #fecaca;
        border-color: rgba(239, 68, 68, 0.24);
    }

    #trang_dang_truyen_chu.light-mode .btn-green {
        color: #15803d;
    }

    #trang_dang_truyen_chu.light-mode .btn-danger {
        color: #b91c1c;
    }

    #trang_dang_truyen_chu .publish-layout {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr) 330px;
        gap: 24px;
        align-items: start;
        padding-bottom: 56px;
    }

    #trang_dang_truyen_chu .sidebar,
    #trang_dang_truyen_chu .preview-sidebar {
        position: sticky;
        top: 96px;
        display: grid;
        gap: 18px;
    }

    #trang_dang_truyen_chu .panel {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 26px;
        box-shadow: 0 15px 45px rgba(0,0,0,0.13);
        padding: 22px;
    }

        #trang_dang_truyen_chu .panel + .panel {
            margin-top: 24px;
        }

    #trang_dang_truyen_chu .side-menu {
        display: grid;
        gap: 8px;
    }

    #trang_dang_truyen_chu .side-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 13px;
        border-radius: 16px;
        color: var(--muted);
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        cursor: pointer;
        font-weight: 900;
        transition: 0.2s;
        text-align: left;
    }

        #trang_dang_truyen_chu .side-link:hover,
        #trang_dang_truyen_chu .side-link.active {
            color: #111827;
            background: var(--primary);
            border-color: transparent;
        }

        #trang_dang_truyen_chu .side-link b {
            font-size: 12px;
            padding: 4px 8px;
            border-radius: 999px;
            background: rgba(255,255,255,0.10);
        }

    #trang_dang_truyen_chu .section-head {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 18px;
    }

    #trang_dang_truyen_chu .section-kicker {
        color: var(--primary);
        text-transform: uppercase;
        font-size: 13px;
        font-weight: 900;
        letter-spacing: 1px;
    }

    #trang_dang_truyen_chu .section-title {
        margin: 6px 0 0;
        font-size: 28px;
        letter-spacing: -0.8px;
    }

    #trang_dang_truyen_chu .tab-panel {
        display: none;
    }

        #trang_dang_truyen_chu .tab-panel.active {
            display: block;
        }

    #trang_dang_truyen_chu .form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    #trang_dang_truyen_chu .field-group {
        display: grid;
        gap: 8px;
    }

        #trang_dang_truyen_chu .field-group.full {
            grid-column: 1 / -1;
        }

    #trang_dang_truyen_chu .field-label {
        font-size: 14px;
        font-weight: 900;
        color: var(--text);
    }

    .field,
    .select,
    .textarea {
        width: 100%;
        min-height: 46px;
        padding: 0 13px;
        border-radius: 15px;
        border: 1px solid var(--border);
        outline: none;
        background: var(--bg-soft);
        color: var(--text);
        font-size: 15px;
        font-weight: 700;
        transition: 0.2s;
    }

    .textarea {
        min-height: 130px;
        padding: 13px;
        resize: vertical;
        line-height: 1.65;
    }

        .textarea.editor {
            min-height: 380px;
            font-size: 17px;
            line-height: 1.85;
        }

       .field:focus,
      .select:focus,
        .textarea:focus {
            border-color: rgba(255, 204, 77, 0.65);
            box-shadow: 0 0 0 4px rgba(255, 204, 77, 0.10);
        }

    #trang_dang_truyen_chu .field-note {
        color: var(--muted-2);
        font-size: 12px;
        line-height: 1.45;
        font-weight: 700;
    }

    #trang_dang_truyen_chu .segmented {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 7px;
        border-radius: 18px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        margin-bottom: 18px;
    }

    #trang_dang_truyen_chu .seg-btn {
        min-height: 42px;
        border: 0;
        border-radius: 13px;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        font-weight: 900;
        transition: 0.2s;
    }

        #trang_dang_truyen_chu .seg-btn.active {
            background: var(--primary);
            color: #111827;
        }

    #trang_dang_truyen_chu .cover-upload {
        display: grid;
        grid-template-columns: 130px 1fr;
        gap: 14px;
        align-items: center;
        padding: 14px;
        border-radius: 20px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        margin-bottom: 16px;
    }

    #trang_dang_truyen_chu .cover-preview {
        width: 130px;
        height: 180px;
        border-radius: 18px;
        position: relative;
        overflow: hidden;
        display: grid;
        place-items: center;
        text-align: center;
        padding: 12px;
        color: #fff;
        font-weight: 900;
        background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
        box-shadow: 0 16px 36px rgba(0,0,0,0.22);
    }

        #trang_dang_truyen_chu .cover-preview.comic {
            background: linear-gradient(135deg, #020617, #581c87 55%, #ef4444);
        }

        #trang_dang_truyen_chu .cover-preview::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.68), transparent 58%);
        }

        #trang_dang_truyen_chu .cover-preview img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 1;
        }

        #trang_dang_truyen_chu .cover-preview span {
            position: relative;
            z-index: 2;
            text-shadow: 0 8px 22px rgba(0,0,0,0.45);
        }

    #trang_dang_truyen_chu .cover-upload strong {
        display: block;
        margin-bottom: 6px;
    }

    #trang_dang_truyen_chu .cover-upload p {
        margin: 0 0 12px;
        color: var(--muted);
        line-height: 1.5;
        font-size: 14px;
    }

    #trang_dang_truyen_chu .tag-input-box {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        border-radius: 15px;
        border: 1px solid var(--border);
        background: var(--bg-soft);
        min-height: 48px;
    }

    #trang_dang_truyen_chu .tag-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 28px;
        padding: 0 9px;
        border-radius: 999px;
        background: rgba(255, 204, 77, 0.14);
        color: var(--primary);
        font-size: 12px;
        font-weight: 900;
    }
    #trang_dang_truyen_chu .story-row, #trang_dang_truyen_chu .chapter-row,
    #trang_dang_truyen_chu .comment-row, #trang_dang_truyen_chu .post-row {
        display: grid;
        grid-template-columns: 90px minmax(0, 1fr) auto;
        gap: 14px;
        align-items: center;
        padding: 14px;
        border-radius: 20px;
        background: var(--bg-soft);
        border: 1px solid rgba(127, 127, 127, 0.12);
        transition: 0.2s;
    }
    #trang_dang_truyen_chu .cover {
        width: 90px;
        height: 122px;
        border-radius: 16px;
        position: relative;
        overflow: hidden;
        background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
    }
    #trang_dang_truyen_chu .row-actions {
        display: grid;
        gap: 8px;
        min-width: 128px;
    }
    #trang_dang_truyen_chu  .topline {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }
    #trang_dang_truyen_chu .pill.published {
        background: rgba(34, 197, 94, 0.14);
        color: #86efac;
    }
    #trang_dang_truyen_chu .row-meta strong {
        color: var(--text);
    }
    #trang_dang_truyen_chu .pill.draft {
        background: rgba(148, 163, 184, 0.14);
        color: #cbd5e1;
    }
    #trang_dang_truyen_chu .row-meta {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        color: var(--muted-2);
        font-size: 13px;
        font-weight: 800;
    }
        #trang_dang_truyen_chu .tag-pill button {
            border: 0;
            background: transparent;
            color: inherit;
            cursor: pointer;
            font-weight: 900;
            padding: 0;
        }
    #trang_dang_truyen_chu .row-info p {
        margin: 0 0 10px;
        color: var(--muted);
        line-height: 1.55;
        font-size: 14px;
    }
    #trang_dang_truyen_chu .row-info h3 {
        margin: 0 0 7px;
        font-size: 19px;
        line-height: 1.3;
        letter-spacing: -0.2px;
    }
    #trang_dang_truyen_chu .tag-input-box input {
        flex: 1;
        min-width: 150px;
        border: 0;
        background: transparent;
        color: var(--text);
        outline: none;
        font-weight: 800;
    }

    #trang_dang_truyen_chu .checkbox-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #trang_dang_truyen_chu .check-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border-radius: 15px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        color: var(--muted);
        font-weight: 900;
        cursor: pointer;
    }

        #trang_dang_truyen_chu .check-card input {
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
        }

    #trang_dang_truyen_chu .price-box {
        display: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        margin-top: 12px;
    }

        #trang_dang_truyen_chu .price-box.show {
            display: grid;
        }

    #trang_dang_truyen_chu .upload-zone {
        border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--border));
        background: color-mix(in srgb, var(--primary) 6%, var(--bg-soft));
        border-radius: 22px;
        padding: 24px;
        text-align: center;
        cursor: pointer;
        transition: 0.2s;
        margin-bottom: 16px;
    }

        #trang_dang_truyen_chu .upload-zone:hover,
        #trang_dang_truyen_chu .upload-zone.dragover {
            transform: translateY(-2px);
            border-color: var(--primary);
            background: color-mix(in srgb, var(--primary) 10%, var(--bg-soft));
        }

        #trang_dang_truyen_chu .upload-zone strong {
            display: block;
            font-size: 18px;
            margin-bottom: 8px;
        }

        #trang_dang_truyen_chu .upload-zone p {
            margin: 0;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.55;
            font-weight: 700;
        }

    #trang_dang_truyen_chu .panel-list {
        display: grid;
        gap: 10px;
    }

    #trang_dang_truyen_chu .panel-item {
        display: grid;
        grid-template-columns: 48px 1fr auto;
        gap: 12px;
        align-items: center;
        padding: 12px;
        border-radius: 16px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
    }

    #trang_dang_truyen_chu .panel-thumb {
        width: 48px;
        height: 64px;
        border-radius: 12px;
        background: linear-gradient(135deg, #020617, #581c87 55%, #ef4444);
        display: grid;
        place-items: center;
        color: #fff;
        font-weight: 900;
        overflow: hidden;
    }

        #trang_dang_truyen_chu .panel-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    #trang_dang_truyen_chu .panel-item strong {
        display: block;
        font-size: 14px;
        margin-bottom: 4px;
    }

    #trang_dang_truyen_chu .panel-item span {
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
    }

    #trang_dang_truyen_chu .editor-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    #trang_dang_truyen_chu .tool-btn {
        min-height: 36px;
        padding: 0 11px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--bg-soft);
        color: var(--muted);
        cursor: pointer;
        font-weight: 900;
        transition: 0.2s;
    }

        #trang_dang_truyen_chu .tool-btn:hover {
            color: var(--primary);
            border-color: rgba(255,204,77,0.45);
        }

    #trang_dang_truyen_chu .save-bar {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 18px;
        padding-top: 18px;
        border-top: 1px solid rgba(127,127,127,0.12);
    }

    #trang_dang_truyen_chu .preview-card {
        overflow: hidden;
    }

    #trang_dang_truyen_chu .live-cover {
        width: 100%;
        height: 360px;
        border-radius: 22px;
        position: relative;
        overflow: hidden;
        background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
        margin-bottom: 16px;
        box-shadow: 0 18px 44px rgba(0,0,0,0.18);
    }

        #trang_dang_truyen_chu .live-cover.comic {
            background: linear-gradient(135deg, #020617, #581c87 55%, #ef4444);
        }

        #trang_dang_truyen_chu .live-cover::before {
            content: "";
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 22%, rgba(255,255,255,0.25), transparent 22%), linear-gradient(to top, rgba(0,0,0,0.72), transparent 55%);
        }

        #trang_dang_truyen_chu .live-cover img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 1;
        }

        #trang_dang_truyen_chu .live-cover h3 {
            position: absolute;
            left: 16px;
            right: 16px;
            bottom: 16px;
            z-index: 2;
            margin: 0;
            color: #fff;
            font-size: 28px;
            line-height: 1.08;
            text-shadow: 0 8px 24px rgba(0,0,0,0.55);
        }

    #trang_dang_truyen_chu .preview-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    #trang_dang_truyen_chu .preview-text {
        color: var(--muted);
        line-height: 1.6;
        font-size: 14px;
        font-weight: 700;
        margin: 0 0 14px;
    }

    #trang_dang_truyen_chu .status-list {
        display: grid;
        gap: 10px;
    }

    #trang_dang_truyen_chu .status-row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 12px;
        border-radius: 16px;
        background: var(--bg-soft);
        border: 1px solid rgba(127,127,127,0.12);
        color: var(--muted);
        font-weight: 800;
    }

        #trang_dang_truyen_chu .status-row strong {
            color: var(--text);
            text-align: right;
        }

            #trang_dang_truyen_chu .status-row strong.good {
                color: #86efac;
            }

            #trang_dang_truyen_chu .status-row strong.warn {
                color: var(--primary);
            }

    #trang_dang_truyen_chu.light-mode .status-row strong.good {
        color: #15803d;
    }

    #trang_dang_truyen_chu .message-box {
        display: none;
        margin-bottom: 14px;
        padding: 12px 14px;
        border-radius: 15px;
        font-size: 14px;
        line-height: 1.5;
        font-weight: 800;
    }

        #trang_dang_truyen_chu .message-box.show {
            display: block;
        }

        #trang_dang_truyen_chu .message-box.success {
            background: rgba(34, 197, 94, 0.14);
            color: #86efac;
            border: 1px solid rgba(34, 197, 94, 0.24);
        }

        #trang_dang_truyen_chu .message-box.error {
            background: rgba(239, 68, 68, 0.14);
            color: #fecaca;
            border: 1px solid rgba(239, 68, 68, 0.24);
        }

    #trang_dang_truyen_chu.light-mode .message-box.success {
        color: #15803d;
    }

    #trang_dang_truyen_chu.light-mode .message-box.error {
        color: #b91c1c;
    }

    #trang_dang_truyen_chu .toast {
        position: fixed;
        left: 50%;
        bottom: 22px;
        z-index: 300;
        transform: translate(-50%, 12px);
        padding: 14px 16px;
        border-radius: 16px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
        color: var(--text);
        font-weight: 900;
        opacity: 0;
        pointer-events: none;
        transition: 0.22s;
        text-align: center;
    }

        #trang_dang_truyen_chu .toast.show {
            opacity: 1;
            transform: translate(-50%, 0);
        }

@media (max-width: 1180px) {
    #trang_dang_truyen_chu .hero-card {
        grid-template-columns: 1fr;
    }

    #trang_dang_truyen_chu .publish-layout {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    #trang_dang_truyen_chu .preview-sidebar {
        position: static;
        grid-column: 1 / -1;
    }

    #trang_dang_truyen_chu .live-cover {
        height: 300px;
    }
}

@media (max-width: 880px) {
    #trang_dang_truyen_chu .publish-layout {
        grid-template-columns: 1fr;
    }

    #trang_dang_truyen_chu .sidebar {
        position: static;
    }

    #trang_dang_truyen_chu .form-grid,
    #trang_dang_truyen_chu .price-box,
    #trang_dang_truyen_chu .checkbox-grid {
        grid-template-columns: 1fr;
    }

    #trang_dang_truyen_chu .cover-upload {
        grid-template-columns: 1fr;
    }

    #trang_dang_truyen_chu .cover-preview {
        width: 100%;
        height: 240px;
    }
}

@media (max-width: 620px) {
    #trang_dang_truyen_chu .container {
        width: min(100% - 22px, var(--container));
    }

    #trang_dang_truyen_chu .hero-card {
        border-radius: 24px;
    }

    #trang_dang_truyen_chu .hero-actions .btn,
    #trang_dang_truyen_chu .save-bar .btn {
        width: 100%;
    }

    #trang_dang_truyen_chu .hero-stat-grid {
        grid-template-columns: 1fr;
    }

    #trang_dang_truyen_chu .panel-item {
        grid-template-columns: 1fr;
    }

    #trang_dang_truyen_chu .panel-thumb {
        width: 100%;
        height: 160px;
    }

    #trang_dang_truyen_chu .status-row {
        display: grid;
    }

        #trang_dang_truyen_chu .status-row strong {
            text-align: left;
        }
}

#trang_dang_truyen_chu {
    min-height: 100vh;
}
.top-alert {
  
    width: calc(100% - 30px);
    max-width: 100%;
    min-height: 48px;
    padding: 12px 48px 12px 16px;
    border-radius: 0 0 10px 10px;
 
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    z-index: 999999;

    transition: all 0.3s ease;
}

    .top-alert.show {

        opacity: 1;
        visibility: visible;
    }

    .top-alert.error {
        background: #dc3545;
    }

    .top-alert.success {
        background: #198754;
    }

    .top-alert.warning {
        background: #f59e0b;
        color: #1f2937;
    }

    .top-alert.info {
        background: #0d6efd;
    }

.top-alert-close {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
#trang_dang_chuong_tieu_thuyet .chapter-row {
    grid-template-columns: 78px 58px minmax(0, 1fr) auto auto;
}
    .btn-action {
        padding: 5px;
        min-height: unset;
        border-radius: unset;
    }
.publish-setting {
    width: 100%;
}

.publish-title {
    margin-bottom: 12px;
    color: #f3f4f6;
    font-size: 15px;
    font-weight: 700;
}

.publish-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* Card lựa chọn */
.publish-option {
    position: relative;
    min-height: 92px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid #2b3242;
    border-radius: 12px;
    background: #151a25;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

    .publish-option:hover {
        border-color: #586174;
        background: #191f2c;
    }

    /* Ẩn radio mặc định */
    .publish-option input[type="radio"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

/* Radio custom */
.publish-radio {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid #697386;
    border-radius: 50%;
    background: transparent;
    transition: 0.2s ease;
}

    .publish-radio::after {
        content: "";
        position: absolute;
        inset: 4px;
        border-radius: 50%;
        background: #f59e0b;
        opacity: 0;
        transform: scale(0.4);
        transition: 0.2s ease;
    }

/* Khi được chọn */
.publish-option:has(input[type="radio"]:checked) {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

    .publish-option:has(input[type="radio"]:checked) .publish-radio {
        border-color: #f59e0b;
    }

        .publish-option:has(input[type="radio"]:checked) .publish-radio::after {
            opacity: 1;
            transform: scale(1);
        }

.publish-option-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.publish-option-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 700;
}

    .publish-option-title i {
        width: 18px;
        color: #f59e0b;
        text-align: center;
    }

.publish-option-description {
    color: #929bad;
    font-size: 13px;
    line-height: 1.5;
}

/* Khung chọn thời gian */
.schedule-box {
    max-height: 0;
    margin-top: 0;
    padding: 0 16px;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #151a25;
    transform: translateY(-5px);
    transition: all 0.25s ease;
}

    .schedule-box.show {
        max-height: 180px;
        margin-top: 14px;
        padding: 16px;
        visibility: visible;
        opacity: 1;
        border-color: #2b3242;
        transform: translateY(0);
    }

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #d8dee9;
    font-size: 14px;
    font-weight: 600;
}

.field {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #343c4d;
    border-radius: 9px;
    outline: none;
    background: #0f1420;
    color: #f8fafc;
    font-size: 14px;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.9;
    cursor: pointer;
}

    .field:focus {
        border-color: #f59e0b;
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
    }

.field-note {
    display: block;
    margin: 14px 0;
    color: #7f899b;
    font-size: 12px;
}

@media (max-width: 650px) {
    .publish-options {
        grid-template-columns: 1fr;
    }
}

.btn-preview {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #3a4356;
    border-radius: 10px;
    background: #171d29;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

    .btn-preview:hover {
        border-color: #f59e0b;
        color: #f59e0b;
        background: rgba(245, 158, 11, 0.08);
    }

/* Modal */
.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

    .preview-modal.show {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.preview-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border: 1px solid #30394b;
    border-radius: 18px;
    background: #111722;
    color: #f8fafc;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
    transform: translateY(15px) scale(0.98);
    transition: transform 0.2s ease;
}

.preview-modal.show .preview-dialog {
    transform: translateY(0) scale(1);
}

.preview-header {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #293142;
    background: #151b27;
}

.preview-label {
    display: block;
    margin-bottom: 7px;
    color: #f59e0b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.preview-header h2 {
    margin: 0;
    color: #fff;
    font-size: 23px;
    line-height: 1.35;
}

.preview-meta {
    margin-top: 8px;
    color: #8e98aa;
    font-size: 13px;
}

.preview-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #364055;
    border-radius: 9px;
    background: #101621;
    color: #aab2c1;
    font-size: 18px;
    cursor: pointer;
}

    .preview-close:hover {
        border-color: #ef4444;
        color: #ef4444;
    }

.preview-content-wrapper {
    flex: 1;
    overflow-y: auto;
    background: #0e141e;
}

.preview-content {
    width: min(760px, 100%);
    min-height: 400px;
    margin: 0 auto;
    padding: 36px 28px 60px;
    box-sizing: border-box;
    color: #dbe2ec;
    font-size: 18px;
    line-height: 1.9;
    word-break: break-word;
}

    .preview-content p {
        margin: 0 0 20px;
    }

    .preview-content img {
        display: block;
        max-width: 100%;
        height: auto;
        margin: 20px auto;
    }

.preview-empty {
    color: #747f91;
    font-style: italic;
}

.preview-footer {
    padding: 14px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #293142;
    background: #151b27;
}

.btn-close-preview {
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: #f59e0b;
    color: #17120a;
    font-weight: 700;
    cursor: pointer;
}

body.preview-open {
    overflow: hidden;
}

@media (max-width: 650px) {
    .preview-modal {
        padding: 0;
    }

    .preview-dialog {
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .preview-header {
        padding: 16px;
    }

        .preview-header h2 {
            font-size: 19px;
        }

    .preview-content {
        padding: 25px 18px 50px;
        font-size: 17px;
    }
}

.chapter-form-actions {
    grid-column: 1 / -1;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-preview-chapter,
.btn-submit-chapter {
    min-height: 44px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-preview-chapter {
    border: 1px solid #394256;
    background: #171d29;
    color: #e9edf5;
}

    .btn-preview-chapter:hover {
        border-color: #f59e0b;
        background: rgba(245, 158, 11, 0.08);
        color: #f59e0b;
    }

.btn-submit-chapter {
    border: 1px solid #f59e0b;
    background: #f59e0b;
    color: #17120a;
}

/* Modal xem trước */
.chapter-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: visibility 0.2s ease, opacity 0.2s ease;
}

    .chapter-preview-modal.show {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

.chapter-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.chapter-preview-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #313a4d;
    border-radius: 18px;
    background: #111722;
    color: #f8fafc;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.2s ease;
}

.chapter-preview-modal.show .chapter-preview-dialog {
    transform: translateY(0) scale(1);
}

.chapter-preview-header {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #293143;
    background: #151b27;
}

.chapter-preview-heading {
    min-width: 0;
}

.chapter-preview-label {
    display: block;
    margin-bottom: 7px;
    color: #f59e0b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.chapter-preview-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    line-height: 1.4;
    word-break: break-word;
}

.chapter-preview-meta {
    margin-top: 9px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #929caf;
    font-size: 13px;
}

.preview-meta-item {
    padding: 5px 9px;
    border: 1px solid #30394b;
    border-radius: 999px;
    background: #101621;
}

.chapter-preview-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #364055;
    border-radius: 9px;
    background: #101621;
    color: #aab3c2;
    font-size: 18px;
    cursor: pointer;
}

    .chapter-preview-close:hover {
        border-color: #ef4444;
        color: #ef4444;
    }

.chapter-preview-body {
    flex: 1;
    overflow-y: auto;
    background: #0d131d;
}

.chapter-preview-content {
    box-sizing: border-box;
    width: min(780px, 100%);
    min-height: 450px;
    margin: 0 auto;
    padding: 38px 28px 70px;
    color: #dce3ed;
    font-size: 18px;
    line-height: 1.9;
    word-break: break-word;
}

    .chapter-preview-content p {
        margin: 0 0 20px;
    }

    .chapter-preview-content img {
        display: block;
        max-width: 100%;
        height: auto;
        margin: 22px auto;
    }

    .chapter-preview-content h1,
    .chapter-preview-content h2,
    .chapter-preview-content h3 {
        color: #ffffff;
    }

.preview-empty {
    color: #758094;
    font-style: italic;
}

.chapter-preview-footer {
    padding: 14px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #293143;
    background: #151b27;
}

.btn-close-preview {
    min-height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    background: #f59e0b;
    color: #17120a;
    font-weight: 700;
    cursor: pointer;
}

body.chapter-preview-open {
    overflow: hidden;
}

@media (max-width: 650px) {
    .chapter-preview-modal {
        padding: 0;
    }

    .chapter-preview-dialog {
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .chapter-preview-header {
        padding: 16px;
    }

        .chapter-preview-header h2 {
            font-size: 20px;
        }

    .chapter-preview-content {
        padding: 28px 18px 60px;
        font-size: 17px;
    }

    .chapter-form-actions {
        flex-direction: column;
    }

    .btn-preview-chapter,
    .btn-submit-chapter {
        width: 100%;
    }
}
.status-label {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Chờ duyệt */
.status-pending {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}

/* Đang xử lý */
.status-processing {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Đã duyệt */
.status-approved {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Từ chối */
.status-rejected {
    color: #fb7185;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Đã hủy */
.status-cancelled {
    color: #a1a1aa;
    background: rgba(113, 113, 122, 0.14);
    border-color: rgba(113, 113, 122, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    padding: 18px;
    border-radius: 22px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    position: relative;
    overflow: hidden;
}
    .stat-card span {
        display: block;
        color: var(--muted);
        font-size: 13px;
        font-weight: 900;
        margin-bottom: 10px;
    }

    .stat-card strong {
        display: block;
        font-size: 30px;
        line-height: 1;
        letter-spacing: -1px;
    }
    .stat-card small {
        display: block;
        margin-top: 9px;
        color: #86efac;
        font-weight: 900;
    }
.trend-up {
    color: #75efa9;
}

.trend-down {
    color: #ff7373;
}

.trend-equal {
    color: #a6afc3;
}
.comment-item.comment-child {
    width: calc(100% - 80px);
    margin-left: 80px;
    background: #171e2d;
}

    /* Đường dọc bên trái giống ảnh */
    .comment-item.comment-child::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: -24px;
        width: 3px;
        background: #75662f;
        border-radius: 3px;
    }

.withdraw-history {
    width: 100%;
    overflow: hidden;
    background: #fff;margin-top:15px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
}

.withdraw-row {
    display: grid;
    grid-template-columns: 30px minmax(130px, 1fr) 90px minmax(130px, 1fr) minmax(170px, 1.2fr) 140px;
    align-items: center;
    gap: 15px;
    padding: 15px 18px;
    border-bottom: 1px solid #eee;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
}

    .withdraw-row:last-child {
        border-bottom: 0;
    }

.withdraw-header {
    background: #f7f8fa;
    color: #555;
    font-weight: 600;
}

.withdraw-amount {
    color: #444;
    font-weight: 600;
}

.withdraw-tax {
    color: #e67e22;
    font-weight: 500;
}

.withdraw-net-amount {
    color: #16803d;
    font-size: 15px;
    font-weight: 700;
}

.withdraw-date {
    color: #666;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.withdraw-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 105px;
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

    .withdraw-status.pending {
        color: #9a6700;
        background: #fff4cc;
    }

    .withdraw-status.approved {
        color: #075985;
        background: #e0f2fe;
    }

    .withdraw-status.processing {
        color: #5b21b6;
        background: #ede9fe;
    }

    .withdraw-status.paid {
        color: #166534;
        background: #dcfce7;
    }

    .withdraw-status.rejected {
        color: #991b1b;
        background: #fee2e2;
    }

    .withdraw-status.cancelled {
        color: #52525b;
        background: #e4e4e7;
    }

    .withdraw-status.failed {
        color: #9f1239;
        background: #ffe4e6;
    }

.withdraw-empty {
    padding: 35px 20px;
    text-align: center;
    color: #888;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 12px;
}
.withdraw-header .text-center {
    text-align: center;
    color: unset;
}
.author-hero {
    margin-bottom: 26px;
}
.author-cover {
    position: relative;
    overflow: hidden;
    min-height: 340px;
    border-radius: 34px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(13, 15, 22, 0.98), rgba(13, 15, 22, 0.72), rgba(13, 15, 22, 0.32)), radial-gradient(circle at 78% 28%, rgba(255, 204, 77, 0.30), transparent 26%), radial-gradient(circle at 88% 76%, rgba(139, 92, 246, 0.42), transparent 28%), linear-gradient(135deg, #161b2b, #37250c 52%, #4c1d95);
    box-shadow: var(--shadow);
}
.author-profile {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    align-items: end;
    padding: clamp(26px, 5vw, 46px);
}
.author-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 40px;
    overflow:hidden;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 58px;
    font-weight: 900;
    background: linear-gradient(135deg, #f59e0b, #7c2d12 55%, #8b5cf6);
    border: 4px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.author-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.author-name {
    margin: 0;
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -1.8px;
}
.author-bio-short {
    margin: 12px 0 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}
.author-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.author-cover::after {
    content: "AUTHOR";
    position: absolute;
    right: -22px;
    bottom: 20px;
    font-size: clamp(64px, 14vw, 160px);
    font-weight: 900;
    letter-spacing: 10px;
    color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}
.badge.secondary {
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.24);
}
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: -36px;
    position: relative;
    z-index: 4;
    padding: 0 28px;
}
@media (max-width: 1020px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 720px) {
    .author-profile {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .stats-row {
        margin-top: 14px;
        padding: 0;
    }
    .author-avatar-large {
        width: 120px;
        height: 120px;
        border-radius: 32px;
        font-size: 48px;
    }
}
.stat-card {
    padding: 18px;
    border-radius: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
    .stat-card strong {
        display: block;
        font-size: 28px;
        line-height: 1;
        color: var(--text);
    }
    .stat-card span {
        display: block;
        margin-top: 8px;
        color: var(--muted);
        font-size: 13px;
        font-weight: 800;
    }

.layout_tg {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    padding-bottom: 56px;
}
.side-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
    color: var(--muted);
    font-weight: 800;
}
.side-list {
    display: grid;
    gap: 12px;
}
.side-row strong {
    color: var(--text);
}
.mini-story {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: var(--bg-soft);
    border: 1px solid rgba(127, 127, 127, 0.12);
}
.mini-cover {
    width: 54px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e293b, #7c2d12 60%, #f59e0b);
}
.mini-story h4 {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.35;
}
.mini-story p {
    margin: 0;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 700;
}
#tuongtacgia .story-list {
    display: grid;
    gap: 14px;
}
#tuongtacgia .story-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid rgba(127,127,127,0.12);
    transition: 0.2s;
}

    #tuongtacgia .story-card:hover {
        transform: translateY(-3px);
        border-color: rgba(255,204,77,0.45);
    }

#tuongtacgia .story-cover {
    width: 96px;
    height: 130px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #24160b, #7c2d12 55%, #f59e0b);
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

    #tuongtacgia .story-cover::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 50% 22%, rgba(255,255,255,0.25), transparent 22%), linear-gradient(to top, rgba(0,0,0,0.72), transparent 55%);
    }

    #tuongtacgia .story-cover::after {
        content: attr(data-short);
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 10px;
        color: #fff;
        font-weight: 900;
        font-size: 15px;
        line-height: 1.1;
        text-shadow: 0 6px 18px rgba(0,0,0,0.45);
    }

#tuongtacgia .story-info {
    min-width: 0;
}

#tuongtacgia .story-topline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

#tuongtacgia .pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

    #tuongtacgia .pill.novel {
        background: rgba(255, 204, 77, 0.15);
        color: var(--primary);
    }

    #tuongtacgia .pill.ongoing {
        background: rgba(34,197,94,0.14);
        color: #86efac;
    }

    #tuongtacgia .pill.completed {
        background: rgba(56,189,248,0.14);
        color: #7dd3fc;
    }

#tuongtacgia body.light-mode .pill.ongoing {
    color: #15803d;
}

#tuongtacgia body.light-mode .pill.completed {
    color: #0369a1;
}

#tuongtacgia .story-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.3;
}

    #tuongtacgia .story-info h3 a:hover {
        color: var(--primary);
    }

#tuongtacgia .story-info p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

#tuongtacgia .story-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 800;
}

    #tuongtacgia .story-meta strong {
        color: var(--text);
    }

#tuongtacgia .story-action {
    display: grid;
    gap: 8px;
    min-width: 132px;
}

/* =====================================================
   ASSISTIVE TOUCH
   ===================================================== */

.assistive-touch {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    left: auto;
    top: auto;
    width: 60px;
    height: 60px;
    z-index: 9999;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: left 0.2s ease, top 0.2s ease;
}

    .assistive-touch.is-dragging {
        transition: none;
    }

/* =====================================================
   NÚT TRÒN
   ===================================================== */

.assistive-touch-button {
    position: relative;
    z-index: 2;
    width: 60px;
    height: 60px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.7);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    cursor: grab;
    touch-action: none;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

    .assistive-touch-button:active {
        cursor: grabbing;
    }

    .assistive-touch-button::before {
        content: "";
        position: absolute;
        inset: 10px;
        border: 2px solid rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.13);
    }

    .assistive-touch-button span {
        z-index: 1;
        display: block;
        color: rgba(255, 255, 255, 0.98);
        font-size: 12px;
        line-height: 1;
    }

    .assistive-touch-button:hover,
    .assistive-touch-button:focus-visible,
    .assistive-touch.is-open .assistive-touch-button {
        background: rgba(255, 204, 77, 0.86);
        transform: scale(1.06);
        outline: none;
    }

.assistive-touch.is-dragging .assistive-touch-button {
    cursor: grabbing;
    opacity: 0.86;
    transform: scale(1.08);
}

/* =====================================================
   MENU VUÔNG – MẶC ĐỊNH MỞ BÊN DƯỚI NÚT
   ===================================================== */

.assistive-touch-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(340px, calc(100vw - 24px));
    aspect-ratio: 1 / 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 35px;
    background: rgba(28, 28, 32, 0.94);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) scale(0.78);
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.23s ease, visibility 0.2s ease;
}

/* Trạng thái mở menu */

.assistive-touch.is-open .assistive-touch-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

/* =====================================================
   CĂN POPUP KHI NÚT GẦN MÉP TRÁI
   ===================================================== */

.assistive-touch.menu-align-left .assistive-touch-menu {
    left: 0;
    right: auto;
    transform: scale(0.78);
    transform-origin: top left;
}

.assistive-touch.is-open.menu-align-left
.assistive-touch-menu {
    transform: scale(1);
}

/* =====================================================
   CĂN POPUP KHI NÚT GẦN MÉP PHẢI
   ===================================================== */

.assistive-touch.menu-align-right .assistive-touch-menu {
    left: auto;
    right: 0;
    transform: scale(0.78);
    transform-origin: top right;
}

.assistive-touch.is-open.menu-align-right
.assistive-touch-menu {
    transform: scale(1);
}

/* =====================================================
   KHÔNG ĐỦ CHỖ BÊN DƯỚI THÌ MỞ LÊN TRÊN
   ===================================================== */

.assistive-touch.menu-open-above .assistive-touch-menu {
    top: auto;
    bottom: calc(100% + 12px);
    transform-origin: bottom center;
}

.assistive-touch.menu-open-above.menu-align-left
.assistive-touch-menu {
    transform-origin: bottom left;
}

.assistive-touch.menu-open-above.menu-align-right
.assistive-touch-menu {
    transform-origin: bottom right;
}

/* =====================================================
   TỪNG Ô TRONG MENU
   ===================================================== */

.assistive-touch-link {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

    .assistive-touch-link:hover,
    .assistive-touch-link:focus-visible {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.13);
        outline: none;
        transform: scale(1.05);
    }

    .assistive-touch-link:active {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(0.96);
    }

/* =====================================================
   ICON VÀ NHÃN
   ===================================================== */

.assistive-touch-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: transparent;
    color: #ffffff;
    font-size: 35px;
    font-weight: 400;
    line-height: 1;
}

.assistive-touch-label {
    display: block;
    max-width: 95px;
    color: #ffffff;
    text-align: center;
}

/* Luôn giữ menu màu tối */

body.light-mode .assistive-touch-menu {
    background: rgba(28, 28, 32, 0.94);
    border-color: rgba(255, 255, 255, 0.13);
}

body.light-mode .assistive-touch-link,
body.light-mode .assistive-touch-label,
body.light-mode .assistive-touch-icon {
    color: #ffffff;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 520px) {
    .assistive-touch {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .assistive-touch-button {
        width: 54px;
        height: 54px;
    }

        .assistive-touch-button::before {
            inset: 9px;
        }

    .assistive-touch-menu {
        width: min(320px, calc(100vw - 24px));
        padding: 14px;
        gap: 4px;
        border-radius: 30px;
    }

    .assistive-touch-link {
        padding: 8px 3px;
        gap: 7px;
        border-radius: 18px;
        font-size: 13px;
    }

    .assistive-touch-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 30px;
    }

    .assistive-touch-label {
        max-width: 82px;
    }
}
.assistive-touch-button::before {
    display: none;
}

.assistive-touch-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 50%;
    pointer-events: none;
}
@media (max-width: 360px) {
    .assistive-touch-menu {
        width: calc(100vw - 16px);
        padding: 10px;
    }

    .assistive-touch-link {
        font-size: 12px;
    }

    .assistive-touch-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 27px;
    }
}
#rankingTabsComic .tab-btn {
    padding: 0 27px;
}

/* =====================================================
   TRUYỆN MỚI CẬP NHẬT
   DESKTOP: 4 Ô
   MOBILE: 3 Ô
   ===================================================== */

.updated-story-section {
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px;
    color: #ffffff;
    background: #151b29;
    box-sizing: border-box;
}

    .updated-story-section *,
    .updated-story-section *::before,
    .updated-story-section *::after {
        box-sizing: border-box;
    }

/* =====================================================
   TIÊU ĐỀ KHU VỰC
   ===================================================== */

.updated-story-heading {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

    .updated-story-heading h2 {
        position: relative;
        margin: 0;
        padding-left: 15px;
        color: #ffffff;
        font-size: 26px;
        font-weight: 900;
        line-height: 1.3;
    }

        .updated-story-heading h2::before {
            content: "";
            position: absolute;
            top: 4px;
            bottom: 4px;
            left: 0;
            width: 5px;
            border-radius: 999px;
            background: linear-gradient( 180deg, #ffda63 0%, #ff7a00 100% );
            box-shadow: 0 0 14px rgba(255, 174, 0, 0.45);
        }

    .updated-story-heading > a {
        flex: 0 0 auto;
        color: #f6be3b;
        font-size: 14px;
        font-weight: 800;
        text-decoration: none;
        transition: color 0.2s ease, transform 0.2s ease;
    }

        .updated-story-heading > a:hover {
            color: #ffffff;
            transform: translateX(3px);
        }

/* =====================================================
   GRID DESKTOP: 4 Ô
   ===================================================== */

.updated-story-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* =====================================================
   CARD TRUYỆN
   ===================================================== */

.updated-story-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    background: #1b2232;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

    .updated-story-card:hover {
        transform: translateY(-6px);
        border-color: rgba(255, 190, 59, 0.45);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 190, 59, 0.08);
    }

/* =====================================================
   ẢNH BÌA
   ===================================================== */

.updated-story-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    display: block;
    overflow: hidden;
    background: #0f1420;
    text-decoration: none;
}

    .updated-story-cover::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 35%;
        pointer-events: none;
        background: linear-gradient( 180deg, transparent 0%, rgba(15, 20, 32, 0.82) 100% );
    }

    .updated-story-cover img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center;
        transition: transform 0.35s ease, filter 0.35s ease;
    }

.updated-story-card:hover .updated-story-cover img {
    transform: scale(1.055);
    filter: brightness(1.06);
}

/* =====================================================
   NHÃN MỚI CẬP NHẬT
   ===================================================== */

.updated-story-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: linear-gradient( 135deg, #ff4040 0%, #ff7b2c 100% );
    box-shadow: 0 6px 18px rgba(255, 71, 71, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

/* =====================================================
   NỘI DUNG CARD
   ===================================================== */

.updated-story-content {
    padding: 10px;
}

/* =====================================================
   TÊN TRUYỆN
   ===================================================== */

.updated-story-title {
    margin: 0 0 10px;
    min-height: 40px;
    font-size: 16px;
    line-height: 1.35;
}

    .updated-story-title a {
        display: -webkit-box;
        overflow: hidden;
        color: #ffffff;
        text-decoration: none;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        transition: color 0.2s ease;
    }

        .updated-story-title a:hover {
            color: #ffd15c;
        }

/* =====================================================
   CHƯƠNG MỚI NHẤT
   ===================================================== */

.updated-story-chapter {
    width: 100%;
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
  
    color: #ffd15c;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}


.chapter-icon {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1;
}

.chapter-name {
    min-width: 0;
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================
   THỐNG KÊ
   ===================================================== */

.updated-story-stats {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.updated-story-stat {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 6px;

    color: #9baaca;
}

    .updated-story-stat.update-time {
        grid-column: 1 / -1;
        color: #55d6be;
    }

    .updated-story-stat.recommendation {
        color: #ffc94f;
    }

.stat-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}

.stat-value {
    min-width: 0;
    display: block;
    overflow: hidden;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================
   TABLET: VẪN 4 Ô
   ===================================================== */

@media (max-width: 1100px) {
    .updated-story-section {
        padding: 20px;
    }

    .updated-story-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }

    .updated-story-content {
        padding: 10px;
    }

    .updated-story-title {
        min-height: 43px;
        font-size: 16px;
    }

    .chapter-name {
        font-size: 12px;
    }

    .stat-value {
        font-size: 11px;
    }
}

/* =====================================================
   MOBILE VÀ TABLET NHỎ: 3 Ô
   HIỂN THỊ ĐỦ THÔNG TIN
   ===================================================== */

@media (max-width: 800px) {
    .updated-story-section {
        padding: 18px 12px;
    }

    .updated-story-heading {
        margin-bottom: 15px;
    }

        .updated-story-heading h2 {
            font-size: 21px;
        }

    .updated-story-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .updated-story-card {
        border-radius: 14px;
    }

    .updated-story-content {
        padding: 9px 7px;
    }

    .updated-story-title {
        margin-bottom: 7px;
        min-height: 38px;
        font-size: 14px;
    }

    .updated-story-chapter {
        padding: 7px 6px;
        gap: 4px;
        border-radius: 8px;
    }

    .chapter-icon {
        font-size: 10px;
    }

    .chapter-name {
        font-size: 10px;
    }

    .updated-story-stats {
        margin-top: 7px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .updated-story-stat {
        padding: 5px;
        gap: 4px;
        border-radius: 7px;
    }

        .updated-story-stat.update-time {
            grid-column: 1 / -1;
        }

    .stat-icon {
        font-size: 10px;
    }

    .stat-value {
        font-size: 9px;
    }
}

/* =====================================================
   ĐIỆN THOẠI: 3 Ô
   KHÔNG ẨN THÔNG TIN
   ===================================================== */

@media (max-width: 520px) {
    .updated-story-section {
        padding: 14px 6px;
    }

    .updated-story-heading {
        margin-bottom: 12px;
        padding: 0 3px;
    }

        .updated-story-heading h2 {
            padding-left: 10px;
            font-size: 18px;
        }

            .updated-story-heading h2::before {
                width: 4px;
            }

        .updated-story-heading > a {
            font-size: 10px;
        }

    .updated-story-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .updated-story-card {
        border-radius: 10px;
    }

        .updated-story-card:hover {
            transform: none;
        }

    .updated-story-badge {
        top: 5px;
        left: 5px;
        padding: 4px 5px;
        font-size: 7px;
    }

    .updated-story-content {
        padding: 7px 5px;
    }

    .updated-story-title {
        margin-bottom: 5px;
        min-height: 31px;
        font-size: 11px;
        line-height: 1.4;
    }

    .updated-story-chapter {
        padding: 5px 4px;
        gap: 3px;
        border-radius: 6px;
    }

    .chapter-icon {
        font-size: 8px;
    }

    .chapter-name {
        font-size: 8px;
    }

    .updated-story-stats {
        margin-top: 5px;
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .updated-story-stat {
        width: 100%;
        padding: 4px;
        gap: 3px;
        border-radius: 5px;
    }

        .updated-story-stat.update-time {
            grid-column: auto;
        }

    .stat-icon {
        width: 11px;
        font-size: 8px;
    }

    .stat-value {
        font-size: 8px;
    }
}

/* =====================================================
   ĐIỆN THOẠI RẤT NHỎ: VẪN 3 Ô
   ===================================================== */

@media (max-width: 360px) {
    .updated-story-section {
        padding-right: 4px;
        padding-left: 4px;
    }

    .updated-story-grid {
        gap: 4px;
    }

    .updated-story-content {
        padding-right: 4px;
        padding-left: 4px;
    }

    .updated-story-title {
        font-size: 10px;
    }

    .chapter-name,
    .stat-value {
        font-size: 7px;
    }

    .updated-story-badge {
        font-size: 6px;
    }
}
/* =====================================================
   BADGE THỐNG KÊ ĐÈ Ở CUỐI ẢNH
   ===================================================== */

.image-stat-badge {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    min-width: 0;
    overflow: hidden;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: rgba(10, 14, 24, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    pointer-events: none;
}

.image-stat-item {
    min-width: 0;
    padding: 7px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    overflow: hidden;
    color: #d9e1f2;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

    .image-stat-item + .image-stat-item {
        border-left: 1px solid rgba(255, 255, 255, 0.14);
    }

.image-stat-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.image-view .image-stat-icon {
    color: #5bc0ff;
}

.image-follow .image-stat-icon {
    color: #ff6178;
}

.image-rate .image-stat-icon {
    color: #ffd04f;
}

/* =====================================================
   THỜI GIAN CẬP NHẬT
   ===================================================== */

.updated-story-time {
    margin-top: 9px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(48, 210, 174, 0.18);
    border-radius: 9px;
    background: rgba(48, 210, 174, 0.08);
    color: #55d6be;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.updated-story-time-icon {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
}

/* =====================================================
   RESPONSIVE MOBILE: VẪN ĐỦ 3 THÔNG SỐ
   ===================================================== */

@media (max-width: 800px) {
    .image-stat-badge {
        right: 5px;
        bottom: 5px;
        left: 5px;
        border-radius: 7px;
    }

    .image-stat-item {
        padding: 5px 3px;
        gap: 3px;
        font-size: 9px;
    }

    .image-stat-icon {
        font-size: 9px;
    }

    .updated-story-time {
        margin-top: 6px;
        padding: 5px 6px;
        gap: 4px;
        border-radius: 6px;
        font-size: 9px;
    }

    .updated-story-time-icon {
        font-size: 9px;
    }
}

@media (max-width: 520px) {
    .image-stat-badge {
        right: 3px;
        bottom: 3px;
        left: 3px;
        border-radius: 5px;
    }

    .image-stat-item {
        padding: 4px 2px;
        gap: 2px;
        font-size: 7px;
    }

    .image-stat-icon {
        font-size: 7px;
    }

    .updated-story-time {
        padding: 4px;
        font-size: 8px;
    }

    .updated-story-time-icon {
        font-size: 8px;
    }
}
/* badge trong menu Tủ sách */
.follow-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    position:absolute;
    top:0px;right:-5px;
    border-radius: 999px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(229, 57, 53, .35);
}


/* nút trợ lý phải làm mốc cho badge */
.assistive-touch-button {
    position: relative;
}


/* badge trên icon trợ lý */
.assistive-main-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e53935;
    color: white;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5 !important;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    z-index: 5;
}


/* để badge Tủ sách nằm sát bên phải */
.assistive-touch-link {
    display: flex;
    align-items: center;
}
.posrelative{
    position:relative;
}
.mobile-filter-toggle {
    display: none;
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border-radius: 14px;
    border: 1px dashed var(--border);
    background: var(--bg-soft);
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    transition: 0.2s;
}
@media (max-width: 980px) {
   #search_advance .layout {
        grid-template-columns: 1fr;
    }
    #search_advance .filter-panel {
        position: static;
    }
    #search_advance .story-item .cover{
        min-height:unset !important;
        position:relative;
    }
        #search_advance .story-item .cover img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            object-position: center center;
            transition: transform 0.35s, filter 0.35s;
        }
    #search_advance .story-item .cover {
        min-height: unset !important;
        position: relative;
    }
    #search_advance .story-item, .result-list.grid-view .story-item {
        grid-template-columns: 1fr;
    }
    #search_advance .cover, .grid-view .cover {
        width: 100%;
        height: 240px;
    }
    #search_advance .mobile-filter-toggle {
        display: block;
    }

    #search_advance .filter-panel .mobile-filter-extra {
        display: none;
    }

    #search_advance .filter-panel.mobile-expanded .mobile-filter-extra {
        display: block !important;
    }
}


    #search_advance .mobile-filter-toggle:hover {
        border-color: rgba(255, 204, 77, 0.55);
        background: rgba(255, 204, 77, 0.07);
    }

    #search_advance .mobile-filter-toggle .arrow {
        display: inline-block;
        margin-left: 6px;
        transition: transform 0.2s ease;
    }

#search_advance .filter-panel.mobile-expanded .mobile-filter-toggle .arrow {
    transform: rotate(180deg);
}
.notify-check {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

    .notify-check input {
        width: 19px;
        height: 19px;
        accent-color: #ffcc4d;
        cursor: pointer;
    }


/* MODAL */

.member-notify-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(4px);
}

    .member-notify-modal.show {
        display: flex;
    }

.member-notify-box {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    border-radius: 20px;
    background: #181d2a;
    border: 1px solid #30384d;
    color: #fff;
    text-align: center;
}

.member-notify-icon {
    font-size: 38px;
    margin-bottom: 12px;
}

.member-notify-box h3 {
    margin: 0 0 10px;
    font-size: 21px;
}

.member-notify-box p {
    margin: 0;
    color: #9ca6bd;
    font-size: 14px;
    line-height: 1.6;
}

.member-notify-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}

    .member-notify-actions button {
        min-height: 44px;
        border: 0;
        border-radius: 12px;
        cursor: pointer;
        background: #292f3f;
        color: #fff;
        font-weight: 700;
    }

    .member-notify-actions .confirm {
        background: #ffcc4d;
        color: #111;
    }