/* ============================================================
   TooPower 史上最強小學生！ — 設計系統 v3（tp3.css）
   方向：編得很好的紙本複習講義。橫線索引、編輯格線、米白紙、
   深墨字、朱砂印章主色、低彩度科目輔色、手繪波浪重點線。
   全站單一淺色，不跟隨系統深色；無外部字體、圖片、請求。

   變數分三層（單一來源，元件只讀語意層與元件層）：
     1. primitive  --tp3-p-*        原始色票與尺度
     2. semantic   --tp3-*          語意命名（bg/text/accent…）
     3. component  --tp3-btn-* 等   元件層，可被局部覆寫
   末段附 v1 --tp-* 相容 alias，供 math.css／zhuyin.css 沿用。
   ============================================================ */

/* ============================================================
   1. Primitive 層（原始值，元件請勿直接引用）
   ============================================================ */
:root {
  color-scheme: light; /* 全站單一淺色，不跟系統深色 */

  /* 紙階 */
  --tp3-p-paper: #FAF6EE;        /* 米白紙：全站背景 */
  --tp3-p-paper-deep: #F3EDE0;   /* 深一階紙：區塊底、凹陷面 */
  --tp3-p-surface: #FFFCF7;      /* 暖白（非純白）：卡片、輸入框 */

  /* 墨階 */
  --tp3-p-ink: #3B352C;          /* 深墨：標題、內文 */
  --tp3-p-ink-soft: #6E6558;     /* 次要文字（對紙 5.32:1） */
  --tp3-p-ink-faint: #7A6F5C;    /* 輔助 caption（對紙 4.58:1） */

  /* 線 */
  --tp3-p-line: #E7DECD;         /* 卡片邊、分隔線 */
  --tp3-p-line-strong: #D5C8AE;  /* 輸入框邊、索引線 */
  --tp3-p-grid-line: #E0D4BE;    /* 編輯格線、田字格輔助線 */

  /* 朱砂（印章主色） */
  --tp3-p-cinnabar: #C05B4B;       /* 僅圖形、大字、波浪線 */
  --tp3-p-cinnabar-dark: #A94A3C;  /* 主按鈕底（白字 5.63:1） */
  --tp3-p-cinnabar-deeper: #93402F;/* 主按鈕 hover（白字 6.97:1） */
  --tp3-p-cinnabar-soft: #F6E4DF;  /* 淺底標記（深字 4.58:1） */

  /* 鼠尾草（成功、已複習） */
  --tp3-p-sage: #7C8B6F;           /* 僅圖形、邊框 */
  --tp3-p-sage-deep: #5E6E52;      /* 綠字（對紙 5.09:1） */
  --tp3-p-sage-soft: #E9EDE2;      /* 淺底（深字 4.62:1） */

  /* 琥珀（進行中、提示） */
  --tp3-p-amber: #C99A4B;          /* 僅圖形、邊框 */
  --tp3-p-amber-deep: #A87A2E;     /* 琥珀大字 */
  --tp3-p-amber-soft: #F6ECDA;     /* 提示淺底（墨字 10.35:1） */

  /* 墨藍（連結、資訊） */
  --tp3-p-blue: #5B7183;           /* 對紙 4.71:1，可用於內文 */
  --tp3-p-blue-soft: #EEF2F6;      /* 淺底（藍字 4.51:1） */

  /* 五科低彩度輔色（文字級，對紙皆 ≥4.5:1） */
  --tp3-p-sub-chinese: #A94A3C;  --tp3-p-sub-chinese-soft: #F6E4DF; /* 國語：朱砂 5.22 */
  --tp3-p-sub-math: #5B7183;     --tp3-p-sub-math-soft: #EEF2F6;    /* 數學：墨藍 4.71 */
  --tp3-p-sub-english: #75566A;  --tp3-p-sub-english-soft: #F0E6EC; /* 英語：灰紫 5.91 */
  --tp3-p-sub-science: #5E6E52;  --tp3-p-sub-science-soft: #E9EDE2; /* 自然：灰綠 5.09 */
  --tp3-p-sub-social: #7E6238;   --tp3-p-sub-social-soft: #F1EADA;  /* 社會：赭褐 5.28 */

  /* 字體堆疊（全系統字型，不下載） */
  --tp3-p-font-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", "Source Han Sans TC", sans-serif;
  --tp3-p-font-serif: "Songti TC", "PMingLiU", "Noto Serif CJK TC", "Source Han Serif TC", serif;
  --tp3-p-font-kai: "BiauKaiTC-Regular", "BiauKaiTC", "BiauKai", "Kaiti TC", "STKaiti", "DFKai-SB", "TW-Kai", "LXGW WenKai TC", "Songti TC", serif;

  /* 字級（手機優先；內文基準 17px） */
  --tp3-p-fs-caption: 0.8125rem;  /* 13px：僅輔助標註，配 ink-faint */
  --tp3-p-fs-small: 0.9375rem;    /* 15px：次要內文 */
  --tp3-p-fs-body: 1.0625rem;     /* 17px：內文基準（下限） */
  --tp3-p-fs-lead: 1.1875rem;     /* 19px：導言 */
  --tp3-p-fs-h4: 1.1875rem;       /* 19px */
  --tp3-p-fs-h3: 1.375rem;        /* 22px */
  --tp3-p-fs-h2: clamp(1.5rem, 1.3rem + 1vw, 1.75rem);    /* 24→28px */
  --tp3-p-fs-h1: clamp(1.75rem, 1.45rem + 1.6vw, 2.25rem);/* 28→36px */
  --tp3-p-fs-display: clamp(2rem, 1.5rem + 2.6vw, 2.75rem);/* 32→44px */

  /* 行高／字重 */
  --tp3-p-lh-title: 1.3;
  --tp3-p-lh-body: 1.85;
  --tp3-p-lh-zhuyin: 1.05;
  --tp3-p-fw-regular: 400;
  --tp3-p-fw-medium: 500;
  --tp3-p-fw-bold: 700;

  /* 間距（4px 基準） */
  --tp3-p-space-1: 0.25rem;  /* 4 */
  --tp3-p-space-2: 0.5rem;   /* 8 */
  --tp3-p-space-3: 0.75rem;  /* 12 */
  --tp3-p-space-4: 1rem;     /* 16 */
  --tp3-p-space-5: 1.25rem;  /* 20 */
  --tp3-p-space-6: 1.5rem;   /* 24 */
  --tp3-p-space-8: 2rem;     /* 32 */
  --tp3-p-space-10: 2.5rem;  /* 40 */
  --tp3-p-space-12: 3rem;    /* 48 */
  --tp3-p-space-16: 4rem;    /* 64 */

  /* 線寬（講義感：細線為主） */
  --tp3-p-rule-hair: 1px;    /* 索引線、分隔線 */
  --tp3-p-rule: 1.5px;       /* 輸入框邊、按鈕邊 */
  --tp3-p-rule-bold: 2px;    /* 印章框、重點線 */

  /* 圓角（紙本感：收斂） */
  --tp3-p-radius-s: 4px;
  --tp3-p-radius-m: 8px;
  --tp3-p-radius-l: 12px;
  --tp3-p-radius-pill: 999px;

  /* 陰影（極淡紙感） */
  --tp3-p-shadow-1: 0 1px 2px rgba(59, 53, 44, 0.06);
  --tp3-p-shadow-2: 0 2px 6px rgba(59, 53, 44, 0.08), 0 8px 20px rgba(59, 53, 44, 0.06);

  /* 動效 */
  --tp3-p-time-fast: 140ms;
  --tp3-p-time-base: 240ms;
  --tp3-p-ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* 版面 */
  --tp3-p-wrap: 70rem;       /* 1120px 版心 */
  --tp3-p-touch: 48px;       /* 觸控下限 */
  --tp3-p-touch-kid: 56px;   /* 孩子作答下限 */
}

