/* ================= tokens ================= */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, "Times New Roman", serif;

  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --border: rgba(11,11,11,.30);
  --rule: #4a4843;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --accent: #2a78d6;
  --accent-soft: rgba(42,120,214,.10);
  --good: #006300;

  --meter-track: #cde2fb;
  --heat-0: #efeee9;
  --heat-1: #86b6ef;
  --heat-2: #5598e7;
  --heat-3: #256abf;
  --heat-4: #104281;
  --bar-dim: #dcdad2;

  --shadow: 0 1px 2px rgba(11,11,11,.04), 0 8px 28px rgba(11,11,11,.05);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7;
  --muted: #898781; --hairline: #2c2c2a; --border: rgba(255,255,255,.25);
  --rule: #b5b3aa;
  --grid: #2c2c2a; --axis: #383835;
  --accent: #3987e5; --accent-soft: rgba(57,135,229,.16); --good: #0ca30c;
  --meter-track: #184f95;
  --heat-0: #242423; --heat-1: #184f95; --heat-2: #256abf; --heat-3: #3987e5; --heat-4: #9ec5f4;
  --bar-dim: #3a3a37;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7;
    --muted: #898781; --hairline: #2c2c2a; --border: rgba(255,255,255,.25);
    --rule: #b5b3aa;
    --grid: #2c2c2a; --axis: #383835;
    --accent: #3987e5; --accent-soft: rgba(57,135,229,.16); --good: #0ca30c;
    --meter-track: #184f95;
    --heat-0: #242423; --heat-1: #184f95; --heat-2: #256abf; --heat-3: #3987e5; --heat-4: #9ec5f4;
    --bar-dim: #3a3a37;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

