/*
 * Henri 頁面套件樣式：安靜、以文字為主，像一本排得很好的課本。
 * 頁面離線：字體不是系統的，就是套件自己帶的（font-*.woff2，給各個風格家族用）。
 * 顏色都是 CSS 變數，深色跟 prefers-color-scheme，也可以由 app 用 :root[data-theme="light|dark"] 強制。
 * 風格家族在檔案最後：<html data-style="家族" data-tone="配色">，由服務端按那門課的約定標上。
 * 字級由 --h-text-size 決定（預設 17px），app 可以調。
 */

/* ---------- 變數 ---------- */

:root {
  --h-paper: #f5f7f3;
  --h-surface: #ffffff;
  --h-ink: #16241e;
  --h-soft: #52635a;
  --h-rule: #d3dcd5;
  --h-accent: #1f5443;
  --h-on-accent: #ffffff;
  --h-accent-tint: #e2ece6;
  --h-wrong: #b3312a;
  --h-wrong-tint: #f6e3e0;
  --h-mark: #f6e58d;
  --h-mark-line: #b4932b;   /* 「常見誤解」的邊線，螢光筆的深色版 */
  /* 「答對」的顏色，和強調色分開：預設跟著強調色走，強調色是暖色或黑色的家族另外給一個綠。 */
  --h-ok: var(--h-accent);
  --h-ok-tint: var(--h-accent-tint);
  --h-on-ok: var(--h-on-accent);
  /* 說「答對了」的那幾個字的顏色。多數家族就是 ok；ok 只拿來整塊填色的家族（瑞士）另外給。 */
  --h-ok-ink: var(--h-ok);
  --h-shadow: 0 1px 2px rgba(16, 32, 26, .08), 0 10px 28px rgba(16, 32, 26, .14);

  --h-font-body: -apple-system, "PingFang TC", "Hiragino Sans", "Noto Sans TC", system-ui, sans-serif;
  --h-font-display: "Kaiti TC", "STKaiti", "BiauKai", "LXGW WenKai TC", "Songti TC", serif;
  --h-font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --h-text-size: 17px;
  --h-leading: 1.75;
  --h-measure: 34em;   /* 正文欄的寬度：中文一行約 34 字，西文約 70 個字元 */
  --h-gutter: 22px;
  --h-radius: 14px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --h-paper: #13201b;
    --h-surface: #1a2a24;
    --h-ink: #e8eee8;
    --h-soft: #a5b5ac;
    --h-rule: #30463c;
    --h-accent: #9fd6be;
    --h-on-accent: #10201a;
    --h-accent-tint: #20382f;
    --h-wrong: #f1907f;
    --h-wrong-tint: #3b2320;
    --h-mark: #5c4f10;
    --h-mark-line: #cfb24c;
    --h-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --h-paper: #13201b;
  --h-surface: #1a2a24;
  --h-ink: #e8eee8;
  --h-soft: #a5b5ac;
  --h-rule: #30463c;
  --h-accent: #9fd6be;
  --h-on-accent: #10201a;
  --h-accent-tint: #20382f;
  --h-wrong: #f1907f;
  --h-wrong-tint: #3b2320;
  --h-mark: #5c4f10;
  --h-mark-line: #cfb24c;
  --h-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* 各語言的字體。簡體、日文、西文各用自己的字形和行高。 */
:root:lang(zh-Hans), :root:lang(zh-CN), :root:lang(zh-SG) {
  --h-font-body: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --h-font-display: "Kaiti SC", "STKaiti", "LXGW WenKai", "Songti SC", serif;
}
:root:lang(ja) {
  --h-font-body: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --h-font-display: "Hiragino Mincho ProN", "YuMincho", "Yu Mincho", "Noto Serif JP", serif;
}
:root:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)) {
  --h-font-body: -apple-system, system-ui, "Helvetica Neue", sans-serif;
  --h-font-display: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --h-leading: 1.6;
}

/* 頁面裡標了另一種中日韓語言的片段（<span lang="ja">、text-lang），改用那種語言的字體，漢字字形才對。
   權重和一般 class 一樣，放在前面，元件自己指定的字體（例如等寬）會蓋過它。 */
:where(:root:not(:lang(ja))) :lang(ja) {
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}
:where(:root:not(:lang(zh-Hant))) :lang(zh-Hant), :where(:root:not(:lang(zh-Hant))) :lang(zh-TW) {
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}
:where(:root:not(:lang(zh-Hans))) :lang(zh-Hans), :where(:root:not(:lang(zh-Hans))) :lang(zh-CN) {
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}
:where(:root:not(:lang(ko))) :lang(ko) {
  font-family: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

/* ---------- 頁面 ---------- */

html {
  font-size: var(--h-text-size);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--h-paper);
}

body {
  margin: 0;
  background: var(--h-paper);
  color: var(--h-ink);
  font-family: var(--h-font-body);
  font-size: 1rem;
  line-height: var(--h-leading);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

main {
  display: block;
  max-width: var(--h-measure);
  margin: 0 auto;
  padding:
    calc(var(--h-reader-top, env(safe-area-inset-top, 0px)) + 32px)
    max(var(--h-gutter), env(safe-area-inset-right, 0px))
    calc(env(safe-area-inset-bottom, 0px) + 56px)
    max(var(--h-gutter), env(safe-area-inset-left, 0px));
}

::selection { background: var(--h-mark); color: var(--h-ink); }

:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}

/* ---------- 文字 ---------- */

h1, h2, h3, h4 {
  color: var(--h-ink);
  text-wrap: balance;
}

h1, h2 {
  font-family: var(--h-font-display);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 1.82rem;
  line-height: 1.3;
  letter-spacing: .01em;
}

h2 {
  margin: 2.2em 0 .6em;
  font-size: 1.3rem;
  line-height: 1.4;
}

h3 {
  margin: 1.8em 0 .45em;
  font-size: 1.04rem;
  line-height: 1.5;
  font-weight: 600;
}

h4 {
  margin: 1.4em 0 .3em;
  font-size: 1rem;
  font-weight: 600;
}

p { margin: 0 0 1em; }

/* 正文靠左，不左右對齊：中文段落夾西文詞時，justify 會把那一行的字距撐開。
   text-wrap: pretty 只用在西文（避免最後一行只剩一個詞）。中日韓文不用：WebKit 的 pretty 會為了右緣整齊
   把整段每一行都縮短一截（中文每個字都能斷行，縮得特別多），可用的寬度白白浪費；Chrome 只調最後幾行，看不出來。
   權重壓到 0，元件可以用自己的設定。 */
:where(main p, main li, main figcaption, main blockquote, henri-event, henri-note, henri-level, henri-option, .h-why, .h-choice-text):where(:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) { text-wrap: pretty; }
/* 導言用 balance 讓兩行差不多長；中日韓文不用：balance 可能在詞的中間斷開（「一瓶寫／著」）。 */
:where(main) .lede:where(:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) { text-wrap: balance; }

strong, b { font-weight: 600; }

/* 中日文的強調不用斜體，用字下面一排小點（像著重號）。
   不用 text-emphasis：WebKit 會為了放著重號把那一行撐高，iPhone 上點又小得看不見。
   點狀底線不改行高，兩個引擎看起來一樣。 */
:lang(zh) em, :lang(ja) em {
  font-style: normal;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--h-accent);
  text-decoration-thickness: .16em;
  text-underline-offset: .32em;
  text-decoration-skip-ink: none;
}

mark {
  color: inherit;
  background: linear-gradient(transparent 52%, var(--h-mark) 52%, var(--h-mark) 92%, transparent 92%);
  padding: 0 .1em;
}

a {
  color: var(--h-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: color-mix(in srgb, var(--h-accent) 40%, transparent);
}
/* 電話號碼（熱線）：和別的連結一樣的樣子，號碼不從中間斷行。點了由 app 交給系統撥號。 */
a[href^="tel:"] { white-space: nowrap; }

sup {
  font-size: .68em;
  line-height: 0;
  vertical-align: super;
}

sup a[href^="#"] {
  font-family: var(--h-font-mono);
  font-weight: 600;
  color: var(--h-accent);
  text-decoration: none;
  padding: 0 .18em;
}

/* 腳註記號（套件的腳本會標上這幾個 class）：
   .h-fn-glue 把記號和前一個字黏在一起，記號不會單獨掉到下一行開頭；
   .h-fn-sep 是並排的第二個以後的記號，前面加逗號，「1」「2」不會看成「12」；
   .h-fn-before-digit 是後面緊接數字的記號，拉開一點，不會黏成「¹1950」。 */
.h-fn-glue { white-space: nowrap; }
sup a.h-fn-sep { padding-left: 0; }
.h-fn-sep::before { content: ","; margin-left: -.14em; padding-right: .14em; color: var(--h-soft); font-weight: 400; }
sup.h-fn-before-digit { margin-right: .3em; }

small { font-size: .84em; color: var(--h-soft); }

main ul, main ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}
main li { margin: .3em 0; }
main li::marker { color: var(--h-soft); }

blockquote {
  margin: 1.4em 0;
  padding: .1em 0 .1em 1em;
  border-left: 2px solid var(--h-rule);
  color: var(--h-soft);
}

hr {
  border: 0;
  margin: 2.4em 0;
  text-align: center;
  line-height: 1;
}
hr::before {
  content: "\00B7\2003\00B7\2003\00B7";
  color: var(--h-soft);
}

code, kbd, samp {
  font-family: var(--h-font-mono);
  font-size: .86em;
}
:not(pre) > code {
  padding: .08em .35em;
  border-radius: 5px;
  background: var(--h-accent-tint);
}
pre {
  overflow-x: auto;
  margin: 1.4em 0;
  padding: 14px 16px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.6;
}

img, video { max-width: 100%; height: auto; }

/* ---------- 頁首 ---------- */

main > header { margin-bottom: 1.2em; }

.eyebrow {
  margin: 0 0 1em;
  font-family: var(--h-font-mono);
  font-size: .76rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .12em;
  color: var(--h-accent);
}

.lede {
  margin: .85em 0 0;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--h-soft);
}

main > header::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-top: 1.5rem;
  border-radius: 2px;
  background: var(--h-accent);
}

/* ---------- 圖 ---------- */

figure {
  margin: 2em 0;
  padding: 14px 14px 12px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: var(--h-radius);
}

figure > svg, figure > img {
  display: block;
  width: 100%;
  height: auto;
  color: var(--h-ink);
}

figcaption {
  margin-top: .75em;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--h-soft);
}

/* 內嵌 SVG 的字。<main> 裡任何 SVG 都適用，不只 <figure> 裡的。
   字體和字級設在 <svg> 上讓 <text> 繼承，所以 <text> 自己的 font-size 屬性照樣生效（也可以用 style 或 class）。
   字的顏色固定成墨色，要別的顏色把 fill-* class 寫在 <text> 自己身上（寫在外層的 <g> 上不會傳下來）。 */
main svg {
  font-family: var(--h-font-body);
  font-size: 12px;
}
main svg text { fill: var(--h-ink); }
svg .fill-ink { fill: var(--h-ink); }
svg .fill-soft { fill: var(--h-soft); }
svg .fill-rule { fill: var(--h-rule); }
svg .fill-accent { fill: var(--h-accent); }
svg .fill-tint { fill: var(--h-accent-tint); }
svg .fill-wrong { fill: var(--h-wrong); }
svg .fill-wrong-tint { fill: var(--h-wrong-tint); }
svg .fill-mark { fill: var(--h-mark); }
svg .fill-surface { fill: var(--h-surface); }
svg .fill-paper { fill: var(--h-paper); }
svg .fill-none { fill: none; }
svg .stroke-ink { stroke: var(--h-ink); }
svg .stroke-soft { stroke: var(--h-soft); }
svg .stroke-rule { stroke: var(--h-rule); }
svg .stroke-accent { stroke: var(--h-accent); }
svg .stroke-wrong { stroke: var(--h-wrong); }
svg .stroke-surface { stroke: var(--h-surface); }
svg .stroke-tint { stroke: var(--h-accent-tint); }
svg .stroke-mark { stroke: var(--h-mark); }
/* .small 低於 12px 的下限（發布檢查會警告），新的圖不要用；保留只是為了不改動現有頁面的圖。 */
svg text.small, svg tspan.small { font-size: 10.5px; }
svg text.label { font-weight: 600; }

/* ---------- 元件共用 ---------- */

henri-quiz, henri-levels, henri-reveal, henri-timeline, henri-compare, henri-note, henri-pick, henri-find, henri-reply {
  display: block;
}

henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card {
  margin: 2.2em 0;
  padding: 18px 16px 16px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: var(--h-radius);
}

.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label {
  display: block;
  margin: 0 0 10px;
  font-family: var(--h-font-mono);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--h-accent);
}

.h-icon { display: inline-flex; }
.h-icon svg { display: block; width: 100%; height: 100%; }

