:root {
    --ink: #10161f;
    --ink-soft: #1a2433;
    --panel: rgba(18, 27, 40, 0.78);
    --line: rgba(214, 196, 160, 0.18);
    --text: #e8e2d6;
    --muted: #9aa3b2;
    --accent: #d6a15b;
    --accent-2: #6f9e8a;
    --paper: #f3efe6;
    --paper-ink: #1d2430;
    --danger: #c97866;
    --radius: 18px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --font-ui: "Be Vietnam Pro", sans-serif;
    --font-display: "Fraunces", Georgia, serif;
    --font-read: "Literata", Georgia, serif;
    --max: 1280px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--text);
    background: var(--ink);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

select {
    color-scheme: dark;
}

select option,
select optgroup {
    background-color: #1a2433;
    color: #e8e2d6;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1200px 700px at 10% -10%, rgba(111, 158, 138, 0.22), transparent 55%),
        radial-gradient(900px 600px at 90% 0%, rgba(214, 161, 91, 0.18), transparent 50%),
        linear-gradient(160deg, #0c121a 0%, #152033 45%, #0f171f 100%);
}

.page-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    opacity: 0.5;
}

.container {
    width: min(100% - 2rem, var(--max));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    background: rgba(12, 18, 26, 0.72);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    min-height: 74px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(214, 161, 91, 0.95), rgba(111, 158, 138, 0.85)),
        var(--accent);
    box-shadow: 0 10px 24px rgba(214, 161, 91, 0.25);
    position: relative;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 10px 12px;
    border-left: 2px solid rgba(16, 22, 31, 0.55);
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(16, 22, 31, 0.2), transparent);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.75rem;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}

.primary-nav > a,
.nav-dropdown-btn {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    color: var(--muted);
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: 0.2s ease;
}

.primary-nav > a:hover,
.nav-dropdown-btn:hover,
.primary-nav > a.is-active,
.nav-dropdown-btn.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    padding: 0.5rem;
    border-radius: 16px;
    background: rgba(18, 27, 40, 0.96);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
    z-index: 20;
}

.nav-dropdown.is-open .nav-dropdown-menu {
    display: grid;
    animation: rise 0.22s ease;
}

