/* 布局：手机优先单栏。书库=线路网（每个分类一条“线路”），书=一条线，章节=一个“站”。
   封面是线装书：左侧装订线 + 右上题签竖排书名。 */
:root {
  --bg: #F2F4F3;
  --surface: #FFFFFF;
  --surface-2: #E8ECEA;
  --ink: #15201C;
  --ink-2: #47554F;
  --ink-3: #7A8782;
  --line: #D3DAD7;
  --accent: #12675C;
  --accent-ink: #FFFFFF;
  --accent-soft: #DBECE8;
  --seal: #B5352B;
  --gold: #9E7420;
  --warn-soft: #FBF1DC;
  --scrim: rgb(10 20 17 / .48);
  --label: #FBFAF6;
  --label-ink: #1E2421;
  --shadow: 0 1px 2px rgb(16 32 28 / .06), 0 10px 28px rgb(16 32 28 / .08);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", serif;
  --font-read: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", serif;
  --font-ui: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --read-size: 18px;
  --nav-h: 58px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1412; --surface: #151D1A; --surface-2: #1D2724; --ink: #E6ECE9; --ink-2: #B2BEB9; --ink-3: #82908A;
    --line: #2A3531; --accent: #4CB3A3; --accent-ink: #062019; --accent-soft: #19332D; --seal: #E0594C; --gold: #D6A646;
    --warn-soft: #2E2715; --scrim: rgb(0 0 0 / .6); --label: #EDEAE2; --label-ink: #1E2421;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1412; --surface: #151D1A; --surface-2: #1D2724; --ink: #E6ECE9; --ink-2: #B2BEB9; --ink-3: #82908A;
  --line: #2A3531; --accent: #4CB3A3; --accent-ink: #062019; --accent-soft: #19332D; --seal: #E0594C; --gold: #D6A646;
  --warn-soft: #2E2715; --scrim: rgb(0 0 0 / .6); --label: #EDEAE2; --label-ink: #1E2421;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px rgb(0 0 0 / .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 外框 ---------- */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 0 calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}
body.has-player #app { padding-bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom, 0px)); }
body.reading #app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.reading.has-player #app { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
  padding: 8px var(--gutter-r) 8px var(--gutter-l);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }

.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.seal {
  display: inline-grid; grid-template-columns: 1fr 1fr; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 6px; background: var(--seal); color: #fff;
  font-family: var(--font-display); font-weight: 900; font-size: 13px; line-height: 1; padding: 3px;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35);
}
.seal span { display: block; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: .04em; }
.brand-sub { font-size: 12px; color: var(--ink-3); display: block; line-height: 1.2; }

.search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin: 6px 0 14px;
}
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; }
.search input::placeholder { color: var(--ink-3); }