button { font: inherit; }

/* ---------- 單選題 ---------- */

henri-quiz > p, .h-quiz-stem, .h-reply-q {
  margin: 0 0 .85em;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
}

henri-choice { display: block; }
/* <henri-why> 是選了之後才顯示的解釋，套件把它複製到解釋區；原本的元素一直藏著（和 why 屬性一樣，沒有腳本時也不顯示）。 */
henri-why { display: none; }

/* 腳本沒載入時：選項照樣列出來。 */
henri-quiz:not([data-ready]) henri-choice {
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--h-rule);
  border-radius: 11px;
}

.h-choices {
  display: grid;
  gap: 8px;
}

henri-choice[data-ready] {
  border: 1px solid var(--h-rule);
  border-radius: 11px;
  background: var(--h-surface);
  transition: border-color .18s ease, background-color .18s ease;
}

.h-choice {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  min-height: 50px;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.h-choice-text { flex: 1; min-width: 0; padding-top: 1px; }

.h-choice-mark {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  box-sizing: border-box;
  border: 1px solid var(--h-rule);
  border-radius: 50%;
  font-family: var(--h-font-mono);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1;
  color: var(--h-soft);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.h-choice-mark .h-icon { display: none; width: 15px; height: 15px; }

@media (hover: hover) {
  henri-choice[data-ready]:not([data-state]):hover { border-color: var(--h-soft); }
}
henri-choice[data-ready]:not([data-state]):active { background: var(--h-accent-tint); }

henri-choice[data-state="correct"] {
  border-color: var(--h-ok);
  background: var(--h-ok-tint);
}
henri-choice[data-state="correct"] .h-choice-mark {
  border-color: var(--h-ok);
  background: var(--h-ok);
  color: var(--h-on-ok);
}
henri-choice[data-state="wrong"] {
  border-color: var(--h-wrong);
  background: var(--h-wrong-tint);
}
henri-choice[data-state="wrong"] .h-choice-mark {
  border-color: var(--h-wrong);
  background: var(--h-wrong);
  color: var(--h-surface);
}
henri-choice[data-state] .h-choice-letter { display: none; }
henri-choice[data-state="correct"] .h-icon-check,
henri-choice[data-state="wrong"] .h-icon-cross { display: block; }

.h-why {
  padding: 0 14px 13px 52px;
  font-size: .94rem;
  line-height: 1.7;
  color: var(--h-ink);
}
.h-why:empty { padding: 0; }
.h-verdict { font-weight: 700; margin-right: .35em; }
/* 中日文的句號自帶留白，不再加間距。 */
:lang(zh) .h-verdict, :lang(ja) .h-verdict { margin-right: 0; }
henri-choice[data-state="correct"] .h-verdict { color: var(--h-ok); }
henri-choice[data-state="wrong"] .h-verdict { color: var(--h-wrong); }
henri-choice[data-state] .h-why { animation: h-rise .22s ease-out; }

/* ---------- 點出來 ---------- */

/* 題目寫在 label，套件放在最上面；片段是行內的切換按鈕，散在原本的文字裡（配料表、一句話）。 */
.h-find-stem {
  margin: 0 0 .85em;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
}
.h-find-body { line-height: 2.5; }
.h-find-body > :first-child { margin-top: 0; }
.h-find-body > :last-child { margin-bottom: 0; }
henri-spot { display: inline; }
/* 腳本沒載入時：片段只是原文，加一條淡淡的底線。 */
henri-find:not([data-ready]) henri-spot { border-bottom: 1px dashed var(--h-rule); }
/* 片段放在清單裡時，片段本身已經是一個個框：不再加圓點（沒腳本時照樣有圓點，免得清單擠成一團） */
henri-find[data-ready] ul { list-style: none; padding-left: 0; }

.h-spot {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  min-height: 44px;
  margin: 2px 1px;
  padding: 4px 10px;
  border: 1px dashed var(--h-soft);
  border-radius: 9px;
  background: var(--h-surface);
  color: var(--h-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .18s ease, border-color .18s ease;
}
.h-spot .h-icon { display: none; width: 14px; height: 14px; flex: none; }
.h-spot[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
  font-weight: 600;
}
.h-spot:disabled { cursor: default; }
henri-spot[data-state="found"] .h-spot { border-style: solid; border-color: var(--h-ok); background: var(--h-ok-tint); color: var(--h-ink); }
henri-spot[data-state="missed"] .h-spot { border: 2px dashed var(--h-ok); background: none; color: var(--h-ink); font-weight: 600; }
henri-spot[data-state="extra"] .h-spot { border-style: solid; border-color: var(--h-wrong); background: var(--h-wrong-tint); color: var(--h-ink); }
henri-spot[data-state="found"] .h-icon-check,
henri-spot[data-state="extra"] .h-icon-cross { display: inline-flex; }
henri-spot[data-state="found"] .h-icon-check { color: var(--h-ok); }
henri-spot[data-state="extra"] .h-icon-cross { color: var(--h-wrong); }

.h-find-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}
.h-find-bar [hidden] { display: none; }
.h-find-verdict { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--h-soft); }
henri-find[data-state="correct"] .h-find-verdict { color: var(--h-ok-ink); font-weight: 700; }
henri-find[data-state="wrong"] .h-find-verdict { color: var(--h-ink); font-weight: 600; }

.h-find-results {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  animation: h-rise .22s ease-out;
}
.h-find-results[hidden] { display: none; }
.h-find-result {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: .94rem;
  line-height: 1.65;
}
.h-find-result .h-icon { width: 15px; height: 15px; margin-top: .3em; flex: none; }
.h-find-result[data-state="found"] .h-icon, .h-find-result[data-state="missed"] .h-icon { color: var(--h-ok-ink); }
.h-find-result[data-state="extra"] .h-icon { color: var(--h-wrong); }
.h-find-result[data-state="missed"] .h-icon { opacity: .55; }
.h-find-result[data-state="found"] .h-verdict, .h-find-result[data-state="missed"] .h-verdict { color: var(--h-ok-ink); }
.h-find-result[data-state="extra"] .h-verdict { color: var(--h-wrong); }
.h-find-name { font-weight: 600; margin-right: .4em; }
.h-find-name::after { content: ":"; font-weight: 400; }
/* 中日文用全形冒號，冒號自帶留白 */
:lang(zh) .h-find-name, :lang(ja) .h-find-name { margin-right: 0; }
:lang(zh) .h-find-name::after, :lang(ja) .h-find-name::after { content: "："; }
.h-find-line .h-verdict { margin-right: .5em; }

/* ---------- 先想再看 ---------- */

henri-reveal { margin: 2.2em 0; }

henri-reveal:not([data-ready]) {
  padding: 16px 18px;
  border: 1px dashed var(--h-rule);
  border-radius: var(--h-radius);
}

.h-reveal-btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 112px;
  box-sizing: border-box;
  margin: 0;
  padding: 22px 18px;
  border: 1px dashed color-mix(in srgb, var(--h-accent) 55%, var(--h-rule));
  border-radius: var(--h-radius);
  background:
    repeating-linear-gradient(-45deg, transparent 0 9px, color-mix(in srgb, var(--h-accent-tint) 75%, transparent) 9px 10px),
    var(--h-surface);
  color: var(--h-accent);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .18s ease, border-color .18s ease;
}
.h-reveal-btn .h-icon {
  width: 30px;
  height: 30px;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--h-accent);
  color: var(--h-on-accent);
}
.h-reveal-btn:active { border-style: solid; }
.h-reveal-btn[hidden] { display: none; }

.h-reveal-body {
  padding: 16px 18px 2px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-left: 3px solid var(--h-accent);
  border-radius: 4px var(--h-radius) var(--h-radius) 4px;
}
.h-reveal-body:focus { outline: none; }
.h-flag:focus { outline: none; }
.h-reveal-body:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }
henri-reveal[data-open] .h-reveal-body { animation: h-rise .35s ease-out; }

.h-reveal-label {
  margin: 0 0 .4em;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--h-soft);
  text-align: left;
}

/* ---------- 分檔滑桿 ---------- */

henri-levels:not([data-ready]) henri-level { display: block; margin: .6em 0; }
henri-levels:not([data-ready]) henri-level::before {
  content: attr(name);
  margin-right: .6em;
  font-weight: 600;
  color: var(--h-accent);
}

.h-levels-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.h-levels-head .h-levels-label { margin: 0 0 3px; }
.h-levels-name {
  font-family: var(--h-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--h-accent);
  white-space: nowrap;
}

/* 量表：十格的條，填滿比例是當前一檔的 value。 */
.h-meter {
  position: relative;
  height: 12px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--h-accent-tint);
}
.h-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--h-accent);
  transition: width .4s cubic-bezier(.2, .7, .2, 1);
}
.h-meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--h-surface) calc(10% - 2px) 10%);
}

.h-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 8px 0 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.h-range:focus { outline: none; }
.h-range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: var(--h-rule);
}
.h-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -12px;
  border: 2px solid var(--h-accent);
  border-radius: 50%;
  background: var(--h-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.h-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--h-surface), 0 0 0 5px var(--h-accent);
}
.h-range::-moz-range-track { height: 2px; border-radius: 1px; background: var(--h-rule); }
.h-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid var(--h-accent);
  border-radius: 50%;
  background: var(--h-surface);
}

.h-ticks {
  position: relative;
  height: 30px;
  margin: -4px 0 8px;
}
.h-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding: 2px 4px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--h-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease;
}
.h-tick.is-first { transform: translateX(-13px); }
.h-tick.is-last { transform: translateX(calc(-100% + 13px)); }
.h-tick.is-on { color: var(--h-accent); font-weight: 600; }
/* 檔名擠成一串時（henri.js 量過，加 is-crowded）：只標頭尾兩檔，中間的畫成小點，當前一檔的點用強調色。 */
.h-ticks.is-crowded .h-tick.is-mid {
  top: 9px;
  width: 6px;
  height: 6px;
  padding: 0;
  border-radius: 50%;
  background: var(--h-rule);
  color: transparent;
  font-size: 0;
}
.h-ticks.is-crowded .h-tick.is-mid.is-on { background: var(--h-accent); }

/* 各檔的說明疊在同一格裡，高度取最高的一檔，切換時頁面不跳。 */
.h-levels-desc { display: grid; }
.h-levels-desc > henri-level {
  grid-area: 1 / 1;
  visibility: hidden;
  font-size: .96rem;
  line-height: 1.7;
}
.h-levels-desc > henri-level[data-active] { visibility: visible; }

/* ---------- 時間軸 ---------- */

henri-timeline {
  position: relative;
  margin: 2em 0;
  padding: 0 0 0 28px;
}
henri-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 12px;
  width: 2px;
  border-radius: 1px;
  background: var(--h-rule);
}
henri-event {
  display: block;
  position: relative;
  margin: 0 0 1.15em;
  line-height: 1.7;
}
henri-event:last-child { margin-bottom: 0; }
henri-event::before {
  content: attr(when);
  display: block;
  margin-bottom: 1px;
  font-family: var(--h-font-mono);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--h-accent);
}
henri-event::after {
  content: "";
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid var(--h-accent);
  border-radius: 50%;
  background: var(--h-paper);
}

/* ---------- 對照表 ---------- */

henri-compare {
  margin: 2em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: var(--h-radius);
}

henri-compare table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .88rem;
  line-height: 1.55;
}
henri-compare caption {
  padding: 12px 14px 0;
  text-align: left;
  font-size: .8rem;
  color: var(--h-soft);
}
henri-compare th, henri-compare td {
  min-width: 3.6em;
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--h-rule);
}
henri-compare tbody tr:last-child > * { border-bottom: 0; }
henri-compare thead th {
  font-weight: 600;
  color: var(--h-ink);
  vertical-align: bottom;
  border-bottom-color: var(--h-soft);
}
henri-compare th { white-space: nowrap; }
henri-compare tbody th { font-weight: 600; color: var(--h-ink); }
/* 第一欄固定，表格橫向捲動時留在原地。 */
henri-compare tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 0;
  padding-left: 12px;
  background: var(--h-surface);
  border-right: 1px solid var(--h-rule);
}

/* ---------- 提示框 ---------- */

henri-note {
  margin: 1.8em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--h-accent);
  font-size: .96rem;
  line-height: 1.75;
}
henri-note > :last-child { margin-bottom: 0; }
henri-note[kind="warn"] { border-left-color: var(--h-wrong); }
henri-note[kind="misconception"] { border-left-color: var(--h-mark-line); }

.h-note-label {
  display: block;
  margin-bottom: 2px;
  font-family: var(--h-font-mono);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--h-accent);
}
henri-note[kind="warn"] .h-note-label { color: var(--h-wrong); }
henri-note[kind="misconception"] .h-note-label {
  width: fit-content;
  margin-bottom: 4px;
  padding: 0 .35em;
  border-radius: 2px;
  background: var(--h-mark);
  color: var(--h-ink);
}