.nav-dropdown-menu a {
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    color: var(--muted);
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.is-active {
    background: rgba(214, 161, 91, 0.12);
    color: var(--text);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.25rem 0.25rem 0.9rem;
}

.search-form input {
    width: min(220px, 28vw);
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.search-form button {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    background: linear-gradient(135deg, var(--accent), #b88645);
    color: #1a1308;
    font-weight: 600;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
    width: 18px;
    height: 2px;
    background: var(--text);
    display: block;
}

.hero {
    position: relative;
    min-height: clamp(420px, 78vh, 680px);
    display: grid;
    align-items: end;
    overflow: hidden;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(12, 18, 26, 0.25) 0%, rgba(12, 18, 26, 0.55) 45%, rgba(12, 18, 26, 0.96) 100%),
        url("../images/hero-library.svg") center/cover no-repeat,
        #152033;
    transform: scale(1.02);
    animation: drift 18s ease-in-out infinite alternate;
}

.hero-content {
    padding: 4.5rem 0 3rem;
    max-width: 720px;
    animation: fade-up 0.8s ease both;
}

.hero-brand {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.4rem);
    line-height: 0.95;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.hero-content p {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 1.08rem;
    max-width: 34rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.featured-banner {
    padding: 1.25rem 0 0.5rem;
}

.featured-banner-inner {
    padding-top: 0.5rem;
}

.featured-viewport {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(18, 27, 40, 0.72);
    box-shadow: var(--shadow);
}

.featured-track {
    display: flex;
    gap: 0;
    will-change: transform;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.featured-card {
    flex: 0 0 calc(100% / 5);
    min-width: 0;
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #121820;
}

.featured-banner.is-static .featured-track {
    justify-content: flex-start;
}

.featured-banner.is-static .featured-card {
    flex-basis: calc(100% / 5);
    max-width: calc(100% / 5);
}

@media (max-width: 900px) {
    .featured-banner.is-static .featured-card {
        flex-basis: 50%;
        max-width: 50%;
    }
}

@media (max-width: 640px) {
    .featured-banner.is-static .featured-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}

.featured-cover {
    position: absolute;
    inset: 0;
}

.featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.featured-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(8, 12, 18, 0.88) 100%);
    pointer-events: none;
}

.featured-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 1rem 1rem 1.1rem;
}

.featured-info .chip {
    margin-bottom: 0.45rem;
}

.featured-info h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-info p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-card:hover .featured-cover img {
    transform: scale(1.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #c48c45);
    color: #1a1308;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(214, 161, 91, 0.28);
}

.btn-ghost {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: rgba(214, 161, 91, 0.45);
    background: rgba(214, 161, 91, 0.08);
}

.section {
    padding: 2.5rem 0 3.5rem;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.15;
}

.section-head p {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
}

.genre-pills a {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    transition: 0.2s ease;
}

.genre-pills a:hover,
.genre-pills a.is-active {
    color: var(--ink);
    background: var(--accent);
    border-color: transparent;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.story-card {
    display: grid;
    grid-template-rows: auto 1fr;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: fade-up 0.7s ease both;
}

.story-card:nth-child(2) { animation-delay: 0.05s; }
.story-card:nth-child(3) { animation-delay: 0.1s; }
.story-card:nth-child(4) { animation-delay: 0.15s; }
.story-card:nth-child(5) { animation-delay: 0.2s; }
.story-card:nth-child(6) { animation-delay: 0.25s; }
.story-card:nth-child(7) { animation-delay: 0.3s; }
.story-card:nth-child(8) { animation-delay: 0.35s; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-weight: 600;
    transition: 0.2s ease;
}

.page-btn:hover {
    color: var(--text);
    border-color: rgba(214, 161, 91, 0.45);
}

.page-btn.is-active {
    background: linear-gradient(135deg, var(--accent), #b88645);
    color: #1a1308;
    border-color: transparent;
}

.page-btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.story-card:hover {
    transform: translateY(-6px);
    border-color: rgba(214, 161, 91, 0.4);
    box-shadow: var(--shadow);
}

.story-cover {
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #1b2738;
}

.story-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.story-card:hover .story-cover img {
    transform: scale(1.05);
}

.story-body {
    padding: 0.75rem 0.8rem 0.9rem;
    display: grid;
    gap: 0.4rem;
    align-content: start;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(111, 158, 138, 0.15);
    color: #b7d2c5;
}

.chip.gold {
    background: rgba(214, 161, 91, 0.16);
    color: #e7c48d;
}

.story-body h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.02rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-body .author {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-body .summary {
    color: #c5c0b4;
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.story-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.hashtag-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--accent, #f0b429);
    font-size: 0.78rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.hashtag-pill:hover {
    background: var(--accent, #f0b429);
    color: #111;
    border-color: var(--accent, #f0b429);
}

/* Hashtag nằm trong đoạn văn summary */
.hashtag-inline {
    padding: 1px 6px;
    font-size: 0.82em;
    vertical-align: baseline;
    border-radius: 12px;
}

.hashtag-heading {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hashtag-icon {
    color: var(--accent, #f0b429);
    font-weight: 700;
}

.story-stats-inline {
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    border: 0;
    padding: 0;
    margin: 0.85rem 0 0;
    font-size: 0.95rem;
    max-width: none;
}

.story-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
}

.story-stat svg {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.9;
}

.empty-state {
    padding: 2.5rem;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}

.story-hero {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2.5rem 0 1rem;
    align-items: start;
}

.story-hero-cover {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    animation: fade-up 0.6s ease both;
}

.story-hero-cover img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

.story-hero-info {
    animation: fade-up 0.7s ease both;
}

.story-hero-info h1 {
    margin: 0.4rem 0 0.6rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
}

.story-hero-info .lead {
    color: #c9c3b6;
}

.story-summary-block {
    max-width: 42rem;
}

.story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.25rem;
}

.story-actions .btn {
    gap: 0.45rem;
}

.story-actions .btn svg {
    flex-shrink: 0;
}

.story-actions .btn[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--accent), #c48c45);
    color: #1a1308;
    border-color: transparent;
}

.share-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(120%);
    z-index: 80;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    background: rgba(18, 27, 40, 0.95);
    border: 1px solid rgba(214, 161, 91, 0.35);
    color: var(--text);
    font-size: 0.92rem;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
}

.share-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.playlist-panel .chapter-panel-head .muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.playlist-player {
    display: grid;
    gap: 0;
}

.playlist-now {
    padding: 1.15rem 1.2rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.playlist-now-label {
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.playlist-now-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
    line-height: 1.3;
}

.playlist-now audio {
    width: 100%;
    height: 44px;
}

.playlist-tracks {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    display: grid;
    gap: 0.35rem;
    max-height: min(58vh, 520px);
    overflow: auto;
}

.playlist-track {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    text-align: left;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    transition: 0.2s ease;
}

.playlist-track:hover {
    background: rgba(214, 161, 91, 0.1);
    border-color: rgba(214, 161, 91, 0.22);
}

.playlist-track.is-active {
    background: rgba(214, 161, 91, 0.14);
    border-color: rgba(214, 161, 91, 0.35);
}

.playlist-track.is-playing .playlist-track-icon {
    color: var(--accent);
}

.playlist-track-num {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(111, 158, 138, 0.14);
    color: #c7ddd2;
    font-weight: 650;
    font-size: 0.9rem;
}

.playlist-track-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-track-icon {
    color: var(--muted);
    font-size: 0.95rem;
}

.chapter-panel {
    margin: 1.5rem 0 3rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(18, 27, 40, 0.65);
    overflow: hidden;
}

.chapter-panel-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
}

.chapter-panel-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.4rem;
}

.chapter-select {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.chapter-select select {
    min-width: 220px;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #1a2433;
    color: var(--text);
    color-scheme: dark;
}

.chapter-select select option {
    background-color: #1a2433;
    color: #e8e2d6;
}

.chapter-select select option:checked,
.chapter-select select option:hover {
    background-color: #2a384c;
    color: #fff;
}

.chapter-list {
    list-style: none;
    margin: 0;
    padding: 0.55rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 0.45rem;
}

.chapter-list li a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 48px;
    padding: 0.55rem 0.3rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    transition: 0.2s ease;
    text-align: center;
}

.chapter-list li a:hover {
    background: rgba(214, 161, 91, 0.12);
    border-color: rgba(214, 161, 91, 0.35);
}

.chapter-list li a.has-audio {
    border-color: rgba(214, 161, 91, 0.28);
}

.chapter-num {
    width: auto;
    height: auto;
    border-radius: 0;
    display: block;
    background: transparent;
    color: #c7ddd2;
    font-weight: 650;
    font-size: 0.98rem;
    line-height: 1.1;
}

.chapter-title {
    display: none;
    font-weight: 500;
    font-size: 0.68rem;
    color: var(--muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-audio-flag {
    position: absolute;
    top: 3px;
    right: 5px;
    color: var(--accent);
    font-size: 0.68rem;
    line-height: 1;
}

.reader-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.25rem;
    padding: 1.5rem 0 3rem;
}

.reader-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(18, 27, 40, 0.72);
    padding: 1rem;
    max-height: calc(100vh - 110px);
    overflow: auto;
}

.reader-sidebar h2 {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    color: var(--muted);
    font-weight: 600;
}

.mini-chapter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.25rem;
}

.mini-chapter-list a {
    display: block;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.mini-chapter-list a.is-active,
.mini-chapter-list a:hover {
    background: rgba(214, 161, 91, 0.12);
    color: var(--text);
}

.reader-main {
    display: grid;
    gap: 1rem;
}

.audio-player {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(214, 161, 91, 0.12), rgba(18, 27, 40, 0.85));
    padding: 1rem 1.1rem;
}

.audio-player h2 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.audio-player p {
    margin: 0 0 0.8rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.audio-player audio {
    width: 100%;
    height: 42px;
}

.reader-paper {
    background: var(--paper);
    color: var(--paper-ink);
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2.4rem);
    box-shadow: var(--shadow);
}

.reader-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(29, 36, 48, 0.1);
}

.reader-toolbar .muted {
    color: #667084;
    font-size: 0.92rem;
}

.reader-paper h1 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.2;
}

.reader-content {
    font-family: var(--font-read);
    font-size: clamp(1.05rem, 1.4vw, 1.18rem);
    line-height: 1.85;
}

.reader-content p {
    margin: 0 0 1.1rem;
}

.reader-content h2,
.reader-content h3,
.reader-content h4 {
    font-family: var(--font-display);
    line-height: 1.3;
    margin: 1.6rem 0 0.8rem;
}

.reader-content h2 { font-size: 1.45em; }
.reader-content h3 { font-size: 1.25em; }
.reader-content h4 { font-size: 1.1em; }

.reader-content ul,
.reader-content ol {
    margin: 0 0 1.1rem;
    padding-left: 1.4rem;
}

.reader-content li {
    margin: 0.25rem 0;
}

.reader-content blockquote {
    margin: 0 0 1.2rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid rgba(214, 161, 91, 0.7);
    background: rgba(29, 36, 48, 0.04);
    color: #3a4556;
}

.reader-content a {
    color: #8a6230;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reader-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0.5rem 0 1.1rem;
}

.reader-content pre,
.reader-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
}

.reader-content pre {
    overflow: auto;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(29, 36, 48, 0.06);
    margin: 0 0 1.1rem;
}

.reader-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.2rem;
    font-size: 0.95em;
}

