/* 兩日循環閱讀 — 站內樣式
   層次與易讀優先；配色取暖紙與花生殼色，而非科技行銷風。 */

:root {
  --bg: #f7f1e8;
  --bg-hero: #f3eadb;
  --card: #fffbf5;
  --ink: #1a1612;
  --muted: #534c44;
  --accent: #8b3419;
  --accent-hover: #6f2913;
  --accent-soft: #f3e2d6;
  --green: #1f4d38;
  --green-soft: #e4efe8;
  --highlight: #f3d7a0;
  --highlight-ink: #1a1612;
  --line: #e4d8c8;
  --line-strong: #d2c3ae;
  --shadow: 0 10px 30px rgba(44, 28, 16, 0.08);
  --shadow-soft: 0 4px 16px rgba(44, 28, 16, 0.05);
  --ok: #1f4d38;
  --ok-bg: #e4efe8;
  --bad: #8b3419;
  --bad-bg: #f8e8e1;
  --warn-bg: #f6ebd0;
  --warn-ink: #4a3a16;
  --focus: #8b3419;
  --radius: 1.15rem;
  --radius-sm: 0.8rem;
  --header-h: 4.25rem;
  --nav-h: 3.4rem;
  --sticky-top-nav: var(--header-h);
  --sticky-top-tts: calc(var(--header-h) + var(--nav-h));
  --scroll-pad: calc(var(--header-h) + 0.75rem);
  --read-width: 42rem;
  --page-width: 72rem;
  --font-serif: "Noto Serif CJK HK", "Noto Serif CJK TC", "Source Han Serif HC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans CJK HK", "Noto Sans CJK TC", "Source Han Sans HC", "PingFang HK", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --step: 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #161210;
  --bg-hero: #1b1612;
  --card: #211c18;
  --ink: #f4ede3;
  --muted: #c9bdb0;
  --accent: #e8a078;
  --accent-hover: #f3c2a3;
  --accent-soft: #3a2a22;
  --green: #8fceb0;
  --green-soft: #1d3229;
  --highlight: #5c4518;
  --highlight-ink: #f4ede3;
  --line: #3a322b;
  --line-strong: #53483d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.18);
  --ok: #8fceb0;
  --ok-bg: #1d3229;
  --bad: #e8a078;
  --bad-bg: #3a2420;
  --warn-bg: #3a3018;
  --warn-ink: #f4ede3;
  --focus: #e8a078;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-pad);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 8% -10%, rgba(139, 52, 25, 0.08), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(31, 77, 56, 0.07), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: var(--ink); }
input, textarea, select, .text-input {
  color: var(--ink);
  background-color: var(--card);
}
input[type="range"],
input[type="radio"],
input[type="checkbox"],
input[type="submit"],
input[type="button"],
input[type="reset"],
input[type="image"] {
  background-color: transparent;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0.7rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}
.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
}
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-nav a, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.header-nav a:hover, .icon-btn:hover {
  background: var(--card);
  border-color: var(--line);
}
.icon-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

/* Layout */
.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.15rem 4.5rem;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.15rem 3rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.site-footer .footer-inner { max-width: var(--page-width); margin: 0 auto; }
.site-footer .credit { margin-top: 0.6rem; color: var(--ink); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  margin: 1.1rem 0 1.6rem;
  padding: 1.6rem 1.25rem 1.7rem;
  border-radius: calc(var(--radius) + 0.2rem);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-hero) 80%, var(--card)) 0%, var(--card) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.hero-deco {
  position: absolute;
  inset: 0 auto 0 54%;
  width: 46%;
  opacity: 0.95;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 36rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.7rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.18;
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}
.hero .lede {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.75;
  max-width: 34rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 650;
  background: var(--accent);
  color: #fffbf5;
  transition: transform var(--step), background-color var(--step), border-color var(--step);
}
html[data-theme="dark"] .btn { color: #1a1612; }
.btn:hover { background: var(--accent-hover); color: #fffbf5; }
html[data-theme="dark"] .btn:hover { color: #1a1612; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover, html[data-theme="dark"] .btn-ghost:hover {
  background: var(--card);
  color: var(--ink);
}
.btn:active { transform: translateY(1px); }

/* Bento */
.bento {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}
.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.15rem 1.15rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  min-height: 8.5rem;
  transition: transform var(--step), box-shadow var(--step), border-color var(--step);
}
a.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.bento-card .kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.bento-card h2, .bento-card h3 {
  margin: 0.15rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.3;
}
.bento-card p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.bento-card .go { margin-top: auto; font-weight: 650; color: var(--accent); }

.section {
  margin: 2.2rem 0 0;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}
.section h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.3;
}
.section .hint { color: var(--muted); font-size: 0.98rem; }