/* ---------- 名詞解釋 ---------- */

/* 行內的詞，下面一條虛線，字的顏色不變：強調是一排圓點、連結是實線加強調色，三種分得開。
   套件增強之後才有 aria-expanded，所以沒有解釋、或放錯地方的詞看起來就是一般文字。 */
henri-term[aria-expanded] {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--h-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .34em;
  text-decoration-skip-ink: none;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  cursor: pointer;
  touch-action: manipulation;
}
henri-term[aria-expanded="true"] { background: var(--h-accent-tint); }

/* 腳本沒載入時：解釋接在詞後面的括號裡。 */
henri-term[def]:not([data-ready])::after {
  content: " (" attr(def) ")";
  color: var(--h-soft);
  font-size: .92em;
}
:lang(zh) henri-term[def]:not([data-ready])::after,
:lang(ja) henri-term[def]:not([data-ready])::after { content: "（" attr(def) "）"; }

/* 解釋卡：整頁共用一張，絕對定位在詞的下一行（放不下時在上面），跟著頁面捲動。位置由套件算。 */
.h-term-card {
  position: absolute;
  z-index: 40;
  box-sizing: border-box;
  width: max-content;
  max-width: min(23.5rem, var(--h-term-max, 100vw));
  margin: 0;
  padding: 11px 14px 12px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: 12px;
  box-shadow: var(--h-shadow);
  color: var(--h-ink);
  font-family: var(--h-font-body);
  font-size: .92rem;
  font-weight: 400;
  line-height: 1.65;
  text-align: left;
  animation: h-pop .16s ease-out;
}
.h-term-card[hidden] { display: none; }
.h-term-name {
  display: block;
  margin-bottom: 1px;
  font-weight: 600;
}
.h-term-def { display: block; }
/* 指著詞的小尖角：一個轉了 45 度的方塊，只畫靠外的兩條邊。 */
.h-term-arrow {
  position: absolute;
  top: -6px;
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  background: var(--h-surface);
  border: solid var(--h-rule);
  border-width: 1px 0 0 1px;
  border-top-left-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}
.h-term-card[data-side="top"] .h-term-arrow {
  top: auto;
  bottom: -6px;
  transform: translateX(-50%) rotate(225deg);
}

/* ---------- 選一項看說明 ---------- */

henri-pick figure {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: none;
}
henri-pick > svg { display: block; width: 100%; height: auto; margin: 0 0 14px; }
henri-pick svg [data-pick] { cursor: pointer; }
/* 圖上帶 data-pick 的部位：.h-hl 是只在選中時出現的高亮層。 */
henri-pick svg [data-pick] .h-hl { opacity: 0; transition: opacity .2s ease; }
henri-pick svg [data-pick].h-picked .h-hl { opacity: 1; }

/* 腳本沒載入時：每一項的名稱和說明都列出來。 */
henri-pick:not([data-ready]) henri-option { display: block; margin: .7em 0; }
henri-pick:not([data-ready]) henri-option::before {
  content: attr(name);
  display: block;
  font-weight: 600;
  color: var(--h-accent);
}

.h-pick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* 選項按鈕比一般按鈕緊一點，手機上四個短選項排得下一行；名稱不在按鈕裡斷行，放不下就整個換到下一行。 */
.h-pick-options .h-pick-btn {
  padding: 6px 11px;
  white-space: nowrap;
}
/* tabs：放得下時等寬排成一排；放不下時換行，不把名稱擠成兩行。 */
henri-pick[layout="tabs"] .h-pick-options .h-pick-btn {
  flex: 1 1 0;
  min-width: max-content;
  padding: 6px 10px;
}

.h-pick-desc {
  display: grid;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--h-rule);
}
.h-pick-desc > henri-option {
  grid-area: 1 / 1;
  visibility: hidden;
  font-size: .96rem;
  line-height: 1.7;
}
.h-pick-desc > henri-option[data-active] { visibility: visible; }
.h-pick-desc > henri-option > :last-child { margin-bottom: 0; }
.h-pick-name {
  display: block;
  margin-bottom: 2px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--h-accent);
}

/* ---------- 給自訂互動用的工具 class ---------- */

/* 不斷行 */
.h-nowrap { white-space: nowrap; }
/* 中日文大標題裡的一個詞，套件自己包的（henri.js 的 keepWords，#37）：詞裡不斷行，詞和詞之間照常 */
.h-word { white-space: nowrap; }
/* 片段和後面的標點黏在一起（glueTrailingPunct）：片段本身照樣可以折行，留一個字的位置給標點，長片段才不會撐出螢幕。 */
.h-nowrap > henri-spot .h-spot { white-space: normal; max-width: calc(100% - 1.2em); }

/* 按鈕：至少 44pt 高，和套件的選項一致。aria-pressed="true"（切換按鈕）或 aria-checked="true"（單選）是選中。 */
.h-button, .h-pick-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 6px 16px;
  border: 1px solid var(--h-rule);
  border-radius: 999px;
  background: var(--h-surface);
  color: var(--h-ink);
  font: inherit;
  font-size: .9rem;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
@media (hover: hover) {
  .h-button:not([aria-pressed="true"]):not([aria-checked="true"]):not(:disabled):hover,
  .h-pick-btn:not([aria-checked="true"]):hover { border-color: var(--h-soft); }
}
.h-button[aria-pressed="true"], .h-button[aria-checked="true"], .h-pick-btn[aria-checked="true"] {
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
  color: var(--h-accent);
  font-weight: 600;
}
.h-button-primary {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: var(--h-on-accent);
  font-weight: 600;
}
.h-button:disabled { opacity: .45; cursor: default; }
.h-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 分一分、猜一個數、滑桿帶動圖（0.2.0） ---------- */

/* 這三個增強時自己加上 .h-card：框和上面的小標籤（.h-label）跟著風格家族走，這裡只管裡面。 */
henri-sort, henri-guess, henri-range, henri-item { display: block; }
henri-sort[data-ready] henri-bin { display: none; }

/* 腳本沒載入時：題目、類別的名字、每一項照樣列出來；猜一個數剩題目和解釋；滑桿剩那張圖。 */
henri-sort:not([data-ready]), henri-guess:not([data-ready]), henri-range:not([data-ready]) { margin: 2.2em 0; }
henri-sort:not([data-ready])::before, henri-guess:not([data-ready])::before {
  content: attr(label);
  display: block;
  margin-bottom: .6em;
  font-weight: 600;
}
henri-sort:not([data-ready]) henri-bin {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 2px 12px;
  border: 1px solid var(--h-rule);
  border-radius: 999px;
  font-size: .9rem;
}
henri-sort:not([data-ready]) henri-item { margin: .6em 0; }

.h-sort-stem, .h-guess-stem {
  margin: 0 0 .85em;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
}

/* 分一分：一項一段，下面一排類別的按鈕。 */
.h-sort-list { display: grid; gap: 16px; }
.h-sort-list > henri-item + henri-item { padding-top: 16px; border-top: 1px solid var(--h-rule); }
.h-sort-text { margin: 0 0 10px; line-height: 1.65; }
.h-sort-text > :first-child { margin-top: 0; }
.h-sort-text > :last-child { margin-bottom: 0; }
.h-sort-bin .h-icon { display: none; width: 14px; height: 14px; flex: none; }
.h-sort-bin[aria-disabled="true"] { cursor: default; }
/* 分對的那一類整塊填成「答對」的顏色、字反白（每個家族都測過 on-ok 對 ok 的對比度），其他類別收起來；
   選錯的那一類用錯色的淺底。 */
.h-sort-bin[data-state="correct"] { border-color: var(--h-ok); background: var(--h-ok); color: var(--h-on-ok); font-weight: 600; }
.h-sort-bin[data-state="wrong"] { border-color: var(--h-wrong); background: var(--h-wrong-tint); color: var(--h-ink); font-weight: 400; }
.h-sort-bin[data-state="correct"] .h-icon-check,
.h-sort-bin[data-state="wrong"] .h-icon-cross { display: inline-flex; }
.h-sort-bin[data-state="wrong"] .h-icon-cross { color: var(--h-wrong); }
henri-item[data-state="correct"] .h-sort-bin:not([data-state="correct"]) { display: none; }
.h-sort-why { margin: 8px 0 0; font-size: .94rem; line-height: 1.65; }
.h-sort-why:empty { display: none; }
henri-item[data-state] .h-sort-why { animation: h-rise .22s ease-out; }
henri-item[data-state="correct"] .h-verdict { color: var(--h-ok-ink); }
henri-item[data-state="wrong"] .h-verdict { color: var(--h-wrong); }
.h-sort-verdict, .h-guess-verdict { margin: 14px 0 0; font-size: .92rem; line-height: 1.5; color: var(--h-soft); }
.h-sort-verdict:empty { display: none; }
henri-sort[data-state="correct"] .h-sort-verdict { color: var(--h-ok-ink); font-weight: 700; }
.h-sort-done { margin: 6px 0 0; font-size: .96rem; line-height: 1.7; animation: h-rise .22s ease-out; }
.h-sort-done[hidden] { display: none; }

/* 猜一個數：上面是他現在猜的數（大字）和滑桿；看了答案換成兩條並排的量條。 */
.h-guess-now {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.h-guess-you { font-size: .92rem; line-height: 1.5; color: var(--h-soft); }
.h-guess-value, .h-range-value {
  font-family: var(--h-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--h-accent);
}
.h-range-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 0;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--h-soft);
}
.h-guess-in .h-buttons { margin-top: 14px; }
.h-guess-in[hidden], .h-guess-out[hidden] { display: none; }
.h-guess-out { animation: h-rise .22s ease-out; }
.h-guess-out:focus { outline: none; }
.h-guess-rows { display: grid; gap: 12px; }
.h-guess-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: .92rem;
  line-height: 1.4;
}
.h-guess-name { color: var(--h-soft); }
.h-guess-num { font-weight: 700; text-align: right; }
.h-guess-row[data-row="actual"] .h-guess-name { color: var(--h-ink); font-weight: 600; }
.h-guess-row[data-row="actual"] .h-guess-num { color: var(--h-accent); }
.h-guess-track { height: 12px; border-radius: min(var(--h-radius), 3px); background: var(--h-accent-tint); }
.h-guess-fill {
  height: 100%;
  min-width: 3px;
  border-radius: min(var(--h-radius), 3px);
  background: var(--h-soft);
  transform-origin: left center;
  animation: h-grow .5s cubic-bezier(.2, .7, .2, 1);
}
.h-guess-row[data-row="actual"] .h-guess-fill { background: var(--h-accent); }
.h-guess-verdict { color: var(--h-ink); font-weight: 600; }
henri-guess[data-state="close"] .h-guess-verdict .h-verdict { color: var(--h-ok-ink); }
.h-guess-body { margin-top: 8px; font-size: .96rem; line-height: 1.7; }
.h-guess-body:empty { display: none; }
.h-guess-body > :first-child { margin-top: 0; }
.h-guess-body > :last-child { margin-bottom: 0; }

/* 滑桿帶動圖：圖（元素裡原本的內容）在上，讀數靠右，下面是滑桿。圖怎麼變由頁面的腳本寫。 */
henri-range > svg { display: block; width: 100%; height: auto; margin: 0 0 6px; }
henri-range > figure { margin: 0 0 6px; padding: 0; border: 0; background: none; box-shadow: none; }
.h-range-control { margin-top: 10px; }
.h-range-value { margin: 0; text-align: right; }
.h-range-value[hidden] { display: none; }
.h-range-control .h-range { margin-top: 2px; }

/* henri.drag 接上的把手：拖的時候換游標。 */
[data-dragging] { cursor: grabbing !important; }

/* ---------- 外語短句 ---------- */

henri-phrase {
  display: block;
  margin: 2em 0;
  padding: 18px 18px 14px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: var(--h-radius);
}

/* 腳本沒載入時：用屬性把句子、讀音、意思都列出來。 */
henri-phrase:not([data-ready])::before {
  content: attr(text);
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.35;
}
henri-phrase:not([data-ready])::after {
  content: attr(reading) "\A" attr(reading2) "\A" attr(meaning);
  display: block;
  margin-top: .4em;
  white-space: pre-line;
  color: var(--h-soft);
}

.h-phrase-text {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-wrap: balance;
}
/* 短句和讀音不在詞中間斷行（日文的助詞不會掉到行首）：只在空格、標點和作者標的零寬空格（&#8203;）處換行，
   真的放不下才任意斷開。 */
