/* ═══════════════════════════════════════════════════════════
   RUANG NOVEL — Emerald Dark Theme
   A reading-first design with character.
   ═══════════════════════════════════════════════════════════ */

/* ── Brightened Emerald Dark Theme ────────────────────── */
:root {
    --bg-primary: #182028;
    --bg-secondary: #1d2731;
    --bg-tertiary: #232d38;
    --bg-card: #1b242d;
    --bg-card-hover: #1e2731;
    --bg-elevated: #26313d;
    --bg-input: #1f2933;

    --border-color: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(52, 211, 153, 0.35);

    --text-primary: #e8ecf0;
    --text-secondary: #9eaab8;
    --text-muted: #6b7a8d;
    --text-heading: #f4f6f8;

    --accent: #34d399;
    --accent-hover: #2bc48c;
    --accent-glow: rgba(52, 211, 153, 0.2);
    --accent-subtle: rgba(52, 211, 153, 0.07);
    --accent-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    --accent-text: #0f1419;

    --mint: #6ee7b7;
    --teal: #2dd4bf;
    --gold: #fbbf24;
    --rust: #f97316;
    --rose: #fb7185;

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 24px var(--accent-glow);

    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--mint); }

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

::selection {
    background: rgba(52, 211, 153, 0.25);
    color: #fff;
}

/* ── Container ─────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ────────────────────────────────────────────── */
#site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 20, 25, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-heading);
    text-decoration: none;
    flex-shrink: 0;
}
.logo:hover { color: var(--accent); }

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    flex-shrink: 0;
    transition: transform var(--transition);
}
.logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.logo:hover .logo-mark { transform: scale(1.05); }

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    white-space: nowrap;
}
.logo-text strong {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.logo-text small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    color: var(--text-heading);
    background: var(--accent-subtle);
}
.nav-link.active {
    color: var(--text-heading);
    background: var(--accent-subtle);
    border: 1px solid rgba(52, 211, 153, 0.24);
}
.nav-link:hover svg { color: var(--accent); }
.nav-link.active svg { color: var(--accent); opacity: 0.95; }
.nav-link svg { opacity: 0.5; transition: all var(--transition); }

.header-search {
    display: flex;
    align-items: center;
    margin-left: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: var(--bg-input);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.header-search-input {
    width: clamp(180px, 24vw, 280px);
    background: transparent;
    border: 0;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.84rem;
    padding: 9px 12px 9px 14px;
    outline: none;
}
.header-search-input::placeholder { color: var(--text-muted); }
.header-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-left: 1px solid var(--border-subtle);
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.header-search-btn:hover {
    background: var(--accent);
    color: var(--accent-text);
}

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

.header-shortcuts {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.header-favorite-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--transition);
}
.header-favorite-link svg {
    flex-shrink: 0;
}
.header-favorite-link:hover {
    color: var(--accent);
    border-color: var(--border-hover);
    background: var(--accent-subtle);
}

.search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.search-toggle:hover {
    border-color: var(--border-hover);
    color: var(--accent);
    background: var(--accent-subtle);
}
.search-toggle[aria-expanded="true"] {
    border-color: var(--border-hover);
    color: var(--accent);
    background: var(--accent-subtle);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.menu-toggle span {
    display: block; width: 100%; height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.mobile-search {
    display: none;
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.09) 0%, rgba(52, 211, 153, 0.02) 100%);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height var(--transition-slow), opacity var(--transition);
}
.mobile-search .container {
    padding-top: 10px;
    padding-bottom: 12px;
}
.mobile-search.open {
    max-height: 104px;
    opacity: 1;
    border-bottom: 1px solid var(--border-subtle);
    pointer-events: auto;
}
.mobile-search-form {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    overflow: hidden;
}
.mobile-search-form:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.mobile-search-input {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 11px 12px;
    outline: none;
}
.mobile-search-input::placeholder { color: var(--text-muted); }
.mobile-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 42px;
    border: 0;
    border-left: 1px solid var(--border-subtle);
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.mobile-search-btn:hover {
    background: var(--accent);
    color: var(--accent-text);
}

