/* ==========================================================================
   VNS STUDIO - LOCAL FONTS (Eliminates FOUT font swap and text expansion)
   ========================================================================== */
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url('../fonts/be-vietnam-pro-400.woff2') format('woff2'),
         url('../fonts/be-vietnam-pro-400-latin.woff2') format('woff2');
    unicode-range: U+0000-02BA, U+0300-0329, U+1EA0-1EF9, U+2000-206F, U+20AB;
}

@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url('../fonts/be-vietnam-pro-600.woff2') format('woff2'),
         url('../fonts/be-vietnam-pro-600-latin.woff2') format('woff2');
    unicode-range: U+0000-02BA, U+0300-0329, U+1EA0-1EF9, U+2000-206F, U+20AB;
}

@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 700;
    font-display: optional;
    src: url('../fonts/be-vietnam-pro-700.woff2') format('woff2'),
         url('../fonts/be-vietnam-pro-700-latin.woff2') format('woff2');
    unicode-range: U+0000-02BA, U+0300-0329, U+1EA0-1EF9, U+2000-206F, U+20AB;
}

/* ==========================================================================
   VNS STUDIO - MODERN PERFORMANCE & RESPONSIVE DESIGN SYSTEM
   "Content first, fast loading, clear hierarchy, minimal effects, easy navigation"
   ========================================================================== */

:root {
    /* Color Palette */
    --pink: #e93573;
    --pink-hover: #d3205f;
    --pink-soft: #fff0f5;
    --pink-border: #ffd3e2;
    --green: #117e5d;
    --green-hover: #0c6348;
    --green-soft: #ecfaf4;
    --green-border: #bde7d7;

    /* Light Theme Surface & Text */
    --bg: #fcfcfd;
    --surface: #ffffff;
    --surface-2: #f4f5f8;
    --surface-3: #eaecee;
    --line: #e5e7eb;
    --line-subtle: #f0f2f5;
    --text: #1e2430;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Reader Customization Defaults */
    --reader-bg: #ffffff;
    --reader-text: #1e2430;
    --reader-font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --reader-size: 18px;
    --reader-max-w: 780px;

    /* Metrics & Spacing */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --container-w: 1240px;
    --header-h: 62px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
    --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);

    --font-sans: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #21262d;
    --surface-3: #2d333b;
    --line: #30363d;
    --line-subtle: #24292f;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-light: #6e7681;

    --pink-soft: #2e1522;
    --pink-border: #4d2338;
    --green-soft: #0d281e;
    --green-border: #1a4d3a;

    --reader-bg: #161b22;
    --reader-text: #e6edf3;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Base Reset & Document Rules */
*, *::before, *::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100vw;
}

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

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

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

/* Accessibility: Skip Link & Focus */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--pink);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    z-index: 99999;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
}

:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   SHARED UTILITIES & BASE PATTERNS
   ========================================================================== */

/* Text truncation - replaces 15+ inline occurrences */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Circular flex-center icon container - replaces 4+ inline patterns */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Panel / Card surface container base */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Layout Container */
.container {
    width: min(calc(100% - 32px), var(--container-w));
    margin-inline: auto;
}

/* Announcement Bar */
.site-announcement {
    background: var(--pink-soft);
    color: var(--pink);
    border-bottom: 1px solid var(--pink-border);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 8px 16px;
}

/* ==========================================================================
   GLOBAL HEADER & NAVIGATION
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand strong {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.2px;
    color: var(--text);
}

.brand small {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Search Bar */
.search-form {
    flex: 1;
    max-width: 460px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-form input {
    width: 100%;
    height: 38px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    padding: 0 16px 0 38px;
    font-size: 13px;
    color: var(--text);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.search-form input:focus {
    border-color: var(--pink);
    background: var(--surface);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 14px;
    pointer-events: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wallet-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pink);
    transition: background-color 0.15s;
}

.wallet-badge:hover {
    background: var(--pink-soft);
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: color 0.15s, background-color 0.15s;
}

.theme-toggle-btn:hover {
    color: var(--text);
    background: var(--surface-3);
}

.theme-icon-dark {
    display: none;
}
.theme-icon-light {
    display: block;
}
[data-theme="dark"] .theme-icon-dark {
    display: block;
}
[data-theme="dark"] .theme-icon-light {
    display: none;
}

/* Mobile Hamburger Button */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
}

/* Category & Secondary Nav Bar */
.nav-bar {
    background: var(--surface);
    border-top: 1px solid var(--line-subtle);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 4px;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 0;
    white-space: nowrap;
    position: relative;
    transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--pink);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--pink);
    border-radius: 2px;
}

/* ==========================================================================
   BUTTONS & UI ELEMENTS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--pink);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--pink-hover);
    color: #ffffff;
}

.btn-green {
    background: var(--green);
    color: #ffffff;
}

.btn-green:hover {
    background: var(--green-hover);
    color: #ffffff;
}

.btn-ghost {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-3);
}

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

.btn-outline:hover {
    background: var(--pink-soft);
}

.btn-writer {
    background: var(--green-soft);
    border-color: var(--green-border);
    color: var(--green);
}

.btn-writer:hover {
    background: var(--green);
    color: #ffffff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

.btn-full {
    width: 100%;
}

.btn-pill {
    border-radius: var(--radius-full) !important;
    padding: 7px 18px !important;
}

.btn-pill-lg {
    border-radius: var(--radius-full) !important;
    padding: 9px 24px !important;
    font-size: 13.5px !important;
}

.btn-ghost-light {
    background: rgba(255, 255, 255, 0.16) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    backdrop-filter: blur(8px);
}

.btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
}

.btn-outline-pink {
    background: transparent;
    border: 1px solid var(--pink);
    color: var(--pink);
    transition: all 0.15s ease;
}

.btn-outline-pink:hover {
    background: var(--pink);
    color: #ffffff;
}

.btn-writer-outline-pill {
    background: transparent;
    border: 1.5px solid #10b981;
    color: #10b981;
    border-radius: var(--radius-full);
    padding: 7px 18px;
    font-size: 12.5px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.btn-writer-outline-pill:hover {
    background: #10b981;
    color: #ffffff;
}

/* ==========================================================================
   HOMEPAGE & HERO SECTION
   ========================================================================== */

.page-home {
    padding: 12px 0 16px;
}

/* 1. HERO CAROUSEL & SIDE SPOTLIGHT */
.hero-section {
    margin-bottom: 14px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 14px;
    min-height: 400px;
}

.hero-slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #11141c;
    box-shadow: var(--shadow);
}

.hero-slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 34px 36px;
    max-width: 520px;
    color: #ffffff;
    background: linear-gradient(90deg, rgba(13, 17, 23, 0.90) 0%, rgba(13, 17, 23, 0.6) 55%, rgba(13, 17, 23, 0.15) 88%);
}

.hero-slide-overlay .badge-pill {
    display: inline-block;
    align-self: flex-start;
    background: var(--pink);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    margin-bottom: 12px;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 12px rgba(233, 53, 115, 0.35);
}

.hero-slide-title {
    font-size: 28px;
    line-height: 1.15;
    margin: 0 0 6px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.hero-slide-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin: 0 0 10px;
}

