/* HN 书单 · 设计语言「书房」
   暖纸底色 + 墨色正文 + 朱砂强调色；衬线标题（Noto Serif SC 全量切片），封面像实体书一样带书脊与投影。
   强调色只用于：主按钮、当前导航、指数徽标、链接悬停。其余保持克制。
   类名沿用 app.js 渲染的结构，颜色与字体只通过下面的 token 改。 */

:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-2: #efe9df;
  --surface-3: #e7e0d3;
  --text: #1f1b16;
  --text-2: #4d463d;
  --muted: #776e62;
  --faint: #ada395;
  --border: #e2dacb;
  --rule: #1f1b16;
  --divider: #e7e0d4;
  --accent: #c2410c;
  --accent-hover: #a33508;
  --accent-ink: #ffffff;
  --accent-soft: #f8e4d8;
  --focus: #c2410c;
  --mark: #f8e4d8;
  --st-r: #3b7a57; --st-n: #d3cabb; --st-c: #a5562f;
  --tr-1: #1f1b16; --tr-2: #c2410c; --tr-3: #3b7a57; --tr-4: #5b5fa8; --tr-5: #a0466a;
  --shadow-sm: 0 1px 2px rgba(48, 36, 20, .08);
  --shadow-book: 0 1px 1px rgba(48, 36, 20, .10), 0 4px 10px -2px rgba(48, 36, 20, .16), 0 14px 28px -12px rgba(48, 36, 20, .28);
  --shadow-book-hover: 0 2px 3px rgba(48, 36, 20, .12), 0 10px 20px -4px rgba(48, 36, 20, .22), 0 22px 40px -14px rgba(48, 36, 20, .34);
  --shadow-pop: 0 10px 40px -10px rgba(30, 20, 10, .35);
  --radius: 10px;
  --radius-sm: 6px;
  --topbar-h: 62px;
  --tabbar-h: 0px;
  --side-w: 236px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --serif: "Book Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --latin: "Newsreader", "Book Serif", "Noto Serif SC", "Songti SC", Georgia, serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15130f; --surface: #1c1915; --surface-2: #24201b; --surface-3: #2d2822;
    --text: #ede6da; --text-2: #c6bdae; --muted: #968c7e; --faint: #5f574b;
    --border: #322c25; --rule: #ede6da; --divider: #2b2620;
    --accent: #f08552; --accent-hover: #f59a6d; --accent-ink: #1a1009; --accent-soft: #3a2418; --focus: #f08552; --mark: #3a2418;
    --st-r: #6fbf8f; --st-n: #4a433a; --st-c: #d98a62;
    --tr-1: #ede6da; --tr-2: #f08552; --tr-3: #6fbf8f; --tr-4: #9fa3e6; --tr-5: #e08aae;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-book: 0 1px 1px rgba(0, 0, 0, .35), 0 6px 14px -4px rgba(0, 0, 0, .55);
    --shadow-book-hover: 0 2px 3px rgba(0, 0, 0, .45), 0 14px 28px -8px rgba(0, 0, 0, .7);
    --shadow-pop: 0 10px 40px -10px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15130f; --surface: #1c1915; --surface-2: #24201b; --surface-3: #2d2822;
  --text: #ede6da; --text-2: #c6bdae; --muted: #968c7e; --faint: #5f574b;
  --border: #322c25; --rule: #ede6da; --divider: #2b2620;
  --accent: #f08552; --accent-hover: #f59a6d; --accent-ink: #1a1009; --accent-soft: #3a2418; --focus: #f08552; --mark: #3a2418;
  --st-r: #6fbf8f; --st-n: #4a433a; --st-c: #d98a62;
  --tr-1: #ede6da; --tr-2: #f08552; --tr-3: #6fbf8f; --tr-4: #9fa3e6; --tr-5: #e08aae;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-book: 0 1px 1px rgba(0, 0, 0, .35), 0 6px 14px -4px rgba(0, 0, 0, .55);
  --shadow-book-hover: 0 2px 3px rgba(0, 0, 0, .45), 0 14px 28px -8px rgba(0, 0, 0, .7);
  --shadow-pop: 0 10px 40px -10px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.7 var(--sans); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 8px; left: 8px; background: var(--text); color: var(--bg); padding: 6px 12px; }
.noscript { padding: 24px 16px; }
kbd { font: 13px var(--latin); color: var(--muted); border: 1px solid var(--border); padding: 0 7px; line-height: 20px; }