/* ============================================================
   2. Semantic 層（頁面與元件以此為準）
   ============================================================ */
:root {
  --tp3-paper: var(--tp3-p-paper);
  --tp3-paper-deep: var(--tp3-p-paper-deep);
  --tp3-surface: var(--tp3-p-surface);
  --tp3-ink: var(--tp3-p-ink);
  --tp3-ink-soft: var(--tp3-p-ink-soft);
  --tp3-ink-faint: var(--tp3-p-ink-faint);
  --tp3-line: var(--tp3-p-line);
  --tp3-line-strong: var(--tp3-p-line-strong);
  --tp3-grid-line: var(--tp3-p-grid-line);

  --tp3-primary: var(--tp3-p-cinnabar-dark);
  --tp3-primary-hover: var(--tp3-p-cinnabar-deeper);
  --tp3-primary-soft: var(--tp3-p-cinnabar-soft);
  --tp3-on-primary: #FFFCF7;

  --tp3-sage: var(--tp3-p-sage-deep);
  --tp3-sage-soft: var(--tp3-p-sage-soft);
  --tp3-amber: var(--tp3-p-amber);
  --tp3-amber-deep: var(--tp3-p-amber-deep);
  --tp3-amber-soft: var(--tp3-p-amber-soft);
  --tp3-blue: var(--tp3-p-blue);
  --tp3-blue-soft: var(--tp3-p-blue-soft);
  --tp3-danger: var(--tp3-p-cinnabar-dark);
  --tp3-danger-soft: var(--tp3-p-cinnabar-soft);
  --tp3-focus: var(--tp3-p-cinnabar-dark);

  --tp3-link: var(--tp3-p-blue);
  --tp3-success: var(--tp3-p-sage-deep);
  --tp3-warning: var(--tp3-p-amber-deep);

  --tp3-subject-chinese: var(--tp3-p-sub-chinese);
  --tp3-subject-chinese-soft: var(--tp3-p-sub-chinese-soft);
  --tp3-subject-math: var(--tp3-p-sub-math);
  --tp3-subject-math-soft: var(--tp3-p-sub-math-soft);
  --tp3-subject-english: var(--tp3-p-sub-english);
  --tp3-subject-english-soft: var(--tp3-p-sub-english-soft);
  --tp3-subject-science: var(--tp3-p-sub-science);
  --tp3-subject-science-soft: var(--tp3-p-sub-science-soft);
  --tp3-subject-social: var(--tp3-p-sub-social);
  --tp3-subject-social-soft: var(--tp3-p-sub-social-soft);

  --tp3-font-sans: var(--tp3-p-font-sans);
  --tp3-font-serif: var(--tp3-p-font-serif);
  --tp3-font-kai: var(--tp3-p-font-kai);

  --tp3-fs-caption: var(--tp3-p-fs-caption);
  --tp3-fs-small: var(--tp3-p-fs-small);
  --tp3-fs-body: var(--tp3-p-fs-body);
  --tp3-fs-lead: var(--tp3-p-fs-lead);
  --tp3-fs-h4: var(--tp3-p-fs-h4);
  --tp3-fs-h3: var(--tp3-p-fs-h3);
  --tp3-fs-h2: var(--tp3-p-fs-h2);
  --tp3-fs-h1: var(--tp3-p-fs-h1);
  --tp3-fs-display: var(--tp3-p-fs-display);
  --tp3-lh-title: var(--tp3-p-lh-title);
  --tp3-lh-body: var(--tp3-p-lh-body);

  --tp3-space-1: var(--tp3-p-space-1);
  --tp3-space-2: var(--tp3-p-space-2);
  --tp3-space-3: var(--tp3-p-space-3);
  --tp3-space-4: var(--tp3-p-space-4);
  --tp3-space-5: var(--tp3-p-space-5);
  --tp3-space-6: var(--tp3-p-space-6);
  --tp3-space-8: var(--tp3-p-space-8);
  --tp3-space-10: var(--tp3-p-space-10);
  --tp3-space-12: var(--tp3-p-space-12);
  --tp3-space-16: var(--tp3-p-space-16);

  --tp3-radius-s: var(--tp3-p-radius-s);
  --tp3-radius-m: var(--tp3-p-radius-m);
  --tp3-radius-l: var(--tp3-p-radius-l);
  --tp3-radius-pill: var(--tp3-p-radius-pill);

  --tp3-rule-hair: var(--tp3-p-rule-hair);
  --tp3-rule: var(--tp3-p-rule);
  --tp3-rule-bold: var(--tp3-p-rule-bold);

  --tp3-shadow-1: var(--tp3-p-shadow-1);
  --tp3-shadow-2: var(--tp3-p-shadow-2);

  --tp3-time-fast: var(--tp3-p-time-fast);
  --tp3-time-base: var(--tp3-p-time-base);
  --tp3-ease-out: var(--tp3-p-ease-out);

  --tp3-wrap: var(--tp3-p-wrap);
  --tp3-touch: var(--tp3-p-touch);
}