.hero-slide-desc {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Slider Controls */
.hero-slider-nav {
    position: absolute;
    bottom: 18px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slider-arrow {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 0;
}

.slider-arrow:hover {
    background: var(--pink);
}

.slider-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.slider-dot.active {
    width: 18px;
    background: var(--pink);
}

/* Hero Side Curated Cards */
.hero-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.hero-card {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #181b24;
    min-height: 190px;
    box-shadow: var(--shadow-sm);
    display: block;
}

.hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero-card:hover img {
    transform: scale(1.04);
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(13, 17, 23, 0.85) 100%);
}

.hero-card-meta {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 2;
    color: #ffffff;
}

.hero-side-badge {
    display: inline-block;
    background: var(--pink);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-card h2 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-card span {
    font-size: 11px;
    color: #cbd5e1;
}

.hero-card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
}

.hero-card-link {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff !important;
    opacity: 0.9;
    white-space: nowrap;
}

/* 2. GENRE STRIP & CHIPS - BỌC CHỮ KHÔNG ICON */
.genre-strip {
    padding: 10px 0 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.chips-scroll-wrap {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.chips-scroll-wrap::-webkit-scrollbar {
    display: none;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.chip-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.chip-item:hover, .chip-item.active {
    background: var(--pink);
    border-color: var(--pink);
    color: #ffffff;
    font-weight: 600;
}

/* 4. SECTION HEADINGS & ACTIONS */
.section-heading-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.section-heading-bar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.heading-bar-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heading-bar-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--text);
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 8px;
}

.heading-bar-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--pink);
    border-radius: 2px;
    flex-shrink: 0;
}

.heading-bar-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    padding-left: 12px;
}

.heading-bar-link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pink);
    white-space: nowrap;
    transition: opacity 0.15s;
}

.heading-bar-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

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

.heading-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.section-heading h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    position: relative;
    padding-left: 12px;
    color: var(--text);
    line-height: 1.2;
}

.section-heading h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3.5px;
    background: var(--pink);
    border-radius: var(--radius-full);
}

.heading-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    padding-left: 12px;
}

.heading-link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pink);
    white-space: nowrap;
}

.heading-link:hover {
    text-decoration: underline;
}

.section-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-switch {
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.view-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.view-btn:hover {
    color: var(--text);
}

.view-btn.active {
    background: var(--surface);
    color: var(--pink);
    box-shadow: var(--shadow-sm);
}

.view-btn svg {
    pointer-events: none;
}

/* 5. NOVEL GRID & UPGRADED NOVEL CARD */
.content-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
    padding: 6px 0 14px;
    align-items: start;
}

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

.section-block {
    margin-bottom: 16px;
}

.section-block-sm {
    margin-bottom: 12px;
}

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

.novel-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
}

.novel-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--pink-border);
}

.cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 2.8;
    background: var(--surface-2);
    overflow: hidden;
    display: block;
}

.cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.novel-card:hover .cover-wrap img {
    transform: scale(1.04);
}

.card-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-floating-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--pink);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    line-height: 1.2;
    pointer-events: none;
}

.card-floating-pill.pill-full {
    background: #10b981;
}

.badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.badge-hot {
    background: #ef4444;
    color: #ffffff;
}

.badge-full {
    background: #10b981;
    color: #ffffff;
}

.card-chapter-pill {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.novel-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    font-size: 10px;
    font-weight: 700;
    color: var(--pink);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
    display: block;
}

.novel-title-wrap {
    margin: 0 0 4px;
    font-size: 13.5px;
    line-height: 1.35;
}

.novel-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
    text-decoration: none;
}

.novel-title:hover {
    color: var(--pink);
}

.card-author-line {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-author-line a:hover {
    color: var(--text);
}

.card-genre-sub {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--line-subtle);
}

.card-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.card-stat.card-likes {
    color: var(--pink);
    font-weight: 600;
}

.card-author {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
    color: var(--text-muted);
}

.card-author:hover {
    color: var(--text);
}

.card-views {
    font-weight: 600;
    white-space: nowrap;
    font-size: 10.5px;
}

/* Shared card hover lift */
.author-card:hover,
.featured-author-card:hover,
.package-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}



/* BOTTOM AUTHOR BANNER STRIP */
.author-banner-strip {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    margin: 10px 0 14px;
}

.author-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--pink-soft);
    color: var(--pink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.author-banner-text strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}

.author-banner-text p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* 6. STREAM LIST VIEW (COMPACT ROW) */
.novel-stream-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.novel-row-item {
    display: grid;
    grid-template-columns: 44px 1.4fr 1.2fr auto;
    gap: 14px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s ease;
}

.novel-row-item:hover {
    background: var(--surface-2);
}

.novel-row-item:last-child {
    border-bottom: none;
}

.novel-row-cover {
    width: 44px;
    height: 58px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-2);
}

.novel-row-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-row-title-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.novel-row-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.novel-row-title:hover {
    color: var(--pink);
}

.novel-row-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.novel-row-category {
    color: var(--pink);
    font-weight: 600;
}

.novel-row-author {
    color: var(--text-muted);
}

.novel-row-author:hover {
    color: var(--text);
}

.novel-row-chapter-link {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.novel-row-chapter-link:hover {
    color: var(--pink);
}

.novel-row-chapter-title {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.novel-row-time {
    font-size: 11px;
    color: var(--text-light);
    text-align: right;
    white-space: nowrap;
}

/* 9. SIDEBAR & INTERACTIVE RANKINGS */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ranking-widget {
    padding: 12px 14px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ranking-pill-tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 4px;
    margin-bottom: 10px;
}

.ranking-pill-tabs button {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.ranking-pill-tabs button.active {
    background: var(--pink);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(233, 53, 115, 0.3);
}

/* Shared list-row patterns */
.rank-row,
.chapter-item,
.rank-full-row {
    border-bottom: 1px solid var(--line-subtle);
    color: inherit;
    transition: background 0.15s;
}

.rank-row:hover,
.chapter-item:hover,
.rank-full-row:hover {
    background: var(--surface-2);
}

.rank-row:last-of-type,
.chapter-item:last-of-type,
.rank-full-row:last-of-type {
    border-bottom: none;
}

.rank-row {
    display: grid;
    grid-template-columns: 24px 44px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 4px;
    text-decoration: none;
}

.rank-row:hover {
    border-radius: var(--radius-xs);
}

.rank-number {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rank-number.gold {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.35);
}

.rank-number.silver {
    background: #94a3b8;
    color: #ffffff;
}

.rank-number.bronze {
    background: #d97706;
    color: #ffffff;
}

.rank-number.other {
    background: var(--surface-2);
    color: var(--text-muted);
}

.rank-row img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    background: var(--surface-2);
}

.rank-info {
    min-width: 0;
    flex: 1;
}

.rank-info b {
    font-size: 12.5px;
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    line-height: 1.3;
}

.rank-author {
    font-size: 11px;
    color: var(--text-muted);
    margin: 1px 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    color: var(--text-muted);
}

.rank-views, .rank-likes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.rank-likes {
    color: var(--pink);
    font-weight: 600;
}

.rank-empty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 25px 0;
}

/* Side Callouts */
.side-cta {
    padding: 18px;
    border-radius: var(--radius);
}

.side-cta-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
}