/* Archive list */
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.archive-item a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  min-height: 44px;
  padding: 0.9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
}
.archive-item a:hover { border-color: var(--line-strong); }
.archive-item .date { font-variant-numeric: tabular-nums; color: var(--muted); }
.archive-item .title { font-family: var(--font-serif); font-weight: 700; }

/* Cycle subnav */
.cycle-nav {
  position: sticky;
  top: var(--sticky-top-nav);
  z-index: 30;
  margin: 0 -1.15rem 1.2rem;
  padding: 0.4rem 1.15rem;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cycle-nav-list {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  list-style: none;
  margin: 0 auto;
  padding: 0 0 0.15rem;
  max-width: var(--page-width);
  -webkit-overflow-scrolling: touch;
}
.cycle-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  border: 1px solid transparent;
}
.cycle-nav a:hover, .cycle-nav a[aria-current="true"] {
  background: var(--card);
  border-color: var(--line-strong);
}
.cycle-nav a[aria-current="true"] { font-weight: 700; }

/* Article reading */
.read-wrap {
  max-width: var(--read-width);
  margin: 0 auto;
}
.tts-panel {
  position: sticky;
  top: var(--sticky-top-tts);
  z-index: 20;
  margin: 0 0 1.1rem;
  padding: 0.8rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
}
.tts-row .grow { flex: 1 1 10rem; }
.tts-controls button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  cursor: pointer;
}
.tts-controls button:hover { background: var(--accent-soft); }
.tts-controls button[aria-pressed="true"],
.tts-controls button.is-active {
  background: var(--accent);
  color: #fffbf5;
  border-color: transparent;
}
html[data-theme="dark"] .tts-controls button[aria-pressed="true"],
html[data-theme="dark"] .tts-controls button.is-active { color: #1a1612; }
.tts-panel label,
.tts-rate-label { font-size: 0.92rem; color: var(--muted); }
.tts-rate {
  align-items: center;
}
.tts-rate-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tts-rate-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.tts-rate-btn:hover { background: var(--accent-soft); }
.tts-rate-btn[aria-pressed="true"],
.tts-rate-btn.is-active {
  background: var(--accent);
  color: #fffbf5;
  border-color: transparent;
}
html[data-theme="dark"] .tts-rate-btn[aria-pressed="true"],
html[data-theme="dark"] .tts-rate-btn.is-active { color: #1a1612; }
.tts-status {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}
.tts-status.is-warning {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
}

.essay {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  line-height: 1.9;
  letter-spacing: 0.01em;
}
.essay p {
  margin: 0 0 1.15em;
  text-align: justify;
  text-justify: inter-ideograph;
}
.essay p:last-child { margin-bottom: 0; }
.sentence {
  border-radius: 0.28em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 0.45s ease, box-shadow 0.45s ease, color 0.45s ease;
  cursor: pointer;
}
.sentence:hover { background: color-mix(in srgb, var(--highlight) 45%, transparent); }
.sentence:focus-visible { outline-offset: 2px; }
.sentence.is-reading {
  background: var(--highlight);
  color: var(--highlight-ink);
  box-shadow: 0 0 0 3px var(--highlight);
}

button.vocab {
  display: inline;
  padding: 0 0.08em;
  margin: 0;
  border: 0;
  border-radius: 0.15em;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  box-shadow: inset 0 -0.18em 0 var(--accent-soft);
  border-bottom: 2px dotted var(--accent);
  min-height: 0;
}
button.vocab:hover, button.vocab:focus-visible {
  background: var(--accent-soft);
}

.source-credit {
  margin: 1.2rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

/* Note / word cards */
.note-card, .word-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.3rem;
  box-shadow: var(--shadow-soft);
}
.word-card h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.7rem;
}
.jyutping {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.8rem;
}
.word-card p, .note-card p { margin: 0 0 0.7rem; line-height: 1.8; }
.word-card p:last-child, .note-card p:last-child { margin-bottom: 0; }
.note-card + .note-card, .word-card + .word-card { margin-top: 0.8rem; }
.vocab-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}
.note-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

/* Dialog */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.45);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}
.dialog {
  width: min(32rem, 100%);
  max-height: min(80vh, 36rem);
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border-radius: 1.1rem 1.1rem 0.6rem 0.6rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.2rem 1.4rem;
}
.dialog h2 { margin: 0 0 0.2rem; font-family: var(--font-serif); font-size: 1.6rem; }
.dialog-close {
  float: right;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  border-radius: 999px;
  cursor: pointer;
}