.reader-content th,
.reader-content td {
    border: 1px solid rgba(29, 36, 48, 0.12);
    padding: 0.55rem 0.7rem;
    text-align: left;
}

.reader-content hr {
    border: 0;
    border-top: 1px solid rgba(29, 36, 48, 0.12);
    margin: 1.5rem 0;
}

.reader-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(29, 36, 48, 0.1);
}

.reader-nav a {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(29, 36, 48, 0.06);
    color: var(--paper-ink);
    font-weight: 600;
}

.reader-nav a:hover {
    background: rgba(214, 161, 91, 0.2);
}

.reader-nav a.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0 2.5rem;
    margin-top: 1rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    color: var(--muted);
}

.footer-brand {
    display: block;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    from { transform: scale(1.02) translateY(0); }
    to { transform: scale(1.06) translateY(-12px); }
}

@media (max-width: 1280px) {
    .story-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .story-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand toggle"
            "search search";
        padding: 0.75rem 0;
    }

    .brand { grid-area: brand; }
    .nav-toggle { grid-area: toggle; display: inline-flex; }
    .search-form {
        grid-area: search;
        width: 100%;
    }
    .search-form input { width: 100%; }

    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0.75rem 1rem 1rem;
        background: rgba(12, 18, 26, 0.98);
        border-bottom: 1px solid var(--line);
    }

    .primary-nav.is-open {
        display: flex;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        min-width: 0;
        box-shadow: none;
        margin-top: 0.35rem;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        display: grid;
    }

    .story-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .featured-card {
        flex-basis: 50%;
        aspect-ratio: 9 / 16;
    }

    .story-hero,
    .reader-layout {
        grid-template-columns: 1fr;
    }

    .story-hero-cover {
        max-width: 280px;
    }

    .reader-sidebar {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .story-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .featured-card {
        flex-basis: 100%;
        aspect-ratio: 9 / 16;
    }

    .section-head,
    .footer-inner,
    .chapter-panel-head,
    .reader-toolbar,
    .reader-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .chapter-select select {
        min-width: 0;
        width: 100%;
    }
}
