:root {
  --ink: #071a1c;
  --ink-2: #0d2b2e;
  --ink-3: #123b3d;
  --paper: #f6ecd6;
  --paper-2: #efe1c2;
  --paper-3: #e5d2a9;
  --text: #f3ead6;
  --muted: rgba(243, 234, 214, 0.66);
  --muted-2: rgba(243, 234, 214, 0.42);
  --dark: #2b2620;
  --dark-muted: #6b5d48;
  --gold: #e8c47a;
  --gold-2: #f5e3b0;
  --cinnabar: #b3453a;
  --cinnabar-2: #8e2f28;
  --jade: #7fb7a3;
  --jade-2: #a9d5c4;
  --line: rgba(243, 234, 214, 0.13);
  --line-dark: rgba(70, 52, 30, 0.16);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  --font-kai: "Kaiti TC", "Kaiti SC", "KaiTi", "STKaiti", "DFKai-SB", "BiauKai", "Noto Serif TC", serif;
  --font-song: "Songti TC", "Songti SC", "SimSun", "Noto Serif TC", serif;
  --font-ui: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  /* 拼音／粵拼／臺羅共用一套字形：不分語系、不分頁面，都是這個字體與這個比例。
     0.46em 跟著中文字大小走（字大就跟著大）；10px 是手機小字的底線，22px 是上限。 */
  --font-ann: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --ann-size: clamp(10px, 0.46em, 22px);
}

/* 注音符號專用字型：只收 37 個注音與 4 個聲調（7 KB），
   聲調是注音自己的筆形，不是拉丁字母上的重音符。
   來源：GenyoMinBopomofo（ButTaiwan/bpmfvs，Apache 2.0，見 assets/fonts/NOTICE.txt）。 */
@font-face {
  font-family: "Mochi Bopomofo";
  src: url("assets/fonts/bpmf-annot.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink);
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }
body.reader-open { overflow: hidden; }

/* ---------------- 文・圖・讀 ---------------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background: #07191a;
  /* 頂部遮罩：整條壓暗到 0.82，左上角標題不論底圖多亮都有一層夠深的底。 */
  --veil-a0: 0.82;
  --veil-a1: 0.18;
}
@keyframes readerIn { from { opacity: 0; } to { opacity: 1; } }
.reader-scene { position: absolute; inset: 0; z-index: 0; animation: readerIn 0.5s ease both; }
.reader-scene-layer {
  position: absolute;
  inset: -4%;
  opacity: 0;
  transition: opacity 0.85s ease;
  animation: kenBurns 34s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
.reader-scene-layer.is-front { opacity: 1; }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.07) translate3d(0, -1.2%, 0); } }
.reader-scene-layer svg { width: 100%; height: 100%; display: block; }
.reader-scene-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 20, 21, var(--veil-a0)) 0%, rgba(6, 20, 21, var(--veil-a1)) 24%, rgba(6, 20, 21, 0.06) 58%, rgba(6, 20, 21, 0.78) 100%);
}
.reader-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px clamp(16px, 4vw, 40px);
}
.reader-close.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  background: rgba(252, 247, 236, 0.97);
  color: #101614;
  border: 2px solid rgba(16, 22, 20, 0.55);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  flex: 0 0 auto;
}
/* 左上角底圖亮 → 深黑鈕；底圖暗 → 淺白鈕。 */
.reader[data-tone="bright"] .reader-close.icon-btn { background: rgba(8, 17, 18, 0.94); color: #fff; border-color: rgba(255, 255, 255, 0.85); }
.reader-meta { flex: 1 1 auto; min-width: 0; }
/* 左上角標題：固定米白字＋一圈深墨硬描邊。
   不再依底圖亮度換色：不管底下是多亮的天、多花的水，白字配黑邊都讀得出來。 */
.reader-kicker {
  font-family: var(--font-kai);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: #fff8e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow:
    0 1px 0 rgba(3, 10, 11, 0.95),
    0 -1px 0 rgba(3, 10, 11, 0.95),
    1px 0 0 rgba(3, 10, 11, 0.95),
    -1px 0 0 rgba(3, 10, 11, 0.95),
    0 0 6px rgba(3, 10, 11, 0.8),
    0 2px 6px rgba(0, 0, 0, 0.7);
}
.reader-pos {
  font-size: 0.76rem;
  color: #f7eeda;
  margin-top: 3px;
  white-space: nowrap;
  text-shadow:
    0 1px 0 rgba(3, 10, 11, 0.95),
    0 -1px 0 rgba(3, 10, 11, 0.9),
    1px 0 0 rgba(3, 10, 11, 0.9),
    -1px 0 0 rgba(3, 10, 11, 0.9),
    0 0 6px rgba(3, 10, 11, 0.75);
}
/* 版次下拉盒：只有同一篇有多套分鏡時才出現（例如將進酒 v1／v2）。 */
.reader-version { flex: 0 0 auto; }
.reader-version select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-kai);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: rgba(8, 17, 18, 0.62);
  border: 1px solid rgba(243, 234, 214, 0.32);
  border-radius: 999px;
  padding: 6px 26px 6px 12px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, rgba(243, 234, 214, 0.75) 50%),
    linear-gradient(135deg, rgba(243, 234, 214, 0.75) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  max-width: 42vw;
}
.reader-version select option { color: #101614; background: #f7efe0; }
.reader-version select:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.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;
}
.reader-cue {
  font-family: var(--font-kai);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  border: 1px solid rgba(243, 234, 214, 0.22);
  border-radius: 999px;
  padding: 5px 12px;
  flex: 0 0 auto;
}
.reader-body {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  padding: 12vh clamp(20px, 6vw, 90px) 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: center;
}
/* 電影字幕做法：整個畫面下方三分之一鋪一層透明漸層（含按鈕區），
   字清楚、圖不被蓋住，也不會有色塊接縫。 */
.reader-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reader-stage::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(180deg, rgba(4, 14, 15, 0) 0%, rgba(4, 14, 15, 0.35) 42%, rgba(4, 14, 15, 0.82) 100%);
  pointer-events: none;
  z-index: 1;
}
.reader-line {
  font-family: var(--font-kai);
  font-size: clamp(1.5rem, 3.6vw, 2.7rem);
  line-height: 1.7;
  letter-spacing: 0.05em;
  max-width: 26em;
  color: #fbf3df;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0 0.35em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 4px 18px rgba(0, 0, 0, 0.65),
    0 0 42px rgba(0, 0, 0, 0.45);
}
.reader-line [data-ci] { transition: color 0.18s ease, opacity 0.18s ease; opacity: 0.5; cursor: pointer; }
.reader-line.swap { animation: readerLineIn 0.45s ease both; }
@keyframes readerLineIn { from { opacity: 0.28; } to { opacity: 1; } }
.reader-line [data-ci].on { opacity: 1; }
/* 變色、發亮、放大都只給文字（.zi）；標點（.punc）只要亮起來（opacity 1），不變色也不放大。 */
.reader-line .zi.active {
  color: #f6cf82;
  opacity: 1;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(246, 207, 130, 0.55),
    0 0 36px rgba(246, 207, 130, 0.28);
}
/* 讀到的字也「跳」一下（與單篇同一條 keyframe），下一顆字亮起時這一顆回復原狀。
   只放大字本身：注音／拼音、顏色、淡入淡出都照舊。 */
.reader-line .zi { transition: color 0.18s ease, opacity 0.18s ease, transform 0.16s ease; transform-origin: 50% 70%; }
.reader-line .zi.active { transform: translateY(0) scale(1.12); animation: readCharJump .3s cubic-bezier(.2, .8, .3, 1); }
.reader-hint {
  font-size: 0.74rem;
  color: rgba(243, 234, 214, 0.62);
  max-width: 36em;
  line-height: 1.7;
  border-left: 2px solid rgba(232, 196, 122, 0.35);
  padding: 2px 10px;
  text-align: left;
  background: none;
  border-radius: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.reader-foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px clamp(16px, 4vw, 40px) 4px;
  flex: 0 0 auto;
  background: #071a1b;
  border-top: 1px solid rgba(232, 196, 122, 0.22);
}
.reader-foot .mini-btn {
  background: rgba(10, 30, 31, 0.5);
  border-color: rgba(243, 234, 214, 0.26);
  color: var(--text);
}
.reader-foot .mini-btn:hover { background: rgba(10, 30, 31, 0.72); color: var(--text); }
.reader-foot .mini-btn[disabled] { opacity: 0.35; }
.reader-play { min-width: 190px; justify-content: center; }
.reader-dots {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  flex: 0 0 auto;
  background: #071a1b;
  padding: 12px clamp(16px, 4vw, 40px) 26px;
}
.reader-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(243, 234, 214, 0.22);
  background: rgba(10, 30, 31, 0.45);
  color: var(--muted);
  font-size: 0.62rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.reader-dot.done { color: var(--gold-2); border-color: rgba(232, 196, 122, 0.35); }
.reader-dot.active { background: var(--gold-2); color: #2b2620; border-color: var(--gold-2); font-weight: 700; }
@media (max-width: 620px) {
  .reader-cue { display: none; }
  .rk-lead { display: none; }
  .reader-version select { max-width: 40vw; padding: 5px 22px 5px 10px; font-size: 0.72rem; }
  .reader-line { letter-spacing: 0.02em; }
  .reader-hint { display: none; }
}

/* 學新：句子旁邊的分鏡圖 */
.learn-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.learn-scene {
  margin: 4px 0 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  box-shadow: 0 12px 30px rgba(40, 30, 16, 0.14);
  aspect-ratio: 16 / 9;
  background: #efe1c2;
}
.learn-scene svg { width: 100%; height: 100%; display: block; animation: sceneIn 0.7s ease both; }
.learn-scene { position: relative; }
.learn-scene .scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: sceneIn 0.7s ease both; }
.reader-scene-layer .scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#app { position: relative; z-index: 2; }

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }
a { color: inherit; }

.muted { color: var(--muted); }
.paper .muted { color: var(--dark-muted); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; line-height: 1.7; color: var(--muted); }
.paper .tiny { color: rgba(70, 52, 30, 0.58); }
.center { text-align: center; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }
.full { width: 100%; justify-content: center; }

.page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 26px 26px 70px;
  position: relative;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.paper .kicker { color: #9a743c; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}
.eyebrow-line {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  display: inline-block;
}

/* ---------------- paper & buttons ---------------- */
.paper {
  position: relative;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.95), transparent 55%),
    radial-gradient(80% 70% at 100% 100%, rgba(196, 166, 115, 0.2), transparent 60%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  color: var(--dark);
  border: 1px solid rgba(99, 74, 42, 0.18);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}