.side-cta.green {
    background: var(--green-soft);
    border: 1px solid var(--green-border);
}

.side-cta.green .side-cta-badge {
    background: var(--green);
    color: #ffffff;
}

.side-cta strong {
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
    line-height: 1.3;
}

.side-cta.green strong { color: var(--green); }

.side-cta-features {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    margin: 10px 0 14px;
    color: var(--text);
}

.side-cta.pink {
    background: var(--pink-soft);
    border: 1px solid var(--pink-border);
}

.side-cta.pink .side-cta-badge {
    background: var(--pink);
    color: #ffffff;
}

.side-cta.pink strong { color: var(--pink); }

.side-cta p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 12px;
}

/* ==========================================================================
   NOVEL DETAIL PAGE
   ========================================================================== */

.novel-hero {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    padding: 24px;
    margin-bottom: 24px;
}

.novel-detail-cover {
    width: 200px;
    aspect-ratio: 2 / 2.8;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    background: var(--surface-2);
}

.novel-detail-main h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 8px 0;
    line-height: 1.25;
}

.novel-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.novel-meta-tags span {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-muted);
}

.novel-stats-line {
    font-size: 12px;
    color: var(--text-muted);
    margin: 10px 0 14px;
}

.novel-stats-line strong {
    color: var(--text);
}

.lead {
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 820px;
    margin-bottom: 18px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Chapter List */
.chapter-list {
    padding: 20px;
}

.chapter-item {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 6px;
}

.chapter-item:hover {
    border-radius: var(--radius-xs);
}

.chapter-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.chapter-title {
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-tag {
    background: var(--pink-soft);
    color: var(--pink);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    border: 1px solid var(--pink-border);
}

/* Author Panel */
.author-panel {
    padding: 20px;
}

.author-panel h2 {
    font-size: 16px;
    margin: 0 0 10px;
}

.author-panel strong {
    font-size: 14px;
    color: var(--pink);
}

.author-panel p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 6px;
}

/* ==========================================================================
   CHAPTER READER PAGE
   ========================================================================== */

.reading-page {
    background: var(--surface-2);
    min-height: calc(100vh - var(--header-h));
    padding: 20px 0 60px;
}

.reading-shell {
    max-width: var(--reader-max-w);
    margin-inline: auto;
    transition: max-width 0.2s ease;
}

.reading-shell.wide {
    --reader-max-w: 960px;
}

/* Reader Toolbar */
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.reader-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-breadcrumb a {
    color: var(--pink);
    font-weight: 700;
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.reader-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    color: var(--text);
    transition: background 0.15s;
}

.reader-ctrl-btn:hover {
    background: var(--surface-3);
}

.reader-font-btn {
    display: none !important;
}

/* Reader Body */
.reader-article {
    background: var(--reader-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px 56px;
    box-shadow: var(--shadow);
    color: var(--reader-text);
}

.reader-article h1 {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 32px;
    line-height: 1.35;
}

.reader-content,
.reader-content.font-sans {
    font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: var(--reader-size);
    line-height: 1.88;
    word-break: break-word;
}

.reader-content.font-serif {
    font-family: "Noto Serif", "Georgia", "Times New Roman", serif !important;
    font-size: var(--reader-size);
    line-height: 1.88;
    word-break: break-word;
}

.reader-content p {
    margin: 0 0 1.25em;
    text-indent: 1.5em;
}

/* Unlock Box */
.unlock-box {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface-2);
    border: 1px dashed var(--pink-border);
    border-radius: var(--radius);
    margin: 20px 0;
}

.unlock-box strong {
    font-size: 16px;
    color: var(--pink);
    display: block;
    margin-bottom: 8px;
}

.unlock-box p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.unlock-box .inline-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Chapter Navigation */
.chapter-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.chapter-nav > div:last-child {
    text-align: right;
}

/* Shared form control base - applied via component selectors below */
.comment-form textarea,
.gift-form input[type="number"],
.gift-form input[type="text"],
.gift-form input[name="message"],
.catalog-toolbar-input,
.catalog-toolbar-select,
.auth-card input,
.drawer-search input,
.chat-form input,
.category-search-input {
    background-color: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.comment-form textarea:focus,
.catalog-toolbar-input:focus,
.catalog-toolbar-select:focus,
.auth-card input:focus,
.chat-form input:focus,
.category-search-input:focus {
    border-color: var(--pink);
    background-color: var(--surface);
}

/* Comments & Donations below Chapter */
.reader-extra-section {
    margin-top: 20px;
}

.comments-panel {
    padding: 24px;
    margin-top: 18px;
}

.comment-form textarea {
    width: 100%;
    min-height: 90px;
    border-radius: var(--radius-sm);
    padding: 12px;
    resize: vertical;
    font-size: 13px;
}

.comment-form .btn {
    margin-top: 10px;
}

.comment-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-subtle);
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.avatar-initial {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--pink-soft);
    color: var(--pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.comment-body strong {
    font-size: 13px;
    color: var(--text);
}

.comment-body .muted {
    font-size: 11px;
    color: var(--text-muted);
}

.comment-body p {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Gift / Donation Form */
.gift-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.gift-form input[type="number"] {
    width: 110px;
    height: 38px;
    border-radius: var(--radius-sm);
    padding: 0 10px;
}

.gift-form input[type="text"], .gift-form input[name="message"] {
    flex: 1;
    min-width: 180px;
    height: 38px;
    border-radius: var(--radius-sm);
    padding: 0 12px;
}

.gift-form label.check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

/* ==========================================================================
   RANKING & AUTHORS FULL PAGE
   ========================================================================== */

.page-section {
    padding: 16px 0 24px;
}

.page-title {
    margin-bottom: 14px;
}

.page-title .eyebrow {
    font-size: 11px;
    font-weight: 800;
    color: var(--pink);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.page-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0 20px;
}

.page-tabs a {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    font-size: 12.5px;
    transition: all 0.15s ease;
}

.page-tabs a.active, .page-tabs a:hover {
    background: var(--pink);
    border-color: var(--pink);
    color: #ffffff;
}

/* ==========================================================================
   VNS STUDIO - MODERN LEADERBOARD & RANKING PODIUM SYSTEM
   ========================================================================== */

.ranking-page-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ranking-page-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 4px 0 6px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ranking-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--pink-soft);
    color: var(--pink);
    border: 1px solid var(--pink-border);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.ranking-badge-live .live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ranking-btn-rule {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ranking-btn-rule:hover {
    color: var(--pink);
    border-color: var(--pink-border);
    background: var(--pink-soft);
}

/* Time Tabs: Ngày / Tuần / Tháng / Năm */
.rank-time-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.rank-time-tab {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.rank-time-tab:hover {
    border-color: var(--pink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.rank-time-tab.active {
    background: linear-gradient(135deg, #e93573 0%, #ff5b94 100%);
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(233, 53, 115, 0.3);
    transform: translateY(-2px);
}

.rank-time-tab-title {
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-time-tab-desc {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.rank-time-tab.active .rank-time-tab-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* Secondary Filter Bar: Types & Categories */
.rank-filter-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-types-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.rank-type-pill {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rank-type-pill:hover {
    color: var(--pink);
    background: var(--pink-soft);
}

.rank-type-pill.active {
    background: var(--pink);
    color: #ffffff !important;
    border-color: var(--pink);
    box-shadow: 0 3px 10px rgba(233, 53, 115, 0.25);
}

.rank-cat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.rank-cat-chip {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.rank-cat-chip:hover {
    border-color: var(--pink);
    color: var(--pink);
}

.rank-cat-chip.active {
    background: var(--text);
    color: var(--surface) !important;
    border-color: var(--text);
}

[data-theme="dark"] .rank-cat-chip.active {
    background: #ffffff;
    color: #000000 !important;
}

/* ==========================================================================
   THE PODIUM: TOP 3 HIGHLIGHT SECTION
   ========================================================================== */
.rank-podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
    gap: 18px;
    margin: 28px 0 36px;
}

.podium-col {
    display: flex;
    flex-direction: column;
}

.podium-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 22px 18px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

/* Rank 1 - Champion (Gold) */
.podium-card.rank-1 {
    border: 2px solid #f59e0b;
    box-shadow: 0 16px 36px rgba(245, 158, 11, 0.22);
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.3) 0%, var(--surface) 35%);
    transform: translateY(-10px);
}

[data-theme="dark"] .podium-card.rank-1 {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, var(--surface) 35%);
}

.podium-card.rank-1:hover {
    transform: translateY(-14px);
    box-shadow: 0 20px 42px rgba(245, 158, 11, 0.3);
}

/* Rank 2 - Silver */
.podium-card.rank-2 {
    border: 2px solid #94a3b8;
    box-shadow: 0 12px 28px rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.5) 0%, var(--surface) 35%);
}

[data-theme="dark"] .podium-card.rank-2 {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.1) 0%, var(--surface) 35%);
}

/* Rank 3 - Bronze */
.podium-card.rank-3 {
    border: 2px solid #d97706;
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.16);
    background: linear-gradient(180deg, rgba(254, 215, 170, 0.35) 0%, var(--surface) 35%);
}

[data-theme="dark"] .podium-card.rank-3 {
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.1) 0%, var(--surface) 35%);
}

