/* 有剧本 youjuben.com — 全站样式 v2（纸张 + 墨 + 朱砂 · 剧场感）
   设计参照：videoretalk 的 hero 光效/卡片质感 + aixfr 提示词库的信息框架；
   内容适配：剧本封面印章、纸面阅读、衬线标题、字号调节。 */
:root {
    --bg: #f5f2ea;
    --panel: #fffdf7;
    --ink: #26231d;
    --ink-2: #4c473e;
    --muted: #8b8374;
    --line: #e6dfd0;
    --line-2: #d9d0bd;
    --brand: #b23a2e;
    --brand-dark: #9a3126;
    --brand-weak: #f7eae6;
    --gold: #a2793a;
    --gold-ink: #8a6428;
    --gold-weak: #f6efe1;
    --green: #2f7d4f;
    --green-weak: #e9f3ed;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(38, 35, 29, .05);
    --shadow-md: 0 12px 32px rgba(38, 35, 29, .10);
    --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 24px; padding-bottom: 64px; min-height: 62vh; }

/* ── 顶部导航 ─────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(245, 242, 234, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--serif); font-weight: 800; font-size: 20px;
    color: var(--ink); text-decoration: none; letter-spacing: .02em;
}
.brand-seal {
    width: 27px; height: 27px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #c14a3a, #9a3126);
    color: #fff; font-size: 15px; font-family: var(--serif); font-weight: 700;
    border-radius: 8px; box-shadow: 0 3px 8px rgba(178, 58, 46, .35);
}
.brand-dot { color: var(--brand); }

.search { flex: 1; max-width: 420px; display: flex; }
.search input {
    flex: 1; min-width: 0; padding: 8px 14px; font-size: 14px;
    border: 1px solid var(--line-2); border-right: none; border-radius: 10px 0 0 10px;
    background: var(--panel); outline: none; font-family: inherit;
}
.search input:focus { border-color: var(--brand); }
.search button {
    padding: 8px 18px; font-size: 14px; cursor: pointer; font-family: inherit;
    border: none; border-radius: 0 10px 10px 0;
    background: var(--brand); color: #fff;
}
.search button:hover { background: var(--brand-dark); }

.header-nav { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.header-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.header-nav a:hover { color: var(--ink); }
.nav-cta { background: var(--brand); color: #fff !important; padding: 7px 14px; border-radius: 9px; }
.nav-cta:hover { background: var(--brand-dark); }
.nav-wallet { color: var(--gold-ink) !important; font-weight: 600; }
.nav-me { display: inline-flex; align-items: center; gap: 8px; padding: 4px 13px 4px 5px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--ink) !important; font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-me:hover { border-color: var(--brand); color: var(--brand) !important; }
.nav-avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #c14a3a, #9a3126); color: #fff; font-family: var(--serif); font-size: 14px; font-weight: 700; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--muted); font-size: 14px; cursor: pointer; font-family: inherit; }
.link-btn:hover { color: var(--ink); }

/* ── 提示条 ─────────────────────────── */
.flash { padding: 11px 15px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: var(--green-weak); color: #26663f; border: 1px solid #cfe6d9; }
.flash-error { background: #fbeae6; color: #97332a; border: 1px solid #f0cdc6; }

/* ── 首页 Hero（参考 videoretalk 光效） ── */
.hero {
    position: relative; overflow: hidden; border-radius: 24px;
    background:
        radial-gradient(960px 420px at 82% -20%, rgba(178, 58, 46, .42), transparent 62%),
        radial-gradient(720px 340px at 6% 116%, rgba(162, 121, 58, .30), transparent 60%),
        linear-gradient(180deg, #232030 0%, #1a1723 100%);
    color: #f6f2e9; padding: 56px 52px 48px; margin-bottom: 28px;
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent 88%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent 88%);
}
.hero > * { position: relative; z-index: 1; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; letter-spacing: .14em; color: #e9c9a8;
    border: 1px solid rgba(233, 201, 168, .35); border-radius: 999px;
    padding: 6px 14px; margin: 0 0 18px;
}
.hero-title {
    font-family: var(--serif); font-size: 42px; line-height: 1.3;
    margin: 0 0 14px; letter-spacing: .02em; font-weight: 800;
}
.hero-title .accent {
    background: linear-gradient(100deg, #e8b98a, #dc8f62);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: #c9c3d6; font-size: 15.5px; max-width: 640px; margin: 0 0 24px; line-height: 1.9; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.btn-light { background: #f6f2e9; color: #26231d; }
.btn-light:hover { background: #fff; color: #26231d; }
.btn-outline-light { background: transparent; border: 1px solid rgba(246, 242, 233, .4); color: #f6f2e9; }
.btn-outline-light:hover { border-color: rgba(246, 242, 233, .8); color: #fff; }
.hero-feats { display: flex; gap: 28px; flex-wrap: wrap; color: #bdb6c8; font-size: 13.5px; }
.hero-feats b { color: #f0e6d8; font-weight: 600; }

/* ── 分类 chips / 列表头 / 排序 ────────── */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 0 14px; }
.list-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; letter-spacing: .02em; }
.list-head .sub { color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
    padding: 6px 15px; border-radius: 999px; font-size: 13px; text-decoration: none;
    background: var(--panel); border: 1px solid var(--line-2); color: var(--muted);
}
.chip:hover { color: var(--brand); border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sort-tabs a { color: var(--muted); text-decoration: none; font-size: 14px; margin-right: 16px; }
.sort-tabs a.active { color: var(--ink); font-weight: 700; }
.search-note { margin: 0; font-size: 13px; color: var(--muted); }

/* ── 卡片瀑布 ─────────────────────────── */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    color: inherit; text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #f0ebdf; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.04); }

/* 无封面占位：稿纸线 + 朱砂印章 */
.card-ph {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background:
        repeating-linear-gradient(180deg, transparent 0 25px, rgba(120, 105, 80, .09) 25px 26px),
        linear-gradient(160deg, #fbf7ec, #f1e9d8);
}
.card-ph span {
    width: 84px; height: 84px; display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 46px; font-weight: 700; color: var(--brand);
    border: 2.5px solid rgba(178, 58, 46, .6); border-radius: 14px;
    background: rgba(255, 253, 247, .75); box-shadow: 0 4px 14px rgba(178, 58, 46, .12);
}
.ph-0, .ph-1, .ph-2, .ph-3 { background: inherit; }

.price-badge {
    position: absolute; top: 12px; right: 12px;
    padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
}
.price-badge.free { background: rgba(233, 243, 237, .94); color: var(--green); }
.price-badge.paid { background: rgba(246, 239, 225, .95); color: var(--gold-ink); border: 1px solid rgba(162, 121, 58, .3); }

.card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 16px 16px; }
.card-title { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.card-desc {
    margin: 0; font-size: 13px; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.tag { font-size: 12px; color: var(--brand); background: var(--brand-weak); padding: 2px 9px; border-radius: 6px; text-decoration: none; }
.meta-dot { font-size: 12px; color: var(--muted); }

.feed-end { text-align: center; padding: 26px 0; color: var(--muted); font-size: 13px; }
.pager-btn {
    display: inline-block; padding: 7px 18px; border-radius: 999px; font-size: 13px;
    background: var(--panel); border: 1px solid var(--line-2); color: var(--muted); text-decoration: none;
}
.pager-btn:hover { color: var(--brand); border-color: var(--brand); }
.pager-btn.disabled { opacity: .5; }
.feed-status { color: var(--muted); }
.done { color: #a99f8c; }

.empty {
    background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius);
    padding: 38px; text-align: center; color: var(--muted); font-size: 14px;
}

/* ── 详情页 ─────────────────────────── */
.back { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--brand); }
.detail-hero { display: grid; grid-template-columns: 300px 1fr; gap: 30px; align-items: start; }
.detail-cover {
    aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #f0ebdf;
    border: 1px solid var(--line); box-shadow: 0 20px 44px rgba(38, 35, 29, .16);
    position: relative;
}
.detail-cover::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; z-index: 2;
    background: linear-gradient(90deg, rgba(38, 35, 29, .18), rgba(38, 35, 29, 0));
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-cover .card-ph span { width: 116px; height: 116px; font-size: 64px; }
.detail-top-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-top-meta .price-badge { position: static; }
.detail-title { margin: 10px 0 6px; font-family: var(--serif); font-size: 32px; line-height: 1.35; letter-spacing: .01em; }
.detail-author { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.detail-stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.buy-box {
    display: flex; flex-direction: column; gap: 12px; max-width: 540px;
    background: linear-gradient(180deg, #fffdf8, #faf4e6);
    border: 1px solid var(--line-2); border-radius: 16px; padding: 20px 22px;
}
.price-line { display: flex; align-items: baseline; gap: 12px; }
.price-big { font-family: var(--serif); font-size: 34px; font-weight: 800; color: var(--gold-ink); }
.price-hint { color: var(--muted); font-size: 13px; }
.buy-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.buy-note { margin: 0; font-size: 13px; color: var(--muted); padding-top: 10px; border-top: 1px dashed rgba(120, 105, 80, .28); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 19px; border-radius: 10px; font-size: 14px; font-weight: 600;
    text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.btn-block { width: 100%; }
.btn.copied { border-color: var(--green); color: var(--green); }

.detail-summary { margin-top: 28px; }
.detail-summary h2, .episodes h2, .block-title { font-family: var(--serif); font-size: 19px; margin: 0 0 12px; letter-spacing: .02em; }
.detail-summary p { margin: 0; color: var(--ink-2); line-height: 2; white-space: pre-line; }

.episodes { margin-top: 28px; }
.episode-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.episode-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; transition: background .12s ease; }
.episode-list li:last-child .episode-row { border-bottom: none; }
.episode-row:hover { background: #faf6ec; }
.ep-idx { flex: none; width: 70px; color: var(--muted); font-size: 13px; font-family: var(--serif); letter-spacing: .02em; }
.ep-title { flex: 1; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-right { flex: none; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 6px; }
.badge-preview { background: var(--green-weak); color: var(--green); }
.badge-lock { background: #f1ece0; color: var(--muted); }

/* ── 阅读页（纸面质感） ─────────────────── */
.reader { max-width: 800px; margin: 0 auto; }
.reader-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.reader-pos { color: var(--muted); font-size: 13px; }
.reader-toolbar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 9px 12px; margin-bottom: 18px;
}
.toolbar-sep { width: 1px; height: 18px; background: var(--line-2); }
.toolbar-spacer { flex: 1; }
.font-tools { display: flex; gap: 2px; background: #f1ece0; border-radius: 8px; padding: 2px; }
.font-btn {
    border: 0; background: transparent; padding: 5px 11px; border-radius: 6px;
    color: var(--muted); font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.font-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.reader-title { margin: 6px 0 18px; font-family: var(--serif); font-size: 24px; letter-spacing: .02em; }
.reader-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 6px 0 18px; }
.reader-title-row .reader-title { margin: 0; }
.reader-next-top { flex: none; }
.reader-next-done { flex: none; color: var(--muted); font-size: 13px; }
.reader-body {
    background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 36px 42px; font-family: var(--serif); font-size: 17.5px; line-height: 2.05;
    word-break: break-word; color: #2d2a23;
    box-shadow: 0 1px 2px rgba(38, 35, 29, .04);
}
.reader-body p { margin: 0 0 12px; }
.reader-body p:last-child { margin-bottom: 0; }
.rb-action { margin: 6px 0 14px; padding: 2px 0 2px 14px; border-left: 3px solid rgba(178, 58, 46, .25); color: #8a7f6a; font-size: .9em; line-height: 1.95; }
.rb-say { margin: 0 0 12px; padding-left: 26px; }
.rb-say .rb-who { color: var(--brand); font-weight: 700; }
.rb-say .rb-note { color: #9a917f; font-size: .88em; }
.rb-text { margin: 0 0 12px; }
.gate {
    background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius);
    padding: 44px 26px; text-align: center;
}
.gate-lock { font-size: 40px; line-height: 1; }
.gate-title { margin: 12px 0 6px; font-family: var(--serif); font-size: 19px; }
.gate-desc { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.reader-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }

/* ── 阅读页：左目录右正文 ─────────────── */
.reader-grid { display: grid; grid-template-columns: 264px 1fr; gap: 22px; align-items: start; }
.reader-side { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 12px; }
.side-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.side-back { display: inline-block; margin-bottom: 8px; font-size: 13px; color: var(--muted); text-decoration: none; }
.side-back:hover { color: var(--brand); }
.side-title { margin: 0 0 10px; font-family: var(--serif); font-size: 18px; line-height: 1.45; }
.side-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.side-summary { font-size: 13px; color: var(--muted); }
.side-summary summary { cursor: pointer; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.side-summary p { margin: 0; line-height: 1.85; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.side-buy { margin-top: 12px; }
.side-buy .btn { width: 100%; }
.side-fav { margin-top: 10px; }
.side-fav .btn { width: 100%; }
.btn.favorited { border-color: var(--gold-ink); color: var(--gold-ink); }
.side-toc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; }
.side-toc summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); margin: 2px 8px 8px; }
.side-toc summary::-webkit-details-marker { display: none; }
.toc-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; }
.toc-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.toc-item:hover { background: #faf6ec; }
.toc-item.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.toc-idx { flex: none; width: 46px; font-family: var(--serif); font-size: 12.5px; opacity: .75; }
.toc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-badge { flex: none; font-size: 11px; padding: 1px 7px; }
.reader-main { min-width: 0; max-width: 820px; }
.reader-price { font-size: 13px; color: var(--gold-ink); text-decoration: none; }

/* ── 认证页 ─────────────────────────── */
.auth-card {
    max-width: 430px; margin: 44px auto; background: var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
    box-shadow: var(--shadow-md);
}
.auth-title { margin: 0 0 16px; font-family: var(--serif); font-size: 23px; }
.auth-hint { margin: -8px 0 8px; color: var(--muted); font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field input {
    padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px;
    font-size: 14px; outline: none; background: #fff; font-family: inherit;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(178, 58, 46, .12); }
.field input:disabled { background: #f1ece0; color: var(--muted); }
.field textarea, .field select { padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 14px; outline: none; background: #fff; font-family: inherit; color: var(--ink); }
.field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(178, 58, 46, .12); }
.field textarea { resize: vertical; line-height: 1.8; }
.field textarea.tall { min-height: 320px; }
.cover-thumb { display: inline-block; vertical-align: middle; max-width: 120px; max-height: 90px; border: 1px solid var(--line); border-radius: 8px; margin-left: 4px; }
.cover-preview { display: none; max-width: 240px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; box-shadow: 0 1px 2px rgba(38, 35, 29, .06); }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 180px; }
.badge-published { background: var(--green-weak); color: var(--green); }
.badge-draft { background: #f1ece0; color: var(--muted); }
.badge-pending { background: var(--gold-weak); color: var(--gold-ink); }
.badge-rejected { background: #fbeae6; color: #97332a; }
.badge-offline { background: #efece4; color: #9a937f; }
.text-danger { color: #97332a; }
.app-tabs-sub { margin-top: -6px; }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.auth-links { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.dot { margin: 0 6px; }

/* ── 用户中心 ─────────────────────────── */
.app-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.app-tabs a {
    padding: 10px 16px; color: var(--muted); text-decoration: none; font-size: 14px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.app-tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.page-title { margin: 0 0 16px; font-family: var(--serif); font-size: 23px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row-item {
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.row-compact { padding: 10px 14px; }
.row-title { font-weight: 600; color: inherit; text-decoration: none; }
.row-title:hover { color: var(--brand); }
.row-title-sm { font-size: 14px; }
.row-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.row-right { flex: none; text-align: right; }
.tx-amount.plus { color: var(--green); font-weight: 600; }
.tx-amount.minus { color: var(--ink-2); font-weight: 600; }

.wallet-grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.wallet-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.wallet-label { margin: 0; color: var(--muted); font-size: 13px; }
.wallet-balance { margin: 6px 0 16px; font-family: var(--serif); font-size: 36px; font-weight: 800; color: var(--gold-ink); }
.redeem-form { display: flex; flex-direction: column; gap: 10px; }
.wallet-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.8; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

.pager { display: flex; gap: 12px; justify-content: center; align-items: center; padding: 18px 0; font-size: 13px; color: var(--muted); }
.pager-info { color: var(--muted); }

/* ── 用户主页 ─────────────────────────── */
.notice-bar { display: flex; gap: 8px; align-items: flex-start; background: var(--gold-weak); border: 1px solid rgba(162, 121, 58, .3); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; color: var(--gold-ink); }
.notice-bar span { white-space: pre-line; }
.side-report { margin: 10px 0 0; font-size: 12px; text-align: center; }
.side-report a { color: var(--muted); text-decoration: none; }
.side-report a:hover { color: var(--brand); }
.row-item.unread { border-left: 3px solid var(--brand); }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 4px; vertical-align: middle; }
.badge-row { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; gap: 5px; flex-wrap: wrap; max-width: 82%; }
.script-badge { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .05em; box-shadow: 0 2px 8px rgba(0, 0, 0, .22); }
.script-badge.auto { background: rgba(38, 35, 29, .74); color: #f6f1e3; font-weight: 500; box-shadow: none; }
.side-meta .script-badge { box-shadow: none; font-size: 11.5px; padding: 2px 8px; }
.rating-summary { margin: 8px 0 0; font-family: var(--serif); font-size: 15px; color: var(--gold-ink); font-weight: 700; }
.rating-summary .meta-dot { font-weight: 400; font-size: 12.5px; }
.rating-box { margin-top: 26px; border-top: 1px dashed var(--line-2); padding-top: 18px; }
.rating-form { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.rate-stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 3px; }
.rate-star { position: relative; }
.rate-star input { position: absolute; opacity: 0; pointer-events: none; }
.rate-star span { font-size: 28px; line-height: 1; color: #d9d3c4; cursor: pointer; transition: color .12s ease; }
.rate-star:hover span,
.rate-star:hover ~ .rate-star span,
.rate-star:has(input:checked) span,
.rate-star:has(input:checked) ~ .rate-star span { color: #d8a43c; }
.rating-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.rating-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--panel); }
.rating-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rating-stars-static { color: #d8a43c; font-size: 13px; letter-spacing: .08em; }
.rating-comment { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.preview-banner { background: var(--gold-weak); border: 1px solid rgba(162, 121, 58, .35); color: var(--gold-ink); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }

.profile-card { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #c14a3a, #9a3126); color: #fff; font-family: var(--serif); font-size: 28px; font-weight: 700; flex: none; box-shadow: 0 6px 16px rgba(178, 58, 46, .25); }
.profile-info { flex: 1; min-width: 0; }
.profile-name { margin: 0; font-family: var(--serif); font-size: 20px; }
.profile-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.profile-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: inherit; display: block; transition: border-color .15s ease, transform .15s ease; }
.stat-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { font-family: var(--serif); font-size: 26px; font-weight: 800; margin-top: 6px; color: var(--ink); }
.stat-value.gold { color: var(--gold-ink); }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.section-title-row h2 { font-family: var(--serif); font-size: 18px; margin: 0; }
.section-title-row a { font-size: 13px; color: var(--muted); }

/* ── 页脚 ─────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 28px 0; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 0; }
.footer-sub { margin-top: 6px !important; font-size: 12px; color: #b3a992; }

/* ── 筛选行（题材 / 受众 / 状态） ────────── */
.filters { margin-bottom: 14px; }
.chip-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chip-row:last-child { margin-bottom: 0; }
.chip-label { flex: none; width: 40px; color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.chip-row .chips { margin-bottom: 0; }

.badge-serial { background: var(--gold-weak); color: var(--gold-ink); }
.badge-done { background: var(--green-weak); color: var(--green); }

/* ── 响应式 ─────────────────────────── */
@media (max-width: 760px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
    .search { order: 3; max-width: none; width: 100%; }
    .header-nav { gap: 10px; }
    .hero { padding: 36px 24px 34px; border-radius: 18px; }
    .hero-title { font-size: 29px; }
    .hero-feats { gap: 12px; }
    .detail-hero { grid-template-columns: 1fr; }
    .detail-cover { max-width: 240px; }
    .detail-title { font-size: 25px; }
    .wallet-grid, .account-grid { grid-template-columns: 1fr; }
    .reader-body { padding: 20px 17px; font-size: 16.5px; }
    .row-item { flex-direction: column; align-items: flex-start; }
    .row-right { text-align: left; }
}

@media (max-width: 900px) {
    .reader-grid { grid-template-columns: 1fr; }
    .reader-side { position: static; }
    .toc-list { max-height: 260px; }
}