/* ── Buttons — Distinctive & characterful ──────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--accent-text);
    box-shadow: 0 2px 10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
    font-weight: 700;
}
.btn-primary:hover {
    color: var(--accent-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    padding: 10px 21px;
}
.btn-outline:hover {
    color: var(--accent-text);
    background: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-ghost {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
    color: var(--text-heading);
    background: var(--bg-elevated);
    border-color: var(--border-color);
}

.btn-sm { padding: 7px 16px; font-size: 0.75rem; }
.btn-lg { padding: 14px 32px; font-size: 0.9375rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ef4444; color: #fff; transform: translateY(-1px); }
.btn-favorite.is-saved {
    color: #b9f7df;
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(52, 211, 153, 0.16);
}
.btn-favorite.is-saved:hover {
    color: #dcfce7;
    background: rgba(52, 211, 153, 0.24);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-glow {
    background: var(--accent-gradient);
    color: var(--accent-text);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.badge-subtle {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.badge-sm { padding: 3px 8px; font-size: 0.625rem; }

/* ── Chips — pill-shaped with personality ──────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
}
.chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
}

.chip-genre {
    border-color: rgba(52, 211, 153, 0.18);
    color: var(--mint);
    background: rgba(52, 211, 153, 0.05);
}
.chip-genre:hover {
    border-color: var(--accent);
    background: rgba(52, 211, 153, 0.12);
    color: #a7f3d0;
}

.chip-tag {
    border-color: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.05);
}
.chip-tag:hover {
    border-color: var(--info);
    background: rgba(56, 189, 248, 0.1);
    color: #bae6fd;
}

.chip-xs { padding: 3px 9px; font-size: 0.6875rem; }
.chip-lg { padding: 8px 18px; font-size: 0.875rem; }
.chip-count {
    background: rgba(255,255,255,0.08);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Section Headers ───────────────────────────────────── */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    margin-top: 6px;
}
.section-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Hero Section ──────────────────────────────────────── */
.hero-section {
    padding: 56px 0 48px;
    background: linear-gradient(175deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -20%;
    width: 70%;
    height: 140%;
    background: radial-gradient(ellipse, rgba(52, 211, 153, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: -10%;
    width: 50%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(45, 212, 191, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: center;
    position: relative;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 14px 0 16px;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
}

.hero-stats {
    display: flex;
    gap: 28px;
    margin: 24px 0;
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.hero-stat span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ── Featured Card ─────────────────────────────────────── */
.featured-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-slow);
}
.featured-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}
.featured-cover {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}
.featured-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.featured-card:hover .featured-cover img { transform: scale(1.05); }
.featured-overlay { position: absolute; top: 12px; left: 12px; }
.featured-info { padding: 20px; }
.featured-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0;
    line-height: 1.3;
}
.featured-excerpt {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}
.featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

/* ── Novel Grid ────────────────────────────────────────── */
.novel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.novel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.novel-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 0 1px var(--border-hover);
}
.novel-cover {
    display: block;
    position: relative;
    aspect-ratio: 3 / 4.2;
    overflow: hidden;
    background: var(--bg-tertiary);
}
.novel-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.novel-card:hover .novel-cover img { transform: scale(1.06); }

.novel-rating {
    position: absolute;
    top: 8px; right: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(251, 191, 36, 0.2);
}
.novel-status-badge {
    position: absolute;
    top: 8px; left: 8px;
    padding: 3px 9px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.novel-status-badge.is-ongoing {
    background: linear-gradient(135deg, #047857, #10b981);
    border-color: rgba(16, 185, 129, 0.45);
    color: #ecfdf5;
}
.novel-status-badge.is-completed {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border-color: rgba(96, 165, 250, 0.45);
    color: #eff6ff;
}
.novel-status-badge.is-hiatus {
    background: linear-gradient(135deg, #9a3412, #ea580c);
    border-color: rgba(251, 146, 60, 0.45);
    color: #fff7ed;
}
.novel-status-badge.is-dropped {
    background: linear-gradient(135deg, #7f1d1d, #dc2626);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fef2f2;
}
.novel-status-badge.is-unknown {
    background: rgba(51, 65, 85, 0.92);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

.novel-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 162px;
}
.novel-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0;
    min-height: calc(1.4em * 2);
}
.novel-title a {
    color: var(--text-heading);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.novel-title a:hover { color: var(--accent); }

.novel-chapter-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0;
    min-width: 0;
}
.novel-chapter-link svg { flex: 0 0 auto; }
.novel-chapter-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.novel-chapter-link:hover { color: var(--accent); }
.novel-chapter-unavailable {
    display: block;
    font-size: 0.75rem;
    color: #fca5a5;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.novel-chapter-count {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.novel-updated-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--accent);
    margin-bottom: 0;
    margin-top: auto;
    font-weight: 500;
}

.novel-chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }

/* ── Discover ──────────────────────────────────────────── */
.section-discover {
    padding: 44px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}
.discover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.discover-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.discover-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 16px;
}
.discover-label svg { color: var(--accent); }

.section-novels { padding: 44px 0 60px; }

/* ── Novel Detail Hero ─────────────────────────────────── */
.novel-hero {
    position: relative;
    padding: 36px 0 20px;
    overflow: hidden;
}
.novel-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.15) saturate(1.5);
    transform: scale(1.3);
    opacity: 0.6;
}
.novel-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,20,25,0.5) 0%, var(--bg-primary) 100%);
}