.podium-badge {
    position: absolute;
    top: -14px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.podium-card.rank-1 .podium-badge {
    background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
    color: #78350f;
}

.podium-card.rank-2 .podium-badge {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    color: #1e293b;
}

.podium-card.rank-3 .podium-badge {
    background: linear-gradient(135deg, #fed7aa 0%, #f97316 100%);
    color: #7c2d12;
}

.podium-cover-wrap {
    position: relative;
    margin-top: 10px;
    margin-bottom: 12px;
}

.podium-card.rank-1 .podium-cover {
    width: 96px;
    height: 132px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    object-fit: cover;
    border: 2px solid #fbbf24;
}

.podium-card.rank-2 .podium-cover,
.podium-card.rank-3 .podium-cover {
    width: 82px;
    height: 114px;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
    object-fit: cover;
}

.podium-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    margin-bottom: 4px;
    min-height: 40px;
}

.podium-title:hover {
    color: var(--pink);
}

.podium-author {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.podium-score-box {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    width: 100%;
    margin-bottom: 12px;
}

.podium-main-score {
    font-size: 16px;
    font-weight: 900;
    color: var(--pink);
}

.podium-sub-metrics {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 3px;
}

.podium-actions {
    display: flex;
    gap: 6px;
    width: 100%;
}

.podium-actions .btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   THE LEADERBOARD STREAM: RANKS 4 AND BEYOND
   ========================================================================== */
.ranking-list-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.ranking-list-header {
    padding: 14px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ranking-list-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.rank-row-card {
    display: grid;
    grid-template-columns: 48px 58px minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s ease;
    text-decoration: none;
    color: var(--text);
}

.rank-row-card:last-child {
    border-bottom: none;
}

.rank-row-card:hover {
    background: var(--surface-2);
}

.rank-pos {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-light);
    text-align: center;
}

.rank-pos.gold { color: #f59e0b; }
.rank-pos.silver { color: #94a3b8; }
.rank-pos.bronze { color: #d97706; }

.rank-cover-thumb {
    width: 58px;
    height: 78px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.rank-info-content {
    min-width: 0;
}

.rank-info-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rank-row-card:hover .rank-info-title {
    color: var(--pink);
}

.rank-info-author {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-cat-tag {
    display: inline-block;
    padding: 2px 7px;
    background: var(--surface-3);
    border-radius: var(--radius-xs);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.rank-info-chapter {
    font-size: 11.5px;
    color: var(--text-light);
    display: block;
}

.rank-score-cell {
    text-align: right;
    padding-left: 8px;
}

.rank-score-main {
    font-size: 16px;
    font-weight: 900;
    color: var(--pink);
    display: block;
}

.rank-score-breakdown {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.rank-action-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive for Mobile */
@media (max-width: 860px) {
    .rank-podium {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .podium-card.rank-1 {
        order: -1;
        transform: none;
    }
    .podium-card.rank-1:hover {
        transform: none;
    }
    .rank-time-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    .rank-row-card {
        grid-template-columns: 36px 50px minmax(0, 1fr) auto;
        padding: 12px 14px;
        gap: 12px;
    }
    .rank-action-cell {
        display: none;
    }
}


/* Author Cards Grid */
.author-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.author-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.author-card:hover {
    border-color: var(--pink-border);
}

.author-card img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--line);
    flex-shrink: 0;
}

.author-card strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.author-card p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-card small {
    display: block;
    font-size: 10.5px;
    color: var(--pink);
    font-weight: 600;
}

/* ==========================================================================
   HOMEPAGE LATEST CHAPTERS LIST (Matching user reference)
   ========================================================================== */

.latest-chapters-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.latest-chapter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    gap: 12px;
}

.latest-chapter-row:last-child {
    border-bottom: none;
}

.latest-chapter-row:hover {
    background: var(--surface-2);
}

.latest-chapter-row:hover .latest-chapter-novel-title {
    color: var(--pink);
}

.latest-chapter-row:hover .latest-chapter-arrow {
    transform: translateX(3px);
    color: var(--pink);
}

.latest-chapter-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.latest-chapter-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-2);
    box-shadow: var(--shadow-xs);
}

.latest-chapter-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.latest-chapter-novel-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
    line-height: 1.25;
}

.latest-chapter-sub {
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.latest-chapter-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.latest-chapter-time {
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.latest-chapter-arrow {
    color: var(--text-muted);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .latest-chapter-row {
        padding: 10px 14px;
        gap: 10px;
    }
    .latest-chapter-thumb {
        width: 40px;
        height: 40px;
    }
    .latest-chapter-novel-title {
        font-size: 13.5px;
    }
    .latest-chapter-sub {
        font-size: 11.5px;
    }
    .latest-chapter-time {
        font-size: 11.5px;
    }
}

/* ==========================================================================
   CATALOG COMPACT TOOLBAR (Matching user reference design)
   ========================================================================== */

.catalog-toolbar-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 26px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.catalog-toolbar-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
}

.catalog-toolbar-input {
    flex: 1;
    min-width: 160px;
    height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 13.5px;
    font-family: inherit;
}

.catalog-toolbar-input::placeholder {
    color: var(--text-muted);
}

.catalog-toolbar-input:focus {
    box-shadow: 0 0 0 2px rgba(233, 53, 115, 0.15);
}

.catalog-toolbar-select {
    height: 38px;
    min-width: 150px;
    padding: 0 28px 0 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.catalog-toolbar-btn {
    height: 38px;
    padding: 0 22px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.catalog-toolbar-btn:hover {
    background: var(--pink);
    color: #ffffff;
    border-color: var(--pink);
    box-shadow: 0 2px 8px rgba(233, 53, 115, 0.28);
}

.catalog-toolbar-reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pink);
    text-decoration: none;
    padding: 0 6px;
    white-space: nowrap;
}

.catalog-toolbar-reset:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .catalog-toolbar-form {
        flex-wrap: wrap;
        gap: 8px;
    }
    .catalog-toolbar-input {
        width: 100%;
        flex: 1 1 100%;
    }
    .catalog-toolbar-select {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }
    .catalog-toolbar-btn {
        flex: 1 1 100%;
        width: 100%;
    }
    .catalog-toolbar-reset {
        width: 100%;
        text-align: center;
        display: block;
        padding-top: 4px;
    }
}

/* ==========================================================================
   AUTHENTICATION & FORMS
   ========================================================================== */

.auth-wrap {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
    padding: 40px 16px;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%);
}

.auth-card {
    width: min(440px, 100%);
    padding: 36px 32px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.auth-card > img {
    margin: 0 auto 12px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
}

.auth-card p {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.auth-card form {
    text-align: left;
}

.auth-card label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-top: 14px;
    color: var(--text);
}

.auth-card input {
    width: 100%;
    height: 42px;
    margin-top: 6px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.auth-card input:focus {
    border-color: var(--pink);
    background: var(--surface);
}

.auth-card .check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-card .check input {
    width: auto;
    height: auto;
    margin: 0;
}

.auth-foot {
    margin-top: 20px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

.auth-foot a {
    color: var(--pink);
    font-weight: 700;
}

/* ==========================================================================
   PAGINATION & EMPTY STATES
   ========================================================================== */

.pagination-wrap {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.15s ease;
}

.pagination .active span, .pagination a:hover {
    background: var(--pink);
    border-color: var(--pink);
    color: #ffffff;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 13px;
}

/* ==========================================================================
   COMMUNITY, ACCOUNT & TABLES
   ========================================================================== */

.community-grid, .account-grid, .admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.community-grid .panel, .account-grid .panel, .admin-grid .panel {
    padding: 22px;
}

.thread {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-subtle);
}

.thread:last-child {
    border-bottom: none;
}

.thread strong {
    font-size: 13.5px;
}

.thread span {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.table-responsive,
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   FOOTER (CLEAN PILL/CHIP WRAPPED - NO ICONS)
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding-top: 24px;
    padding-bottom: 16px;
    margin-top: auto;
    position: relative;
}

.footer-main-grid {
    display: grid;
    grid-template-columns: 1.1fr 2fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 24px;
}

/* Brand Column */
.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.footer-brand-link img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.footer-brand-info {
    display: flex;
    flex-direction: column;
}

.footer-brand-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.2px;
}

.footer-brand-sub {
    font-size: 11.5px;
    color: var(--pink);
    font-weight: 600;
    margin-top: 2px;
}

.footer-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    max-width: 360px;
}

/* Nav Groups & Chip Pills (Bọc chữ) */
.footer-nav-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.footer-nav-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-nav-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.1px;
}

.footer-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.footer-chip:hover {
    background: var(--pink-soft);
    border-color: var(--pink-border);
    color: var(--pink);
    transform: translateY(-1px);
}

.footer-chip:active {
    transform: scale(0.97);
}

/* Bottom Copyright Row */
.footer-bottom-row {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copyright strong {
    color: var(--text);
    font-weight: 700;
}

/* ==========================================================================
   CHATBOX WIDGET (DEFERRED & CLEAN)
   ========================================================================== */

.chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
}

.chat-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px 0 16px;
    border-radius: var(--radius-full);
    background: var(--pink);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(233, 53, 115, 0.38);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.chat-fab:hover {
    transform: translateY(-2px);
    background: var(--pink-hover);
    box-shadow: 0 10px 28px rgba(233, 53, 115, 0.45);
}

.chat-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-window {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: min(360px, calc(100vw - 32px));
    height: 460px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    animation: chatSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-window[hidden] {
    display: none !important;
}

.chat-head {
    height: 56px;
    background: var(--pink);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-weight: 700;
    font-size: 13.5px;
    flex-shrink: 0;
}

.chat-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.chat-avatar-icon svg {
    stroke: #ffffff !important;
}

.chat-head-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.chat-head-title strong {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.chat-status-line {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: #4ade80;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.4);
    display: inline-block;
}

.chat-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
    padding: 0;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
}

.chat-close-btn:active {
    transform: scale(0.95);
}

.chat-close-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

.chat-messages {
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    background: var(--bg);
}

.chat-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--pink-soft);
    color: var(--pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.chat-item b {
    font-size: 11.5px;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}

.chat-item p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text);
    background: var(--surface);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    word-break: break-word;
}

.chat-empty {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    padding: 50px 15px;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.chat-form input {
    flex: 1;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    padding: 0 16px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.chat-form input:focus {
    border-color: var(--pink);
    background: var(--surface);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--pink);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.1s ease;
    padding: 0;
}

.chat-send-btn:hover {
    background: var(--pink-hover);
    transform: scale(1.05);
}

/* ==========================================================================
   PAGINATION (MODERN, RESPONSIVE, BOUNDED ICONS)
   ========================================================================== */

.pagination-wrap {
    margin-top: 32px;
    width: 100%;
}

.vns-pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.vns-pagination-nav.simple {
    justify-content: center;
}

.vns-pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.vns-pagination-info strong {
    color: var(--text);
    font-weight: 700;
}

.vns-pagination-list {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.page-item {
    display: inline-flex;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.page-link:hover {
    background: var(--surface-2);
    border-color: var(--text-light);
    color: var(--text);
}

.page-item.active .page-link {
    background: var(--pink);
    border-color: var(--pink);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(233, 53, 115, 0.3);
}

.page-item.disabled .page-link {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text-muted);
}

.page-link.ellipsis {
    border: none;
    background: transparent;
    cursor: default;
    min-width: 24px;
    padding: 0 4px;
}

.vns-pagination-nav svg,
.pagination-wrap svg,
nav[role="navigation"] svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0;
}

/* Fallback for standard Laravel pagination elements */
nav[role="navigation"] {
    width: 100%;
}

nav[role="navigation"] > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 640px) {
    .vns-pagination-nav {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-align: center;
    }
    
    .vns-pagination-list {
        justify-content: center;
    }
}

/* ==========================================================================
   MOBILE DRAWER NAVIGATION
   ========================================================================== */

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

body.drawer-open {
    overflow: hidden;
}

body.drawer-open .drawer-backdrop {
    opacity: 1;
    visibility: visible;
}

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

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.drawer-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
}