.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(120, 90, 50, 0.08) 0 1px, transparent 1.4px),
    radial-gradient(circle at 70% 70%, rgba(120, 90, 50, 0.06) 0 1px, transparent 1.4px);
  background-size: 18px 18px, 26px 26px;
}
.paper > * { position: relative; z-index: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #bd4a3e, #8e2f28);
  color: #fff6e3;
  border-color: rgba(255, 226, 170, 0.22);
  box-shadow: 0 10px 26px rgba(142, 47, 40, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(142, 47, 40, 0.42); }
.btn-ghost {
  border-color: rgba(243, 234, 214, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}
.paper .btn-ghost {
  color: #3b3124;
  border-color: rgba(70, 52, 30, 0.24);
  background: rgba(255, 255, 255, 0.28);
}
.btn-danger {
  background: linear-gradient(135deg, #b3453a, #7d241f);
  color: #fff3dd;
}
.btn-lg { padding: 15px 28px; font-size: 1.03rem; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  transition: background 0.18s, transform 0.18s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.icon-btn:disabled { opacity: 0.25; cursor: default; }

.mini-btn {
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.3);
  color: #4c3d28;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: 0.18s;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.62); }
.link-btn {
  border: 0;
  background: none;
  color: #8e2f28;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.82rem;
  margin-top: 10px;
}

.seal {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, #bb4a3e, #8e2f28);
  color: #fff4dd;
  font-family: var(--font-kai);
  font-size: 1.45rem;
  line-height: 1;
  border: 2px solid rgba(255, 236, 200, 0.38);
  box-shadow: 0 4px 14px rgba(142, 47, 40, 0.28);
  transform: rotate(-3deg);
  flex: 0 0 auto;
}
.seal.small { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 6px; }
.seal-mini {
  width: 30px; height: 30px; border-radius: 5px;
  display: inline-grid; place-items: center;
  background: #a83a32; color: #fff3dd;
  font-family: var(--font-kai); font-size: 0.82rem;
  transform: rotate(-4deg); flex: 0 0 auto;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(70, 52, 30, 0.25);
  background: rgba(255, 255, 255, 0.38);
  color: var(--dark);
  font-family: var(--font-ui);
  font-size: 0.94rem;
}
.input.big { padding: 14px 16px; font-size: 1.1rem; }
select.input { cursor: pointer; }
.field { display: block; margin: 18px 0; font-size: 0.86rem; color: var(--dark-muted); }
.field .input { margin-top: 8px; }
.field-label { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--dark-muted); margin: 16px 0 8px; }

.form-row { display: flex; gap: 12px; align-items: end; }
.form-row label { flex: 1; font-size: 0.8rem; color: var(--dark-muted); }
.form-row .input { margin-top: 6px; }

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(70, 52, 30, 0.08);
  flex-wrap: wrap;
}
.seg {
  border: 0;
  background: transparent;
  color: #5d4a30;
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 0.84rem;
  transition: 0.18s;
}
.seg.active { background: #2f423c; color: #f7efdb; box-shadow: 0 4px 12px rgba(30, 45, 40, 0.22); }
.segmented.small .seg { padding: 5px 10px; font-size: 0.78rem; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  width: 40px; height: 22px; border-radius: 999px;
  background: rgba(70, 52, 30, 0.18);
  position: relative; transition: 0.2s;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #f8efd9; transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.switch input:checked + i { background: #4d7a6b; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch b { font-size: 0.78rem; font-weight: 500; color: var(--dark-muted); }

.progress { height: 9px; border-radius: 999px; background: rgba(70, 52, 30, 0.14); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7fb7a3, #e8c47a); transition: width 0.5s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--dark-muted); margin-bottom: 6px; }
.mini-progress { height: 5px; border-radius: 999px; background: rgba(70, 52, 30, 0.14); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, #7fb7a3, #c9a86a); }

/* ---------------- hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 30px;
  align-items: center;
  min-height: 480px;
  padding: 20px 4px 10px;
}
.hero-copy h1 {
  font-family: var(--font-kai);
  font-size: clamp(1.85rem, 3.4vw, 3.5rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin: 16px 0 18px;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.ink-accent { color: var(--gold-2); }
.hero-sub {
  max-width: 35rem;
  color: var(--muted);
  line-height: 1.9;
  font-size: 0.98rem;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.hero-chips span {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
  color: var(--muted);
}
.hero-chips b { color: var(--gold-2); font-size: 1rem; margin-right: 2px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-note { margin-top: 16px; font-size: 0.78rem; color: var(--muted-2); }

.koi-stage {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  border: 1px solid rgba(232, 196, 122, 0.12);
  background:
    radial-gradient(circle at 50% 52%, rgba(127, 183, 163, 0.14), transparent 58%),
    radial-gradient(circle at 50% 100%, rgba(232, 196, 122, 0.08), transparent 55%);
  overflow: hidden;
}
.koi-stage::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(232, 196, 122, 0.1);
  border-radius: 24px;
  pointer-events: none;
}
.koi-moon {
  position: absolute;
  top: 7%;
  right: 9%;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8df, #f0dfb3 58%, #d9c38b 100%);
  box-shadow: 0 0 60px rgba(240, 223, 179, 0.2);
  opacity: 0.9;
}
.koi-svg { width: 100%; max-width: 570px; position: relative; z-index: 2; overflow: visible; }
.koi-swim { animation: koiFloat 7.5s ease-in-out infinite; transform-origin: 50% 60%; }
.koi-svg.mood-happy .koi-swim { animation-duration: 4.8s; }
.koi-svg.mood-proud .koi-swim { animation-duration: 3.8s; filter: drop-shadow(0 0 16px rgba(232, 196, 122, 0.4)); }
.koi-svg.mood-gentle .koi-swim { animation-duration: 10s; }
.koi-bubbles { animation: bubbles 4.5s ease-in-out infinite; }
.koi-caption {
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(7, 26, 28, 0.62);
  border: 1px solid rgba(232, 196, 122, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  color: var(--text);
  z-index: 3;
}
.koi-caption-label { color: var(--gold); font-family: var(--font-kai); white-space: nowrap; }
.scale-count {
  position: absolute;
  top: 16px; left: 16px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(7, 26, 28, 0.5);
  border: 1px solid var(--line);
  text-align: center;
  z-index: 3;
}
.scale-count b { display: block; font-family: var(--font-kai); font-size: 1.7rem; color: var(--gold-2); line-height: 1; }
.scale-count span { font-size: 0.68rem; color: var(--muted); }

/* ---------------- home cards ---------------- */
.home-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 20px; margin-top: 24px; }
.today-card { padding: 26px; }
.today-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.today-actions .btn { flex: 1 1 170px; justify-content: center; }
.today-more { margin-top: 10px; }
.today-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.today-date { font-size: 0.8rem; color: var(--dark-muted); }
.streak-pill {
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(168, 58, 50, 0.08);
  color: #8e2f28;
  font-size: 0.72rem;
  border: 1px solid rgba(168, 58, 50, 0.14);
}
.today-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 20px 0 14px; }
.today-title-row h2 { font-family: var(--font-kai); font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.2; }
.order-badge {
  font-family: var(--font-kai);
  font-size: 3.2rem;
  line-height: 0.9;
  color: rgba(70, 52, 30, 0.13);
  flex: 0 0 auto;
}
.progress-block { margin: 10px 0 18px; }
.route {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0;
}
.route-step {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(70, 52, 30, 0.045);
  border: 1px solid transparent;
  text-align: center;
  position: relative;
  min-width: 0;
}
.route-step.active { border-color: rgba(168, 58, 50, 0.22); background: rgba(168, 58, 50, 0.055); }
.route-step.done { background: rgba(77, 122, 107, 0.07); }
.route-dot {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  margin: 0 auto 5px;
  background: rgba(70, 52, 30, 0.12);
  font-size: 0.68rem; color: #5d4a30;
}
.route-step.active .route-dot { background: #a83a32; color: #fff3dd; }
.route-step.done .route-dot { background: #4d7a6b; color: #f7efdb; }
.route-step > span:not(.route-dot) { display: block; font-size: 0.8rem; font-weight: 600; }
.route-step small { display: block; font-size: 0.64rem; color: var(--dark-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 0.7rem; color: var(--dark-muted); flex-wrap: wrap; }

.path-card { padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-head h2, .card-head h3 { font-family: var(--font-kai); font-size: 1.45rem; }
.stage-groups { display: grid; gap: 12px; margin-top: 18px; }
.stage-group { padding: 9px 10px; border-radius: 12px; background: rgba(70, 52, 30, 0.035); }
.stage-group.current { background: rgba(168, 58, 50, 0.055); border: 1px solid rgba(168, 58, 50, 0.12); }
.stage-label { font-size: 0.7rem; color: var(--dark-muted); margin-bottom: 7px; letter-spacing: 0.05em; }
.stage-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-dot {
  width: 27px; height: 27px;
  border-radius: 50%;
  border: 1px solid rgba(70, 52, 30, 0.18);
  background: transparent;
  color: #6b5d48;
  font-size: 0.66rem;
  cursor: pointer;
  transition: 0.18s;
}
.stage-dot:hover { transform: translateY(-2px); border-color: #a83a32; }
.stage-dot.done { background: #c9a86a; border-color: #b08a48; color: #2b2620; }
.stage-dot.started { background: rgba(77, 122, 107, 0.22); border-color: #4d7a6b; color: #2b2620; }
.stage-dot.current { box-shadow: 0 0 0 3px rgba(168, 58, 50, 0.14); border-color: #a83a32; }
.path-foot { display: flex; justify-content: space-between; margin-top: 14px; font-size: 0.72rem; color: var(--dark-muted); }

.star-section { margin-top: 22px; padding: 24px; }
.star-map { width: 100%; height: auto; display: block; margin: 8px 0; }
.star-node { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform 0.2s; }
.star-node:hover { transform: scale(1.18); }
.star-node.current circle:first-child { animation: starPulse 2.2s ease-in-out infinite; }
.star-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.72rem; color: var(--dark-muted); }
.star-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(70, 52, 30, 0.18); display: inline-block; }
.dot.done { background: #c9a86a; }
.dot.current { background: #a83a32; }

.home-foot { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.foot-quote { display: flex; align-items: center; gap: 14px; }
.foot-quote p { font-family: var(--font-kai); font-size: 1.3rem; color: var(--text); }
.foot-quote small { display: block; font-family: var(--font-ui); font-size: 0.7rem; color: var(--muted); margin-top: 3px; letter-spacing: 0.08em; }
.foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- session ---------------- */
.session {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 22px 40px;
  display: flex;
  flex-direction: column;
}
.session-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 18px; }
.stage-dots-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.stage-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  opacity: 0.42;
  transition: 0.2s;
}
.stage-pill span {
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.65rem;
  border: 1px solid var(--line);
}
.stage-pill b { font-size: 0.76rem; font-weight: 500; }
.stage-pill.active { opacity: 1; background: rgba(232, 196, 122, 0.1); }
.stage-pill.active span { background: var(--cinnabar); border-color: transparent; color: #fff3dd; }
.stage-pill.done { opacity: 0.82; }
.stage-pill.done span { background: #4d7a6b; border-color: transparent; }
.stage-line { width: 16px; height: 1px; background: var(--line); display: inline-block; }
.session-main { flex: 1; display: grid; place-items: center; padding: 6px 0 24px; }
.session-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 0.72rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

.stage-card {
  width: min(880px, 100%);
  padding: 34px 38px;
  animation: fadeUp 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stage-kicker { font-size: 0.7rem; letter-spacing: 0.16em; color: #9a743c; margin-bottom: 10px; }
.stage-card h2 { font-family: var(--font-kai); font-size: clamp(1.6rem, 3.3vw, 2.35rem); line-height: 1.25; }
.stage-lede { margin-top: 14px; line-height: 1.9; color: #4a4032; font-size: 0.98rem; }
.stage-icon { font-size: 2.4rem; color: #c9a86a; margin: 12px 0 8px; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; }
.stage-card.center .stage-actions { justify-content: center; }

.review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.review-seal {
  width: 66px; height: 66px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(168, 58, 50, 0.08);
  border: 1px solid rgba(168, 58, 50, 0.22);
  color: #8e2f28;
  font-family: var(--font-kai);
  font-size: 1.15rem;
  line-height: 1.1;
  text-align: center;
  padding: 6px;
  flex: 0 0 auto;
  transform: rotate(-2deg);
}
.memory-veil {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  min-height: 92px;
  padding: 18px;
  margin-top: 20px;
  border-radius: 14px;
  border: 1px dashed rgba(70, 52, 30, 0.24);
  background: rgba(70, 52, 30, 0.035);
}
.hint-char {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(70, 52, 30, 0.1);
  font-family: var(--font-kai);
  font-size: 1.25rem;
  color: #6b5533;
}
.hint-char.read { color: #b08a48; }
.hint-char.active { color: #a83a32; background: rgba(232, 196, 122, 0.5); border-color: rgba(168, 58, 50, 0.28); transform: translateY(-1px); }
.memory-veil.no-hint { color: var(--dark-muted); }

/* 溫故清單：今天有哪幾篇完篇可以複習 */
.review-list { margin-bottom: 18px; padding: 12px 14px; border-radius: 14px; background: rgba(70, 52, 30, 0.04); border: 1px solid rgba(70, 52, 30, 0.1); }
.review-list-label { font-size: 0.72rem; letter-spacing: 0.08em; color: #9a743c; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.review-list-label span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: rgba(168, 58, 50, 0.12); color: #8e2f28; font-size: 0.66rem; padding: 0 4px; }
.review-list-items { display: flex; flex-wrap: wrap; gap: 8px; }
.review-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(70, 52, 30, 0.14); background: rgba(255, 255, 255, 0.5); cursor: pointer; text-align: left; font: inherit; color: #4a4032; transition: border-color 0.15s, background 0.15s; }
.review-item:hover { border-color: rgba(168, 58, 50, 0.4); }
.review-item.active { border-color: rgba(168, 58, 50, 0.6); background: rgba(232, 196, 122, 0.22); }
.review-item b { font-family: var(--font-kai); font-size: 1rem; }
.review-item small { font-size: 0.68rem; color: #8a7a5e; }

.review-prompt { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: rgba(127, 183, 163, 0.1); border: 1px dashed rgba(77, 122, 107, 0.3); }
.prompt-text { font-family: var(--font-kai); font-size: 1.5rem; color: #4d7a6b; letter-spacing: 0.08em; }

/* 溫昨：逐級提示格 */
.veil-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.veil-pos { font-size: 0.9rem; color: #4a4032; }
.veil-pos b { color: #8e2f28; font-size: 1.05rem; }
.veil-grid { align-items: flex-start; gap: 6px; justify-content: flex-start; }
.veil-seg { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 34px; padding: 5px 6px; border-radius: 8px; border: 1px solid rgba(70, 52, 30, 0.14); background: rgba(255, 255, 255, 0.5); cursor: pointer; font: inherit; color: #6b5533; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.veil-seg:hover { border-color: rgba(168, 58, 50, 0.4); }
.veil-seg.focus { border-color: rgba(168, 58, 50, 0.6); background: rgba(232, 196, 122, 0.28); transform: translateY(-1px); }
.veil-seg.full { background: rgba(127, 183, 163, 0.16); border-color: rgba(77, 122, 107, 0.3); }
.veil-no { font-size: 0.56rem; color: #9a743c; line-height: 1; }
.veil-chars { font-family: var(--font-kai); font-size: 0.95rem; line-height: 1.2; max-width: 10em; overflow-wrap: anywhere; }

/* 學新：上一句（已熟） */
.learn-prev { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(70, 52, 30, 0.04); border: 1px dashed rgba(70, 52, 30, 0.16); }
.learn-prev-copy p { font-family: var(--font-kai); font-size: 1.05rem; color: #8a7a5e; line-height: 1.6; }

/* 首頁今日預覽 */
.today-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.preview-item { flex: 1 1 0; min-width: 88px; text-align: center; padding: 10px 8px; border-radius: 12px; background: rgba(70, 52, 30, 0.05); font-size: 0.74rem; color: #6b5d48; }
.preview-item b { display: block; font-family: var(--font-kai); font-size: 1.4rem; color: #8e2f28; line-height: 1.2; }

.learn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.learn-sentence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1px;
  min-height: 190px;
  padding: 24px 8px;
  margin: 14px 0;
  font-family: var(--font-kai);
  font-size: clamp(1.75rem, 4.2vw, 3.1rem);
  line-height: 1.65;
  text-align: center;
  letter-spacing: 0.02em;
}
/* 讀到的字「跳」一下 —— 與新加坡雲 v90（使用者指定好看的版本）逐字相同：
   抬起的就是那顆字本身：translateY(-4px) scale(1.08)、transition .12s，
   一次只抬一顆，下一顆亮起時前一顆落回。注音／拼音不跟著抬（跟 v90 一樣只有字在跳）。 */
.zi { display: inline-block; transition: color 0.12s, transform 0.12s, text-shadow 0.12s, background 0.12s; cursor: pointer; border-radius: 4px; }
.zi:hover, .punc:hover { color: #a83a32; background: rgba(168,58,50,.08); }
.zi.read { color: #b08a48; }
.zi.lit {
  color: #a83a32;
  transform: translateY(-4px) scale(1.08);
  text-shadow: 0 6px 20px rgba(232, 196, 122, 0.5);
}
/* 學新逐字三段色（照新加坡 v90 的顯示）：未讀＝原文黑、正在讀＝紅＋放大、讀過＝淺咖啡。
   有注音／拼音時，標音跟著字換同一個顏色；抬起的仍然只有字本身。 */
#learn-sentence .ann.read-group .ann-py,
#learn-sentence .ann.read-group .ann-jy,
#learn-sentence .ann.read-group .ann-tl,
#learn-sentence .ann.read-group .ann-zy,
#learn-sentence .ann.read-group .ann-tone { color: #b08a48; }
#learn-sentence .ann.lit-group .ann-py,
#learn-sentence .ann.lit-group .ann-jy,
#learn-sentence .ann.lit-group .ann-tl,
#learn-sentence .ann.lit-group .ann-zy,
#learn-sentence .ann.lit-group .ann-tone { color: #a83a32; }
.punc { color: #9a743c; opacity: 0.75; cursor: pointer; transition: color .12s, background .12s; }
.learn-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.learn-dots { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; margin-top: 18px; }
.learn-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(70, 52, 30, 0.18);
  background: transparent;
  color: #6b5d48;
  font-size: 0.7rem;
  cursor: pointer;
}
.learn-dot.active { background: #a83a32; border-color: transparent; color: #fff3dd; }
.learn-dot.visited { background: rgba(77, 122, 107, 0.18); }
.teacher-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(127, 183, 163, 0.1);
  border: 1px solid rgba(77, 122, 107, 0.14);
}
.teacher-block + .teacher-block { margin-top: 14px; }
.teacher-label { display: block; font-size: 0.7rem; letter-spacing: 0.1em; color: #4d7a6b; margin-bottom: 4px; }
.teacher-panel p { font-size: 0.9rem; line-height: 1.8; color: #4a4032; }
.learn-ready { margin-top: 22px; padding-top: 18px; border-top: 1px dashed rgba(70, 52, 30, 0.18); text-align: center; }
.learn-ready .btn { margin-top: 10px; }

.record-scroll { max-height: 330px; overflow-y: auto; margin: 16px 0 4px; padding-right: 6px; }
/* 第四站錄音卡：注音／拼音開關跟單篇一樣放在卡片內（標題右側），不要留在書課頁首。 */
.record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.record-head-copy { min-width: 0; }
.record-head .annotation-btn { flex: 0 0 auto; margin-top: 3px; }
.record-line { display: flex; gap: 12px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid rgba(70, 52, 30, 0.1); }
.record-line > span { font-size: 0.68rem; color: #9a743c; flex: 0 0 26px; }
.record-line.reading { background: rgba(232, 196, 122, 0.12); border-radius: 8px; }
.record-line p { font-family: var(--font-kai); font-size: 1.8rem; line-height: 1.6; }

/* 課文注音／拼音：繁體注音放在字右邊（直書），簡體拼音放在字下方。
   注音／拼音用自己的字體（不用楷體），小字才看得清楚。
   台灣注音的聲調放在整串注音的右邊（垂直置中），不是放在第一個符號頭上。 */
.ann { position: relative; }
.ann-zhuyin { display: inline-flex; align-items: center; gap: 0.08em; padding-right: 0.5em; }
/* 單篇的欄寬有限：注音間距收窄一點，讓「10 字 + 2 標點」能排在同一行。 */
.text-detail .ann-zhuyin { padding-right: 0.3em; }
.ann-zhuyin .ann-base { position: relative; }
.ann-zy-col { position: relative; display: inline-block; line-height: 1; }
.ann-zy {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: "Mochi Bopomofo", "Microsoft JhengHei", "PMingLiU", var(--font-kai), sans-serif;
  font-size: 1em;
  line-height: 1;
  color: #4a3418;
  font-weight: 400;
  letter-spacing: 0;
  user-select: none;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.18);
}
.ann-tone {
  position: absolute;
  right: -1.05em;
  /* 聲調符號貼在注音字串的右下角；用 bottom 錨定，字級放大時才不會跟著往上飄。 */
  bottom: 0;
  font-family: "Mochi Bopomofo", "Microsoft JhengHei", "PMingLiU", var(--font-kai), sans-serif;
  font-size: 1em;
  line-height: 1;
  color: #4a3418;
  font-weight: 400;
  user-select: none;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.18);
}
/* 輕聲的點（˙）維持在注音字串中間：它不是四聲，掉到右下角會像標點。 */
.ann-tone.tone-neutral {
  bottom: auto;
  top: 60%;
  transform: translateY(-50%);
}
/* ── 拼音／粵拼／臺羅：三種語系共用一套字形 ─────────────────────
   同一個字體（--font-ann）、同一個粗細（400）、同一個字距（0）、
   同一個比例（--ann-size：0.46em，跟著中文字大小走，10px 下限、22px 上限）。
   所以「單篇」「文・圖・讀」「背誦預讀（字大）」看到的是同一種字母，
   只是字大的地方拼音也等比例大一點。 */
.ann-pinyin, .ann-jyutping, .ann-tailo {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.06em; margin: 0 0.06em;
}
.ann-py, .ann-jy, .ann-tl {
  font-family: var(--font-ann);
  font-size: var(--ann-size);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
  white-space: nowrap;
  user-select: none;
}
/* 語系只用顏色分，不動字形：拼音墨褐、粵拼青、臺羅赭。 */
.ann-pinyin .ann-py { color: #4a3418; }
.ann-jyutping .ann-jy { color: #2f5d62; }
.ann-tailo .ann-tl { color: #7a4a3a; }

/* 文・圖・讀的背景是分鏡圖（多為深色）：注音與拼音都換成亮金色＋深色陰影。
   注音是直書的注音符號，維持粗體（700，不動）；
   拼音／粵拼／臺羅在這一頁用 300（Light）——深色底圖＋黑描邊會讓 400 看起來偏粗；
   但 300 單獨看又太細（使用者回饋），所以補一條 0.01em 的極細同色描邊：
   20px 字級時約 0.2px，實測墨水覆蓋 1423（300）→ 1694，剛好落在 300 與 400（1982）中間。
   這是 2026-11-24 使用者指定的唯一例外；單篇、學新、錄音頁仍是 400。 */
.reader-line .ann-zy,
.reader-line .ann-tone {
  color: #f6cf82;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 2px 12px rgba(0, 0, 0, 0.75);
}
.reader-line .ann-py,
.reader-line .ann-jy,
.reader-line .ann-tl {
  color: #f6cf82;
  font-weight: 300;
  -webkit-text-stroke: 0.01em currentColor;
  paint-order: stroke fill;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 2px 12px rgba(0, 0, 0, 0.75);
}

/* 拼音在字下方會多佔一點高度，補行高；注音已與字齊平，不需要多加內距。 */
.learn-sentence:has(.ann) { line-height: 2; }
.record-line p:has(.ann) { line-height: 2; }
.text-detail-body .detail-line p:has(.ann) { line-height: 2.1; }

.session-top-actions { display: flex; align-items: center; gap: 8px; }
/* 書課右上角：注音／拼音和繁／簡是同一組「顯示」設定，所以做成同一種膠囊——
   同字級（桌機 .72rem／手機 .66rem）、同內距、同圓角、同高度，兩顆並排不會一高一低。
   不用開關圖示、也不寫「開／關」：關＝只有細框沒有底色，開＝整顆填金（和繁／簡選中同一色）。
   字級與內距刻意和 .script-btn 對齊，改那邊就要一起改。 */
.session-top-actions .annotation-btn,
.record-head .annotation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
}
/* 只在還沒開的時候換框色與字色：底色一律代表狀態，滑鼠移過去不會多出一塊底色，
   不然「剛關掉、游標還停在上面」會看起來像半開。 */
.session-top-actions .annotation-btn:not(.active):hover,
.record-head .annotation-btn:not(.active):hover {
  border-color: rgba(232, 196, 122, 0.55);
  color: var(--text);
}
.session-top-actions .annotation-btn.active,
.record-head .annotation-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #2b2116;
  font-weight: 600;
  letter-spacing: 0.04em;
}
/* 錄音卡在米色紙上：關閉時不能只剩一條淡框（站長回報「幾乎不見了」）。
   關＝米白底＋暗紅描邊＋暗紅字＋空心圓；開＝整顆填金＋實心圓。
   圓點本身就是狀態，不必再寫「開／關」。 */
.record-head .annotation-btn {
  background: rgba(168, 58, 50, 0.10);
  border: 1.5px solid rgba(142, 47, 40, 0.62);
  color: #8e2f28;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(70, 52, 30, 0.08);
}
.record-head .annotation-btn::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}
.record-head .annotation-btn:not(.active):hover {
  background: #fffdf6;
  border-color: #8e2f28;
  color: #6f211c;
}
.record-head .annotation-btn.active {
  background: var(--gold);
  border-color: #a8792f;
  color: #2b2116;
}
.record-head .annotation-btn.active::before { background: currentColor; }
/* 單篇文章的按鈕在米色紙上，維持原本的暗紅 active */
.text-detail .annotation-btn.active { background: rgba(168, 58, 50, 0.14); color: #8e2f28; border-color: rgba(168, 58, 50, 0.38); }

.done-hero { display: flex; align-items: center; gap: 18px; margin: 14px 0 18px; }
.done-koi { width: 220px; flex: 0 0 auto; }
.done-card h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.done-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }
.done-scores > div {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: rgba(70, 52, 30, 0.05);
}
.done-scores span { display: block; font-family: var(--font-kai); font-size: 1.8rem; color: #8e2f28; line-height: 1; }
.done-scores small { display: block; font-size: 0.68rem; color: var(--dark-muted); margin-top: 5px; }
.reward-unlock { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; margin: 18px 0; }
.reward-art svg { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 16px 36px rgba(70, 52, 30, 0.18); }
.reward-copy h3 { font-family: var(--font-kai); font-size: 1.6rem; margin: 4px 0 8px; }
.quote { font-family: var(--font-kai); font-size: 1.08rem; line-height: 1.7; color: #6b5533; margin-bottom: 10px; }
.done-progress { margin: 18px 0; }

/* ---------------- score ---------------- */
.score-sheet { padding: 26px 28px 24px; }
.score-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.score-head h2 { font-family: var(--font-kai); font-size: 1.5rem; }
.score-main { display: flex; gap: 20px; align-items: center; margin: 16px 0 10px; }
.score-num {
  font-family: var(--font-kai);
  font-size: 5.2rem;
  line-height: 1;
  color: #a83a32;
  min-width: 100px;
  text-align: center;
  text-shadow: 0 8px 26px rgba(168, 58, 50, 0.16);
}
.score-num.empty { color: #9a743c; }
.score-copy h3 { font-family: var(--font-kai); font-size: 1.35rem; margin-bottom: 6px; }
.score-stars { display: flex; gap: 2px; margin-top: 8px; color: rgba(70, 52, 30, 0.2); font-size: 1rem; }
.score-stars i.on { color: #c9a86a; font-style: normal; }
.score-stars i { font-style: normal; }
.weak-box { margin: 16px 0; padding: 14px 16px; border-radius: 12px; background: rgba(168, 58, 50, 0.055); border: 1px solid rgba(168, 58, 50, 0.1); }
.weak-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(70, 52, 30, 0.08); }
.weak-row:last-child { border-bottom: 0; }
.weak-row > span { font-size: 0.68rem; color: #9a743c; }
.weak-row p { font-family: var(--font-kai); font-size: 1rem; line-height: 1.5; }
.manual-rate { margin: 14px 0; padding-top: 14px; border-top: 1px dashed rgba(70, 52, 30, 0.16); }
.rate-buttons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.rate-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(70, 52, 30, 0.18);
  background: rgba(255, 255, 255, 0.3);
  color: #5d4a30;
  font-size: 0.8rem;
  cursor: pointer;
}
.rate-btn.active { background: #a83a32; color: #fff3dd; border-color: transparent; }
.score-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------------- library / rewards ---------------- */
.page-head { display: flex; align-items: center; gap: 16px; padding: 10px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-kai); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; }
.head-stat { margin-left: auto; text-align: right; }
.head-stat b { display: block; font-family: var(--font-kai); font-size: 1.9rem; color: var(--gold-2); line-height: 1; }
.head-stat span { font-size: 0.72rem; color: var(--muted); }
.page-lede { max-width: 780px; color: var(--muted); line-height: 1.8; margin-bottom: 16px; }
.library-stage { margin-top: 24px; }
.library-stage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.library-stage-head h2 { font-family: var(--font-kai); font-size: 1.3rem; color: var(--gold-2); }
.library-stage-head span { font-size: 0.72rem; color: var(--muted); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 13px; }
.text-card {
  text-align: left;
  padding: 15px 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(243, 234, 214, 0.055);
  color: var(--text);
  cursor: pointer;
  transition: 0.2s;
}
.text-card:hover { transform: translateY(-3px); border-color: rgba(232, 196, 122, 0.42); background: rgba(243, 234, 214, 0.08); }
.text-card.done { border-color: rgba(232, 196, 122, 0.34); background: rgba(232, 196, 122, 0.07); }
.text-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.text-card .order { font-family: var(--font-kai); font-size: 0.85rem; color: var(--gold); }
.text-card .status { font-size: 0.64rem; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.text-card h3 { font-family: var(--font-kai); font-size: 1.35rem; margin-bottom: 3px; }
.text-card p { font-size: 0.72rem; }
.text-card .mini-progress { margin: 13px 0 9px; background: rgba(255, 255, 255, 0.08); }
.text-card-foot { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); }

.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.reward-card {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}
.reward-card .reward-art { border-radius: 12px; overflow: hidden; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25); transition: 0.2s; }
.reward-card:hover .reward-art { transform: translateY(-3px) rotate(-0.4deg); }
.reward-card.locked { opacity: 0.5; }
.reward-card.locked:hover { opacity: 0.7; }
.ink-card-svg { width: 100%; height: auto; display: block; }
.reward-meta { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px 0; }
.reward-meta h3 { font-family: var(--font-kai); font-size: 1.15rem; }
.reward-meta p { font-size: 0.7rem; color: var(--muted); }
.reward-quote { font-family: var(--font-kai); font-size: 0.86rem; color: var(--muted); margin: 5px 2px 0; }

/* ---------------- text detail ---------------- */
/* 單篇對話框：最高 90vh（內容少時自己收斂），內文框把剩下的高度吃完。 */
.text-detail { padding: 22px 26px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
/* 左：內文（看字優先）；右：橫幅＋版本。版本以後會愈來愈多，所以做成直的清單。 */
.text-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
}
.text-detail-main { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.text-detail-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.text-detail .text-detail-art { margin: 0; flex: 0 0 auto; }
/* 字體版本（爭議字）：側欄可摺疊面板；只影響顯示，不改讀音。 */
.variant-box { border: 1px solid rgba(70, 52, 30, 0.14); border-radius: 10px; padding: 8px 10px; background: rgba(255, 253, 247, 0.7); }
.variant-box-button { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.variant-box > summary { cursor: pointer; font-family: var(--font-kai); font-size: 0.95rem; color: #4c3d28; }
.variant-box .muted.small { margin: 6px 0 8px; font-size: 0.72rem; line-height: 1.5; }
.variant-row { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-top: 1px dashed rgba(70, 52, 30, 0.12); }
.variant-ctx { font-family: var(--font-kai); font-size: 0.9rem; color: #5a4a33; }
.variant-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.variant-box .mini-btn.active { background: #a83a32; color: #fff; border-color: #a83a32; }
/* 選完就地換字時，那一顆字閃一下，讓「已經變了」看得見（不影響版面）。 */
.variant-flash { animation: variantFlash 0.85s ease; }
@keyframes variantFlash {
  0% { background: rgba(168, 58, 50, 0.26); border-radius: 0.18em; }
  60% { background: rgba(168, 58, 50, 0.14); border-radius: 0.18em; }
  100% { background: transparent; border-radius: 0.18em; }
}
.text-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.text-detail-head h2 { font-family: var(--font-kai); font-size: 2rem; }
.text-detail-head .icon-btn { color: #4c3d28; background: rgba(70, 52, 30, 0.05); border-color: rgba(70, 52, 30, 0.16); }
.detail-head-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.detail-back { display: none; }
.detail-lang-pick { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; color: #7a6850; white-space: nowrap; }
.detail-lang-pick select { height: 30px; width: auto; min-width: 92px; padding: 0 8px; font-size: 0.72rem; border-radius: 8px; }
.detail-read-version { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.68rem; color: #7a6850; }
.detail-read-version .mini-btn { font-size: 0.7rem; padding: 5px 9px; }
/* 朗讀版本（人教／古詩詞版）：選中的那一顆要「填色」，兩個版本各一個顏色，
   沒選的是描邊——一眼就知道現在讀的是哪一版（2026-11-28 使用者要求）。 */
.detail-read-version .mini-btn.active { color: #fff; font-weight: 600; }
.detail-read-version .mini-btn.active[data-version="cn"] { background: #a83a32; border-color: #a83a32; }
.detail-read-version .mini-btn.active[data-version="poem"] { background: #2f6f5e; border-color: #2f6f5e; }
.detail-read-version .mini-btn.active:hover { filter: brightness(1.06); }
/* 已選但那一版音檔還沒齊（例：剛切過來）：仍看得出選了誰，只是淡一點。 */
.detail-read-version .mini-btn.active[disabled] { opacity: 0.72; cursor: default; }
.detail-read-version .mini-btn[disabled]:not(.active) { opacity: 0.38; }
.detail-lang-lock { font-size: 0.68rem; color: #8b765a; white-space: nowrap; }
@media (max-width: 640px) {
  /* 手機的習慣：左上「← 返回」、標題靠左，語言與注音收成同一排 chips。
     原本是右上角 ×、注音、讀音語系三個直排，佔掉三列、把內文往下壓。 */
  .text-detail-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 8px; align-items: start; }
  .detail-back { display: grid; }
  .detail-head-main { grid-column: 2; min-width: 0; }
  .detail-head-right { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; margin-top: 10px; }
  .detail-head-right .detail-close { display: none; }
  .detail-lang-pick { gap: 5px; }
  .detail-lang-pick select { height: 30px; min-width: 0; padding: 0 24px 0 10px; border-radius: 999px; font-size: .76rem; }
  .detail-lang-lock { font-size: .68rem; }
}
.text-detail-meta { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 0.72rem; color: var(--dark-muted); }
.text-detail-meta .mini-progress { flex: 1; }
.detail-edited-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 12px; padding: 7px 11px; border-radius: 9px;
  background: rgba(232, 196, 122, 0.16); border: 1px solid rgba(154, 116, 60, 0.28);
  font-size: 0.7rem; line-height: 1.6; color: #6b5334;
}
.detail-edited-note .link-btn { margin: 0; padding: 0; font-size: 0.7rem; }
.text-detail-intro { padding: 10px 13px; border-radius: 12px; background: rgba(127, 183, 163, 0.1); margin-bottom: 8px; flex: 0 0 auto; }
.text-detail-intro p { font-size: 0.82rem; line-height: 1.7; color: #4a4032; }
.text-detail-intro p + p { margin-top: 6px; }

/* 鎖住的文章（試讀）：兩個「看方案」入口用同一個 .plan-link，
   只差位置與大小；外框、字體、紅墨色都跟紙面同一套，不再用沒有樣式的 .notice。 */
.trial-strip {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  margin: 0 0 9px;
  padding: 9px 11px 9px 10px;
  border: 1px solid rgba(154, 116, 60, 0.26);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.94), rgba(246, 235, 213, 0.7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 0 rgba(70, 52, 30, 0.03);
}
.trial-seal {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, #bb4a3e, #8e2f28);
  color: #fff3dd;
  font-family: var(--font-kai);
  font-size: 0.8rem;
  line-height: 1.05;
  letter-spacing: 0.04em;
  transform: rotate(-3deg);
  box-shadow: 0 3px 8px rgba(142, 47, 40, 0.18);
}
.trial-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trial-copy b {
  font-family: var(--font-kai);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #3b2d1c;
  line-height: 1.35;
}
.trial-copy span { font-size: 0.69rem; line-height: 1.5; color: #7a6850; }
.plan-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 5px 11px;
  border: 1px solid rgba(142, 47, 40, 0.3);
  border-radius: 999px;
  background: rgba(255, 251, 241, 0.65);
  color: #8e2f28;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.plan-link:hover { background: #8e2f28; border-color: #8e2f28; color: #fff6e3; transform: translateY(-1px); }
.plan-link .plan-arrow { font-size: 0.9em; line-height: 1; transition: transform 0.18s ease; }
.plan-link:hover .plan-arrow { transform: translateX(2px); }
.side-offer {
  position: relative;
  padding: 11px 12px 11px 14px;
  border: 1px solid rgba(154, 116, 60, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(246, 236, 214, 0.5));
  overflow: hidden;
}
.side-offer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #c9a25f, #a83a32);
  opacity: 0.65;
}
.side-offer-kicker { margin: 0 0 3px; font-family: var(--font-kai); font-size: 0.82rem; letter-spacing: 0.1em; color: #6b5334; }
.side-offer-copy { margin: 0 0 8px; font-size: 0.68rem; line-height: 1.65; color: #7a6850; }
.side-offer-list { margin: 0 0 9px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.side-offer-list li { position: relative; padding-left: 11px; font-size: 0.68rem; line-height: 1.55; color: #6b5334; }
.side-offer-list li::before { content: ""; position: absolute; left: 1px; top: 0.62em; width: 4px; height: 4px; border-radius: 50%; background: rgba(168, 58, 50, 0.55); }
.side-offer .plan-link { padding: 4px 10px; font-size: 0.7rem; }
.plan-inline { color: #8e2f28; text-decoration: none; border-bottom: 1px solid rgba(142, 47, 40, 0.35); padding-bottom: 1px; white-space: nowrap; }
.plan-inline:hover { color: #a83a32; border-color: #a83a32; }
.detail-trial-note { align-self: center; font-size: 0.72rem; color: #8b765a; letter-spacing: 0.02em; white-space: nowrap; }
/* 單篇內文：以「整句」為單位捲動（app.js 捲的是 .detail-line，不是單字），
   這樣一句兩行也不會只露一行。底邊留一小段淡出，讓還沒唸到的下一句是「淡出」而不是被硬切。
   scroll-padding 讓 scrollIntoView／手動捲動停在句子邊界。 */
/* 單篇內文框：高度＝目前這幾段的實際高度（fitDetailView 依注音／拼音／純文字現量現排），
   頂端停在句首、底端停在句尾，任何狀態都不會有半個字；高度變化走短 transition，捲動由 detailScrollTo 緩動。 */
.text-detail-body { max-height: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-anchor: none; padding-right: 8px; }
/* 貼合後「高度由 JS 決定」：flex:0 0 auto 才不會被 flex-grow 撐回整個可用高度。 */
.text-detail-body.fitted { flex: 0 0 auto; }
/* 桌機（v270 以前）不裁底邊：手機轉換層會對文字區寫 inline clip-path，
   這裡只在寬螢幕把它關掉，手機（≤640px／data-mobile）不受影響。 */
@media (min-width: 761px) {
  .text-detail-body, .text-detail-layout { clip-path: none !important; }
  /* 試讀只有 3 句：留一點高度給第 3 句，不要讓它被框底切掉。 */
  .text-detail.is-locked { max-height: 92vh; }
  /* 聽全文播放中：下面那排只留「■ 停止」和「關閉」，其他功能先收起來不給按；
     按停止就全部回來。 */
  .text-detail-actions.is-listening > *:not(.listening):not(.modal-close) { display: none; }
}
/* 矮螢幕（常見 1366×768）：簡介與點字提示先讓位，3 句試讀才進得了框；
   平板／手機不套用（手機走 mobile.css 的轉換層）。 */
@media (min-width: 761px) and (max-height: 820px) {
  .text-detail.is-locked { max-height: 98vh; }
  .text-detail.is-locked .text-detail-intro,
  .text-detail.is-locked .detail-read-tip { display: none; }
  /* 矮螢幕／瀏覽器放大時，試讀字級跟著視窗高度收一點：
     三個「段」都要進框，不能讓第 3 段被框底切掉。一般 900px 以上不動。 */
  .text-detail.is-locked .detail-line { padding: 7px 0; }
  .text-detail.is-locked .detail-line p { font-size: clamp(1.3rem, 3.15vh, 1.7rem); line-height: 1.8; }
}
/* 內文框的垂直捲軸：跟宣紙／墨色同一套（細、圓、半透明墨褐；滑過轉深、拖曳時轉朱紅），
   不要用系統預設那條灰白粗條。track 透明，thumb 離邊 2px，看起來像浮在紙上的一粒墨。 */
.text-detail-body::-webkit-scrollbar { width: 10px; height: 10px; }
.text-detail-body::-webkit-scrollbar-track { background: transparent; margin-block: 6px; }
.text-detail-body::-webkit-scrollbar-thumb {
  background: rgba(70, 52, 30, 0.24);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  transition: background .18s ease;
}
.text-detail-body::-webkit-scrollbar-thumb:hover { background: rgba(70, 52, 30, 0.4); background-clip: padding-box; }
.text-detail-body::-webkit-scrollbar-thumb:active { background: rgba(179, 69, 58, 0.52); background-clip: padding-box; }
.text-detail-body::-webkit-scrollbar-corner { background: transparent; }
/* Firefox 只吃這兩個屬性（Chrome／Edge 若設了它們會蓋掉上面的 ::-webkit-scrollbar，所以分開寫） */
@supports (-moz-appearance: none) {
  .text-detail-body { scrollbar-width: thin; scrollbar-color: rgba(70, 52, 30, 0.3) transparent; }
}
.detail-line { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 9px 0; border-bottom: 1px solid rgba(70, 52, 30, 0.08); scroll-margin-block: 2px; }
.detail-line > span { font-size: 0.66rem; color: #9a743c; padding-top: 6px; }
.detail-line p { font-family: var(--font-kai); font-size: 1.7rem; line-height: 2; color: #4a4032; }
.detail-line.learned p { color: #2b2620; }
/* 朗讀游標只過場「顏色」與「放大」，底色一律瞬間換位。
   以前 transition 含 background，換字時舊框淡出、新框淡入，兩個半透明框同時存在，
   看起來就是「框忽有忽無、閃一下」；框跟著字瞬間跳過去才俐落。 */
.detail-line .read-char { font-size: inherit; color: inherit; cursor: pointer; border-radius: 3px; transition: color .1s, transform .16s ease; }
.detail-line.reading { background: rgba(232, 196, 122, 0.12); border-radius: 8px; }
.detail-line .read-char:hover { color: #a83a32; background: rgba(168,58,50,.08); }
/* 變大、變色只給文字（.zi）；標點（.punc）永遠原文色，只跟著亮度走。 */
.detail-line .zi.read { color: #b08a48; }
.detail-line .zi.active { color: #a83a32; }
/* 單篇：讀到的字「跳」一下，然後停在放大＋紅色的狀態，等下一顆字接手。
   每一顆字都重新起一次 keyframe：先輕輕彈高、再落到 1.12 倍，看起來才是「字在跳」，
   而不是只把同一個放大框換位置。只動字本身，注音／拼音、底色、捲動都照舊。 */
@keyframes readCharJump {
  0%   { transform: translateY(0) scale(1); }
  45%  { transform: translateY(-2px) scale(1.12); }
  100% { transform: translateY(0) scale(1.12); }
}
.detail-line .zi.active {
  color: #a83a32;
  transform: translateY(0) scale(1.12);
  transform-origin: 50% 70%;
  animation: readCharJump .3s cubic-bezier(.2, .8, .3, 1);
  will-change: transform;
  backface-visibility: hidden;
}
/* 前一顆字退場要「立刻回到讀過色」，不要拖 0.1 秒和下一顆紅字重疊；
   這是「前字不要閃爍」的主要來源。 */
.detail-line .zi.read { transition: color .05s linear, transform .12s ease; }
/* 其他頁（文・圖・讀、句卡）仍用這組通用游標色。 */
.read-char { border-radius: 3px; transition: color .1s ease, background .1s ease; }
.read-char.zi.read { color: #b08a48; }
.read-char.zi.active { color: #a83a32; }
/* 錄音頁「今日新句」的游標字：節奏要跟單篇閱全文同一個（跳一下、停在 1.16 倍）。
   以前只有變色、沒有放大與過場，看起來是「換一格」而不是「字跳起來」。 */
.record-line .read-char { cursor: default; transition: color .1s ease, transform .16s ease; }
.record-line .zi.active { transform: translateY(0) scale(1.12); transform-origin: 50% 70%; animation: readCharJump .3s cubic-bezier(.2, .8, .3, 1); }
/* 朗讀底色框是選配（家長 → 學習 → 朗讀底色框，預設不顯示）。
   預設只變紅＋放大，念過轉淺咖啡，不墊底色；要墊才加上 .with-char-box。
   框不要跟著整條 line-height 長：以前背景畫在 .zi 的內容框上，框高 57–64px，
   下面拼音／粵拼／臺羅就在框底，看起來快被壓到。現在用 ::before 畫一個
   1.35em 高、垂直置中的小框，文字排版與注音位置完全不動。 */
.with-char-box .zi.active {
  position: relative;
  z-index: 0;
  isolation: isolate;
  background: none;
  box-shadow: none;
}
.with-char-box .zi.active::before {
  content: "";
  position: absolute;
  left: -0.08em;
  right: -0.08em;
  top: 50%;
  height: 1.35em;
  transform: translateY(-50%);
  border-radius: 0.18em;
  background: rgba(232, 196, 122, .46);
  box-shadow: 0 0 0 1px rgba(168, 58, 50, .16);
  z-index: -1;
  pointer-events: none;
}
/* 讀字高亮三段（家長 → 讀字高亮）：red＝只紅、big＝紅＋放大、bg＝紅＋放大＋底色。
   預設 big；底色沿用 .with-char-box，所以這裡只負責「關掉放大」與「學習頁的底色」。 */
body[data-hl="red"] .detail-line .zi.active,
body[data-hl="red"] .reader-line .zi.active,
body[data-hl="red"] .record-line .zi.active,
body[data-hl="red"] #learn-sentence .zi.lit {
  transform: none;
  animation: none;
  text-shadow: none;
}
body[data-hl="bg"] #learn-sentence .zi.lit {
  background: rgba(232,196,122,.46);
  box-shadow: 0 0 0 1px rgba(168,58,50,.16);
}
.detail-read-tip { color: #9a743c; margin: 4px 0 8px; }
/* 內文框（listbox）與下面按鈕列之間的間隙：桌機縮小一點，不要把版面撐開。 */
.text-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; flex: 0 0 auto; }
/* 對話框的「關閉」放在動作按鈕同一排、被推到最右緣：與左邊按鈕同一顆 .btn（等高），
 * 中間的空白就是間隙；不要把它黏在上一顆按鈕旁邊。手機在下面收起（只留右上 ×）。 */
.text-detail-actions .modal-close { margin-left: auto; }
/* 單篇「聽全文」旁邊的角色選單：和按鈕同高（39px）、同一顆膠囊，不用另外一個開關區塊。 */
.read-role { display: inline-flex; align-items: center; margin: 0; }
.read-role-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 30px 12px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.34);
  background-image: linear-gradient(45deg, transparent 50%, #7a6a50 50%), linear-gradient(135deg, #7a6a50 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: #4c3d28;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.read-role-select:hover { background-color: rgba(255, 255, 255, 0.5); }
.read-role-select:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
/* 文章頁的分鏡版本：兩張縮圖並排，按一下切換。 */
.detail-versions { margin-top: 16px; }
.detail-versions-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.version-row { display: flex; gap: 10px; flex-wrap: wrap; }
.version-card {
  flex: 1 1 190px;
  max-width: 280px;
  padding: 0;
  border: 1px solid rgba(70, 52, 30, 0.22);
  border-radius: 12px;
  overflow: hidden;
  background: #f7efdc;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.version-card img { display: block; width: 100%; height: 86px; object-fit: cover; }
.version-card span {
  display: block;
  padding: 7px 10px 8px;
  font-family: var(--font-kai);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #3a2f22;
}
.version-card:hover { transform: translateY(-1px); border-color: rgba(70, 52, 30, 0.45); }
.version-card.active { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(232, 196, 122, 0.55); }
.version-card.active span { background: rgba(232, 196, 122, 0.22); font-weight: 700; }
@media (max-width: 640px) {
  .version-card { flex: 1 1 140px; }
  .version-card img { height: 70px; }
}
/* 文章頁右欄：版本做成「直的縮圖清單」，以後加真人版／動漫版／實劇版也不會擠。 */
.text-detail-side .detail-versions { margin-top: 0; display: flex; flex-direction: column; min-height: 0; }
.text-detail-side .detail-versions-head { margin-bottom: 6px; flex-direction: column; gap: 2px; align-items: flex-start; }
.text-detail-side .version-row { flex-direction: column; flex-wrap: nowrap; gap: 8px; overflow-y: auto; min-height: 0; }
.text-detail-side .version-card { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; max-width: none; padding: 5px; border-radius: 10px; }
.text-detail-side .version-card img { width: 76px; height: 46px; border-radius: 6px; flex: 0 0 auto; }
.text-detail-side .version-card .v-text { padding: 0; font-size: 0.75rem; line-height: 1.3; }
.version-card .v-text { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; }
.version-card .v-text b { font-family: var(--font-kai); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.03em; color: #3a2f22; }
.version-card .v-text i { font-style: normal; font-size: 0.68rem; color: #8b765a; }
.version-card.active span { background: transparent; }

/* 手機：橫幅縮成小 banner、版本變成橫向 chips，把高度留給內文。 */
@media (max-width: 760px) {
  .text-detail { padding: 14px 12px; max-height: 94vh; }
  .text-detail-layout { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; min-height: 0; }
  .text-detail-side { order: 0; flex: 0 0 auto; flex-direction: column; gap: 6px; overflow: visible; }
  .text-detail-main { order: 1; flex: 1 1 auto; min-height: 0; }
  .text-detail .text-detail-art { height: 68px; aspect-ratio: auto; border-radius: 9px; }
  .text-detail-side .detail-versions { flex: 0 0 auto; }
  .text-detail-side .detail-versions-head { flex-direction: row; align-items: baseline; gap: 8px; margin-bottom: 2px; }
  .text-detail-side .detail-versions-head span:last-child { display: none; }
  .text-detail-side .version-row { flex-direction: row; overflow-x: auto; padding-bottom: 2px; gap: 6px; -webkit-overflow-scrolling: touch; }
  .text-detail-side .version-card { flex: 0 0 auto; padding: 3px; max-width: none; }
  .text-detail-side .version-card img { width: 34px; height: 24px; }
  .text-detail-side .version-card .v-text { font-size: 0.62rem; }
  .text-detail-side .version-card .v-text b { font-size: 0.66rem; white-space: nowrap; }
  .text-detail-side .version-card .v-text i { display: none; }
  .text-detail-actions .modal-close { display: none; }
  .text-detail-intro { padding: 6px 9px; margin-bottom: 4px; }
  .text-detail-intro p { font-size: 0.72rem; line-height: 1.55; }
  .text-detail-intro p + p { display: none; }
  .trial-strip { gap: 9px; padding: 8px 9px; margin-bottom: 7px; }
  .trial-seal { width: 30px; height: 30px; font-size: 0.72rem; }
  .trial-copy b { font-size: 0.86rem; }
  .trial-copy span { font-size: 0.64rem; }
  .plan-link { padding: 4px 9px; font-size: 0.68rem; }
  .side-offer { margin-top: 10px; }
  .side-offer .plan-link { font-size: 0.68rem; }
  .detail-trial-note { white-space: normal; font-size: 0.68rem; }
  .text-detail.is-listening .trial-strip,
  .text-detail.is-listening .side-offer { display: none; }
  /* 聽全文時把「畫面／版本」那一塊縮成一條 40px 的小縮圖列（縮到邊邊），
     簡介也收起來，整個高度讓給內文；按停止或唸完就還原。 */
  .text-detail.is-listening .text-detail-side {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: 40px;
    overflow: hidden;
  }
  .text-detail.is-listening .text-detail-side .text-detail-art {
    width: 56px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 8px;
  }
  .text-detail.is-listening .detail-versions { min-width: 0; overflow: hidden; }
  .text-detail.is-listening .detail-versions-head { display: none; }
  .text-detail.is-listening .version-row { gap: 4px; overflow: hidden; }
  .text-detail.is-listening .version-card { padding: 2px; }
  .text-detail.is-listening .version-card img { width: 30px; height: 22px; }
  .text-detail.is-listening .version-card .v-text { display: none; }
  .text-detail.is-listening .text-detail-intro { display: none; }
  .text-detail.is-listening { height: 94vh; }
  .text-detail.is-listening .text-detail-layout { margin-top: 4px; }
  .detail-read-tip { display: none; }
  /* 單篇頁（可聽全文）：手機把內文放大到 24px（原本 20px），
     跟著唸、背誦時字要夠大；注音開著時一行約 7–8 字，長句自然折行。
     文・圖・讀是另一個全螢幕頁，不動。 */
  .detail-line p { font-size: 1.5rem; line-height: 1.85; }
  /* 單篇：字＋標點綁在一起（views.js 的 groupPunct），標點不會掉到下一行開頭。 */
  .detail-line .nb { white-space: nowrap; }
  .detail-line { padding: 9px 0; }
  .detail-line > span { padding-top: 9px; }
  .text-detail-actions { margin-top: 10px; gap: 6px; }
  .text-detail-actions .btn { padding: 9px 12px; font-size: 0.84rem; }
  /* 按「聽全文」之後，手機上只留「■ 停止」一顆（其他按鈕、版本、聲音選單、
     語系標籤全部先收起來），停止或唸完就還原；畫面小，一次只做一件事。
     桌機的同一條規則在 ≥761 那一段（連 .modal-close 一起留），手機的關閉在標題列右上。 */
  .text-detail-actions.is-listening > *:not(.listening) { display: none; }
  .text-detail-actions.is-listening .btn.listening { flex: 1 1 auto; justify-content: center; }
  /* 「聽全文（說書人）」在手機只留「聽全文」：聲線在旁邊的「聲音」選單就選得到，
     整串字讓三顆鈕擠成兩列不划算。桌機照舊顯示。 */
  .text-detail-actions .role-suffix { display: none; }
  .read-role-select { padding: 9px 26px 9px 11px; font-size: 0.8rem; }
}

/* ---------------- parent ---------------- */
.parent { width: min(1120px, 100%); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }
@media (max-width: 760px) {
  .tabs { flex-wrap: wrap; overflow: visible; gap: 2px; }
  .tab { padding: 9px 10px; font-size: .72rem; }
}
.parent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.parent-card { padding: 22px; }
.parent-card.wide { grid-column: 1 / -1; }
.expert-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border: 1px dashed rgba(154, 116, 60, 0.35); border-radius: 10px; background: rgba(232, 196, 122, 0.1); }
.expert-entry .kicker { margin-bottom: 3px; }
.expert-entry .small { margin: 0; max-width: 560px; }
.parent-card h3 { font-family: var(--font-kai); font-size: 1.3rem; margin-bottom: 4px; }
.parent-card hr { border: 0; border-top: 1px dashed rgba(70, 52, 30, 0.16); margin: 16px 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(70, 52, 30, 0.1); }
.setting-row > span { font-size: 0.84rem; color: #4a4032; }
.setting-row > span b { color: #8e2f28; margin-left: 4px; }
.setting-row input[type="range"] { width: 150px; accent-color: #a83a32; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.file-btn { position: relative; overflow: hidden; }
.progress-table { margin-top: 12px; }
.progress-row { display: grid; grid-template-columns: 28px 1.5fr 1fr 40px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(70, 52, 30, 0.08); }
.pr-order { font-size: 0.66rem; color: #9a743c; }
.pr-main b { display: block; font-family: var(--font-kai); font-size: 1rem; font-weight: 500; }
.pr-main small { font-size: 0.66rem; color: var(--dark-muted); }
.pr-bar { height: 6px; border-radius: 999px; background: rgba(70, 52, 30, 0.12); overflow: hidden; }
.pr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fb7a3, #c9a86a); }
.pr-pct { font-size: 0.68rem; color: var(--dark-muted); text-align: right; }
.voice-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 16px; }
.voice-card {
  border: 1px solid rgba(70, 52, 30, 0.16);
  background: rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  color: #4a4032;
}
.voice-card b { display: block; font-family: var(--font-kai); font-size: 1.05rem; }
.voice-card small { display: block; font-size: 0.66rem; color: var(--dark-muted); margin-top: 3px; }
.voice-badge { display: block; margin-top: 6px; font-style: normal; font-size: 0.58rem; letter-spacing: 0.04em; color: #9a876b; }
.voice-badge.on { color: #8e2f28; font-weight: 600; }
.voice-card.active { border-color: #a83a32; background: rgba(168, 58, 50, 0.06); box-shadow: 0 0 0 2px rgba(168, 58, 50, 0.08); }
/* 單一聲線的語系（閩南語）：角色固定，四張卡片都 disabled；只有使用中的那張保持清楚。 */
.voice-card:disabled { cursor: not-allowed; opacity: 0.5; filter: saturate(0.6); }
.voice-card.active:disabled { opacity: 1; filter: none; }
.voice-card:disabled .voice-badge { color: #9a876b; }
.danger-card { border-color: rgba(168, 58, 50, 0.2); }
.about-copy p { font-size: 0.92rem; line-height: 1.9; color: #4a4032; margin: 8px 0; }
.about-copy h2 { font-family: var(--font-kai); font-size: 2rem; margin-bottom: 12px; }
.about-copy h3 { margin-top: 18px; }
.about-copy ul { padding-left: 1.2rem; color: #4a4032; line-height: 1.9; font-size: 0.9rem; }

/* ---------------- onboarding / pin ---------------- */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(3, 12, 14, 0.48);
  backdrop-filter: blur(7px);
}
.onboarding-card { width: min(660px, 100%); padding: 32px 34px; border-radius: 26px; animation: modalIn 0.4s ease; }
.onboarding-top { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-kai); font-size: 1.1rem; }
.onboarding-progress { display: flex; gap: 5px; margin: 18px 0 24px; }
.onboarding-progress i { flex: 1; height: 4px; border-radius: 999px; background: rgba(70, 52, 30, 0.12); }
.onboarding-progress i.on { background: linear-gradient(90deg, #a83a32, #c9a86a); }
.onboarding-card h1 { font-family: var(--font-kai); font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.3; margin: 4px 0 10px; }
.age-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.age-btn, .daily-btn {
  border: 1px solid rgba(70, 52, 30, 0.16);
  background: rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  color: #4a4032;
  font-family: var(--font-kai);
  font-size: 1.2rem;
}
.age-btn small, .daily-btn small { display: block; font-family: var(--font-ui); font-size: 0.66rem; color: var(--dark-muted); margin-top: 2px; }
.age-btn.active, .daily-btn.active { border-color: #a83a32; background: rgba(168, 58, 50, 0.06); box-shadow: 0 0 0 2px rgba(168, 58, 50, 0.08); }
.daily-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.daily-btn b { display: block; font-size: 1.7rem; line-height: 1; color: #8e2f28; }
.daily-btn span { font-size: 0.72rem; }
.onboarding-voices { grid-template-columns: repeat(4, 1fr); }
.onboarding-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; justify-content: flex-end; }
.pin-display { display: flex; justify-content: center; gap: 12px; margin: 22px 0 18px; }
.pin-display i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(70, 52, 30, 0.28); background: transparent; }
.pin-display i.on { background: #a83a32; border-color: #a83a32; box-shadow: 0 0 0 4px rgba(168, 58, 50, 0.1); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; margin: 0 auto; }
.pin-key {
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(70, 52, 30, 0.16);
  background: rgba(255, 255, 255, 0.32);
  color: #4a4032;
  font-size: 1.3rem;
  cursor: pointer;
}
.pin-key:active { background: rgba(168, 58, 50, 0.1); }
.pin-key.ghost { color: #8e2f28; }
.pin-modal { position: relative; padding: 28px; text-align: center; }
.pin-close { position: absolute; top: 12px; right: 12px; }
.pin-error { color: #a83a32; font-size: 0.8rem; margin: 6px 0; }
.pin-modal .btn.full { margin-top: 16px; }

/* ---------------- modal / toast / effects ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 10, 12, 0.66);
  backdrop-filter: blur(9px);
  overflow-y: auto;
  animation: fadeIn 0.22s ease;
}
.modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background:
    radial-gradient(90% 80% at 10% 0%, rgba(255, 252, 242, 0.96), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  color: var(--dark);
  border: 1px solid rgba(99, 74, 42, 0.2);
  border-radius: 24px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
  animation: modalIn 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-pad { padding: 26px 28px; }
.modal-kicker { font-size: 0.7rem; letter-spacing: 0.16em; color: #9a743c; margin-bottom: 6px; }
.modal h2 { font-family: var(--font-kai); font-size: 1.6rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .btn-ghost { color: #3b3124; border-color: rgba(70, 52, 30, 0.24); background: rgba(255, 255, 255, 0.28); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 200;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(7, 26, 28, 0.9);
  color: var(--text);
  border: 1px solid rgba(232, 196, 122, 0.22);
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
}
.petal {
  position: absolute;
  left: var(--x);
  top: -30px;
  font-size: var(--size);
  color: var(--gold-2);
  opacity: 0;
  animation: petalFall var(--dur) ease-in var(--delay) forwards;
  text-shadow: 0 0 12px rgba(232, 196, 122, 0.5);
}
.petal:nth-child(3n) { color: #e8a6a0; }
.petal:nth-child(4n) { color: var(--jade-2); }

/* ---------------- animations ---------------- */
@keyframes koiFloat {
  0%, 100% { transform: translate(0, 0) rotate(-0.6deg); }
  50% { transform: translate(6px, -10px) rotate(1.2deg); }
}
@keyframes bubbles {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-10px); opacity: 0.35; }
}
@keyframes starPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes petalFall {
  0% { opacity: 0; transform: translate(0, -20px) rotate(0); }
  10% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--dx), 105vh) rotate(var(--rot)); }
}

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 10px; }
  .koi-stage { min-height: 330px; }
  .home-grid { grid-template-columns: 1fr; }
  .parent-grid { grid-template-columns: 1fr; }
  .reward-unlock { grid-template-columns: 1fr; }
  .done-hero { flex-direction: column; align-items: flex-start; }
  .done-koi { width: 180px; }
  .voice-presets { grid-template-columns: repeat(2, 1fr); }
  .onboarding-voices { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .page { padding: 16px 14px 50px; }
  .hero { padding-top: 6px; }
  .hero-copy h1 { font-size: 1.85rem; }
  .hero-sub { font-size: 0.9rem; }
  .koi-stage { min-height: 280px; border-radius: 22px; }
  .koi-moon { width: 86px; height: 86px; }
  .koi-caption { font-size: 0.7rem; padding: 8px 10px; }
  .scale-count { top: 10px; left: 10px; padding: 6px 9px; }
  .scale-count b { font-size: 1.3rem; }
  .today-card, .path-card, .star-section { padding: 18px; border-radius: 16px; }
  .route { grid-template-columns: repeat(2, 1fr); }
  .order-badge { font-size: 2.4rem; }
  .home-foot { flex-direction: column; align-items: flex-start; }
  .stage-card { padding: 22px 18px; border-radius: 16px; }
  .stage-dots-bar { gap: 2px; }
  .stage-pill { padding: 4px 6px; }
  .stage-pill b { display: none; }
  .stage-line { width: 8px; }
  .learn-sentence { font-size: 1.75rem; min-height: 150px; padding: 16px 2px; }
  .learn-actions { gap: 6px; }
  .learn-actions .btn { padding: 10px 14px; }
  .done-scores { grid-template-columns: repeat(2, 1fr); }
  .score-main { flex-direction: column; align-items: flex-start; gap: 6px; }
  .score-num { min-width: 0; font-size: 4.2rem; }
  .score-sheet { padding: 20px 18px; }
  .modal { border-radius: 18px; }
  .text-detail { padding: 20px 18px; }
  .onboarding { padding: 10px; }
  .onboarding-card { padding: 22px 18px; border-radius: 20px; }
  .daily-grid { grid-template-columns: repeat(3, 1fr); }
  .age-grid { grid-template-columns: repeat(2, 1fr); }
  .onboarding-voices { grid-template-columns: repeat(2, 1fr); }
  .library-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .text-card { padding: 12px; }
  .text-card h3 { font-size: 1.1rem; }
  .reward-grid { grid-template-columns: 1fr; }
  .progress-row { grid-template-columns: 24px 1.3fr 1fr auto; }
  .progress-row .pr-pct { display: none; }
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 1.8rem; }
  .head-stat b { font-size: 1.4rem; }
  .setting-row { flex-wrap: wrap; }
  .setting-row input[type="range"] { width: 100%; }
}

/* 書課頁首：一列放不下時（平板窄邊與手機）固定分兩列——
   ← 與右上控制一列、站點一列。多一顆繁／簡也不會把注音鈕壓成兩三行、站點斷行。 */
@media (max-width: 760px) {
  .session-top { flex-wrap: wrap; row-gap: 4px; padding-bottom: 10px; }
  .session-top > .icon-btn:first-child { order: 1; }
  .session-top-actions { order: 2; margin-left: auto; gap: 6px; }
  .stage-dots-bar {
    order: 3; flex: 1 1 100%;
    justify-content: flex-start; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
  }
  .stage-dots-bar::-webkit-scrollbar { display: none; }
  .session-top-actions .annotation-btn,
  .record-head .annotation-btn { min-width: 40px; padding: 5px 8px; font-size: .66rem; }
  .record-head { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------- print ---------------- */
#print-area { display: none; }
@media print {
  @page { size: A5; margin: 12mm; }
  body { background: #fff; color: #111; }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area {
    display: block;
    position: absolute;
    inset: 0;
    padding: 10mm;
    font-family: "KaiTi", "STKaiti", "Songti TC", serif;
    color: #111;
  }
  .print-card {
    border: 1.5px solid #8e2f28;
    border-radius: 8px;
    padding: 10mm;
    background: #fffdf6;
  }
  .print-card h1 { font-size: 26pt; margin-bottom: 4mm; }
  .print-card .print-sub { font-size: 11pt; color: #555; margin-bottom: 8mm; }
  .print-card .print-line { font-size: 17pt; line-height: 2.1; border-bottom: 0.3mm dashed #ccc; padding: 1mm 0; }
  .print-card .print-foot { font-size: 9pt; color: #777; margin-top: 8mm; }
}

/* ---------------- take / score / text modal sizing ---------------- */
.modal.take-modal-wrap { width: min(680px, 100%); background: linear-gradient(160deg, #0f2d30, #071a1c); color: var(--text); border-color: rgba(232,196,122,.18); }
.modal .muted { color: var(--dark-muted); }
.modal .tiny { color: rgba(70, 52, 30, 0.58); }
.modal.take-modal-wrap .muted, .modal.take-modal-wrap .tiny { color: var(--muted); }
.modal.take-modal-wrap h2 { color: var(--text); }
.modal.take-modal-wrap .btn-ghost { color: var(--text); border-color: rgba(243,234,214,.24); background: rgba(255,255,255,.05); }
.take-sheet { padding: 28px 30px; text-align: center; }
.take-sheet h2 { font-family: var(--font-kai); font-size: 1.6rem; color: var(--text); }
.take-orb { position: relative; margin: 18px auto 6px; display: grid; place-items: center; }
#take-wave { width: 100%; height: auto; max-height: 180px; border-radius: 18px; background: rgba(255,255,255,.025); border: 1px solid rgba(232,196,122,.1); }
.take-ring { position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 1px solid rgba(232,196,122,.15); animation: takeRing 2.6s ease-out infinite; pointer-events: none; }
.take-timer { font-family: var(--font-kai); font-size: 2.6rem; color: var(--gold-2); letter-spacing: .08em; margin-top: 6px; }
.take-hint { color: var(--muted); font-size: .86rem; line-height: 1.7; min-height: 2.8em; margin: 6px 0; }
.take-note { color: #e8c47a; background: rgba(232,196,122,.08); border: 1px solid rgba(232,196,122,.28); border-radius: 10px; font-size: .8rem; line-height: 1.7; margin: 4px 0 10px; padding: 8px 10px; text-align: left; }
.take-note b { color: #f5ecd2; }
.take-actions { display: flex; gap: 10px; justify-content: center; margin: 16px 0 8px; }
.take-sheet .btn-ghost { color: var(--text); border-color: rgba(243,234,214,.22); }
.take-sheet .tiny { color: var(--muted); }
.modal.score-modal-wrap { width: min(720px, 100%); }
.modal.text-modal-wrap { width: min(880px, 100%); }
/* 單篇「閱全文」：文字框再寬 20px（880 → 900），左欄內文跟著 +20px；墨寶頁不受影響。 */
.modal.text-detail-modal { width: min(900px, 100%); }
.modal.pin-modal-wrap { width: min(420px, 100%); }
.reward-detail .reward-art { border-radius: 14px; overflow: hidden; }
@keyframes takeRing { 0% { transform: scale(.72); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }


/* ---------------- home top bar / parent tip ---------------- */
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 0; }
.home-top .brand { font-size: 1.05rem; }
.home-top .brand .seal { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 6px; }
.home-top-actions { display: flex; align-items: center; gap: 7px; }
.home-top-actions .mini-btn { background: rgba(255,255,255,.05); color: var(--text); border-color: var(--line); }
.home-top-actions .mini-btn:hover { background: rgba(255,255,255,.1); }

/* 全站繁／簡字形切換：深色硯池底上有時會壓到亮底圖（硯池的月亮、分鏡圖），
   所以給它一層薄暗底，兩邊的字都讀得清楚。 */
.script-toggle { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: 0 0 auto; background: rgba(7,26,28,.72); }
.script-btn { border: 0; background: transparent; color: var(--muted); font-family: var(--font-ui); font-size: .72rem; line-height: 1; padding: 6px 9px; cursor: pointer; min-width: 28px; }
.script-btn.active { background: var(--gold); color: #2b2116; font-weight: 600; }
.script-btn + .script-btn { border-left: 1px solid var(--line); }
@media (max-width: 760px) {
  .script-btn { padding: 5px 7px; font-size: .66rem; min-width: 26px; }
}
.sound-icon { width: 34px; height: 34px; font-size: .9rem; }
.parent-tip { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(127,183,163,.1); border: 1px solid rgba(77,122,107,.14); }
.parent-tip p { font-size: .84rem; line-height: 1.8; color: #4a4032; margin-top: 4px; }
.parent-grid { align-items: start; }

/* ---------------- score koi / reward word ---------------- */
.score-koi { width: 190px; flex: 0 0 auto; margin-left: auto; align-self: center; }
.score-koi .koi-svg { width: 100%; max-width: 190px; }
.reward-word { font-family: var(--font-kai); font-size: 1.12rem; line-height: 1.6; color: #8e2f28; margin: 6px 0 6px; }
@media (max-width: 640px) {
  .score-koi { width: 120px; margin: 0 auto; }
  .score-koi .koi-svg { max-width: 120px; }
}


/* ---------------- hero balance / score mood ---------------- */
.hero-copy h1 { text-wrap: balance; }
.score-sheet[data-mood="proud"] .score-num { text-shadow: 0 0 34px rgba(232,196,122,.6), 0 8px 26px rgba(168,58,50,.2); }
.score-sheet[data-mood="happy"] .score-num { animation: scoreBounce .9s cubic-bezier(.2,.8,.2,1); }
.score-sheet[data-mood="gentle"] .score-num { color: #9a743c; text-shadow: none; }
.score-sheet[data-mood="calm"] .score-num { animation: scoreBreathe 3s ease-in-out infinite; }
@keyframes scoreBounce { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes scoreBreathe { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }


/* ---------------- accounts / profiles ---------------- */
.accounts { width: min(1120px, 100%); margin: 0 auto; padding: 30px 26px 70px; position: relative; z-index: 2; }
.accounts-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:34px; }
.accounts-top .brand { font-size:1.1rem; }
.accounts-hero { max-width:820px; margin-bottom:28px; }
.accounts-hero h1 { font-family:var(--font-kai); font-size:clamp(2rem,4.4vw,3.8rem); line-height:1.25; margin:12px 0 14px; text-wrap:balance; }
.accounts-hero .hero-sub { max-width:650px; }
.account-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.account-card {
  display:flex; align-items:center; gap:16px; text-align:left; cursor:pointer;
  padding:18px 20px; border-radius:18px; color:var(--text);
  border:1px solid var(--line); background:rgba(243,234,214,.055);
  transition:.2s; font-family:var(--font-ui);
}
.account-card:hover { transform:translateY(-3px); border-color:rgba(232,196,122,.5); background:rgba(243,234,214,.09); }
.account-card.new { border-style:dashed; background:rgba(243,234,214,.025); }
.account-avatar { width:54px; height:54px; border-radius:50%; display:grid; place-items:center; font-family:var(--font-kai); font-size:1.35rem; color:#1d2a26; flex:0 0 auto; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.avatar-jade { background:linear-gradient(135deg,#a9d5c4,#6f9f8c); }
.avatar-cinnabar { background:linear-gradient(135deg,#e8a6a0,#a83a32); color:#fff4dd; }
.avatar-gold { background:linear-gradient(135deg,#f5e3b0,#b08a48); }
.avatar-lotus { background:linear-gradient(135deg,#f3cbc5,#c76d72); }
.avatar-new { background:rgba(255,255,255,.06); border:1px dashed rgba(243,234,214,.35); color:var(--gold); font-family:var(--font-ui); font-size:1.4rem; box-shadow:none; }
.account-info { flex:1; min-width:0; }
.account-info b { display:block; font-family:var(--font-kai); font-size:1.35rem; font-weight:500; color:var(--text); margin-bottom:4px; }
.account-info small { display:block; font-size:.76rem; color:var(--muted); }
.account-meta { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.account-lock { font-size:.6rem; letter-spacing:.08em; color:var(--gold); border:1px solid rgba(232,196,122,.3); border-radius:999px; padding:2px 7px; font-style:normal; }
.account-arrow { font-style:normal; color:var(--gold); font-size:1.1rem; }
.accounts-note { margin-top:24px; padding:14px 16px; border-radius:12px; border:1px solid var(--line); background:rgba(243,234,214,.035); color:var(--muted); font-size:.8rem; line-height:1.8; }

.profile-chip { display:inline-flex; align-items:center; gap:7px; padding:5px 10px 5px 6px; border-radius:999px; border:1px solid var(--line); background:rgba(255,255,255,.05); color:var(--text); cursor:pointer; font-family:var(--font-ui); font-size:.8rem; }
.profile-chip:hover { background:rgba(255,255,255,.1); }
.profile-dot { width:24px; height:24px; border-radius:50%; display:grid; place-items:center; font-family:var(--font-kai); font-size:.8rem; color:#1d2a26; }

.avatar-picker { display:flex; gap:9px; margin:6px 0 16px; }
.avatar-choice { width:34px; height:34px; border-radius:50%; border:2px solid rgba(70,52,30,.18); cursor:pointer; padding:0; }
.avatar-choice.active { border-color:#a83a32; box-shadow:0 0 0 4px rgba(168,58,50,.13); }
.avatar-choice:nth-child(1){ background:linear-gradient(135deg,#a9d5c4,#6f9f8c); }
.avatar-choice:nth-child(2){ background:linear-gradient(135deg,#e8a6a0,#a83a32); }
.avatar-choice:nth-child(3){ background:linear-gradient(135deg,#f5e3b0,#b08a48); }
.avatar-choice:nth-child(4){ background:linear-gradient(135deg,#f3cbc5,#c76d72); }

/* ---------------- sound archive ---------------- */
.sound-strip { width:100%; display:flex; align-items:center; gap:14px; margin:22px 0 0; padding:14px 18px; border-radius:16px; border:1px solid rgba(232,196,122,.2); background:linear-gradient(100deg, rgba(243,234,214,.08), rgba(232,196,122,.05)); color:var(--text); cursor:pointer; text-align:left; transition:.2s; }
.sound-strip:hover { border-color:rgba(232,196,122,.5); transform:translateY(-2px); }
.sound-strip-copy { flex:1; min-width:0; }
.sound-strip-copy b { display:block; font-family:var(--font-kai); font-size:1.2rem; font-weight:500; margin-bottom:2px; }
.sound-strip-copy small { display:block; font-size:.76rem; color:var(--muted); }
.sound-strip-arrow { color:var(--gold); font-size:.8rem; white-space:nowrap; }
.sound-summary { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:20px; }
.sound-summary > div { padding:10px 16px; border-radius:12px; background:rgba(243,234,214,.05); border:1px solid var(--line); text-align:center; min-width:80px; }
.sound-summary b { display:block; font-family:var(--font-kai); font-size:1.4rem; color:var(--gold-2); line-height:1; }
.sound-summary span { display:block; font-size:.64rem; color:var(--muted); margin-top:3px; }
.sound-summary .mini-btn { margin-left:auto; }
.sound-day { margin-top:20px; }
.sound-day-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.sound-day-head h2 { font-family:var(--font-kai); font-size:1.25rem; color:var(--gold-2); }
.sound-day-head span { font-size:.7rem; color:var(--muted); }
.recording-list { display:grid; gap:9px; }
.recording-card { display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:14px; border:1px solid var(--line); background:rgba(243,234,214,.045); }
.rec-play { width:42px; height:42px; border-radius:50%; border:1px solid rgba(232,196,122,.35); background:rgba(232,196,122,.12); color:var(--gold-2); font-size:.85rem; cursor:pointer; flex:0 0 auto; }
.rec-play:hover { background:rgba(232,196,122,.25); }
.rec-main { flex:1; min-width:0; }
.rec-main h3 { font-family:var(--font-kai); font-size:1.08rem; font-weight:500; margin-bottom:2px; }
.rec-main p { font-size:.7rem; color:var(--muted); }
.rec-lang { display:inline-block; margin-right:6px; padding:1px 7px; border-radius:999px; border:1px solid rgba(232,196,122,.34); color:var(--gold-2); font-size:.62rem; letter-spacing:.04em; }
.rec-main .rec-transcript { color:rgba(243,234,214,.4); font-size:.68rem; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rec-score { font-family:var(--font-kai); font-size:1.5rem; color:var(--gold-2); min-width:42px; text-align:center; }
.rec-score small { font-family:var(--font-ui); font-size:.55rem; color:var(--muted); margin-left:1px; }
.rec-actions { display:flex; gap:4px; flex:0 0 auto; }
.rec-actions .mini-btn { background:rgba(255,255,255,.05); color:var(--text); border-color:var(--line); }
.empty-state { text-align:center; padding:50px 20px; border:1px dashed var(--line); border-radius:18px; margin-top:20px; }
.empty-seal { width:54px; height:54px; border-radius:9px; display:grid; place-items:center; margin:0 auto 12px; background:#a83a32; color:#fff3dd; font-family:var(--font-kai); font-size:1.5rem; }
.empty-state h2 { font-family:var(--font-kai); font-size:1.5rem; margin-bottom:6px; }
.empty-state p { color:var(--muted); font-size:.85rem; margin-bottom:16px; }
.recording-detail { padding:26px 28px; }
.recording-detail-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.recording-detail-head h2 { font-family:var(--font-kai); font-size:1.8rem; }
.recording-player { margin:18px 0; }
.recording-player audio { width:100%; }
.recording-detail-meta { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0; }
.recording-detail-meta > div { background:rgba(70,52,30,.05); border-radius:10px; padding:9px 12px; text-align:center; }
.recording-detail-meta span { display:block; font-size:.65rem; color:var(--dark-muted); }
.recording-detail-meta b { display:block; font-family:var(--font-kai); font-size:1.2rem; color:#8e2f28; margin-top:2px; }
.recording-transcript { font-size:.85rem; line-height:1.8; color:#4a4032; padding:12px 14px; border-radius:10px; background:rgba(127,183,163,.1); }
.modal.recording-modal-wrap { width:min(620px,100%); }

@media (max-width: 760px) {
  .accounts { padding:20px 16px 50px; }
  .account-grid { grid-template-columns:1fr; }
  .accounts-hero h1 { font-size:2rem; }
  .accounts-top { margin-bottom:22px; }
  .recording-card { flex-wrap:wrap; }
  .rec-actions { width:100%; justify-content:flex-end; }
  .rec-score { min-width:34px; }
  .sound-summary .mini-btn { margin-left:0; }
}

@media (max-width: 640px) {
  .home-top-actions { gap: 4px; }
  .home-top-actions .mini-btn { padding: 5px 7px; font-size: .66rem; }
  .profile-chip { padding: 4px 6px; }
  .profile-chip > span:last-child { display: none; }
  .home-top .brand { font-size: .95rem; gap: 6px; }
  .home-top .brand .seal { width: 30px; height: 30px; font-size: .95rem; }
  .accounts-top .muted { display: none; }
  .sound-strip { padding: 12px 14px; }
  .sound-strip-copy b { font-size: 1.05rem; }
  .sound-strip-arrow { font-size: .7rem; }
}

.head-actions { display:flex; align-items:center; gap:12px; margin-left:auto; }
@media (max-width: 640px) {
  .head-actions { gap:6px; }
  .head-actions .mini-btn { padding:5px 7px; font-size:.66rem; }
  .head-stat { min-width:60px; }
}
.head-actions .head-stat { margin-left:0; }

/* 頁首右上角的語系下拉盒：沿用文章詳情頁的 .detail-lang-pick（同一個標籤＋select 結構），
   但頁首是深色硯池底，所以配色照頁首走，不改結構、不改位置。 */
.page-head .detail-lang-pick { font-size: .7rem; color: rgba(246,236,214,.72); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.page-head .detail-lang-pick select {
  height: 30px; width: auto; min-width: 92px; padding: 0 8px;
  font-size: .72rem; border-radius: 8px;
  background: rgba(7,26,28,.45); color: var(--paper);
  border: 1px solid rgba(246,236,214,.28);
}
.page-head .detail-lang-pick select option { background: #10292b; color: var(--paper); }
/* 手機的頁首：標題自己一列，語言／繁簡／統計收成下面一列 chips（左對齊）。
 * 以前是標題和控制在同一列硬擠，控制在右邊浮著、跟標題不同高。 */
@media (max-width: 640px) {
  .page-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
  }
  .page-head > div:first-of-type { grid-column: 2; min-width: 0; }
  .page-head .head-actions {
    grid-column: 1 / -1;
    margin-left: 0;
    margin-top: 8px;
    justify-content: flex-start;
    gap: 8px;
  }
}

/* 手機的頁首右上角：語言與繁／簡做「同一型」的小膠囊——
 * 同高（30px）、同圓角（999px）、同底色與金線，手指好按、看起來是一組。
 * 以前是一個白/深色方盒配兩顆 21px 的小字，兩個元件不像同一套。 */
@media (max-width: 640px) {
  .page-head .detail-lang-pick select,
  .page-head .script-toggle {
    height: 30px;
    border-radius: 999px;
    background: rgba(246, 236, 214, 0.07);
    border: 1px solid rgba(232, 196, 122, 0.3);
    color: var(--paper);
  }
  .page-head .detail-lang-pick select {
    min-width: 0;
    padding: 0 26px 0 11px;
    font-size: .72rem;
    -webkit-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(232,196,122,.8) 50%), linear-gradient(135deg, rgba(232,196,122,.8) 50%, transparent 50%);
    background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
  }
  .script-toggle { padding: 0 1px; }
  .script-btn { height: 28px; min-width: 30px; padding: 0 9px; font-size: .7rem; }
  .script-btn + .script-btn { border-left-color: rgba(232, 196, 122, 0.22); }
}
.setting-row > span { white-space: nowrap; }
.sound-summary-actions { display:flex; gap:6px; margin-left:auto; }
@media (max-width: 640px) {
  .sound-summary-actions { width:100%; margin-left:0; }
  .sound-summary-actions .mini-btn { flex:1; }
}
.sound-summary-actions { margin-left: 8px; }

/* ---------------- guest read-only ---------------- */
.guest-entry {
  width:100%; margin-top:14px; display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:14px 18px; border-radius:14px; border:1px dashed rgba(232,196,122,.3);
  background:rgba(232,196,122,.035); color:var(--text); cursor:pointer; text-align:left; transition:.2s;
}
.guest-entry:hover { border-color:rgba(232,196,122,.6); background:rgba(232,196,122,.07); }
.guest-entry-main b { display:block; font-family:var(--font-kai); font-size:1.15rem; font-weight:500; color:var(--gold-2); margin-bottom:2px; }
.guest-entry-main small { display:block; font-size:.74rem; color:var(--muted); }
.guest-entry-arrow { color:var(--gold); font-size:1rem; }
.guest-cta {
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  margin:18px 0 6px; padding:16px 18px; border-radius:14px;
  background:linear-gradient(100deg, rgba(232,196,122,.1), rgba(168,58,50,.06));
  border:1px solid rgba(232,196,122,.22);
}
.guest-cta b { display:block; font-family:var(--font-kai); font-size:1.25rem; font-weight:500; color:var(--gold-2); margin-bottom:3px; }
.guest-cta span { display:block; font-size:.78rem; color:var(--muted); line-height:1.7; }
.guest-card-line { margin-top:10px; font-size:.7rem; color:var(--muted); padding-top:8px; border-top:1px dashed rgba(70,52,30,.14); }

/* ---------------- privacy center ---------------- */
.privacy-grid .wide { grid-column: 1 / -1; }
.privacy-hero { background: linear-gradient(135deg, rgba(232,196,122,.14), rgba(111,159,140,.08)); border-color: rgba(176,138,72,.32); }
.privacy-hero h2 { font-family:var(--font-kai); font-size:clamp(1.7rem,3vw,2.5rem); line-height:1.3; margin:6px 0 10px; color:#3b2d1c; }
.privacy-hero p { max-width:850px; line-height:2; color:#5a4932; font-size:.9rem; }
.privacy-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.privacy-badges span { font-size:.68rem; color:#8e2f28; border:1px solid rgba(168,58,50,.22); background:rgba(168,58,50,.06); padding:4px 10px; border-radius:999px; }
.privacy-options { display:grid; gap:8px; margin-top:10px; }
.privacy-option { display:flex; align-items:flex-start; gap:10px; width:100%; text-align:left; padding:12px 13px; border-radius:12px; border:1px solid rgba(70,52,30,.14); background:rgba(255,252,242,.35); color:#4a4032; cursor:pointer; transition:.2s; font-family:var(--font-ui); }
.privacy-option:hover { border-color:rgba(168,58,50,.4); background:rgba(255,252,242,.55); }
.privacy-option.active { border-color:#a83a32; background:rgba(168,58,50,.06); box-shadow:inset 0 0 0 1px rgba(168,58,50,.18); }
.privacy-option.disabled { opacity:.48; cursor:not-allowed; }
.privacy-radio { width:16px; height:16px; border-radius:50%; border:1.5px solid rgba(70,52,30,.35); flex:0 0 auto; margin-top:2px; position:relative; }
.privacy-option.active .privacy-radio { border-color:#a83a32; }
.privacy-option.active .privacy-radio::after { content:""; position:absolute; inset:3px; border-radius:50%; background:#a83a32; }
.privacy-option b { display:block; font-size:.84rem; color:#3b2d1c; margin-bottom:2px; }
.privacy-option small { display:block; font-size:.7rem; line-height:1.65; color:#7a6850; }
@media (max-width: 760px) {
  .privacy-hero h2 { font-size:1.55rem; }
}

/* ---------------- parent community preview ---------------- */
.community { display:grid; gap:16px; }
.community-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 26px 20px;
  background: linear-gradient(135deg, rgba(232, 196, 122, .14), rgba(111, 159, 140, .08));
  border-color: rgba(176, 138, 72, .3);
}
.community-banner h2 {
  font-family: var(--font-kai);
  font-size: 1.8rem;
  line-height: 1.35;
  margin: 4px 0 10px;
  color: #3b2d1c;
  overflow-wrap: anywhere;
}
.community-banner p {
  max-width: 820px;
  color: #5a4932;
  line-height: 1.9;
  font-size: .84rem;
  overflow-wrap: anywhere;
}
.community-banner b { color:#8e2f28; font-weight:600; }
.community-seal { width:56px; height:56px; flex:0 0 auto; display:grid; place-items:center; background:#a83a32; color:#fff3dd; font-family:var(--font-kai); font-size:1.5rem; border-radius:6px; transform:rotate(-4deg); }
.community-privacy-line { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:0 4px; font-size:.72rem; color:var(--muted); }
.community-privacy-line b { color:var(--gold-2); font-weight:500; }
.community-privacy-line .mini-btn { margin-left:auto; }
.community-compose { padding:16px 18px; }
.community-compose textarea { resize:vertical; min-height:84px; line-height:1.8; }
.community-compose-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; }
.community-locked { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.community-locked b { font-family:var(--font-kai); font-size:1.3rem; color:#3b2d1c; }
.community-locked p { color:#6b5d48; font-size:.8rem; margin-top:4px; }
.community-feed { display:grid; gap:14px; }
.community-post { background:var(--paper); border-radius:16px; padding:18px 20px; box-shadow:0 8px 24px rgba(0,0,0,.12); }
.community-post.just-posted { animation: postPop 2.6s ease-out; }
@keyframes postPop {
  0% { box-shadow: 0 0 0 2px rgba(232,196,122,.85), 0 8px 24px rgba(0,0,0,.12); }
  60% { box-shadow: 0 0 0 5px rgba(232,196,122,.35), 0 8px 24px rgba(0,0,0,.12); }
  100% { box-shadow: 0 0 0 2px rgba(232,196,122,0), 0 8px 24px rgba(0,0,0,.12); }
}
.community-post-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; row-gap:6px; }
.community-post-head .account-avatar { width:40px; height:40px; font-size:1rem; flex:0 0 auto; }
.community-author { flex:1; min-width:0; }
.community-author b { display:block; font-family:var(--font-kai); font-size:1.08rem; color:#3b2d1c; font-weight:500; overflow-wrap:anywhere; }
.community-author small { display:block; font-size:.65rem; color:#8a765a; margin-top:1px; }
.community-mine { font-size:.6rem; color:#8e2f28; border:1px solid rgba(168,58,50,.2); padding:2px 7px; border-radius:999px; }
.community-withdraw { font-size:.62rem; color:#8e2f28; border-color:rgba(168,58,50,.28); background:rgba(168,58,50,.06); }
.community-follow { background:rgba(168,58,50,.06); color:#8e2f28; border-color:rgba(168,58,50,.22); }
.community-follow.active { background:#a83a32; color:#fff3dd; border-color:#a83a32; }
.community-post h3 { font-family:var(--font-kai); font-size:1.35rem; font-weight:500; line-height:1.45; color:#2f2418; margin:4px 0 7px; overflow-wrap:anywhere; }
.community-body { font-size:.85rem; line-height:1.95; color:#5a4932; white-space:pre-wrap; overflow-wrap:anywhere; }
.community-actions { display:flex; align-items:center; gap:16px; margin-top:12px; padding-top:10px; border-top:1px dashed rgba(70,52,30,.14); flex-wrap:wrap; }
.community-action { border:0; background:transparent; color:#8a765a; font-family:var(--font-ui); font-size:.72rem; cursor:pointer; padding:0; }
.community-action.active { color:#a83a32; }
.community-action.muted { cursor:default; color:#b0a08a; margin-left:auto; }
.community-replies { margin-top:10px; display:grid; gap:7px; }
.community-reply { display:flex; gap:7px; align-items:baseline; flex-wrap:wrap; padding:7px 10px; border-radius:9px; background:rgba(70,52,30,.045); font-size:.74rem; line-height:1.65; color:#5a4932; min-width:0; overflow-wrap:anywhere; }
.community-reply b { color:#8e2f28; font-weight:600; overflow-wrap:anywhere; }
.community-reply span { min-width:0; }
.community-reply small { color:#a08d72; font-size:.6rem; margin-left:auto; }
.community-reply .community-reply-withdraw { padding:1px 7px; font-size:.6rem; line-height:1.5; color:#8e2f28; background:rgba(168,58,50,.06); border-color:rgba(168,58,50,.18); opacity:.85; }
.community-reply .community-reply-withdraw:hover { opacity:1; }
.community-reply-box { display:flex; gap:7px; margin-top:9px; }
.community-reply-box .input { height:32px; font-size:.74rem; }
.community-reply-box .mini-btn { background:rgba(168,58,50,.06); color:#8e2f28; border-color:rgba(168,58,50,.2); }
.community-foot { margin-top:4px; padding:0 4px; }
@media (max-width: 760px) {
  .community-banner { flex-direction:column; padding:16px 16px 14px; }
  .community-seal { display:none; }
  .community-post { padding:14px 14px; }
  .community-post h3 { font-size:1.15rem; }
  .community-privacy-line { gap:6px; }
  .community-privacy-line > span { flex:1 1 100%; min-width:0; overflow-wrap:anywhere; }
  .community-privacy-line .mini-btn { margin-left:0; }
  .community-post-head { row-gap:6px; }
  .community-readonly { padding:16px; align-items:flex-start; flex-direction:column; }
  .community-readonly > div { flex:1 1 auto; }
}

.privacy-hero {
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255,252,242,.9), transparent 55%),
    linear-gradient(135deg, rgba(232,196,122,.28), rgba(111,159,140,.16)),
    linear-gradient(145deg, #f8efd9, #eddfc0);
}
.community-banner {
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255,252,242,.9), transparent 55%),
    linear-gradient(135deg, rgba(232,196,122,.24), rgba(111,159,140,.14)),
    linear-gradient(145deg, #f8efd9, #eddfc0);
}

/* 文章頁的橫幅：有分鏡圖就用分鏡圖（2:1），沒有才退回墨寶 SVG。
   以前用固定高度 120–220px 裝 360×220 的 SVG，會被拉成中間一條細縫。 */
.text-detail-art { position:relative; flex:0 0 auto; margin:14px 0 4px; border-radius:14px; overflow:hidden; border:1px solid rgba(70,52,30,.14); background:#f7efdc; aspect-ratio: 2 / 1; }
.text-detail-art svg { position:absolute; inset:0; display:block; width:100%; height:100%; }
.text-detail-art .detail-hero { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; }
@media (max-width: 640px) {
  .text-detail-art { aspect-ratio: 16 / 10; }
}

.community-type-row { display:grid; grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr); gap:10px; margin-bottom:10px; }
.community-type-row .field { margin:0; min-width:0; }
.community-type-row select { width:100%; height:auto; min-height:46px; padding:9px 30px 9px 11px; font-size:.8rem; line-height:1.5; }
.community-readonly { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:20px 24px; }
.community-readonly > div { min-width:0; flex:1 1 420px; }
.community-readonly b { font-family:var(--font-kai); font-size:1.25rem; color:#3b2d1c; }
.community-readonly p { color:#6b5d48; font-size:.78rem; margin-top:4px; max-width:620px; line-height:1.7; overflow-wrap:anywhere; }
.community-progress { margin:12px 0 2px; padding:10px 12px; border-radius:10px; border:1px solid rgba(176,138,72,.25); background:rgba(232,196,122,.1); display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:.72rem; color:#5a4932; }
.community-progress b { font-family:var(--font-kai); font-size:1.3rem; color:#8e2f28; }
.community-progress-label { font-size:.6rem; letter-spacing:.08em; color:#9a743c; border:1px solid rgba(154,116,60,.3); border-radius:999px; padding:2px 7px; }
.community-voice { margin:12px 0 2px; border:1px solid rgba(168,58,50,.22); background:rgba(168,58,50,.07); color:#8e2f28; border-radius:10px; padding:9px 12px; font-size:.75rem; cursor:pointer; width:100%; text-align:left; }
.community-voice:hover { background:rgba(168,58,50,.12); }
.community-privacy-line b { color:var(--gold-2); font-weight:500; }
@media (max-width:760px){ .community-type-row{grid-template-columns:1fr} .community-type-row select{min-height:48px;font-size:16px} .community-readonly{align-items:flex-start;flex-direction:column} }

/* ---------------- login form ---------------- */
.login-page .accounts-hero { margin-bottom: 20px; }
.login-panel {
  width: min(560px, 100%);
  padding: 24px 26px;
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255,252,242,.95), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  color: #3b2d1c;
  border: 1px solid rgba(99,74,42,.2);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.login-panel h2 { font-family: var(--font-kai); font-size: 1.8rem; font-weight: 500; margin: 4px 0 4px; color: #3b2d1c; }
.login-panel .kicker { color: #9a743c; }
.login-panel .field { color: #5a4932; }
.login-panel .field .input { margin-top: 5px; }
.login-panel .muted { color: #7a6850; }
.login-panel .tiny { color: rgba(70,52,30,.58); }
.login-panel form { display: grid; gap: 10px; margin-top: 14px; }
.login-panel .btn.full { width: 100%; justify-content: center; }
.login-links { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.login-links .link-btn { color: #8e2f28; }
.login-links span { color: #b9a78b; }
.login-error { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(168,58,50,.08); border: 1px solid rgba(168,58,50,.2); color: #8e2f28; font-size: .76rem; }
.login-error.hidden { display: none; }
.login-empty .login-links { margin-top: 16px; }
@media (max-width: 640px) {
  .login-panel { padding: 18px 16px; border-radius: 16px; }
  .login-panel h2 { font-size: 1.5rem; }
}
.onboarding-account { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.onboarding-account .field:first-child { grid-column:1 / -1; }
@media (max-width: 640px) { .onboarding-account { grid-template-columns:1fr; } .onboarding-account .field:first-child { grid-column:auto; } }

/* 建立帳號：地區三選一（台灣／大陸／香港）；選了只改新帳號的預設，不影響別的帳號。 */
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.region-grid .age-btn { padding: 9px 4px; }
.region-grid .age-btn small { font-size: 0.6rem; line-height: 1.3; white-space: nowrap; }
@media (max-width: 380px) { .region-grid { grid-template-columns: 1fr; } }

/* listening toggle */
.btn.listening, .mini-btn.listening, .icon-btn.listening, .model-btn.listening, .model-play.listening {
  background: #a83a32 !important;
  border-color: #a83a32 !important;
  color: #fff7e8 !important;
  box-shadow: 0 0 0 3px rgba(168,58,50,.12);
}
@keyframes listenPulse { 0%,100%{box-shadow:0 0 0 3px rgba(168,58,50,.10)} 50%{box-shadow:0 0 0 6px rgba(168,58,50,.04)} }
.btn.listening { animation: listenPulse 1.8s ease-in-out infinite; }

/* visitor counter */
.visit-badge {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232,196,122,.22);
  background: rgba(8,24,22,.72);
  color: rgba(243,233,210,.78);
  font-family: var(--font-ui);
  font-size: .66rem;
  line-height: 1;
  backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.visit-badge b { color: #e8c47a; font-weight: 600; font-size: .72rem; }
.visit-dot { width: 5px; height: 5px; border-radius: 50%; background: #8fc6b2; box-shadow: 0 0 0 3px rgba(143,198,178,.12); }
/* 遊戲館入口與瀏覽人數只留在首頁（app.js 的 syncHomeChrome 會切 hidden）。 */
.games-fab[hidden], .visit-badge[hidden] { display: none !important; }
@media (max-width: 760px) {
  .visit-badge { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); font-size: .62rem; }
}

/* ---------------- landing / entry ---------------- */
.landing-page {
  width: min(1180px, 100%);
  min-height: 100vh;
  padding: 26px 28px 34px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.landing-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 48% at 82% 4%, rgba(232,196,122,.16), transparent 62%),
    radial-gradient(48% 44% at 2% 92%, rgba(111,159,140,.1), transparent 66%),
    linear-gradient(180deg, rgba(7,26,28,.02), rgba(7,26,28,.28));
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(28px, 5vh, 54px);
}
.landing-nav .brand { font-size: 1.15rem; }
.landing-nav-note {
  margin: 0;
  color: rgba(243,234,214,.5);
  font-size: .72rem;
  letter-spacing: .04em;
}
.landing-nav .script-toggle { margin-left: auto; }
.landing-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(340px, .78fr);
  gap: clamp(30px, 5vw, 68px);
  align-items: center;
}
.landing-hero { position: relative; min-width: 0; }
.landing-hero::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: 2%;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,196,122,.15), transparent 68%);
  pointer-events: none;
  z-index: -1;
}
.landing-hero h1 {
  margin: 14px 0 16px;
  font-family: var(--font-kai);
  font-size: clamp(2.5rem, 4.5vw, 4.35rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: .01em;
  color: #f5ecd8;
  text-wrap: balance;
}
.landing-lede {
  max-width: 35rem;
  margin: 0;
  color: rgba(243,234,214,.66);
  font-size: .92rem;
  line-height: 2;
}
.landing-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 22px;
}
.landing-actions .btn { min-height: 46px; }
.landing-actions .btn-primary { padding-inline: 22px; }
.landing-actions .btn-ghost { border-color: rgba(243,234,214,.24); color: rgba(243,234,214,.84); background: rgba(243,234,214,.04); }
.landing-actions .btn-ghost:hover { border-color: rgba(232,196,122,.55); color: var(--gold-2); background: rgba(232,196,122,.08); }
.landing-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0 30px;
  padding: 16px 0;
  border-top: 1px solid rgba(243,234,214,.1);
  border-bottom: 1px solid rgba(243,234,214,.1);
}
.landing-points li {
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid rgba(243,234,214,.1);
}
.landing-points li:first-child { padding-left: 0; border-left: 0; }
.landing-points b {
  display: block;
  font-family: var(--font-kai);
  font-size: 1.06rem;
  font-weight: 500;
  color: var(--gold-2);
  margin-bottom: 3px;
}
.landing-points span { display: block; font-size: .68rem; line-height: 1.6; color: rgba(243,234,214,.5); }
.landing-quote {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  width: min(440px, 100%);
  margin: 0;
  padding: 18px 20px 16px;
  border-radius: 16px;
  color: #3b2d1c;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255,252,242,.95), transparent 58%),
    linear-gradient(140deg, #f7edd5, #ebdbb9);
  border: 1px solid rgba(232,196,122,.38);
  box-shadow: 0 18px 44px rgba(0,0,0,.2);
  transform: rotate(-.7deg);
}
.landing-quote-seal {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #a83a32;
  color: #fff3dd;
  font-family: var(--font-kai);
  font-size: 1.05rem;
  box-shadow: 0 4px 10px rgba(168,58,50,.25);
}
.landing-quote blockquote {
  margin: 0;
  grid-column: 2;
  min-width: 0;
  font-family: var(--font-kai);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.55;
  letter-spacing: .08em;
  color: #3b2d1c;
}
.landing-quote figcaption { grid-column: 2; margin-top: 9px; font-size: .6rem; color: #8b765a; display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; }
.landing-quote figcaption b { font-family: var(--font-kai); font-weight: 500; color: #8e2f28; }
.landing-quote figcaption span { color: #9a876b; }

.entry-card {
  width: 100%;
  max-width: 420px;
  justify-self: end;
  padding: 26px 26px 22px;
  border-radius: 24px;
  color: #3b2d1c;
  background:
    radial-gradient(120% 90% at 14% 0%, rgba(255,252,242,.98), transparent 56%),
    linear-gradient(150deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99,74,42,.2);
  box-shadow: 0 28px 80px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.5);
}
.entry-card-head { display: flex; align-items: center; gap: 12px; }
.entry-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(168,58,50,.1);
  border: 1px solid rgba(168,58,50,.2);
  color: #8e2f28;
  font-family: var(--font-kai);
  font-size: 1.25rem;
}
.entry-card h2 {
  margin: 2px 0 0;
  font-family: var(--font-kai);
  font-size: 1.62rem;
  font-weight: 500;
  line-height: 1.25;
  color: #3b2d1c;
}
.entry-card .kicker { margin: 0; color: #9a743c; font-size: .62rem; }
.entry-sub { margin: 12px 0 4px; font-size: .76rem; line-height: 1.75; color: #7a6850; }
.entry-card form { display: grid; gap: 11px; margin-top: 14px; }
.entry-card .field { margin: 0; color: #5a4932; font-size: .78rem; }
.entry-card .field .input { margin-top: 5px; background: rgba(255,252,242,.78); border-color: rgba(99,74,42,.2); color: #3b2d1c; }
.entry-card .field .input::placeholder { color: rgba(90,73,50,.45); }
.entry-card .field .input:focus { border-color: rgba(168,58,50,.55); box-shadow: 0 0 0 3px rgba(168,58,50,.08); }
.entry-card .btn.full { width: 100%; justify-content: center; min-height: 46px; margin-top: 2px; }
.entry-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: #a08d72; font-size: .64rem; }
.entry-divider::before, .entry-divider::after { content: ""; height: 1px; flex: 1; background: rgba(99,74,42,.14); }
.entry-register {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(154,116,60,.42);
  background: rgba(255,252,242,.34);
  color: #6f4d24;
  font-family: var(--font-ui);
  font-size: .82rem;
  cursor: pointer;
  transition: .18s;
}
.entry-register:hover { border-color: #a83a32; background: rgba(168,58,50,.06); color: #8e2f28; }
.entry-register b { font-size: 1rem; font-weight: 400; }
.entry-guest {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 0;
  background: transparent;
  color: #8e2f28;
  font-family: var(--font-ui);
  font-size: .74rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.entry-guest:hover { color: #6f2a24; }
.entry-privacy { display: flex; align-items: flex-start; gap: 7px; margin: 14px 0 0; font-size: .64rem; line-height: 1.65; color: rgba(70,52,30,.6); }
.privacy-dot { width: 5px; height: 5px; margin-top: 7px; flex: 0 0 auto; border-radius: 50%; background: #6f9f8c; box-shadow: 0 0 0 3px rgba(111,159,140,.12); }
.entry-help { margin-top: 10px; border-top: 1px dotted rgba(99,74,42,.14); padding-top: 8px; }
.entry-help summary { cursor: pointer; list-style: none; font-size: .62rem; color: rgba(70,52,30,.5); }
.entry-help summary::-webkit-details-marker { display: none; }
.entry-help p { margin: 7px 0 0; font-size: .64rem; line-height: 1.7; color: rgba(70,52,30,.55); }
.entry-admin { display: block; width: 100%; margin-top: 14px; padding: 9px 12px; border: 1px dashed rgba(154,116,60,.42); border-radius: 999px; background: rgba(255,253,247,.35); color: #7a5a31; font-family: var(--font-ui); font-size: .7rem; text-align: center; cursor: pointer; }
.entry-admin + .entry-admin { margin-top: 6px; }
.entry-admin-link { text-decoration: none; }
.entry-admin:hover { border-color: #8e2f28; color: #8e2f28; background: rgba(168,58,50,.06); }
.landing-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(243,234,214,.08);
  color: rgba(243,234,214,.36);
  font-size: .62rem;
  letter-spacing: .14em;
}
.landing-foot span + span::before { content: "·"; margin-right: 18px; color: rgba(232,196,122,.35); }
.landing-foot .app-ver { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .8; }
.landing-foot .app-ver::before { content: none !important; }
/* 登入頁刻意**不做進場動畫**。
 * 以前 .landing-hero／.entry-card／.landing-quote 進場會上浮 12px＋淡入 0.65 秒；
 * 但 index.html 的第一屏本來就是同一塊登入頁（見 index.html 的說明），
 * app.js 接手重畫時動畫會再播一次 → 重新整理就會看到字「先偏一下、再回正」。
 * 進站要一次到位，所以這裡只留靜態版面。 */
@media (max-width: 980px) {
  .landing-grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .entry-card { justify-self: start; max-width: 560px; }
  .landing-hero h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); }
  .landing-hero::before { right: 8%; }
}
@media (max-width: 640px) {
  .landing-page { padding: 18px 16px 28px; }
  .landing-nav { margin-bottom: 26px; gap: 10px; }
  .landing-nav-note { display: none; }
  .landing-hero h1 { font-size: clamp(2.15rem, 10vw, 2.9rem); line-height: 1.22; }
  .landing-lede { font-size: .84rem; line-height: 1.9; }
  /* 手機：兩顆入口鈕並排（一列放得下就不要疊成兩列），高度收到 46px。
     「先聽一篇，不用註冊」＋「建立小書童」在 390px 一列各 171px，字還放得下；
     320–380px 的窄機另外在下面退回單欄，不讓字被擠成兩行。 */
  .landing-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 20px 0 16px; }
  .landing-actions .btn { width: 100%; justify-content: center; min-height: 46px; padding: 0 10px; font-size: .88rem; }
  .landing-points { grid-template-columns: 1fr; row-gap: 0; margin: 20px 0 22px; }
  .landing-points li { padding: 10px 0; border-left: 0; border-top: 1px solid rgba(243,234,214,.08); }
  .landing-points li:first-child { border-top: 0; }
  .landing-points li:nth-child(3) { grid-column: auto; padding: 10px 0; border-left: 0; border-top: 1px solid rgba(243,234,214,.08); }
  .landing-quote { padding: 15px 16px 14px; transform: none; }
  .landing-quote blockquote { font-size: 1.28rem; }
  .landing-quote figcaption { position: static; margin-top: 10px; flex-wrap: wrap; }
  .entry-card { max-width: none; padding: 20px 18px 18px; border-radius: 20px; }
  .entry-card .btn-lg { padding: 12px 20px; font-size: .98rem; }
  .entry-card h2 { font-size: 1.4rem; }
  .landing-foot { gap: 10px; font-size: .58rem; margin-top: 26px; }
  .landing-foot span + span::before { margin-right: 10px; }
}

/* 320–380px：入口鈕兩顆並排會把字擠成兩行，改回單欄、但高度仍是 46px。 */
@media (max-width: 380px) {
  .landing-actions { grid-template-columns: 1fr; }
  .landing-actions .btn { font-size: .92rem; }
}



/* daily report */
.daily-report {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(99,74,42,.16);
  background: rgba(255,252,242,.46);
}
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.report-head .kicker { margin: 0 0 4px; color: #9a743c; }
.report-head h3 { margin: 0; font-family: var(--font-kai); font-size: 1.28rem; font-weight: 500; color: #3b2d1c; }
.report-seal { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 5px; background: #a83a32; color: #fff3dd; font-family: var(--font-kai); font-size: .95rem; box-shadow: 0 4px 10px rgba(168,58,50,.18); }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 16px; }
.report-stats > div { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.36); border: 1px solid rgba(99,74,42,.1); }
.report-stats b { display: block; font-family: var(--font-kai); font-size: 1.55rem; font-weight: 500; color: #8e2f28; line-height: 1; }
.report-stats span { display: block; margin-top: 4px; font-size: .68rem; color: #5a4932; }
.report-stats small { display: block; margin-top: 2px; font-size: .6rem; color: #9a876b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px dashed rgba(99,74,42,.16); padding-top: 14px; }
.report-col h4 { margin: 0 0 6px; font-family: var(--font-kai); font-size: .95rem; font-weight: 500; color: #8e2f28; }
.report-main { margin: 0; font-family: var(--font-kai); font-size: 1.05rem; color: #3b2d1c; }
.report-sub { margin: 4px 0 0; font-size: .68rem; line-height: 1.6; color: #7a6850; }
.report-line { margin: 5px 0 0; font-size: .64rem; color: #9a876b; }
.report-empty { margin: 0; font-size: .72rem; color: #8b765a; }
.report-lines { margin: 8px 0 0; padding-left: 16px; font-family: var(--font-kai); font-size: .82rem; line-height: 1.8; color: #4a4032; }
.report-lines li + li { margin-top: 2px; }
.report-foot { margin: 14px 0 0; padding-top: 10px; border-top: 1px dotted rgba(99,74,42,.16); font-size: .64rem; color: #7a6850; }
@media (max-width: 640px) {
  .daily-report { padding: 14px; }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .report-stats > div:nth-child(3) { grid-column: 1 / -1; }
  .report-columns { grid-template-columns: 1fr; gap: 12px; }
  .report-head h3 { font-size: 1.12rem; }
}

/* read-mode per-segment recordings */
.read-takes { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(232,196,122,.1); border: 1px solid rgba(154,116,60,.14); }
.read-takes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.read-takes-head b { font-family: var(--font-kai); font-size: .92rem; font-weight: 500; color: #8e2f28; }
.read-takes-head span { font-size: .62rem; color: #8b765a; }
.read-takes-list { display: grid; gap: 5px; margin-top: 8px; max-height: 190px; overflow: auto; }
.read-take { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid rgba(99,74,42,.12); background: rgba(255,252,242,.5); color: #4a4032; border-radius: 8px; padding: 6px 8px; font: inherit; cursor: pointer; }
.read-take:hover { border-color: rgba(168,58,50,.35); background: rgba(255,252,242,.82); }
.read-take-no { flex: 0 0 auto; font-family: var(--font-kai); font-size: .72rem; color: #8e2f28; }
.read-take-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-kai); font-size: .78rem; }
.read-take-dur { flex: 0 0 auto; font-size: .6rem; color: #8b765a; }
.read-take-play { flex: 0 0 auto; color: #a83a32; font-size: .62rem; }
.read-take.listening { background: #a83a32; border-color: #a83a32; color: #fff8ea; }
.read-take.listening .read-take-no, .read-take.listening .read-take-text, .read-take.listening .read-take-dur, .read-take.listening .read-take-play { color: #fff8ea; }

/* 訪客語系：2026-11-24 起改成頁首右上角的下拉盒（.page-head .detail-lang-pick），
   不再用頁面裡的一排 segmented 按鈕；原本的 .guest-lang-row／.detail-lang-row 已移除。 */


/* 手機：用 cover 填滿，再用每張圖的重點座標推移，避免上下留一大片黑；
   桌面維持滿版大圖。 */
@media (max-width: 640px) {
  .reader-scene-layer .scene-img,
  .learn-scene .scene-img {
    object-fit: cover;
    object-position: var(--fx, 50%) var(--fy, 50%);
    transform: scale(1.02);
    transform-origin: var(--fx, 50%) var(--fy, 50%);
  }
}

/* 有真實分鏡圖時，不要再讓底下的墨色 SVG 從 letterbox 露出來。 */
.reader-scene-layer:has(.scene-img) > svg,
.learn-scene:has(.scene-img) > svg { display: none; }

/* ── 手機文・圖・讀：圖是上面一個完整圖框，字與控制列都在框外 ──
   分鏡圖本來就是 1280×632（2.025:1）。手機把圖框做成同一個比例，
   整張圖都看得到、不裁切；標題、句子、按鈕、圓點都排在圖框下面。
   關閉鈕移到畫面左下角（圖框外），不壓圖、也不壓字。 */
@media (max-width: 640px) {
  .reader { padding-top: env(safe-area-inset-top); }
  .reader-stage { overflow: hidden; }
  .reader-scene {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    width: 100%;
    /* 不用 aspect-ratio：舊手機（iOS 14／舊 WebView）不支援時，
       這一格會塌成 0 高，圖就整個不見。直接用 632/1280 的 vw 高度。 */
    height: 49.375vw;
    max-height: 46vh;
    background: #04100f;
    border-bottom: 1px solid rgba(232, 196, 122, 0.18);
  }
  .reader-scene-layer { inset: 0; animation: none; }
  .reader-scene-layer .scene-img {
    object-fit: cover;
    object-position: 50% 50%;
    transform: none;
  }
  .reader-scene-veil { display: none; }
  .reader-top {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    /* 右上角的關閉鈕是 fixed，兩側留出它的寬度：標題不會鑽到鈕底下，也仍然置中。 */
    padding: 9px 56px 0;
    text-align: center;
    /* 關閉鈕是 fixed，但會被困在 .reader-top 的 stacking context 裡；
       拉高這一層，鈕才不會被下面的圓點列蓋掉。 */
    z-index: 60;
  }
  .reader-meta { flex: 0 0 auto; }
  .reader-kicker { font-size: 0.8rem; letter-spacing: 0.08em; }
  .reader-pos { font-size: 0.7rem; }
  .reader-version { margin-top: 4px; }
  .reader-body {
    padding: 6px 18px 10px;
    justify-content: center;
  }
  .reader-line {
    font-size: clamp(1.4rem, 6.2vw, 1.95rem);
    line-height: 1.62;
    line-break: strict;
    padding: 0 0.1em;
    text-wrap: pretty;
  }
  /* 關閉鈕固定在畫面右上角，和對話框的 × 同一個角落；深色列上固定用米白鈕，不隨圖亮暗切換。 */
  .reader-close.icon-btn {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    top: calc(8px + env(safe-area-inset-top));
    left: auto;
    bottom: auto;
    width: 40px;
    height: 40px;
    z-index: 6;
    font-size: 1.45rem;
    border-width: 1.5px;
    background: rgba(252, 247, 236, 0.93);
    color: #101614;
    border-color: rgba(16, 22, 20, 0.45);
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.32);
  }
  .reader[data-tone="bright"] .reader-close.icon-btn {
    background: rgba(252, 247, 236, 0.93);
    color: #101614;
    border-color: rgba(16, 22, 20, 0.45);
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.32);
  }
  .reader-foot { padding-bottom: 14px; }
  /* 圓點列維持最下面一條可橫向滑動的列；關閉鈕在右上角，左邊不用再讓位。 */
  .reader-dots {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 7px 14px calc(7px + env(safe-area-inset-bottom));
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .reader-dots::-webkit-scrollbar { display: none; }
  .reader-dot { flex: 0 0 auto; width: 30px; height: 30px; }
}

/* 手機正面標題：底圖的月亮再亮，字也要有暗邊可以讀。 */
@media (max-width: 640px) {
  .hero-copy h1,
  .landing-hero h1 {
    text-shadow:
      0 1px 2px rgba(3, 10, 11, 0.72),
      0 0 10px rgba(3, 10, 11, 0.55),
      0 10px 34px rgba(0, 0, 0, 0.35);
  }
}

/* ── 手機橫式（例如 844×390）：圖在左，句子與控制在右 ──
   橫向時螢幕矮，左右兩欄比上下堆疊妥當；控制列與圓點只佔最下面一條，
   圓點維持單列可橫向滑動，28 顆不會擠成兩三排。 */
@media (orientation: landscape) and (max-height: 520px) {
  .reader {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .reader-stage {
    display: grid;
    grid-template-columns: minmax(0, 54%) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .reader-stage::after { display: none; }
  .reader-scene {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-right: 1px solid rgba(232, 196, 122, 0.18);
    background: #07191a;
  }
  .reader-scene-layer { inset: 0; animation: none; }
  .reader-scene-layer .scene-img {
    object-fit: contain;
    object-position: 50% 50%;
    transform: none;
  }
  .reader-scene-veil { display: none; }
  .reader-top {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    /* 右上角是固定的關閉鈕，這一側留出它的寬度。 */
    padding: 10px 56px 0 16px;
    text-align: left;
    z-index: 60;
  }
  .reader-meta { flex: 0 0 auto; }
  .reader-kicker { font-size: 0.8rem; letter-spacing: 0.08em; }
  .reader-pos { font-size: 0.7rem; }
  .reader-cue { display: none; }
  .reader-version { margin-top: 2px; }
  .reader-body {
    grid-column: 2;
    grid-row: 2;
    padding: 6px 16px 12px;
    justify-content: center;
  }
  .reader-line {
    font-size: clamp(1.15rem, 2.9vw, 1.55rem);
    line-height: 1.55;
    line-break: strict;
    padding: 0 0.05em;
    text-wrap: pretty;
  }
  .reader-hint { display: none; }
  .reader-close.icon-btn {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    top: calc(8px + env(safe-area-inset-top));
    left: auto;
    bottom: auto;
    width: 40px;
    height: 40px;
    font-size: 1.45rem;
    border-width: 1.5px;
    z-index: 60;
    background: rgba(252, 247, 236, 0.93);
    color: #101614;
    border-color: rgba(16, 22, 20, 0.45);
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.32);
  }
  .reader[data-tone="bright"] .reader-close.icon-btn {
    background: rgba(252, 247, 236, 0.93);
    color: #101614;
    border-color: rgba(16, 22, 20, 0.45);
  }
  .reader-foot { padding: 8px 16px 6px; }
  .reader-dots {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .reader-dots::-webkit-scrollbar { display: none; }
  .reader-dot { flex: 0 0 auto; width: 28px; height: 28px; }
  /* 橫向時標題不要大到把首頁撐成兩三屏。 */
  .landing-hero h1,
  .hero-copy h1 { font-size: 2rem; line-height: 1.22; }
  .landing-lede,
  .hero-sub { font-size: 0.92rem; }
}

/* 手機（直向、橫向）：上一句／從這句讀／下一句 一律同一行。
   箭頭鈕收窄、播放鈕吃掉剩下的寬度，320px 也排得下。 */
@media (max-width: 640px), (orientation: landscape) and (max-height: 520px) {
  .reader-foot {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px 14px;
  }
  .reader-foot .mini-btn {
    flex: 0 1 auto;
    min-width: 0;
    padding: 8px 9px;
    font-size: 0.76rem;
    white-space: nowrap;
  }
  .reader-play {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 260px;
    padding: 10px 12px;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

/* 固定版本徽章：平常顯示版號；有新 SW 時變成更新按鈕。 */
#app-version-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  border: 1px solid rgba(232,196,122,.35);
  border-radius: 999px;
  background: rgba(30, 26, 22, .82);
  color: rgba(243,234,214,.72);
  font: inherit;
  font-size: .62rem;
  letter-spacing: .08em;
  padding: 4px 9px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#app-version-badge.has-update {
  color: #1e1a16;
  background: #e8c47a;
  border-color: #e8c47a;
  font-weight: 700;
}
#app-version-badge:disabled { opacity: .7; cursor: default; }
#app-version-badge[hidden] { display: none; }
/* 開著對話框／單篇時也不顯示版次碼：那顆固定在右下角，會壓在內容上。 */
body.modal-open #app-version-badge { display: none; }
@media print { #app-version-badge { display: none; } }

/* ---------------- 首頁內嵌專家設定 ---------------- */
.modal.admin-settings{width:min(1120px,96vw);max-height:92vh;padding:0;overflow:hidden;display:flex;flex-direction:column}
.admin-shell{display:flex;flex-direction:column;min-height:0;max-height:92vh}
.admin-pad{padding:26px 28px}
.admin-login-pad{max-width:560px;margin:0 auto}
.admin-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding:22px 26px 14px;border-bottom:1px solid rgba(99,74,42,.16)}
.admin-head h2{font-family:var(--font-kai);font-size:1.7rem;margin:0}
.admin-head-note{font-size:.78rem;line-height:1.75;margin:5px 0 0;max-width:58ch}
.admin-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 26px;border-bottom:1px solid rgba(99,74,42,.12);font-size:.78rem;color:#5b4a33}
.admin-tools select{border:1px solid rgba(154,116,60,.32);background:#fffdf7;border-radius:9px;padding:7px 10px;color:#3f3324;min-width:12rem}
.admin-count{font-size:.7rem;color:#8b765a}
.admin-save-state{font-size:.72rem;color:#8b765a;margin-left:auto}
.admin-save-state[data-state="ok"]{color:#2f6b4f;font-weight:600}
.admin-save-state[data-state="err"]{color:#a83a32;font-weight:600}
.admin-save-state[data-state="pending"]{color:#9a743c}
.admin-body{display:grid;grid-template-columns:1.15fr .85fr;gap:20px;padding:18px 26px;overflow:auto;min-height:0}
.admin-segments-wrap,.admin-poly-wrap{min-width:0}
.admin-section-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:2px}
.admin-section-head h3{font-family:var(--font-kai);font-size:1.15rem;margin:0;color:#3b2d1c}
.admin-hint{font-size:.7rem;line-height:1.75;color:#8b765a;margin:4px 0 10px}
.admin-segments{display:flex;flex-direction:column;gap:8px}
.admin-seg{display:grid;grid-template-columns:26px 1fr;gap:6px;align-items:start;border:1px solid rgba(99,74,42,.12);border-radius:10px;padding:8px;background:rgba(255,253,247,.45)}
.admin-seg-no{font-size:.7rem;color:#9a743c;text-align:right;padding-top:8px}
.admin-seg textarea{width:100%;resize:vertical;min-height:48px;border:1px solid rgba(154,116,60,.22);border-radius:8px;background:#fffdf7;color:#3b2d1c;font:inherit;font-size:.9rem;line-height:1.7;padding:7px 9px}
.admin-seg-btns{grid-column:2;display:flex;gap:5px;flex-wrap:wrap}
.admin-seg-btns button{border:1px solid rgba(154,116,60,.28);background:rgba(255,250,238,.7);color:#7a5a31;border-radius:999px;padding:3px 8px;font-size:.65rem;cursor:pointer;font-family:var(--font-ui)}
.admin-seg-btns button:hover{background:rgba(232,196,122,.25)}
.admin-poly-list{display:flex;flex-direction:column;gap:6px;max-height:42vh;overflow:auto;margin-bottom:10px}
.admin-poly-row{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;border-bottom:1px dashed rgba(99,74,42,.14);padding:5px 2px;font-size:.78rem;color:#4a4032}
.admin-poly-row code{background:rgba(168,58,50,.08);color:#8e2f28;border-radius:4px;padding:0 4px}
.admin-poly-row small{color:#8b765a;font-size:.66rem}
.admin-poly-row button{margin-left:auto;border:1px solid rgba(179,69,58,.35);background:rgba(179,69,58,.07);color:#8e2f28;border-radius:999px;padding:2px 8px;font-size:.64rem;cursor:pointer}
.admin-poly-form{display:flex;flex-wrap:wrap;gap:6px;align-items:center;border-top:1px solid rgba(99,74,42,.12);padding-top:10px}
.admin-poly-form input,.admin-poly-form select{border:1px solid rgba(154,116,60,.3);background:#fffdf7;border-radius:8px;padding:6px 8px;color:#3f3324;font:inherit;font-size:.74rem;min-width:0}
.admin-poly-form input[name="from"],.admin-poly-form input[name="to"]{width:7.2rem}
.admin-poly-form input[name="note"]{flex:1;min-width:8rem}
.admin-poly-form .mini-btn{border:1px solid #8e2f28;background:#8e2f28;color:#fff8ea;border-radius:999px;padding:5px 10px;font-size:.7rem;cursor:pointer}
.admin-unlock-form{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap;margin-top:16px}
.admin-unlock-form label{flex:1;min-width:220px;font-size:.78rem;color:#5b4a33;display:flex;flex-direction:column;gap:5px}
.admin-unlock-form input{border:1px solid rgba(154,116,60,.35);background:#fffdf7;border-radius:9px;padding:10px 12px;font:inherit;color:#3b2d1c}
.admin-error{min-height:1.2em;font-size:.74rem;color:#a83a32;margin:8px 0 0}
.admin-error[data-state="ok"]{color:#2f6b4f}
.admin-pad-foot{display:flex;justify-content:flex-end;margin-top:18px}
.admin-foot{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:14px 26px 18px;border-top:1px solid rgba(99,74,42,.16);background:rgba(255,252,242,.35)}
.admin-foot .admin-hint{margin:0}
.admin-foot-actions{display:flex;gap:8px}
@media(max-width:860px){
  .admin-body{grid-template-columns:1fr;padding:14px 16px}
  .admin-head,.admin-tools,.admin-foot{padding-left:16px;padding-right:16px}
  .admin-seg{grid-template-columns:20px 1fr}
  .admin-save-state{margin-left:0}
}
/* 2026-11-29 方案／學習單入口：登入頁頁尾（獨立頁用 shop.css，不動主站其他規則） */
.landing-foot .foot-links{display:inline-flex;align-items:center;flex-wrap:wrap;gap:2px}
.landing-foot .foot-links a{color:inherit;text-decoration:none;padding:2px 0;border-bottom:1px solid transparent}
.landing-foot .foot-links a:hover{color:#e8c47a;border-bottom-color:rgba(232,196,122,.45)}
.landing-foot .foot-links a + a::before{content:"·";margin:0 8px;color:rgba(232,196,122,.35);border:0}
a.entry-guest{text-decoration:none}

/* 2026-11-30：免費版未解鎖的文章卡 */
.text-card.locked{opacity:.72;border-style:dashed;border-color:rgba(232,196,122,.28)}
.text-card.locked h3::after{content:' 🔒';font-size:.72em;opacity:.8}

.linklike{background:none;border:0;padding:0;color:inherit;font:inherit;cursor:pointer;text-decoration:underline;text-underline-offset:3px}

/* 2026-11-30：讀字游標不受「減少動態效果」影響。
 * 手機開了「移除動畫」（Android 協助工具／iOS 減少動態效果）時，上面的全域規則
 * 會把 animation-duration 壓成 0.001ms —— 字會變大、變紅，卻看不到「跳一下」。
 * 讀字游標是「現在唸到哪一顆」的主要指示，不是裝飾，所以只讓這幾個選字器保留
 * 原本的 0.3 秒；其他動畫（進場、場景、換行）照樣減量。 */
@media (prefers-reduced-motion: reduce) {
  .detail-line .zi.active,
  .reader-line .zi.active,
  .record-line .zi.active {
    animation-duration: .3s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
  }
}