/* ================= base ================= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: #101013;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ================= stage & phone frame ================= */
.stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 28px 16px; }
.demo-bar { display: flex; align-items: center; gap: 14px; color: #9a9aa2; font-size: 13px; }
.demo-bar .demo-title { color: #e8e8ec; font-weight: 600; font-size: 14px; }
.demo-bar .demo-btn {
  color: #d6d6dc; border: 1px solid #3a3a40; border-radius: 999px; padding: 6px 14px; font-size: 13px;
}
.demo-bar .demo-btn:hover { background: #26262c; }
.phone {
  position: relative; width: 390px; height: 844px; flex: none;
  background: var(--page); border-radius: 54px; overflow: hidden;
  border: 10px solid #1c1c1f;
  box-shadow: 0 0 0 2px #3c3c42, 0 30px 80px rgba(0,0,0,.55);
}
.island { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 118px; height: 34px; border-radius: 20px; background: #000; z-index: 40; }
.statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 39;
  display: flex; align-items: flex-end; justify-content: space-between; padding: 0 30px 8px;
  font-size: 15px; font-weight: 600; color: var(--ink); pointer-events: none;
}
.statusbar .sb-icons { display: flex; align-items: center; gap: 6px; }
.home-indicator { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .85; z-index: 41; pointer-events: none; }

/* ================= app & screens ================= */
.app { position: absolute; inset: 0; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 66px 18px 110px; display: none; background: var(--page);
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.on { display: block; }
.screen.push {
  display: block; transform: translateX(100%); visibility: hidden; pointer-events: none;
  transition: transform .3s cubic-bezier(.32,.72,.28,1), visibility 0s .3s;
  z-index: 5;
}
.screen.push.on { transform: none; visibility: visible; pointer-events: auto; transition: transform .3s cubic-bezier(.32,.72,.28,1); }

/* ================= header / nav ================= */
.nav { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.large-title { font-size: 30px; font-weight: 800; letter-spacing: .2px; }
.nav-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.nav-actions { display: flex; gap: 4px; margin-top: 2px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 0; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: none; border: none;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:active { transform: scale(.94); }
.backbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.backbtn { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 16px; font-weight: 500; padding: 4px 6px 4px 0; }
.backbtn svg { width: 20px; height: 20px; }

/* ================= common components ================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 0;
  padding: 16px; margin-bottom: 12px;
}
.section-label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .22em; color: var(--ink-2);
  margin: 24px 2px 10px;
}
.section-label::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  background: var(--ink); margin-right: 2px; transform: translateY(.5px);
}
.section-label .more { margin-left: auto; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: transparent; color: var(--ink-2);
  border-radius: 0; padding: 6px 12px; font-size: 12.5px; white-space: nowrap; letter-spacing: .04em;
}
.chip.sel { background: var(--ink); color: var(--page); border-color: var(--ink); font-weight: 600; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: 0 -2px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700;
  border-radius: 0; padding: 2px 6px; letter-spacing: .08em;
}
.badge.reading { color: var(--accent); background: var(--accent-soft); }
.badge.done { color: var(--good); background: rgba(12,163,12,.10); }
.badge.quit { color: var(--muted); background: rgba(137,135,129,.12); }
.badge.wish { color: var(--ink-2); background: rgba(137,135,129,.12); }
.meter { height: 4px; border-radius: 0; background: var(--meter-track); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 0; background: var(--accent); }
.meter > i.done { background: var(--good); }
.meter > i.quit { background: var(--muted); }
.quote { font-family: var(--serif); font-size: 17px; line-height: 1.75; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 0; padding: 10px 16px; font-size: 13.5px; font-weight: 600; letter-spacing: .06em;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
}
.btn.primary { background: var(--ink); color: var(--page); }
.btn.small { padding: 6px 11px; font-size: 12.5px; font-weight: 550; }
.btn:active { transform: scale(.98); }
.hairline-div { height: 1px; background: var(--hairline); border: 0; margin: 14px 0; }

/* ================= tab bar ================= */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 84px; z-index: 10;
  display: flex; align-items: flex-start; padding: 8px 10px 0;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 550; letter-spacing: .06em; padding: 4px 0;
}
.tab svg { width: 24px; height: 24px; }
.tab::after { content: ""; width: 18px; height: 2px; background: transparent; }
.tab.sel { color: var(--ink); }
.tab.sel::after { background: var(--ink); }
.tab:active { transform: scale(.95); }

/* ================= recap (回顾) ================= */
.qcard { border-top: 3px solid var(--ink); }
.qcard .qmark { color: var(--accent); font-family: var(--serif); font-size: 34px; line-height: 1; }
.qcard .qsrc { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.qcard .qsrc b { font-weight: 600; color: var(--ink); }
.qcard .qwhen { color: var(--muted); }
.qacts { display: flex; gap: 8px; margin-top: 14px; }
.qacts .btn { flex: none; }
.qacts .count { color: var(--muted); font-weight: 500; }
.letter { font-family: var(--serif); font-size: 15.5px; line-height: 1.9; color: var(--ink); }
.letter .clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.letter .clamp.open { -webkit-line-clamp: unset; overflow: visible; }
.letter-foot { margin-top: 12px; font-size: 12px; color: var(--muted); font-family: var(--sans); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  border: 1px solid var(--border); background: transparent; border-radius: 0;
  padding: 7px 13px; font-size: 13px; color: var(--ink); font-weight: 550; letter-spacing: .04em;
}
.tag i { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 3px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; text-align: left; }
.mini-row + .mini-row { border-top: 1px solid var(--hairline); }
.mini-row:active { opacity: .7; }
.thumb {
  width: 42px; height: 58px; border-radius: 3px; flex: none;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; font-size: 11px; font-weight: 600; letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.12);
}
.mini-main { flex: 1; min-width: 0; }
.mini-title { font-size: 14.5px; font-weight: 600; }
.mini-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chev { color: var(--axis); flex: none; }

/* ================= archive (档案) ================= */
.searchbox {
  display: flex; align-items: center; gap: 8px; margin: 12px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 9px 12px;
}
.searchbox svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.searchbox input { flex: 1; border: 0; background: none; color: var(--ink); font-size: 15px; outline: none; font-family: inherit; }
.searchbox input::placeholder { color: var(--muted); }
.ctrl-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; }
.sortbtn {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2);
  border: 1px solid var(--border); background: var(--surface); border-radius: 0; padding: 6px 11px;
  position: relative;
}
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 2px; }
.seg button { padding: 5px 11px; border-radius: 0; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.seg button svg { width: 13px; height: 13px; }
.seg button.sel { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 150px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 0;
  padding: 5px; display: none;
}
.menu.open { display: block; }
.menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-radius: 0; font-size: 14px; color: var(--ink); }
.menu button:hover { background: var(--accent-soft); }
.menu .chk { visibility: hidden; color: var(--accent); font-weight: 700; }
.menu button.sel .chk { visibility: visible; }

.book-row { padding: 13px 2px; display: flex; gap: 12px; width: 100%; text-align: left; }
.br-body { flex: 1; min-width: 0; }
.book-row + .book-row { border-top: 1px solid var(--hairline); }
.book-row:active { opacity: .7; }
.br-top { display: flex; align-items: center; gap: 8px; }
.br-title { font-size: 15.5px; font-weight: 650; }
.br-author { font-size: 12.5px; color: var(--muted); }
.br-stats { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.br-stats .meter { flex: 1; }
.br-pct { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.br-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.br-meta .dot::before { content: "·"; margin-right: 6px; }
.src-badge { border: 1px solid var(--border); border-radius: 0; padding: 1px 4px; font-size: 10px; letter-spacing: .04em; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 14px; }
.cover {
  position: relative; width: 100%; aspect-ratio: 3/4.2; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; font-size: 15px; font-weight: 650; letter-spacing: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.14);
}
.cover .cov-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.18); }
.cover .cov-bar i { display: block; height: 100%; background: var(--accent); }
.cover .cov-done {
  position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--good); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
  border-radius: 0;
}
.cover .cov-quit { position: absolute; inset: 0; background: rgba(127,127,127,.55); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; writing-mode: horizontal-tb; letter-spacing: 2px; border-radius: 8px; }
.cov-name { font-size: 11.5px; color: var(--ink-2); margin-top: 7px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8.5px 2px; }
.compact-row + .compact-row { border-top: 1px solid var(--hairline); }
.cr-title { font-size: 14px; font-weight: 550; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-pct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 44px 0; }