.drawer-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.drawer-search input {
    width: 100%;
    height: 40px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-size: 13px;
    color: var(--text);
    outline: none;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-nav a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}

.drawer-nav a:hover, .drawer-nav a.active {
    background: var(--pink-soft);
    color: var(--pink);
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   FEATURED AUTHORS GRID
   ========================================================================== */

.featured-authors-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 6px;
}

.featured-author-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-xs);
}

.featured-author-card:hover {
    border-color: var(--pink);
    box-shadow: 0 4px 16px rgba(233, 53, 115, 0.12);
}

.featured-author-card:hover .featured-author-name {
    color: var(--pink);
}

.featured-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--line);
}

.featured-author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.featured-author-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-author-stat {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .featured-authors-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .featured-author-card {
        padding: 12px 14px;
    }
    .featured-author-avatar {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ==========================================================================*/

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .ranking-widget {
        grid-column: 1 / -1;
    }

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

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

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

    .footer-main-grid > div:last-child {
        display: none;
    }
}

/* Tablet Portrait & Large Phones (<= 768px) */
@media (max-width: 768px) {
    .container {
        width: min(calc(100% - 20px), var(--container-w));
    }

    .header-top {
        gap: 8px;
    }

    .brand img {
        width: 34px;
        height: 34px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand small {
        display: none;
    }

    .search-form {
        display: none; /* Accessible in mobile drawer */
    }

    .nav-bar {
        display: none; /* Handled by mobile drawer */
    }

    .hamburger-btn {
        display: inline-flex;
    }

    .header-actions .btn-ghost, 
    .header-actions .btn-writer,
    .header-actions .btn-writer-outline-pill,
    .header-actions .wallet-badge {
        display: none !important;
    }

    .header-actions .btn-primary {
        padding: 6px 14px;
        font-size: 12px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-slider, .hero-slides-wrapper {
        min-height: 280px;
    }

    .hero-slide-overlay {
        padding: 18px 16px;
        max-width: 100%;
    }

    .hero-slide-title {
        font-size: 20px;
    }

    .hero-slide-desc {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .hero-slide-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .hero-slide-actions .btn-pill-lg {
        padding: 8px 16px;
        font-size: 12px;
    }

    .hero-slider-nav {
        top: 14px;
        right: 14px;
        bottom: auto;
        padding: 3px 8px;
        gap: 6px;
    }

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

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

    .latest-chapters-panel {
        border-radius: var(--radius-sm);
    }

    .latest-chapter-row {
        padding: 8px 10px;
        gap: 8px;
    }

    .latest-chapter-thumb {
        width: 40px;
        height: 40px;
    }

    .latest-chapter-info {
        min-width: 0;
        overflow: hidden;
    }

    .latest-chapter-novel-title {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .latest-chapter-sub {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .latest-chapter-time {
        font-size: 11px;
        white-space: nowrap;
    }

    .author-banner-strip {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
        padding: 14px 16px;
    }

    .author-banner-left {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    .author-banner-strip .btn {
        width: 100%;
        justify-content: center;
    }

    .featured-authors-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .featured-author-card {
        padding: 8px 10px;
        gap: 8px;
    }

    .featured-author-avatar {
        width: 36px;
        height: 36px;
    }

    .featured-author-info {
        min-width: 0;
        overflow: hidden;
    }

    .featured-author-name {
        font-size: 12.5px;
    }

    .featured-author-stat {
        font-size: 10.5px;
    }

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

    .novel-row-item {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 10px 12px;
    }

    .novel-row-chapter-title,
    .novel-row-time {
        display: none;
    }

    .novel-hero {
        grid-template-columns: 130px 1fr;
        gap: 16px;
        padding: 16px;
    }

    .novel-detail-cover {
        width: 130px;
    }

    .novel-detail-main h1 {
        font-size: 20px;
    }

    .reader-article {
        padding: 24px 16px;
    }

    .reader-article h1 {
        font-size: 19px;
        margin-bottom: 20px;
    }

    .reader-toolbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .reader-breadcrumb {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .reader-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 6px;
    }

    .reader-size-btns {
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .reader-width-btn,
    .reader-theme-btn,
    .reader-font-btn {
        display: none !important;
    }

    .chapter-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 24px;
        padding-top: 16px;
    }

    .chapter-nav-prev {
        order: 1;
    }

    .chapter-nav-next {
        order: 2;
        text-align: right;
    }

    .chapter-nav-toc {
        order: 3;
        grid-column: 1 / -1;
    }

    .chapter-nav .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12.5px;
        font-weight: 700;
        white-space: nowrap;
    }

    .reading-page {
        padding-bottom: 24px;
    }

    .community-thread-panel,
    .community-comments-panel {
        padding: 16px 14px;
    }

    .brand-sub {
        display: none;
    }

    .site-footer {
        padding-top: 18px;
        padding-bottom: 14px;
    }

    .footer-main-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 14px;
    }

    .footer-nav-groups {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .footer-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .footer-bottom-row {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        padding-top: 10px;
    }

    .community-grid, .account-grid, .admin-grid {
        grid-template-columns: 1fr;
    }

    .chat-widget {
        right: 14px;
        bottom: 14px;
    }

    .chat-fab {
        height: 42px;
        padding: 0 14px 0 12px;
        font-size: 12.5px;
    }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
    .container {
        width: min(calc(100% - 16px), var(--container-w));
    }

    .header-top {
        gap: 6px;
    }

    .brand img {
        width: 30px;
        height: 30px;
    }

    .brand strong {
        font-size: 14.5px;
        white-space: nowrap;
        max-width: none;
    }

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

    .novel-card-body {
        padding: 6px 4px;
    }

    .novel-title-wrap {
        margin: 0 0 2px;
    }

    .novel-title {
        font-size: 11.5px;
        line-height: 1.25;
        min-height: 28px;
    }

    .card-author-line {
        font-size: 10px;
    }

    .card-genre-sub {
        display: none;
    }

    .card-meta-bottom {
        font-size: 9.5px;
        gap: 4px;
    }

    .card-floating-pill {
        font-size: 8.5px;
        padding: 2px 6px;
        top: 4px;
        left: 4px;
    }

    .card-chapter-pill {
        font-size: 8px;
        padding: 1px 4px;
        right: 4px;
        bottom: 4px;
    }

    .hero-slider, .hero-slides-wrapper {
        min-height: 240px;
    }

    .hero-slide-overlay {
        padding: 14px 12px;
    }

    .hero-slide-title {
        font-size: 17px;
        margin-bottom: 4px;
    }

    .hero-slide-subtitle {
        font-size: 11.5px;
        margin-bottom: 6px;
    }

    .hero-slide-desc {
        display: none;
    }

    .hero-slide-actions {
        gap: 6px;
    }

    .hero-slide-actions .btn-pill-lg {
        padding: 6px 12px;
        font-size: 11.5px;
    }

    .hero-slider-nav {
        top: 10px;
        right: 10px;
        bottom: auto;
        padding: 2px 6px;
        gap: 4px;
    }

    .slider-arrow {
        width: 22px;
        height: 22px;
    }

    .slider-arrow svg {
        width: 12px;
        height: 12px;
    }

    .slider-dot {
        width: 5px;
        height: 5px;
    }

    .slider-dot.active {
        width: 12px;
    }

    .hero-side {
        display: none;
    }

    .featured-authors-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .latest-chapter-row {
        padding: 7px 8px;
        gap: 6px;
    }

    .latest-chapter-arrow {
        display: none;
    }

    .latest-chapter-time {
        font-size: 10px;
    }

    .novel-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .novel-detail-cover {
        width: 150px;
        margin: 0 auto;
    }

    .detail-actions {
        justify-content: center;
    }

    .chapter-item {
        grid-template-columns: 80px 1fr;
    }

    .chapter-item .price-tag {
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 4px;
    }

    .rank-row {
        grid-template-columns: 20px 36px minmax(0, 1fr);
        gap: 8px;
        padding: 6px 2px;
    }

    .rank-row img {
        width: 36px;
        height: 36px;
    }

    .rank-info b {
        font-size: 12px;
    }

    .rank-meta {
        font-size: 10px;
    }

    .rank-full-row {
        grid-template-columns: 28px 48px minmax(0, 1fr);
    }

    .rank-full-row i {
        display: none;
    }

    .site-footer {
        padding-top: 16px;
        padding-bottom: 12px;
    }

    .footer-brand-title {
        font-size: 16.5px;
    }

    .footer-desc {
        font-size: 12px;
    }

    .footer-nav-title {
        font-size: 13px;
    }

    .footer-chip {
        padding: 5px 12px;
        font-size: 11.5px;
    }

    .chat-window {
        right: 8px;
        bottom: 64px;
        width: calc(100vw - 16px);
        max-height: calc(100vh - 76px);
    }

    .auth-card {
        padding: 24px 16px;
    }

    .news-item {
        padding: 16px 14px !important;
    }

    .vns-pagination-list {
        gap: 4px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}

@media (max-width: 350px) {
    .novel-grid,
    .novel-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

/* Community thread card hover (consolidated from community section) */
.community-thread-card:hover {
    border-color: var(--pink) !important;
    background: var(--surface-2) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Finance, Wallet & Topup Grids */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.wallet-split-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.wallet-withdraw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.author-perks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.wallet-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.package-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    transition: all 0.15s ease;
}

.package-card:hover {
    border-color: var(--pink);
}

/* ==========================================================================
   USER ACCOUNT & LIBRARY DESIGN SYSTEM
   ========================================================================== */
.wallet-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wallet-pill,
.ticket-pill,
.author-wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.wallet-pill {
    background: var(--pink-soft);
    color: var(--pink);
    border: 1px solid var(--pink-border);
}

.wallet-pill:hover {
    background: var(--pink);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(233, 53, 115, 0.25);
}

.ticket-pill {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.author-wallet-pill {
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid var(--green-border);
}

.finance-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.finance-card h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--text);
}

.finance-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.big-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    display: block;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-subtle);
    transition: all 0.15s ease;
}

.history-row:hover {
    border-color: var(--pink-border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.history-row img {
    width: 44px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    background: var(--surface);
}

.history-row-content {
    flex: 1;
    min-width: 0;
}

.history-row-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 4px;
}

.history-row-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ledger .table-wrap {
    margin-top: 14px;
}

.positive {
    color: var(--green);
    font-weight: 700;
}

.negative {
    color: #ef4444;
    font-weight: 700;
}

/* Modern Empty State Box */
.empty-state-box {
    padding: 48px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.empty-state-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0;
    line-height: 1.5;
}

/* Library Filter Tabs */
.library-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

.library-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: all 0.15s ease;
}

.library-tab:hover {
    background: var(--surface-2);
    color: var(--text);
}

.library-tab.active {
    background: var(--pink);
    color: #ffffff;
    border-color: var(--pink);
    box-shadow: 0 2px 8px rgba(233, 53, 115, 0.25);
}

/* ==========================================================================
   WALLET & FINANCE DESIGN SYSTEM (VÍ XU & TÀI CHÍNH)
   ========================================================================== */
.wallet-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* Mini Balance Cards */
.wallet-mini-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wallet-mini-card:hover {
    border-color: var(--pink-border);
    box-shadow: var(--shadow);
}

.wallet-mini-card.mini-card-xu {
    background: linear-gradient(135deg, var(--surface) 0%, var(--pink-soft) 180%);
    border-left: 4px solid var(--pink);
}

.wallet-mini-card.mini-card-ticket {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(147, 51, 234, 0.05) 180%);
    border-left: 4px solid #9333ea;
}

.wallet-mini-card.mini-card-author {
    background: linear-gradient(135deg, var(--surface) 0%, var(--green-soft) 180%);
    border-left: 4px solid var(--green);
}

.mini-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mini-card-icon.xu-icon {
    background: var(--pink-soft);
    color: var(--pink);
}

.mini-card-icon.ticket-icon {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.mini-card-icon.author-icon {
    background: var(--green-soft);
    color: var(--green);
}

.mini-card-info {
    display: flex;
    flex-direction: column;
}

.mini-card-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.mini-card-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.mini-card-number {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.mini-card-unit {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.mini-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: var(--radius-sm) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wallet-balance-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wallet-balance-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--pink-border);
}

.wallet-balance-card.card-xu {
    background: linear-gradient(145deg, var(--surface) 0%, var(--pink-soft) 180%);
    border-top: 3px solid var(--pink);
}

.wallet-balance-card.card-ticket {
    background: linear-gradient(145deg, var(--surface) 0%, rgba(147, 51, 234, 0.05) 180%);
    border-top: 3px solid #9333ea;
}

.wallet-balance-card.card-author {
    background: linear-gradient(145deg, var(--surface) 0%, var(--green-soft) 180%);
    border-top: 3px solid var(--green);
}

.balance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.balance-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: var(--radius-full);
}

.balance-tag.xu-tag {
    background: var(--pink-soft);
    color: var(--pink);
}

.balance-tag.ticket-tag {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.balance-tag.author-tag {
    background: var(--green-soft);
    color: var(--green);
}

.balance-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-icon.xu-icon {
    background: var(--pink-soft);
    color: var(--pink);
}

.balance-icon.ticket-icon {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.balance-icon.author-icon {
    background: var(--green-soft);
    color: var(--green);
}

.balance-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}

.balance-big-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    font-family: var(--font-sans);
}

.balance-unit {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
}

.balance-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 16px;
    flex: 1;
}

.wallet-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* Topup Layout — QR + Packages */
.topup-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.qr-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
    position: sticky;
    top: 80px;
}

[data-theme="dark"] .qr-card {
    background: linear-gradient(135deg, #161e2e 0%, #0c121e 100%);
}

.qr-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-image-wrap {
    background: #ffffff;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

.qr-image-wrap img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.qr-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 11.5px;
    text-align: center;
    padding: 16px;
    display: none;
}

.qr-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qr-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qr-info-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.qr-info-value {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn-sm {
    font-size: 10px;
    font-weight: 600;
    color: var(--pink-border);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn-sm:hover {
    background: var(--pink);
    color: #fff;
    border-color: var(--pink);
}

/* Compact Package Grid */
.packages-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.pkg-compact-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
}

.pkg-compact-card:hover {
    border-color: var(--pink);
    box-shadow: 0 4px 12px rgba(233, 53, 115, 0.1);
}

.pkg-compact-card.pkg-selected {
    border-color: var(--pink);
    background: var(--pink-soft);
    box-shadow: 0 0 0 2px rgba(233, 53, 115, 0.2);
}

.pkg-compact-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pkg-xu-number {
    font-size: 22px;
    font-weight: 800;
    color: var(--pink);
    line-height: 1.1;
}

.pkg-xu-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.pkg-bonus-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid var(--green-border);
    padding: 1px 7px;
    border-radius: var(--radius-full);
}

.pkg-compact-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.pkg-form {
    width: 100%;
    margin-top: 4px;
}

.btn-pkg-select {
    width: 100%;
    padding: 7px 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    background: var(--pink);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-pkg-select:hover {
    background: var(--pink-hover);
    transform: translateY(-1px);
}

.btn-pkg-select:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* History Tabs */
.history-tabs {
    display: flex;
    border-bottom: 2px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.history-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.history-tab:hover {
    color: var(--text);
}

.history-tab.active {
    color: var(--pink);
    border-bottom-color: var(--pink);
    font-weight: 700;
}

/* Keep old Bank Transfer card for backwards compat */
.bank-transfer-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .bank-transfer-card {
    background: linear-gradient(135deg, #161e2e 0%, #0c121e 100%);
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.badge-status.pending {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-status.paid,
.badge-status.completed,
.badge-status.approved {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-status.rejected,
.badge-status.failed {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .badge-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .badge-status.paid,
[data-theme="dark"] .badge-status.completed,
[data-theme="dark"] .badge-status.approved {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .badge-status.rejected,
[data-theme="dark"] .badge-status.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 900px) {
    .wallet-hero-grid,
    .wallet-split-grid,
    .wallet-withdraw-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .topup-layout {
        grid-template-columns: 1fr !important;
    }
    .topup-qr-section {
        order: -1;
    }
    .qr-card {
        position: static;
        max-width: 320px;
        margin: 0 auto;
    }
    .bank-grid {
        grid-template-columns: 1fr;
    }
    .author-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    .author-perks-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .packages-compact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .author-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PUBLIC AUTHORS & CREATOR DIRECTORY DESIGN SYSTEM
   ========================================================================== */
.author-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.author-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.author-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--pink-border);
}

.author-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.author-avatar-wrap {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--pink);
    box-shadow: 0 3px 10px rgba(233, 53, 115, 0.15);
    flex-shrink: 0;
    background: var(--surface-2);
}

.author-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.author-card-bio {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.author-stats-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-muted);
}

.author-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.author-stat-pill strong {
    color: var(--text);
}

/* Author Profile Hero on /tac-gia/{slug} */
.author-profile-hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.author-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 3px solid var(--pink);
    box-shadow: 0 4px 18px rgba(233, 53, 115, 0.25);
    flex-shrink: 0;
    background: var(--surface-2);
}

.author-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-profile-info {
    flex: 1;
    min-width: 260px;
}

.author-profile-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin: 4px 0 8px;
}

.author-profile-bio {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 16px;
    max-width: 680px;
}

.author-profile-stats {
    display: flex;
    gap: 20px;
    font-size: 13.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .author-profile-hero {
        padding: 20px 16px;
        gap: 16px;
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .author-profile-info {
        min-width: 0;
        width: 100%;
    }
    .author-profile-stats {
        justify-content: center;
        gap: 14px;
    }
    .author-profile-title {
        font-size: 22px;
    }
}

/* ==========================================================================
   CATEGORIES EXPLORATION PAGE
   ========================================================================== */
.categories-page {
    padding-bottom: 80px;
}

.category-header-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-header-main {
    flex: 1;
    min-width: 260px;
}

.category-header-main .eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--pink);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.category-page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.25;
}

.category-page-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Category Filter & Search Toolbar */
.category-toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.category-search-wrapper {
    position: relative;
    width: 100%;
}

.category-search-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

.category-search-input:focus {
    border-color: var(--pink);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(233, 53, 115, 0.12);
}

.category-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    display: none;
    line-height: 1;
}

.category-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.category-filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.category-chip-btn {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.category-chip-btn:hover {
    border-color: var(--pink-border);
    color: var(--pink);
}

.category-chip-btn.active {
    background: var(--pink);
    border-color: var(--pink);
    color: #ffffff;
}

.category-count-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}



/* Category Card */
.category-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
    min-height: 70px;
    position: relative;
    overflow: hidden;
}



.category-card:hover {
    border-color: var(--pink);
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 53, 115, 0.08);
}

.category-card.has-novels {
    border-left: 3px solid var(--pink);
}

.category-card.is-empty {
    opacity: 0.78;
}

.category-card.is-empty:hover {
    opacity: 1;
}

.category-card-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
    display: block;
    word-break: break-word;
}