.novel-detail-grid {
    display: grid;
    grid-template-columns: 212px 1fr;
    gap: 30px;
    align-items: start;
    position: relative;
    z-index: 1;
}
.novel-detail-cover {
    position: relative;
    width: 100%;
    max-width: 212px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 36px rgba(0,0,0,0.5);
}
.novel-detail-cover img {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}
.novel-detail-info { padding-top: 8px; }

.novel-breadcrumb-mobile {
    display: none;
}
.novel-breadcrumb-desktop {
    display: flex;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb.novel-breadcrumb-mobile { display: none; }

.novel-detail-info h1 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.novel-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.novel-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.novel-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}
.novel-stat svg { color: var(--accent); flex-shrink: 0; }
.novel-stat div { display: flex; flex-direction: column; }
.novel-stat strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}
.novel-stat span {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.novel-chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.novel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.novel-share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.share-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}
.share-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    transition: transform var(--transition), border-color var(--transition), opacity var(--transition);
}
.share-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
.share-facebook { color: #1877f2; border-color: rgba(24,119,242,0.35); background: rgba(24,119,242,0.12); }
.share-x { color: #e2e8f0; border-color: rgba(226,232,240,0.25); background: rgba(226,232,240,0.06); }
.share-telegram { color: #26a5e4; border-color: rgba(38,165,228,0.35); background: rgba(38,165,228,0.12); }
.share-whatsapp { color: #22c55e; border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.12); }

/* ── Detail Columns ────────────────────────────────────── */
.section-content { padding: 44px 0; }
.page-novel-detail .section-content {
    padding-top: 22px;
    padding-bottom: 24px;
}
.page-novel-detail .section-chapters {
    padding-top: 8px;
}
.detail-columns {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.panel-header svg { color: var(--accent); }
.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
}

.prose {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.85;
}
.prose p { margin-bottom: 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul,
.prose ol {
    margin: 0.85em 0 1em;
    padding-left: 1.4em;
}
.prose li {
    margin-bottom: 0.48em;
    padding-left: 0.12em;
}
.prose li:last-child { margin-bottom: 0; }
.prose li::marker { color: var(--text-muted); }

.info-list { display: flex; flex-direction: column; }
.info-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.info-list > div:last-child { border-bottom: none; }
.info-list dt {
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.info-list dd {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

/* ── Chapter List ──────────────────────────────────────── */
.section-chapters { padding: 0 0 60px; }
.chapter-list {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.chapter-list-scrollable {
    max-height: min(74vh, 920px);
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    min-height: 240px;
}
.chapter-list-scrollable::-webkit-scrollbar {
    width: 10px;
}
.chapter-list-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}
.chapter-list-scrollable::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.34);
    border-radius: 999px;
}
.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.chapter-item:last-child { border-bottom: none; }
.chapter-item:hover {
    background: var(--accent-subtle);
    color: var(--accent);
    padding-left: 24px;
}
.chapter-item.is-read {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary);
}
.chapter-item.is-read .chapter-number {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.3);
}
.chapter-item.is-read .chapter-date,
.chapter-item.is-read .chapter-words,
.chapter-item.is-read .chapter-arrow {
    color: #94a3b8;
}
.chapter-item.is-read:hover {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-primary);
}
.chapter-item-disabled {
    cursor: default;
}
.chapter-item-disabled:hover {
    background: transparent;
    color: var(--text-primary);
    padding-left: 20px;
}
.chapter-item-main {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    min-width: 0;
}
.chapter-number {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(52, 211, 153, 0.1);
    font-family: var(--font-mono);
}
.chapter-title {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chapter-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.chapter-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-mono);
}
.chapter-arrow { color: var(--text-muted); transition: color var(--transition); }
.chapter-item:hover .chapter-arrow { color: var(--accent); }
.chapter-words {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
}

@media (max-width: 1024px) {
    .chapter-list-scrollable {
        max-height: min(70vh, 760px);
    }
}

@media (max-width: 640px) {
    .chapter-list-scrollable {
        max-height: 64vh;
    }
}

/* ── Reader ────────────────────────────────────────────── */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 200;
    width: 0;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px var(--accent-glow);
}