/* ============================================================
   3. Component 層（元件預設，可在容器上以變數覆寫）
   ============================================================ */
:root {
  --tp3-btn-bg: var(--tp3-surface);
  --tp3-btn-text: var(--tp3-ink);
  --tp3-btn-border: var(--tp3-ink-soft);
  --tp3-btn-radius: var(--tp3-radius-m);
  --tp3-btn-min-h: var(--tp3-touch);

  --tp3-card-bg: var(--tp3-surface);
  --tp3-card-border: var(--tp3-line);
  --tp3-card-radius: var(--tp3-radius-l);

  --tp3-input-bg: var(--tp3-surface);
  --tp3-input-border: var(--tp3-line-strong);
  --tp3-input-radius: var(--tp3-radius-m);
  --tp3-input-min-h: var(--tp3-touch);

  --tp3-chip-bg: var(--tp3-surface);
  --tp3-chip-text: var(--tp3-ink);
  --tp3-chip-border: var(--tp3-line-strong);

  --tp3-header-bg: var(--tp3-paper);
  --tp3-footer-bg: var(--tp3-paper-deep);

  --tp3-stack-gap: var(--tp3-space-4);
  --tp3-cluster-gap: var(--tp3-space-3);
  --tp3-grid-gap: var(--tp3-space-4);
}

/* ============================================================
   v1 相容 alias：math.css／zhuyin.css 等舊樣式直接沿用
   ============================================================ */
:root {
  --tp-paper: var(--tp3-paper);
  --tp-paper-deep: var(--tp3-paper-deep);
  --tp-surface: var(--tp3-surface);
  --tp-ink: var(--tp3-ink);
  --tp-ink-soft: var(--tp3-ink-soft);
  --tp-ink-faint: var(--tp3-ink-faint);
  --tp-ink-blue: var(--tp3-blue);
  --tp-line: var(--tp3-line);
  --tp-grid-line: var(--tp3-grid-line);
  --tp-cinnabar: var(--tp3-p-cinnabar);
  --tp-cinnabar-dark: var(--tp3-primary);
  --tp-cinnabar-soft: var(--tp3-primary-soft);
  --tp-sage: var(--tp3-p-sage);
  --tp-sage-deep: var(--tp3-sage);
  --tp-sage-soft: var(--tp3-sage-soft);
  --tp-amber: var(--tp3-amber);
  --tp-amber-deep: var(--tp3-amber-deep);
  --tp-amber-soft: var(--tp3-amber-soft);
  --tp-success: var(--tp3-success);
  --tp-success-soft: var(--tp3-sage-soft);
  --tp-warning: var(--tp3-warning);
  --tp-warning-soft: var(--tp3-amber-soft);
  --tp-error: var(--tp3-danger);
  --tp-error-soft: var(--tp3-danger-soft);
  --tp-info: var(--tp3-blue);
  --tp-focus-ring: var(--tp3-focus);
  --tp-focus-ring-soft: rgba(169, 74, 60, 0.35);
  --tp-font-serif: var(--tp3-font-serif);
  --tp-font-sans: var(--tp3-font-sans);
  --tp-font-kai: var(--tp3-font-kai);
  --tp-fs-caption: var(--tp3-fs-caption);
  --tp-fs-small: var(--tp3-fs-small);
  --tp-fs-body: var(--tp3-fs-body);
  --tp-fs-lead: var(--tp3-fs-lead);
  --tp-fs-h4: var(--tp3-fs-h4);
  --tp-fs-h3: var(--tp3-fs-h3);
  --tp-fs-h2: var(--tp3-fs-h2);
  --tp-fs-h1: var(--tp3-fs-h1);
  --tp-fs-display: var(--tp3-p-fs-display);
  --tp-lh-tight: 1.35;
  --tp-lh-title: var(--tp3-lh-title);
  --tp-lh-body: var(--tp3-lh-body);
  --tp-lh-zhuyin: var(--tp3-p-lh-zhuyin);
  --tp-fw-regular: var(--tp3-p-fw-regular);
  --tp-fw-medium: var(--tp3-p-fw-medium);
  --tp-fw-bold: var(--tp3-p-fw-bold);
  --tp-fw-black: 700;
  --tp-space-1: var(--tp3-space-1);
  --tp-space-2: var(--tp3-space-2);
  --tp-space-3: var(--tp3-space-3);
  --tp-space-4: var(--tp3-space-4);
  --tp-space-5: var(--tp3-space-5);
  --tp-space-6: var(--tp3-space-6);
  --tp-space-8: var(--tp3-space-8);
  --tp-space-10: var(--tp3-space-10);
  --tp-space-12: var(--tp3-space-12);
  --tp-space-16: var(--tp3-space-16);
  --tp-radius-s: var(--tp3-radius-s);
  --tp-radius-m: var(--tp3-radius-m);
  --tp-radius-l: var(--tp3-radius-l);
  --tp-radius-xl: var(--tp3-radius-l);
  --tp-radius-pill: var(--tp3-radius-pill);
  --tp-shadow-1: var(--tp3-shadow-1);
  --tp-shadow-2: var(--tp3-shadow-2);
  --tp-shadow-3: var(--tp3-shadow-2);
  --tp-shadow-lift: var(--tp3-shadow-2);
  --tp-shadow-pop: var(--tp3-shadow-2);
  --tp-time-fast: var(--tp3-time-fast);
  --tp-time-base: var(--tp3-time-base);
  --tp-time-slow: 450ms;
  --tp-ease-out: var(--tp3-ease-out);
  --tp-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --tp-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --tp-container: var(--tp3-wrap);
  --tp-header-h: 60px;
  --tp-touch-min: 48px;
  --tp-touch-kid: 56px;
  --tpz-size: 56px;
  --tpz-cell-border: var(--tp3-ink-soft);
  --tpz-grid: var(--tp3-grid-line);
}

