/* ─────────────────────────────────────────────
   English Reader · 样式
   浅色主题，阅读区走暖纸色，界面走冷灰蓝
   ───────────────────────────────────────────── */

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --text: #1f1e1c;
  --muted: #6b6862;
  --faint: #9a968e;
  --border: rgba(31, 30, 28, 0.10);
  --border-strong: rgba(31, 30, 28, 0.20);

  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --accent-line: #85b7eb;
  --good: #0f6e56;
  --good-soft: #e1f5ee;
  --warn: #ba7517;
  --warn-soft: #faeeda;
  --danger: #a32d2d;
  --danger-soft: #fcebeb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 30, 28, 0.05), 0 8px 24px rgba(31, 30, 28, 0.07);

  --font-scale: 1;
  --line-height: 1.85;
  --article-font: Georgia, "Songti SC", "Source Han Serif SC", serif;
  --ui-font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

/*
 * 必须放在所有布局规则之前生效。
 * 作者样式里的 display（.overlay{display:flex} / .grades{display:grid} /
 * .btn{display:inline-flex} / .dot{display:inline-block}）优先级高于浏览器默认的
 * [hidden]{display:none}，不加这条的话 el.hidden = true 完全不起作用——
 * 弹窗关不掉、评分按钮提前出现、徽标常驻。
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: 48px; }

/* ───────────── 顶栏 ───────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent-soft);
}
.brand-name { font-size: 14px; }

.tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

.dot {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  vertical-align: 1px;
}

/* ───────────── 布局 ───────────── */

main { max-width: 860px; margin: 0 auto; padding: 20px 20px 0; }

.view { display: none; }
.view.is-active { display: block; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.panel-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.section-title { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--muted); }
.panel-sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.hint { color: var(--faint); font-size: 12.5px; margin: 10px 0 0; }
.spacer { flex: 1; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ───────────── 控件 ───────────── */

textarea, .input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.7; }
textarea:focus, .input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #14507f; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: rgba(163, 45, 45, 0.3); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 8px 0; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 12px; font-size: 14px; }
.file-label { cursor: pointer; }

input[type="range"] { width: 100%; accent-color: var(--accent); margin: 4px 0 12px; }

/* ───────────── 分析面板 ───────────── */

.analysis-top { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }

.title-input {
  flex: 1;
  border: 0;
  border-bottom: 1px dashed transparent;
  background: transparent;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
  outline: none;
  min-width: 0;
}
.title-input:hover { border-bottom-color: var(--border-strong); }
.title-input:focus { border-bottom-color: var(--accent-line); }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.metric { background: var(--surface); padding: 12px 14px; }
.metric-label { font-size: 11.5px; color: var(--faint); margin-bottom: 3px; }
.metric-value { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }

/*
 * 结论块是普通块级排版。
 * 注意别写成 display:flex —— 里面混着 <b>、文本节点和按钮，
 * flex 默认不换行，会把整段挤成一行并撑出横向滚动。
 */