/* ================= detail (档案卡片) ================= */
.dt-head { display: flex; gap: 16px; margin: 6px 0 4px; }
.dt-cover {
  width: 96px; height: 134px; border-radius: 3px; flex: none;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; font-size: 19px; font-weight: 650; letter-spacing: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.18);
}
.dt-info { flex: 1; min-width: 0; padding-top: 4px; }
.dt-title { font-size: 21px; font-weight: 750; line-height: 1.3; }
.dt-author { color: var(--ink-2); font-size: 13.5px; margin-top: 5px; }
.dt-sub { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.dt-prog { margin-top: 14px; }
.dt-prog .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: 0; overflow: hidden; }
.statgrid .cell { background: var(--surface); padding: 12px 8px; text-align: center; }
.statgrid .v { font-size: 17px; font-weight: 700; }
.statgrid .k { font-size: 11px; color: var(--muted); margin-top: 3px; }
.hl-item { padding: 12px 0; }
.hl-item + .hl-item { border-top: 1px solid var(--hairline); }
.hl-chap { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.note {
  margin-top: 9px; background: var(--accent-soft); border-radius: 0; padding: 9px 12px;
  font-size: 13.5px; line-height: 1.65; color: var(--ink);
}
.note b { font-weight: 600; color: var(--accent); }
.ai-body { font-size: 14px; line-height: 1.8; color: var(--ink); }
.ai-body .one { font-weight: 650; }
.ai-body ol { margin: 8px 0 0 18px; }
.ai-body li { margin: 4px 0; }
.dt-footer { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, var(--page) 38%); }
.dt-footer .btn { width: 100%; }