/* ============================================================
   基底（reset、排版、焦點、無障礙）
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--tp3-paper);
  color: var(--tp3-ink);
  font-family: var(--tp3-font-sans);
  font-size: var(--tp3-fs-body);          /* 17px，內文下限 */
  line-height: var(--tp3-lh-body);
  overflow-x: hidden;                     /* 保險，版面本身不得溢出 */
}

h1, h2, h3, h4 {
  font-family: var(--tp3-font-serif);
  line-height: var(--tp3-lh-title);
  color: var(--tp3-ink);
  margin: 0 0 var(--tp3-space-3);
  text-wrap: balance;
  line-break: strict;
}
.tp3-nowrap {
  display: inline-block;
  white-space: nowrap;
}
h1 { font-size: var(--tp3-fs-h1); }
h2 { font-size: var(--tp3-fs-h2); }
h3 { font-size: var(--tp3-fs-h3); }
h4 { font-size: var(--tp3-fs-h4); }
p { margin: 0 0 var(--tp3-space-4); }

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

img, svg, video { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

/* [hidden] 永遠優先，不得被 flex/grid 蓋掉 */
[hidden] { display: none !important; }

/* 鍵盤焦點：清楚可見 */
:focus-visible {
  outline: 3px solid var(--tp3-focus);
  outline-offset: 2px;
  border-radius: var(--tp3-radius-s);
}
.tp3-input:focus-visible, .tp3-select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--tp3-focus);
  outline-offset: 0;
  border-color: var(--tp3-focus);
}

.tp3-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 跳到主要內容（tp3-shell.js 注入） */
.tp3-skip {
  position: absolute;
  top: var(--tp3-space-2);
  left: var(--tp3-space-2);
  z-index: 300;
  transform: translateY(-200%);
  background: var(--tp3-primary);
  color: var(--tp3-on-primary);
  padding: var(--tp3-space-3) var(--tp3-space-5);
  border-radius: var(--tp3-radius-m);
  font-weight: var(--tp3-fw-bold);
  text-decoration: none;
}
.tp3-skip:focus-visible {
  transform: none;
  color: var(--tp3-on-primary);
}

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

/* ============================================================
   版面：版心、區段、堆疊、群組、格線
   ============================================================ */
.tp3-wrap {
  width: 100%;
  max-width: var(--tp3-wrap);
  margin-inline: auto;
  padding-inline: var(--tp3-space-4);
}
@media (min-width: 640px) {
  .tp3-wrap { padding-inline: var(--tp3-space-6); }
}

main, .tp3-main { display: block; }
.tp3-main {
  padding-block: var(--tp3-space-8) var(--tp3-space-12);
  min-height: 40vh;
}

.tp3-section {
  margin-block: var(--tp3-space-10);
}
@media (min-width: 768px) {
  .tp3-section { margin-block: var(--tp3-space-16); }
}
/* 區段上方的編輯索引線 */
.tp3-section--ruled {
  border-top: var(--tp3-rule-hair) solid var(--tp3-line-strong);
  padding-top: var(--tp3-space-6);
}

.tp3-stack {
  display: flex;
  flex-direction: column;
  gap: var(--tp3-stack-gap);
}
.tp3-stack--loose { --tp3-stack-gap: var(--tp3-space-6); }
.tp3-stack--tight { --tp3-stack-gap: var(--tp3-space-2); }

.tp3-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tp3-cluster-gap);
}
.tp3-cluster--between { justify-content: space-between; }
.tp3-cluster--end { justify-content: flex-end; }