/* Quiz */
.quiz-list { display: grid; gap: 1.1rem; }
.question {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.25rem;
}
.question h3 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  line-height: 1.65;
  font-weight: 700;
}
.q-num { color: var(--accent); margin-right: 0.3rem; }
.options { display: grid; gap: 0.5rem; }
.option, .judge-choice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  min-height: 44px;
  cursor: pointer;
  background: var(--bg);
}
.option:hover, .judge-choice:hover { border-color: var(--line-strong); }
.option input, .judge-choice input { margin-top: 0.3rem; accent-color: var(--accent); }
.option.is-correct, .judge-item.is-correct .judge-choice.is-picked {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.option.is-wrong, .judge-item.is-wrong .judge-choice.is-picked {
  border-color: var(--bad);
  background: var(--bad-bg);
}
textarea, .text-input {
  width: 100%;
  min-height: 8rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  line-height: 1.75;
  resize: vertical;
}
textarea:disabled, input:disabled, select:disabled, .text-input:disabled {
  color: var(--ink);
  background: var(--card);
  opacity: 0.85;
}
.char-count { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.char-count.out { color: var(--accent); font-weight: 700; }
.requirements { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.requirements li { margin: 0.2rem 0; }
.feedback {
  display: none;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.quiz-form.is-submitted .feedback { display: block; }
.feedback h4 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.feedback p, .feedback li { line-height: 1.8; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-bad { background: var(--bad-bg); color: var(--bad); }
.tag-ref { background: var(--accent-soft); color: var(--accent); }
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.sample-essay {
  font-family: var(--font-serif);
  line-height: 1.9;
  background: var(--bg);
  border-radius: 0.8rem;
  padding: 0.9rem 1rem;
}


/* Quiz in-page reread */
.reread-block {
  max-width: var(--read-width);
  margin-left: auto;
  margin-right: auto;
}
.reread-details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.reread-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.15rem;
  min-height: 44px;
  border-radius: var(--radius);
}
.reread-details > summary::-webkit-details-marker,
.reread-details > summary::marker { display: none; content: none; }
.reread-details[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.reread-kicker {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.reread-title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--ink);
  padding-right: 2.2rem;
  position: relative;
}
.reread-details > summary .reread-title::after {
  content: "▸";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 500;
}
.reread-details[open] > summary .reread-title::after { content: "▾"; }
.reread-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.98rem;
}
.reread-details > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.reread-body { padding: 1rem 1.15rem 1.25rem; }
.reread-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
}
.quiz-page .tts-panel,
.reread-block .tts-panel {
  position: static;
  top: auto;
}

/* Error / empty */
.empty, .error-box {
  padding: 1.5rem 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .hero, .bento-card, .section, .question {
    animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .bento-card:nth-child(2) { animation-delay: 0.05s; }
  .bento-card:nth-child(3) { animation-delay: 0.1s; }
  .bento-card:nth-child(4) { animation-delay: 0.15s; }
  .bento-card:nth-child(5) { animation-delay: 0.2s; }
  .bento-card:nth-child(6) { animation-delay: 0.25s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sentence { transition: none; }
  .btn, .bento-card { transition: none; }
  .btn:active, a.bento-card:hover { transform: none; }
}

/* Breakpoints — body text does not shrink on small screens */
@media (min-width: 640px) {
  .hero { padding: 2.2rem 2rem 2.1rem; }
  .dialog-backdrop { align-items: center; }
  .dialog { border-radius: 1.1rem; }
  .vocab-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 800px) {
  /* 離開「今日閱讀」後收起桌面黏性朗讀列，避免蓋住後面章節。佔位仍在原文位置，版面不會跳動。 */
  .tts-panel.is-away {
    visibility: hidden;
    pointer-events: none;
    top: -120vh;
  }
  .quiz-page .tts-panel,
  .reread-block .tts-panel {
    position: static;
    top: auto;
    visibility: visible;
    pointer-events: auto;
  }
  .bento { grid-template-columns: repeat(6, 1fr); }
  .span-6 { grid-column: span 6; }
  .span-4 { grid-column: span 4; }
  .span-3 { grid-column: span 3; }
  .span-2 { grid-column: span 2; }
  .hero-deco { inset: -8% -4% auto auto; width: 46%; height: 120%; }
}
@media (max-width: 799px) {
  .hero-deco {
    position: relative;
    inset: auto;
    width: min(16rem, 70%);
    margin: 0 0 1rem auto;
    opacity: 0.9;
  }
  .hero { display: flex; flex-direction: column; }
  /* 手機上朗讀列不跟隨捲動，避免遮住正文 */
  .tts-panel { position: static; }
}

@media (max-width: 520px) {
  .header-nav a.nav-hide-sm { display: none; }
}