.category-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.category-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.category-badge-pill.active {
    background: var(--pink-soft);
    color: var(--pink);
}

.category-badge-pill.muted {
    background: var(--surface-2);
    color: var(--text-muted);
}

.category-card-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.category-card:hover .category-card-arrow {
    color: var(--pink);
    transform: translateX(2px);
}

@media (max-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .category-header-wrap {
        margin-bottom: 14px;
    }
    .category-page-title {
        font-size: 20px;
    }
    .category-page-desc {
        font-size: 12.5px;
    }
    .category-toolbar {
        padding: 10px;
        margin-bottom: 14px;
        gap: 8px;
    }
    .category-card {
        padding: 11px 10px;
        min-height: 60px;
    }
    .category-card-name {
        font-size: 13.5px;
        margin-bottom: 4px;
    }
}

/* ==========================================================================
   PAGE LOADING & CHAPTER TRANSITION SYSTEM
   ========================================================================== */
/* 1. Top Progress Bar (YouTube / GitHub style) */
.vns-top-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vns-top-progress.is-loading {
    opacity: 1;
}

.vns-top-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e93573, #ff4081, #ff79b0);
    box-shadow: 0 0 10px rgba(233, 53, 115, 0.7);
    transition: width 0.25s cubic-bezier(0.1, 0.5, 0.1, 1);
    position: relative;
}

.vns-top-progress-peg {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    box-shadow: 0 0 14px #e93573, 0 0 8px #ff4081;
    border-radius: 50%;
    transform: rotate(3deg) translateY(-4px);
    opacity: 0.9;
}

/* 3. Page / Chapter Transition Modal Pill */
.vns-page-transition {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9999990;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.vns-page-transition.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.vns-page-transition-box {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
    padding: 12px 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transform: scale(0.94);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.vns-page-transition.is-active .vns-page-transition-box {
    transform: scale(1);
}

.vns-spinner-ring {
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--pink-soft);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: vnsSpin 0.65s linear infinite;
    flex-shrink: 0;
}

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

.vns-transition-text {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

/* ==========================================================================
   BUTTON SPINNER & ANTI-DOUBLE CLICK STYLES
   ========================================================================== */
.btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

button[disabled],
.btn[disabled],
button.is-submitting,
.btn.is-submitting {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.cf-turnstile-container {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}