.tp3-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tp3-grid-gap);
}
@media (min-width: 640px) {
  .tp3-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp3-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .tp3-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================================
   文字角色：kicker／標題／導言／小字／波浪重點線
   ============================================================ */
.tp3-kicker {
  display: flex;
  align-items: center;
  gap: var(--tp3-space-3);
  margin: 0 0 var(--tp3-space-2);
  font-size: var(--tp3-fs-small);
  font-weight: var(--tp3-fw-bold);
  letter-spacing: 0.12em;
  color: var(--tp3-primary);
}
.tp3-kicker::before {
  content: "";
  width: 1.75em;
  border-top: var(--tp3-rule-bold) solid var(--tp3-primary);
}

.tp3-title {
  font-family: var(--tp3-font-serif);
  font-size: var(--tp3-fs-h1);
  line-height: var(--tp3-lh-title);
  margin: 0 0 var(--tp3-space-3);
}
.tp3-title--2 { font-size: var(--tp3-fs-h2); }
.tp3-title--3 { font-size: var(--tp3-fs-h3); }
/* 橫線索引：標題右側延伸的編輯線 */
.tp3-title--index {
  display: flex;
  align-items: baseline;
  gap: var(--tp3-space-4);
}
.tp3-title--index::after {
  content: "";
  flex: 1;
  border-top: var(--tp3-rule-hair) solid var(--tp3-line-strong);
  transform: translateY(-0.2em);
}

.tp3-lead {
  font-size: var(--tp3-fs-lead);
  line-height: var(--tp3-lh-body);
  color: var(--tp3-ink-soft);
  margin: 0 0 var(--tp3-space-4);
}

.tp3-small {
  font-size: var(--tp3-fs-body);
  line-height: 1.7;
  color: var(--tp3-ink-soft);
}
.tp3-small--faint { color: var(--tp3-ink-faint); }

/* 手繪波浪重點線（內嵌 SVG，無外部請求） */
.tp3-underline {
  text-decoration: none;
  padding-bottom: 0.12em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='5' viewBox='0 0 24 5'%3E%3Cpath d='M0 3.2 Q3 1.2 6 3.2 T12 3.2 T18 3.2 T24 3.2' fill='none' stroke='%23A94A3C' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: auto 0.28em;
}
.tp3-underline--sage {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='5' viewBox='0 0 24 5'%3E%3Cpath d='M0 3.2 Q3 1.2 6 3.2 T12 3.2 T18 3.2 T24 3.2' fill='none' stroke='%235E6E52' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ============================================================
   按鈕（每畫面只有一個實心 primary）
   ============================================================ */
.tp3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tp3-space-2);
  min-height: var(--tp3-btn-min-h);       /* 48px */
  min-width: var(--tp3-btn-min-h);
  padding: var(--tp3-space-2) var(--tp3-space-5);
  border: var(--tp3-rule) solid var(--tp3-btn-border);
  border-radius: var(--tp3-btn-radius);
  background: var(--tp3-btn-bg);
  color: var(--tp3-btn-text);
  font-size: var(--tp3-fs-body);
  font-weight: var(--tp3-fw-bold);
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--tp3-time-fast) var(--tp3-ease-out),
              border-color var(--tp3-time-fast) var(--tp3-ease-out),
              color var(--tp3-time-fast) var(--tp3-ease-out);
}
.tp3-btn:hover { border-color: var(--tp3-ink); }

.tp3-btn--primary {
  --tp3-btn-bg: var(--tp3-primary);
  --tp3-btn-text: var(--tp3-on-primary);
  --tp3-btn-border: var(--tp3-primary);
}
.tp3-btn--primary:hover {
  --tp3-btn-bg: var(--tp3-primary-hover);
  --tp3-btn-border: var(--tp3-primary-hover);
  color: var(--tp3-on-primary);
}

.tp3-btn--secondary {
  --tp3-btn-bg: var(--tp3-surface);
  --tp3-btn-text: var(--tp3-ink);
  --tp3-btn-border: var(--tp3-ink-soft);
}
.tp3-btn--secondary:hover { background: var(--tp3-paper-deep); color: var(--tp3-ink); }

.tp3-btn--ghost {
  --tp3-btn-bg: transparent;
  --tp3-btn-text: var(--tp3-blue);
  --tp3-btn-border: transparent;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.tp3-btn--ghost:hover { --tp3-btn-text: var(--tp3-primary); background: transparent; }

.tp3-btn--block { display: flex; width: 100%; }

.tp3-btn[disabled], .tp3-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 作答相關按鈕可加大到 56px（孩子觸控） */
.tp3-btn--kid { min-height: var(--tp3-p-touch-kid); font-size: var(--tp3-fs-lead); }
.tp3-btn--sm { min-height: 44px; padding: var(--tp3-space-1) var(--tp3-space-4); font-size: var(--tp3-fs-small); }

/* ============================================================
   頁首／頁尾（tp3-shell.js 注入；全站唯一一套）
   ============================================================ */
.tp3-header {
  background: var(--tp3-header-bg);
  border-bottom: var(--tp3-rule-hair) solid var(--tp3-line-strong);
}
.tp3-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--tp3-space-2) var(--tp3-space-4);
  padding-block: var(--tp3-space-2);
}
.tp3-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--tp3-space-2);
  min-height: var(--tp3-touch);
  text-decoration: none;
  color: var(--tp3-ink);
}
.tp3-brand__logo {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--tp3-radius-s);
}
.tp3-brand__name {
  font-family: var(--tp3-font-serif);
  font-weight: var(--tp3-fw-bold);
  font-size: var(--tp3-fs-body);
  line-height: 1.3;
  white-space: nowrap;
}
.tp3-brand:hover .tp3-brand__name { color: var(--tp3-primary); }

/* 站內主要連結：錯題本、更多練習 */
.tp3-header-links {
  display: flex;
  align-items: center;
  gap: var(--tp3-space-1);
}
.tp3-header-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tp3-touch);
  padding: var(--tp3-space-1) var(--tp3-space-3);
  border-radius: var(--tp3-radius-s);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-small);
  font-weight: var(--tp3-fw-medium);
  text-decoration: none;
}
.tp3-header-links a:hover { color: var(--tp3-primary); background: var(--tp3-paper-deep); }
.tp3-header-links a[aria-current="page"] {
  color: var(--tp3-primary);
  font-weight: var(--tp3-fw-bold);
  box-shadow: inset 0 -2px 0 var(--tp3-primary);
  border-radius: 0;
}