/* ---------- 通用 ---------- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; text-wrap: balance; }
.section-head .more { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.eyebrow { font-size: 12px; letter-spacing: .12em; color: var(--ink-3); font-weight: 600; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.panel { background: var(--surface); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px 0 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink-2);
}
.chip.plain { padding-left: 12px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bullet {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c, var(--accent)); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; flex: none;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; color: var(--ink);
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.tag.ok { background: var(--accent-soft); color: var(--accent); }
.tag.gold { background: var(--warn-soft); color: var(--gold); }

/* ---------- 线装书封面 ---------- */
.cover {
  --c: #555;
  position: relative; container-type: inline-size; aspect-ratio: 3 / 4; width: 100%; max-width: 100%;
  border-radius: 3px 8px 8px 3px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 80% at 80% 0%, rgb(255 255 255 / .16), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 86%, #fff) 0%, var(--c) 48%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  box-shadow: 0 1px 1px rgb(0 0 0 / .12), 0 6px 14px rgb(0 0 0 / .16);
}
.cover::before { /* 装订线 */
  content: ""; position: absolute; left: 7%; top: 0; bottom: 0; width: 1px; background: rgb(255 255 255 / .28);
}
.cover::after { /* 订线孔 */
  content: ""; position: absolute; left: 3.2%; top: 9%; bottom: 9%; width: 3px;
  background: repeating-linear-gradient(to bottom, rgb(255 255 255 / .55) 0 2px, transparent 2px 22%);
}
.cover .label {
  position: absolute; top: 8%; right: 10%; width: 26%; height: 64%;
  background: var(--label); color: var(--label-ink); border: 1px solid rgb(0 0 0 / .08);
  display: flex; justify-content: center; padding: 6% 0;
  box-shadow: inset 0 0 0 2px var(--label), inset 0 0 0 3px rgb(0 0 0 / .12);
}
.cover .label span {
  writing-mode: vertical-rl; text-orientation: upright; font-family: var(--font-display); font-weight: 900;
  font-size: 14px; font-size: var(--fs, 14cqw); line-height: 1.05; letter-spacing: .02em; white-space: nowrap;
}
.cover .cb { position: absolute; left: 14%; bottom: 7%; width: 15cqw; height: 15cqw; min-width: 16px; min-height: 16px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--c); font-weight: 800; font-size: 8cqw; line-height: 1; }
.cover .au { position: absolute; right: 9%; bottom: 7%; max-width: 50%; color: rgb(255 255 255 / .92); font-size: 7.4cqw; line-height: 1.2; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover.soon { filter: saturate(.55); }
.cover.soon::marker { content: none; }

/* ---------- 首页 ---------- */
.hello { display: grid; gap: 12px; }
.continue { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: inherit; }
.continue .meta { min-width: 0; }
.continue .title { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.continue .sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { position: relative; height: 6px; border-radius: 999px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.progress i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--c, var(--accent)); }

.today { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 92px; gap: 14px; align-items: center; padding: 18px; border-radius: 18px; background: var(--ink); color: var(--bg); }
.today .eyebrow { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.today h3 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 24px; font-weight: 900; line-height: 1.2; }
.today p { margin: 0; font-family: var(--font-read); font-size: 14.5px; line-height: 1.7; color: color-mix(in srgb, var(--bg) 82%, transparent); }
.today .go { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; font-weight: 700; color: var(--bg); }

.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 8px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.shelf-row::-webkit-scrollbar { display: none; }
.feature { display: grid; gap: 8px; color: inherit; }
.feature .t { font-weight: 700; font-size: 15px; }
.feature .d { font-size: 12.5px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.book { display: grid; gap: 6px; color: inherit; min-width: 0; }
.book .t { font-size: 14px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book .a { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.book .st { position: absolute; top: 6px; left: 12%; z-index: 2; }
.book .wrap { position: relative; }
.badge-ready { position: absolute; top: 6%; left: 12%; z-index: 2; height: 18px; padding: 0 6px; border-radius: 4px; background: #fff; color: #12675C; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; }
.badge-soon { position: absolute; top: 6%; left: 12%; z-index: 2; height: 18px; padding: 0 6px; border-radius: 4px; background: rgb(0 0 0 / .45); color: #fff; font-size: 11px; display: inline-flex; align-items: center; }
.empty { padding: 32px 8px; text-align: center; color: var(--ink-3); }
.footer-note { margin: 34px 0 6px; text-align: center; font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }

/* ---------- 书籍详情 ---------- */
.detail-head { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: end; margin-top: 4px; }
.detail-head h2 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 900; line-height: 1.2; text-wrap: balance; }
.detail-head .by { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.oneline { margin: 18px 0 0; font-family: var(--font-read); font-size: 17px; line-height: 1.8; }
.oneline::before { content: "“"; color: var(--accent); font-weight: 900; }
.oneline::after { content: "”"; color: var(--accent); font-weight: 900; }
.time-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.time-row div { padding: 10px; border-radius: 12px; background: var(--surface); text-align: center; }
.time-row b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.time-row span { font-size: 12px; color: var(--ink-3); }
.cta-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-top: 16px; }

.tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 56px); z-index: 15; display: grid; grid-template-columns: repeat(4, 1fr); margin: 22px calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 0 var(--gutter-r) 0 var(--gutter-l); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabs button { height: 46px; border: 0; background: transparent; font-weight: 600; color: var(--ink-3); position: relative; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); }
.tabpanel { padding-top: 18px; }

.essence { padding: 18px; border-radius: 16px; background: var(--accent-soft); color: var(--ink); }
.essence .eyebrow { color: var(--accent); }
.essence p { margin: 8px 0 0; font-family: var(--font-read); font-size: 17px; line-height: 1.85; }
.block { margin-top: 24px; }
.block h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.block h3 .n { font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; }
.prose { font-family: var(--font-read); font-size: 16px; line-height: 1.9; color: var(--ink); }
.prose p { margin: 0 0 .7em; }
.list-cards { display: grid; gap: 10px; }
.lc { padding: 14px 16px; border-radius: 14px; background: var(--surface); }
.lc b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.lc p { margin: 0; font-family: var(--font-read); font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 380px) { .people { grid-template-columns: 1fr; } }
.person { padding: 14px; border-radius: 14px; background: var(--surface); min-width: 0; }
.person .nm { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15.5px; }
.person .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 14px; flex: none; }
.person .tg { margin-top: 6px; }
.person p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }

/* ---------- 地铁线路式脉络图 ---------- */
.arc-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 0; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 0 var(--gutter-r) 6px var(--gutter-l); }
.arc-strip::-webkit-scrollbar { display: none; }
.arc { position: relative; padding: 0 12px 0 0; }
.arc .bar { height: 8px; background: var(--lc); border-radius: 0; }
.arc:first-child .bar { border-radius: 8px 0 0 8px; }
.arc:last-child .bar { border-radius: 0 8px 8px 0; }
.arc .dot { position: absolute; top: -4px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--lc); }
.arc .st { margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--lc); }
.arc .nm { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.arc .rg { font-size: 12px; color: var(--ink-3); }

.metro { position: relative; margin-top: 22px; }
.seg { position: relative; padding-left: 38px; }
.seg::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 8px; background: var(--lc); }
.seg:first-child::before { top: 18px; border-radius: 8px 8px 0 0; }
.seg:last-child::before { bottom: 18px; border-radius: 0 0 8px 8px; }
.seg-head { position: relative; padding: 10px 0 12px; }
.seg-head::before { content: ""; position: absolute; left: -36px; top: 9px; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 5px solid var(--lc); box-sizing: border-box; }
.seg-head .ln { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 6px; background: var(--lc); color: #fff; font-size: 13px; font-weight: 700; }
.seg-head h4 { margin: 8px 0 2px; font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.seg-head p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.stn { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 6px 0; border: 0; background: transparent; text-align: left; color: inherit; }
.stn::before { content: ""; position: absolute; left: -31px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--lc); }
.stn.read::before { background: var(--lc); }
.stn.here::before { width: 18px; height: 18px; margin-top: -9px; left: -34px; background: var(--ink); border-color: var(--surface); box-shadow: 0 0 0 3px var(--lc); }
.stn .nm { font-size: 15px; font-weight: 600; min-width: 0; }
.stn .no { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; margin-left: 6px; }
.stn .ic { color: var(--ink-3); display: inline-flex; }
.stn .ic svg { width: 16px; height: 16px; }
.stn:hover .nm { color: var(--accent); }

/* ---------- 章节列表 ---------- */
.chapters { display: grid; gap: 2px; }
.ch { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: inherit; width: 100%; }
.ch .no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ch.read .no { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ch.here .no { border-color: var(--accent); color: var(--accent); }
.ch .tt { font-weight: 700; font-size: 15px; line-height: 1.4; min-width: 0; }
.ch .hk { font-size: 13px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ch .lk { color: var(--ink-3); }
.ch .lk svg { width: 18px; height: 18px; }

/* ---------- 阅读页 ---------- */
.reader { max-width: 640px; margin: 0 auto; }
.r-head { margin-top: 8px; }
.r-head .stn-no { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.r-head h2 { margin: 6px 0 0; font-family: var(--font-display); font-size: 25px; font-weight: 900; line-height: 1.35; text-wrap: balance; }
.r-hook { margin: 14px 0 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-family: var(--font-read); font-size: calc(var(--read-size) - 1px); line-height: 1.75; }
.r-body { font-family: var(--font-read); font-size: var(--read-size); line-height: 1.95; letter-spacing: .01em; margin-top: 18px; }
.r-body p { margin: 0 0 1em; text-indent: 2em; }
.r-sub { margin: 26px 0 10px; font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); }
.r-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.r-points li { position: relative; padding-left: 22px; font-family: var(--font-read); font-size: calc(var(--read-size) - 1px); line-height: 1.7; }
.r-points li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); }
.r-insight { padding: 16px; border-radius: 14px; background: var(--surface); font-family: var(--font-read); font-size: calc(var(--read-size) - 1px); line-height: 1.9; }
.r-take { margin-top: 18px; padding: 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-family: var(--font-display); font-weight: 800; font-size: calc(var(--read-size) + 1px); line-height: 1.65; }
.r-take small { display: block; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .14em; color: color-mix(in srgb, var(--bg) 65%, transparent); margin-bottom: 6px; }
.r-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.r-note b { color: var(--gold); }
.speaking { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 6px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); transition: background .2s; }
.r-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 10px var(--gutter-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.r-nav .btn { height: 44px; padding: 0 12px; font-size: 14px; }
.r-nav .listen { width: 52px; height: 52px; border-radius: 50%; padding: 0; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.r-nav .listen svg { width: 24px; height: 24px; }
.lock-card { margin-top: 20px; padding: 22px 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.lock-card h3 { margin: 6px 0 6px; font-family: var(--font-display); font-size: 20px; }
.lock-card p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.fade-preview { position: relative; max-height: 150px; overflow: hidden; }
.fade-preview::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(to bottom, transparent, var(--bg)); }

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px var(--gutter-r) env(safe-area-inset-bottom, 0px) var(--gutter-l);
  background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav a { display: grid; justify-items: center; gap: 2px; height: var(--nav-h); padding-top: 7px; font-size: 11.5px; color: var(--ink-3); }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
body.reading .nav { display: none; }

/* ---------- 迷你播放器 ---------- */
.mini {
  position: fixed; left: 0; right: 0; z-index: 24;
  bottom: calc(var(--nav-h) + 4px + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--gutter-r) 8px var(--gutter-l);
}
body.reading .mini { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
.mini-in { max-width: 688px; margin: 0 auto; display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.mini .cv { width: 36px; }
.mini .tx { min-width: 0; cursor: pointer; }
.mini .tx b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .tx span { display: block; font-size: 12px; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .icon-btn { color: var(--bg); }
.mini .icon-btn:hover { background: rgb(255 255 255 / .1); }
.mini .bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .2); overflow: hidden; }
.mini .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }

/* ---------- 底部弹层 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 10px var(--gutter-r) calc(20px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 2px auto 12px; }
.sheet h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 20px; }
.player-now { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
.player-now b { display: block; font-family: var(--font-display); font-size: 18px; }
.player-now span { display: block; font-size: 13.5px; color: var(--ink-2); }
.ctrl { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 20px 0 6px; }
.ctrl .icon-btn { width: 52px; height: 52px; }
.ctrl .icon-btn svg { width: 28px; height: 28px; }
.ctrl .big { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.ctrl .big:hover { background: var(--accent); }
.ctrl .big svg { width: 32px; height: 32px; }
.opt { margin-top: 16px; }
.opt label, .opt .lb { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.seg-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btns button { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.seg-btns button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
select.input, input.input { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.queue { margin-top: 18px; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.queue button { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 10px 6px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; color: var(--ink-2); }
.queue button[aria-current="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.queue .i { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- 会员 ---------- */
.vip-hero { padding: 22px 18px; border-radius: 18px; background: var(--ink); color: var(--bg); }
.vip-hero h2 { margin: 6px 0 8px; font-family: var(--font-display); font-size: 24px; font-weight: 900; }
.vip-hero ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: color-mix(in srgb, var(--bg) 85%, transparent); }
.vip-hero li::before { content: "✓"; color: var(--accent); font-weight: 900; margin-right: 8px; }
.plans { display: grid; gap: 12px; margin-top: 16px; }
.plan { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
.plan[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.plan .nm { font-weight: 800; font-size: 17px; }
.plan .ds { grid-column: 1; font-size: 13px; color: var(--ink-3); }
.plan .pr { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-variant-numeric: tabular-nums; }
.plan .pr b { font-size: 26px; font-weight: 800; }
.plan .pr b::before { content: "¥"; font-size: 15px; margin-right: 1px; }
.plan .pr s { display: block; font-size: 12px; color: var(--ink-3); }
.plan .bd { position: absolute; top: -10px; left: 14px; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--seal); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; }
.paym { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.paym button { display: flex; align-items: center; gap: 8px; justify-content: center; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; }
.paym button[aria-pressed="true"] { border-color: var(--accent); }
.paym .pi { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
.member-card { display: grid; gap: 4px; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #2B2416, #4A3C1E); color: #F6E7C1; }
.member-card b { font-family: var(--font-display); font-size: 20px; }
.demo-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* ---------- 我的 / 书架 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px 10px; border-radius: 14px; background: var(--surface); text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--ink-3); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 96px; margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--surface); }
.week div { display: grid; gap: 4px; justify-items: center; align-self: stretch; grid-template-rows: 1fr auto; }
.week i { display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--accent); align-self: end; min-height: 3px; }
.week i.zero { background: var(--surface-2); }
.week span { font-size: 11px; color: var(--ink-3); }
.rows { display: grid; gap: 1px; border-radius: 14px; overflow: hidden; background: var(--line); }
.row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; background: var(--surface); color: inherit; border: 0; width: 100%; text-align: left; font-size: 15px; }
.row .grow { flex: 1; min-width: 0; }
.row .val { color: var(--ink-3); font-size: 14px; }
.row svg { width: 18px; height: 18px; color: var(--ink-3); }
.shelf-list { display: grid; gap: 12px; }
.shelf-item { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface); color: inherit; }
.shelf-item .t { font-weight: 800; font-family: var(--font-display); font-size: 16px; }
.shelf-item .s { font-size: 13px; color: var(--ink-3); }