/* ================= sources (数据源) ================= */
.src-card { display: flex; gap: 13px; align-items: flex-start; }
.src-logo {
  width: 44px; height: 44px; border-radius: 11px; flex: none; background: #3d7ea8;
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700;
}
.src-main { flex: 1; min-width: 0; }
.src-name { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.ok-badge { color: var(--good); font-size: 11.5px; font-weight: 700; background: rgba(12,163,12,.10); border-radius: 0; padding: 2px 7px; letter-spacing: .06em; }
.src-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.src-btns { display: flex; gap: 8px; margin-top: 12px; }
.addcard {
  width: 100%; border: 1.5px dashed var(--axis); border-radius: 0; background: none;
  padding: 18px; text-align: center; color: var(--ink-2);
}
.addcard .plus { font-size: 20px; color: var(--muted); }
.addcard .t { font-size: 14.5px; font-weight: 600; margin-top: 4px; color: var(--ink); }
.addcard .mods { display: flex; gap: 7px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.addcard .mods span { font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
.log { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; font-size: 12.5px; color: var(--ink-2); }
.log + .log { border-top: 1px solid var(--hairline); }
.log .when { color: var(--muted); flex: none; }
.footnote { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 10px; }

/* ================= stats (统计) ================= */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 14px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--hairline); }
.tile { background: none; border: 0; border-left: 1px solid var(--hairline); border-radius: 0; padding: 12px 12px 10px; }
.tile:first-child { border-left: 0; }
.tile .k { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .2em; }
.tile .v { font-family: var(--serif); font-size: 27px; font-weight: 700; margin-top: 6px; }
.tile .v small { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-left: 1px; font-family: var(--sans); }
.tile .d { font-size: 11px; margin-top: 3px; color: var(--muted); }
.tile .d.up { color: var(--good); font-weight: 600; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.card-title { font-size: 14.5px; font-weight: 650; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tblbtn { font-size: 12px; color: var(--accent); font-weight: 500; flex: none; }
.chart-wrap { margin-top: 10px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.hscroll { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.hscroll::-webkit-scrollbar { display: none; }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; font-size: 10.5px; color: var(--muted); }
.heat-legend i { width: 10px; height: 10px; border-radius: 2.5px; display: inline-block; }
.keyrow { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.keyrow .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2.5px; margin-right: 5px; vertical-align: -1px; }
.insight-big { font-size: 15.5px; font-weight: 700; margin-top: 2px; }
.insight-big em { font-style: normal; color: var(--accent); }
.top-row { padding: 7px 0; }
.top-row .t { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.top-row .t b { font-weight: 600; }
.top-row .t span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.top-bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--accent); }
.quit-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.quit-row + .quit-row { border-top: 1px solid var(--hairline); }
.quit-row .m { flex: 1; }

/* ================= tooltip / toast / table ================= */
#tooltip {
  position: absolute; z-index: 50; pointer-events: none; display: none;
  background: var(--ink); color: var(--page); border-radius: 0; padding: 7px 10px;
  font-size: 12px; line-height: 1.45; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 200px;
}
#tooltip .tv { font-weight: 700; font-size: 13px; }
#tooltip .tl { opacity: .75; }
.toast {
  position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--page); border-radius: 0; padding: 9px 18px;
  font-size: 13px; z-index: 60; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl caption { text-align: left; color: var(--muted); font-size: 11px; padding-bottom: 6px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 2px; border-bottom: 1px solid var(--hairline); }
.tbl td { padding: 4px 2px; border-bottom: 1px solid var(--hairline); color: var(--ink-2); }
.tbl td:last-child, .tbl th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-scroll { max-height: 216px; overflow-y: auto; }

/* ================= 看过的书 · 编辑部列表 ================= */
.obs-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 13px 2px; }
.obs-row + .obs-row { border-top: 1px solid var(--hairline); }
.obs-row:active { opacity: .6; }
.obs-no { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 22px; flex: none; }
.obs-main { flex: 1; min-width: 0; }
.obs-title { font-size: 16.5px; font-weight: 650; }
.obs-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.obs-chev { color: var(--axis); flex: none; width: 16px; height: 16px; }

/* ================= 划线 · 解读 · 笔记 模块 ================= */
.kn-chips { display: flex; gap: 7px; margin: 2px 0 4px; flex-wrap: wrap; }
.kn-chip { border: 1px solid var(--border); background: none; color: var(--muted); border-radius: 0; padding: 4.5px 11px; font-size: 12px; }
.kn-chip.sel { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 650; }
.kn-item { padding: 13px 0; }
.kn-item + .kn-item { border-top: 1px solid var(--hairline); }
.kn-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--border); border-radius: 0; padding: 1px 6px; margin-bottom: 7px; }
.kn-item.interp .kn-tag { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.kn-quote { font-family: var(--serif); font-size: 15.5px; line-height: 1.75; }
.kn-item.interp .kn-quote { font-size: 13px; font-family: var(--sans); color: var(--muted); line-height: 1.6; }
.kn-interp { margin-top: 9px; background: var(--accent-soft); border-radius: 0; padding: 10px 12px; font-size: 13.5px; line-height: 1.7; }
.kn-interp b, .kn-note b { font-weight: 650; }
.kn-interp b { color: var(--accent); }
.kn-note { border: 1px solid var(--border); border-radius: 0; padding: 10px 12px; font-size: 13.5px; line-height: 1.7; }
.kn-note b { color: var(--ink-2); }
.kn-chap { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ================= deck（Observer 式横滑卡片） ================= */
.deck { position: absolute; inset: 0; z-index: 30; background: var(--page); display: none; flex-direction: column; }
.deck.on { display: flex; }
.deck-top { display: flex; align-items: center; justify-content: space-between; padding: 58px 18px 6px; }
.deck-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.deck-vp { flex: 1; overflow: hidden; touch-action: pan-y; cursor: grab; }
.deck-vp:active { cursor: grabbing; }
.deck-track { display: flex; height: 100%; will-change: transform; }
.deck-slide { flex: 0 0 100%; min-width: 0; position: relative; display: flex; overflow: hidden; }
.deck-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); font-size: 12px; border-radius: 0; padding: 7px 15px; opacity: .92; transition: opacity .4s; pointer-events: none; white-space: nowrap; }
.deck-hint.off { opacity: 0; }
.bp-color { position: absolute; top: 0; left: 0; right: 0; height: 6px; z-index: 2; }
.bp-edge { flex: 0 0 30px; position: relative; display: flex; justify-content: center; padding: 20px 0 56px; background: var(--page); }
.bp-edge.left { border-right: 1px solid var(--hairline); }
.bp-edge.right { border-left: 1px solid var(--hairline); }
.bp-edge:active { background: var(--accent-soft); }
.bp-edge.empty { visibility: hidden; }
.bp-edge .et { writing-mode: vertical-rl; font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: 4px; color: var(--ink-2); max-height: 100%; overflow: hidden; }
.bp-edge .ed { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 11px; height: 11px; border-radius: 50%; }
.bp-main { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 18px 46px; scrollbar-width: none; }
.bp-main::-webkit-scrollbar { display: none; }
.bp-title { font-size: 42px; text-align: center; letter-spacing: 6px; line-height: 1.15; margin-top: 14px; }
.bp-poster { margin-top: 14px; border: 1px solid var(--border); }
.bp-poster-txt { padding: 16px 16px 18px; background: var(--pc, var(--ink)); color: var(--pc-ink, var(--page)); }
.bp-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; opacity: .8; }
.bp-hed { font-size: 33px; line-height: 1.25; letter-spacing: 3px; margin: 10px 0; }
.bp-deck { font-family: var(--serif); font-size: 15px; line-height: 1.85; opacity: .95; }
.bp-byline { font-size: 12px; margin-top: 14px; opacity: .8; letter-spacing: .06em; }
.bp-art { height: 150px; }
.bp-art svg { display: block; width: 100%; height: 100%; }
.br-thumb { width: 54px; height: 74px; flex: none; border: 1px solid var(--border); }
.br-thumb svg { display: block; width: 100%; height: 100%; }
.rec-art { margin: -16px -16px 12px; height: 64px; border-bottom: 1px solid var(--border); }
.rec-art svg { display: block; width: 100%; height: 100%; }
.rule-h { height: 3px; background: var(--ink); border: 0; margin: 14px 0; }
.rule-h.thin { height: 1px; opacity: .55; }
.bp-meta { text-align: center; font-size: 12.5px; color: var(--muted); }
.bp-links { display: flex; justify-content: center; gap: 18px; margin-top: 10px; }
.bp-links button { font-size: 12.5px; color: var(--accent); font-weight: 550; }
.bp-sec { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: 1px; margin: 4px 0 12px; }
.bp-sum { font-family: var(--serif); font-size: 15.5px; line-height: 1.9; }
.bp-sum .one, .ai-body .one {
  display: block; background: var(--blk, var(--ink)); color: var(--blk-ink, var(--page));
  padding: 12px 14px; font-weight: 700; margin: 0 0 12px; line-height: 1.75;
}
.bp-sum ol { margin: 0 0 0 18px; }
.bp-sum li { margin: 4px 0; }
.feed-row { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--hairline); font-size: 13px; line-height: 1.55; }
.feed-row:last-child { border-bottom: 0; }
.feed-when { color: var(--muted); flex: none; width: 66px; font-size: 11.5px; letter-spacing: .05em; font-weight: 600; }