/* 手機第二列：一至六年級，六個 48px，不消失、不溢出 */
.tp3-grade-nav { border-top: var(--tp3-rule-hair) solid var(--tp3-line); }
.tp3-grade-nav__inner {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--tp3-space-1);
  padding-block: var(--tp3-space-1);
}
.tp3-grade-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--tp3-touch);
  padding: 0 var(--tp3-space-1);
  border-radius: var(--tp3-radius-s);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-small);   /* 15px，375px 六欄不溢出 */
  font-weight: var(--tp3-fw-medium);
  text-decoration: none;
  white-space: nowrap;
}
.tp3-grade-nav a:hover { background: var(--tp3-paper-deep); color: var(--tp3-ink); }
.tp3-grade-nav a[aria-current="page"] {
  background: var(--tp3-primary-soft);
  color: var(--tp3-primary);
  font-weight: var(--tp3-fw-bold);
  box-shadow: inset 0 0 0 var(--tp3-rule) var(--tp3-primary);
}
@media (min-width: 768px) {
  .tp3-grade-nav__inner { gap: var(--tp3-space-2); }
  .tp3-grade-nav a { font-size: var(--tp3-fs-body); }
}

.tp3-footer {
  background: var(--tp3-footer-bg);
  border-top: var(--tp3-rule-hair) solid var(--tp3-line-strong);
  margin-top: var(--tp3-space-16);
}
.tp3-footer__inner {
  padding-block: var(--tp3-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--tp3-space-2);
}
.tp3-footer p {
  margin: 0;
  font-size: var(--tp3-fs-small);
  line-height: 1.7;
  color: var(--tp3-ink-soft);
}
.tp3-footer .tp3-footer__sign {
  color: var(--tp3-ink-soft); /* 對 footer 的 paper-deep 底色仍達 4.91:1 */
  font-size: var(--tp3-fs-caption);
}

/* ============================================================
   卡片與選項卡
   ============================================================ */
.tp3-card {
  display: block;
  background: var(--tp3-card-bg);
  border: var(--tp3-rule-hair) solid var(--tp3-card-border);
  border-radius: var(--tp3-card-radius);
  padding: var(--tp3-space-5);
  box-shadow: var(--tp3-shadow-1);
  color: var(--tp3-ink);
}
a.tp3-card { text-decoration: none; }
a.tp3-card:hover { border-color: var(--tp3-line-strong); box-shadow: var(--tp3-shadow-2); }

/* 圖示底座：低彩度軟底圓角，內嵌 SVG 線稿用 currentColor */
.tp3-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--tp3-radius-m);
  background: var(--tp3-paper-deep);
  color: var(--tp3-ink-soft);
}
.tp3-card-icon svg { width: 24px; height: 24px; }

/* 五科與方向的低彩度識別（文字級對比，對紙皆 ≥4.5:1） */
.tp3-card-icon--chinese { background: var(--tp3-subject-chinese-soft); color: var(--tp3-subject-chinese); }
.tp3-card-icon--math    { background: var(--tp3-subject-math-soft);    color: var(--tp3-subject-math); }
.tp3-card-icon--english { background: var(--tp3-subject-english-soft); color: var(--tp3-subject-english); }
.tp3-card-icon--science { background: var(--tp3-subject-science-soft); color: var(--tp3-subject-science); }
.tp3-card-icon--social  { background: var(--tp3-subject-social-soft);  color: var(--tp3-subject-social); }

/* choice：年級、科目、準備方向的整卡可點選項 */
.tp3-choice {
  display: block;
  min-height: var(--tp3-touch);
  padding: var(--tp3-space-4) var(--tp3-space-5);
  background: var(--tp3-card-bg);
  border: var(--tp3-rule) solid var(--tp3-card-border);
  border-radius: var(--tp3-card-radius);
  color: var(--tp3-ink);
  text-decoration: none;
  transition: border-color var(--tp3-time-fast) var(--tp3-ease-out),
              background-color var(--tp3-time-fast) var(--tp3-ease-out),
              box-shadow var(--tp3-time-fast) var(--tp3-ease-out);
}
a.tp3-choice:hover {
  border-color: var(--tp3-primary);
  box-shadow: var(--tp3-shadow-1);
}
.tp3-choice-head {
  display: flex;
  align-items: center;
  gap: var(--tp3-space-3);
}
.tp3-choice-title {
  font-family: var(--tp3-font-serif);
  font-weight: var(--tp3-fw-bold);
  font-size: var(--tp3-fs-h4);
  line-height: var(--tp3-lh-title);
  color: var(--tp3-ink);
}
.tp3-choice-desc {
  display: block;
  margin-top: var(--tp3-space-2);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-body);
  line-height: 1.7;
}
.tp3-choice-meta {
  display: block;
  margin-top: var(--tp3-space-1);
  color: var(--tp3-ink-faint);
  font-size: var(--tp3-fs-caption);
  letter-spacing: 0.02em;
}
.tp3-choice .tp3-badge { margin-inline-start: auto; }
.tp3-choice.is-pending { opacity: 0.75; cursor: default; }
.tp3-choice[aria-current="page"], .tp3-choice.is-active {
  border-color: var(--tp3-primary);
  box-shadow: inset 0 0 0 1px var(--tp3-primary);
}

/* ============================================================
   清單與列（講義式索引清單）
   ============================================================ */