/* ---------- 提示 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 48px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); }
.modal-card { text-align: center; padding: 8px 4px 4px; }
.qr { width: 168px; height: 168px; margin: 14px auto; border-radius: 12px; background:
  conic-gradient(from 90deg at 18% 18%, var(--ink) 0 25%, transparent 0) 0 0 / 34px 34px,
  repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 11px),
  var(--surface); opacity: .85; display: grid; place-items: center; }
.qr span { background: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--ink); }

.about h3 { font-family: var(--font-display); }
.layer { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.layer .k { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-family: var(--font-display); }
.layer b { display: block; font-size: 16px; }
.layer p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.7; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (min-width: 720px) { .detail-head { grid-template-columns: 140px 1fr; } }

/* =========================================================
 * 第二版新增：中图法书库、实木书架、试读券、导入与拆解
 * ========================================================= */
:root { --wood-back: #4B2F1E; --wood-back-2: #6A4329; --wood-top: #B07B45; --wood-edge: #7A4E2A; --label-card: #FBF8EE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wood-back: #24170F; --wood-back-2: #3A2617; --wood-top: #6E4A2A; --wood-edge: #4A3019; --label-card: #E9E4D6; } }
:root[data-theme="dark"] { --wood-back: #24170F; --wood-back-2: #3A2617; --wood-top: #6E4A2A; --wood-edge: #4A3019; --label-card: #E9E4D6; }

.lib-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 10px; }
.switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.switch button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; color: var(--ink-2); }
.switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-size: 13.5px; padding: 4px 2px; margin-left: auto; }
.cls { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 5px; background: var(--ink); color: var(--bg); font: 700 12px/1 var(--font-ui); flex: none; }
.chip[aria-pressed="true"] .cls { background: var(--bg); color: var(--ink); }