/* ================= masthead & 书脊墙（Observer 式首页） ================= */
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 10px; border-bottom: 4px double var(--ink); }
.masthead .mh-side { display: flex; gap: 6px; min-width: 78px; }
.masthead .mh-side:last-child { justify-content: flex-end; }
.masthead .mh-center { text-align: center; }
.masthead .mh-title { font-family: var(--serif); font-weight: 800; font-size: 29px; letter-spacing: 18px; text-indent: 18px; line-height: 1.15; }
.masthead .mh-strap { font-size: 8.5px; font-weight: 600; letter-spacing: .34em; text-indent: .34em; color: var(--muted); margin-top: 3px; }
.shelf-wrap { flex: 1; display: flex; min-height: 0; border-bottom: 3px solid var(--ink); }
.shelf { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.shelf::-webkit-scrollbar { display: none; }
#screen-home.on { display: flex; flex-direction: column; }
.spine {
  flex: 0 0 64px; position: relative; scroll-snap-align: start;
  border-right: 1px solid var(--rule);
  display: flex; justify-content: center; padding: 24px 0 66px;
}
.spine:first-child { border-left: 1px solid var(--rule); }
.spine:active { background: var(--accent-soft); }
.spine-title { writing-mode: vertical-rl; font-size: 21px; letter-spacing: 6px; line-height: 1; color: var(--ink); max-height: 100%; overflow: hidden; }
.sp-t-song { font-family: var(--serif); font-weight: 700; }
.sp-t-hei { font-family: var(--sans); font-weight: 800; letter-spacing: 4px; }
.sp-t-kai { font-family: "Kaiti SC", "STKaiti", "KaiTi", var(--serif); font-weight: 600; }
.sp-t-it { font-family: var(--serif); font-weight: 700; font-style: italic; }
.spine-sub { position: absolute; top: 24px; right: 10px; writing-mode: vertical-rl; font-size: 9px; color: var(--muted); letter-spacing: 1px; max-height: 45%; overflow: hidden; }
.spine-dot { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); width: 15px; height: 15px; border-radius: 50%; }
.spine.wish .spine-title { color: var(--ink-2); font-weight: 500; }
.spine.wish .spine-dot { background: var(--page); border: 1.5px dashed var(--axis); }