.tp3-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tp3-list > li { margin: 0; }
/* 列與列之間是細索引線，不是卡片牆 */
.tp3-row {
  border-top: var(--tp3-rule-hair) solid var(--tp3-line-strong);
}
.tp3-row:last-child { border-bottom: var(--tp3-rule-hair) solid var(--tp3-line-strong); }
.tp3-row-link {
  display: block;
  padding: var(--tp3-space-4) var(--tp3-space-2);
  min-height: var(--tp3-touch);
  color: var(--tp3-ink);
  text-decoration: none;
  border-radius: var(--tp3-radius-s);
  transition: background-color var(--tp3-time-fast) var(--tp3-ease-out);
}
a.tp3-row-link:hover { background: var(--tp3-paper-deep); }
.tp3-row-text {
  display: block;
  padding: var(--tp3-space-4) var(--tp3-space-2);
}
.tp3-row-title {
  display: flex;
  align-items: center;
  gap: var(--tp3-space-2);
  font-weight: var(--tp3-fw-bold);
  font-size: var(--tp3-fs-body);
  color: var(--tp3-ink);
}
a.tp3-row-link:hover .tp3-row-title { color: var(--tp3-primary); }
.tp3-row-desc {
  display: block;
  margin-top: var(--tp3-space-1);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-body);
  line-height: 1.7;
}
/* row 尾端箭頭圖示推到右側 */
.tp3-row-title [data-tp-icon="arrow"] { margin-inline-start: auto; color: var(--tp3-ink-faint); }

/* 返回上一層連結 */
.tp3-back {
  display: inline-flex;
  align-items: center;
  gap: var(--tp3-space-2);
  min-height: var(--tp3-touch);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-small);
  text-decoration: none;
}
.tp3-back:hover { color: var(--tp3-primary); }
.tp3-back [data-tp-icon="arrow"] svg { transform: scaleX(-1); } /* 指向左 */

/* ============================================================
   表單：field／label／input／select／check／chip
   ============================================================ */
.tp3-field {
  margin: 0 0 var(--tp3-space-5);
  padding: 0;
  border: 0;
  min-width: 0;
}
.tp3-label {
  display: block;
  margin-bottom: var(--tp3-space-2);
  font-size: var(--tp3-fs-body);
  font-weight: var(--tp3-fw-bold);
  color: var(--tp3-ink);
}
.tp3-input, .tp3-select, textarea.tp3-input {
  width: 100%;
  min-height: var(--tp3-input-min-h);    /* 48px */
  padding: var(--tp3-space-2) var(--tp3-space-3);
  border: var(--tp3-rule) solid var(--tp3-input-border);
  border-radius: var(--tp3-input-radius);
  background: var(--tp3-input-bg);
  color: var(--tp3-ink);
  font-size: var(--tp3-fs-body);
  line-height: 1.5;
}
.tp3-input::placeholder { color: var(--tp3-ink-faint); }
.tp3-select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: var(--tp3-space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236E6558' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--tp3-space-3) center;
}
.tp3-input:hover, .tp3-select:hover { border-color: var(--tp3-ink-soft); }
.tp3-input[disabled], .tp3-select[disabled] { opacity: 0.55; cursor: not-allowed; }

/* 勾選列（label 包 input），觸控高度 48px */
.tp3-check {
  display: flex;
  align-items: flex-start;
  gap: var(--tp3-space-3);
  min-height: var(--tp3-touch);
  padding: var(--tp3-space-3) var(--tp3-space-4);
  border: var(--tp3-rule) solid var(--tp3-line);
  border-radius: var(--tp3-radius-m);
  background: var(--tp3-surface);
  cursor: pointer;
  font-size: var(--tp3-fs-body);
  line-height: 1.6;
}
.tp3-check:hover { border-color: var(--tp3-ink-soft); }
.tp3-check input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--tp3-primary);
}
.tp3-check:has(input:checked) {
  border-color: var(--tp3-primary);
  background: var(--tp3-primary-soft);
}
.tp3-check:has(input:focus-visible) {
  outline: 3px solid var(--tp3-focus);
  outline-offset: 2px;
}

/* chip：版本／學期等單選按鈕群 */
.tp3-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tp3-space-2);
}
.tp3-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tp3-touch);
  padding: var(--tp3-space-2) var(--tp3-space-4);
  border: var(--tp3-rule) solid var(--tp3-chip-border);
  border-radius: var(--tp3-radius-pill);
  background: var(--tp3-chip-bg);
  color: var(--tp3-chip-text);
  font-size: var(--tp3-fs-body);
  cursor: pointer;
  transition: background-color var(--tp3-time-fast) var(--tp3-ease-out),
              border-color var(--tp3-time-fast) var(--tp3-ease-out);
}
.tp3-chip:hover { border-color: var(--tp3-ink); }
.tp3-chip[aria-pressed="true"], .tp3-chip[aria-checked="true"], .tp3-chip.is-active {
  background: var(--tp3-ink);
  border-color: var(--tp3-ink);
  color: var(--tp3-surface);
  font-weight: var(--tp3-fw-bold);
}
.tp3-chip[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ============================================================
   提示、步驟、進度、空狀態、徽章
   ============================================================ */
/* notice：琥珀淺底的編輯提示條（範圍提醒、生活課程說明） */
.tp3-notice {
  margin: 0;
  padding: var(--tp3-space-3) var(--tp3-space-4);
  border: var(--tp3-rule-hair) solid var(--tp3-amber);
  border-left: var(--tp3-rule-bold) solid var(--tp3-amber);
  border-radius: var(--tp3-radius-s);
  background: var(--tp3-amber-soft);
  color: var(--tp3-ink);
  font-size: var(--tp3-fs-small);
  line-height: 1.7;
}
.tp3-notice--info { border-color: var(--tp3-blue); background: var(--tp3-blue-soft); }
.tp3-notice--success { border-color: var(--tp3-sage); background: var(--tp3-sage-soft); }

/* steps：首頁三步驟，編號圈 + 細線 */
.tp3-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--tp3-space-4);
  counter-reset: tp3-step;
}
.tp3-steps > li {
  counter-increment: tp3-step;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--tp3-space-1) var(--tp3-space-3);
  align-items: start;
}
.tp3-steps > li::before {
  content: counter(tp3-step);
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: var(--tp3-rule) solid var(--tp3-primary);
  border-radius: 50%;
  color: var(--tp3-primary);
  font-family: var(--tp3-font-serif);
  font-weight: var(--tp3-fw-bold);
  font-size: var(--tp3-fs-body);
}
.tp3-steps > li strong { font-size: var(--tp3-fs-body); }
.tp3-steps > li p { margin: 0; }
@media (min-width: 768px) {
  .tp3-steps { flex-direction: row; gap: var(--tp3-space-6); }
  .tp3-steps > li { flex: 1; }
}