/* 书柜 */
.case { margin: 18px 0 6px; }
.case-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; min-width: 0; }
.case-head .no { flex: none; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; font: 600 11px/1 var(--font-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.case-head b { font-family: var(--font-display); font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-head .n { margin-left: auto; flex: none; font-size: 12px; color: var(--ink-3); }
.case-head button { flex: none; border: 0; background: transparent; color: var(--accent); font-size: 12.5px; padding: 0 2px; }
.shelf { position: relative; padding: 14px 10px 0; border-radius: 8px 8px 0 0; background: repeating-linear-gradient(90deg, rgb(255 255 255 / .025) 0 2px, transparent 2px 11px), linear-gradient(180deg, var(--wood-back), var(--wood-back-2)); box-shadow: inset 0 10px 18px rgb(0 0 0 / .35), inset 0 -1px 0 rgb(0 0 0 / .3); }
.shelf + .shelf { border-radius: 0; }
.shelf::after { content: ""; display: block; height: 15px; margin: 0 -10px; background: linear-gradient(180deg, var(--wood-top), var(--wood-edge) 80%); box-shadow: 0 5px 8px rgb(0 0 0 / .28); border-radius: 0 0 3px 3px; position: relative; z-index: 1; }
.shelf .tier { display: flex; align-items: flex-end; gap: 3px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 12px 4px 0; min-height: 232px; }
.shelf .tier::-webkit-scrollbar { display: none; }
.shelf.mini-tier .tier { min-height: 0; }
.spine.here { outline: 2px solid #E9C774; outline-offset: 2px; transform: translateY(-12px); }
.shelf .tag-plate { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); z-index: 2; padding: 1px 8px; border-radius: 2px; background: var(--label-card); color: #3a2a1a; font: 600 10.5px/1.5 var(--font-ui); white-space: nowrap; box-shadow: 0 1px 2px rgb(0 0 0 / .4); }
.shelf .empty-shelf { align-self: center; margin: auto; color: rgb(255 255 255 / .6); font-size: 13px; padding: 0 12px; text-align: center; }
.spine { --c: #555; --h: 176px; --w: 34px; position: relative; flex: none; width: var(--w); height: var(--h); border-radius: 3px 3px 1px 1px; display: flex; flex-direction: column; align-items: center; padding-top: 18px; color: #fff; text-decoration: none;
  background: linear-gradient(90deg, rgb(0 0 0 / .22), rgb(255 255 255 / .08) 22%, transparent 45%, rgb(0 0 0 / .26)), var(--c);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07), 1px 0 2px rgb(0 0 0 / .45); transition: transform .18s ease, box-shadow .18s ease; }
.spine:hover, .spine:focus-visible { transform: translateY(-12px); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1), 0 6px 10px rgb(0 0 0 / .45); }
.spine::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-top: 1px solid rgb(255 255 255 / .35); border-bottom: 1px solid rgb(255 255 255 / .35); }
.spine.ready::before { border-color: #E9C774; height: 5px; }
.spine.ready::after { content: ""; position: absolute; left: 0; right: 0; bottom: 46px; height: 4px; border-top: 1px solid #E9C774; border-bottom: 1px solid #E9C774; }
.spine.soon { filter: saturate(.72) brightness(.93); }
.spine.mine::before, .spine.mine::after { border-color: rgb(255 255 255 / .55); }
.spine .t { writing-mode: vertical-rl; text-orientation: upright; font-family: var(--font-display); font-weight: 700; font-size: var(--fs, 13px); line-height: 1.05; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: calc(var(--h) - 84px); }
.spine .call { position: absolute; left: 3px; right: 3px; bottom: 7px; padding: 2px 0; border-radius: 2px; background: var(--label-card); color: #2a2a2a; text-align: center; font: 700 7px/1.15 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; }
.spine .new { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 0 3px; border-radius: 3px; background: #E9C774; color: #3a2a10; font: 700 9px/14px var(--font-ui); white-space: nowrap; }

/* 试读券 */
.trial-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--ink); }
.trial-banner .tk { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--seal); color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 15px; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); }
.trial-banner b { font-size: 15px; }
.trial-banner span { display: block; font-size: 12.5px; color: var(--ink-2); }
.ticket-row { display: flex; gap: 8px; margin-top: 10px; }
.ticket { flex: 1; height: 54px; border-radius: 10px; border: 2px dashed var(--seal); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: var(--seal); }
.ticket.used { border-style: solid; border-color: var(--line); color: var(--ink-3); font-weight: 600; font-family: var(--font-ui); font-size: 12px; text-align: center; padding: 0 4px; }
.callno { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.callno code { font-family: var(--font-ui); font-weight: 700; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

/* 导入与拆解 */
.dropzone { display: grid; place-items: center; gap: 6px; width: 100%; font: inherit; color: inherit; margin-top: 12px; padding: 22px 16px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); text-align: center; cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); }
.dropzone b { font-size: 16px; }
.fmt-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pick-list { max-height: 46vh; overflow-y: auto; display: grid; gap: 2px; margin: 10px 0; border-radius: 12px; background: var(--surface); padding: 4px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; font-size: 14.5px; }
.pick-list label:hover { background: var(--surface-2); }
.pick-list input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.levels { display: grid; gap: 8px; }
.level { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
.level[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.level .lv { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 900; font-size: 17px; }
.level b { font-size: 15.5px; }
.level b small { font-weight: 500; color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.level span { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.level .done { color: var(--accent); font-weight: 700; }
.run { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--surface); }
.run .msg { font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; min-height: 1.5em; }
.engine { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.engine i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.engine.local i { background: var(--gold); }
.text-body p { text-indent: 2em; }
.toc-list { display: grid; gap: 0; margin-top: 8px; }
.toc-list a { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; font-size: 14.5px; }
.toc-list a span { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 2.2em; }
.toc-list a em { margin-left: auto; font-style: normal; color: var(--ink-3); font-size: 12.5px; }
.class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.class-grid button { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-size: 13.5px; min-width: 0; }
.class-grid button:disabled { opacity: .45; }
.class-grid button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-grid button em { margin-left: auto; font-style: normal; color: var(--ink-3); font-size: 12px; }

.case-more { display: block; width: 100%; margin-top: 8px; padding: 9px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--accent); font-size: 13.5px; }
.trial-banner { margin-top: 14px; text-decoration: none; color: inherit; width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
.trial-banner > svg { width: 18px; height: 18px; margin-left: auto; flex: none; color: var(--ink-3); }
.ticket { text-decoration: none; }
.cta2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.cta-row.two { grid-template-columns: 1fr 1fr; }
.small-btn { height: 34px; padding: 0 12px; font-size: 13px; margin-top: 8px; }
.small-btn svg { width: 16px; height: 16px; }
.run .engine { margin-bottom: 8px; }
.shelf-item .tag { margin-top: 6px; }
.lock-card .btn svg, .trial-banner .tk svg { width: 18px; height: 18px; }
#lib { scroll-margin-top: 76px; }
.shelf .tier.empty { min-height: 104px; align-items: center; }

/* =========================================================
 * 第三版新增：老人模式、划线笔记、登录、偏好、推荐、进度、徽章、桌面提示、平板/电脑适配
 * ========================================================= */
/* 老人模式：整体字号放大、加粗、按钮更大 */
html.big body { font-size: 18px; }
html.big .r-body, html.big .r-hook, html.big .r-insight, html.big .r-points li, html.big .prose { font-weight: 600; }
html.big .r-body { line-height: 2.05; }
html.big .nav a { font-size: 14px; } html.big .nav a svg { width: 28px; height: 28px; }
html.big .btn { min-height: 52px; font-size: 17px; }
html.big .row { font-size: 18px; min-height: 62px; }
html.big .section-head h2 { font-size: 22px; }
html.big .book .t, html.big .feature .t { font-size: 17px; }
html.big .muted.small, html.big .small { font-size: 15px; }
html.big .ch .tt { font-size: 18px; } html.big .ch .hk { font-size: 15px; }

/* 划线与笔记 */
.reader [data-b] { cursor: pointer; border-radius: 6px; transition: background .2s; position: relative; }
.hl-y { background: rgb(255 214 64 / .38); } .hl-g { background: rgb(80 200 120 / .28); } .hl-b { background: rgb(80 160 255 / .26); } .hl-p { background: rgb(255 120 170 / .26); }
mark.hl-y, mark.hl-g, mark.hl-b, mark.hl-p { color: inherit; padding: 0 1px; border-radius: 3px; }
.note-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); vertical-align: middle; text-indent: 0; }
.note-dot svg { width: 12px; height: 12px; }
.sel-pill { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; box-shadow: var(--shadow); }
.sel-pill svg { width: 16px; height: 16px; }
.q-prev { margin: 8px 0 4px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 10px 10px 0; font-family: var(--font-read); line-height: 1.7; max-height: 30vh; overflow: auto; }
.colors .sw-y[aria-pressed="true"] { background: #F5CE3E; color: #3a2a00; } .colors .sw-g[aria-pressed="true"] { background: #5CC489; color: #04210f; } .colors .sw-b[aria-pressed="true"] { background: #6BA8F5; color: #04203f; } .colors .sw-p[aria-pressed="true"] { background: #F58BB3; color: #3f0418; }
textarea.input { width: 100%; resize: vertical; min-height: 80px; padding: 10px 12px; line-height: 1.6; font: inherit; }
.note-item { padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; background: var(--surface); border-left: 4px solid var(--line); }
.note-item.hl-bar-y { border-left-color: #F5CE3E; } .note-item.hl-bar-g { border-left-color: #5CC489; } .note-item.hl-bar-b { border-left-color: #6BA8F5; } .note-item.hl-bar-p { border-left-color: #F58BB3; }
.note-item .nq { display: block; color: inherit; font-family: var(--font-read); line-height: 1.75; }
.note-item .nn { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.note-item .nm { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.note-item .nm .linkbtn { margin-left: auto; }
.share-img { display: block; width: 100%; max-height: 56vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); margin-top: 8px; }

/* 登录 */
.login { max-width: 420px; margin: 8px auto 0; display: grid; gap: 10px; }
.login-hero { text-align: center; margin: 10px 0 8px; } .login-hero .seal { margin: 0 auto 10px; }
.login-hero h2 { font-family: var(--font-display); font-size: 18px; line-height: 1.5; margin: 0; }
.login .btn .pi { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 800; }
.login-wx { background: #1AAD19; border-color: #1AAD19; color: #fff; } .login-wx .pi { background: rgb(255 255 255 / .25) !important; }
.login-apple { background: #000; border-color: #000; color: #fff; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin: 6px 0; } .login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; } .code-row .btn { white-space: nowrap; }
.acct { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: inherit; margin-bottom: 12px; }
.acct .av { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.acct .av svg { width: 24px; height: 24px; }
.acct b { display: block; font-size: 16px; } .acct span { display: block; font-size: 12.5px; color: var(--ink-3); }
.acct > svg { width: 18px; height: 18px; margin-left: auto; color: var(--ink-3); flex: none; } .acct .linkbtn { margin-left: auto; }
.checkin { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); margin-bottom: 12px; }
.checkin.done { background: var(--accent-soft); }
.checkin b { display: block; font-size: 15px; } .checkin span { display: block; font-size: 12.5px; color: var(--ink-2); }
.checkin .btn { margin: 0 0 0 auto; flex: none; }

/* 偏好、推荐 */
.pref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pref { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 15px; text-align: left; }
.pref .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.pref[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); font-weight: 700; }
.rec-list { display: grid; gap: 10px; }
.rec { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--surface); color: inherit; }
.rec .t { font-weight: 800; font-family: var(--font-display); font-size: 16px; } .rec .a { font-size: 12.5px; color: var(--ink-3); }
.rec .d { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.rec .m, .feature .m { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 2px; }

/* 进度 */
.prog-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.prog-hero > div { padding: 14px; border-radius: 14px; background: var(--ink); color: var(--bg); }
.prog-hero b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 900; } .prog-hero span { font-size: 12.5px; opacity: .8; }
.prog-row { display: block; padding: 10px 2px; border-bottom: 1px solid var(--line); color: inherit; }
.prog-row .pt { display: flex; align-items: baseline; gap: 8px; } .prog-row .pt span { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.prog-row .progress { margin-top: 6px; }

/* 徽章 */
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 12px 6px; border-radius: 14px; background: var(--surface); }
.badge b { font-size: 14px; } .badge span { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; } .badge em { font-style: normal; font-size: 11px; color: var(--accent); }
.medal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--c); color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 24px; box-shadow: inset 0 0 0 4px rgb(255 255 255 / .35), 0 3px 8px rgb(0 0 0 / .18); }
.medal.big { width: 96px; height: 96px; font-size: 42px; margin: 6px auto 4px; }
.medal.locked { background: var(--surface-2); color: var(--ink-3); box-shadow: inset 0 0 0 2px var(--line); }
.badge-pop { text-align: center; } .badge-pop h3 { margin: 6px 0 4px; }

/* 添加到桌面 */
.a2hs { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 8px 10px 12px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--accent); }
.a2hs .ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); } .a2hs .ico svg { width: 20px; height: 20px; }
.a2hs b { display: block; font-size: 14.5px; } .a2hs span { display: block; font-size: 12px; color: var(--ink-3); }
.a2hs .btn { margin: 0 0 0 auto; flex: none; } .a2hs .icon-btn { flex: none; width: 32px; height: 32px; }
.steps-list { padding-left: 1.4em; line-height: 2; margin: 8px 0; }

/* 授权封面图 */
.cover.img { padding: 0; overflow: hidden; } .cover.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.img::before, .cover.img::after { display: none; }

/* 平板、电脑：版心更宽、书格更多；大屏把底部导航改成左侧栏 */
@media (min-width: 768px) {
  #app { max-width: 900px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .rec-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rec { grid-template-columns: 1fr; align-items: start; } .rec .cover { width: 96px; }
  .badge-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pref-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { max-width: 600px; margin-left: auto; margin-right: auto; }
  .reader { max-width: 720px; }
  .nav { max-width: 600px; margin: 0 auto 12px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); padding-bottom: 0; }
}
@media (min-width: 1100px) {
  #app { max-width: 1120px; padding-left: 132px; }
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .nav { left: 0; right: auto; top: 0; bottom: 0; width: 96px; max-width: none; margin: 0; border-radius: 0; border: 0; border-right: 1px solid var(--line); box-shadow: none; grid-template-columns: 1fr; grid-auto-rows: 72px; align-content: center; padding: 0; }
  .nav a { height: 72px; padding-top: 12px; }
  .mini { left: 96px; bottom: 16px; } body.reading .mini { left: 0; bottom: 80px; }
  .topbar { margin-left: -16px; }
}