/* ---- 顶栏：刊头 ---- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 6px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.icon-btn { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; transition: color 160ms var(--ease), background 160ms var(--ease); }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg, .search-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.logo { display: flex; align-items: center; gap: 9px; flex: none; margin: 0 18px 0 6px; }
.logo-seal { width: 30px; height: 30px; display: block; border-radius: 7px; box-shadow: var(--shadow-sm); }
.logo:hover { text-decoration: none; }
.logo-text { font: 700 21px/1 var(--serif); letter-spacing: 0.04em; white-space: nowrap; }
/* 搜索框平时无下划线，聚焦时出现黑色下划线（用透明 border 占位避免 1px 跳动） */
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; display: flex; align-items: center; min-width: 0; height: 40px; padding: 0 10px 0 38px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.search-ico { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search-kbd { flex: none; margin-left: 6px; border-radius: 5px; background: var(--surface-2); border-color: var(--border); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search input { flex: 1; min-width: 0; height: 38px; padding: 0 2px; font: inherit; font-size: 15px; color: var(--text); background: transparent; border: 0; border-radius: 0; outline: none; }
.search input:focus + .search-kbd { display: none; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search-btn { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.search-btn:hover { color: var(--text); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---- 布局与侧栏：栏目目录 ---- */
.layout { display: flex; align-items: flex-start; min-height: calc(100vh - var(--topbar-h) - 120px); }
.sidebar { position: sticky; top: var(--topbar-h); flex: none; width: var(--side-w); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 18px 12px 28px 14px; border-right: 1px solid var(--border); scrollbar-width: thin; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--text-2); font-size: 15px; font-weight: 500; transition: color 160ms var(--ease), background 160ms var(--ease); }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a:focus-visible { outline: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav a.active svg { stroke: var(--accent) !important; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: 600 11.5px/18px var(--sans); text-align: center; }
.nav a svg, .nav-more svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: stroke 160ms var(--ease); }
.nav a:hover svg, .nav a.active svg, .nav-more:hover svg { stroke: var(--text); }
.nav-more { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--text-2); font: 500 15px var(--sans); cursor: pointer; text-align: left; transition: color 160ms var(--ease); }
.nav-more:hover { color: var(--text); }
.nav-more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.nav-more .chev { width: 14px; height: 14px; margin-left: auto; transition: transform 200ms var(--ease); }
.nav-more[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-extra { margin-top: 2px; }
.nav.topics a { justify-content: space-between; font-size: 14px; font-weight: 400; padding: 4px 10px; }
.nav.topics a.active { font-weight: 700; }
.nav.topics .count { color: var(--muted); font: 13px var(--latin); }
/* 分割线在「关于本站」与「话题分类」正中间：上方间距 = 导航项 padding 6 + margin 26 = 32 */
.nav-h { margin: 22px 10px 8px; padding-top: 22px; border-top: 1px solid var(--divider); font: 600 12px/1 var(--sans); letter-spacing: 0.12em; color: var(--muted); }
.main, main { flex: 1; min-width: 0; padding: 30px clamp(20px, 3.4vw, 48px) 64px; }
body.side-collapsed .sidebar { display: none; }

.scrim { display: none; }
@media (max-width: 899px) {
  .topbar { padding: 0 10px; }
  .sidebar { position: fixed; z-index: 40; top: var(--topbar-h); bottom: 0; left: 0; max-height: none; background: var(--bg); transform: translateX(-102%); transition: transform .22s var(--ease); border-right: 1px solid var(--border); box-shadow: var(--shadow-pop); padding-bottom: calc(28px + var(--tabbar-h)); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 35; background: rgba(0, 0, 0, .45); }
  .main, main { padding: 22px 16px 44px; }
  .logo { margin: 0 6px 0 0; }
  .logo-text { font-size: 19px; }
  .hide-sm { display: none; }
  .search { max-width: none; }
}

/* ---- 页头 / 筛选：文字切换，不用胶囊 ---- */
.page-h { margin-bottom: 6px; padding-top: 10px; }
.page-h h1 { font: 700 clamp(28px, 3.2vw, 40px)/1.25 var(--serif); letter-spacing: 0.01em; }
.sub { color: var(--text-2); margin: 10px 0 0; max-width: 46em; font-size: 15.5px; }
.sub a { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 0.22em; }
.sub a:hover { color: var(--accent); }
.sub a:hover { text-decoration-color: currentColor; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 6px; margin: 14px 0 4px; }
.chips .lbl { color: var(--muted); font-size: 13px; margin-right: 6px; min-width: 4.5em; }
.chip { display: inline-block; padding: 3px 11px; border: 1px solid transparent; border-radius: 999px; background: none; font-size: 13.5px; color: var(--text-2); transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease); }
.chip:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.chip.on { color: var(--accent-ink); background: var(--text); font-weight: 600; }
.chip.topic { color: var(--text-2); border: 1px solid var(--border); background: var(--surface); padding: 2px 10px; font-size: 13px; }
.chip.topic:hover { color: var(--accent); border-color: var(--accent); }
.empty { padding: 40px 0; color: var(--muted); text-align: center; }
.empty h2 { font: 700 22px var(--serif); color: var(--text); margin-bottom: 8px; }
.skel { padding: 56px 0; color: var(--muted); text-align: center; }

/* ---- 书籍网格：封面墙 ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 34px 24px; margin-top: 22px; }
/* 相关书籍：自适应换行网格，数据给的 7-8 本全部展示（原来是 150px 横向滚动条，卡片被裁切） */
.row { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 30px 24px; padding: 6px 0 12px; }
.card { display: flex; flex-direction: column; min-width: 0; }
/* 书单收藏角标（触屏常显，桌面悬停出现） */
.card { position: relative; }
.wl { position: absolute; z-index: 2; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-sm); color: var(--text-2); cursor: pointer; opacity: 0; transform: translateY(-2px); transition: opacity 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease); }
.card:hover .wl, .wl.on, .wl.read, .wl:focus-visible { opacity: 1; transform: none; }
.wl:hover { color: var(--text); }
.wl.on { color: var(--accent-ink); background: var(--accent); }
.wl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.wl.on svg { fill: currentColor; }
@media (hover: none) { .wl { opacity: 1; } }
/* 分享图弹窗 */
dialog.share-box { padding: 18px 20px 20px; max-width: min(94vw, 460px); width: 460px; max-height: 94vh; overflow: auto; }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.share-head h2 { margin: 0; font-size: 20px; }
.seg-group { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg-group .chip { cursor: pointer; font-family: var(--sans); }
.share-stage { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-book); }
.share-stage img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; -webkit-touch-callout: default; }
.share-stage .skel { position: absolute; inset: 0; padding: 0; }
.share-tip { margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-actions .btn { flex: 1; }
.btn.ghost { border-color: transparent; background: transparent; }
.card:hover { text-decoration: none; }
.card h3 { font: 500 16px/1.38 var(--latin); margin: 13px 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: text-decoration-color 160ms var(--ease); }
.card:hover h3 { color: var(--accent); text-decoration-color: transparent; }
.card .t-en { margin: 0; color: var(--muted); font: 13px/1.35 var(--latin); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .au { margin: 1px 0 0; color: var(--muted); font: 13.5px var(--latin); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .rec { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.card .rec b { color: var(--text); font: 500 14px var(--latin); }
.cover { position: relative; aspect-ratio: 2 / 3; width: 100%; overflow: hidden; border-radius: 2px 4px 4px 2px; background: var(--surface-2); box-shadow: var(--shadow-book); transition: transform 240ms var(--ease), box-shadow 240ms var(--ease); }
/* 书脊：左缘一道高光 + 暗线，让封面像一本实体书 */
.cover::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(90deg, rgba(0,0,0,.18) 0, rgba(255,255,255,.22) 1.2%, rgba(255,255,255,0) 3.2%, rgba(0,0,0,.06) 4.2%, rgba(0,0,0,0) 7%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
a.card:hover .cover, a.wcard:hover .cover { transform: translateY(-4px); box-shadow: var(--shadow-book-hover); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; z-index: 1; left: 8px; bottom: 8px; border-radius: 4px; background: rgba(20, 16, 12, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: #f4eee4; font: 500 11.5px/1 var(--latin); padding: 4px 6px; letter-spacing: .02em; }
/* 排版占位封面：黑白书脊 */
.cover.ph { display: flex; flex-direction: column; justify-content: center; padding: 12% 11% 12% 14%; background: linear-gradient(160deg, hsl(var(--h, 30) 32% 30%), hsl(calc(var(--h, 30) + 24) 36% 20%)); color: #f6efe3; }
.cover.ph .ph-a { color: rgba(246, 239, 227, .72); }
.ph-t { font: 500 clamp(12px, 3.4cqw, 16px)/1.3 var(--latin); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; container-type: inline-size; }
.ph-rule { width: 34%; height: 1px; background: currentColor; margin: 10px 0; }
.ph-a { font: clamp(10px, 2.8cqw, 13px) var(--latin); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sentinel { padding: 24px 0 8px; color: var(--muted); font-size: 13.5px; text-align: center; }
.sentinel.end { padding-bottom: 0; }

/* 立场计数行（多档宽度自适应） */
/* 计数行：按卡片自身宽度二选一（窄卡用短版），不再按视口宽度判断——原来 ≤399px 时长短两版会同时显示 */
.rec .rl, .rec .rm, .rec .rs, .rec .rx { display: none; }
.rec-st .rs { display: inline; }
@container card (min-width: 160px) { .rec-st .rl { display: inline; } .rec-st .rs { display: none; } }
.card { container-type: inline-size; container-name: card; }


/* ---- 书籍详情页 ---- */
.book { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; max-width: 920px; padding-top: 18px; }
/* 封面+信息两栏之后，各区块（历年图表/评论区/相关书籍）通栏铺开 */
.book > .sec, .book > #related { grid-column: 1 / -1; }
.book > div:first-child { align-self: start; }
.book h1 { font: 500 clamp(30px, 3.6vw, 44px)/1.18 var(--latin); letter-spacing: -0.005em; }
.book .st { color: var(--muted); font: 20px/1.4 var(--latin); margin: 8px 0 0; }
.book .t-en { color: var(--muted); font: 15px/1.5 var(--latin); margin: 6px 0 0; max-width: 40em; overflow-wrap: anywhere; }
.book .by { margin: 10px 0 0; color: var(--text-2); font: 17px var(--latin); }
.book .by span { color: var(--muted); font-family: var(--sans); font-size: 14px; }
.book .by a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 0.22em; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 22px 0 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.stat b { display: block; font: 400 32px/1.1 var(--latin); }
.stat span { color: var(--muted); font-size: 13px; }
.stance { margin: 18px 0 0; max-width: 440px; }
.sbar { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.sbar i { display: block; }
.s-r { background: var(--st-r); } .s-n { background: var(--st-n); } .s-c { background: var(--st-c); }
.slg { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.slg .dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; }
.desc { margin: 18px 0 0; color: var(--text); max-width: 40em; font-size: 16px; line-height: 1.85; }
/* 双语：英文原文收纳（简介折叠 / 评论弱化展示） */
details.orig { margin: 8px 0 0; max-width: 40em; }
details.orig summary { cursor: pointer; color: var(--muted); font-size: 13.5px; list-style: none; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 0.25em; transition: color 160ms var(--ease); }
details.orig summary::-webkit-details-marker { display: none; }
details.orig summary::before { content: "▸ "; font-size: 11px; }
details.orig[open] summary::before { content: "▾ "; }
details.orig summary:hover { color: var(--text); }
details.orig[open] summary { margin-bottom: 2px; }
details.orig .desc { margin: 6px 0 0; font-size: 15px; color: var(--text-2); }
.comment .c-zh { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.75; color: var(--text); }
.comment .c-en { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14.5px/1.6 var(--latin); color: var(--muted); }
.buy-row { display: flex; align-items: center; gap: 10px 12px; margin: 24px 0 2px; flex-wrap: wrap; }
.buy-lbl { color: var(--muted); font-size: 13.5px; }
.nd-rate { margin: 24px 0 -14px; font-size: 13.5px; color: var(--muted); }
.nd-rate b { font: 400 20px/1 var(--latin); color: var(--text); margin: 0 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 14px var(--sans); cursor: pointer; transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease); }
.btn:hover { background: var(--surface-2); border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.aff-note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 0; }
.links a, .links .btn { font-weight: 500; }
.sec { margin-top: 48px; max-width: 920px; }
.sec h2 { font: 700 23px var(--serif); letter-spacing: 0.01em; padding-top: 18px; border-top: 1px solid var(--border); margin-bottom: 14px; }
.chart { width: 100%; max-width: 680px; height: auto; }
.chart text, .tr-bump text, .tr-cmpchart text { font: 12px var(--latin); fill: var(--muted); }
.chart rect.bar { fill: var(--accent); }
.chart line { stroke: var(--border); }
.chart line[stroke-dasharray] { stroke: var(--muted); }
.comments { list-style: none; margin: 0; padding: 0; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--divider); }
.comment-h { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.comment-h a { color: var(--text-2); font: 14px var(--latin); }
.comment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 16.5px/1.65 var(--latin); color: var(--text); }
.comment mark { background: var(--mark); color: inherit; font-weight: 600; padding: 0 2px; border-radius: 3px; }
.thread { font-size: 13px; color: var(--muted); }
.tag { display: inline-block; padding: 0 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.tag-recommends { color: var(--st-r); }
.tag-mentions { color: var(--muted); }
.tag-critical { color: var(--st-c); }
/* 手机：小封面左浮，书名、作者在右侧，首屏就能看到书名和统计 */
@media (max-width: 640px) {
  .book { display: block; padding-top: 8px; }
  .book > div:first-child { float: left; width: 104px; margin: 4px 16px 10px 0; }
  .book h1 { font-size: 24px; line-height: 1.25; }
  .book .st { font-size: 16px; margin-top: 4px; }
  .book .t-en { font-size: 13.5px; }
  .book .by { font-size: 15px; }
  .book .stats, .book > .sec, .book > #related { clear: both; }
  .book .stats { gap: 10px 24px; margin-top: 16px; }
  .book .stat b { font-size: 26px; }
}

/* ---- 趋势页 ---- */
.tr-sec { margin-top: 48px; max-width: 1100px; }
.tr-sec h2 { font: 700 23px var(--serif); letter-spacing: 0.01em; padding-top: 18px; border-top: 1px solid var(--border); margin-bottom: 8px; }
.tr-gh { font: 600 15px var(--sans); margin: 24px 0 2px; }
.tr-gh span { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.tr-box { position: relative; border: 1px solid var(--border); background: var(--bg); margin-top: 14px; }
.tr-scroll { overflow-x: auto; padding: 8px; }
.tr-tip { position: absolute; top: 0; left: 0; z-index: 5; pointer-events: auto; background: var(--bg); border: 1px solid var(--rule); padding: 8px 12px; font-size: 13px; max-width: 300px; }
.tr-tip b { font-family: var(--latin); font-weight: 500; }
.tr-tip a { color: var(--text); text-decoration: underline; white-space: nowrap; }
.tr-tip .pin::after { content: ""; }
.tr-bump .bk { cursor: pointer; }
.tr-bump .bk-l { fill: none; stroke: var(--border); stroke-width: 2; }
.tr-bump .bk-d { fill: var(--bg); stroke: var(--muted); stroke-width: 1.4; }
.tr-bump.has-hl .bk:not(.on) { opacity: .9; }
.tr-bump .hl-l { fill: none; stroke: var(--text); stroke-width: 2.5; }
.tr-bump .hl-d { fill: var(--text); stroke: var(--text); }
.tr-bump .cur { fill: none; stroke: var(--text); stroke-width: 1.6; }
.tr-bump .tl { font: 12px var(--latin); fill: var(--text); }
.tr-bump .tl.top { font-weight: 600; fill: var(--text); }
.tr-bump .hl-t { font-weight: 600; }
.tr-bump .ax { fill: var(--muted); }
.spark { width: 100%; height: auto; display: block; }
.spark .ln { fill: none; stroke: var(--text); stroke-width: 1.6; }
.spark .ar { fill: var(--surface-2); stroke: none; }
.spark .pk { fill: var(--text); stroke: var(--bg); stroke-width: 1.5; }
.spark line { stroke: var(--border); }
.spark-x { display: flex; justify-content: space-between; color: var(--muted); font: 12px var(--latin); }
.tr-card .rec { color: var(--text); }
.tr-search { position: relative; max-width: 460px; margin: 14px 0; }
.tr-search input { width: 100%; height: 40px; padding: 0 2px; font: inherit; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; outline: none; }
.tr-search input:disabled { opacity: .55; }
#tr-list { position: absolute; z-index: 10; left: 0; right: 0; top: 44px; margin: 0; padding: 4px 0; list-style: none; background: var(--bg); border: 1px solid var(--rule); max-height: 320px; overflow-y: auto; }
#tr-list li { padding: 8px 12px; cursor: pointer; }
#tr-list li.on, #tr-list li:hover { background: var(--surface-2); }
#tr-list li span { color: var(--muted); font-size: 12.5px; }
#tr-list li.none { color: var(--muted); cursor: default; }
.tr-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 12px 0; padding: 0; }
.tr-legend li { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.tr-legend .sw { width: 14px; height: 3px; background: var(--c, var(--text)); }
.tr-legend .x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 2px; }
.tr-legend .x:hover { color: var(--text); }
.tr-cmpchart .cl { fill: none; stroke-width: 2; }
.tr-cmpchart line { stroke: var(--border); }
.tr-cmpchart .vl { stroke: var(--muted); stroke-dasharray: 3 3; }
.tr-cmpchart .ax { fill: var(--muted); }
.tr-cmpchart .tl { font: 12px var(--latin); fill: var(--text); }
.tr-empty { padding: 40px 16px; }
.r { display: flex; align-items: center; gap: 6px; }
.r .sw { width: 12px; height: 3px; background: var(--c); }

/* ---- 关于页 / 长文 ---- */
.prose { max-width: 40em; }
.prose h1 { font: 700 clamp(28px, 3.2vw, 40px)/1.25 var(--serif); letter-spacing: 0.01em; padding-top: 6px; margin-bottom: 16px; }
.prose h2 { font: 700 22px var(--serif); margin: 32px 0 10px; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; line-height: 1.85; }
.prose a { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 0.22em; }
.prose a:hover { color: var(--accent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }

/* ---- 页脚 ---- */
.footer { border-top: 1px solid var(--border); background: var(--surface-2); padding: 30px clamp(20px, 3.4vw, 48px) 48px; color: var(--muted); font-size: 13.5px; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 18px 56px; max-width: 1100px; }
.foot-about { flex: 1 1 380px; max-width: 46em; }
.foot-about p { margin: 0 0 6px; }
.foot-about a, .foot-links a { color: var(--text-2); font-weight: 500; }
.foot-about a:hover, .foot-links a:hover { color: var(--text); }
.foot-brand { display: flex; align-items: center; gap: 8px; font: 700 18px var(--serif); color: var(--text); letter-spacing: 0.04em; }
.foot-brand img { border-radius: 5px; }
.foot-brand span { color: var(--muted); font: 400 13px var(--latin); margin-left: 8px; letter-spacing: 0; }
.foot-links { display: flex; flex-direction: column; gap: 6px; }
#footer-meta { margin: 16px 0 0; font: 13px var(--latin); }
@media (max-width: 899px) { .footer { padding: 22px 16px 44px; } }

/* ---- 弹窗：直角、墨线 ---- */
dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); padding: 26px 30px 22px; max-width: min(92vw, 400px); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(20, 14, 8, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog h2 { font: 700 22px var(--serif); letter-spacing: 0.02em; margin: 0 0 8px; }
dialog img { display: block; margin: 14px auto; background: #fff; }
.qr-note { color: var(--text-2); font-size: 14px; margin: 0; }
.qr-links { text-align: center; font-size: 14px; }
.qr-links a { color: var(--text); font-weight: 500; }
.keys { margin: 10px 0 16px; }
.keys div { display: flex; align-items: baseline; gap: 12px; margin: 8px 0; }
.keys dt { flex: none; min-width: 72px; }
.keys dd { margin: 0; color: var(--text-2); font-size: 14px; }

@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } .nav a, .nav-more { padding: 9px 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print { .topbar, .sidebar, .footer { display: none; } }

/* Secondary actions read as text links (DESIGN.md: one solid ink button per view) */
.buy-row .btn, .links .btn:not(.primary) { border: 0; padding: 4px 0; background: none; font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.25em; transition: text-decoration-color 160ms var(--ease); }
.buy-row .btn:hover, .links .btn:not(.primary):hover { background: none; text-decoration-color: currentColor; }
.buy-row .btn[target="_blank"]::after, .links .btn[target="_blank"]:not(.primary)::after { content: " ↗"; }
.buy-row { gap: 6px 22px; }

/* ---- 我的书架 ---- */
.shelf-row { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.shelf-lbl { color: var(--muted); font-size: 13.5px; }
.seg { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: 600 14px var(--sans); cursor: pointer; transition: all 160ms var(--ease); }
.seg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.seg:hover { color: var(--text); }
.seg.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg.on svg { fill: currentColor; }
.stars { display: inline-flex; gap: 2px; margin-left: 4px; }
.star { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--border); cursor: pointer; transition: color 120ms var(--ease); }
.star svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.stars.on .star { color: var(--muted); }
.stars.on .star:hover, .stars.on .star.on { color: var(--text); }
.stars.on .star.on svg { fill: currentColor; }
.stars:not(.on) .star { opacity: 0.45; cursor: default; }
.wl.read { color: var(--text); border-color: var(--text); }
.shelf-tabs { margin: 14px 0 4px; }
/* 回到顶部 */
.totop { position: fixed; z-index: 40; right: 22px; bottom: calc(26px + var(--tabbar-h)); width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-sm); background: var(--surface); color: var(--text); cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px); transition: all 200ms var(--ease); }
.totop.show { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { background: var(--surface-2); }
.totop svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- 历年年度书 ---- */
.years .yr { margin: 0 0 44px; }
.years .yr h2 { font: 700 30px var(--serif); padding-top: 14px; border-top: 1px solid var(--divider); margin: 0 0 14px; }
.years .yr:first-of-type h2 { border-top: 0; padding-top: 0; }
/* ---- 被低估的书散点 ---- */
.gem-wrap { max-width: 680px; }
.gem-wrap svg { width: 100%; height: auto; }
.gem-wrap svg circle { cursor: pointer; }
.gem-list { margin: 18px 0 0; }

/* 散点图 tooltip */
.gem-wrap { position: relative; }
.gem-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--text); color: var(--bg); padding: 7px 10px; font-size: 12.5px; line-height: 1.5; max-width: 200px; }
.gem-tip b { display: block; font-weight: 600; }
.gem-tip span { opacity: 0.75; font-size: 11.5px; }
.gemdot:hover { stroke: var(--text); stroke-width: 1.5; }
/* 浪潮紧凑网格 */
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 18px 16px; margin-top: 12px; }
.wcard { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: inherit; min-width: 0; }
.wcard:hover { text-decoration: none; }
.wcard img, .wcard .cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--surface-2); }
.wcard .wt { font: 500 13px/1.35 var(--serif); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wcard:hover .wt { text-decoration: underline; text-underline-offset: 0.2em; }
.wcard .wm { color: var(--muted); font-size: 11.5px; }

/* ---- 值得读：指数、一句话、分项条 ---- */
.card .qv { display: inline-block; min-width: 24px; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: 600 12px/18px var(--latin); text-align: center; }
.card .why1 { margin: 5px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qbox { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 18px 0 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 560px; }
.qn b { display: block; font: 500 42px/1 var(--latin); color: var(--accent); }
.qn span { color: var(--muted); font-size: 13px; }
.qbars { list-style: none; margin: 0; padding: 0; flex: 1 1 240px; display: grid; gap: 5px; }
.qbars li { display: grid; grid-template-columns: 4em 1fr 2em; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.qbars i { display: block; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.qbars em { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.qbars b { font: 500 13px var(--latin); text-align: right; color: var(--text); }
.qhow { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: .2em; }
.whybox { margin: 22px 0 0; max-width: 600px; padding: 18px 20px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); }
.whybox h2 { font: 700 19px var(--serif); margin: 0 0 6px; }
.why-lead { font: 500 17px/1.6 var(--serif); margin: 0 0 6px; }
.why-list { margin: 0 0 6px; padding-left: 1.2em; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.why-meta { margin: 2px 0; font-size: 14.5px; color: var(--text-2); }
.why-meta b { display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 4px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface-3); }
.why-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.st-chart rect.s-r { fill: var(--st-r); } .st-chart rect.s-n { fill: var(--st-n); } .st-chart rect.s-c { fill: var(--st-c); }
.sec.wide { max-width: none; }

/* ---- 话题页：阅读路径 ---- */
.paths { margin: 22px 0 8px; }
.paths h2 { font: 700 22px var(--serif); padding-top: 16px; border-top: 1px solid var(--border); margin: 0; }
.path-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 32px; margin-top: 14px; }
.path-col h3 { font: 600 14px var(--sans); color: var(--muted); letter-spacing: .08em; margin: 0 0 6px; }
.path-col ol { list-style: none; margin: 0; padding: 0; }
.path-col li a { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--divider); color: var(--text); }
.path-col li a:hover { text-decoration: none; background: var(--surface-2); }
.path-c .cover { width: 44px; }
.path-c .ph-t { font-size: 8px; -webkit-line-clamp: 3; } .path-c .ph-a, .path-c .ph-rule { display: none; }
.path-t b { display: block; font: 500 15.5px/1.35 var(--latin); }
.path-t span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--text-2); }

/* ---- /explore ---- */
.ex-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; margin: 20px 0 8px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 1000px; }
.ex-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.ex-f select, .ex-f input { font: 14px var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--border); padding: 7px 8px; border-radius: var(--radius-sm); min-width: 0; }
.ex-cs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 14px; color: var(--text-2); }
.ex-c input { accent-color: var(--text); }
.ex-n { margin: 14px 0 4px; font-size: 14px; color: var(--muted); }

/* ---- /map ---- */
.map-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.map-bar input { flex: 1 1 220px; font: 14px var(--sans); padding: 8px 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 0; }
.map-bar .btn { padding: 7px 14px; }
.map-box { position: relative; max-width: 1000px; border: 1px solid var(--border); background: var(--bg); touch-action: none; }
#map-svg { display: block; width: 100%; height: auto; aspect-ratio: 1; cursor: grab; user-select: none; }
#map-svg:active { cursor: grabbing; }
.m-edges line { stroke: var(--border); stroke-width: .8; vector-effect: non-scaling-stroke; }
.m-nodes circle { r: calc(var(--r) * var(--s, 1) * 1px); fill: var(--text); opacity: .72; cursor: pointer; transition: opacity 120ms var(--ease); }
.m-labels text { font: 600 var(--lf, 22px) var(--sans); fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: calc(var(--lf, 22px) / 4); pointer-events: none; letter-spacing: .06em; }
#map-svg.focus circle { opacity: .14; } #map-svg.focus line { opacity: .25; }
#map-svg.focus circle.on { opacity: 1; } #map-svg.focus line.on { opacity: 1; stroke: var(--text); stroke-width: 1.4; }

/* ---- 趋势：话题冷热 ---- */
.heat-scroll { overflow-x: auto; }
.heat table { border-collapse: separate; border-spacing: 2px; font-size: 12.5px; min-width: 640px; }
.heat th { font-weight: 400; color: var(--muted); font-family: var(--latin); padding: 0 2px; }
.heat tbody th { text-align: right; padding-right: 8px; white-space: nowrap; font-family: var(--sans); }
.heat tbody th a { color: var(--text-2); }
.heat td { width: 26px; height: 20px; background: color-mix(in srgb, var(--text) var(--a), var(--surface-2)); }
.heat td.heat-r { background: none; width: auto; padding-left: 8px; white-space: nowrap; font: 500 12.5px var(--latin); color: var(--text); }
@media (max-width: 520px) { .ex-form { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px; } .qbox { padding: 12px; } }

.nav-h2 { margin-top: 18px; padding-top: 20px; }

/* 侧栏 Lucide 图标与「更多」：2026-11-03 */

/* ---- 手机适配 ---- */
.paths-more { display: none; margin: 4px 0 0; } /* 必须写在下面的媒体查询之前，否则会盖掉手机上的 inline-flex */
@media (max-width: 640px) {
  /* 筛选 chips：每组一行、左右滑动，不再把首屏的书挤下去 */
  .chips:not(.shelf-tabs) { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 0 16px; margin-right: -16px; padding-right: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips:not(.shelf-tabs)::-webkit-scrollbar { display: none; }
  .chips .lbl { flex: none; position: sticky; left: 0; z-index: 1; background: var(--bg); padding-right: 10px; margin-right: -6px; }
  .chip { flex: none; }
  .chips.book-topics, .book .chips { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; gap: 8px; }
  /* 图表文字：SVG 等比缩小后 11–12 单位只剩 5–6px，手机上放大到约 11px */
  .chart text, #gem-chart svg text { font-size: 22px; }
  /* 话题路径：默认只展开「入门」 */
  .paths:not(.open) .path-col:not(:first-child) { display: none; }
  .paths-more { display: inline-flex; }
}
/* 触屏：点按目标至少约 40px 高 */
@media (pointer: coarse) {
  .chip { padding: 7px 12px; }
  .chip.topic { padding: 6px 12px; }
  .seg { padding: 11px 18px; }
  .star { width: 40px; height: 40px; }
  .logo { padding: 10px 0; }
  .map-bar .btn { padding: 10px 16px; }
}

/* ======================= HN 书单新增组件 ======================= */
body { background: var(--bg); }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
a:hover { text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--accent); font: 600 12.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.eyebrow a { color: inherit; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.skel { display: flex; align-items: center; justify-content: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 首页 hero ---- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); align-items: center; gap: 24px 40px; margin: -6px 0 18px; padding: clamp(28px, 4vw, 52px) clamp(22px, 3.6vw, 52px); border: 1px solid var(--border); border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%), var(--surface); }
.hero-h { font: 700 clamp(30px, 4.2vw, 52px)/1.16 var(--serif); letter-spacing: .005em; margin: 0; text-wrap: balance; }
.hero-lede { max-width: 34em; margin: 16px 0 0; color: var(--text-2); font-size: clamp(15px, 1.3vw, 17px); line-height: 1.8; }
.hero-search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 560px; margin: 24px 0 0; padding: 6px 6px 6px 44px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); box-shadow: var(--shadow-sm); transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.hero-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.hero-search svg { position: absolute; left: 16px; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hero-search input { flex: 1; min-width: 0; height: 42px; border: 0; background: transparent; color: var(--text); font: 16px var(--sans); outline: none; }
.hero-search input::-webkit-search-cancel-button { display: none; }
.hero-search .btn { min-height: 42px; padding: 8px 22px; }
.hero-try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; }
.hero-try > span { color: var(--muted); font-size: 13px; margin-right: 4px; }
.hero-try .chip { border-color: var(--border); background: var(--bg); font-size: 13px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; list-style: none; margin: 28px 0 0; padding: 18px 0 0; border-top: 1px solid var(--border); }
.hero-stats b { display: block; font: 500 26px/1.1 var(--latin); }
.hero-stats span { color: var(--muted); font-size: 13px; }
/* 右侧：几本书摊开叠放 */
.hero-art { position: relative; height: clamp(260px, 26vw, 340px); margin-right: -8px; }
.hero-book { position: absolute; top: 50%; left: 50%; width: clamp(108px, 9.6vw, 146px); transition: transform 320ms var(--ease); }
.hero-book .cover { box-shadow: var(--shadow-book-hover); }
.hb-0 { transform: translate(-50%, -50%) rotate(-2deg); z-index: 5; }
.hb-1 { transform: translate(-95%, -47%) rotate(-9deg); z-index: 4; }
.hb-2 { transform: translate(-5%, -47%) rotate(8deg); z-index: 4; }
.hb-3 { transform: translate(-132%, -42%) rotate(-16deg) scale(.92); z-index: 3; }
.hb-4 { transform: translate(32%, -42%) rotate(15deg) scale(.92); z-index: 3; }
.hero-art:hover .hb-1 { transform: translate(-102%, -49%) rotate(-11deg); }
.hero-art:hover .hb-2 { transform: translate(2%, -49%) rotate(10deg); }
.hero-book:hover { z-index: 6; }
@media (max-width: 1080px) { .hero { grid-template-columns: 1fr; } .hero-art { display: none; } }
@media (max-width: 640px) {
  .hero { margin: -8px -4px 10px; padding: 26px 18px 22px; border-radius: 18px; }
  .hero-h { font-size: 28px; }
  .hero-search { padding-left: 40px; }
  .hero-search .btn { padding: 8px 16px; }
  .hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 10px; }
  .hero-stats b { font-size: 18px; }
  .hero-stats span { font-size: 12px; }
  .hero-try .chip { padding: 5px 11px; }
  .book .shelf-row .stars { order: 5; }
}