.reader-hero {
    padding: 32px 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.reader-header {
    max-width: 800px;
    margin: 0;
}
.reader-header h1 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
    margin-bottom: 10px;
}
.reader-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}
.reader-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.reader-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.reader-nav-select {
    margin: 4px auto 0;
    width: 420px;
    max-width: 100%;
}
.reader-select-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
}
.reader-select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #8fa0b2;
    border-bottom: 2px solid #8fa0b2;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}
.reader-select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 10px 36px 10px 12px;
    font-size: 0.88rem;
    font-family: var(--font-body);
    outline: none;
    appearance: none;
}
.reader-select:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.reader-content-section { padding: 40px 0 60px; }
.reader-layout { max-width: 720px; margin: 0 auto; }

.reader-article {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 44px 48px;
    position: relative;
}
.reader-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 3px 3px;
}

.reader-body {
    color: var(--text-primary);
    font-size: 1.08rem;
    line-height: 2;
    word-spacing: 0.02em;
}
.reader-body p {
    margin-bottom: 1.4em;
    text-align: justify;
    hyphens: auto;
}
.reader-body p:last-child { margin-bottom: 0; }
.reader-body strong { color: var(--text-heading); }
.reader-body em { color: var(--mint); font-style: italic; }
.reader-body hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 2em 0;
}

.reader-bottom-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 36px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Archive ───────────────────────────────────────────── */
.archive-hero {
    padding: 40px 0 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.archive-header {
    max-width: 760px;
}
.archive-header h1 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    margin: 10px 0 8px;
}
.archive-header p { color: var(--text-secondary); font-size: 0.9375rem; }
.archive-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Search ────────────────────────────────────────────── */
.search-hero {
    padding: 40px 0 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.search-breadcrumb {
    margin-bottom: 12px;
}
.search-hero h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 20px;
}
.search-hero-note {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}
.search-hero-note strong {
    color: var(--text-heading);
    font-weight: 600;
}