/* ================= 第 4 轮：护眼模式 ================= */
:root[data-theme="eye"] {
  --bg: #C7E3C4; --surface: #D8EDD5; --surface-2: #BCD9B8; --ink: #24331F; --ink-2: #3E5236; --ink-3: #5F7457;
  --line: #A9C8A4; --accent: #2E6B3A; --accent-ink: #F2F8EF; --accent-soft: #B4D6B0; --seal: #9C3B2E; --gold: #7A5E1C;
  --warn-soft: #E3E6C2; --scrim: rgb(20 40 18 / .45); --label: #EEF5E8; --label-ink: #24331F;
  --shadow: 0 1px 2px rgb(30 60 25 / .08), 0 10px 28px rgb(30 60 25 / .1);
  --wood-back: #4E3B25; --wood-back-2: #6B5233; --wood-top: #A88456; --wood-edge: #75583A; --label-card: #F1F3E4;
  color-scheme: light;
}
:root[data-theme="eye"] .reader, :root[data-theme="eye"] .r-body { color: #2B3A25; }
#warm { position: fixed; inset: 0; z-index: 9999; pointer-events: none; background: rgb(255 140 20); mix-blend-mode: multiply; transition: opacity .4s; }
.rest-pop { text-align: center; padding: 6px 4px 2px; }
.rest-ring { --p: 0; display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: var(--accent);
  background: radial-gradient(closest-side, var(--surface) 82%, transparent 83%), conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-2) 0); transition: background .9s linear; }