/* ---- 首页书架行：横向滑动 ---- */
.hshelf { margin-top: 44px; }
.hshelf-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.hshelf-h h2 { font: 700 clamp(21px, 2vw, 25px)/1.3 var(--serif); }
.hshelf-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.hshelf-h .more { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; }
.hshelf-h .more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 160ms var(--ease); }
.hshelf-h .more:hover { text-decoration: none; } .hshelf-h .more:hover svg { transform: translateX(3px); }
.hrow { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(138px, calc((100% - 5 * 24px) / 6), 200px); gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 16px 4px 18px; margin: 0 -4px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.hrow > .card { scroll-snap-align: start; }
@media (max-width: 640px) { .hrow { grid-auto-columns: 42%; gap: 16px; margin-right: -16px; padding-right: 16px; } }
.home-wall-sep { height: 1px; margin: 52px 0 26px; background: var(--border); }

/* ---- 话题方块 ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tile-covers { position: relative; flex: none; width: 66px; height: 54px; }
.tile-covers img { position: absolute; top: 0; width: 36px; height: 54px; object-fit: cover; border-radius: 2px 3px 3px 2px; box-shadow: var(--shadow-book); background: var(--surface-2); }
.tile-covers img:nth-child(1) { left: 0; z-index: 3; } .tile-covers img:nth-child(2) { left: 15px; z-index: 2; transform: scale(.94); } .tile-covers img:nth-child(3) { left: 30px; z-index: 1; transform: scale(.88); }
.tile-t { min-width: 0; }
.tile-t b { display: block; font: 600 15.5px/1.35 var(--serif); }
.tile:hover .tile-t b { color: var(--accent); }
.tile-t span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 详情页 ---- */
.book { grid-template-columns: 240px minmax(0, 1fr); gap: 44px; max-width: 1000px; }
.book-cover { position: sticky; top: calc(var(--topbar-h) + 24px); }
.book-cover .cover { border-radius: 3px 6px 6px 3px; }
.book h1 { font: 600 clamp(28px, 3.4vw, 42px)/1.22 var(--serif); letter-spacing: 0; margin-top: 6px; text-wrap: balance; }
.book .book-topics { margin: 0 0 6px; }
.stats { gap: 12px 36px; border-top-color: var(--border); }
.stat.hi b { color: var(--accent); }
.shelf-row { gap: 8px; padding: 16px 0; margin-top: 18px; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.seg.ghost { margin-left: auto; }
.pull { position: relative; margin: 24px 0 0; max-width: 600px; padding: 4px 0 0 34px; }
.pull::before { content: '“'; position: absolute; left: -2px; top: -14px; color: var(--accent); font: 700 64px/1 var(--latin); opacity: .9; }
.pull blockquote { margin: 0; font: 500 17.5px/1.75 var(--serif); color: var(--text); }
.pull figcaption { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.pull figcaption a { color: var(--text-2); }
.desc { color: var(--text-2); }
.cm-filter { margin: 0 0 6px; }
.cm-filter .chip span { opacity: .65; font-size: 12px; margin-left: 2px; }
.cm-filter button.chip { cursor: pointer; font-family: var(--sans); }
@media (max-width: 640px) {
  .book-cover { position: static; }
  .seg.ghost { margin-left: 0; }
  .pull { padding-left: 26px; }
  .pull blockquote { font-size: 16px; }
}
.author-h .eyebrow { margin-bottom: 8px; }

/* ---- 服务端渲染的首屏摘要（JS 接管前） ---- */
.ssr-note { color: var(--muted); font-size: 13.5px; }

/* ---- 手机底栏 ---- */
.tabbar { display: none; }
@media (max-width: 899px) {
  :root { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  body { padding-bottom: var(--tabbar-h); }
  .tabbar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font: 500 11px var(--sans); cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  body.drawer-open .sidebar { bottom: var(--tabbar-h); }
  .sidebar { bottom: var(--tabbar-h); }
  .logo-text { font-size: 18px; }
  .logo { margin-right: 8px; gap: 7px; }
  .logo-seal { width: 26px; height: 26px; }
}
@media (max-width: 420px) { .logo-text { display: none; } }

/* ---- 轻提示 ---- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(28px + var(--tabbar-h)); transform: translate(-50%, 10px); padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity 200ms var(--ease), transform 200ms var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } a.card:hover .cover, .tile:hover { transform: none; } }
@media print { .tabbar, .hero-search, .shelf-row { display: none; } }
.au-hit { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 14px 0 0; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.au-hit:hover { text-decoration: none; border-color: var(--accent); }
.au-hit span { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .1em; }
.au-hit b { font: 600 17px var(--latin); }
.au-hit em { color: var(--muted); font-style: normal; font-size: 13.5px; }
