/* 拾光阅读 · 设计系统 —— 色板/字体取自 Website-Clone 设计稿 */
:root {
  color-scheme: light;
  --bg-page: #f8f9f9;
  --bg-container: #ffffff;
  --bg-container-secondary: rgba(0, 0, 0, 0.04);
  --bg-container-tertiary: rgba(0, 0, 0, 0.08);
  --text-text: rgba(0, 0, 0, 0.82);
  --text-secondary: rgba(0, 0, 0, 0.48);
  --text-tertiary: rgba(0, 0, 0, 0.36);
  --border: rgba(0, 0, 0, 0.09);
  --accent: #00c0b6;
  --accent-strong: #00a89e;
  --accent-soft: rgba(0, 192, 182, 0.1);
  --event: #fa595f;
  --gold: #bb996d;
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 14px;
  --font-body: "Helvetica Neue", Helvetica, "Lucida Grande", "Luxi Sans", Arial, "PingFang SC", "Hiragino Sans GB", STHeiti, "Microsoft YaHei", "Wenquanyi Micro Hei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", SimSun, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-text);
  font-size: 14px;
  line-height: 1.6;
  min-width: 320px;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 8px 12px; background: #111; color: #fff; border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

/* ───── 顶部导航 ───── */
.site-header {
  background: var(--bg-container);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; letter-spacing: .5px; flex-shrink: 0; }
.logo .logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #35d9c0);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.logo .logo-sub { font-size: 10px; color: var(--text-tertiary); font-weight: 400; letter-spacing: 2px; display: block; line-height: 1.2; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 6px 14px; border-radius: 999px; font-size: 15px; color: var(--text-secondary);
  transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text-text); background: var(--bg-container-secondary); }
.main-nav a.active { color: var(--accent-strong); font-weight: 600; background: var(--accent-soft); }
.header-search { position: relative; width: 220px; }
.header-search input {
  width: 100%; height: 34px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-page); padding: 0 14px 0 34px; font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.header-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.header-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-tertiary); fill: none; stroke-width: 2; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font-size: 14px; transition: transform .12s, box-shadow .15s, background .15s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #04cfc0, var(--accent-strong));
  color: #fff; padding: 8px 20px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 168, 158, 0.35);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(0, 168, 158, 0.45); color: #fff; }
.btn-ghost { border: 1px solid var(--border); padding: 7px 18px; background: var(--bg-container); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 8px; place-items: center; }
.menu-toggle svg { width: 22px; height: 22px; stroke: var(--text-text); fill: none; stroke-width: 1.8; }
.mobile-tabbar { display: none; }

/* ───── 卡片 / 书封 / 标签 ───── */
.card { background: var(--bg-container); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.book-cover {
  aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.10);
  transition: transform .2s ease, box-shadow .2s ease;
  background: var(--bg-container-tertiary);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 28px; font-weight: 700; color: var(--accent-strong); background: linear-gradient(135deg, var(--accent-soft), var(--bg-container-secondary)); }
a:hover > .book-cover, .book-card:hover .book-cover { transform: translateY(-4px); box-shadow: 0 6px 14px rgba(0,0,0,.14), 0 14px 32px rgba(0,0,0,.14); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11px; background: var(--bg-container-secondary); color: var(--text-secondary); }
.tag-accent { background: var(--accent-soft); color: var(--accent-strong); }
.tag-event { background: rgba(250, 89, 95, 0.1); color: var(--event); }
.tag-gold { background: rgba(187, 153, 109, 0.12); color: var(--gold); }
.rank-badge {
  position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; z-index: 2;
}
.rank-badge.top { background: var(--event); }