.verdict {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: #0c447c;
  overflow-wrap: anywhere;
}
.verdict.easy { background: var(--good-soft); border-color: #9fe1cb; color: #085041; }
.verdict.hard { background: var(--warn-soft); border-color: #fac775; color: #633806; }
.verdict.too-hard { background: var(--danger-soft); border-color: #f7c1c1; color: #791f1f; }
.verdict b { font-weight: 600; }

.disclosure { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.disclosure summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  list-style: none;
  user-select: none;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: "▸ "; color: var(--faint); }
.disclosure[open] summary::before { content: "▾ "; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
}
.chip:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.chip.ranked { color: var(--muted); }
.chip em { font-style: normal; color: var(--faint); font-size: 11px; margin-left: 4px; }

/* ───────────── 正文 ───────────── */

/*
 * 注意：这里刻意不写 overflow: hidden。
 * overflow 不是 visible 会让 .reader 变成滚动容器，工具栏的 position: sticky
 * 就会以 .reader 为参照系而不是页面——工具栏的自然位置在容器顶部（0px），
 * top: 49px 于是把它往下推 49px，正好压住正文第一行。
 * 圆角改用工具栏自身的 border-radius 来处理。
 */
.reader { padding: 0; }

.reader-toolbar {
  position: sticky;
  top: var(--topbar-h, 49px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tool-group { display: flex; align-items: center; gap: 6px; }
.tool-group:last-child { margin-left: auto; }
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
  padding: 0 4px;
}

.article {
  padding: 28px 28px 40px;
  font-family: var(--article-font);
  font-size: calc(19px * var(--font-scale));
  line-height: var(--line-height);
  color: #24231f;
  max-width: 70ch;
  margin: 0 auto;
  word-wrap: break-word;
}
.article p { margin: 0 0 1.15em; }

.w { cursor: pointer; border-radius: 3px; padding: 1px 0; transition: background 0.12s; }
.w:hover { background: var(--accent-soft); }
.w.unknown {
  background: linear-gradient(transparent 62%, rgba(24, 95, 165, 0.18) 62%);
  border-bottom: 1px solid rgba(24, 95, 165, 0.35);
}
.w.unknown:hover { background: var(--accent-soft); }
.w.saved { background: linear-gradient(transparent 62%, rgba(15, 110, 86, 0.2) 62%); border-bottom-color: rgba(15, 110, 86, 0.4); }
.w.is-active { background: var(--accent); color: #fff; }

.para-zh {
  font-family: var(--ui-font);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
  border-left: 2px solid var(--accent-line);
  padding-left: 12px;
  margin: -0.6em 0 1.4em;
}
.para-zh .loading { color: var(--faint); }

/* ───────────── 查词浮层 ───────────── */

.popover {
  position: absolute;
  z-index: 60;
  width: 330px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
  font-size: 13.5px;
  animation: pop 0.14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.pop-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.pop-word { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.pop-phonetic { color: var(--muted); font-size: 13px; }
.pop-rank { font-size: 11.5px; color: var(--faint); margin-bottom: 10px; }

.pop-zh {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.pop-zh .pos { color: var(--accent); font-size: 12px; margin-right: 4px; }
.pop-zh.muted { color: var(--muted); font-size: 13.5px; }
.pop-src { font-size: 11px; color: var(--faint); }

.pop-note {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 8px 0;
  line-height: 1.55;
}

.pop-sec-title { font-size: 11.5px; color: var(--faint); margin: 12px 0 5px; }
.pop-def { margin: 0 0 5px; line-height: 1.5; }
.pop-def .pos { color: var(--accent); font-size: 12px; font-style: italic; margin-right: 4px; }

.pop-sentence {
  font-size: 12.5px;
  color: var(--muted);
  border-left: 2px solid var(--border-strong);
  padding-left: 9px;
  margin: 10px 0 0;
  line-height: 1.55;
  max-height: 4.6em;
  overflow: hidden;
}

.pop-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pop-actions .btn { flex: 1; min-width: 88px; }
.pop-close {
  position: absolute; top: 8px; right: 8px;
  border: 0; background: transparent; color: var(--faint);
  font-size: 18px; line-height: 1; padding: 4px 6px; cursor: pointer; border-radius: 6px;
}
.pop-close:hover { background: var(--surface-2); color: var(--text); }

.skeleton {
  height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, #ecebe6 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  margin: 8px 0;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ───────────── 卡片列表 ───────────── */

.card-list { display: flex; flex-direction: column; gap: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-word { font-size: 16px; font-weight: 600; }
.card-phonetic { color: var(--muted); font-size: 12.5px; }
.card-meta { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.card-zh { margin-top: 4px; font-size: 14px; }
.card-en { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.card-sentence {
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
  font-family: var(--article-font); line-height: 1.6;
  border-left: 2px solid var(--border-strong); padding-left: 9px;
}
.card-actions { display: flex; gap: 6px; margin-top: 10px; }
.empty { text-align: center; color: var(--faint); padding: 40px 20px; font-size: 13.5px; }

.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.tag.due { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.tag.mastered { background: var(--good-soft); color: var(--good); border-color: #9fe1cb; }

/* ───────────── 复习 ───────────── */

.review-card { text-align: center; padding: 32px 24px; }
.review-progress {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--faint); margin-bottom: 24px;
}
.review-word { font-family: var(--article-font); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; }
.review-sentence {
  font-family: var(--article-font); font-size: 15px; color: var(--muted);
  margin: 16px auto 0; max-width: 46ch; line-height: 1.7;
}
.review-sentence b { color: var(--accent); font-weight: 600; }
.review-back { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.review-zh { font-size: 17px; margin-bottom: 6px; }
.review-en { font-size: 13px; color: var(--muted); }
.review-note {
  font-size: 12.5px; color: var(--muted); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 12px; text-align: left; line-height: 1.6;
}
#btn-reveal { margin-top: 24px; max-width: 260px; margin-left: auto; margin-right: auto; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.btn.grade { flex-direction: column; gap: 2px; padding: 10px 4px; font-size: 13px; }
.btn.grade small { font-size: 10.5px; color: var(--faint); font-weight: 400; }
.btn.grade.g0 { border-color: #f7c1c1; color: var(--danger); }
.btn.grade.g0:hover { background: var(--danger-soft); }
.btn.grade.g1 { border-color: #fac775; color: #854f0b; }
.btn.grade.g1:hover { background: var(--warn-soft); }
.btn.grade.g2 { border-color: var(--accent-line); color: var(--accent); }
.btn.grade.g2:hover { background: var(--accent-soft); }
.btn.grade.g3 { border-color: #9fe1cb; color: var(--good); }
.btn.grade.g3:hover { background: var(--good-soft); }

/* ───────────── 统计 ───────────── */

.metric-hero { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.metric-hero small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }

canvas { width: 100%; display: block; }

/* ───────────── 浮层 / 提示 ───────────── */

.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(31, 30, 28, 0.42);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: pop 0.15s ease-out;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 440px;
  max-height: 86vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal p { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.modal-wide { max-width: 560px; }

/* ───────────── 文件导入 ───────────── */

/* 拖拽时把文本框点亮，让「可以松手了」这件事一眼可见 */
#import-panel.is-dragging textarea {
  border-color: var(--accent);
  border-style: dashed;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal .import-file-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--faint);
  word-break: break-all;
  margin: 0 0 10px;
}
.modal .import-error { color: var(--text); }

.chapter-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 46vh; overflow-y: auto;
  margin: 0 0 18px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.chapter-item {
  display: flex; align-items: baseline; gap: 10px;
  width: 100%; text-align: left;
  font: inherit; font-size: 13.5px;
  padding: 9px 10px;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.chapter-item:hover { background: var(--surface); }
.chapter-item em { flex: none; font-style: normal; font-size: 11.5px; color: var(--faint); }
.chapter-index {
  flex: none; width: 22px;
  font-size: 11.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.chapter-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.test-word {
  font-family: var(--article-font);
  font-size: 30px; font-weight: 600; text-align: center;
  margin: 24px 0 8px; letter-spacing: -0.01em;
}
.test-hint { text-align: center; font-size: 12.5px; color: var(--faint); margin-bottom: 20px; }
.test-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.test-bar { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.test-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.25s; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 90;
  background: #24231f; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: pop 0.16s ease-out;
  max-width: calc(100vw - 40px);
}

/* ───────────── 移动端 ───────────── */

@media (max-width: 640px) {
  main { padding: 14px 12px 0; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand-name { display: none; }
  .tabs { margin-left: 0; width: 100%; }
  .panel { padding: 16px; }
  .article { padding: 20px 18px 32px; font-size: calc(17.5px * var(--font-scale)); }
  .popover {
    position: fixed !important;
    left: 12px !important; right: 12px !important; bottom: 12px !important;
    top: auto !important;
    width: auto; max-width: none;
    max-height: 62vh; overflow-y: auto;
    animation: sheet 0.18s ease-out;
  }
  @keyframes sheet { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .grades { grid-template-columns: repeat(2, 1fr); }
  .review-word { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ───────────── 书库 ───────────── */

.library-gate .panel-title { margin-bottom: 6px; }

.library-points {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.95;
}
.library-points li::marker { color: var(--accent); }

.book-card {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

/* min-width:0 才能让里面的省略号生效——flex 子项默认最小宽度是内容宽度 */
.book-main { flex: 1 1 240px; min-width: 0; }

.book-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

.book-progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.book-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s;
}

.book-original { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.book-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.danger-text { color: var(--danger); }

/* 章节切换器：贴在工具栏最左边 */
.chapter-group { flex: 0 1 auto; min-width: 0; }
.chapter-select {
  max-width: 260px;
  font: inherit;
  font-size: 12.5px;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ───────────── 登录 / 注册 ───────────── */

.auth-modal .field { display: block; margin-bottom: 12px; }
.auth-modal .field > span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.auth-error { color: var(--danger); font-size: 12.5px; margin: 0 0 12px; }
.auth-switch {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.link {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .chapter-select { max-width: 140px; }
  .book-card { align-items: flex-start; }
  .book-actions { width: 100%; }
}