.h-phrase-text, .h-phrase-reading {
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}
.h-phrase-reading {
  margin: .4em 0 0;
  font-size: .98rem;
  line-height: 1.5;
  color: var(--h-soft);
  text-align: left;
}
/* 羅馬字、音標用等寬字；假名、注音等用正文字體。 */
.h-phrase-reading.is-latin {
  font-family: var(--h-font-mono);
  font-size: .84rem;
}
.h-phrase-reading + .h-phrase-reading { margin-top: .15em; }

.h-phrase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.h-phrase-speak {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px 0 12px;
  border: 1px solid var(--h-accent);
  border-radius: 999px;
  background: var(--h-accent-tint);
  color: var(--h-accent);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.h-phrase-speak .h-icon { width: 18px; height: 18px; }
.h-phrase-speak:active { background: var(--h-surface); }
.h-phrase-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px 0 10px;
  border: 1px dashed color-mix(in srgb, var(--h-accent) 55%, var(--h-rule));
  border-radius: 999px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 7px, color-mix(in srgb, var(--h-accent-tint) 75%, transparent) 7px 8px),
    var(--h-surface);
  color: var(--h-accent);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.h-phrase-btn .h-icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--h-accent);
  color: var(--h-on-accent);
}
.h-phrase-btn[hidden] { display: none; }
.h-phrase-meaning {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--h-rule);
  font-size: .98rem;
  line-height: 1.7;
  text-align: left;
}
.h-phrase-meaning:focus { outline: none; }
henri-phrase[data-open] .h-phrase-meaning { animation: h-rise .3s ease-out; }

/* ---------- 頁面上的回答 ---------- */

/* 和題目同一種卡片（框跟著家族變，見最後各家族的選擇器清單）：標籤、題目、會自己長高的輸入框。
   輸入框的字不小於 16px，不然 iOS 一聚焦就把整頁放大；字體跟著正文（手帳、繪本的正文不是黑體）。 */
.h-reply-label .h-reply-next {
  display: inline-block;
  margin-left: .7em;
  padding: 0 .5em;
  border-radius: min(var(--h-radius), 4px);
  background: var(--h-mark);
  color: var(--h-ink);
  letter-spacing: .04em;
}
.h-reply-q > :last-child { margin-bottom: 0; }

.h-reply-input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--h-soft);
  border-radius: var(--h-radius);
  background: var(--h-paper);
  color: var(--h-ink);
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.6;
  resize: none;
  overflow-y: hidden;
}
.h-reply-input::placeholder { color: var(--h-soft); opacity: 1; }
.h-reply-input:not([readonly]):focus { outline: 2px solid var(--h-accent); outline-offset: 0; border-color: transparent; }
.h-reply-input[hidden] { display: none; }

.h-reply-count {
  margin: 6px 0 0;
  font-size: .8rem;
  line-height: 1.4;
  text-align: right;
  color: var(--h-soft);
  font-variant-numeric: tabular-nums;
}
.h-reply-count.is-full { color: var(--h-wrong); }
.h-reply-count[hidden], .h-reply-status[hidden] { display: none; }

/* 交出去之後：他的字留在原地，換成淺底、沒有框，下面一行小字說已交給 Henri。 */
henri-reply[data-state="sent"] .h-reply-input { border-color: transparent; background-color: var(--h-accent-tint); cursor: default; }
.h-reply-status {
  margin: 8px 0 0;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--h-soft);
}
henri-reply[data-state="sent"] .h-reply-status { animation: h-rise .3s ease-out; }
/* 留空讀完：輸入框收起，原地留一個虛線的空格，寫著之後可以在對話裡說。 */
henri-reply[data-state="empty"] .h-reply-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--h-rule);
  border-radius: var(--h-radius);
}

/* ---------- 來源腳註 ---------- */

footer.sources {
  margin-top: 2.6em;
  font-size: .8rem;
  line-height: 1.65;
  color: var(--h-soft);
}
footer.sources h2, .h-sources-title {
  margin: 0 0 .9em;
  font-family: var(--h-font-mono);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--h-soft);
}
footer.sources ol, footer.sources ul { margin: 0; padding-left: 1.6em; }
footer.sources li {
  margin: 0 0 .55em;
  padding-left: .2em;
  overflow-wrap: anywhere;
  scroll-margin-top: 24px;
  border-radius: 4px;
  transition: background-color .4s ease;
}
footer.sources li::marker { font-family: var(--h-font-mono); }
footer.sources li:target { background: var(--h-mark); color: var(--h-ink); }
footer.sources a { color: inherit; text-decoration-color: var(--h-rule); }

/* ---------- 頁尾：讀完了、這裡不對 ---------- */

.h-end {
  margin: 3.2em 0 0;
  padding-top: 2em;
  border-top: 1px solid var(--h-rule);
}

.h-done {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--h-accent);
  color: var(--h-on-accent);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s ease, color .2s ease;
}
.h-done .h-icon { display: none; }
.h-done:active:not(.is-done) { filter: brightness(1.1); }
/* 已讀完：從實心的按鈕變成一枚完成的章：淺底、強調色的框、實心圓裡打勾。
   剛按下和重開時恢復出來的是同一個樣子；剛按下的多一下打勾的動畫。 */
.h-done.is-done {
  background: var(--h-accent-tint);
  box-shadow: inset 0 0 0 1.5px var(--h-accent);
  color: var(--h-accent);
  cursor: default;
}
.h-done.is-done .h-icon {
  display: block;
  flex: none;
  width: 1.5em;
  height: 1.5em;
  padding: .28em;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--h-accent);
  color: var(--h-on-accent);
}
.h-done.is-done-now .h-icon { animation: h-check .42s cubic-bezier(.2, .9, .3, 1.25) both; }

/* 只給讀螢幕的人：看不見、不佔位置。不用 overflow: hidden（發布檢查會當成被裁掉的內容）。 */
.h-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
  clip-path: inset(50%);
  pointer-events: none;
}

/* 這一課怎麼樣（0.3.0）：一行字加兩個圓鈕，點了的那個畫成強調色；點了不好，下面展開理由 */
.h-rate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 20px;
}
.h-rate-label {
  font-size: .94rem;
  color: var(--h-soft);
}
.h-rate-btns {
  display: inline-flex;
  gap: 8px;
}
.h-rate-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--h-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--h-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.h-rate-btn .h-icon { width: 20px; height: 20px; }
.h-rate-btn[aria-pressed="true"] {
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
  color: var(--h-accent);
}
.h-rate-btn:active { filter: brightness(.96); }

.h-rate-why {
  margin-top: 12px;
  padding: 16px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: var(--h-radius);
}
.h-rate-why[hidden] { display: none; }
.h-rate-ask {
  display: block;
  margin: 0 0 8px;
  font-size: .9rem;
  color: var(--h-soft);
}
.h-rate-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.h-rate-reason {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--h-rule);
  border-radius: 999px;
  background: var(--h-paper);
  color: var(--h-ink);
  font-size: .92rem;
  cursor: pointer;
  touch-action: manipulation;
}
.h-rate-reason[aria-pressed="true"] {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: var(--h-on-accent);
}
.h-rate-note {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--h-rule);
  border-radius: 10px;
  background: var(--h-paper);
  color: var(--h-ink);
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.55;
  resize: vertical;
}
.h-rate-note:focus { outline: 2px solid var(--h-accent); outline-offset: 0; border-color: transparent; }

.h-end-row {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.h-link-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--h-soft);
  font-size: .86rem;
  text-decoration: underline;
  text-decoration-color: var(--h-rule);
  text-underline-offset: .28em;
  cursor: pointer;
}

.h-flag {
  margin-top: 6px;
  padding: 16px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: var(--h-radius);
}
.h-flag[hidden] { display: none; }
.h-flag-quote {
  margin: 0 0 12px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--h-mark-line);
  font-size: .9rem;
  line-height: 1.6;
  color: var(--h-soft);
}
.h-flag-quote[hidden] { display: none; }
.h-flag-label {
  display: block;
  margin-bottom: 8px;
  font-size: .9rem;
  color: var(--h-soft);
}
.h-flag-note {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 92px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--h-rule);
  border-radius: 10px;
  background: var(--h-paper);
  color: var(--h-ink);
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.55;
  resize: vertical;
}
.h-flag-note:focus { outline: 2px solid var(--h-accent); outline-offset: 0; border-color: transparent; }
.h-flag-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.h-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--h-rule);
  border-radius: 10px;
  background: transparent;
  color: var(--h-ink);
  font-size: .94rem;
  font-weight: 600;
  cursor: pointer;
}
.h-btn-primary {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: var(--h-on-accent);
}
.h-btn[disabled] { opacity: .4; cursor: default; }

.h-status {
  margin: 10px 0 0;
  font-size: .86rem;
  text-align: center;
  color: var(--h-soft);
}
.h-status:empty { margin: 0; }

/* ---------- 選字提問 ---------- */

/* 選字後的浮條固定在畫面底部置中，不放在選取範圍旁邊：系統的 Copy／Look Up 選單貼著選取範圍，
   iPhone 上多半在上方、iPad 上在下方，頁面量不到它的位置；放在底部兩邊都不會被蓋住。 */
.h-ask {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 50;
  display: flex;
  align-items: center;
  max-width: calc(100% - 32px);
  padding: 3px;
  border-radius: 14px;
  background: var(--h-ink);
  box-shadow: var(--h-shadow);
  transform: translateX(-50%);
  animation: h-dock .18s ease-out;
}
.h-ask[hidden] { display: none; }
.h-ask-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--h-paper);
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.h-ask-btn:active { background: color-mix(in srgb, var(--h-paper) 14%, transparent); }
.h-ask-btn:focus-visible { outline-color: var(--h-paper); outline-offset: -3px; }
.h-ask-sep {
  width: 1px;
  height: 20px;
  background: color-mix(in srgb, var(--h-paper) 28%, transparent);
}

.h-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  z-index: 60;
  max-width: calc(100% - 48px);
  box-sizing: border-box;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--h-ink);
  color: var(--h-paper);
  box-shadow: var(--h-shadow);
  font-size: .88rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .2s ease, transform .2s ease;
}
.h-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 證書 ---------- */