/* progress：作答進度條（原生 <progress>） */
.tp3-progress {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 14px;
  border: var(--tp3-rule-hair) solid var(--tp3-line-strong);
  border-radius: var(--tp3-radius-pill);
  background: var(--tp3-paper-deep);
  overflow: hidden;
}
.tp3-progress::-webkit-progress-bar { background: var(--tp3-paper-deep); border-radius: var(--tp3-radius-pill); }
.tp3-progress::-webkit-progress-value { background: var(--tp3-sage); border-radius: var(--tp3-radius-pill); }
.tp3-progress::-moz-progress-bar { background: var(--tp3-sage); border-radius: var(--tp3-radius-pill); }

/* empty：空狀態（錯題本、無題目、更多練習未接入） */
.tp3-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tp3-space-3);
  padding: var(--tp3-space-10) var(--tp3-space-4);
  text-align: center;
  border: var(--tp3-rule-hair) dashed var(--tp3-line-strong);
  border-radius: var(--tp3-radius-l);
  background: var(--tp3-surface);
}
.tp3-empty svg, .tp3-empty [data-tp-icon] svg {
  width: 64px;
  height: 64px;
  color: var(--tp3-ink-faint);
}
.tp3-empty h2 { margin: 0; font-size: var(--tp3-fs-h3); }
.tp3-empty p { margin: 0; color: var(--tp3-ink-soft); font-size: var(--tp3-fs-body); max-width: 34em; }

/* badge：小標籤（如「生活課程」） */
.tp3-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: var(--tp3-space-1) var(--tp3-space-3);
  border: var(--tp3-rule-hair) solid var(--tp3-line-strong);
  border-radius: var(--tp3-radius-pill);
  background: var(--tp3-paper-deep);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-caption);
  font-weight: var(--tp3-fw-bold);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tp3-badge--sage { background: var(--tp3-sage-soft); border-color: var(--tp3-sage); color: var(--tp3-sage); }
.tp3-badge--amber { background: var(--tp3-amber-soft); border-color: var(--tp3-amber); color: var(--tp3-amber-deep); }
.tp3-badge--blue { background: var(--tp3-blue-soft); border-color: var(--tp3-blue); color: var(--tp3-blue); }

/* ============================================================
   工具類與圖示預設
   ============================================================ */
.tp3-no-print { }
@media print {
  .tp3-no-print, .tp3-header, .tp3-footer, .tp3-skip { display: none !important; }
}

/* 顏色工具（頁面當 class 使用） */
.tp3-ink-soft { color: var(--tp3-ink-soft); }
.tp3-ink-faint { color: var(--tp3-ink-faint); }

/* 分組小標（更多練習）：橫線索引 */
.tp3-title--group {
  font-size: var(--tp3-fs-h3);
  display: flex;
  align-items: baseline;
  gap: var(--tp3-space-4);
}
.tp3-title--group::after {
  content: "";
  flex: 1;
  border-top: var(--tp3-rule-hair) solid var(--tp3-line-strong);
  transform: translateY(-0.2em);
}

/* 內嵌線稿圖示預設（tp3-shell.js 注入 SVG）：
   保留原 span class 與 aria-hidden，SVG 用 currentColor */
[data-tp-icon] { display: inline-flex; flex: none; }
[data-tp-icon] svg {
  width: 1.25em;
  height: 1.25em;
  display: block;
}
.tp3-row-title [data-tp-icon] svg,
.tp3-choice-head [data-tp-icon] svg { width: 1.4em; height: 1.4em; }

/* ============================================================
   列印分工：卷面樣式在 review-print.css；此處只藏介面
   ============================================================ */
@media print {
  body { background: #FFFFFF; }
  .tp3-main { padding-block: 0; min-height: 0; }
}

/* ============================================================
   入口頁與 404（根目錄、錯誤頁專用元件）
   ============================================================ */
/* 三入口：小學生（主）／國中／我想變強 */
.tp3-portal { display: grid; gap: var(--tp3-space-4); }
.tp3-portal__item { display: block; text-decoration: none; color: inherit; }
.tp3-portal__title {
  display: flex;
  align-items: center;
  gap: var(--tp3-space-3);
  font-family: var(--tp3-font-serif);
  font-weight: var(--tp3-fw-bold);
  font-size: var(--tp3-fs-h4);
}
.tp3-portal__desc {
  display: block;
  margin-top: var(--tp3-space-2);
  color: var(--tp3-ink-soft);
  font-size: var(--tp3-fs-body);
  line-height: 1.7;
}
@media (min-width: 768px) {
  .tp3-portal { grid-template-columns: 1.2fr 1fr 1fr; }
}

/* 404：置中線稿空狀態 */
.tp3-404 { text-align: center; padding-block: var(--tp3-space-12); }
.tp3-404 svg { width: 160px; max-width: 60vw; height: auto; color: var(--tp3-ink-faint); }
.tp3-404 .tp3-title { margin-top: var(--tp3-space-4); }

/* choice 變體：整卡連結的科目卡與方向卡 */
.tp3-choice--subject, .tp3-choice--mode { display: block; text-decoration: none; color: inherit; }