/* ───── 页脚 ───── */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 36px 0 46px; color: var(--text-tertiary); font-size: 12px; background: var(--bg-container); }
.site-footer .cols { display: flex; gap: 48px; flex-wrap: wrap; margin-bottom: 22px; }
.site-footer h4 { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.site-footer a { display: block; padding: 3px 0; color: var(--text-tertiary); }
.site-footer a:hover { color: var(--accent-strong); }

/* ───── 首页 ───── */
.hero { margin: 20px auto 0; }
.hero-banner {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-card); aspect-ratio: 1180 / 300;
  background: linear-gradient(135deg, #fef3e2, #fde8cd);
}
.hero-banner img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 6%; max-width: 58%;
}
.hero-copy h1 { font-size: clamp(22px, 3vw, 40px); font-weight: 800; color: #7a3d10; letter-spacing: 2px; line-height: 1.25; }
.hero-copy p { margin-top: 8px; font-size: clamp(12px, 1.2vw, 16px); color: rgba(122, 61, 16, 0.75); }
.hero-copy .hero-cta {
  margin-top: 16px; align-self: flex-start; background: var(--event); color: #fff;
  padding: 8px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 10px rgba(250, 89, 95, 0.4); transition: box-shadow .15s;
}
.hero-copy .hero-cta:hover { box-shadow: 0 5px 16px rgba(250, 89, 95, 0.5); color: #fff; }
.channel-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 20px; }
.channel-row a {
  background: var(--bg-container); border-radius: var(--radius); padding: 13px 0;
  text-align: center; font-size: 15px; font-weight: 600; box-shadow: var(--shadow-card);
  transition: color .15s, transform .15s;
}
.channel-row a:hover { color: var(--accent-strong); transform: translateY(-2px); }

.section { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-head h2 { font-size: 21px; font-weight: 700; }
.section-head h2 em { font-style: normal; color: var(--event); }
.section-head .more { margin-left: auto; font-size: 13px; color: var(--text-tertiary); }
.section-head .more:hover { color: var(--accent-strong); }
.filter-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-tags a, .filter-tags button { padding: 5px 14px; border-radius: 999px; font-size: 13px; color: var(--text-secondary); background: var(--bg-container); border: 1px solid var(--border); text-decoration: none; }
.filter-tags a.on, .filter-tags button.on, .filter-tags a.active { background: var(--event); border-color: var(--event); color: #fff; font-weight: 600; }

.book-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.book-card { display: flex; flex-direction: column; gap: 8px; }
.book-card h3 { font-size: 15px; font-weight: 600; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.book-card .author { font-size: 12px; color: var(--text-tertiary); }
.book-card .desc { font-size: 12px; color: var(--text-secondary); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card .meta { display: flex; gap: 6px; }

/* 编辑强推 */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.editor-card { display: flex; gap: 18px; padding: 18px; }
.editor-card .book-cover { width: 108px; flex-shrink: 0; }
.editor-card .info { display: flex; flex-direction: column; min-width: 0; }
.editor-card h3 { font-size: 17px; font-weight: 700; }
.editor-card .author { font-size: 12px; color: var(--text-tertiary); margin: 3px 0 8px; }
.editor-card .quote {
  font-size: 13px; color: var(--text-secondary); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.editor-card .meta { margin-top: auto; display: flex; gap: 6px; padding-top: 10px; }

/* 排行榜三列 */
.rank-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.rank-col { padding: 20px; }
.rank-col > h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.rank-col > p { font-size: 12px; color: var(--text-tertiary); margin-bottom: 14px; }
.rank-col ol { list-style: none; counter-reset: rk; }
.rank-col li { counter-increment: rk; display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--border); }
.rank-col li::before {
  content: counter(rk); width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--bg-container-secondary); color: var(--text-tertiary);
}
.rank-col li:nth-child(1)::before, .rank-col li:nth-child(2)::before, .rank-col li:nth-child(3)::before { background: rgba(250,89,95,.12); color: var(--event); }
.rank-col li a { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.rank-col li a:hover { color: var(--accent-strong); }
.rank-col li .cat { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; }

/* ───── 书库 ───── */
.lib-search { margin: 26px 0 20px; }
.lib-search form { position: relative; max-width: 640px; margin: 0 auto; }
.lib-search input {
  width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-container); padding: 0 118px 0 46px; font-size: 15px; outline: none;
  box-shadow: var(--shadow-card); transition: border-color .15s, box-shadow .15s;
}
.lib-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lib-search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--text-tertiary); fill: none; stroke-width: 2; }
.lib-search button {
  position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 24px; border-radius: 999px;
  background: linear-gradient(180deg, #04cfc0, var(--accent-strong)); color: #fff; font-size: 14px; font-weight: 600;
}
.hot-words { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--text-tertiary); align-items: center; }
.hot-words a { padding: 3px 10px; border-radius: 999px; background: var(--bg-container-secondary); color: var(--text-secondary); }
.hot-words a:hover { background: var(--accent-soft); color: var(--accent-strong); }

.filter-panel { padding: 18px 22px; margin-bottom: 22px; }
.filter-row { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.filter-row:last-child { border-bottom: 0; }
.filter-row .label { font-size: 13px; color: var(--text-tertiary); width: 44px; flex-shrink: 0; }
.filter-row a, .filter-row button { padding: 3px 12px; border-radius: 999px; font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.filter-row a:hover, .filter-row button:hover { color: var(--accent-strong); }
.filter-row a.on, .filter-row button.on, .filter-row a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

.result-bar { display: flex; align-items: center; margin-bottom: 16px; gap: 14px; }
.result-bar .count { font-size: 13px; color: var(--text-tertiary); }
.result-bar .count b { color: var(--accent-strong); }
.sort-group { margin-left: auto; display: flex; gap: 2px; background: var(--bg-container); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.sort-group a, .sort-group button { padding: 4px 14px; border-radius: 999px; font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.sort-group a.on, .sort-group button.on, .sort-group a.active { background: var(--accent); color: #fff; font-weight: 600; }

.result-list { display: flex; flex-direction: column; gap: 14px; }
.result-item { display: flex; gap: 18px; padding: 18px; }
.result-item .book-cover { width: 96px; flex-shrink: 0; }
.result-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-item h3 { font-size: 17px; font-weight: 700; }
.result-item .author { font-size: 12px; color: var(--text-tertiary); margin: 3px 0 8px; }
.result-item .desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-item .foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-item .stat { font-size: 12px; color: var(--text-tertiary); }
.result-item .stat b { color: var(--gold); font-size: 14px; }
.result-item .go { margin-left: auto; flex-shrink: 0; }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 30px; }
.pager a, .pager span.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; background: var(--bg-container); border: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.pager a.on, .pager span.pg.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager a:hover:not(.on) { border-color: var(--accent); color: var(--accent-strong); }
.pager .pg-info { font-size: 13px; color: var(--text-tertiary); padding: 0 8px; }

/* ───── 书籍详情 ───── */
.detail-hero { display: flex; gap: 30px; padding: 30px; margin-bottom: 22px; }
.detail-hero .book-cover { width: 200px; flex-shrink: 0; }
.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-info h1 { font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.detail-info .byline { margin: 6px 0 14px; font-size: 13px; color: var(--text-tertiary); }
.detail-info .byline a { color: var(--accent-strong); }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.score-row { display: flex; align-items: center; gap: 26px; padding: 14px 18px; background: var(--bg-page); border-radius: var(--radius); margin-bottom: 18px; }
.score-row .score b { font-size: 30px; font-weight: 800; color: var(--gold); }
.score-row .score span { font-size: 12px; color: var(--text-tertiary); display: block; }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.score-row .divider { width: 1px; height: 34px; background: var(--border); }
.score-row .stat b { font-size: 18px; font-weight: 700; display: block; }
.score-row .stat span { font-size: 12px; color: var(--text-tertiary); }
.detail-actions { display: flex; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.detail-actions .btn { padding: 11px 30px; font-size: 15px; }

.detail-body { display: grid; grid-template-columns: 1fr 320px; gap: 22px; margin-top: 24px; align-items: start; }
.panel { padding: 24px; }
.panel h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }
.synopsis p { font-size: 14px; color: var(--text-secondary); line-height: 1.9; margin-bottom: 10px; }

.chapter-panel { margin-top: 22px; }
.chapter-head { display: flex; align-items: center; margin-bottom: 8px; }
.chapter-head .sub { font-size: 12px; color: var(--text-tertiary); margin-left: 10px; }
.chapter-head a { margin-left: auto; font-size: 12px; color: var(--accent-strong); }
.chapter-list { list-style: none; columns: 2; column-gap: 30px; }
.chapter-list li { break-inside: avoid; }
.chapter-list a { display: flex; gap: 8px; padding: 9px 6px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px dashed var(--border); }
.chapter-list a:hover { color: var(--accent-strong); }
.chapter-list .ch-num { color: var(--text-tertiary); flex-shrink: 0; }
.chapter-list .ch-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chapter-list .free { font-size: 11px; color: var(--accent-strong); flex-shrink: 0; }
.chapter-list .lock { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; }

.review { padding: 14px 0; border-top: 1px dashed var(--border); }
.review:first-of-type { border-top: 0; padding-top: 0; }
.review .who { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review .avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.review .name { font-size: 13px; font-weight: 600; }
.review .when { font-size: 11px; color: var(--text-tertiary); }
.review p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

.side-book { display: flex; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--border); }
.side-book:first-of-type { border-top: 0; }
.side-book .book-cover { width: 56px; flex-shrink: 0; }
.side-book h4 { font-size: 13px; font-weight: 600; }
.side-book span { font-size: 11px; color: var(--text-tertiary); display: block; margin-top: 3px; }

/* ───── 阅读器 ───── */
body.reader-page { --rd-size: 18px; --rd-leading: 1.9; padding-bottom: 0 !important; }
body.reader-page[data-theme="day"] {
  --rd-bg: #f6f3ec; --rd-paper: #fdfbf5; --rd-fg: #33302a; --rd-fg-soft: rgba(51,48,42,.55);
  --rd-border: rgba(51,48,42,.1); --rd-chrome: rgba(253,251,245,.95);
  background: var(--rd-bg); color: var(--rd-fg);
}
body.reader-page[data-theme="night"] {
  --rd-bg: #17191c; --rd-paper: #1e2126; --rd-fg: rgba(235,232,225,.86); --rd-fg-soft: rgba(235,232,225,.45);
  --rd-border: rgba(235,232,225,.1); --rd-chrome: rgba(30,33,38,.95);
  background: var(--rd-bg); color: var(--rd-fg);
}
body.reader-page { background: var(--rd-bg, #f6f3ec); color: var(--rd-fg, #33302a); transition: background .25s, color .25s; }

.reader-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 70; width: 0; }
.reader-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 52px;
  background: var(--rd-chrome, rgba(253,251,245,.95)); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rd-border, rgba(51,48,42,.1));
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  transition: transform .25s ease;
}
.reader-top.hidden { transform: translateY(-100%); }
.reader-top .back { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--rd-fg); padding: 8px; border-radius: 8px; text-decoration: none; }
.reader-top .back:hover { background: var(--rd-border); }
.reader-top .back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.reader-top .crumb { flex: 1; min-width: 0; text-align: center; }
.reader-top .crumb b { font-size: 14px; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reader-top .crumb span { font-size: 11px; color: var(--rd-fg-soft); }
.tool-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--rd-fg); flex-shrink: 0; }
.tool-btn:hover { background: var(--rd-border); }
.tool-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.reader-stage { max-width: 720px; margin: 0 auto; padding: 84px 28px 40px; }
.reader-paper { background: var(--rd-paper, #fdfbf5); border-radius: 12px; padding: clamp(24px, 5vw, 56px); box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.chapter-title { font-family: var(--font-serif); font-size: calc(var(--rd-size) * 1.5); font-weight: 700; margin-bottom: .4em; }
.chapter-meta { font-size: 12px; color: var(--rd-fg-soft); margin-bottom: 2.2em; display: flex; gap: 14px; }
.reader-body { font-family: var(--font-serif); font-size: var(--rd-size); line-height: var(--rd-leading); }
.reader-body p { margin-bottom: 1.15em; text-align: justify; white-space: pre-wrap; }
.chapter-nav { display: flex; gap: 12px; margin-top: 34px; }
.chapter-nav a, .chapter-nav span { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 0; font-size: 14px; border: 1px solid var(--rd-border); border-radius: 10px; color: var(--rd-fg); background: var(--rd-paper); text-decoration: none; }
.chapter-nav a:hover { border-color: var(--accent); color: var(--accent-strong); }
.chapter-nav span.disabled { opacity: .4; pointer-events: none; }
.purchase-notice { margin-top: 24px; padding: 22px; border-left: 3px solid var(--gold); background: rgba(187,153,109,.07); border-radius: 0 10px 10px 0; }
.purchase-notice strong { font-size: 15px; }
.purchase-notice p { margin: 6px 0 14px; font-size: 13px; color: var(--rd-fg-soft); }
.reader-foot { max-width: 720px; margin: 0 auto; padding: 0 28px 46px; text-align: center; font-size: 12px; color: var(--rd-fg-soft); }

/* 目录侧栏 */
.toc-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s; }
.toc-mask.open { opacity: 1; pointer-events: auto; }
.toc-panel {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 85vw); z-index: 85;
  background: var(--rd-paper, #fdfbf5); transform: translateX(-100%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.toc-panel.open { transform: none; }
.toc-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--rd-border); }
.toc-head b { font-size: 16px; }
.toc-head span { font-size: 12px; color: var(--rd-fg-soft); display: block; margin-top: 2px; }
.toc-list { flex: 1; overflow-y: auto; padding: 8px 6px 20px; }
.toc-list a { display: flex; gap: 8px; align-items: center; padding: 10px 14px; font-size: 13px; color: var(--rd-fg-soft); border-radius: 8px; text-decoration: none; }
.toc-list a:hover { background: var(--rd-border); }
.toc-list a.current { color: var(--accent-strong); font-weight: 600; background: var(--accent-soft); }
.toc-list a .n { flex-shrink: 0; width: 3.2em; color: var(--rd-fg-soft); font-size: 12px; }
.toc-list a .t { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.toc-list a .lk { margin-left: auto; font-size: 11px; flex-shrink: 0; }

/* 设置面板 */
.setting-pop {
  position: fixed; right: 14px; top: 60px; z-index: 75; width: 300px;
  background: var(--rd-paper, #fdfbf5); border: 1px solid var(--rd-border); border-radius: 14px;
  box-shadow: var(--shadow-pop); padding: 18px; display: none;
}
.setting-pop.open { display: block; }
.set-row { margin-bottom: 16px; }
.set-row:last-child { margin-bottom: 0; }
.set-row label, .set-row .set-label { font-size: 12px; color: var(--rd-fg-soft); display: block; margin-bottom: 8px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 9px 0; border: 1px solid var(--rd-border); border-radius: 9px; font-size: 13px; color: var(--rd-fg); background: transparent; }
.seg button.on { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 40px; height: 36px; border: 1px solid var(--rd-border); border-radius: 9px; font-size: 17px; color: var(--rd-fg); }
.stepper button:hover { border-color: var(--accent); color: var(--accent-strong); }
.stepper b { flex: 1; text-align: center; font-size: 15px; }

/* ───── 登录/注册 ───── */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth-main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  position: relative; display: flex; flex-direction: column;
  justify-content: space-between; gap: 32px; padding: 44px 48px;
  background: #f4efe7; color: var(--text-text);
  border-right: 1px solid rgba(187, 153, 109, 0.22);
}
.auth-side::after {
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  border: 1px solid rgba(187, 153, 109, 0.3); border-radius: 4px;
}
.auth-side .side-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--text-text); text-decoration: none; }
.auth-side .side-logo .logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 800; }
.auth-side .shelf-label { font-size: 12px; letter-spacing: 3px; color: #bb996d; margin-bottom: 14px; }
.auth-side .shelf-label::after { content: ""; display: block; width: 36px; height: 1px; background: #d6c0a2; margin-top: 10px; }
.auth-side .covers { display: flex; gap: 16px; align-items: flex-end; }
.auth-side .covers .cover-slot {
  width: clamp(84px, 8.5vw, 118px); aspect-ratio: 3/4; border-radius: 4px;
  background: linear-gradient(160deg, var(--accent-soft), #e8e4dc);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 5px rgba(53,57,60,.14), 0 10px 22px rgba(53,57,60,.12);
  display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--accent-strong);
  transition: transform .18s ease, box-shadow .18s ease;
}
.auth-side .covers .cover-slot:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 4px 8px rgba(53,57,60,.16), 0 14px 28px rgba(53,57,60,.16); }
.auth-side .shelf-line { height: 1px; background: linear-gradient(90deg, #d6c0a2, rgba(214,192,162,0)); margin-top: 18px; max-width: 420px; }
.auth-side blockquote { font-family: var(--font-serif); font-size: clamp(19px, 1.8vw, 26px); line-height: 1.75; max-width: 24em; color: #333; }
.auth-side cite { display: block; margin-top: 14px; font-size: 13px; font-style: normal; color: rgba(0, 0, 0, 0.48); }
.auth-side cite b { color: #bb996d; font-weight: 600; }
.auth-side .brand-shelf { display: flex; flex-direction: column; gap: 30px; }

.auth-box { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg-container); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card .sub { font-size: 13px; color: var(--text-tertiary); margin: 6px 0 26px; }
.mode-tabs { display: flex; background: var(--bg-container-secondary); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.mode-tabs a { flex: 1; padding: 9px 0; border-radius: 9px; font-size: 14px; color: var(--text-secondary); text-align: center; text-decoration: none; }
.mode-tabs a.on { background: var(--bg-container); color: var(--text-text); font-weight: 600; box-shadow: var(--shadow-card); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 14px; font-size: 14px; outline: none; background: var(--bg-container);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.submit-btn {
  width: 100%; height: 48px; border-radius: 12px; font-size: 15px; font-weight: 700; color: #fff;
  background: #00c0b6; border: 0; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .12s;
}
.submit-btn:hover { background: #00b1a7; box-shadow: 0 3px 10px rgba(0,177,167,.22); }
.submit-btn:active { transform: translateY(1px); }
.switch-line { text-align: center; font-size: 13px; color: var(--text-tertiary); margin-top: 18px; }
.switch-line a { color: var(--accent-strong); font-weight: 600; }
.oauth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--text-tertiary); font-size: 12px; }
.oauth-divider::before,
.oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oauth-buttons { display: flex; flex-direction: column; gap: 10px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 46px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .12s;
}
.oauth-btn svg { width: 18px; height: 18px; flex: none; }
.oauth-btn:disabled { opacity: .6; cursor: default; }
.oauth-google { background: var(--bg-container); color: var(--text-text); border: 1px solid var(--border); }
.oauth-google:hover { background: var(--bg-container-secondary); }
.oauth-apple { background: #111; color: #fff; border: 1px solid #111; }
.oauth-apple:hover { background: #262626; }
.auth-foot { text-align: center; font-size: 12px; color: var(--text-tertiary); padding: 18px; background: var(--bg-container); border-top: 1px solid var(--border); }

/* ───── 用户中心 / 工作台 ───── */
.workspace { min-height: 66vh; padding: 44px 0 64px; }
.workspace-heading { margin-bottom: 28px; }
.workspace-heading.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.workspace-heading h1 { font-size: 26px; font-weight: 800; }
.workspace-heading .kicker { font-size: 12px; color: var(--accent-strong); font-weight: 600; letter-spacing: 1px; margin-bottom: 6px; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-row a { display: flex; flex-direction: column; justify-content: center; padding: 22px; border-radius: var(--radius-lg); background: var(--bg-container); box-shadow: var(--shadow-card); transition: transform .15s; }
.metric-row a:hover { transform: translateY(-2px); color: inherit; }
.metric-row span { font-size: 13px; color: var(--text-tertiary); }
.metric-row strong { font-size: 28px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.workspace-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.workspace-links a { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-container); font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.workspace-links a:hover { border-color: var(--accent); color: var(--accent-strong); }
.work-table { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.work-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 90px; align-items: center; gap: 20px; padding: 15px 8px; border-bottom: 1px solid var(--border); }
.work-row small { display: block; color: var(--text-tertiary); }
.work-row:hover { background: var(--bg-container-secondary); }

/* ───── 社区/书评 ───── */
.community-page { max-width: 860px; }
.community-form { display: grid; gap: 12px; margin-bottom: 30px; padding: 20px 0; border-block: 1px dashed var(--border); }
.community-form label { display: grid; gap: 8px; font-weight: 600; font-size: 13px; }
.community-form textarea { min-height: 110px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--bg-container); font: inherit; outline: none; }
.community-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.community-form .btn { justify-self: start; }
.community-login { padding: 14px 0; border-block: 1px dashed var(--border); }
.community-login a { color: var(--accent-strong); font-weight: 600; }
.community-list article, .comment-focus { padding: 20px 4px; border-bottom: 1px dashed var(--border); }
.community-list header, .comment-focus header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.community-list .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.community-list time, .comment-focus time { color: var(--text-tertiary); font-size: 12px; margin-left: auto; }
.community-list article > a { color: var(--accent-strong); font-size: 13px; font-weight: 600; }
.comment-focus { margin-bottom: 24px; border-left: 3px solid var(--gold); padding-left: 18px; background: rgba(187,153,109,.05); border-radius: 0 10px 10px 0; }

/* ───── 公告/新闻 ───── */
.news-article { max-width: 820px; min-height: 66vh; padding: 54px 24px 72px; margin: 0 auto; }
.news-article header { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.news-article .kicker { font-size: 12px; color: var(--accent-strong); font-weight: 600; letter-spacing: 1px; }
.news-article h1 { margin: 8px 0; font-size: 30px; font-weight: 800; line-height: 1.3; }
.news-article header > p:last-child { color: var(--text-tertiary); font-size: 13px; }
.news-article > div { padding-top: 24px; font-size: 16px; line-height: 1.9; font-family: var(--font-serif); }
.news-article > div p { margin-bottom: 1.2em; }

/* ───── 编辑器(作者章节) ───── */
.editor-shell { min-height: 72vh; padding: 24px; max-width: 1000px; margin: 0 auto; }
.editor-form { display: grid; min-height: calc(100vh - 220px); grid-template-rows: auto 1fr; gap: 12px; }
.editor-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; align-items: center; gap: 14px; }
.editor-toolbar > input { height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; outline: none; }
.editor-toolbar > input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-toolbar label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.editor-form > textarea { width: 100%; min-height: 520px; resize: vertical; border: 1px solid var(--border); border-radius: 12px; padding: 22px; background: var(--bg-container); font: 17px/1.9 var(--font-serif); outline: none; }
.editor-form > textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.command-result { margin-top: 20px; color: var(--accent-strong); font: 700 26px/1.3 ui-monospace, monospace; }

/* ───── 排行页 ───── */
.ranking-page { padding: 34px 0 64px; min-height: 66vh; }
.ranking-list { display: flex; flex-direction: column; }
.ranking-list > a { display: grid; grid-template-columns: 44px 56px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 10px; border-bottom: 1px dashed var(--border); border-radius: 8px; }
.ranking-list > a:hover { background: var(--bg-container); }
.ranking-list .rank-num { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bg-container-secondary); color: var(--text-tertiary); }
.ranking-list > a:nth-child(-n+3) .rank-num { background: rgba(250,89,95,.12); color: var(--event); }
.ranking-list .book-cover { width: 56px; }
.ranking-list small { display: block; color: var(--text-tertiary); font-size: 12px; }
.ranking-list b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ───── 通用 ───── */
.empty-state { grid-column: 1 / -1; padding: 48px 20px; text-align: center; color: var(--text-tertiary); background: var(--bg-container); border-radius: var(--radius-lg); }
.breadcrumbs { display: flex; gap: 8px; margin-bottom: 20px; color: var(--text-tertiary); font-size: 13px; }
.breadcrumbs a:hover { color: var(--accent-strong); }
.toast { position: fixed; z-index: 90; right: 20px; bottom: 20px; max-width: min(380px, calc(100% - 40px)); padding: 12px 18px; border-radius: 10px; background: #1e2126; color: #fff; font-size: 13px; box-shadow: var(--shadow-pop); }
.standalone-section { padding: 34px 0 64px; min-height: 60vh; }

/* ───── 响应式 ───── */
@media (max-width: 820px) {
  .wrap { padding: 0 16px; }
  .main-nav, .header-search { display: none; }
  .site-header .wrap { height: 54px; justify-content: space-between; }
  .menu-toggle { display: grid; }
  body { padding-bottom: 62px; }
  .mobile-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-tertiary); padding: 4px 0; text-decoration: none; }
  .mobile-tabbar a.active { color: var(--accent-strong); }
  .mobile-tabbar svg { width: 22px; height: 22px; }

  .hero-banner { aspect-ratio: 4 / 2.1; }
  .hero-copy { max-width: 78%; }
  .channel-row { gap: 8px; margin-top: 14px; }
  .channel-row a { font-size: 12px; padding: 10px 0; border-radius: 8px; }
  .book-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .book-card .desc { display: none; }
  .editor-grid { grid-template-columns: 1fr; gap: 14px; }
  .editor-card { padding: 14px; }
  .editor-card .book-cover { width: 84px; }
  .rank-cols { grid-template-columns: 1fr; gap: 14px; }
  .section { margin-top: 34px; }
  .section-head h2 { font-size: 18px; }

  .lib-search input { height: 42px; padding-right: 96px; }
  .lib-search button { padding: 0 16px; }
  .filter-panel { padding: 12px 14px; }
  .filter-row .label { width: 100%; padding-bottom: 2px; }
  .result-item { padding: 12px; gap: 12px; }
  .result-item .book-cover { width: 74px; }
  .result-item h3 { font-size: 15px; }
  .result-item .go { display: none; }
  .sort-group { margin-left: 0; }
  .result-bar { flex-wrap: wrap; }

  .detail-hero { padding: 16px; gap: 16px; margin-bottom: 14px; }
  .detail-hero .book-cover { width: 108px; }
  .detail-info h1 { font-size: 20px; }
  .score-row { gap: 14px; padding: 10px 12px; flex-wrap: wrap; }
  .score-row .score b { font-size: 22px; }
  .score-row .divider { display: none; }
  .detail-actions { position: fixed; left: 0; right: 0; bottom: 62px; z-index: 55; margin: 0; padding: 10px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .detail-actions .btn { flex: 1; justify-content: center; padding: 11px 0; }
  .detail-body { grid-template-columns: 1fr; }
  .chapter-list { columns: 1; }
  body.detail-page { padding-bottom: 130px; }

  .metric-row { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ranking-list > a { grid-template-columns: 36px 48px minmax(0, 1fr); gap: 10px; }
  .ranking-list b { grid-column: 3; }
}

@media (max-width: 900px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-side { padding: 22px 20px 24px; gap: 16px; border-right: 0; border-bottom: 1px solid rgba(187, 153, 109, 0.22); }
  .auth-side::after { inset: 8px; }
  .auth-side .side-logo { font-size: 17px; }
  .auth-side .side-logo .logo-mark { width: 30px; height: 30px; font-size: 15px; }
  .auth-side .shelf-label { display: none; }
  .auth-side .covers { gap: 10px; }
  .auth-side .covers .cover-slot { width: 56px; border-radius: 3px; font-size: 16px; }
  .auth-side .shelf-line { display: none; }
  .auth-side .brand-shelf { display: flex; align-items: center; gap: 16px; }
  .auth-side blockquote { font-size: 14px; line-height: 1.7; }
  .auth-side cite { margin-top: 6px; font-size: 12px; }
  .auth-box { padding: 32px 20px 40px; align-items: flex-start; }
  .auth-page { padding-bottom: 0 !important; }
}

@media (max-width: 600px) {
  .reader-stage { padding: 72px 12px 30px; }
  .reader-paper { border-radius: 10px; }
  .reader-top .crumb span { display: none; }
  .setting-pop { right: 8px; left: 8px; width: auto; }
  body.reader-page { --rd-size: 17px; }
  .editor-toolbar { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .book-grid .book-card:nth-child(n+7) { display: none; }
  .channel-row { grid-template-columns: repeat(5, 1fr); }
  .channel-row a { font-size: 11px; }
}