.rest-ring svg { width: 34px; height: 34px; }
.rest-n { display: block; font: 800 44px/1.1 var(--font-display); color: var(--accent); margin-top: 6px; }
.sheet h3 svg { width: 20px; height: 20px; vertical-align: -3px; }

/* ================= 网络封面 ================= */
.cover.has-net::before, .cover.has-net::after { display: none; }
.cover img.net { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 3; background: var(--c); }
.cover .net-title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 14% 6% 5%; color: #fff; font: 700 9.5cqw/1.15 var(--font-display); text-align: center;
  background: linear-gradient(transparent, rgb(0 0 0 / .72)); text-shadow: 0 1px 2px rgb(0 0 0 / .5); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ================= 多选 ================= */
body.multi-on #libbody a.spine, body.multi-on #libbody a.book { cursor: copy; }
#libbody a.spine.picked { transform: translateY(-14px); outline: 3px solid #F4D27A; outline-offset: 1px; }
#libbody a.spine.picked::marker { content: none; }
#libbody a.spine.picked .t::after { content: "✓"; }
#libbody a.book.picked .wrap { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
#libbody a.book .wrap { position: relative; }
body.multi-on #libbody a.book .wrap::after { content: ""; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgb(255 255 255 / .85); border: 2px solid var(--accent); z-index: 5; }
body.multi-on #libbody a.book.picked .wrap::after { content: "✓"; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
body.multi-on #libbody a.spine.in-fav:not(.picked)::after { content: "♡"; position: absolute; left: 0; right: 0; bottom: auto; top: -2px; height: auto; border: 0; color: #F4D27A; font-size: 11px; text-align: center; }
.multibar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px); z-index: 30; width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.multibar .n { display: flex; align-items: center; gap: 4px; font-size: 14px; margin-right: auto; white-space: nowrap; } .multibar .n svg { width: 18px; height: 18px; color: var(--accent); }
.multibar .linkbtn { margin: 0; white-space: nowrap; font-size: 13px; }
.multibar .btn { white-space: nowrap; padding: 8px 12px; } .multibar .btn svg { width: 16px; height: 16px; }
.multibar .btn[disabled] { opacity: .45; }
#multibtn { margin-left: auto; } #multibtn + .linkbtn { margin-left: 14px; }
@media (min-width: 768px) { .multibar { bottom: 84px; } }
@media (min-width: 1100px) { .multibar { bottom: 20px; margin-left: 48px; } }