/* ================= 也许下一本（推荐） ================= */
.rec-card { display: block; }
.rec-title { font-family: var(--serif); font-size: 17.5px; font-weight: 700; }
.rec-author { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rec-why { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 9px 0 12px; padding-left: 10px; border-left: 2px solid var(--accent); }
.rec-card .btn:disabled { opacity: .55; }

/* ================= 手机感交互 ================= */
body { user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
.shelf, .deck-vp { -webkit-overflow-scrolling: touch; }

/* ================= responsive / motion ================= */
@media (max-width: 560px) {
  .stage { padding: 0; gap: 0; }
  .demo-bar { display: none; }
  .phone { width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .island, .statusbar, .home-indicator { display: none; }
  .screen { padding-top: 24px; }
  .deck-top { padding-top: 20px; }
  .tabbar { height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================= 数据源页 · 导入与 AI 设置 ================= */
.imp-hint { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; margin-bottom: 8px; }
.imp-hint b { font-weight: 650; }
.codeblock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.8;
  background: var(--page); border: 1px solid var(--border); padding: 10px 12px;
  overflow-x: auto; white-space: pre; margin-bottom: 10px; color: var(--ink-2);
}
#imp-file { font-size: 12px; margin: 4px 0 8px; width: 100%; }
.imp-text {
  width: 100%; min-height: 74px; resize: vertical; border: 1px solid var(--border);
  background: var(--page); color: var(--ink); font-size: 11.5px; font-family: ui-monospace, Menlo, monospace;
  padding: 8px 10px; margin-bottom: 10px;
}
.imp-log { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.imp-log.err { color: #d03b3b; }
.fld { display: block; margin-bottom: 10px; }
.fld span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .18em; color: var(--muted); margin-bottom: 5px; }
.fld input {
  width: 100%; border: 1px solid var(--border); background: var(--page); color: var(--ink);
  font-size: 13px; padding: 9px 10px; font-family: ui-monospace, Menlo, monospace;
}

/* ================= 手机手势修复：书页内横滑归 JS，纵滑归系统 ================= */
.deck-vp, .deck-vp * { touch-action: pan-y; }

/* ================= 杂志引文卡（拉引文） ================= */
.pull {
  border: 1px solid var(--border); border-top: 4px solid var(--pc, var(--ink));
  background: var(--surface); padding: 16px 16px 14px; margin-bottom: 12px;
}
.pull-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--pc, var(--ink-2)); }
.pull-quote { font-family: var(--serif); font-size: 20px; line-height: 1.7; margin: 10px 0; }
.pull-src { font-size: 12px; color: var(--muted); }
.pull-acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ================= 分享海报弹层 ================= */
.sharecard {
  position: absolute; inset: 0; z-index: 45; display: none;
  align-items: center; justify-content: center; background: rgba(0,0,0,.6);
}
.sharecard.on { display: flex; }
.sc-body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 26px; width: 100%; }
.sc-poster {
  width: 100%; max-width: 320px; aspect-ratio: 3/4;
  background: var(--pc, var(--ink)); color: var(--pc-ink, var(--page));
  padding: 22px 20px; display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.sc-mark { font-size: 9px; font-weight: 700; letter-spacing: .3em; opacity: .75; }
.sc-quote { font-family: var(--serif); font-size: 24px; line-height: 1.75; margin: auto 0; }
.sc-src { font-size: 12px; opacity: .85; letter-spacing: .05em; }
.sc-rule { height: 2px; background: currentColor; opacity: .55; margin: 14px 0 10px; }
.sc-foot { font-size: 10px; letter-spacing: .22em; opacity: .7; }
.sc-hint { color: #d6d6dc; font-size: 12px; letter-spacing: .05em; }