/* ── Saved Novels ─────────────────────────────────────── */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.saved-card {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 12px;
    transition: border-color var(--transition), background var(--transition);
}
.saved-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.saved-cover {
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    display: block;
    aspect-ratio: 3 / 4.3;
}
.saved-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.saved-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.saved-title {
    font-size: 1rem;
    line-height: 1.4;
}
.saved-title a {
    color: var(--text-heading);
}
.saved-title a:hover {
    color: var(--accent);
}
.saved-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.saved-meta span { min-width: 0; }
.saved-meta-chapter {
    flex: 1 1 300px;
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.saved-meta-updated {
    flex: 0 0 auto;
    white-space: nowrap;
}
.saved-progress {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.saved-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

/* ── Pagination ────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}
.page-numbers { display: flex; align-items: center; gap: 4px; }
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-decoration: none;
}
.page-num:hover {
    background: var(--bg-tertiary);
    color: var(--text-heading);
}
.page-num.active {
    background: var(--accent-gradient);
    color: var(--accent-text);
    font-weight: 700;
    box-shadow: 0 2px 10px var(--accent-glow);
}
.page-dots { color: var(--text-muted); padding: 0 4px; }

/* ── Empty / Error ─────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg { opacity: 0.25; }

.error-section {
    padding: 80px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.error-card { text-align: center; max-width: 440px; }
.error-code {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
}
.error-card h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 10px;
}
.error-card p { color: var(--text-secondary); margin-bottom: 24px; }
.error-actions { display: flex; justify-content: center; }

/* ── Footer ────────────────────────────────────────────── */
#site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 18px 0;
    margin-top: auto;
}
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.footer-bottom p {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.footer-links-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.footer-links-inline a {
    font-size: 0.76rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.footer-links-inline a:hover { color: var(--accent); }
.footer-counter {
    margin-top: 10px;
    min-height: 18px;
    display: flex;
    justify-content: center;
}
.footer-counter #histats_counter {
    width: 100%;
    display: flex;
    justify-content: center;
}
.footer-counter #histatsC img {
    display: block;
    margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-featured { max-width: 400px; }
    .detail-columns { grid-template-columns: 1fr; }
    .novel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .header-inner { gap: 12px; }
    .main-nav {
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-subtle);
        flex-direction: column;
        padding: 12px;
        gap: 2px;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-20px);
        transition: transform var(--transition-slow), opacity var(--transition-slow), visibility var(--transition-slow);
        z-index: 99;
    }
    .main-nav.open { 
        visibility: visible;
        opacity: 1;
        transform: translateY(0); 
    }
    .nav-link { width: 100%; padding: 12px 16px; }
    .header-search { display: none; }
    .mobile-search { display: block; }
    .header-favorite-link {
        width: 36px;
        padding: 0;
        justify-content: center;
    }
    .header-favorite-link span { display: none; }
    .search-toggle { display: inline-flex; }
    .menu-toggle { display: flex; }
    .logo-text small { display: none; }
    .hero-content h1 { font-size: 1.6rem; }
    .hero-stats { gap: 18px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .hero-featured { display: none; }
    .novel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .novel-body { padding: 10px; }
    .novel-title { font-size: 0.8125rem; }
    .discover-grid { grid-template-columns: 1fr; }
    .novel-detail-grid { grid-template-columns: 132px 1fr; gap: 16px; }
    .novel-detail-cover { max-width: 132px; }
    .breadcrumb.novel-breadcrumb-mobile { display: flex; margin-bottom: 10px; }
    .novel-breadcrumb-desktop { display: none; }
    .novel-detail-info h1 { font-size: 1.25rem; }
    .novel-stats-row { gap: 6px; }
    .novel-stat { padding: 8px 12px; }
    .archive-header { flex-direction: column; gap: 16px; }
    .archive-header h1 { font-size: 1.3rem; }
    .archive-header { max-width: none; }
    .reader-article { padding: 24px 18px; border-radius: var(--radius-lg); }
    .reader-body { font-size: 1rem; line-height: 1.9; }
    .reader-body p { text-align: left; }
    .reader-nav-select {
        margin-top: 8px;
        width: 100%;
    }
    .reader-select-wrap {
        width: 100%;
        margin: 0;
    }
    .reader-bottom-nav { flex-direction: column; }
    .footer-bottom { justify-content: flex-start; }
    .pagination { flex-wrap: wrap; }
    .chapter-item { padding: 12px 14px; }
    .chapter-item-main { gap: 10px; }
    .saved-card {
        grid-template-columns: 86px 1fr;
        padding: 10px;
        gap: 10px;
    }
    .saved-title {
        font-size: 0.9rem;
    }
    .saved-meta {
        gap: 6px 10px;
    }
    .saved-meta-chapter {
        flex-basis: 100%;
    }
    .saved-progress {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.35rem; }
    .hero-stats { flex-direction: column; gap: 8px; }
    .novel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .novel-detail-grid { grid-template-columns: 1fr; text-align: center; }
    .novel-detail-cover {
        display: block;
        width: 200px;
        max-width: 100%;
        margin: 0 auto;
    }
    .novel-detail-cover img {
        width: 100%;
        max-width: none;
    }
    .breadcrumb { justify-content: flex-start; }
    .novel-chips-row { justify-content: center; }
    .novel-actions { justify-content: center; }
    .novel-share-actions { justify-content: center; }
    .reader-article { padding: 20px 14px; }
}