/* ================= 书架：拖动浏览、惯性、倾斜、书立、拖放 ================= */
.shelf .tier { scroll-behavior: auto; cursor: grab; -webkit-user-select: none; user-select: none; overscroll-behavior-x: contain; }
.shelf .tier.dragging { cursor: grabbing; }
.shelf .tier.dragging .spine { pointer-events: none; }
.spine { -webkit-touch-callout: none; -webkit-user-drag: none; rotate: var(--tilt, 0deg); transform-origin: 50% 100%; transition: transform .18s ease, box-shadow .18s ease, rotate .25s ease-out; }
.tier { --tilt: 0deg; }
.spine.lean { rotate: -7deg; transform-origin: 0% 100%; margin-left: 10px; }
.spine.lean:hover { rotate: 0deg; }
.bookend { flex: none; align-self: flex-end; width: 10px; height: 92px; margin-left: 4px; border-radius: 2px 2px 0 0; background: linear-gradient(90deg, #6d7377, #b9bec2 45%, #7d8387); box-shadow: 1px 0 3px rgb(0 0 0 / .5); position: relative; }
.bookend::after { content: ""; position: absolute; left: -12px; bottom: 0; width: 22px; height: 4px; background: #8d9397; border-radius: 1px; }
/* 放满的书柜：两侧渐隐 + 箭头，提示还能拖动 */
.shelf.over::before { content: ""; position: absolute; top: 14px; bottom: 15px; right: 0; width: 34px; z-index: 2; pointer-events: none; background: linear-gradient(90deg, transparent, rgb(0 0 0 / .45)); border-radius: 0 8px 0 0; }
.shelf.over.at-end::before { display: none; }
.tier-arrow { position: absolute; top: 50%; transform: translateY(-60%); z-index: 3; width: 32px; height: 48px; border: 0; border-radius: 8px; background: rgb(0 0 0 / .42); color: #fff; font-size: 26px; line-height: 1; display: none; cursor: pointer; }
.tier-arrow.l { left: 4px; } .tier-arrow.r { right: 4px; }
.shelf.over:hover .tier-arrow { display: block; }
.shelf.over.at-start .tier-arrow.l, .shelf.over.at-end .tier-arrow.r { display: none; }
@media (pointer: coarse) { .shelf.over:hover .tier-arrow { display: none; } }
.shelf.long .tier { min-height: 232px; }
.swipe-tip { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); z-index: 4; padding: 6px 14px; border-radius: 99px; background: rgb(0 0 0 / .66); color: #fff; font-size: 13px; white-space: nowrap; pointer-events: none; animation: swipeTip 2.2s ease-in-out 2; }
@keyframes swipeTip { 0%, 100% { margin-left: -14px; } 50% { margin-left: 14px; } }
.case-more { white-space: normal; }
/* 拿起一本书 */
.spine.ghost { position: fixed; z-index: 100; pointer-events: none; rotate: 8deg; transform: scale(1.06); box-shadow: 0 18px 30px rgb(0 0 0 / .45); opacity: .96; transition: none; }
.spine.lifted { opacity: .25; }
body.picking { cursor: grabbing; -webkit-user-select: none; user-select: none; }
body.picking .shelf.my .tier { cursor: grabbing; }
.shelf.my.drop-here { box-shadow: inset 0 0 0 3px #E9C774, inset 0 10px 18px rgb(0 0 0 / .35); }
.spine.gap-before { margin-left: 26px; }
.spine { transition: transform .18s ease, box-shadow .18s ease, rotate .25s ease-out, margin .15s ease; }
.dropout { white-space: nowrap; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 14px); z-index: 99; display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 16px; background: var(--surface); border: 2px dashed var(--seal); color: var(--seal); font-weight: 700; box-shadow: var(--shadow); }
.dropout svg { width: 20px; height: 20px; } .dropout.hot { background: var(--seal); color: #fff; }

/* 首页“开始聆听”（借鉴 simin.shop） */
.listen-now { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 5px 12px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.listen-now svg { width: 15px; height: 15px; }