/* 一張置中的紙，雙線框；在 390 寬的手機上一屏看完。所有字都由頁面寫，套件不補字。 */
main.certificate {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px)));
  max-width: 30rem;
  min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px);
  min-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px);
  margin: calc(env(safe-area-inset-top, 0px) + 16px) auto calc(env(safe-area-inset-bottom, 0px) + 16px);
  padding: 40px 28px 30px;
  background: var(--h-surface);
  border: 1px solid var(--h-rule);
  border-radius: 4px;
  outline: 1px solid var(--h-rule);
  outline-offset: -9px;
  text-align: center;
}
main.certificate p { text-align: center; }
main.certificate > svg {
  display: block;
  width: 56px;
  height: auto;
  margin: 0 auto 16px;
  color: var(--h-accent);
}
main.certificate .eyebrow {
  margin: 0 0 .9em;
  letter-spacing: .24em;
}
main.certificate h1 {
  font-size: 1.9rem;
  line-height: 1.3;
}
main.certificate .holder {
  box-sizing: border-box;
  min-width: 62%;
  min-height: 1.5em;
  margin: 1.3em 0 0;
  padding: 0 .4em .1em;
  font-family: var(--h-font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
}
main.certificate .holder:empty { border-bottom: 1px solid var(--h-ink); }
main.certificate .goal {
  max-width: 21em;
  margin: 1.1em 0 1.6em;
  font-size: .98rem;
  line-height: 1.75;
  text-wrap: balance;
}
main.certificate .facts {
  width: 100%;
  margin: 0 0 1.8em;
  border-top: 1px solid var(--h-rule);
  font-size: .86rem;
  line-height: 1.5;
  text-align: left;
}
main.certificate .facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--h-rule);
}
main.certificate .facts dt { flex: none; color: var(--h-soft); }
main.certificate .facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
main.certificate .signature {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: .2em .7em;
  box-sizing: border-box;
  min-width: 62%;
  min-height: 64px;
  margin: 0 0 1.2em;
  padding: 4px 12px 6px;
  border-bottom: 1px solid var(--h-rule);
  font-family: "Snell Roundhand", "Savoye LET", "Apple Chancery", "Bradley Hand", var(--h-font-display), cursive;
  font-size: 2.3rem;
  line-height: 1.3;
  color: var(--h-ink);
}
main.certificate .signature time {
  font-family: var(--h-font-mono);
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--h-soft);
}
/* 還沒簽：虛線框，簽名和日期都不顯示。 */
main.certificate .signature[data-signed="false"] {
  border: 1.5px dashed color-mix(in srgb, var(--h-soft) 45%, var(--h-rule));
  border-radius: 8px;
  color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
main.certificate .signature[data-signed="false"] time { visibility: hidden; }
main.certificate .disclaimer {
  max-width: 24em;
  margin: 0;
  font-size: .74rem;
  line-height: 1.6;
  color: var(--h-soft);
}

/* ---------- 動態 ---------- */

@keyframes h-rise {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}
@keyframes h-dock {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes h-pop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@keyframes h-grow {
  from { transform: scaleX(0); }
  to { transform: none; }
}
@keyframes h-check {
  from { opacity: 0; transform: scale(.3); }
  60% { opacity: 1; transform: scale(1.15); }
  to { opacity: 1; transform: none; }
}

/* 恢復出來的元件直接是做過的樣子，不播展開、換色的動畫；他再動手時套件拿掉 data-restored。 */
[data-restored], [data-restored] * {
  animation: none !important;
  transition: none !important;
}

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

/* 320 這類窄螢幕：卡片內距收一點，留給文字。 */
@media (max-width: 360px) {
  :root { --h-gutter: 18px; }
  henri-quiz, henri-levels, henri-find, henri-reply { padding: 16px 12px 12px; }
  .h-choice { gap: 10px; padding: 10px 12px; }
  .h-why { padding: 0 12px 12px 48px; }
  figure { padding: 12px 10px 10px; }
}

@media (min-width: 700px) {
  :root { --h-gutter: 40px; }
  main { padding-top: calc(var(--h-reader-top, env(safe-area-inset-top, 0px)) + 56px); }

  /* 寬螢幕（iPad）上正文欄維持 --h-measure，圖和互動元件可以往兩邊多伸出一點，
     伸出的量取兩邊剩下的空間，最多 2.5rem，離螢幕邊緣至少留 40px。iPhone 直向不受影響。 */
  :is(main, main > section, main > article, main > article > section) > :is(figure, henri-quiz, henri-levels, henri-pick, henri-find, henri-compare, henri-reveal, henri-phrase, henri-reply, .h-card) {
    margin-left: calc(-1 * clamp(0px, (100vw - var(--h-measure)) / 2 - 40px, 2.5rem));
    margin-right: calc(-1 * clamp(0px, (100vw - var(--h-measure)) / 2 - 40px, 2.5rem));
  }
}

@media print {
  .h-end, .h-ask, .h-toast, .h-term-card { display: none; }
  henri-reveal .h-reveal-body[hidden] { display: block; }
  .h-reveal-btn { display: none; }
}

/* ==================================================================================================
   風格家族
   --------------------------------------------------------------------------------------------------
   一門課用哪個家族、哪套配色，記在那門課約定的 style 和 tone；服務端送出頁面時標在 <html> 上，
   所以同一門課每一課一定一樣。頁面自己不寫 data-style，也不改這裡的變數。規格和每個家族的個性見 styles.md。
   - 沒有 data-style：不套家族，就是上面那一套基礎樣式。
   - 顏色用 light-dark() 一次寫好淺深兩個值，跟著上面的 color-scheme 走（系統設定，或 app 用 data-theme 指定）。
   - 每個家族有幾條「招牌處理」，寫在各段開頭；改樣式時不要把它們改掉。
   - 中文字體是繁體的。簡體頁面退回系統的黑體，日文頁面用系統的明朝體和丸ゴシック。
   ================================================================================================== */

@font-face { font-family: "Noto Serif TC"; src: url("font-noto-serif-tc.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "LXGW WenKai TC"; src: url("font-lxgw-wenkai-tc-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "LXGW WenKai TC"; src: url("font-lxgw-wenkai-tc-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Huninn"; src: url("font-huninn.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("font-newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("font-newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("font-ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("font-ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("font-ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("font-caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("font-fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

/* 各家族共用的三種中文字體，按頁面語言取：繁體用套件帶的，簡體退回系統黑體，日文用系統的明朝和丸ゴシック。 */
:root[data-style] {
  --h-zh-sans: -apple-system, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --h-zh-serif: "Noto Serif TC", "Songti TC", serif;
  --h-zh-kai: "LXGW WenKai TC", "Kaiti TC", "Noto Serif TC", serif;
  --h-zh-round: "Huninn", "PingFang TC", sans-serif;
}
:root[data-style]:lang(zh-Hans), :root[data-style]:lang(zh-CN), :root[data-style]:lang(zh-SG) {
  --h-zh-sans: -apple-system, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --h-zh-serif: "Songti SC", "PingFang SC", sans-serif;
  --h-zh-kai: "Kaiti SC", "PingFang SC", sans-serif;
  --h-zh-round: "PingFang SC", sans-serif;
}
:root[data-style]:lang(ja) {
  --h-zh-sans: -apple-system, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --h-zh-serif: "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --h-zh-kai: "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --h-zh-round: "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}

/* 中文沒有大小寫，方塊字拉開字距會散：標籤在中日文頁面不轉大寫、不加字距（家族另有設定的除外）。 */
[data-style]:is(:lang(zh), :lang(ja)) :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label, .h-note-label, .eyebrow) { letter-spacing: .04em; text-transform: none; }

/* --------------------------------------------------------------------------------------------------
   雜誌 magazine（預設）：獨立雜誌的內頁。宋體標題、黑體正文、等寬的小字；沒有卡片，只有字號、留白和細線。
   招牌：頁首一條粗線；第一段首字下沉；元件不裝框，上面一條粗線、下面一條細線；
         提示寫成拉頁引文，不用側邊色條；題目的選項用細線隔開。
   配色：ink 墨（預設）、indigo 靛藍、forest 森林、kraft 牛皮紙。
   -------------------------------------------------------------------------------------------------- */
:root[data-style="magazine"] {
  --h-paper: light-dark(#f4f1eb, #121211); --h-surface: light-dark(#f4f1eb, #121211);
  --h-ink: light-dark(#131312, #efece5); --h-soft: light-dark(#5e5a54, #a9a59c); --h-rule: light-dark(#d5cfc4, #37352f);
  --h-accent: light-dark(#131312, #efece5); --h-on-accent: light-dark(#f4f1eb, #121211); --h-accent-tint: light-dark(#e7e2d8, #262521);
  --h-ok: light-dark(#23684a, #8fd0ad); --h-ok-tint: light-dark(#dde9e0, #1c2c24); --h-on-ok: light-dark(#ffffff, #0d1a13);
  --h-wrong: light-dark(#a8322a, #f0907e); --h-wrong-tint: light-dark(#f1ddd6, #3a2320);
  --h-mark: light-dark(#f3e08a, #5d5011); --h-mark-line: light-dark(#7d6a16, #d8c55e);
  --h-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 12px 30px rgba(0, 0, 0, .2);
  --h-radius: 0px;
  --h-font-body: var(--h-zh-sans);
  --h-font-display: "Newsreader", var(--h-zh-serif);
  --h-font-mono: "IBM Plex Mono", var(--h-zh-sans);
}
:root[data-style="magazine"][data-tone="indigo"] {
  --h-paper: light-dark(#f1f3f5, #10141b); --h-surface: light-dark(#f1f3f5, #10141b);
  --h-ink: light-dark(#0d203b, #e6ebf3); --h-soft: light-dark(#54617a, #9da8bb); --h-rule: light-dark(#d0d6de, #2b3340);
  --h-accent: light-dark(#2c5688, #9dbbe6); --h-on-accent: light-dark(#ffffff, #0e1a2b); --h-accent-tint: light-dark(#dfe6ef, #1d2a3c);
  --h-ok: var(--h-accent); --h-ok-tint: var(--h-accent-tint); --h-on-ok: var(--h-on-accent);
}
:root[data-style="magazine"][data-tone="forest"] {
  --h-paper: light-dark(#f4f0e6, #121713); --h-surface: light-dark(#f4f0e6, #121713);
  --h-ink: light-dark(#1b2c20, #e6ebe2); --h-soft: light-dark(#5a6557, #a2ad9f); --h-rule: light-dark(#d8d2c1, #2c362e);
  --h-accent: light-dark(#2a6248, #93cfae); --h-on-accent: light-dark(#ffffff, #0d1a13); --h-accent-tint: light-dark(#dfe6d9, #1b2c22);
  --h-ok: var(--h-accent); --h-ok-tint: var(--h-accent-tint); --h-on-ok: var(--h-on-accent);
}
:root[data-style="magazine"][data-tone="kraft"] {
  --h-paper: light-dark(#ecdfc8, #1b1611); --h-surface: light-dark(#ecdfc8, #1b1611);
  --h-ink: light-dark(#2a1e14, #eee3d0); --h-soft: light-dark(#65543f, #b3a48d); --h-rule: light-dark(#cfbf9f, #3b3126);
  --h-accent: light-dark(#7c4014, #e0a878); --h-on-accent: light-dark(#fff8ea, #24160a); --h-accent-tint: light-dark(#e0cfae, #33271a);
  --h-ok: light-dark(#2f5f3f, #9fcfa8); --h-ok-tint: light-dark(#d7d9b9, #22301f); --h-on-ok: light-dark(#ffffff, #0d1a13);
  --h-mark: light-dark(#f0d77a, #5d4c11);
}
[data-style="magazine"] main > header { padding-top: 14px; border-top: 4px solid var(--h-ink); }
[data-style="magazine"] .eyebrow { color: var(--h-soft); font-size: .72rem; font-weight: 500; }
[data-style="magazine"]:not(:lang(zh)):not(:lang(ja)) .eyebrow { letter-spacing: .16em; text-transform: uppercase; }
[data-style="magazine"] h1 { font-weight: 700; font-size: 2.16rem; line-height: 1.26; letter-spacing: 0; }
[data-style="magazine"] h2 { font-weight: 700; font-size: 1.42rem; line-height: 1.4; margin-top: 2.6em; }
[data-style="magazine"] main h2:not(.h-sources-title)::before { content: ""; display: block; width: 2.2rem; height: 2px; margin-bottom: .9em; background: var(--h-accent); }
[data-style="magazine"] .lede { font-family: var(--h-font-display); font-size: 1.16rem; line-height: 1.7; color: var(--h-ink); opacity: .82; }
[data-style="magazine"] main > header::after { width: 100%; height: 1px; border-radius: 0; margin-top: 1.6rem; background: var(--h-rule); }
[data-style="magazine"] main > section:first-of-type > p:first-of-type:not([data-plain-start])::first-letter {
  float: left; margin: .1em .12em 0 0; font-family: var(--h-font-display); font-weight: 700; font-size: 3.3em; line-height: .92; color: var(--h-accent);
}
[data-style="magazine"] :is(henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card, figure) {
  padding: 16px 0 18px; background: none; border: 0; border-top: 2px solid var(--h-ink); border-bottom: 1px solid var(--h-rule); border-radius: 0;
}
[data-style="magazine"] :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label) { color: var(--h-soft); font-size: .72rem; font-weight: 500; }
[data-style="magazine"] henri-quiz > p, [data-style="magazine"] :is(.h-quiz-stem, .h-reply-q) { font-family: var(--h-font-display); font-size: 1.18rem; font-weight: 700; line-height: 1.5; }
[data-style="magazine"] .h-choices { gap: 0; }
[data-style="magazine"] henri-choice[data-ready] { border: 0; border-top: 1px solid var(--h-rule); border-radius: 0; background: none; }
[data-style="magazine"] .h-choice { padding: 13px 4px; border-radius: 0; }
[data-style="magazine"] .h-why { padding-left: 42px; padding-right: 4px; }
[data-style="magazine"] .h-choice-mark { border-color: var(--h-ink); color: var(--h-ink); font-weight: 500; }
[data-style="magazine"] henri-choice[data-state="correct"] { background: var(--h-ok-tint); border-top-color: var(--h-ok); }
[data-style="magazine"] henri-choice[data-state="wrong"] { background: var(--h-wrong-tint); border-top-color: var(--h-wrong); }
[data-style="magazine"] figcaption { font-family: var(--h-font-display); font-size: .9rem; }
[data-style="magazine"] henri-compare { border-radius: 0; border: 0; border-top: 2px solid var(--h-ink); border-bottom: 1px solid var(--h-rule); background: none; }
[data-style="magazine"] henri-note { padding: 14px 0 16px; border: 0; border-top: 1px solid var(--h-ink); border-bottom: 1px solid var(--h-ink); font-family: var(--h-font-display); font-size: 1.06rem; line-height: 1.75; }
[data-style="magazine"] .h-note-label { color: var(--h-soft); font-size: .72rem; font-weight: 500; margin-bottom: 6px; }
[data-style="magazine"] henri-note[kind="misconception"] .h-note-label { background: var(--h-mark); color: var(--h-ink); border-radius: 0; }
[data-style="magazine"] :is(.h-done, .h-btn, .h-rate-btn, .h-rate-reason, .h-rate-note, .h-term-card, .h-reveal-btn, .h-reveal-body, .h-button, .h-pick-btn, henri-phrase) { border-radius: 0; }
[data-style="magazine"] :is(.h-term-card, .h-term-arrow) { border-color: var(--h-ink); background: var(--h-paper); }
[data-style="magazine"] sup a[href^="#"] { font-weight: 500; }
[data-style="magazine"] .h-reply-input { border-color: var(--h-ink); }

/* --------------------------------------------------------------------------------------------------
   瑞士 swiss：瑞士國際主義的海報和手冊。全程無襯線，字越大越細、越小越粗；一個顏色；直角、細線、沒有陰影。
   招牌：頁首是一整塊顏色，上面是細體的大字；點陣只出現在頁首；小標題上方一條通欄細線；
         答對的那一項整塊填色；卡片是灰底、不描邊。
   配色：ikb 克萊因藍（預設）、black 黑、emerald 祖母綠、yellow 檸檬黃。
   -------------------------------------------------------------------------------------------------- */
:root[data-style="swiss"] {
  --h-paper: light-dark(#fafaf8, #0b0b0c); --h-surface: light-dark(#efefeb, #19191b);
  --h-ink: light-dark(#0a0a0a, #f3f3ef); --h-soft: light-dark(#55554f, #a8a8a1); --h-rule: light-dark(#cfcfc8, #343437);
  --h-accent: light-dark(#002fa7, #92a9ff); --h-on-accent: light-dark(#ffffff, #0b0b0c); --h-accent-tint: light-dark(#e2e7f5, #1b2242);
  --h-hero: #002fa7; --h-on-hero: #ffffff;
  --h-ok: light-dark(#002fa7, #2f55d4); --h-ok-tint: var(--h-ok); --h-on-ok: #ffffff;
  /* 瑞士的 ok 是拿來整塊填色的，深色模式下偏暗，當字色在深色底上不夠清楚（鈷藍 2.8、祖母綠 3.3）：深色時說對錯的字用墨色 */
  --h-ok-ink: light-dark(var(--h-ok), var(--h-ink));
  --h-wrong: light-dark(#b3312a, #f29384); --h-wrong-tint: light-dark(#f6e1de, #3c2322);
  --h-mark: light-dark(#ffe94d, #5a5000); --h-mark-line: light-dark(#7a6a00, #e2cf3c);
  --h-shadow: 0 0 0 1px var(--h-ink);
  --h-radius: 0px;
  --h-font-body: "Helvetica Neue", var(--h-zh-sans);
  --h-font-display: "Helvetica Neue", var(--h-zh-sans);
  --h-font-mono: "Helvetica Neue", var(--h-zh-sans);
}
:root[data-style="swiss"][data-tone="black"] {
  --h-accent: light-dark(#0a0a0a, #f3f3ef); --h-on-accent: light-dark(#ffffff, #0b0b0c); --h-accent-tint: light-dark(#e6e6e1, #29292c);
  --h-hero: light-dark(#0a0a0a, #f3f3ef); --h-on-hero: light-dark(#ffffff, #0b0b0c);
  --h-ok: light-dark(#0a0a0a, #f3f3ef); --h-on-ok: light-dark(#ffffff, #0b0b0c);
}
:root[data-style="swiss"][data-tone="emerald"] {
  --h-accent: light-dark(#00634d, #6fd6b6); --h-accent-tint: light-dark(#dcebe6, #143229);
  --h-hero: #00634d; --h-on-hero: #ffffff;
  --h-ok: light-dark(#00634d, #0b7a60);
}
:root[data-style="swiss"][data-tone="yellow"] {
  --h-accent: light-dark(#6f5a00, #ffd500); --h-accent-tint: light-dark(#f4ecc4, #3a3200);
  --h-hero: #ffd500; --h-on-hero: #0a0a0a;
  --h-ok: light-dark(#0a0a0a, #ffd500); --h-on-ok: light-dark(#ffffff, #0a0a0a);
}
[data-style="swiss"] main > header {
  margin: calc(-1 * (var(--h-reader-top, env(safe-area-inset-top, 0px)) + 32px)) calc(-1 * max(var(--h-gutter), env(safe-area-inset-left, 0px))) 2.2em;
  padding: calc(var(--h-reader-top, env(safe-area-inset-top, 0px)) + 52px) max(var(--h-gutter), env(safe-area-inset-left, 0px)) 0;
  background: var(--h-hero); color: var(--h-on-hero);
}
/* 反白的字只在那塊顏色裡面；沒有頁首的頁面（證書）標題照常是墨色 */
[data-style="swiss"] .eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .06em; color: var(--h-ink); }
[data-style="swiss"] h1 { font-weight: 200; font-size: 2.9rem; line-height: 1.16; letter-spacing: 0; }
[data-style="swiss"] main > header :is(h1, .eyebrow, .lede) { color: var(--h-on-hero); }
[data-style="swiss"] main > header .eyebrow { opacity: .9; }
[data-style="swiss"]:not(:lang(zh)):not(:lang(ja)) h1 { font-weight: 300; letter-spacing: -.03em; font-size: 2.6rem; line-height: 1.08; }
[data-style="swiss"] .lede { font-size: 1.04rem; margin-top: 1.2em; }
[data-style="swiss"] main > header .lede { opacity: .86; }
[data-style="swiss"] main > header::after {
  width: auto; height: 34px; margin: 26px calc(-1 * max(var(--h-gutter), env(safe-area-inset-left, 0px))) 0; border-radius: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--h-on-hero) 50%, transparent) 1px, transparent 1.3px) 4px 5px / 10px 10px;
}
[data-style="swiss"] h2 { margin-top: 2.8em; padding-top: .8em; border-top: 1px solid var(--h-ink); font-weight: 300; font-size: 1.62rem; line-height: 1.3; }
[data-style="swiss"] h3 { font-weight: 600; }
[data-style="swiss"] :is(henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card, figure) { border: 0; border-radius: 0; background: var(--h-surface); padding: 18px 16px; }
[data-style="swiss"] :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label, .h-note-label) { color: var(--h-ink); font-size: .72rem; font-weight: 600; letter-spacing: .06em; }
[data-style="swiss"] :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--h-accent); }
[data-style="swiss"] henri-quiz > p, [data-style="swiss"] :is(.h-quiz-stem, .h-reply-q) { font-weight: 500; font-size: 1.12rem; }
[data-style="swiss"] .h-choices { gap: 6px; }
[data-style="swiss"] henri-choice[data-ready] { border: 0; border-radius: 0; background: var(--h-paper); }
[data-style="swiss"] .h-choice { border-radius: 0; }
[data-style="swiss"] .h-choice-mark { border-radius: 0; border-color: var(--h-ink); color: var(--h-ink); }
[data-style="swiss"] henri-choice[data-state="correct"] { background: var(--h-ok); color: var(--h-on-ok); }
[data-style="swiss"] henri-choice[data-state="wrong"] { background: var(--h-wrong-tint); }
[data-style="swiss"] henri-choice[data-state="correct"] .h-choice-mark { background: var(--h-on-ok); border-color: var(--h-on-ok); color: var(--h-ok); }
[data-style="swiss"] henri-choice[data-state="correct"] :is(.h-why, .h-verdict) { color: var(--h-on-ok); }
/* 「點出來」找到的片段：瑞士的 ok-tint 就是 ok（整塊填色），字要反白（不然淺色是黑底黑字、深色是黃底白字） */
[data-style="swiss"] henri-spot[data-state="found"] .h-spot,
[data-style="swiss"] henri-spot[data-state="found"] .h-icon-check { color: var(--h-on-ok); }
[data-style="swiss"] henri-note { border-left: 0; padding: 14px 0 0; border-top: 6px solid var(--h-ink); }
[data-style="swiss"] henri-note[kind="misconception"] { border-top-color: var(--h-mark); }
[data-style="swiss"] henri-note[kind="misconception"] .h-note-label { background: none; padding: 0; }
[data-style="swiss"] henri-compare { border-radius: 0; border: 0; border-top: 1px solid var(--h-ink); border-bottom: 1px solid var(--h-ink); background: none; }
[data-style="swiss"] :is(.h-done, .h-btn, .h-rate-btn, .h-rate-reason, .h-rate-note, .h-term-card, .h-reveal-btn, .h-reveal-body, .h-meter, .h-button, .h-pick-btn, henri-phrase) { border-radius: 0; }
[data-style="swiss"] .h-term-card { border-color: var(--h-ink); box-shadow: none; }
[data-style="swiss"] .h-term-arrow { border-color: var(--h-ink); }
[data-style="swiss"] henri-term[aria-expanded] { text-decoration-style: solid; text-decoration-thickness: 2px; text-underline-offset: .3em; }
[data-style="swiss"] .h-reply-input { border-color: transparent; }

/* --------------------------------------------------------------------------------------------------
   線裝 xianzhuang：線裝書的內頁。楷體的標題、宋體的正文、宣紙的底色。
   招牌：頁首一粗一細的文武線；小標題前一個魚尾；選項用一二三四（不用甲乙丙丁：天干在命理、干支紀年裡是內容，#78）；框是雙線的版框；課名像一張題簽；紙上有很淡的纖維。
   標題預設橫排。用戶明說要直排時，在 <header> 上加 class="h-vertical-title"（只在中日文頁面、標題九個字以內時用）。
   配色：indigo 靛青（預設）、ochre 赭石、moss 黛綠。
   -------------------------------------------------------------------------------------------------- */
:root[data-style="xianzhuang"] {
  --h-paper: light-dark(#f3eee1, #191815); --h-surface: light-dark(#f9f5ea, #211f1b);
  --h-ink: light-dark(#231e17, #ebe4d3); --h-soft: light-dark(#665d4d, #a9a08d); --h-rule: light-dark(#d3c9b3, #403b32);
  --h-accent: light-dark(#264a75, #a9c2e6); --h-on-accent: light-dark(#ffffff, #122033); --h-accent-tint: light-dark(#dde1de, #2a313b);
  --h-wrong: light-dark(#a8322a, #f0907e); --h-wrong-tint: light-dark(#f1ddd4, #3d2420);
  --h-mark: light-dark(#ead9a0, #5b4d17); --h-mark-line: light-dark(#8d701c, #d2b55a);
  --h-shadow: 0 1px 2px rgba(40, 30, 10, .1), 0 10px 28px rgba(40, 30, 10, .2);
  --h-radius: 0px;
  --h-leading: 1.9;
  --h-font-body: var(--h-zh-serif);
  --h-font-display: var(--h-zh-kai);
  --h-font-mono: var(--h-zh-kai);
}
:root[data-style="xianzhuang"][data-tone="ochre"] {
  --h-accent: light-dark(#7a4a1e, #dfae7a); --h-on-accent: light-dark(#fff8ea, #24160a); --h-accent-tint: light-dark(#e6dcc6, #33281b);
  --h-ok: light-dark(#2f5f3f, #9fcfa8); --h-ok-tint: light-dark(#dbe0cb, #22301f); --h-on-ok: light-dark(#ffffff, #0d1a13);
}
:root[data-style="xianzhuang"][data-tone="moss"] {
  --h-accent: light-dark(#2f5a4a, #9ccdb8); --h-on-accent: light-dark(#ffffff, #0d1a13); --h-accent-tint: light-dark(#dde3d6, #1f2e28);
}
[data-style="xianzhuang"] body::before, [data-style="notebook"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .3  0 0 0 0 .2  0 0 0 .16 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-style="xianzhuang"] main, [data-style="notebook"] main { position: relative; z-index: 1; }
@media (prefers-color-scheme: dark) { :is([data-style="xianzhuang"], [data-style="notebook"]):not([data-theme="light"]) body::before { mix-blend-mode: screen; opacity: .22; } }
:is([data-style="xianzhuang"], [data-style="notebook"])[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: .22; }
@media print { [data-style] body::before { display: none; } }
[data-style="xianzhuang"] .eyebrow {
  display: table; padding: 1px 10px 2px; border: 1px solid var(--h-accent); box-shadow: inset 0 0 0 2px var(--h-paper), inset 0 0 0 3px var(--h-accent);
  font-size: .9rem; letter-spacing: .16em; font-weight: 400;
}
[data-style="xianzhuang"] h1 { font-weight: 700; font-size: 2.2rem; line-height: 1.36; letter-spacing: .05em; }
[data-style="xianzhuang"] h2 { font-weight: 700; font-size: 1.46rem; letter-spacing: .06em; }
[data-style="xianzhuang"] .lede { font-family: var(--h-font-display); font-size: 1.16rem; line-height: 1.85; color: var(--h-ink); opacity: .8; }
[data-style="xianzhuang"] main > header::after { width: 100%; height: 6px; border-radius: 0; margin-top: 1.7rem; background: linear-gradient(var(--h-accent) 0 3px, transparent 3px 5px, var(--h-accent) 5px 6px); }
[data-style="xianzhuang"] main h2:not(.h-sources-title)::before {
  content: ""; display: inline-block; width: .62em; height: .72em; margin-right: .5em; vertical-align: -.04em; background: var(--h-accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 58%, 0 100%);
}
/* 直排的題簽：只在明說要直排時用 */
[data-style="xianzhuang"]:is(:lang(zh), :lang(ja)) main > header.h-vertical-title { display: grid; grid-template-columns: 1fr auto; column-gap: 22px; align-items: start; }
[data-style="xianzhuang"]:is(:lang(zh), :lang(ja)) main > header.h-vertical-title > h1 {
  grid-column: 2; grid-row: 1 / span 3; writing-mode: vertical-rl; max-height: 9.2em; padding: 16px 9px; background: var(--h-surface);
  border: 1px solid var(--h-accent); box-shadow: inset 0 0 0 3px var(--h-surface), inset 0 0 0 4px var(--h-accent);
  font-size: 1.72rem; line-height: 1.38; letter-spacing: .1em; text-wrap: wrap;
}
[data-style="xianzhuang"]:is(:lang(zh), :lang(ja)) main > header.h-vertical-title > :is(.eyebrow, .lede) { grid-column: 1; }
[data-style="xianzhuang"] main > header.h-vertical-title::after { grid-column: 1 / -1; }
[data-style="xianzhuang"] :is(henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card, figure, henri-compare) {
  border: 1px solid var(--h-accent); border-radius: 0; background: var(--h-surface); box-shadow: 0 0 0 3px var(--h-paper), 0 0 0 5px var(--h-accent);
}
[data-style="xianzhuang"] :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label, .h-note-label) { font-size: .86rem; letter-spacing: .2em; font-weight: 400; }
[data-style="xianzhuang"] henri-quiz > p, [data-style="xianzhuang"] :is(.h-quiz-stem, .h-reply-q) { font-family: var(--h-font-display); font-size: 1.16rem; font-weight: 700; }
[data-style="xianzhuang"] .h-choices { gap: 0; }
[data-style="xianzhuang"] henri-choice[data-ready] { border: 0; border-top: 1px solid var(--h-rule); border-radius: 0; background: none; }
[data-style="xianzhuang"] henri-choice[data-state="correct"] { background: var(--h-ok-tint); border-top-color: var(--h-ok); }
[data-style="xianzhuang"] henri-choice[data-state="wrong"] { background: var(--h-wrong-tint); border-top-color: var(--h-wrong); }
[data-style="xianzhuang"] :is(.h-choice, .h-done, .h-btn, .h-rate-btn, .h-rate-reason, .h-rate-note, .h-term-card, .h-reveal-btn, .h-reveal-body, .h-button, .h-pick-btn, henri-phrase) { border-radius: 0; }
[data-style="xianzhuang"]:lang(zh) .h-choice-letter { font-size: 0; }
[data-style="xianzhuang"]:lang(zh) .h-choice-letter::after { font-family: var(--h-font-display); font-size: .92rem; }
[data-style="xianzhuang"]:lang(zh) henri-choice:nth-child(1) .h-choice-letter::after { content: "一"; }
[data-style="xianzhuang"]:lang(zh) henri-choice:nth-child(2) .h-choice-letter::after { content: "二"; }
[data-style="xianzhuang"]:lang(zh) henri-choice:nth-child(3) .h-choice-letter::after { content: "三"; }
[data-style="xianzhuang"]:lang(zh) henri-choice:nth-child(4) .h-choice-letter::after { content: "四"; }
[data-style="xianzhuang"]:lang(zh) henri-choice:nth-child(5) .h-choice-letter::after { content: "五"; }
[data-style="xianzhuang"]:lang(zh) henri-choice:nth-child(6) .h-choice-letter::after { content: "六"; }
[data-style="xianzhuang"] .h-choice-mark { width: 28px; height: 28px; border-color: var(--h-accent); color: var(--h-accent); }
[data-style="xianzhuang"] henri-note { border-left: 0; padding: 0 0 0 1.1em; position: relative; font-family: var(--h-font-display); font-size: 1.06rem; line-height: 1.85; }
[data-style="xianzhuang"] henri-note::before { content: ""; position: absolute; left: 0; top: .3em; bottom: .3em; width: 5px; background: linear-gradient(90deg, var(--h-accent) 0 3px, transparent 3px 4px, var(--h-accent) 4px 5px); }
[data-style="xianzhuang"] figcaption { font-family: var(--h-font-display); font-size: .92rem; }
[data-style="xianzhuang"] sup a[href^="#"] { font-family: var(--h-font-body); }
[data-style="xianzhuang"] .h-reply-input { border-color: var(--h-accent); }

/* --------------------------------------------------------------------------------------------------
   藍圖 blueprint：工程圖和方格筆記本。方格紙、虛線框、等寬的標註、圖有編號。
   招牌：整頁 24 的方格；框是虛線，標籤壓在框線上；頁首一條尺寸線；每張圖自動編號；小標題左邊掛一個方塊。
   配色：cobalt 鈷藍（預設）、cyan 青、graphite 石墨。
   -------------------------------------------------------------------------------------------------- */
:root[data-style="blueprint"] {
  --h-paper: light-dark(#edf2f8, #0e1830); --h-surface: light-dark(#ffffff, #13203d);
  --h-ink: light-dark(#0f1b33, #e3ebf8); --h-soft: light-dark(#4d5b7b, #9aabc9); --h-rule: light-dark(#c5d1e3, #2b3d63);
  --h-accent: light-dark(#1746bf, #9dc0ff); --h-on-accent: light-dark(#ffffff, #0a1226); --h-accent-tint: light-dark(#dce5f8, #1c2f58);
  --h-wrong: light-dark(#b3312a, #f29384); --h-wrong-tint: light-dark(#f7e2df, #3c2327);
  --h-mark: light-dark(#ffd98a, #5a4410); --h-mark-line: light-dark(#94620a, #e5bd62);
  --h-shadow: 0 1px 2px rgba(15, 27, 51, .1), 0 10px 28px rgba(15, 27, 51, .22);
  --h-radius: 2px;
  --h-font-body: var(--h-zh-sans);
  --h-font-display: var(--h-zh-sans);
  --h-font-mono: "IBM Plex Mono", var(--h-zh-sans);
}
:root[data-style="blueprint"][data-tone="cyan"] {
  --h-paper: light-dark(#ecf4f5, #0c1c20); --h-surface: light-dark(#ffffff, #11272c);
  --h-ink: light-dark(#0d2227, #e0eef0); --h-soft: light-dark(#4a6268, #96b0b5); --h-rule: light-dark(#c2d6d9, #24434a);
  --h-accent: light-dark(#0b6677, #7fd3e0); --h-on-accent: light-dark(#ffffff, #06181c); --h-accent-tint: light-dark(#d6e9ec, #143740);
}
:root[data-style="blueprint"][data-tone="graphite"] {
  --h-paper: light-dark(#f0f1f2, #131416); --h-surface: light-dark(#ffffff, #1b1d20);
  --h-ink: light-dark(#17191c, #e8eaec); --h-soft: light-dark(#565b62, #a1a7ae); --h-rule: light-dark(#cdd1d6, #30343a);
  --h-accent: light-dark(#2b3036, #dfe3e8); --h-on-accent: light-dark(#ffffff, #131416); --h-accent-tint: light-dark(#e0e3e6, #26292e);
  --h-ok: light-dark(#23684a, #8fd0ad); --h-ok-tint: light-dark(#dde9e0, #1c2c24); --h-on-ok: light-dark(#ffffff, #0d1a13);
}
html[data-style="blueprint"] {
  background-color: var(--h-paper);
  background-image:
    linear-gradient(color-mix(in srgb, var(--h-rule) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--h-rule) 55%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
[data-style="blueprint"] body { background: none; }
[data-style="blueprint"] h1 { font-weight: 600; font-size: 1.96rem; letter-spacing: 0; }
[data-style="blueprint"]:not(:lang(zh)):not(:lang(ja)) h1 { font-family: var(--h-font-mono); font-weight: 500; font-size: 1.7rem; letter-spacing: -.02em; }
[data-style="blueprint"] h2 { position: relative; font-weight: 600; font-size: 1.26rem; }
[data-style="blueprint"] main h2:not(.h-sources-title)::before { content: ""; position: absolute; left: -15px; top: .62em; width: 7px; height: 7px; background: var(--h-accent); }
[data-style="blueprint"] .eyebrow { font-size: .74rem; font-weight: 500; }
[data-style="blueprint"] main > header::after {
  width: 100%; height: 9px; border-radius: 0; margin-top: 1.5rem;
  background:
    linear-gradient(var(--h-accent), var(--h-accent)) left center / 1px 9px no-repeat,
    linear-gradient(var(--h-accent), var(--h-accent)) right center / 1px 9px no-repeat,
    linear-gradient(var(--h-accent), var(--h-accent)) center / 100% 1px no-repeat;
}
[data-style="blueprint"] :is(henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card, figure, henri-compare) { border: 1px dashed color-mix(in srgb, var(--h-accent) 60%, var(--h-rule)); border-radius: 2px; }
[data-style="blueprint"] :is(henri-quiz, henri-pick, henri-find, henri-reply) { padding-top: 22px; }
[data-style="blueprint"] :is(.h-quiz-label, .h-pick-label, .h-find-label, .h-reply-label) { position: relative; display: table; margin: -32px 0 12px -6px; padding: 0 6px; background: var(--h-paper); font-size: .72rem; font-weight: 500; }
[data-style="blueprint"] :is(.h-levels-label, .h-label, .h-note-label) { font-size: .72rem; font-weight: 500; }
[data-style="blueprint"] main { counter-reset: h-fig; }
[data-style="blueprint"] figure { counter-increment: h-fig; }
[data-style="blueprint"] figcaption::before { content: "Fig. " counter(h-fig); margin-right: .7em; font-family: var(--h-font-mono); font-size: .92em; font-weight: 600; color: var(--h-accent); }
[data-style="blueprint"]:lang(zh) figcaption::before { content: "圖 " counter(h-fig); }
[data-style="blueprint"]:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) figcaption::before { content: "图 " counter(h-fig); }
[data-style="blueprint"]:lang(ja) figcaption::before { content: "図 " counter(h-fig); }
[data-style="blueprint"] :is(henri-choice[data-ready], .h-choice, .h-done, .h-btn, .h-term-card, .h-reveal-btn, .h-choice-mark, .h-button, .h-pick-btn, henri-phrase) { border-radius: 2px; }
[data-style="blueprint"] henri-note { border-left-style: dashed; border-left-width: 1px; }
[data-style="blueprint"] .h-reply-input { border-color: color-mix(in srgb, var(--h-accent) 60%, var(--h-rule)); }

/* --------------------------------------------------------------------------------------------------
   手帳 notebook：旅行手帳和田野筆記。點陣紙、鋼筆的墨水色、手寫的楷體、紙膠帶。
   招牌：正文和標題都是手寫感的楷體，字是墨水的顏色，不是黑；頁首貼一段紙膠帶；小標題下面一條波浪線；
         卡片是貼上去的紙，有一道硬邊的影子；提示是一張歪一點的便利貼；標籤像蓋上去的章。
   配色：blue 鋼筆藍（預設）、green 墨綠、sepia 棕。
   -------------------------------------------------------------------------------------------------- */
:root[data-style="notebook"] {
  --h-paper: light-dark(#f6f1e4, #171a24); --h-surface: light-dark(#fffdf6, #1f2330);
  --h-ink: light-dark(#1c2647, #e7e4d6); --h-soft: light-dark(#56607f, #a3a6b6); --h-rule: light-dark(#c9cbd3, #3a4054);
  --h-accent: light-dark(#2748a8, #a3b9ff); --h-on-accent: light-dark(#ffffff, #101630); --h-accent-tint: light-dark(#e1e6f4, #26305a);
  --h-wrong: light-dark(#b3312a, #f29384); --h-wrong-tint: light-dark(#f7e2dc, #3c2327);
  --h-mark: light-dark(#f4d86a, #6a560d); --h-mark-line: light-dark(#8a6d0c, #ecd067);
  --h-note: light-dark(#f4d86a, #57480f); --h-note-tip: light-dark(#d9ead2, #25382b); --h-hard: light-dark(#1c2647, #05060a);
  --h-shadow: 4px 5px 0 var(--h-hard);
  --h-radius: 4px;
  --h-leading: 1.85;
  --h-font-body: var(--h-zh-kai);
  --h-font-display: var(--h-zh-kai);
  --h-font-mono: "Caveat", var(--h-zh-kai);
}
:root[data-style="notebook"][data-tone="green"] {
  --h-ink: light-dark(#1d3327, #e3e8dc); --h-soft: light-dark(#566a5c, #a3b0a4);
  --h-accent: light-dark(#23684a, #9cd3b3); --h-on-accent: light-dark(#ffffff, #0d1a13); --h-accent-tint: light-dark(#dcebe0, #1e3329); --h-hard: light-dark(#1d3327, #05060a);
}
:root[data-style="notebook"][data-tone="sepia"] {
  --h-ink: light-dark(#3a2a1c, #ebe1d0); --h-soft: light-dark(#6e5a47, #b5a591);
  --h-accent: light-dark(#7c4014, #e2ab7c); --h-on-accent: light-dark(#fff8ea, #24160a); --h-accent-tint: light-dark(#eadcc6, #35281b); --h-hard: light-dark(#3a2a1c, #05060a);
  --h-ok: light-dark(#2f5f3f, #9fcfa8); --h-ok-tint: light-dark(#dbe6d6, #22301f); --h-on-ok: light-dark(#ffffff, #0d1a13);
}
html[data-style="notebook"] { background-color: var(--h-paper); background-image: radial-gradient(circle, color-mix(in srgb, var(--h-ink) 17%, transparent) .9px, transparent 1.2px); background-size: 20px 20px; }
[data-style="notebook"] body { background: none; font-size: 1.06rem; }
[data-style="notebook"]:not(:lang(zh)):not(:lang(ja)) body { font-family: "Newsreader", Georgia, serif; }
[data-style="notebook"] h1 { font-weight: 700; font-size: 2.2rem; line-height: 1.3; letter-spacing: .02em; }
[data-style="notebook"]:not(:lang(zh)):not(:lang(ja)) :is(h1, h2) { font-family: "Caveat", cursive; font-size: 2.9rem; line-height: 1.05; }
[data-style="notebook"]:not(:lang(zh)):not(:lang(ja)) h2 { font-size: 2rem; }
[data-style="notebook"] h2 { display: table; font-weight: 700; font-size: 1.5rem; text-decoration: underline wavy var(--h-accent) 1.5px; text-underline-offset: .32em; }
[data-style="notebook"] .eyebrow { font-size: 1rem; font-weight: 400; color: var(--h-accent); }
[data-style="notebook"]:not(:lang(zh)):not(:lang(ja)) .eyebrow { font-size: 1.3rem; letter-spacing: .02em; text-transform: none; }
[data-style="notebook"] .lede { font-size: 1.14rem; }
[data-style="notebook"] main > header::after {
  width: 46%; height: 16px; margin-top: 1.5rem; border-radius: 1px; transform: rotate(-1.4deg); opacity: .9;
  background: repeating-linear-gradient(-45deg, var(--h-note) 0 7px, color-mix(in srgb, var(--h-note) 62%, var(--h-paper)) 7px 14px);
}
[data-style="notebook"] :is(henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card, figure) { border: 1.5px solid var(--h-ink); border-radius: 4px; box-shadow: 4px 5px 0 var(--h-hard); }
[data-style="notebook"] henri-compare { border: 1.5px solid var(--h-ink); border-radius: 4px; }
[data-style="notebook"] :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label) {
  display: table; margin-bottom: 14px; padding: 1px 9px; border: 1.5px solid var(--h-accent); border-radius: 2px; transform: rotate(-2.5deg);
  font-size: .92rem; font-weight: 700; letter-spacing: .08em; color: var(--h-accent);
}
[data-style="notebook"]:not(:lang(zh)):not(:lang(ja)) :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label) { font-size: 1.1rem; text-transform: none; }
[data-style="notebook"] henri-choice[data-ready] { border: 1.5px dashed color-mix(in srgb, var(--h-ink) 55%, transparent); border-radius: 4px; }
[data-style="notebook"] henri-choice[data-state] { border-style: solid; }
[data-style="notebook"] :is(.h-choice, henri-phrase) { border-radius: 4px; }
[data-style="notebook"] .h-choice-mark { border-color: var(--h-ink); color: var(--h-ink); font-size: 1rem; }
[data-style="notebook"] henri-note { position: relative; margin: 2.4em 4px; padding: 20px 16px 16px; border: 0; background: var(--h-note); transform: rotate(-.7deg); box-shadow: 2px 3px 0 color-mix(in srgb, var(--h-hard) 30%, transparent); }
[data-style="notebook"] henri-note::before { content: ""; position: absolute; top: -9px; left: 50%; width: 74px; height: 18px; transform: translateX(-50%) rotate(1.5deg); background: color-mix(in srgb, var(--h-surface) 70%, transparent); border-left: 1px dashed color-mix(in srgb, var(--h-ink) 30%, transparent); border-right: 1px dashed color-mix(in srgb, var(--h-ink) 30%, transparent); }
[data-style="notebook"] henri-note[kind="tip"] { background: var(--h-note-tip); }
[data-style="notebook"] .h-note-label { color: var(--h-ink); font-size: 1rem; font-weight: 700; }
[data-style="notebook"] henri-note[kind="misconception"] .h-note-label { background: none; padding: 0; }
[data-style="notebook"] henri-note henri-term[aria-expanded] { text-decoration-color: var(--h-ink); }
[data-style="notebook"] :is(.h-done, .h-btn, .h-button, .h-pick-btn) { border-radius: 4px; border: 1.5px solid var(--h-ink); }
[data-style="notebook"] .h-done { box-shadow: 3px 4px 0 var(--h-hard); }
[data-style="notebook"] .h-term-card { border: 1.5px solid var(--h-ink); border-radius: 4px; }
[data-style="notebook"] .h-term-arrow { border-color: var(--h-ink); border-width: 1.5px 0 0 1.5px; }
[data-style="notebook"] figcaption { font-size: .96rem; }
[data-style="notebook"] sup a[href^="#"] { font-family: -apple-system, system-ui, sans-serif; }
/* 輸入框是手帳上的橫線：字寫在線上，沒有框 */
[data-style="notebook"] .h-reply-input {
  padding: 0 2px 6px; border: 0; border-radius: 0; background-color: transparent;
  background-image: linear-gradient(transparent calc(1.6em - 1.5px), color-mix(in srgb, var(--h-accent) 45%, transparent) calc(1.6em - 1.5px));
  background-size: 100% 1.6em; background-origin: content-box;
}
[data-style="notebook"] .h-reply-input:not([readonly]):focus { outline-offset: 5px; border-radius: 4px; }
[data-style="notebook"] henri-reply[data-state="sent"] .h-reply-input { padding: 0 8px 6px; }

/* --------------------------------------------------------------------------------------------------
   繪本 storybook：兒童繪本和貼紙本。圓體字、粗的深色描邊、硬邊的影子、幾塊粉彩色。
   招牌：所有框都是粗描邊加一道硬影子，大圓角；課名是一張歪一點的黃色貼紙；小標題壓在一塊粉彩色上；
         答對的那一項變成薄荷綠；頁首一排圓點。
   配色：mint 薄荷（預設）、sky 天藍、grape 葡萄。
   -------------------------------------------------------------------------------------------------- */
:root[data-style="storybook"] {
  --h-paper: light-dark(#fbf5e8, #1c1b2c); --h-surface: light-dark(#ffffff, #272640);
  --h-ink: light-dark(#2c2824, #f5efe0); --h-soft: light-dark(#655d55, #b9b3c9); --h-rule: light-dark(#2c2824, #f5efe0);
  --h-accent: light-dark(#0d7d73, #7fe0cf); --h-on-accent: light-dark(#ffffff, #10201d); --h-accent-tint: light-dark(#c9ece4, #1f4a47);
  --h-ok: light-dark(#0a5f57, #7fe0cf); --h-ok-tint: light-dark(#b8ecd6, #1f4a47); --h-on-ok: light-dark(#ffffff, #10201d);
  --h-wrong: light-dark(#b3312a, #ff9d90); --h-wrong-tint: light-dark(#fbd5cf, #4a2630);
  --h-mark: light-dark(#fde27a, #7a6412); --h-mark-line: light-dark(#2c2824, #f5efe0);
  --h-chip-a: light-dark(#bfe3f6, #2c4a66); --h-chip-b: light-dark(#f9cbd8, #5a3350); --h-hard: light-dark(#2c2824, #0b0a14);
  --h-shadow: 5px 5px 0 var(--h-hard);
  --h-radius: 22px;
  --h-font-body: var(--h-zh-round);
  --h-font-display: "Fredoka", var(--h-zh-round);
  --h-font-mono: "Fredoka", var(--h-zh-round);
}
:root[data-style="storybook"][data-tone="sky"] { --h-accent: light-dark(#17609f, #8cc6f5); --h-on-accent: light-dark(#ffffff, #0c1b2a); --h-accent-tint: light-dark(#cfe4f6, #1f3c57); --h-chip-a: light-dark(#fde27a, #6a5712); }
:root[data-style="storybook"][data-tone="grape"] { --h-accent: light-dark(#6a3fa0, #c9a8f0); --h-on-accent: light-dark(#ffffff, #1d1230); --h-accent-tint: light-dark(#e5d9f4, #3a2a55); --h-chip-a: light-dark(#e5d9f4, #3a2a55); }
[data-style="storybook"] body { font-size: 1.04rem; }
[data-style="storybook"]:not(:lang(zh)):not(:lang(ja)) body { font-family: "Fredoka", sans-serif; }
[data-style="storybook"] h1 { font-weight: 600; font-size: 2.3rem; line-height: 1.26; letter-spacing: .01em; }
[data-style="storybook"] h2 { display: table; font-weight: 600; font-size: 1.42rem; padding: .08em .5em .12em; margin-left: -.3em; background: var(--h-chip-a); border-radius: 12px; }
[data-style="storybook"] main > section:nth-of-type(even) > h2 { background: var(--h-chip-b); }
[data-style="storybook"] .eyebrow {
  display: table; margin-bottom: 1.2em; padding: 3px 14px; border: 2.5px solid var(--h-hard); border-radius: 999px; background: #fde27a; color: #2c2824;
  box-shadow: 3px 3px 0 var(--h-hard); transform: rotate(-2deg); font-size: .88rem; font-weight: 600;
}
[data-style="storybook"] .lede { font-size: 1.12rem; }
[data-style="storybook"] main > header::after {
  width: 100%; height: 12px; margin-top: 1.6rem; border-radius: 0;
  background: radial-gradient(circle at 6px 6px, var(--h-accent) 5px, transparent 5.6px) 0 0 / 24px 12px repeat-x;
}
[data-style="storybook"] :is(henri-quiz, henri-levels, henri-pick, henri-find, henri-reply, .h-card, figure) { border: 2.5px solid var(--h-ink); border-radius: 22px; box-shadow: 5px 5px 0 var(--h-hard); }
[data-style="storybook"] henri-compare { border: 2.5px solid var(--h-ink); border-radius: 18px; }
[data-style="storybook"] :is(.h-quiz-label, .h-levels-label, .h-pick-label, .h-find-label, .h-label, .h-note-label) { font-size: .84rem; font-weight: 600; letter-spacing: .06em; color: var(--h-accent); }
[data-style="storybook"] henri-choice[data-ready] { border: 2px solid var(--h-ink); border-radius: 16px; }
[data-style="storybook"] :is(.h-choice, henri-phrase) { border-radius: 14px; }
[data-style="storybook"] .h-choice-mark { width: 30px; height: 30px; border: 2px solid var(--h-ink); color: #2c2824; font-size: .9rem; background: #fde27a; }
[data-style="storybook"] henri-choice[data-state] { border-color: var(--h-ink); }
[data-style="storybook"] henri-choice[data-state="correct"] { box-shadow: 3px 3px 0 var(--h-hard); }
[data-style="storybook"] henri-choice[data-state] .h-choice-mark { border-color: var(--h-ink); }
[data-style="storybook"] henri-note { padding: 14px 16px; border: 2.5px solid var(--h-ink); border-radius: 18px; background: var(--h-mark); }
[data-style="storybook"] henri-note[kind="tip"] { background: var(--h-accent-tint); }
[data-style="storybook"] henri-note .h-note-label { color: var(--h-ink); }
[data-style="storybook"] henri-note[kind="misconception"] .h-note-label { background: none; padding: 0; }
[data-style="storybook"] henri-note henri-term[aria-expanded] { text-decoration-color: var(--h-ink); }
[data-style="storybook"] :is(.h-done, .h-btn, .h-button, .h-pick-btn) { border: 2.5px solid var(--h-ink); border-radius: 999px; }
[data-style="storybook"] .h-done { box-shadow: 4px 4px 0 var(--h-hard); }
[data-style="storybook"] .h-term-card { border: 2.5px solid var(--h-ink); border-radius: 18px; }
[data-style="storybook"] .h-term-arrow { border-color: var(--h-ink); border-width: 2.5px 0 0 2.5px; top: -8px; }
[data-style="storybook"] .h-term-card[data-side="top"] .h-term-arrow { bottom: -8px; }
[data-style="storybook"] sup a[href^="#"] { font-family: var(--h-font-display); }
[data-style="storybook"] .h-reply-input { border: 2px solid var(--h-ink); border-radius: 16px; }
[data-style="storybook"] henri-reply[data-state="empty"] .h-reply-status { border: 2px dashed var(--h-ink); border-radius: 16px; }
