/* ============================================================
   椤靛笨 路 YEYU READER
   A quiet reading room, built with paper, ink and a little light.
   ============================================================ */

:root {
  --bg: #f7f3eb;
  --bg-deep: #f0eadf;
  --surface: #fffdf8;
  --surface-2: #f2ede3;
  --surface-3: #e9e2d5;
  --ink: #24211c;
  --ink-2: #514b41;
  --muted: #817a6d;
  --faint: #a9a193;
  --line: #e6dfd2;
  --line-strong: #d9d0c0;
  --accent: #c45d3c;
  --accent-deep: #a3482d;
  --accent-soft: #f6e4da;
  --forest: #233f35;
  --forest-soft: #e3ece6;
  --sage: #52705f;
  --gold: #c2913d;
  --gold-soft: #f5ecd8;
  --blue: #54738c;
  --blue-soft: #e5edf2;
  --rose: #b96c76;
  --rose-soft: #f6e6e8;
  --danger: #b7473d;
  --danger-soft: #f8e7e4;
  --shadow-xs: 0 1px 2px rgba(56, 46, 31, .05);
  --shadow-sm: 0 2px 7px rgba(56, 46, 31, .06), 0 1px 2px rgba(56, 46, 31, .04);
  --shadow-md: 0 12px 30px rgba(56, 46, 31, .10), 0 2px 7px rgba(56, 46, 31, .05);
  --shadow-lg: 0 28px 70px rgba(45, 37, 25, .18), 0 6px 18px rgba(45, 37, 25, .08);
  --serif: "Iowan Old Style", "Palatino Linotype", "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --radius: 18px;
  --radius-sm: 11px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .11' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  --paper-fibers:
    repeating-linear-gradient(0deg, rgba(104, 82, 52, .018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(104, 82, 52, .012) 0 1px, transparent 1px 6px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: #d8cfbf transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d8cfbf; border: 3px solid transparent; background-clip: content-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #c5b9a5; border: 2px solid transparent; background-clip: content-box; }
body {
  margin: 0;
  background: var(--app-bg, var(--bg));
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .35s var(--ease);
}
body[data-app-bg="paper"] { --app-bg: var(--bg); }
body[data-app-bg="sand"] { --app-bg: #f2e7d4; background: radial-gradient(ellipse at 86% 0%, rgba(199, 151, 84, .09), transparent 42%), var(--app-bg); }
body[data-app-bg="sage"] { --app-bg: #e8efe5; background: radial-gradient(ellipse at 86% 0%, rgba(103, 139, 108, .07), transparent 42%), var(--app-bg); }
body[data-app-bg="mist"] { --app-bg: #edf0ee; background: radial-gradient(ellipse at 86% 0%, rgba(100, 126, 132, .06), transparent 42%), var(--app-bg); }
body[data-app-bg="rose"] { --app-bg: #f4e9e5; background: radial-gradient(ellipse at 86% 0%, rgba(180, 120, 112, .06), transparent 42%), var(--app-bg); }
body[data-app-bg="night"] {
  color-scheme: dark;
  --app-bg: #111413; --bg: #111413; --bg-deep: #0b0e0d;
  --surface: #1a201c; --surface-2: #232a25; --surface-3: #2c342e;
  --ink: #ece7dc; --ink-2: #c9c3b6; --muted: #9b9589; --faint: #736e64;
  --line: rgba(236, 229, 214, .11); --line-strong: rgba(236, 229, 214, .2);
  --accent: #d88262; --accent-deep: #e59a7a; --accent-soft: rgba(216, 130, 98, .15);
  --forest: #2a4036; --forest-soft: #26342c;
  --sage: #9db7a2; --gold: #d4a55b; --gold-soft: #2d2a21; --blue: #7e9cb3; --blue-soft: #202a30; --rose: #c98c94; --rose-soft: #2f2225;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .26); --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25); --shadow-md: 0 12px 30px rgba(0, 0, 0, .35); --shadow-lg: 0 28px 70px rgba(0, 0, 0, .5);
  background: radial-gradient(ellipse at 84% 0%, rgba(110, 140, 120, .06), transparent 42%), var(--app-bg);
}
body[data-app-bg="chinese"] {
  color-scheme: dark;
  --app-bg: #8f2c24; --bg: #8f2c24; --bg-deep: #7b231e;
  --surface: #9a352d; --surface-2: #a64036; --surface-3: #b24a3f;
  --ink: #f8e8d1; --ink-2: #e8cfb5; --muted: #d0aa8d; --faint: #b98a70;
  --line: rgba(248, 232, 209, .14); --line-strong: rgba(248, 232, 209, .24);
  --accent: #e6b261; --accent-deep: #f0c378; --accent-soft: rgba(230, 178, 97, .16);
  --forest: #6b1f1a; --forest-soft: #782b24;
  --sage: #d7b37e; --gold: #e8bd6b; --gold-soft: #79322a; --blue: #d8b7a0; --blue-soft: #7e352e; --rose: #e0a59f; --rose-soft: #82352f;
  --shadow-xs: 0 1px 2px rgba(45, 10, 8, .25); --shadow-sm: 0 2px 8px rgba(45, 10, 8, .22); --shadow-md: 0 12px 30px rgba(45, 10, 8, .3); --shadow-lg: 0 28px 70px rgba(45, 10, 8, .42);
  background: #8f2c24;
}
body[data-app-bg="chinese"]::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('chinese-scenery.jpg') center / cover no-repeat;
  opacity: .64;
  filter: saturate(.9) contrast(1.02);
}
body[data-app-bg="chinese"]::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(172, 62, 50, .18), transparent 62%),
    linear-gradient(180deg, rgba(122, 32, 25, .3) 0%, rgba(116, 30, 24, .42) 52%, rgba(96, 23, 19, .56) 100%);
}
body[data-app-bg="chinese"] .app-shell { position: relative; z-index: 1; }
body[data-app-bg="chinese"] .sidebar {
  box-shadow: inset -1px 0 rgba(255, 236, 208, .06), 18px 0 46px rgba(45, 10, 8, .18);
  overflow: hidden;
  isolation: isolate;
}
body[data-app-bg="chinese"] .sidebar::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('chinese-floral-line.jpg') center / cover no-repeat;
  transform: scaleX(-1);
  transform-origin: center;
  opacity: .3;
  mix-blend-mode: screen;
  filter: invert(1) sepia(.9) saturate(1.7) hue-rotate(345deg) brightness(1.08);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 7%, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 7%, #000 84%, transparent 100%);
}
body[data-app-bg="chinese"] .sidebar > * { position: relative; z-index: 1; }
body[data-app-bg="chinese"] .book-card,
body[data-app-bg="chinese"] .note-card,
body[data-app-bg="chinese"] .insight-card,
body[data-app-bg="chinese"] .settings-card,
body[data-app-bg="chinese"] .goal-mini,
body[data-app-bg="chinese"] .continue-card {
  box-shadow: 0 14px 32px rgba(45, 10, 8, .2), inset 0 1px 0 rgba(255, 238, 212, .055);
}
body[data-app-bg="chinese"] .continue-card {
  border-color: rgba(255, 226, 184, .11);
}
body[data-app-bg="night"] .sidebar,
body[data-app-bg="chinese"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 34%),
    var(--app-bg);
  border-color: var(--line);
}
body[data-app-bg="night"] .nav-item:hover,
body[data-app-bg="chinese"] .nav-item:hover { background: rgba(255, 255, 255, .06); }
body[data-app-bg="night"] .btn-ghost:hover,
body[data-app-bg="chinese"] .btn-ghost:hover { background: rgba(255, 255, 255, .06); }
body[data-app-bg="night"] .shelf-empty,
body[data-app-bg="night"] .notes-empty,
body[data-app-bg="night"] .add-book-card,
body[data-app-bg="chinese"] .shelf-empty,
body[data-app-bg="chinese"] .notes-empty,
body[data-app-bg="chinese"] .add-book-card { background: rgba(255, 255, 255, .025); }
body[data-app-bg="night"] .note-card:hover,
body[data-app-bg="chinese"] .note-card:hover { border-color: var(--line-strong); }
body[data-app-bg="night"] .continue-card {
  background:
    radial-gradient(ellipse at 88% 12%, rgba(203, 157, 98, .14), transparent 42%),
    radial-gradient(ellipse at 0% 100%, rgba(102, 143, 120, .12), transparent 50%),
    linear-gradient(122deg, #15211b 0%, #1b2b23 58%, #22392e 100%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .32);
}
body[data-app-bg="chinese"] .continue-card {
  background:
    radial-gradient(ellipse at 88% 12%, rgba(244, 198, 112, .2), transparent 42%),
    radial-gradient(ellipse at 0% 100%, rgba(151, 55, 43, .3), transparent 50%),
    linear-gradient(122deg, #6b1e1a 0%, #82271f 58%, #963128 100%);
  box-shadow: 0 20px 44px rgba(45, 10, 8, .3);
}
body[data-app-bg="night"] .brand-name,
body[data-app-bg="night"] .goal-big,
body[data-app-bg="night"] .insight-number strong,
body[data-app-bg="night"] .week-bar.is-today em,
body[data-app-bg="night"] .filter-pill.active,
body[data-app-bg="night"] .view-toggle button.active,
body[data-app-bg="night"] .nav-item.active,
body[data-app-bg="night"] .notes-order .sort-btn.is-active,
body[data-app-bg="night"] .setting-seg button.active,
body[data-app-bg="chinese"] .brand-name,
body[data-app-bg="chinese"] .goal-big,
body[data-app-bg="chinese"] .insight-number strong,
body[data-app-bg="chinese"] .week-bar.is-today em,
body[data-app-bg="chinese"] .filter-pill.active,
body[data-app-bg="chinese"] .view-toggle button.active,
body[data-app-bg="chinese"] .nav-item.active,
body[data-app-bg="chinese"] .notes-order .sort-btn.is-active,
body[data-app-bg="chinese"] .setting-seg button.active { color: var(--ink); }
body[data-app-bg="night"] .nav-item,
body[data-app-bg="chinese"] .nav-item { color: var(--ink-2); }
body[data-app-bg="night"] .nav-item .icon,
body[data-app-bg="chinese"] .nav-item .icon { color: var(--muted); }
body[data-app-bg="night"] .side-label,
body[data-app-bg="chinese"] .side-label { color: var(--muted); }
body[data-app-bg="night"] .goal-mini-head { color: #817a6d; }
body[data-app-bg="night"] .goal-mini-title { color: #233f35; }
body[data-app-bg="night"] .goal-mini-sub { color: #a9a193; }
body[data-app-bg="chinese"] .goal-mini {
  background: linear-gradient(145deg, #9b372f, #7f241e);
  border-color: rgba(248, 232, 209, .13);
  box-shadow: 0 12px 26px rgba(45, 10, 8, .2), inset 0 1px 0 rgba(255, 238, 212, .06);
}
body[data-app-bg="chinese"] .goal-mini-head { color: var(--muted); }
body[data-app-bg="chinese"] .goal-mini-title { color: var(--ink); }
body[data-app-bg="chinese"] .goal-mini-sub { color: var(--ink-2); }
body[data-app-bg="chinese"] .goal-ring::before { background: #8b2a23; }
body[data-app-bg="night"] .nav-item.active .icon,
body[data-app-bg="chinese"] .nav-item.active .icon { color: var(--accent); }
body.no-scroll { overflow: hidden; padding-right: var(--scrollbar-comp, 0px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(196, 93, 60, .21); }
:focus-visible { outline: 2px solid rgba(196, 93, 60, .65); outline-offset: 3px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

/* ------------------------------------------------------------
   Boot
   ------------------------------------------------------------ */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 251, 243, .95) 0, rgba(247, 243, 235, 0) 45%),
    var(--bg);
  transition: opacity .55s var(--ease), visibility .55s;
}
.boot-screen.is-done { opacity: 0; visibility: hidden; }
.boot-mark { position: relative; width: 58px; height: 46px; margin-bottom: 6px; animation: boot-float 2.6s ease-in-out infinite; }
.boot-page { position: absolute; top: 4px; width: 27px; height: 38px; background: var(--forest); border-radius: 3px 8px 8px 3px; }
.boot-page.left { left: 2px; transform: skewY(5deg); transform-origin: right center; background: #2f4b3f; }
.boot-page.right { right: 2px; transform: skewY(-5deg); transform-origin: left center; background: var(--accent); }
.boot-sun { position: absolute; top: -3px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #f1d9b2; box-shadow: 0 0 0 4px rgba(241, 217, 178, .18); }
.boot-brand { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: .24em; text-indent: .24em; color: var(--forest); }
.boot-copy { color: var(--muted); font-size: 12px; letter-spacing: .12em; display: flex; align-items: center; gap: 3px; }
.boot-dots { display: inline-flex; gap: 3px; margin-left: 3px; }
.boot-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); animation: dot 1.15s infinite ease-in-out; }
.boot-dots i:nth-child(2) { animation-delay: .18s; }
.boot-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes boot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ------------------------------------------------------------
   App shell & sidebar
   ------------------------------------------------------------ */
.app-root { min-height: 100dvh; }
body[data-ui-scale="small"] { --ui-zoom: .92; }
body[data-ui-scale="standard"] { --ui-zoom: 1; }
body[data-ui-scale="large"] { --ui-zoom: 1.08; }
body[data-ui-scale="xlarge"] { --ui-zoom: 1.16; }
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100dvh / var(--ui-zoom, 1)); width: calc(100% / var(--ui-zoom, 1)); zoom: var(--ui-zoom, 1); }
body.is-desktop-host .app-shell { min-height: 100dvh; width: 100%; zoom: 1; }
body.is-desktop-host .sidebar { height: 100dvh; }
.ui-font-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-family: var(--serif); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.ui-font-btn:hover { border-color: var(--accent); color: var(--accent); }
.ui-font-menu .context-item { justify-content: space-between; }
.ui-scale-sample { color: var(--faint); font-family: var(--serif); }
.sidebar {
  position: sticky;
  top: 0;
  height: calc(100dvh / var(--ui-zoom, 1));
  padding: 30px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .58), rgba(255, 253, 248, 0) 34%),
    var(--app-bg, var(--bg));
  border-right: 1px solid var(--line);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; margin-bottom: 34px; }
.brand-mark {
  width: 43px; height: 43px; border-radius: 13px; position: relative; flex: none;
  background: var(--forest);
  box-shadow: 0 7px 16px rgba(35, 63, 53, .18), inset 0 1px 0 rgba(255,255,255,.16);
  display: grid; place-items: center;
  overflow: hidden;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; top: 12px; width: 13px; height: 19px; background: #f2e7d2;
}
.brand-mark::before { left: 7px; border-radius: 2px 5px 5px 2px; transform: skewY(7deg); }
.brand-mark::after { right: 7px; border-radius: 5px 2px 2px 5px; transform: skewY(-7deg); background: #e2a05a; }
.brand-sun { position: absolute; right: 6px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #f5dfb9; z-index: 2; }
.brand-words { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: .16em; color: var(--forest); }
.brand-sub { margin-top: 7px; font-size: 8.5px; letter-spacing: .26em; color: var(--faint); font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 43px; padding: 0 12px; border-radius: 11px;
  color: #655e52; font-size: 13.5px; font-weight: 500;
  transition: background .2s, color .2s, transform .2s;
  position: relative;
}
.nav-item .icon { color: #8e8576; transition: color .2s; }
.nav-item:hover { background: rgba(255, 253, 248, .75); color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--forest); box-shadow: var(--shadow-xs); font-weight: 600; }
.nav-item.active .icon { color: var(--accent); }
.nav-item.active::after { content: ""; position: absolute; right: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; border-radius: 7px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; }
.nav-item.active .nav-count { background: var(--accent-soft); color: var(--accent-deep); margin-right: 14px; }
.side-section { margin-top: 28px; }
.side-label { padding: 0 12px; margin-bottom: 11px; font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; justify-content: space-between; }
.side-label button { font-size: 9px; letter-spacing: .06em; color: var(--accent); opacity: .8; }
.mini-books { display: flex; flex-direction: column; gap: 2px; }
.mini-book { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; text-align: left; transition: background .2s; }
.mini-book:hover { background: rgba(255, 253, 248, .8); }
.mini-cover { display: block; width: 27px; height: 37px; border-radius: 2px 5px 5px 2px; flex: none; box-shadow: 0 2px 5px rgba(35, 30, 21, .18); position: relative; overflow: hidden; background: var(--forest); }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-cover span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); color: #f4ead7; font-size: 12px; }
.mini-info { min-width: 0; flex: 1; }
.mini-title { font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { margin-top: 3px; font-size: 9.5px; color: var(--faint); display: flex; align-items: center; gap: 5px; }
.mini-bar { width: 48px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.sidebar-foot { margin-top: auto; padding-top: 20px; }
.goal-mini {
  padding: 14px; border-radius: 14px; background: linear-gradient(145deg, #fdfaf4, #f0e9dd);
  border: 1px solid rgba(217, 208, 192, .65);
  margin-bottom: 12px;
}
.goal-mini-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.goal-mini-row { display: flex; align-items: center; gap: 11px; }
.goal-ring { --p: 0; width: 38px; height: 38px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; position: relative; }
.goal-ring::before { content: ""; width: 29px; height: 29px; border-radius: 50%; background: #f7f2e8; }
.goal-ring-value { position: absolute; font-size: 8.5px; font-weight: 700; color: var(--accent-deep); }
.goal-mini-copy { min-width: 0; }
.goal-mini-title { font-family: var(--serif); font-size: 15px; color: var(--forest); font-weight: 700; }
.goal-mini-sub { font-size: 9.5px; color: var(--faint); margin-top: 2px; }
.profile-card { display: flex; align-items: center; gap: 10px; padding: 9px 8px 5px; border-top: 1px solid var(--line); }
.avatar { width: 33px; height: 33px; border-radius: 50%; background: var(--forest); color: #f4ead8; display: grid; place-items: center; font-family: var(--serif); font-size: 15px; flex: none; }
.profile-name { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.profile-sub { font-size: 9px; color: var(--faint); margin-top: 2px; }

/* ------------------------------------------------------------
   Main column
   ------------------------------------------------------------ */
.main-column { min-width: 0; }
.main-inner { width: 100%; max-width: 1360px; margin: 0 auto; padding: 30px 40px 58px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.page-title { font-family: var(--serif); font-size: clamp(28px, 2.65vw, 38px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; color: var(--ink); }
.page-title em { font-style: normal; color: var(--accent); }
.page-sub { margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.reminder-header-btn { height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
.reminder-header-btn .icon { width: 14px; height: 14px; }
.reminder-header-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.reminder-header-btn.is-active { color: var(--accent-deep); border-color: rgba(230, 178, 97, .55); background: var(--accent-soft); }
.reminder-menu { min-width: 238px; padding: 8px; }
.reminder-menu-head { padding: 5px 8px 2px; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.reminder-menu-sub { padding: 0 8px 7px; font-size: 9px; color: var(--faint); }
.reminder-current { margin: 0 8px 7px; padding: 5px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-deep); font-size: 9.5px; }
.reminder-time-menu { width: 268px; padding: 10px 10px 8px; }
.reminder-input-row { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 8px 7px; }
.reminder-input-row input { width: 78px; height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(0, 0, 0, .1); color: var(--ink); text-align: center; font-family: var(--serif); font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; transition: border-color .2s, box-shadow .2s; }
.reminder-input-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.reminder-input-row input::-webkit-inner-spin-button, .reminder-input-row input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.reminder-input-colon { font-family: var(--serif); font-size: 20px; color: var(--muted); }
.reminder-wheel-toggle { width: 100%; height: 30px; border: 0; background: none; color: var(--accent-deep); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 10px; font-weight: 600; }
.reminder-wheel-toggle .icon { width: 14px; height: 14px; }
.reminder-wheel-toggle .reminder-chevron { transition: transform .2s var(--ease); }
.reminder-wheel-toggle.is-open .reminder-chevron { transform: rotate(180deg); }
.reminder-wheel-wrap { margin: 4px 4px 0; padding-top: 4px; border-top: 1px solid var(--line); }
.reminder-wheel-wrap[hidden] { display: none; }
.reminder-time-picker { position: relative; height: 150px; margin: 0 2px; display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); align-items: stretch; }
.reminder-picker-band { position: absolute; z-index: 0; left: 2px; right: 2px; top: 60px; height: 30px; border-radius: 7px; background: var(--accent-soft); border-top: 1px solid rgba(230, 178, 97, .2); border-bottom: 1px solid rgba(230, 178, 97, .2); pointer-events: none; }
.reminder-wheel { position: relative; z-index: 1; height: 150px; overflow-y: auto; box-sizing: border-box; padding: 60px 0; scroll-snap-type: y mandatory; scrollbar-width: none; cursor: grab; user-select: none; touch-action: none; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 28%, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 28%, #000 72%, transparent 100%); }
.reminder-wheel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.reminder-wheel::-webkit-scrollbar { display: none; }
.reminder-wheel-item { width: 100%; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; background: none; border: 0; color: var(--muted); font-family: var(--sans); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
.reminder-wheel-item.is-selected { color: var(--ink); font-size: 13px; font-weight: 700; }
.reminder-colon { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 17px; color: var(--muted); }
.reminder-picker-foot { display: flex; align-items: center; gap: 4px; margin-top: 4px; padding: 8px 8px 1px; border-top: 1px solid var(--line); }
.reminder-foot-link { height: 30px; padding: 0 6px; background: none; border: 0; color: var(--muted); font-size: 10px; }
.reminder-foot-link.accent { color: var(--accent-deep); }
.reminder-foot-link.is-muted { opacity: .45; }
.reminder-done-btn { height: 32px; margin-left: auto; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff9f0; font-size: 10.5px; font-weight: 600; }
@media (max-width: 1280px) {
  .reminder-header-btn { width: 40px; padding: 0; justify-content: center; }
  .reminder-header-btn span { display: none; }
}
.search-box {
  width: 224px; height: 40px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 12px;
  transition: border-color .2s, box-shadow .2s, width .25s var(--ease);
}
.search-box:focus-within { border-color: #d2c4af; box-shadow: 0 0 0 3px rgba(196, 93, 60, .07); width: 258px; }
.search-box .icon { color: var(--faint); width: 16px; height: 16px; }
.search-box input { width: 100%; border: 0; background: none; outline: 0; font-size: 12px; }
.search-box input::placeholder { color: var(--faint); }
.search-kbd { font-size: 9px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; color: var(--faint); background: var(--bg); }
.btn {
  height: 40px; padding: 0 16px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: transform .18s, background .18s, box-shadow .18s, border-color .18s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--forest); color: #f8f1e4; box-shadow: 0 5px 14px rgba(35, 63, 53, .18); }
.btn-primary:hover { background: #2b4b3f; box-shadow: 0 7px 18px rgba(35, 63, 53, .24); }
.btn-accent { background: var(--accent); color: #fffaf3; box-shadow: 0 5px 14px rgba(196, 93, 60, .2); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); background: #fffefb; }
.btn-soft { background: var(--surface-2); color: var(--ink-2); }
.btn-soft:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 11px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--muted); transition: background .18s, color .18s, transform .18s;
}
.icon-btn:hover { background: rgba(35, 63, 53, .07); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-on { color: var(--accent); background: var(--accent-soft); }
.avatar-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--forest); font-family: var(--serif); font-size: 15px; }
body[data-app-bg="night"] .avatar-btn,
body[data-app-bg="chinese"] .avatar-btn { color: #f5e5c9; }
body[data-app-bg="chinese"] .ui-font-btn {
  color: var(--accent);
  border-color: rgba(230, 178, 97, .52);
  background: var(--accent-soft);
}
body[data-app-bg="chinese"] .ui-font-btn:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: rgba(230, 178, 97, .24);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.shelf-hero { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(292px, .82fr); gap: 22px; margin-bottom: 36px; }
.continue-card {
  position: relative; min-height: 270px; border-radius: 23px; overflow: hidden;
  background:
    radial-gradient(ellipse at 88% 12%, rgba(226, 160, 90, .23), transparent 42%),
    radial-gradient(ellipse at 0% 100%, rgba(120, 155, 134, .2), transparent 50%),
    linear-gradient(122deg, #1d382f 0%, #29483c 58%, #345648 100%);
  color: #f4eddf;
  padding: 34px 38px;
  display: grid; grid-template-columns: minmax(0, 1fr) 178px; align-items: center; gap: 22px;
  box-shadow: 0 20px 44px rgba(32, 54, 45, .15);
}
.continue-card::before {
  content: ""; position: absolute; width: 430px; height: 430px; border-radius: 50%;
  border: 1px solid rgba(244, 237, 223, .12); right: -140px; top: -200px;
}
.continue-card::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  border: 1px solid rgba(244, 237, 223, .07); right: -80px; top: -150px;
}
.continue-copy { position: relative; z-index: 3; min-width: 0; }
.continue-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; color: rgba(244, 237, 223, .65); margin-bottom: 18px; }
.continue-kicker::before { content: ""; width: 22px; height: 1px; background: #d69a5b; }
.continue-title { font-family: var(--serif); font-size: clamp(30px, 3vw, 41px); font-weight: 700; letter-spacing: .01em; line-height: 1.12; margin-bottom: 8px; }
.continue-chapter { font-size: 11.5px; color: rgba(244, 237, 223, .64); letter-spacing: .02em; }
.continue-quote { margin-top: 18px; max-width: 370px; font-family: var(--serif); font-size: 12.5px; line-height: 1.8; color: rgba(244, 237, 223, .76); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.continue-btn {
  height: 42px; padding: 0 18px 0 20px; border-radius: 11px; background: #f1e7d5; color: #243d33;
  display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(9, 24, 18, .16); transition: background .2s, transform .2s;
}
.continue-btn:hover { background: #fbf3e4; transform: translateY(-1px); }
.continue-btn .icon { width: 16px; height: 16px; transition: transform .2s; }
.continue-btn:hover .icon { transform: translateX(3px); }
.continue-progress { display: flex; align-items: center; gap: 10px; font-size: 10px; color: rgba(244, 237, 223, .55); letter-spacing: .03em; }
.continue-progress strong { color: #f1e7d5; font-weight: 600; }
.progress-track { width: 98px; height: 3px; border-radius: 3px; background: rgba(244, 237, 223, .18); overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: #e3a15d; }
.hero-cover-wrap { position: relative; display: flex; justify-content: center; align-items: center; z-index: 2; }
.hero-cover-halo { position: absolute; width: 190px; height: 190px; border-radius: 50%; background: rgba(226, 160, 90, .13); filter: blur(3px); }
.hero-cover { position: relative; width: 146px; aspect-ratio: 2 / 3; flex: none; transform: rotate(4.5deg); filter: drop-shadow(0 20px 26px rgba(5, 17, 12, .35)); transition: transform .45s var(--ease); }
.hero-cover .book-cover { box-shadow: 0 22px 40px rgba(5, 17, 12, .3), 0 0 0 1px rgba(244, 237, 223, .22); }
.continue-card:hover .hero-cover { transform: rotate(2deg) translateY(-4px); }
.hero-cover .book-cover { aspect-ratio: 2 / 3; }
.hero-bookmark { position: absolute; top: -2px; right: 4px; width: 24px; height: 34px; background: #d9974e; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); z-index: 4; filter: drop-shadow(0 3px 4px rgba(0,0,0,.16)); }
.continue-deco-lines { position: absolute; left: 37%; bottom: -2px; width: 150px; height: 72px; opacity: .2; z-index: 1; }
.continue-deco-lines span { position: absolute; left: 0; right: 0; height: 1px; background: #f1e7d5; border-radius: 50%; }
.continue-deco-lines span:nth-child(1) { bottom: 10px; transform: rotate(-3deg); }
.continue-deco-lines span:nth-child(2) { bottom: 26px; transform: rotate(2deg); opacity: .6; }
.continue-deco-lines span:nth-child(3) { bottom: 42px; transform: rotate(-1deg); opacity: .4; }

/* Weekly insight card */
.insight-card {
  border-radius: 23px; background: var(--surface); border: 1px solid rgba(230, 223, 210, .9);
  padding: 25px 24px 20px; display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden;
}
.insight-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(196, 93, 60, .07), transparent 70%); }
.insight-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.insight-label { font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.insight-period { font-size: 9.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; }
.insight-number { margin-top: 15px; display: flex; align-items: baseline; gap: 7px; }
.insight-number strong { font-family: var(--serif); font-size: 33px; line-height: 1; font-weight: 600; letter-spacing: -.02em; color: var(--forest); }
.insight-number span { font-size: 10.5px; color: var(--faint); }
.insight-sub { margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.week-bars { margin-top: auto; padding-top: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 7px; height: 80px; }
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bar-track { width: 100%; max-width: 18px; height: 52px; border-radius: 5px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.week-bar-fill { width: 100%; border-radius: 5px; background: linear-gradient(180deg, #d99559, #c45d3c); min-height: 0; transition: height .8s var(--ease); }
.week-bar.is-today .week-bar-fill { background: linear-gradient(180deg, #345f4d, #233f35); }
.week-bar em { font-style: normal; font-size: 8.5px; color: var(--faint); }
.week-bar.is-today em { color: var(--forest); font-weight: 700; }
.insight-goal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.insight-goal .goal-ring { width: 32px; height: 32px; }
.insight-goal .goal-ring::before { width: 24px; height: 32px; background: var(--surface); }
.insight-goal-copy { flex: 1; min-width: 0; }
.insight-goal-title { font-size: 10px; font-weight: 600; color: var(--ink-2); }
.insight-goal-sub { margin-top: 2px; font-size: 9px; color: var(--faint); }
.insight-goal .icon { color: var(--gold); width: 17px; height: 17px; }

/* ------------------------------------------------------------
   Shelf section
   ------------------------------------------------------------ */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title-row { display: flex; align-items: baseline; gap: 11px; }
.section-title { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.section-count { font-size: 10.5px; color: var(--faint); }
.section-actions { display: flex; align-items: center; gap: 8px; }
.filter-pills { display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.filter-pill { height: 28px; padding: 0 11px; border-radius: 7px; font-size: 10.5px; color: var(--muted); transition: background .18s, color .18s, box-shadow .18s; }
.filter-pill:hover { color: var(--ink); }
.filter-pill.active { background: var(--surface); color: var(--forest); font-weight: 600; box-shadow: var(--shadow-xs); }
.sort-btn { height: 34px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; background: var(--surface); }
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.view-toggle button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--faint); }
.view-toggle button.active { background: var(--surface-2); color: var(--forest); }
.view-toggle .icon { width: 15px; height: 15px; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 30px 24px; }
.book-grid.is-list { grid-template-columns: 1fr; gap: 10px; }
.book-card { min-width: 0; position: relative; animation: fade-up .45s var(--ease) both; }
.book-card:nth-child(2) { animation-delay: .04s; }
.book-card:nth-child(3) { animation-delay: .08s; }
.book-card:nth-child(4) { animation-delay: .12s; }
.book-card:nth-child(5) { animation-delay: .16s; }
.book-card:nth-child(6) { animation-delay: .2s; }
.book-cover-wrap { position: relative; aspect-ratio: 2 / 3; margin-bottom: 12px; }
.book-cover {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4px 9px 9px 4px; overflow: hidden;
  background: var(--forest); color: #f3ead8; box-shadow: 0 12px 23px rgba(47, 39, 27, .17), 0 2px 5px rgba(47, 39, 27, .1);
  transition: transform .38s var(--ease), box-shadow .38s var(--ease);
  isolation: isolate;
}
.book-cover::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; z-index: 5;
  background: linear-gradient(90deg, rgba(0,0,0,.3), rgba(0,0,0,.03) 52%, rgba(255,255,255,.11) 64%, rgba(0,0,0,.06));
}
.book-cover::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.14), transparent 31%, transparent 80%, rgba(0,0,0,.1));
  mix-blend-mode: soft-light;
}
.book-card:hover .book-cover { transform: translateY(-7px) rotate(-.45deg); box-shadow: 0 22px 38px rgba(47, 39, 27, .23), 0 4px 9px rgba(47, 39, 27, .1); }
.cover-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.cover-art svg { width: 100%; height: 100%; display: block; }
.cover-type { position: absolute; inset: 0; z-index: 3; padding: 14% 13% 11%; display: flex; flex-direction: column; }
.cover-kicker { font-size: 6.2px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; opacity: .62; line-height: 1.4; }
.cover-title { margin-top: auto; font-family: var(--serif); font-size: clamp(18px, 1.48vw, 23px); line-height: 1.14; font-weight: 700; letter-spacing: .04em; max-width: 95%; text-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cover-title.is-en { font-size: clamp(15px, 1.18vw, 19px); letter-spacing: -.015em; line-height: 1.08; }
.cover-title.is-compact { font-size: clamp(14px, 1.16vw, 18px); }
.cover-rule { width: 18px; height: 1px; background: currentColor; opacity: .55; margin: 9px 0 7px; }
.cover-author { font-size: 6.8px; letter-spacing: .1em; opacity: .68; font-weight: 500; }
.cover-seal { position: absolute; right: 11%; bottom: 10%; width: 19px; height: 19px; border: 1px solid currentColor; border-radius: 2px; display: grid; place-items: center; font-family: var(--serif); font-size: 6px; line-height: 1; opacity: .6; transform: rotate(-5deg); z-index: 3; text-align: center; }
.cover-spine-label { position: absolute; left: 2px; top: 16%; writing-mode: vertical-rl; font-size: 5px; letter-spacing: .16em; opacity: .4; z-index: 3; }
.cover-badge {
  position: absolute; top: 9px; left: 9px; z-index: 7; height: 18px; padding: 0 7px; border-radius: 5px;
  background: rgba(255, 251, 243, .88); color: #3c372f; font-size: 7.5px; font-weight: 700; letter-spacing: .08em;
  display: flex; align-items: center; backdrop-filter: blur(4px); box-shadow: 0 2px 5px rgba(0,0,0,.08);
}
.cover-badge.is-new { background: var(--accent); color: #fff9f0; }
.book-menu-btn {
  position: absolute; top: 7px; right: 7px; width: 27px; height: 27px; border-radius: 8px; z-index: 9;
  background: rgba(28, 27, 24, .56); color: #fff; display: grid; place-items: center;
  opacity: 0; transform: translateY(-3px); transition: opacity .2s, transform .2s, background .2s; backdrop-filter: blur(5px);
}
.book-menu-btn .icon { width: 15px; height: 15px; }
.book-card:hover .book-menu-btn, .book-menu-btn:focus-visible { opacity: 1; transform: translateY(0); }
.book-menu-btn:hover { background: rgba(28, 27, 24, .76); }
.book-delete-btn {
  position: absolute; top: 7px; right: 39px; width: 27px; height: 27px; border-radius: 8px; z-index: 9;
  background: rgba(28, 27, 24, .56); color: #fff; display: grid; place-items: center;
  opacity: 0; transform: translateY(-3px); transition: opacity .2s, transform .2s, background .2s; backdrop-filter: blur(5px);
}
.book-delete-btn .icon { width: 14px; height: 14px; }
.book-card:hover .book-delete-btn, .book-delete-btn:focus-visible { opacity: 1; transform: translateY(0); }
.book-delete-btn:hover { background: rgba(126, 32, 26, .88); }
.book-row-actions { display: flex; align-items: center; gap: 5px; grid-column: 3; }
.book-card.is-list .book-delete-btn { opacity: 1; position: static; background: none; color: var(--faint); transform: none; backdrop-filter: none; }
.book-card.is-list .book-delete-btn:hover { color: var(--danger); background: var(--danger-soft); }
.book-hover-cta {
  position: absolute; left: 9px; right: 9px; bottom: 9px; z-index: 8; height: 33px; border-radius: 8px;
  background: rgba(255, 251, 242, .94); color: var(--forest); font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  opacity: 0; transform: translateY(5px); transition: opacity .2s, transform .2s; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.book-hover-cta .icon { width: 13px; height: 13px; }
.book-card:hover .book-hover-cta { opacity: 1; transform: translateY(0); }
.book-info { padding: 0 2px; }
.book-title-row { display: flex; align-items: flex-start; gap: 7px; }
.book-title { font-family: var(--serif); font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.book-author { margin-top: 3px; font-size: 9.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-group-tag { margin-left: 6px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 7px; letter-spacing: .02em; vertical-align: 1px; }
.shelf-group-btn { white-space: nowrap; }
.context-label { padding: 6px 12px 3px; font-size: 7.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.context-group-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 3px 10px 8px; max-height: 92px; overflow-y: auto; }
.group-manager-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.group-manager-row { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.group-manager-name { flex: 1; font-size: 11px; color: var(--ink-2); }
.group-manager-count { font-size: 8.5px; color: var(--faint); }
.group-manager-fixed { font-size: 8px; color: var(--faint); }
.group-manager-delete { width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center; color: var(--faint); }
.group-manager-delete:hover { background: var(--danger-soft); color: var(--danger); }
.group-manager-delete .icon { width: 13px; height: 13px; }
.group-create-row { display: flex; gap: 8px; }
.group-create-row input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink-2); padding: 0 10px; font-size: 10.5px; outline: 0; }
.group-create-row input:focus { border-color: var(--accent); }
.group-create-row input::placeholder { color: var(--faint); opacity: .9; }
.context-group-chip { flex: 1; height: 25px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 8.5px; }
.context-group-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.context-group-chip.active { background: var(--forest); border-color: var(--forest); color: #f7f0e2; }
.context-item.active { color: var(--accent); }
.context-count { margin-left: auto; color: var(--faint); font-size: 8px; }
.book-progress-row { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.book-progress { flex: 1; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.book-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.book-status { font-size: 8.5px; color: var(--faint); flex: none; letter-spacing: .02em; }
.book-status.is-done { color: var(--sage); }
.book-status.is-reading { color: var(--accent); }
.book-card.is-list { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 15px; align-items: center; padding: 10px; border-radius: 13px; border: 1px solid transparent; }
.book-card.is-list:hover { background: var(--surface); border-color: var(--line); }
.book-card.is-list .book-cover-wrap { width: 68px; margin: 0; }
.book-card.is-list .book-cover { position: relative; }
.book-card.is-list .cover-type { padding: 13% 12%; }
.book-card.is-list .cover-title { font-size: 10px; }
.book-card.is-list .cover-kicker, .book-card.is-list .cover-author, .book-card.is-list .cover-seal, .book-card.is-list .cover-spine-label { display: none; }
.book-card.is-list .book-info { display: contents; }
.book-card.is-list .book-info { display: block; grid-column: 2; align-self: center; min-width: 0; }
.book-card.is-list .book-title-row { align-items: center; }
.book-card.is-list .book-title { font-size: 15px; }
.book-card.is-list .book-author { margin-top: 4px; }
.book-card.is-list .book-progress-row { margin-top: 8px; }
.book-card.is-list .book-menu-btn { opacity: 1; position: static; background: none; color: var(--faint); width: 30px; height: 30px; }
.book-card.is-list .book-hover-cta { display: none; }
.book-card.is-list .cover-badge { display: none; }
.add-book-card { border-radius: 16px; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 22px; border: 1.5px dashed #d5cbbb; color: var(--muted); text-align: center; transition: border-color .2s, background .2s, color .2s; background: rgba(255, 253, 248, .37); }
.add-book-card:hover { border-color: var(--accent); background: var(--surface); color: var(--accent-deep); }
.add-book-plus { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--accent); }
.add-book-title { font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.add-book-sub { font-size: 9px; color: var(--faint); line-height: 1.6; max-width: 110px; }
.shelf-empty { padding: 74px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 20px; background: rgba(255, 253, 248, .4); }
.shelf-empty .empty-mark { width: 58px; height: 58px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; margin: 0 auto 15px; color: var(--accent); box-shadow: var(--shadow-sm); }
.shelf-empty h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 7px; }
.shelf-empty p { color: var(--muted); font-size: 11.5px; line-height: 1.8; margin-bottom: 18px; }

/* ------------------------------------------------------------
   Book covers (art themes)
   ------------------------------------------------------------ */
.book-cover[data-theme="island"] { background: #23483d; color: #f2e8d4; }
.book-cover[data-theme="night"] { background: #111a2c; color: #e8e5f2; }
.book-cover[data-theme="notice"] { background: #e9dcc5; color: #25221d; }
.book-cover[data-theme="ink"] { background: #d8ccb7; color: #28231b; }
.book-cover[data-theme="hometown"] { background: #1a2a40; color: #eadfc9; }
.book-cover[data-theme="birds"] { background: #efe1c6; color: #304535; }
.book-cover[data-theme="imported"] { background: #324a40; color: #f3ead7; }
.book-cover.has-image { background: #2a3a32; }
.cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cover-image-shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, transparent 45%, rgba(12, 17, 14, .54) 100%); }
.has-image .cover-type { display: none; }
.has-image .cover-seal { color: rgba(255,255,255,.8); background: rgba(20, 25, 22, .18); backdrop-filter: blur(3px); }
.cover-title.is-long { font-size: clamp(14px, 1.2vw, 18px); }
.cover-title .line { display: block; }
.cover-title .accent { color: #e0a05b; }
.cover-subline { margin-top: 6px; font-family: var(--serif); font-size: 7px; letter-spacing: .1em; opacity: .62; }

/* ------------------------------------------------------------
   Reader
   ------------------------------------------------------------ */
.reader {
  --r-bg: #f2e9d8;
  --r-bg-deep: #e9decb;
  --r-ink: #2b2721;
  --r-ink-soft: #514a3e;
  --r-muted: #8a8171;
  --r-faint: #aaa08d;
  --r-line: rgba(82, 69, 49, .14);
  --r-line-strong: rgba(82, 69, 49, .25);
  --r-surface: #faf3e5;
  --r-surface-2: #eee4d3;
  --r-accent: #a95538;
  --r-accent-soft: rgba(169, 85, 56, .13);
  --r-highlight: rgba(219, 170, 76, .33);
  --r-shadow: rgba(55, 44, 27, .12);
  position: fixed; inset: 0 auto 0 0; width: 100vw; height: 100dvh; z-index: 60; display: flex; flex-direction: column;
  background: var(--r-bg); color: var(--r-ink); overflow: hidden;
  transition: background .35s, color .35s;
}
.reader[data-theme="white"] {
  --r-bg: #fdfdfb; --r-bg-deep: #f4f4f0; --r-ink: #22211e; --r-ink-soft: #4b4944;
  --r-muted: #817d74; --r-faint: #aaa69d; --r-line: rgba(42, 39, 33, .1); --r-line-strong: rgba(42, 39, 33, .2);
  --r-surface: #ffffff; --r-surface-2: #f3f2ed; --r-accent: #a24b34; --r-accent-soft: rgba(162, 75, 52, .1);
}
.reader[data-theme="sage"] {
  --r-bg: #c7d6be; --r-bg-deep: #b9cab0; --r-ink: #28372c; --r-ink-soft: #435446;
  --r-muted: #647663; --r-faint: #899b88; --r-line: rgba(40, 66, 45, .15); --r-line-strong: rgba(40, 66, 45, .26);
  --r-surface: #d3e0cc; --r-surface-2: #bccdb3; --r-accent: #8f4e36; --r-accent-soft: rgba(143, 78, 54, .12);
}
.reader[data-theme="night"] {
  --r-bg: #1b1e1d; --r-bg-deep: #151817; --r-ink: #c9c4b8; --r-ink-soft: #aaa59a;
  --r-muted: #858177; --r-faint: #68645c; --r-line: rgba(231, 225, 211, .11); --r-line-strong: rgba(231, 225, 211, .2);
  --r-surface: #222625; --r-surface-2: #2a2f2d; --r-accent: #c07f5d; --r-accent-soft: rgba(192, 127, 93, .15);
  --r-highlight: rgba(199, 147, 55, .3); color-scheme: dark;
}
.reader::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 248, 232, .32), transparent 46%),
    radial-gradient(ellipse at 88% 100%, rgba(120, 101, 71, .08), transparent 46%);
}
.reader[data-theme="sage"]::before {
  background: radial-gradient(ellipse at 88% 100%, rgba(74, 103, 76, .045), transparent 52%);
}
.reader[data-theme="night"]::before { background: radial-gradient(ellipse at 30% 0%, rgba(90, 100, 94, .18), transparent 50%); }
.reader::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: var(--paper-noise), var(--paper-fibers);
  background-size: 260px 260px, auto, auto;
  opacity: .085; mix-blend-mode: multiply;
}
.reader[data-theme="night"]::after { opacity: .035; mix-blend-mode: screen; }
.reader-top {
  position: relative; z-index: 12; height: 66px; flex: none; padding: 0 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
  border-bottom: 1px solid transparent; transition: border-color .25s, background .25s, transform .3s var(--ease), opacity .3s;
}
.reader.is-scrolled .reader-top { border-bottom-color: var(--r-line); background: color-mix(in srgb, var(--r-bg) 82%, transparent); backdrop-filter: blur(14px); }
.reader-top-left, .reader-top-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.reader-top-left { justify-self: start; }
.reader-top-right { justify-self: end; justify-content: flex-end; }
.reader .icon-btn { color: var(--r-muted); }
.reader .icon-btn:hover { background: var(--r-line); color: var(--r-ink); }
.reader .icon-btn.is-on { color: var(--r-accent); background: var(--r-accent-soft); }
.reader-book-meta { text-align: center; min-width: 0; max-width: min(52vw, 420px); justify-self: center; }
.reader-book-title { font-family: var(--serif); font-size: 13.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-book-sub { margin-top: 2px; font-size: 8.5px; color: var(--r-faint); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-body { position: relative; z-index: 2; flex: 1; display: flex; min-height: 0; }
.reader-page-shell { flex: 1; min-width: 0; display: flex; align-items: stretch; justify-content: center; padding: 8px 0 0; position: relative; }
.reader-page-frame { width: var(--r-page-width, 760px); max-width: min(calc(100vw - 190px), 920px); height: 100%; display: flex; flex-direction: column; min-height: 0; position: relative; }
.reader-page-frame.is-spread { max-width: min(calc(100vw - 110px), 1160px); }
.reader-page-frame.is-dragging { cursor: grabbing; user-select: none; }
.reader.is-pdf .reader-top-right .icon-btn:not([data-action="reader-fullscreen"]) { display: none; }
.reader.is-pdf .reader-page-shell { padding: 0; }
.reader.is-pdf .reader-page-frame { width: 100%; max-width: none; height: 100%; }
.reader.is-pdf .reader-page-viewport { overflow: hidden; }
.reader.is-pdf .page-arrow, .reader.is-pdf .reader-foot { display: none; }
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pdf-error { padding: 40px; text-align: center; color: var(--r-ink-soft); font-size: 13px; }
.reader-page-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.page-flip-sheet {
  position: absolute; inset: 0; z-index: 30; pointer-events: none; overflow: hidden;
  background: var(--r-bg);
  backface-visibility: hidden; transform-style: preserve-3d;
}
.page-flip-curl {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, .17) 0%,
      rgba(0, 0, 0, .03) 15%,
      rgba(255, 255, 255, .08) 56%,
      rgba(0, 0, 0, .03) 84%,
      rgba(0, 0, 0, .16) 100%);
  opacity: .62;
}
.page-flip-sheet.flip-prev .page-flip-curl { transform: scaleX(-1); }
.page-flip-sheet.flip-next { box-shadow: inset -16px 0 24px -20px rgba(24, 14, 8, .4); }
.page-flip-sheet.flip-prev { box-shadow: inset 16px 0 24px -20px rgba(24, 14, 8, .4); }
.reader[data-theme="night"] .page-flip-curl { opacity: .16; }
.reader[data-theme="night"] .page-flip-sheet.flip-next { box-shadow: inset -16px 0 24px -20px rgba(0, 0, 0, .25); }
.reader[data-theme="night"] .page-flip-sheet.flip-prev { box-shadow: inset 16px 0 24px -20px rgba(0, 0, 0, .25); }
.page-flip-mask {
  position: absolute; inset: 0; z-index: 25; pointer-events: none;
  background: var(--r-bg);
}
.reader[data-theme="night"] .page-flip-sheet,
.reader[data-theme="night"] .page-flip-mask {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(90, 100, 94, .18), transparent 50%),
    var(--r-bg);
}
.reader[data-theme="night"] .page-flip-sheet::after,
.reader[data-theme="night"] .page-flip-mask::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--paper-noise), var(--paper-fibers);
  background-size: 260px 260px, auto, auto;
  opacity: .035; mix-blend-mode: screen;
}
.reader.page-turning .reader-foot { opacity: 0; }
.reader-foot { transition: opacity .18s; }
.page-turn-glow {
  position: absolute; inset: -2%; z-index: 6; pointer-events: none; opacity: 0;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 250, 240, .46) 57%, rgba(255, 250, 240, .12) 72%, transparent 88%),
    linear-gradient(90deg, transparent 55%, rgba(55, 44, 27, .16) 100%);
  transform-origin: right center;
}
.page-turn-glow::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 4%; width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 245, .28));
  box-shadow: -18px 0 35px rgba(55, 44, 27, .10);
  transform: skewY(-.6deg);
}
.reader-page-viewport.turn-next .page-turn-glow { animation: page-turn-next .5s var(--ease) both; }
.reader-page-viewport.turn-prev .page-turn-glow { animation: page-turn-prev .5s var(--ease) both; }
@keyframes page-turn-next {
  0% { opacity: 0; transform: translateX(16%) scaleX(.72); }
  24% { opacity: .72; }
  58% { opacity: .36; transform: translateX(-6%) scaleX(1); }
  100% { opacity: 0; transform: translateX(-17%) scaleX(1.02); }
}
@keyframes page-turn-prev {
  0% { opacity: 0; transform: translateX(-16%) scaleX(.72); }
  24% { opacity: .62; }
  58% { opacity: .32; transform: translateX(6%) scaleX(1); }
  100% { opacity: 0; transform: translateX(17%) scaleX(1.02); }
}
.reader-page-viewport.is-scroll .page-turn-glow { display: none; }
.reader-page-viewport.is-spread::after { content: ""; position: absolute; z-index: 4; top: 2%; bottom: 2%; left: 50%; width: 1px; pointer-events: none; background: linear-gradient(180deg, transparent, var(--r-line) 18%, var(--r-line) 82%, transparent); opacity: .55; }
.reader-page-viewport.is-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--r-line-strong) transparent; }
.reader-page-viewport.is-scroll::-webkit-scrollbar { width: 7px; }
.reader-page-viewport.is-scroll::-webkit-scrollbar-thumb { background: var(--r-line-strong); border-radius: 8px; }
.reading-surface {
  height: 100%; column-width: 760px; column-gap: 86px; column-fill: auto;
  transition: transform .34s cubic-bezier(.22, 1, .36, 1); will-change: transform;
  backface-visibility: hidden;
}
.reader-page-viewport.is-scroll .reading-surface { height: auto; column-width: auto; column-gap: 0; transition: none; }
.reader-page-viewport.is-scroll .chapter-head { padding-top: 5vh; }
.chapter-head { break-inside: avoid; padding: 4px 0 28px; }
.chapter-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 9px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--r-accent); }
.chapter-kicker::before { content: ""; width: 19px; height: 1px; background: var(--r-accent); opacity: .55; }
.chapter-title { font-family: var(--r-serif, var(--serif)); font-size: clamp(25px, 2.5vw, 33px); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; color: var(--r-ink); }
.chapter-meta { margin-top: 12px; display: flex; align-items: center; gap: 9px; font-size: 9.5px; color: var(--r-faint); letter-spacing: .02em; }
.chapter-meta span { display: flex; align-items: center; gap: 4px; }
.chapter-meta i { width: 2.5px; height: 2.5px; border-radius: 50%; background: var(--r-faint); opacity: .7; }
.prose {
  font-family: var(--r-serif, var(--serif));
  font-size: var(--r-font-size, 19px);
  line-height: var(--r-line-height, 1.9);
  letter-spacing: var(--r-letter-spacing, .015em);
  color: var(--r-ink-soft); text-align: justify; text-justify: inter-ideograph;
  word-break: break-word; overflow-wrap: break-word;
  font-weight: 600;
}
.prose p { margin: 0 0 calc(var(--r-para-gap, 1.1) * 1em); text-indent: 2em; orphans: 2; widows: 2; }
.prose p, .prose p span, .prose p mark, .prose p em, .prose p i, .prose p strong, .prose p b { font-weight: 600 !important; }
.prose p:last-child { margin-bottom: 0; }
.prose p.lead { text-indent: 0; }
.prose p.lead::first-letter {
  float: left; font-family: var(--r-serif, var(--serif)); font-size: 3.35em; line-height: .8;
  padding: .07em .12em 0 0; color: var(--r-accent); font-weight: 600;
}
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--r-serif, var(--serif)); color: var(--r-ink); font-weight: 600; line-height: 1.35; break-after: avoid; }
.prose h1 { font-size: 1.55em; margin: 1.2em 0 .7em; }
.prose h2 { font-size: 1.28em; margin: 1.3em 0 .6em; }
.prose h3 { font-size: 1.12em; margin: 1.1em 0 .5em; }
.prose h4 { font-size: 1em; margin: 1em 0 .4em; }
.prose blockquote {
  margin: 1.4em 0; padding: .8em 0 .8em 1.25em; border-left: 2px solid var(--r-accent);
  font-size: .92em; line-height: 1.85; color: var(--r-muted); font-style: normal; text-indent: 0;
  break-inside: avoid;
}
.prose blockquote p { text-indent: 0; margin-bottom: .45em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose em, .prose i { font-style: italic; }
.prose strong, .prose b { font-weight: 650; color: var(--r-ink); }
.prose hr { border: 0; height: 1px; background: var(--r-line); margin: 2.2em 0; }
.prose ul, .prose ol { margin: 1em 0 1.2em 1.5em; text-indent: 0; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4em; text-indent: 0; }
.prose img { max-width: 100%; max-height: 52vh; object-fit: contain; margin: 1.2em auto; border-radius: 3px; break-inside: avoid; }
.prose figure { margin: 1.2em 0; text-indent: 0; }
.prose figcaption { margin-top: .4em; font-size: .72em; color: var(--r-faint); text-align: center; font-family: var(--sans); }
.prose a { color: var(--r-accent); text-decoration: underline; text-underline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .82em; margin: 1em 0; font-family: var(--sans); }
.prose th, .prose td { border: 1px solid var(--r-line); padding: .45em .6em; text-indent: 0; }
.prose sup, .prose sub { font-size: .65em; line-height: 0; }
.chapter-end { break-inside: avoid; padding: 42px 0 12px; text-align: center; clear: both; }
.chapter-end-rule { display: flex; align-items: center; gap: 14px; color: var(--r-faint); }
.chapter-end-rule span { flex: 1; height: 1px; background: var(--r-line); }
.chapter-end-rule i { font-style: normal; font-family: var(--serif); font-size: 9px; letter-spacing: .24em; color: var(--r-faint); white-space: nowrap; }
.chapter-next { margin: 20px auto 0; width: min(360px, 100%); padding: 13px 15px; border: 1px solid var(--r-line); border-radius: 11px; background: var(--r-surface); display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; color: var(--r-ink-soft); transition: border-color .2s, background .2s, transform .2s; }
.chapter-next:hover { border-color: var(--r-accent); background: var(--r-surface-2); transform: translateY(-1px); }
.chapter-next span { display: flex; flex-direction: column; gap: 3px; font-family: var(--serif); font-size: 11px; }
.chapter-next em { font-style: normal; font-family: var(--sans); font-size: 8px; letter-spacing: .12em; color: var(--r-faint); }
.chapter-next .icon { width: 15px; height: 15px; color: var(--r-accent); flex: none; }
.reader-page-frame[data-font="sans"] { --r-serif: var(--sans); }
.reader-page-frame[data-font="kai"] { --r-serif: var(--kai); }
.reader-page-frame[data-font="serif"] { --r-serif: var(--serif); }
.tts-active { background: var(--r-accent-soft); border-radius: 2px; box-shadow: 0 0 0 3px var(--r-accent-soft); transition: background .2s; }
::highlight(yeyu-red) { background: rgba(207, 100, 88, .30); color: inherit; }
::highlight(yeyu-orange) { background: rgba(223, 149, 82, .31); color: inherit; }
::highlight(yeyu-yellow) { background: rgba(233, 188, 76, .35); color: inherit; }
::highlight(yeyu-green) { background: rgba(112, 166, 126, .32); color: inherit; }
::highlight(yeyu-blue) { background: rgba(110, 157, 194, .32); color: inherit; }
::highlight(yeyu-pink) { background: rgba(210, 133, 148, .3); color: inherit; }
::highlight(yeyu-purple) { background: rgba(155, 123, 181, .30); color: inherit; }
::highlight(yeyu-red-note) { background: rgba(207, 100, 88, .28); color: inherit; text-decoration: underline; text-decoration-color: rgba(153, 56, 46, .65); text-underline-offset: 3px; }
::highlight(yeyu-orange-note) { background: rgba(223, 149, 82, .28); color: inherit; text-decoration: underline; text-decoration-color: rgba(154, 92, 32, .65); text-underline-offset: 3px; }
::highlight(yeyu-yellow-note) { background: rgba(233, 188, 76, .3); color: inherit; text-decoration: underline; text-decoration-color: rgba(154, 104, 18, .65); text-underline-offset: 3px; }
::highlight(yeyu-green-note) { background: rgba(112, 166, 126, .28); color: inherit; text-decoration: underline; text-decoration-color: rgba(54, 108, 70, .65); text-underline-offset: 3px; }
::highlight(yeyu-blue-note) { background: rgba(110, 157, 194, .28); color: inherit; text-decoration: underline; text-decoration-color: rgba(45, 89, 122, .65); text-underline-offset: 3px; }
::highlight(yeyu-pink-note) { background: rgba(210, 133, 148, .27); color: inherit; text-decoration: underline; text-decoration-color: rgba(142, 69, 84, .6); text-underline-offset: 3px; }
::highlight(yeyu-purple-note) { background: rgba(155, 123, 181, .28); color: inherit; text-decoration: underline; text-decoration-color: rgba(101, 70, 128, .65); text-underline-offset: 3px; }
mark.hl { background: rgba(233, 188, 76, .35); color: inherit; border-radius: 2px; padding: 0 .03em; cursor: pointer; }
mark.hl.red { background: rgba(207, 100, 88, .30); }
mark.hl.orange { background: rgba(223, 149, 82, .31); }
mark.hl.green { background: rgba(112, 166, 126, .32); }
mark.hl.blue { background: rgba(110, 157, 194, .32); }
mark.hl.pink { background: rgba(210, 133, 148, .3); }
mark.hl.purple { background: rgba(155, 123, 181, .30); }
mark.hl.has-note { text-decoration: underline; text-decoration-color: rgba(120, 80, 20, .55); text-underline-offset: 3px; }
::highlight(yeyu-search) { background: rgba(196, 93, 60, .28); color: inherit; }
.hl-popover { padding: 16px 16px 12px; min-width: 330px; max-width: 370px; max-height: min(72vh, 460px); overflow-y: auto; }
.hl-pop-head { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--faint); margin-bottom: 11px; }
.hl-pop-color { margin-left: auto; color: var(--muted); }
.hl-pop-quote { margin: 0; padding: 0 4px 0 12px; border-left: 2px solid var(--line-strong); font-family: var(--serif); font-size: 14px; line-height: 1.85; color: var(--ink-2); max-height: 125px; overflow-y: auto; }
.hl-pop-note { margin: 11px 0 0; padding: 9px 11px; border-radius: 8px; background: var(--bg-deep); font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }
.hl-pop-definition { margin: 11px 0 0; padding: 9px 11px; border-radius: 8px; border-left: 2px solid var(--accent); background: var(--accent-soft); font-size: 11.5px; line-height: 1.8; color: var(--ink-2); max-height: 92px; overflow-y: auto; }
.hl-pop-definition b { margin-right: 8px; color: var(--accent-deep); font-weight: 700; }
.hl-pop-colors { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.hl-color-choice { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; }
.hl-color-choice.red { background: #d76f62; }
.hl-color-choice.orange { background: #e3a15e; }
.hl-color-choice.yellow { background: #e2b44d; }
.hl-color-choice.green { background: #7fb28b; }
.hl-color-choice.blue { background: #77a3c5; }
.hl-color-choice.pink { background: #ce8c99; }
.hl-color-choice.purple { background: #a98bc4; }
.hl-color-choice.is-active { border-color: currentColor; box-shadow: 0 0 0 2px var(--surface); }
.hl-pop-actions { display: flex; gap: 5px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.hl-pop-actions button { height: 31px; padding: 0 9px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
.hl-pop-actions button:hover { background: var(--surface-2); color: var(--ink); }
.hl-pop-actions button:last-child { margin-left: auto; }
.hl-pop-actions button:last-child:hover { color: var(--danger); }
.hl-pop-actions .icon { width: 14px; height: 14px; }
.reader .hl-popover { background: var(--r-surface); border-color: var(--r-line); color: var(--r-ink); }
.reader .hl-popover .hl-pop-head { color: var(--r-muted); }
.reader .hl-popover .hl-pop-quote { color: var(--r-ink-soft); border-left-color: var(--r-line-strong); }
.reader .hl-popover .hl-pop-note { background: var(--r-bg-deep); color: var(--r-ink-soft); }
.reader .hl-popover .hl-pop-definition { background: var(--r-accent-soft); color: var(--r-ink-soft); }
.reader .hl-popover .hl-pop-colors { border-top-color: var(--r-line); }
.reader .hl-popover .hl-pop-actions { border-top-color: var(--r-line); }
.reader .hl-popover .hl-pop-actions button { color: var(--r-muted); }
.reader .hl-popover .hl-pop-actions button:hover { background: var(--r-surface-2); color: var(--r-ink); }
.reader .hl-popover .hl-pop-actions button:last-child:hover { color: #d98b7e; }
.reader .hl-color-choice.is-active { box-shadow: 0 0 0 2px var(--r-surface); }
body.reader-open .toast-stack { bottom: 82px; }
.page-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--r-surface) 62%, transparent);
  border: 1px solid var(--r-line); color: var(--r-muted); display: grid; place-items: center;
  opacity: .24; transition: opacity .2s, background .2s, color .2s, transform .2s; backdrop-filter: blur(8px);
}
.page-arrow:hover { opacity: 1; color: var(--r-ink); background: var(--r-surface); transform: translateY(-50%) scale(1.04); }
.page-arrow:disabled { opacity: .08; pointer-events: none; }
.page-arrow.prev { left: 22px; }
.page-arrow.next { right: 22px; }
.reader-page-shell:hover .page-arrow { opacity: .62; }
.page-edge-hint { position: absolute; top: 50%; font-size: 8px; letter-spacing: .14em; color: var(--r-faint); writing-mode: vertical-rl; opacity: .4; user-select: none; }
.page-edge-hint.left { left: 38px; }
.page-edge-hint.right { right: 38px; }
.reader-foot {
  position: relative; z-index: 12; height: 56px; flex: none; padding: 0 30px;
  display: grid; grid-template-columns: 1fr minmax(200px, 330px) 1fr; align-items: center; gap: 20px;
  border-top: 1px solid transparent; transition: border-color .25s, background .25s, transform .3s var(--ease), opacity .3s;
}
.reader.is-scrolled .reader-foot { border-top-color: var(--r-line); background: color-mix(in srgb, var(--r-bg) 82%, transparent); backdrop-filter: blur(14px); }
.reader-foot-left { font-size: 9px; color: var(--r-faint); display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-foot-left b { font-weight: 600; color: var(--r-muted); }
.reader-foot-center { display: flex; align-items: center; gap: 11px; }
.reader-progress-range { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; cursor: pointer; }
.reader-progress-range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(to right, var(--r-accent) var(--range-p, 0%), var(--r-line-strong) var(--range-p, 0%)); }
.reader-progress-range::-moz-range-track { height: 2px; border-radius: 2px; background: var(--r-line-strong); }
.reader-progress-range::-moz-range-progress { height: 2px; background: var(--r-accent); }
.reader-progress-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 11px; height: 11px; margin-top: -4.5px; border-radius: 50%; background: var(--r-accent); box-shadow: 0 0 0 3px var(--r-bg); transition: transform .15s; }
.reader-progress-range:hover::-webkit-slider-thumb { transform: scale(1.15); }
.reader-progress-range::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--r-accent); }
.reader-foot-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 9px; color: var(--r-faint); white-space: nowrap; }
.reader-foot-right .mode-btn { height: 27px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--r-line); display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--r-muted); }
.reader-foot-right .mode-btn:hover { background: var(--r-surface); color: var(--r-ink); }
.reader-page-number { font-family: var(--serif); font-size: 10px; color: var(--r-muted); letter-spacing: .04em; }
.reader.is-zen .reader-top, .reader.is-zen .reader-foot { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.reader.is-zen .reader-foot { transform: translateY(8px); }
.reader.is-zen .reader-page-shell { padding-top: 0; }
.reader.is-zen::after { content: ""; position: fixed; left: 50%; bottom: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--r-faint); opacity: .35; transform: translateX(-50%); }
.zen-exit { position: fixed; z-index: 20; top: 16px; right: 18px; height: 32px; padding: 0 11px; border-radius: 16px; display: none; align-items: center; gap: 5px; background: color-mix(in srgb, var(--r-surface) 82%, transparent); border: 1px solid var(--r-line); color: var(--r-muted); font-size: 9px; backdrop-filter: blur(10px); opacity: .55; transition: opacity .2s, background .2s; }
.zen-exit .icon { width: 14px; height: 14px; }
.zen-exit:hover { opacity: 1; background: var(--r-surface); color: var(--r-ink); }
.reader.is-zen .zen-exit { display: flex; }
.reader-zen-hint { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 20; font-size: 9px; color: var(--r-faint); background: var(--r-surface); border: 1px solid var(--r-line); border-radius: 20px; padding: 5px 12px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.reader-zen-hint.show { opacity: 1; }

/* ------------------------------------------------------------
   Drawers
   ------------------------------------------------------------ */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(25, 22, 17, .34); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.scrim.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; bottom: 0; width: 386px; max-width: 92vw; z-index: 90;
  background: var(--r-bg, var(--surface)); color: var(--r-ink, var(--ink));
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  transition: transform .42s var(--ease), visibility .42s;
}
.drawer.left { left: 0; transform: translateX(-104%); border-radius: 0 20px 20px 0; }
.drawer.right { right: 0; transform: translateX(104%); border-radius: 20px 0 0 20px; }
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer-head { flex: none; padding: 22px 22px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-title { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.drawer-sub { margin-top: 4px; font-size: 9.5px; color: var(--r-faint, var(--faint)); }
.drawer-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--r-muted, var(--muted)); background: var(--r-line, var(--surface-2)); }
.drawer-close:hover { background: var(--r-line-strong, var(--line-strong)); }
.drawer-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 0 14px 24px; scrollbar-width: thin; }
.drawer-book { display: flex; gap: 14px; align-items: center; padding: 20px 8px 18px; margin: 0 0 8px; border-bottom: 1px solid var(--r-line, var(--line)); }
.drawer-cover { width: 48px; aspect-ratio: 2/3; flex: none; border-radius: 3px 6px 6px 3px; overflow: hidden; box-shadow: 0 6px 13px rgba(35, 29, 21, .2); position: relative; display: grid; place-items: center; background: #324a40; color: #f3ead7; }
.drawer-cover img { width: 100%; height: 100%; object-fit: cover; }
.drawer-cover span { font-family: var(--serif); font-size: 19px; opacity: .86; }
.drawer-cover[data-theme="island"] { background: #23483d; }
.drawer-cover[data-theme="night"] { background: #121a2b; color: #e8e5f2; }
.drawer-cover[data-theme="notice"] { background: #e9dcc5; color: #25221d; }
.drawer-cover[data-theme="ink"] { background: #d8ccb7; color: #28231b; }
.drawer-cover[data-theme="hometown"] { background: #1a2a40; color: #eadfc9; }
.drawer-cover[data-theme="birds"] { background: #efe1c6; color: #304535; }
.drawer-book-title { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.drawer-book-author { margin-top: 3px; font-size: 9px; color: var(--r-faint, var(--faint)); }
.drawer-book-progress { margin-top: 9px; display: flex; align-items: center; gap: 7px; font-size: 8.5px; color: var(--r-muted, var(--muted)); }
.drawer-tabs { display: flex; gap: 4px; padding: 12px 8px 10px; position: sticky; top: 0; background: var(--r-bg, var(--surface)); z-index: 2; }
.drawer-tab { flex: 1; height: 32px; border-radius: 8px; font-size: 10px; color: var(--r-muted, var(--muted)); display: flex; align-items: center; justify-content: center; gap: 5px; transition: background .2s, color .2s; }
.drawer-tab:hover { background: var(--r-line, var(--surface-2)); }
.drawer-tab.active { background: var(--r-surface-2, var(--surface-2)); color: var(--r-ink, var(--ink)); font-weight: 600; }
.toc-list { padding: 2px 0 20px; }
.toc-item { width: 100%; display: flex; align-items: flex-start; gap: 11px; text-align: left; padding: 11px 10px; border-radius: 9px; transition: background .18s; }
.toc-item:hover { background: var(--r-line, var(--surface-2)); }
.toc-item.active { background: var(--r-accent-soft, var(--accent-soft)); }
.toc-index { flex: none; width: 20px; font-family: var(--serif); font-size: 9px; color: var(--r-faint, var(--faint)); padding-top: 2px; }
.toc-copy { flex: 1; min-width: 0; display: block; }
.toc-name { display: block; font-family: var(--serif); font-size: 12px; line-height: 1.5; color: var(--r-ink-soft, var(--ink-2)); }
.toc-page { display: block; }
.toc-item.active .toc-name { color: var(--r-accent, var(--accent-deep)); font-weight: 600; }
.toc-page { margin-top: 3px; font-size: 8px; color: var(--r-faint, var(--faint)); }
.toc-current { width: 5px; height: 5px; border-radius: 50%; background: var(--r-accent, var(--accent)); margin-top: 6px; flex: none; }
.toc-empty, .panel-empty { padding: 48px 20px; text-align: center; color: var(--r-faint, var(--faint)); font-size: 10.5px; line-height: 1.8; }
.toc-empty .icon, .panel-empty .icon { width: 28px; height: 28px; margin: 0 auto 10px; opacity: .45; }
.bookmark-item, .highlight-item { padding: 13px 10px; border-radius: 10px; border-bottom: 1px solid var(--r-line, var(--line)); }
.bookmark-item { display: flex; gap: 10px; align-items: flex-start; }
.bookmark-mark { width: 3px; align-self: stretch; border-radius: 2px; background: var(--r-accent, var(--accent)); flex: none; }
.bookmark-copy { flex: 1; min-width: 0; }
.bookmark-title { font-size: 11px; font-weight: 600; color: var(--r-ink-soft, var(--ink-2)); }
.bookmark-meta { margin-top: 3px; font-size: 8.5px; color: var(--r-faint, var(--faint)); display: flex; gap: 6px; }
.bookmark-actions, .highlight-actions { display: flex; gap: 2px; }
.mini-icon-btn { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--r-faint, var(--faint)); }
.mini-icon-btn:hover { background: var(--r-line, var(--surface-2)); color: var(--r-ink, var(--ink)); }
.mini-icon-btn .icon { width: 14px; height: 14px; }
.highlight-item { display: block; text-align: left; width: 100%; }
.highlight-item:hover { background: var(--r-line, var(--surface-2)); }
.highlight-quote { font-family: var(--serif); font-size: 11.5px; line-height: 1.7; color: var(--r-ink-soft, var(--ink-2)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.highlight-note { margin-top: 6px; padding-left: 8px; border-left: 2px solid var(--r-line-strong, var(--line-strong)); font-size: 9px; color: var(--r-muted, var(--muted)); line-height: 1.65; }
.highlight-meta { margin-top: 7px; display: flex; align-items: center; gap: 6px; font-size: 8px; color: var(--r-faint, var(--faint)); }
.highlight-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.highlight-dot.red { background: #cf6458; }
.highlight-dot.orange { background: #df9552; }
.highlight-dot.yellow { background: #d7a83e; }
.highlight-dot.green { background: #77a983; }
.highlight-dot.blue { background: #6c99b9; }
.highlight-dot.pink { background: #c78491; }
.highlight-dot.purple { background: #9b7bb5; }

/* Settings panel */
.settings-panel { padding: 0 22px 28px; }
.settings-intro { margin-top: 18px; font-size: 10px; line-height: 1.8; color: var(--r-muted, var(--muted)); }
.settings-block { padding: 19px 0; border-bottom: 1px solid var(--r-line, var(--line)); }
.settings-block:last-child { border-bottom: 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.settings-key { font-size: 11px; font-weight: 600; color: var(--r-ink-soft, var(--ink-2)); }
.settings-hint { margin-top: 3px; font-size: 8.5px; color: var(--r-faint, var(--faint)); line-height: 1.5; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.theme-choice { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--r-line, var(--line)); padding: 8px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; transition: border-color .2s, transform .2s; }
.theme-choice:hover { transform: translateY(-1px); }
.theme-choice.active { border-color: var(--r-accent, var(--accent)); box-shadow: 0 0 0 2px var(--r-accent-soft, var(--accent-soft)); }
.theme-choice .aa { font-family: var(--serif); font-size: 19px; line-height: 1; }
.theme-choice .name { font-size: 8px; }
.theme-choice.paper { background: #f4eee2; color: #2b2721; }
.theme-choice.white { background: #fff; color: #222; }
.theme-choice.sage { background: #e7eee5; color: #26332b; }
.theme-choice.night { background: #1b1e1d; color: #c8c3b7; }
.theme-choice .tick { position: absolute; right: 5px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--r-accent, var(--accent)); color: #fff; display: none; place-items: center; }
.theme-choice.active .tick { display: grid; }
.theme-choice .tick .icon { width: 8px; height: 8px; stroke-width: 2.6; }
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--r-surface-2, var(--surface-2)); margin-top: 10px; }
.segmented button { flex: 1; height: 29px; border-radius: 6px; font-size: 9.5px; color: var(--r-muted, var(--muted)); }
.segmented button.active { background: var(--r-surface, var(--surface)); color: var(--r-ink, var(--ink)); font-weight: 600; box-shadow: var(--shadow-xs); }
.range-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.range-row input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 20px; background: transparent; }
.range-row input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--r-line-strong, var(--line-strong)); }
.range-row input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--r-line-strong, var(--line-strong)); }
.range-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--r-accent, var(--accent)); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.range-row input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--r-accent, var(--accent)); }
.range-value { min-width: 38px; text-align: right; font-size: 9px; color: var(--r-faint, var(--faint)); font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 2px; border: 1px solid var(--r-line, var(--line)); border-radius: 8px; padding: 2px; }
.stepper button { width: 28px; height: 27px; border-radius: 6px; display: grid; place-items: center; color: var(--r-muted, var(--muted)); }
.stepper button:hover { background: var(--r-line, var(--surface-2)); }
.stepper span { min-width: 36px; text-align: center; font-size: 10px; color: var(--r-ink-soft, var(--ink-2)); font-variant-numeric: tabular-nums; }
.settings-actions { display: flex; gap: 8px; margin-top: 20px; }
.settings-actions .btn { flex: 1; }
.reader .btn-ghost { background: var(--r-surface); border-color: var(--r-line); color: var(--r-muted); }
.reader .btn-primary { background: var(--r-accent); color: #fff9f1; box-shadow: none; }

/* ------------------------------------------------------------
   Search modal, selection popup, TTS
   ------------------------------------------------------------ */
.modal-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(25, 22, 17, .4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 540px; max-height: min(84vh, 760px); background: var(--r-surface, var(--surface)); color: var(--r-ink, var(--ink)); border-radius: 21px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.55); display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(10px) scale(.985); transition: transform .32s var(--ease);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); }
.modal.is-wide { max-width: 660px; }
.modal.is-narrow { max-width: 420px; }
.modal-head { flex: none; padding: 22px 24px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-title { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; color: var(--r-ink, var(--ink)); }
.modal-sub { margin-top: 4px; font-size: 10.5px; color: var(--r-ink-soft, var(--muted)); line-height: 1.6; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--r-muted, var(--muted)); background: var(--r-surface-2, var(--surface-2)); flex: none; }
.modal-close:hover { background: var(--r-surface-3, var(--surface-3)); color: var(--r-ink, var(--ink)); }
.modal-body { padding: 6px 24px 24px; overflow-y: auto; }
.modal-foot { flex: none; padding: 16px 24px 20px; border-top: 1px solid var(--r-line, var(--line)); display: flex; justify-content: flex-end; gap: 9px; }
.modal .btn-danger { background: #c94f43; color: #fff8f2; border: 1px solid rgba(255, 240, 224, .28); }
.modal .btn-danger:hover { background: #a63a31; color: #fff; }
.search-modal { max-width: 680px; max-height: 80vh; }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.search-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-input-wrap .icon { color: var(--faint); width: 18px; height: 18px; }
.search-input-wrap input { width: 100%; border: 0; outline: 0; background: none; font-size: 14px; padding: 7px 0; }
.search-input-wrap kbd { font-size: 9px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; background: var(--surface); }
.search-summary { padding: 12px 2px 8px; font-size: 9.5px; color: var(--faint); display: flex; justify-content: space-between; }
.search-results { max-height: 50vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.search-result { display: block; width: 100%; text-align: left; padding: 12px 13px; border-radius: 10px; transition: background .16s; }
.search-result:hover { background: var(--surface-2); }
.search-result + .search-result { border-top: 1px solid var(--line); border-radius: 0; }
.search-result-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; font-weight: 600; color: var(--ink-2); }
.search-result-title span { font-weight: 400; color: var(--faint); font-size: 8.5px; }
.search-snippet { margin-top: 5px; font-family: var(--serif); font-size: 11.5px; line-height: 1.7; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-snippet mark { background: var(--accent-soft); color: var(--accent-deep); padding: 0 2px; border-radius: 2px; }
.search-empty { padding: 42px 20px; text-align: center; color: var(--faint); font-size: 11px; line-height: 1.8; }
.search-empty .icon { width: 30px; height: 30px; margin: 0 auto 10px; opacity: .4; }
.reader .search-input-wrap, .reader .search-results, .reader .search-modal { background: var(--r-surface); color: var(--r-ink); }
.reader .modal { background: var(--r-surface); color: var(--r-ink); border-color: var(--r-line); }
.reader .modal-close { background: var(--r-surface-2); color: var(--r-muted); }
.reader .search-input-wrap { background: var(--r-bg); border-color: var(--r-line); }
.reader .search-input-wrap input { color: var(--r-ink); }
.reader .search-result:hover { background: var(--r-surface-2); }
.reader .search-result + .search-result { border-color: var(--r-line); }
.reader .search-result-title { color: var(--r-ink-soft); }
.reader .search-snippet { color: var(--r-muted); }
.reader .search-snippet mark { background: var(--r-accent-soft); color: var(--r-accent); }
.selection-menu {
  position: fixed; z-index: 150; display: flex; align-items: center; gap: 2px;
  background: #24221e; color: #f3ede2; border-radius: 11px; padding: 5px; box-shadow: 0 12px 35px rgba(20,17,12,.32);
  transform: translate(-50%, -100%) scale(.96); transform-origin: bottom center; opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s, visibility .15s;
}
.selection-menu.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -100%) scale(1); }
.selection-menu.is-below { transform: translate(-50%, 0) scale(.96); transform-origin: top center; }
.selection-menu.is-below.is-open { transform: translate(-50%, 0) scale(1); }
.selection-menu.is-below::after { bottom: auto; top: -5px; }
.sel-action { height: 31px; padding: 0 9px; border-radius: 7px; display: flex; align-items: center; gap: 5px; font-size: 10px; color: #e9e2d6; white-space: nowrap; }
.sel-action:hover { background: rgba(255,255,255,.1); }
.sel-action .icon { width: 14px; height: 14px; }
.sel-divider { width: 1px; height: 18px; background: rgba(255,255,255,.16); margin: 0 3px; }
.sel-colors { display: flex; align-items: center; gap: 5px; padding: 0 7px; }
.sel-color { width: 15px; height: 15px; border-radius: 50%; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.sel-color:hover, .sel-color.active { transform: scale(1.16); border-color: #fff; }
.sel-color.red { background: #d76f62; }
.sel-color.orange { background: #e3a15e; }
.sel-color.yellow { background: #e2b44d; }
.sel-color.green { background: #7fb28b; }
.sel-color.blue { background: #77a3c5; }
.sel-color.pink { background: #ce8c99; }
.sel-color.purple { background: #a98bc4; }
.selection-menu::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #24221e; transform: translateX(-50%) rotate(45deg); border-radius: 1px; }
.tts-pill {
  position: fixed; z-index: 100; bottom: 72px; left: 50%; transform: translateX(-50%) translateY(8px);
  height: 46px; border-radius: 23px; background: #24221e; color: #f6efe2; padding: 0 7px 0 15px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 14px 34px rgba(20,17,12,.25);
  opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s;
}
.tts-pill.is-open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.tts-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.tts-wave i { width: 2px; height: 6px; border-radius: 2px; background: #d99a5d; animation: wave 1s ease-in-out infinite; }
.tts-wave i:nth-child(2) { animation-delay: .12s; height: 11px; }
.tts-wave i:nth-child(3) { animation-delay: .24s; height: 8px; }
.tts-wave i:nth-child(4) { animation-delay: .36s; height: 13px; }
.tts-wave i:nth-child(5) { animation-delay: .48s; height: 5px; }
.tts-pill.is-paused .tts-wave i { animation-play-state: paused; opacity: .5; }
@keyframes wave { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1.25); } }
.tts-copy { max-width: 220px; min-width: 0; }
.tts-title { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tts-sub { font-size: 8px; color: rgba(246,239,226,.5); margin-top: 1px; }
.tts-controls { display: flex; align-items: center; gap: 1px; }
.tts-btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #f0e8da; }
.tts-btn:hover { background: rgba(255,255,255,.1); }
.tts-btn .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------
   Notes view
   ------------------------------------------------------------ */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.view-head-actions { display: flex; gap: 8px; align-items: center; }
.notes-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.notes-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: border-color .2s, background .2s, color .2s; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--forest); border-color: var(--forest); color: #f7f0e2; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.notes-toolbar-right { display: flex; align-items: center; gap: 7px; }
.notes-toolbar-right .notes-search { width: 170px; }
.notes-sort-wrap { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); flex: none; }
.notes-sort-wrap .icon { width: 14px; height: 14px; color: var(--faint); }
.notes-sort-select { appearance: none; border: 0; outline: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 0 10px 0 0; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 3px) 14px, calc(100% - 1px) 14px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.notes-sort-select:focus { color: var(--ink); }
.notes-search { display: flex; align-items: center; gap: 7px; width: 210px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 0 10px; }
.notes-search input { width: 100%; border: 0; outline: 0; background: none; font-size: 10.5px; }
.notes-search .icon { width: 14px; height: 14px; color: var(--faint); }
.chip-label { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-sort, .notes-labels { height: 34px; }
.notes-order { display: flex; align-items: center; gap: 0; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.notes-order .sort-btn { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; box-shadow: none; }
.notes-order .sort-btn.is-active { background: var(--surface); color: var(--forest); font-weight: 600; box-shadow: var(--shadow-xs); }
.notes-books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 30px 24px; padding-top: 2px; }
.note-book-card { min-width: 0; cursor: pointer; animation: fade-up .45s var(--ease) both; }
.note-book-cover { position: relative; aspect-ratio: 2 / 3; margin-bottom: 12px; display: block; }
.note-book-cover .book-cover { position: absolute; }
.note-book-card:hover .book-cover { transform: translateY(-7px) rotate(-.45deg); box-shadow: 0 22px 38px rgba(47, 39, 27, .23), 0 4px 9px rgba(47, 39, 27, .1); }
.note-book-cover .cover-badge { top: 9px; right: 9px; left: auto; }
.note-book-info { display: block; padding: 0 2px; }
.note-book-kicker { font-size: 7.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.note-book-title { font-family: var(--serif); font-size: 14px; line-height: 1.35; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-book-author { margin-top: 3px; font-size: 9.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-book-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 8px; color: var(--faint); }
.note-book-meta span + span::before { content: "\00B7"; margin-right: 8px; }
.notes-books-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 32px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 9px; color: var(--faint); }
.notes-labels-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9.5px; }
.notes-labels-link:hover { color: var(--accent); }
.notes-labels-link .icon { width: 13px; height: 13px; }
.notes-back { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 19px; color: var(--muted); font-size: 10px; }
.notes-back:hover { color: var(--accent); }
.notes-back .icon { width: 13px; height: 13px; }
.book-notes-head { display: flex; align-items: flex-end; gap: 22px; padding-bottom: 24px; margin-bottom: 4px; }
.book-notes-cover { width: 104px; flex: none; aspect-ratio: 2 / 3; position: relative; }
.book-notes-cover .book-cover { position: absolute; }
.book-notes-copy { min-width: 0; flex: 1; }
.book-notes-copy .page-title { font-size: clamp(28px, 2.8vw, 39px); }
.book-notes-actions { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.book-notes-progress { font-size: 9px; color: var(--faint); }
.color-label-list { display: flex; flex-direction: column; gap: 9px; }
.color-label-row { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.color-label-swatch { width: 17px; height: 17px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(60, 50, 36, .12); }
.color-label-copy { flex: 1; min-width: 0; }
.color-label-copy > span { display: block; font-size: 8px; color: var(--faint); margin-bottom: 3px; letter-spacing: .04em; }
.color-label-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; outline: 0; padding: 3px 0; font-size: 11px; color: var(--ink-2); }
.color-label-input:focus { border-bottom-color: var(--accent); }
.color-label-input::placeholder { color: var(--faint); }
.color-label-reset { flex: none; font-size: 8.5px; color: var(--faint); padding: 4px 2px; }
.color-label-reset:hover { color: var(--accent); }
.color-label-delete { flex: none; font-size: 8.5px; color: var(--danger); padding: 4px 2px; }
.color-add-row { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.color-add-row input[type="color"] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; flex: none; }
.color-add-row #new-color-label { flex: 1; min-width: 0; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 10px; outline: none; }
.color-add-row #new-color-label:focus { border-color: var(--accent); }
.color-add-row .btn { flex: none; height: 30px; padding: 0 10px; font-size: 9.5px; }
.color-restore-defaults { margin-top: 10px; color: var(--accent); font-size: 9px; text-decoration: underline; text-underline-offset: 3px; }
.color-label-hint { margin-top: 12px; font-size: 9px; line-height: 1.7; color: var(--faint); }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.notes-grid.is-single { grid-template-columns: 1fr; }
.note-book-group { margin-bottom: 30px; }
.note-book-group + .note-book-group { border-top: 1px dashed var(--line-strong); padding-top: 24px; }
.note-group-head { display: flex; align-items: center; gap: 13px; padding: 2px 2px 13px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.note-group-cover { width: 40px; border-radius: 3px 7px 7px 3px; }
.note-group-cover span { font-size: 15px; }
.note-group-copy { flex: 1; min-width: 0; }
.note-group-kicker { font-size: 8px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.note-group-title { font-family: var(--serif); font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.note-group-title span { margin-left: 7px; font-family: var(--sans); font-size: 10px; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.note-group-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; font-size: 8.5px; color: var(--muted); }
.note-group-meta span + span::before { content: "\00B7"; margin-right: 9px; color: var(--faint); }
.note-group-open { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; flex: none; transition: border-color .2s, background .2s, color .2s; }
.note-group-open:hover { border-color: var(--line-strong); background: var(--bg); color: var(--ink-2); }
.note-group-open .icon { width: 13px; height: 13px; }
.note-card.is-grouped .note-head { margin-bottom: 10px; }
.note-chapter-label { font-size: 8.5px; letter-spacing: .05em; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 40px); }
.note-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 21px 22px 17px; box-shadow: var(--shadow-xs); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  overflow: hidden;
}
.note-card::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 2px; border-radius: 2px; background: var(--note-color, var(--accent)); opacity: .6; }
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #ddd3c3; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.note-book { display: flex; align-items: center; gap: 8px; min-width: 0; }
.note-book-mark { width: 23px; height: 31px; border-radius: 2px 4px 4px 2px; flex: none; box-shadow: 0 2px 5px rgba(35,30,21,.18); position: relative; overflow: hidden; }
.note-book-mark img { width: 100%; height: 100%; object-fit: cover; }
.note-book-mark span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); color: #f4ead7; font-size: 10px; }
.note-book-title { font-size: 10px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-chapter { margin-top: 2px; font-size: 8px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.note-menu { color: var(--faint); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.note-menu:hover { background: var(--surface-2); color: var(--ink); }
.note-menu .icon { width: 14px; height: 14px; }
.note-quote { font-family: var(--serif); font-size: 15px; font-weight: 500; line-height: 1.85; color: var(--ink-2); letter-spacing: .01em; text-wrap: balance; }
.note-quote::before { content: "\201C"; color: var(--accent); opacity: .55; margin-right: 1px; }
.note-quote::after { content: "\201D"; color: var(--accent); opacity: .55; margin-left: 1px; }
.note-thought { margin-top: 14px; padding: 11px 13px; border-radius: 9px; background: var(--bg); font-size: 11.5px; line-height: 1.85; color: var(--ink-2); display: flex; gap: 8px; }
.note-thought .icon { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--accent); opacity: .6; }
.note-definition { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border-left: 2px solid var(--accent); background: var(--accent-soft); font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }
.note-definition b { color: var(--accent-deep); font-weight: 700; }
.note-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.note-date { font-size: 8.5px; color: var(--faint); display: flex; align-items: center; gap: 7px; }
.note-jump { font-size: 9px; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; opacity: .85; }
.note-jump:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.note-jump .icon { width: 11px; height: 11px; }
.note-menu-colors { display: flex; flex-wrap: wrap; gap: 7px; padding: 5px 10px 9px; }
.note-menu-color { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.note-menu-color:hover { transform: scale(1.12); }
.note-menu-color.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.notes-empty { grid-column: 1 / -1; padding: 78px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 18px; background: rgba(255,253,248,.5); }
.notes-empty .empty-icon { width: 56px; height: 56px; border-radius: 17px; background: var(--surface); display: grid; place-items: center; margin: 0 auto 14px; color: var(--accent); box-shadow: var(--shadow-sm); }
.notes-empty h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.notes-empty p { font-size: 10.5px; color: var(--muted); line-height: 1.8; }

/* ------------------------------------------------------------
   Stats view
   ------------------------------------------------------------ */
.stats-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 19px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -24px; bottom: -30px; width: 80px; height: 80px; border-radius: 50%; background: var(--stat-tint, var(--surface-2)); opacity: .45; }
.stat-icon { width: 31px; height: 31px; border-radius: 9px; background: var(--stat-tint, var(--surface-2)); color: var(--stat-color, var(--forest)); display: grid; place-items: center; margin-bottom: 15px; }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-value { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.stat-value small { font-family: var(--sans); font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-label { margin-top: 7px; font-size: 9px; letter-spacing: .06em; color: var(--faint); }
.stat-foot { margin-top: 10px; font-size: 8.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat-foot .up { color: var(--sage); font-weight: 600; }
.stats-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr); gap: 18px; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 23px; box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-title { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.panel-sub { margin-top: 4px; font-size: 9px; color: var(--faint); }
.panel-tag { font-size: 8.5px; border-radius: 20px; padding: 4px 9px; background: var(--surface-2); color: var(--muted); }
.big-chart { height: 210px; display: flex; align-items: flex-end; gap: 11px; padding: 12px 2px 0; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; position: relative; }
.chart-col .bar-track { width: 100%; max-width: 45px; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.chart-col .bar-fill { width: 100%; max-width: 36px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #d39a69, #c45d3c); min-height: 3px; position: relative; transition: height .7s var(--ease); }
.chart-col.is-today .bar-fill { background: linear-gradient(180deg, #3d6553, #233f35); }
.chart-col .bar-value { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 8px; color: var(--muted); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.chart-col:hover .bar-value { opacity: 1; }
.chart-col .bar-label { font-size: 8.5px; color: var(--faint); flex: none; }
.chart-col.is-today .bar-label { color: var(--forest); font-weight: 700; }
.chart-grid { position: absolute; inset: 0 0 20px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { display: block; height: 1px; background: var(--line); opacity: .55; }
.chart-wrap { position: relative; }
.heatmap-panel .heatmap { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 4px; margin: 4px 0 12px; overflow-x: auto; padding-bottom: 4px; }
.heat-cell { width: 11px; height: 11px; border-radius: 2.5px; background: #eee8dd; }
.heat-cell.l1 { background: #f0d9c6; } .heat-cell.l2 { background: #e2b294; } .heat-cell.l3 { background: #d1845f; } .heat-cell.l4 { background: #b75c3e; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 8px; color: var(--faint); }
.heat-legend .heat-cell { width: 9px; height: 9px; }
.heatmap-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.heatmap-summary div { display: flex; flex-direction: column; gap: 3px; }
.heatmap-summary div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.heatmap-summary b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1; }
.heatmap-summary span { font-size: 8.5px; color: var(--faint); }
.heatmap-quote { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--line); font-family: var(--serif); font-size: 10.5px; line-height: 1.8; color: var(--muted); }
.book-dist { display: flex; flex-direction: column; gap: 15px; }
.dist-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dist-cover { width: 25px; height: 34px; border-radius: 2px 4px 4px 2px; overflow: hidden; position: relative; box-shadow: 0 2px 5px rgba(35,30,21,.16); }
.dist-cover .book-cover { position: relative; }
.dist-cover .cover-title, .dist-cover .cover-kicker, .dist-cover .cover-author, .dist-cover .cover-rule, .dist-cover .cover-seal, .dist-cover .cover-spine-label { display: none; }
.dist-copy { min-width: 0; }
.dist-title { font-size: 10px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-bar { height: 3px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.dist-value { font-size: 8.5px; color: var(--faint); }
.stats-footnote { margin-top: 18px; display: flex; align-items: center; gap: 6px; font-size: 8.5px; color: var(--faint); justify-content: center; }
.stats-footnote .icon { width: 12px; height: 12px; }

/* ------------------------------------------------------------
   Settings view
   ------------------------------------------------------------ */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; box-shadow: var(--shadow-xs); margin-bottom: 18px; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.settings-card-title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.settings-card-sub { margin-top: 4px; font-size: 9.5px; color: var(--faint); line-height: 1.6; }
.setting-line { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 15px 0; border-top: 1px solid var(--line); }
.setting-line:first-of-type { border-top: 0; padding-top: 0; }
.setting-copy { min-width: 0; }
.setting-name { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.setting-desc { margin-top: 3px; font-size: 9px; color: var(--faint); line-height: 1.6; }
.setting-control { flex: none; }
.speed-range-field { display: flex; align-items: center; gap: 7px; }
.speed-range-field input { width: 66px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink-2); font-size: 11px; text-align: right; padding: 0 9px; outline: 0; }
.speed-range-field input:focus { border-color: var(--accent); }
.speed-range-field span { font-size: 8.5px; color: var(--faint); }
.setting-note { margin: 2px 0 15px; padding: 0 2px; font-size: 9px; line-height: 1.7; color: var(--faint); }
.app-bg-choices { display: flex; align-items: center; gap: 7px; }
.app-bg-choice { width: 25px; height: 25px; border-radius: 50%; background: var(--swatch); border: 1px solid rgba(72, 58, 38, .14); box-shadow: inset 0 1px 2px rgba(255,255,255,.45); transition: transform .2s, box-shadow .2s; }
.app-bg-choice:hover { transform: translateY(-1px); }
.app-bg-choice.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }
.setting-select { height: 34px; min-width: 124px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 0 30px 0 10px; font-size: 10.5px; color: var(--ink-2); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.setting-seg { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); }
.setting-seg button { height: 28px; padding: 0 10px; border-radius: 6px; font-size: 9.5px; color: var(--muted); }
.setting-seg button.active { background: var(--surface); color: var(--forest); font-weight: 600; box-shadow: var(--shadow-xs); }
.setting-themes { display: flex; gap: 7px; }
.setting-theme { width: 29px; height: 29px; border-radius: 50%; border: 2px solid transparent; position: relative; box-shadow: inset 0 0 0 1px rgba(80, 67, 48, .13); }
.setting-theme.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.setting-theme.paper { background: #f4eee2; } .setting-theme.white { background: #fff; border: 1px solid var(--line); } .setting-theme.sage { background: #e7eee5; } .setting-theme.night { background: #1b1e1d; }
.goal-setting { display: flex; align-items: center; gap: 14px; }
.goal-setting input { width: 150px; }
.goal-setting input[type="range"], .settings-card input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 20px; background: transparent; cursor: pointer;
}
.goal-setting input[type="range"]::-webkit-slider-runnable-track, .settings-card input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px; background: var(--surface-3);
}
.goal-setting input[type="range"]::-moz-range-track, .settings-card input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 4px; background: var(--surface-3);
}
.goal-setting input[type="range"]::-webkit-slider-thumb, .settings-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; margin-top: -5.5px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(56, 46, 31, .22);
}
.goal-setting input[type="range"]::-moz-range-thumb, .settings-card input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}
.goal-big { font-family: var(--serif); font-size: 20px; color: var(--forest); min-width: 55px; text-align: right; }
.goal-big small { font-family: var(--sans); font-size: 8px; color: var(--faint); }
.toggle { width: 38px; height: 22px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; left: 3px; top: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: transform .2s; }
.toggle.is-on { background: var(--forest); }
.toggle.is-on::after { transform: translateX(16px); }
.danger-zone { border-color: #ead7d2; }
.danger-zone .settings-card-title { color: var(--danger); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.storage-meter { margin-top: 16px; }
.storage-meter-head { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--faint); margin-bottom: 6px; }
.storage-meter-track { height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.storage-meter-track i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--sage), var(--forest)); }
.about-card { background: linear-gradient(145deg, #223e34, #2e4e40); color: #f3ead9; border: 0; position: relative; overflow: hidden; }
.about-card::after { content: ""; position: absolute; right: -36px; top: -50px; width: 180px; height: 180px; border: 1px solid rgba(243,234,217,.13); border-radius: 50%; }
.about-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.about-mark .brand-mark { background: rgba(255,255,255,.1); box-shadow: none; }
.about-title { font-family: var(--serif); font-size: 23px; letter-spacing: .12em; }
.about-version { font-size: 8px; color: rgba(243,234,217,.5); letter-spacing: .12em; margin-top: 4px; }
.about-copy { font-family: var(--serif); font-size: 12px; line-height: 1.9; color: rgba(243,234,217,.7); }
.about-meta { margin-top: 18px; padding-top: 13px; border-top: 1px solid rgba(243,234,217,.14); display: flex; justify-content: space-between; font-size: 8px; color: rgba(243,234,217,.45); }
.about-meta .icon { width: 12px; height: 12px; }
.keyboard-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
.shortcut-edit-btn { width: 100%; margin-top: 15px; }
.shortcut-editor-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.shortcut-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.shortcut-edit-row > span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.shortcut-key-btn { min-width: 48px; height: 28px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink-2); font-size: 9px; display: inline-flex; align-items: center; justify-content: center; transition: border-color .2s, background .2s; }
.shortcut-key-btn:hover { border-color: var(--accent); }
.shortcut-key-btn.is-capturing { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.shortcut-key-btn kbd { font-family: var(--sans); font-size: 9px; font-weight: 600; }
.shortcut-capturing { font-size: 7.5px; white-space: nowrap; }
.keyboard-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 9.5px; color: var(--muted); }
.kbd-group { display: flex; gap: 3px; }
.kbd { min-width: 21px; height: 21px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg); display: inline-grid; place-items: center; font-size: 8px; color: var(--ink-2); padding: 0 5px; font-family: var(--sans); }

/* ------------------------------------------------------------
   Modals: import, detail, note editor, confirm
   ------------------------------------------------------------ */
.import-panel { padding: 8px 24px 26px; }
.import-drop {
  border: 1.5px dashed var(--line-strong); border-radius: 16px; padding: 38px 22px; text-align: center;
  background: linear-gradient(180deg, rgba(247,242,233,.5), rgba(255,253,248,.3)); transition: border-color .2s, background .2s;
}
.import-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.import-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); display: grid; place-items: center; margin: 0 auto 14px; color: var(--accent); }
.import-icon .icon { width: 23px; height: 23px; }
.import-title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.import-desc { margin-top: 6px; font-size: 10px; color: var(--muted); line-height: 1.75; }
.import-actions { margin-top: 18px; display: flex; justify-content: center; gap: 9px; }
.import-hint { margin-top: 11px; font-size: 8.5px; color: var(--faint); }
.import-types { display: flex; justify-content: center; gap: 18px; margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--line); }
.import-type { display: flex; align-items: center; gap: 6px; font-size: 8px; color: var(--faint); }
.import-type b { color: var(--muted); font-weight: 600; }
.import-progress { padding: 22px 24px 30px; text-align: center; }
.import-spinner { width: 54px; height: 54px; margin: 0 auto 18px; position: relative; }
.import-spinner::before, .import-spinner::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); }
.import-spinner::after { border-color: var(--accent) transparent transparent transparent; animation: spin 1s linear infinite; }
.import-spinner .icon { position: absolute; inset: 0; margin: auto; width: 21px; height: 21px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.import-progress h3 { font-family: var(--serif); font-size: 18px; }
.import-progress p { margin-top: 7px; font-size: 10px; color: var(--muted); }
.import-status-line { margin: 18px auto 0; height: 3px; width: 210px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.import-status-line i { display: block; height: 100%; width: 35%; border-radius: inherit; background: var(--accent); animation: import-slide 1.4s ease-in-out infinite; }
@keyframes import-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(390%); } }
.detail-hero { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 23px; padding: 8px 24px 20px; align-items: center; }
.detail-cover { width: 124px; aspect-ratio: 2/3; position: relative; filter: drop-shadow(0 14px 22px rgba(47,39,27,.2)); }
.detail-cover .book-cover { position: relative; }
.detail-title { font-family: var(--serif); font-size: 25px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.detail-author { margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.detail-badges { display: flex; gap: 5px; margin-top: 11px; flex-wrap: wrap; }
.detail-badge { font-size: 8px; border-radius: 5px; padding: 4px 7px; background: var(--surface-2); color: var(--muted); }
.detail-badge.format { background: var(--forest-soft); color: var(--forest); font-weight: 600; }
.detail-desc { padding: 0 24px 20px; font-family: var(--serif); font-size: 12px; line-height: 1.85; color: var(--muted); }
.detail-stats { margin: 0 24px 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.detail-stat { text-align: center; border-left: 1px solid var(--line); }
.detail-stat:first-child { border-left: 0; }
.detail-stat b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); }
.detail-stat span { display: block; margin-top: 3px; font-size: 8px; color: var(--faint); }
.detail-progress { margin: 0 24px 22px; }
.detail-progress-head { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-bottom: 7px; }
.detail-progress-head strong { color: var(--accent); }
.detail-actions { padding: 0 24px 22px; display: flex; gap: 8px; }
.detail-actions .btn { flex: 1; }
.detail-actions .btn:last-child { flex: 0 0 44px; padding: 0; }
.finish-modal { position: relative; padding: 30px 30px 24px; color: var(--r-ink, var(--ink)); overflow: hidden; }
.finish-modal::before { content: ""; position: absolute; top: -130px; right: -90px; width: 320px; height: 320px; border-radius: 50%; border: 1px solid var(--r-line, var(--line)); opacity: .65; pointer-events: none; }
.finish-close { position: absolute; top: 17px; right: 17px; z-index: 2; }
.finish-kicker { font-size: 8px; font-weight: 700; letter-spacing: .2em; color: var(--r-accent, var(--accent)); margin-bottom: 20px; }
.finish-hero { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 25px; align-items: center; }
.finish-cover { width: 108px; aspect-ratio: 2 / 3; position: relative; filter: drop-shadow(0 14px 22px rgba(40, 33, 23, .18)); }
.finish-cover .book-cover { position: relative; }
.finish-overline { font-family: var(--serif); font-size: 11px; color: var(--r-muted, var(--muted)); margin-bottom: 5px; }
.finish-title { font-family: var(--serif); font-size: 29px; line-height: 1.22; font-weight: 600; letter-spacing: -.02em; color: var(--r-ink, var(--ink)); }
.finish-author { margin-top: 5px; font-size: 10px; color: var(--r-faint, var(--faint)); }
.finish-quote { margin: 15px 0 0; padding-left: 12px; border-left: 2px solid var(--r-line-strong, var(--line-strong)); font-family: var(--serif); font-size: 11.5px; line-height: 1.8; color: var(--r-muted, var(--muted)); }
.finish-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 26px 0 0; padding: 18px 0; border-top: 1px solid var(--r-line, var(--line)); border-bottom: 1px solid var(--r-line, var(--line)); }
.finish-stats > div { padding: 0 13px; border-left: 1px solid var(--r-line, var(--line)); min-width: 0; }
.finish-stats > div:first-child { padding-left: 0; border-left: 0; }
.finish-stats span { display: block; font-size: 8px; letter-spacing: .05em; color: var(--r-faint, var(--faint)); margin-bottom: 6px; }
.finish-stats b { display: block; font-family: var(--serif); font-size: 16px; line-height: 1.2; font-weight: 600; color: var(--r-ink-soft, var(--ink-2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finish-stats b small { display: block; margin-top: 3px; font-family: var(--sans); font-size: 7.5px; font-weight: 400; color: var(--r-faint, var(--faint)); }
.finish-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 13px; font-size: 8.5px; color: var(--r-faint, var(--faint)); }
.finish-meta span + span::before { content: "\00B7"; margin-right: 16px; color: var(--r-line-strong, var(--line-strong)); }
.finish-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.finish-actions .btn { flex: none; }
.finish-actions .btn-ghost { background: transparent; border-color: var(--r-line, var(--line)); color: var(--r-muted, var(--muted)); }
.finish-actions .btn-primary { background: var(--r-accent, var(--accent)); color: #fff9f1; box-shadow: none; }
.note-editor-quote { font-family: var(--serif); font-size: 15px; line-height: 1.75; color: var(--ink-2); padding: 14px 16px; border-radius: 10px; background: var(--bg); border-left: 2px solid var(--note-color, var(--accent)); margin-bottom: 16px; max-height: 150px; overflow-y: auto; }
.note-editor-quote::before { content: "\201C"; color: var(--accent); }
.note-editor-quote::after { content: "\201D"; color: var(--accent); }
.note-textarea { width: 100%; min-height: 120px; resize: vertical; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); padding: 12px 14px; outline: 0; font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }
.note-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note-colors { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.note-colors-label { font-size: 9px; color: var(--faint); margin-right: 3px; }
.color-choice { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s; }
.color-choice.active { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); }
.color-choice.red { background: #d76f62; }
.color-choice.orange { background: #e3a15e; }
.color-choice.yellow { background: #e2b44d; }
.color-choice.green { background: #7fb28b; }
.color-choice.blue { background: #77a3c5; }
.color-choice.pink { background: #ce8c99; }
.color-choice.purple { background: #a98bc4; }
.confirm-copy { padding: 0 24px 22px; font-size: 13px; line-height: 1.9; color: var(--r-ink-soft, var(--ink-soft)); }
.confirm-copy b { color: var(--r-ink, var(--ink)); font-weight: 600; }
.confirm-copy b:last-child { color: var(--r-accent, var(--accent)); font-weight: 700; }
.reminder-control { display: flex; align-items: center; gap: 9px; }
.reminder-select { width: 92px; height: 32px; }
.modal.reminder-modal { width: min(92vw, 380px); max-width: 380px; background: var(--r-surface, var(--surface)); border-color: var(--r-line, rgba(255,255,255,.55)); }
.modal.reminder-modal .modal-title { color: var(--r-ink, var(--ink)); }
.modal.reminder-modal .modal-sub { color: var(--r-ink-soft, var(--ink-soft)); }
.modal.reminder-modal .modal-close { color: var(--r-muted, var(--muted)); }
.reminder-body { padding: 6px 26px 10px; text-align: center; }
.reminder-badge { width: 58px; height: 58px; margin: 0 auto 13px; border-radius: 19px; display: grid; place-items: center; background: var(--r-accent-soft, var(--accent-soft)); color: var(--r-accent, var(--accent)); }
.reminder-badge .icon { width: 27px; height: 27px; }
.reminder-body p { font-size: 13px; line-height: 1.8; color: var(--r-ink-soft, var(--ink-soft)); }
.reminder-body p b { color: var(--r-ink, var(--ink)); font-weight: 700; }
.reminder-body .reminder-sub { margin-top: 3px; font-size: 11.5px; color: var(--r-muted, var(--muted)); }
.reminder-foot { gap: 8px; }
.reminder-foot .btn { flex: 1; }
.modal.goal-modal, .modal.lookup-modal { background: var(--r-surface, var(--surface)); border-color: var(--r-line, rgba(255,255,255,.55)); }
.modal.goal-modal .modal-foot, .modal.lookup-modal .modal-foot { border-top-color: var(--r-line, var(--line)); }
.modal.goal-modal .modal-close, .modal.lookup-modal .modal-close { color: var(--r-muted, var(--muted)); }
.modal.goal-modal { width: min(92vw, 380px); max-width: 380px; }
.modal.lookup-modal { width: min(92vw, 430px); max-width: 430px; }
.lookup-body { padding: 2px 24px 18px; overflow-y: auto; max-height: calc(84vh - 150px); }
.dict-result { padding: 14px 0 2px; border-bottom: 1px solid var(--r-line, var(--line)); }
.dict-entry + .dict-entry { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--r-line, var(--line)); }
.dict-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dict-word { font-family: var(--serif); font-size: 25px; font-weight: 700; color: var(--r-ink, var(--ink)); }
.dict-pinyin { color: var(--r-accent, var(--accent)); font-size: 13.5px; font-weight: 500; letter-spacing: .02em; }
.dict-sense-picker { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 9.5px; color: var(--r-muted, var(--muted)); }
.dict-sense-picker select { flex: 1; height: 30px; border-radius: 7px; border: 1px solid var(--r-line, var(--line)); background: var(--r-surface-2, var(--surface-2)); color: var(--r-ink, var(--ink)); padding: 0 7px; font-size: 10.5px; }
.dict-sense-panel { display: none; }
.dict-sense-panel.is-active { display: block; }
.dict-use-sense { margin-top: 8px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--r-line-strong, var(--line-strong)); background: var(--r-accent-soft, var(--accent-soft)); color: var(--r-accent-deep, var(--accent-deep)); font-size: 9.5px; font-weight: 600; }
.dict-use-sense:hover { border-color: var(--r-accent, var(--accent)); }
.dict-sense { margin-top: 8px; }
.dict-cat { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--r-accent-soft, var(--accent-soft)); color: var(--r-accent, var(--accent)); font-size: 9px; font-weight: 600; }
.dict-sense ul { margin: 5px 0 0; padding-left: 16px; list-style: disc; }
.dict-sense li { font-size: 12.5px; line-height: 1.75; color: var(--r-ink-soft, var(--ink-soft)); }
.dict-example { margin-top: 4px; padding-left: 9px; border-left: 2px solid var(--r-line-strong, var(--line-strong)); font-size: 11px; line-height: 1.7; color: var(--r-muted, var(--muted)); }
.dict-note { margin-top: 8px; font-size: 10.5px; line-height: 1.7; color: var(--r-muted, var(--muted)); }
.dict-baike { font-size: 12px; line-height: 1.8; color: var(--r-ink-soft, var(--ink-soft)); padding-top: 10px; }
.dict-definition-text { margin-top: 7px; font-size: 13px; line-height: 1.85; color: var(--r-ink-soft, var(--ink-soft)); }
.dict-senses { margin: 7px 0 0; padding-left: 19px; list-style: decimal; }
.dict-senses li { margin-bottom: 4px; font-size: 12.5px; line-height: 1.8; color: var(--r-ink-soft, var(--ink-soft)); }
.dict-senses li::marker { color: var(--r-accent, var(--accent)); font-weight: 600; }
.dict-baike-sense b { display: block; font-family: var(--serif); font-size: 17px; color: var(--r-ink, var(--ink)); margin-bottom: 4px; }
.dict-baike-sense p { font-size: 12.5px; line-height: 1.75; color: var(--r-ink-soft, var(--ink-soft)); }
.dict-source { margin-top: 9px; font-size: 9px; color: var(--r-faint, var(--faint)); }
.dict-empty { padding: 14px 0; font-size: 11px; line-height: 1.8; color: var(--r-muted, var(--muted)); }
.dict-result + .lookup-result { border-bottom: 1px solid var(--r-line, var(--line)); }
.lookup-source { padding: 12px 14px; border-radius: 10px; background: var(--r-surface-2, var(--surface-2)); color: var(--r-ink-soft, var(--ink-2)); font-size: 13px; line-height: 1.7; word-break: break-word; }
.lookup-result { min-height: 58px; padding: 16px 2px 8px; display: flex; align-items: center; }
.lookup-result:empty { display: none; }
.dict-result + .lookup-result:empty { border-bottom: 0; }
.lookup-loading { color: var(--r-muted, var(--muted)); font-size: 11.5px; }
.lookup-translated { font-family: var(--serif); font-size: 21px; line-height: 1.45; color: var(--r-ink, var(--ink)); word-break: break-word; }
.lookup-error { color: var(--danger); font-size: 11.5px; line-height: 1.7; }
.lookup-credit { font-size: 9px; color: var(--r-faint, var(--faint)); }
.modal.lookup-modal .modal-title { color: var(--r-ink, var(--ink)); }
.modal.lookup-modal .modal-sub { color: var(--r-ink-soft, var(--ink-soft)); }
.lookup-foot { align-items: center; justify-content: flex-end; gap: 10px; }
.lookup-group-wrap { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lookup-group-caption { flex: none; font-size: 9.5px; letter-spacing: .04em; color: var(--r-muted, var(--muted)); white-space: nowrap; }
.lookup-group-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px 0 8px; border-radius: 9px; border: 1px solid var(--r-line, var(--line)); background: var(--r-surface-2, var(--surface-2)); color: var(--r-ink-soft, var(--ink-2)); font-size: 10.5px; transition: border-color .18s, background .18s; }
.lookup-group-btn:hover, .lookup-group-btn.is-open { border-color: var(--r-line-strong, var(--line-strong)); background: var(--r-surface, var(--surface)); }
.lookup-group-new-btn { color: var(--r-accent, var(--accent)); }
.lookup-group-new-btn .icon { width: 14px; height: 14px; }
.lookup-group-quick { gap: 6px; padding: 0 8px; max-width: 104px; background: var(--r-accent-soft, var(--accent-soft)); border-color: transparent; }
.lookup-group-quick:hover { border-color: var(--r-accent, var(--accent)); }
.lookup-group-quick-name { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lookup-group-swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(60, 42, 26, .08); }
.lookup-group-name { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lookup-group-chevron { width: 13px; height: 13px; color: var(--r-faint, var(--faint)); transition: transform .18s var(--ease); }
.lookup-group-btn.is-open .lookup-group-chevron { transform: rotate(180deg); }
.lookup-group-menu { position: absolute; left: 0; bottom: calc(100% + 9px); z-index: 8; width: 190px; max-height: 384px; overflow: hidden; padding: 5px; border-radius: 12px; border: 1px solid var(--r-line, var(--line)); background: var(--r-surface, var(--surface)); box-shadow: var(--shadow-md); animation: pop .15s var(--ease); }
.lookup-group-title { padding: 6px 10px 5px; font-size: 8px; letter-spacing: .1em; color: var(--r-faint, var(--faint)); }
.lookup-group-list { max-height: 292px; overflow-y: auto; }
.lookup-group-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; text-align: left; color: var(--r-ink-soft, var(--ink-2)); font-size: 10.5px; }
.lookup-group-item:hover { background: var(--r-surface-2, var(--surface-2)); }
.lookup-group-item.is-active { color: var(--r-accent, var(--accent)); font-weight: 600; }
.lookup-group-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lookup-group-check { width: 14px; height: 14px; color: var(--r-accent, var(--accent)); }
.lookup-group-sep { height: 1px; margin: 4px 6px; background: var(--r-line, var(--line)); }
.lookup-group-add { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; text-align: left; color: var(--r-accent, var(--accent)); font-size: 10.5px; }
.lookup-group-add:hover { background: var(--r-surface-2, var(--surface-2)); }
.lookup-group-add .icon { width: 14px; height: 14px; }
.lookup-group-form { display: flex; align-items: center; gap: 8px; padding: 3px 6px 6px; }
.lookup-group-color { width: 30px; height: 30px; flex: none; padding: 0; border: 1px solid var(--r-line, var(--line)); border-radius: 8px; background: none; cursor: pointer; }
.lookup-group-color::-webkit-color-swatch-wrapper { padding: 2px; }
.lookup-group-color::-webkit-color-swatch { border: 0; border-radius: 6px; }
.lookup-group-input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--r-line, var(--line)); background: var(--r-surface-2, var(--surface-2)); color: var(--r-ink, var(--ink)); font-size: 10.5px; outline: none; }
.lookup-group-input:focus { border-color: var(--r-accent, var(--accent)); }
.lookup-group-input::placeholder { color: var(--r-faint, var(--faint)); }
.lookup-group-form-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 2px 6px 4px; }
.lookup-group-back { height: 28px; padding: 0 10px; border-radius: 7px; color: var(--r-muted, var(--muted)); font-size: 10px; }
.lookup-group-back:hover { background: var(--r-surface-2, var(--surface-2)); }
.lookup-group-create { height: 28px; padding: 0 10px; border-radius: 7px; background: var(--r-accent, var(--accent)); color: #fff9f1; font-size: 10px; font-weight: 600; }
.lookup-group-create:hover { filter: brightness(1.05); }
.modal.goal-modal .modal-title { color: var(--r-ink, var(--ink)); font-size: 21px; }
.modal.goal-modal .modal-sub { color: var(--r-ink-soft, var(--ink-soft)); font-size: 11px; }
.goal-done { padding: 4px 26px 8px; text-align: center; }
.goal-done-badge { width: 58px; height: 58px; margin: 2px auto 12px; border-radius: 19px; display: grid; place-items: center; background: var(--r-accent-soft, var(--accent-soft)); color: var(--r-accent, var(--accent)); }
.goal-done-badge .icon { width: 27px; height: 27px; }
.goal-done-count { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--r-accent, var(--accent)); font-weight: 700; }
.goal-done-count span { font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--r-ink-soft, var(--ink-soft)); margin-left: 5px; }
.goal-done p { margin-top: 11px; font-size: 12.5px; line-height: 1.75; color: var(--r-ink-soft, var(--ink-soft)); }
.goal-done p b { color: var(--r-ink, var(--ink)); font-weight: 700; }
.goal-done .goal-done-sub { margin-top: 4px; font-size: 11px; color: var(--r-muted, var(--muted)); }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.shortcut-row:last-child, .shortcut-row:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.shortcut-row kbd { font-family: var(--sans); font-size: 8.5px; background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; color: var(--ink-2); min-width: 22px; text-align: center; }
.shortcut-group-title { grid-column: 1 / -1; margin-top: 10px; font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.shortcut-group-title:first-child { margin-top: 0; }

/* ------------------------------------------------------------
   Context menu, toasts
   ------------------------------------------------------------ */
.context-menu { position: fixed; z-index: 160; min-width: 172px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 5px; transform-origin: top right; animation: pop .15s var(--ease); }
.ui-tooltip { min-width: 0; max-width: 260px; padding: 7px 10px; border-radius: 10px; white-space: nowrap; font-size: 10.5px; color: var(--ink-2); pointer-events: none; animation: tooltip-in .14s var(--ease); }
.ui-tooltip[hidden] { display: none; }
@keyframes tooltip-in { from { opacity: 0; transform: translateY(3px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.context-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 10.5px; color: var(--ink-2); text-align: left; }
.context-item:hover { background: var(--surface-2); }
.context-item .icon { width: 15px; height: 15px; color: var(--muted); }
.context-item.danger { color: var(--danger); }
.context-item.danger .icon { color: var(--danger); }
.context-sep { height: 1px; background: var(--line); margin: 4px 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.toast-stack { position: fixed; z-index: 200; right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  min-height: 42px; max-width: 360px; border-radius: 10px; background: #26231e; color: #f5eee2;
  display: flex; align-items: center; gap: 9px; padding: 9px 14px 9px 11px; font-size: 10.5px; box-shadow: 0 12px 32px rgba(20,17,12,.25);
  animation: toast-in .3s var(--ease); pointer-events: auto;
}
.toast .toast-icon { width: 23px; height: 23px; border-radius: 7px; background: rgba(255,255,255,.1); display: grid; place-items: center; color: #e8b476; flex: none; }
.toast .icon { width: 14px; height: 14px; }
.toast.is-out { animation: toast-out .25s forwards; }
.toast button { margin-left: 6px; color: #e5b67d; font-size: 9.5px; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px) scale(.98); } }

/* ------------------------------------------------------------
   Shared bits & animations
   ------------------------------------------------------------ */
.empty-state { padding: 78px 22px; text-align: center; }
.empty-state .empty-icon { width: 60px; height: 60px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; margin: 0 auto 15px; color: var(--accent); box-shadow: var(--shadow-sm); }
.empty-state h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 7px; }
.empty-state p { font-size: 10.5px; line-height: 1.8; color: var(--muted); margin-bottom: 18px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.view-enter { animation: fade-up .4s var(--ease) both; }
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--line); }
.spacer { flex: 1; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
  .main-inner { padding: 26px 30px 52px; }
  .stats-cards { grid-template-columns: repeat(3, 1fr); }
  .shelf-hero { grid-template-columns: minmax(0, 1.6fr) minmax(270px, .8fr); }
  .continue-card { padding: 30px 30px; grid-template-columns: minmax(0, 1fr) 146px; min-height: 252px; }
  .hero-cover { width: 128px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 27px 20px; }
  .cover-title { font-size: clamp(17px, 1.52vw, 22px); }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { padding: 24px 12px 16px; align-items: center; }
  .brand { padding: 0; margin-bottom: 28px; }
  .brand-words { display: none; }
  .side-nav { width: 100%; align-items: center; }
  .nav-item { width: 48px; height: 46px; padding: 0; justify-content: center; }
  .nav-item span:not(.nav-count):not(.icon) { display: none; }
  .nav-item .icon { width: 20px; height: 20px; }
  .nav-item.active::after { right: 7px; top: 8px; }
  .nav-count { display: none; }
  .side-section { display: none; }
  .goal-mini { padding: 9px; width: 48px; display: flex; justify-content: center; }
  .goal-mini-head, .goal-mini-copy { display: none; }
  .goal-mini-row { gap: 0; }
  .profile-card { justify-content: center; padding: 9px 0 0; width: 48px; }
  .profile-card > div:not(.avatar) { display: none; }
  .main-inner { padding: 26px 28px 50px; }
  .shelf-hero { grid-template-columns: minmax(0, 1.5fr) minmax(250px, .8fr); }
  .continue-card { grid-template-columns: 1fr; padding-right: 190px; }
  .hero-cover-wrap { display: flex; position: absolute; right: 25px; top: 50%; width: 138px; transform: translateY(-50%); }
  .hero-cover { width: 132px; }
  .hero-cover-halo { width: 150px; height: 150px; }
  .continue-quote { max-width: 100%; }
  .stats-main { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .settings-aside .settings-card { margin-bottom: 0; }
}

@media (max-width: 860px) {
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 66px; width: 100%;
    flex-direction: row; align-items: center; justify-content: center; padding: 0 10px calc(env(safe-area-inset-bottom, 0px));
    border-right: 0; border-top: 1px solid var(--line); background: rgba(250, 247, 240, .92);
    backdrop-filter: blur(16px); z-index: 70;
  }
  .brand, .side-section, .goal-mini, .profile-card { display: none; }
  .side-nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 2px; }
  .nav-item { width: auto; min-width: 58px; height: 48px; flex-direction: column; gap: 3px; padding: 4px 10px; border-radius: 9px; }
  .nav-item span:not(.icon):not(.nav-count) { display: block; font-size: 8.5px; letter-spacing: .02em; }
  .nav-item .icon { width: 18px; height: 18px; }
  .nav-item.active::after { display: none; }
  .nav-item.active { background: var(--surface); }
  .main-inner { padding: 22px 20px 34px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .head-actions { width: 100%; }
  .search-box { flex: 1; width: auto; }
  .search-box:focus-within { width: auto; }
  .head-actions .avatar-btn { display: none; }
  .page-title { font-size: 27px; }
  .shelf-hero { grid-template-columns: 1fr; gap: 14px; margin-bottom: 28px; }
  .insight-card { min-height: 0; padding: 20px; }
  .week-bars { height: 60px; padding-top: 12px; }
  .week-bar-track { height: 36px; }
  .continue-card { min-height: 250px; padding: 27px 25px; padding-right: 126px; }
  .continue-title { font-size: 31px; }
  .hero-cover-wrap { right: 16px; width: 102px; }
  .hero-cover { width: 96px; }
  .hero-cover-halo { width: 110px; height: 110px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 24px 16px; }
  .cover-title { font-size: clamp(15px, 3.7vw, 20px); }
  .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .section-actions { width: 100%; justify-content: space-between; }
  .filter-pills { overflow-x: auto; }
  .notes-grid { grid-template-columns: 1fr; }
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .view-head { align-items: flex-start; flex-direction: column; gap: 15px; }
  .view-head-actions { width: 100%; }
  .notes-toolbar { align-items: flex-start; flex-direction: column; }
  .notes-search { width: 100%; }
  .notes-toolbar-right { width: 100%; flex-wrap: wrap; }
  .notes-toolbar-right .notes-search { width: auto; flex: 1; min-width: 140px; }
  .notes-toolbar-right .sort-btn, .notes-sort-wrap { flex: none; }
  .notes-books-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 23px 16px; }
  .book-notes-head { align-items: flex-start; gap: 14px; }
  .book-notes-cover { width: 78px; }
  .book-notes-copy .page-title { font-size: 27px; }
  .notes-order { width: 100%; justify-content: center; }
  .settings-aside { grid-template-columns: 1fr; }
  .keyboard-list { grid-template-columns: 1fr; }
  .shortcut-editor-list { grid-template-columns: 1fr; }
  .reader-page-frame { max-width: calc(100vw - 36px); width: 100%; }
  .reader-top { height: 58px; padding: 0 10px; }
  .reader-book-meta { max-width: 46vw; }
  .reader-book-sub { display: none; }
  .reader-top-left, .reader-top-right { min-width: 0; gap: 0; }
  .reader-top-right .desktop-only { display: none; }
  .reader .icon-btn { width: 35px; height: 35px; }
  .reader .icon-btn .icon { width: 18px; height: 18px; }
  .page-arrow { display: none; }
  .page-edge-hint { display: none; }
  .reader-foot { grid-template-columns: 1fr auto; padding: 0 16px; height: 50px; gap: 10px; }
  .reader-foot-left { display: none; }
  .reader-foot-center { gap: 8px; }
  .reader-foot-right { gap: 8px; }
  .reader-progress-range { height: 18px; }
  .reader-progress-text { display: none; }
  .reader-page-number { font-size: 9px; }
  .selection-menu { max-width: calc(100vw - 24px); }
  .sel-action span { display: none; }
  .sel-action { padding: 0 8px; }
  .tts-pill { bottom: 62px; max-width: calc(100vw - 24px); }
  .tts-copy { max-width: 130px; }
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { max-height: 90dvh; border-radius: 19px; }
  .toast-stack { right: 12px; left: 12px; bottom: 80px; align-items: center; }
  .toast { max-width: 100%; width: auto; }
  .detail-hero { grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 4px 18px 16px; }
  .detail-cover { width: 92px; }
  .detail-title { font-size: 21px; }
  .detail-desc, .detail-progress, .detail-actions, .detail-stats { margin-left: 18px; margin-right: 18px; }
  .detail-actions { padding-left: 18px; padding-right: 18px; }
  .modal-head { padding: 18px 18px 12px; }
  .modal-body { padding: 4px 18px 18px; }
  .modal-foot { padding: 14px 18px 18px; }
  .import-panel { padding: 4px 18px 20px; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); gap: 12px 0; }
  .detail-stat:nth-child(3) { border-left: 0; }
  .finish-modal { padding: 26px 20px 20px; }
  .finish-hero { grid-template-columns: 82px minmax(0, 1fr); gap: 17px; }
  .finish-cover { width: 82px; }
  .finish-title { font-size: 23px; }
  .finish-quote { font-size: 10.5px; }
  .finish-stats { grid-template-columns: repeat(2, 1fr); gap: 15px 0; }
  .finish-stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .finish-actions .btn { flex: 1; min-width: 90px; }
}

@media (max-width: 480px) {
  .main-inner { padding: 18px 15px 28px; }
  .page-title { font-size: 24px; }
  .page-sub { font-size: 11px; }
  .eyebrow { font-size: 9px; }
  .head-actions .btn-primary span { display: none; }
  .head-actions .btn-primary { width: 40px; padding: 0; }
  .continue-card { min-height: 236px; padding: 24px 20px; padding-right: 112px; }
  .continue-title { font-size: 26px; }
  .hero-cover-wrap { right: 12px; width: 94px; }
  .hero-cover { width: 88px; }
  .hero-cover-halo { width: 100px; height: 100px; }
  .continue-quote { font-size: 11.5px; }
  .continue-kicker { margin-bottom: 14px; }
  .continue-actions { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 20px; }
  .continue-progress { font-size: 9px; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 11px; }
  .book-title { font-size: 11.5px; }
  .book-author { font-size: 8px; }
  .book-cover { border-radius: 3px 7px 7px 3px; }
  .cover-type { padding: 13% 11% 10%; }
  .cover-title { font-size: 13px; }
  .cover-title.is-en { font-size: 10.5px; }
  .cover-kicker { font-size: 5px; }
  .cover-author { font-size: 5.5px; }
  .cover-seal { width: 15px; height: 15px; font-size: 5px; }
  .add-book-card { padding: 13px 8px; gap: 9px; }
  .add-book-plus { width: 34px; height: 34px; }
  .add-book-title { font-size: 10.5px; }
  .add-book-sub { display: none; }
  .section-title { font-size: 19px; }
  .filter-pill { padding: 0 8px; font-size: 9.5px; }
  .sort-btn { padding: 0 8px; font-size: 9.5px; }
  .stats-cards { gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 22px; }
  .big-chart { gap: 6px; }
  .chart-col .bar-fill { max-width: 100%; }
  .panel { padding: 18px 16px; }
  .note-card { padding: 17px 17px 14px; }
  .note-quote { font-size: 15px; }
  .note-book-group { margin-bottom: 24px; }
  .note-group-head { gap: 10px; align-items: flex-start; }
  .note-group-cover { width: 34px; }
  .note-group-title { font-size: 17px; }
  .note-group-title span { display: block; margin: 3px 0 0; }
  .note-group-meta { gap: 6px; font-size: 8px; }
  .note-group-meta span + span::before { margin-right: 6px; }
  .note-group-open { width: 30px; height: 30px; padding: 0; justify-content: center; align-self: center; }
  .note-group-open span { display: none; }
  .reader-page-frame { max-width: calc(100vw - 28px); }
  .reader-top { padding: 0 5px; }
  .reader-book-meta { max-width: 38vw; }
  .reader-book-title { font-size: 11.5px; }
  .reader-foot { padding: 0 12px; }
  .reader-page-frame { --r-font-size: 17px; }
  .chapter-title { font-size: 24px; }
  .prose { line-height: 1.85; }
  .drawer { width: 100%; max-width: 100%; border-radius: 0; }
  .toast { font-size: 9.5px; }
}

@media (max-width: 360px) {
  .reader-book-meta { display: none; }
  .reader .icon-btn { width: 32px; height: 32px; }
  .reader-top { padding: 0 4px; }
  .reader-foot { padding: 0 8px; }
  .reader-page-frame { max-width: calc(100vw - 22px); }
  .continue-title { font-size: 24px; }
  .hero-cover-wrap { right: 8px; width: 86px; }
  .hero-cover { width: 80px; }
  .continue-card { padding-right: 94px; }
  .head-actions .search-box { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

