/* course.css — AI 安全上班族課程 共用樣式
 * 方向：「會議室白板」— 講師站在白板前把一件事講清楚：黑筆寫大字、紅筆圈重點、藍筆拉引線、綠筆打勾。
 * 墨色只有四支白板筆（黑、藍、紅、綠）加便利貼黃；講師模式另有一支紫筆，只在講師模式出現。
 * 板面上寫的字是平的；可以按的是吸在板上的磁鐵（有厚度、有影子）。細節見 DESIGN.md。 */

:root {
  --paper: #f5f7f6;    /* 白板琺瑯面：偏冷的白，不是米色紙 */
  --paper-2: #e8ecec;  /* 擦過的板面、凹槽 */
  --card: #ffffff;     /* 貼在板上的 A4 紙、磁鐵面 */
  --ink: #1d2327;      /* 黑色白板筆 */
  --muted: #4d5961;    /* 淡一點的黑筆：在板面上對比 6.8 */
  --line: #d3d9dc;
  --line-strong: #aeb7bd; /* 鋁框、磁鐵邊 */
  --brand: #1f4fbf;    /* 藍色白板筆 */
  --brand-ink: #173c93;
  --brand-soft: #e2e9f8;
  /* 實心底色專用（上面放白字）：淺色模式和品牌色一樣；深色模式的品牌色調亮了，當底色時白字會看不清楚，另外給一組深一點的 */
  /* 反色（深底淺字）：翻牌卡背面、選中的標籤、提示訊息。深色模式不能直接拿文字色當底色，否則會變成一塊亮白 */
  --invert-bg: #1d2327; --invert-ink: #f5f7f6;
  --brand-fill: #1f4fbf; --brand-fill-hover: #173c93; --ok-fill: #1b7f45; --danger-fill: #c62d29;
  --ok: #176b3b;       /* 綠色白板筆，文字用：在淡綠底上對比 5 以上 */
  --ok-soft: #e1f1e7;
  --warn: #7a5600;     /* 便利貼黃的字：黃色本身當字看不見，用深一階的黃褐 */
  --warn-soft: #fff3bf;
  --danger: #b3261e;   /* 紅色白板筆，文字用 */
  --danger-soft: #fbe4e2;
  --sticky: #ffe27a;   /* 便利貼 */
  --sticky-ink: #1d2327;
  --tape: rgb(255 226 122 / 55%); /* 紙膠帶：半透明的便利貼黃 */
  --teacher: #6d35c9;  /* 講師的紫筆：只在講師模式出現 */
  --teacher-soft: #f0e9fb;
  --shadow: 0 1px 2px rgb(29 35 39 / 8%), 0 10px 24px -14px rgb(29 35 39 / 30%);
  --shadow-lift: 0 2px 4px rgb(29 35 39 / 10%), 0 18px 36px -16px rgb(29 35 39 / 38%);
  /* 磁鐵：吸在板上的厚度（軟影子，不是硬邊方塊影） */
  --magnet: 0 1px 0 rgb(255 255 255 / 70%) inset, 0 1px 1px rgb(29 35 39 / 14%), 0 4px 10px -3px rgb(29 35 39 / 28%);
  --magnet-up: 0 1px 0 rgb(255 255 255 / 70%) inset, 0 2px 2px rgb(29 35 39 / 12%), 0 10px 18px -6px rgb(29 35 39 / 30%);
  --magnet-down: 0 1px 2px rgb(29 35 39 / 20%) inset, 0 1px 1px rgb(29 35 39 / 10%);
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  /* 手繪框：白板筆畫出來的框，四個角不一樣圓 */
  --hand-box: 14px 22px 16px 26px / 22px 14px 24px 16px;
  --font: "Inter", "Noto Sans TC", system-ui, sans-serif;
  --hand: "Kalam", "LXGW WenKai TC", "Noto Sans TC", system-ui, sans-serif; /* 手寫數字與編號（Kalam 的數字＋文楷的中文） */
  --hand-text: "LXGW WenKai TC", "Noto Sans TC", system-ui, sans-serif; /* 手寫標題與標註：整句同一種筆跡，英文也用文楷的，不跟中文打架；內文一律用 --font */
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --text-base: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --text-hero: clamp(2.3rem, 1.4rem + 3.8vw, 4.4rem);
  --space-section: clamp(3rem, 2rem + 4vw, 6rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
  --normal: 250ms;
  color-scheme: light;
}

/* 深色：同一塊白板在關燈的教室——玻璃黑板，筆色調亮 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181b; --paper-2: #1c2226; --card: #20272c; --ink: #eef2f3; --muted: #a7b2b9;
    --line: #333d44; --line-strong: #4a565e; --brand: #86a8ff; --brand-ink: #b0c6ff; --brand-soft: #1b2847;
    --ok: #5fd08f; --ok-soft: #14301f; --warn: #ffd24d; --warn-soft: #3a3110;
    --danger: #ff8078; --danger-soft: #3d1a18; --teacher: #c3a4ff; --teacher-soft: #2a2140;
    --invert-bg: #2a3238; --invert-ink: #eef2f3;
    --brand-fill: #2d5bd0; --brand-fill-hover: #2349ad; --ok-fill: #1d7a44; --danger-fill: #c2352f;
    --tape: rgb(255 226 122 / 38%); --sticky: #b9993c;
    --magnet: 0 1px 0 rgb(255 255 255 / 8%) inset, 0 1px 1px rgb(0 0 0 / 40%), 0 4px 10px -3px rgb(0 0 0 / 60%);
    --magnet-up: 0 1px 0 rgb(255 255 255 / 8%) inset, 0 2px 2px rgb(0 0 0 / 40%), 0 10px 18px -6px rgb(0 0 0 / 65%);
    --magnet-down: 0 1px 2px rgb(0 0 0 / 50%) inset;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14181b; --paper-2: #1c2226; --card: #20272c; --ink: #eef2f3; --muted: #a7b2b9;
  --line: #333d44; --line-strong: #4a565e; --brand: #86a8ff; --brand-ink: #b0c6ff; --brand-soft: #1b2847;
  --ok: #5fd08f; --ok-soft: #14301f; --warn: #ffd24d; --warn-soft: #3a3110;
  --danger: #ff8078; --danger-soft: #3d1a18; --teacher: #c3a4ff; --teacher-soft: #2a2140;
  --invert-bg: #2a3238; --invert-ink: #eef2f3;
  --brand-fill: #2d5bd0; --brand-fill-hover: #2349ad; --ok-fill: #1d7a44; --danger-fill: #c2352f;
  --tape: rgb(255 226 122 / 38%); --sticky: #b9993c;
  --magnet: 0 1px 0 rgb(255 255 255 / 8%) inset, 0 1px 1px rgb(0 0 0 / 40%), 0 4px 10px -3px rgb(0 0 0 / 60%);
  --magnet-up: 0 1px 0 rgb(255 255 255 / 8%) inset, 0 2px 2px rgb(0 0 0 / 40%), 0 10px 18px -6px rgb(0 0 0 / 65%);
  --magnet-down: 0 1px 2px rgb(0 0 0 / 50%) inset;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: var(--text-base); line-height: 1.75; -webkit-font-smoothing: antialiased;
  /* 格線白板：很淡的 32px 方格，一看就是會議室那塊板 */
  background-image: linear-gradient(rgb(29 35 39 / 3.2%) 1px, transparent 1px), linear-gradient(90deg, rgb(29 35 39 / 3.2%) 1px, transparent 1px);
  background-size: 32px 32px;
}
img, svg { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); font-weight: 900; }
h3, .h3 { font-size: 1.2rem; font-weight: 800; } /* .h3：標題層級要用 h2，但外觀跟卡片小標一樣大 */
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
/* 注意：main 會裁掉左右超出的部分。要做滿版區塊，main 本身不能是 .wrap（1120px），
   否則滿版區塊會被裁回 1120px。首頁的做法是 main 滿版、裡面再分段套 .wrap。 */
main { isolation: isolate; overflow-x: clip; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 86%, transparent); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-fill); color: #fff; font-size: 1.05rem; box-shadow: var(--shadow);
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; line-height: 1.2; }
.header-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mode-switch { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mode-switch button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all var(--fast);
}
.mode-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.mode-switch button[data-mode="teacher"][aria-pressed="true"] { color: var(--teacher); }
.progress-bar { height: 3px; background: transparent; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--brand-fill); transition: width var(--normal) var(--ease); }

/* 講師：還沒回覆的聯絡留言數（頁首「管理後台」、後台「聯絡留言」分頁） */
.unread-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px;
  background: var(--danger-fill); color: #fff; font: 800 .75rem/1 "Inter", sans-serif; vertical-align: 2px; }
.unread-dot[hidden] { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700;
  font-size: .95rem; border-radius: 999px; padding: 10px 20px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast), background var(--fast), border-color var(--fast);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.btn-primary:hover { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); }
.btn-ok { background: var(--ok-fill); border-color: var(--ok-fill); color: #fff; }
.btn-danger { background: var(--danger-fill); border-color: var(--danger-fill); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-ghost { background: transparent; }
.btn-help { border-color: var(--brand); color: var(--brand); }
[data-auth-slot] { display: inline-flex; gap: 8px; align-items: center; }
.btn-help.is-hinting { animation: hint-pulse 1.2s ease-in-out 4; }
@keyframes hint-pulse { 50% { background: var(--brand-fill); color: #fff; box-shadow: 0 0 0 6px var(--brand-soft); } }

/* ---------- Hero ---------- */
.module-hero { padding: var(--space-section) 0 calc(var(--space-section) * .6); position: relative; }
.module-hero::before {
  content: ""; position: absolute; z-index: -1; inset: -40px 0 auto auto; width: min(520px, 80vw); aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(circle at 60% 40%, rgb(31 79 191 / 26%), rgb(168 85 247 / 14%) 40%, transparent 68%);
  filter: blur(20px);
}
.module-hero .eyebrow {
  display: inline-flex; gap: 10px; align-items: center; font-weight: 800; color: var(--brand);
  letter-spacing: .08em; font-size: .85rem; text-transform: uppercase;
}
.module-hero .eyebrow b {
  font-size: 1rem; background: var(--brand-fill); color: #fff; border-radius: 8px; padding: 2px 10px; letter-spacing: 0;
}
.module-hero h1 { font-size: var(--text-hero); font-weight: 900; margin: .3em 0 .35em; max-width: 16em; }
.module-hero h1 em { font-style: normal; color: var(--brand); position: relative; white-space: nowrap; }
.module-hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .22em; z-index: -1;
  background: color-mix(in srgb, var(--brand) 22%, transparent); border-radius: 4px;
}
.module-hero .lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: var(--muted); max-width: 40em; }
.goals {
  margin-top: 28px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  padding: 0; list-style: none;
}
.goals li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 14px 16px 14px 44px; position: relative; font-weight: 600; box-shadow: var(--shadow);
}
.goals li::before {
  content: "✓"; position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: .75rem;
}
.meta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */
.slide { padding: calc(var(--space-section) * .55) 0; border-top: 1px dashed var(--line); }
.section-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.section-num {
  flex: none; font-weight: 900; font-size: 2.6rem; line-height: 1; color: transparent;
  -webkit-text-stroke: 1.5px var(--brand); font-family: "Inter", sans-serif;
}
.section-head p { color: var(--muted); margin: 0; }
.kicker { font-size: .8rem; font-weight: 800; letter-spacing: .08em; color: var(--brand); text-transform: uppercase; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
/* 格線的欄預設不會比內容窄：卡片裡有一排按鈕時會被撐到比手機還寬、右半邊被裁掉。允許縮小，內容自己換行 */
.split > * { min-width: 0; }

.analogy {
  border: 2px solid var(--brand); border-radius: var(--hand-box);
  padding: 16px 20px; margin: 18px 0; font-weight: 500;
}
.analogy strong { color: var(--brand-ink); }
.callout { border-radius: var(--radius-m); padding: 14px 18px; margin: 14px 0; border: 1px solid; }
.callout-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.callout-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.callout-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.must-read { font-size: .92rem; }
.presenting .must-read { display: none; } /* 投影時是講師在帶，不需要這段 */

.pill { display: inline-block; font-size: .75rem; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- Teacher notes（只在講師模式出現）---------- */
.teacher { display: none; }
:root[data-mode="teacher"] .teacher { display: block; }
.teacher-note {
  margin: 18px 0; border: 1.5px dashed var(--teacher); background: var(--teacher-soft);
  border-radius: var(--radius-m); padding: 14px 18px; font-size: .95rem;
}
.teacher-note > b:first-child { color: var(--teacher); display: block; margin-bottom: 4px; }
.teacher-note ul { margin: .3em 0 0; padding-left: 1.2em; }
.teacher-banner {
  background: var(--teacher); color: #fff; text-align: center; font-size: .85rem; font-weight: 700; padding: 6px 12px;
}

/* ---------- Choice / quiz ---------- */
.options { display: grid; gap: 10px; margin: 14px 0; }
.option {
  text-align: left; font: inherit; border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--radius-m); padding: 12px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start;
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.option:hover:not(:disabled) { border-color: var(--brand); transform: translateX(3px); }
.option .key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--paper-2); font-weight: 800; font-size: .85rem;
}
.option.is-right { border-color: var(--ok); background: var(--ok-soft); }
.option.is-right .key { background: var(--ok-fill); color: #fff; }
.option.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.option.is-wrong .key { background: var(--danger-fill); color: #fff; }
.option:disabled { cursor: default; }
.feedback { border-radius: var(--radius-m); padding: 12px 16px; margin-top: 8px; animation: pop var(--normal) var(--ease); }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--danger-soft); }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.quiz-dots { display: flex; gap: 6px; }
.quiz-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.quiz-dots i.now { background: var(--brand-fill); transform: scale(1.3); }
.quiz-dots i.ok { background: var(--ok-fill); }
.quiz-dots i.bad { background: var(--danger-fill); }
.quiz-q { font-size: 1.15rem; font-weight: 700; }
.score-big { font-size: clamp(3rem, 2rem + 4vw, 5rem); font-weight: 900; line-height: 1; color: var(--brand); }

/* ---------- Games ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: .9rem; font-weight: 700; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: all var(--fast);
}
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }

.flip { perspective: 1000px; min-height: 240px; cursor: pointer; }
.flip-inner { position: relative; display: grid; min-height: inherit; transition: transform 600ms var(--ease); transform-style: preserve-3d; }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  /* 正反兩面疊在同一格：卡片高度跟著比較長的那一面，手機上背面字多也不用在卡片裡捲動 */
  position: relative; grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius-l);
  padding: 22px 22px 44px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.flip-front { background: var(--card); }
.flip-back { background: var(--invert-bg); color: var(--invert-ink); transform: rotateY(180deg); }
.flip-back .pill { margin-bottom: 6px; }
.flip-front .emoji { font-size: 2.6rem; line-height: 1; }
.flip-hint { position: absolute; bottom: 14px; right: 18px; font-size: .78rem; color: var(--muted); }
.flip-back .flip-hint { color: color-mix(in srgb, var(--invert-ink) 70%, transparent); }
/* 背面是深底：原本的灰字（--muted）放上去幾乎看不見 */
.flip-back .muted { color: color-mix(in srgb, var(--invert-ink) 75%, transparent); }

/* 翻牌卡炫光：跟著游標傾斜、反光跟著走，翻面時回彈，翻到背面掃過一道光，正面滑過時外框流光 */
.flip { position: relative; }
.flip-inner { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; }
.flip.is-flipped .flip-inner { transform: rotateX(var(--rx, 0deg)) rotateY(calc(180deg + var(--ry, 0deg))); }
.flip.is-turning .flip-inner { transition: transform 650ms var(--ease); }
.flip:hover .flip-face, .flip:focus-visible .flip-face { box-shadow: var(--shadow-lift); }
.flip-face::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--normal);
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / 40%), transparent 55%);
}
.flip-back::after { background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / 16%), transparent 55%); }
.flip:hover .flip-face::after { opacity: 1; }
.flip-front::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--fx-a), transparent 0 55%, #86a8ff 70%, #86a8ff 80%, #fbbf24 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity var(--normal); animation: fx-spin 4s linear infinite;
}
.flip:hover .flip-front::before, .flip:focus-visible .flip-front::before { opacity: 1; }
.flip-back::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 22%) 50%, transparent 65%) 150% 0 / 250% 100% no-repeat;
}
.flip.is-flipped .flip-back::before { animation: fx-shine .9s .35s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .flip-inner, .flip.is-turning .flip-inner { transition: none; }
  .flip-front::before, .flip.is-flipped .flip-back::before { animation: none; }
}
@media print { .flip-face::before, .flip-face::after { display: none; } }

.code {
  font-family: var(--mono); font-size: .88rem; background: #1b1a26; color: #e9e7f5; border-radius: var(--radius-m);
  padding: 12px 0; overflow-x: auto; line-height: 1.7; margin: 0;
}
.code-line {
  display: flex; gap: 12px; padding: 1px 16px; white-space: pre; cursor: default; border-left: 3px solid transparent;
  width: 100%; text-align: left; font: inherit; color: inherit; background: none; border-top: 0; border-right: 0; border-bottom: 0;
}
.code-line .ln { color: #8f8cab; user-select: none; min-width: 1.6em; text-align: right; }
.code.is-clickable .code-line { cursor: pointer; }
.code.is-clickable .code-line:hover { background: rgb(255 255 255 / 6%); border-left-color: #86a8ff; }
.code-line.hit { background: rgb(255 90 80 / 18%); border-left-color: #ff7a73; }
.code-line.miss { background: rgb(255 255 255 / 5%); animation: shake 300ms; }
.code-line.found { background: rgb(76 197 143 / 16%); border-left-color: #4cc58f; }

textarea, input[type="text"], input[type="datetime-local"], select {
  font: inherit; width: 100%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--radius-m); padding: 10px 14px;
}
textarea { min-height: 120px; resize: vertical; }
input[type="datetime-local"] { min-width: 0; }
textarea.code-input { font-family: var(--mono); font-size: .85rem; background: #1b1a26; color: #e9e7f5; min-height: 190px; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--paper-2); border-radius: var(--radius-m); padding: 10px 16px; min-width: 110px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat span { font-size: .8rem; color: var(--muted); }

.steps { counter-reset: step; display: grid; gap: 12px; }
.step {
  border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px 14px 60px; position: relative;
  background: var(--card); opacity: .35; transition: opacity var(--normal), transform var(--normal) var(--ease), border-color var(--normal);
}
.step::before {
  counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-weight: 900;
}
.step.is-on { opacity: 1; border-color: var(--brand); transform: translateX(4px); }
.step.is-on::before { background: var(--brand-fill); color: #fff; }
.step.is-bad.is-on { border-color: var(--danger); }
.step.is-bad.is-on::before { background: var(--danger-fill); }

/* 流程步驟：步驟之間畫一條連接線，亮起時從上往下長出來 */
.steps .step:not(:last-child)::after {
  content: ""; position: absolute; left: 30px; top: 46px; bottom: -28px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--brand), #86a8ff); transform-origin: top; transform: scaleY(0);
  transition: transform .4s var(--ease) .15s;
}
.steps .step.is-on:not(:last-child)::after { transform: scaleY(1); }
.steps .step.is-bad.is-on:not(:last-child)::after { background: var(--danger-fill); }
.steps .step.is-on::before { box-shadow: 0 0 0 4px var(--brand-soft); transition: box-shadow var(--normal); }

/* ---------- 圖解進場：捲到才播放（core.js 的 initReveal；沒有 JS 或「減少動態」時不會加上 fx-reveal-on） ---------- */
.fx-reveal-on :is(.analogy, .callout, .steps)[data-reveal]:not(.is-in),
.fx-reveal-on :is(.goals, .grid-2, .grid-3)[data-reveal]:not(.is-in) > *,
.fx-reveal-on .compare[data-reveal]:not(.is-in) tbody tr { opacity: 0; }
.fx-reveal-on :is(.callout, .steps)[data-reveal].is-in { animation: rv-rise .55s var(--ease) backwards; }
.fx-reveal-on .analogy[data-reveal].is-in { animation: rv-slide .6s var(--ease) backwards; position: relative; }
.fx-reveal-on .analogy[data-reveal].is-in::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 55%) 50%, transparent 65%) 150% 0 / 250% 100% no-repeat;
  animation: fx-shine 1.1s .35s ease-out both;
}
.fx-reveal-on :is(.goals, .grid-2, .grid-3)[data-reveal].is-in > * { animation: rv-rise .55s var(--ease) calc(var(--ri, 0) * 90ms) backwards; }
.fx-reveal-on .goals[data-reveal].is-in > li::before { animation: fx-pop .4s var(--ease) calc(var(--ri, 0) * 90ms + .3s) backwards; }
.fx-reveal-on .compare[data-reveal].is-in tbody tr { animation: rv-row .45s ease-out calc(var(--ri, 0) * 90ms) backwards; }
.fx-reveal-on .compare[data-reveal].is-in td.hl { animation: rv-hl 1.4s ease-in-out calc(var(--ri, 0) * 90ms + .4s); }
@keyframes rv-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes rv-slide { from { opacity: 0; transform: translateX(-28px); } }
@keyframes rv-row { from { opacity: 0; transform: translateX(-14px); } }
@keyframes rv-hl { 35% { background: color-mix(in srgb, var(--brand) 26%, var(--card)); box-shadow: inset 3px 0 0 var(--brand); } }
@media (prefers-reduced-motion: reduce) { .steps .step::after { transition: none; } }
@media print {
  .fx-reveal-on [data-reveal], .fx-reveal-on [data-reveal] > *, .fx-reveal-on [data-reveal] tr { opacity: 1 !important; animation: none !important; }
}

/* ---------- Module nav / footer ---------- */
.module-nav { display: flex; justify-content: space-between; gap: 12px; padding: 32px 0 64px; flex-wrap: wrap; }
.module-nav a { max-width: 48%; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .85rem; }
/* 手機上連結要點得到：inline-block 加上下留白，高度超過 24px */
.site-footer a { display: inline-block; padding-block: 4px; }
/* 原生拉桿本身只有 16px 高，手指很難按到 */
input[type="range"] { min-height: 32px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 90;
  background: var(--invert-bg); color: var(--invert-ink); padding: 10px 18px; border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow-lift); transition: all var(--normal) var(--ease); pointer-events: none; max-width: calc(100% - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Teacher timer ---------- */
.timer {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; background: var(--teacher); color: #fff;
  border-radius: var(--radius-m); padding: 8px 12px; display: none; gap: 8px; align-items: center; box-shadow: var(--shadow-lift);
}
:root[data-mode="teacher"] .timer { display: flex; }
.timer output { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.2rem; min-width: 3.2em; text-align: center; }
.timer button { background: rgb(255 255 255 / 18%); color: #fff; border: 0; border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: .8rem; }
.timer.is-done { animation: pulse 900ms infinite; }

/* ---------- Presenter mode（投影）---------- */
:root.presenting { font-size: 125%; } /* 放不下會自動縮小，所以字可以大一點 */
/* 一段一頁。實際高度由 core.js 量過之後寫進 style（內容太高會整段縮小），
   這裡的 min-height 只是 JS 還沒跑到時的保險值。 */
:root.presenting .slide {
  min-height: calc(100vh - 84px); display: flex; flex-direction: column;
  justify-content: safe center; padding-block: 24px; scroll-margin-top: 76px;
}
@supports not (justify-content: safe center) {
  :root.presenting .slide { justify-content: flex-start; }
}
:root.presenting .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
:root.presenting .wb, :root.presenting .workshop { font-size: .88em; }
.slide-counter {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; background: var(--invert-bg); color: var(--invert-ink);
  border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 700; display: none;
}
:root.presenting .slide-counter { display: block; }

/* ---------- Tour ---------- */
.tour-backdrop { position: fixed; inset: 0; z-index: 100; pointer-events: auto; }
.tour-spot {
  position: fixed; z-index: 101; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgb(15 14 25 / 62%), 0 0 0 3px var(--brand);
  transition: all var(--normal) var(--ease);
}
.tour-pop {
  position: fixed; z-index: 102; width: min(340px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  border-radius: var(--radius-m); padding: 16px 18px; box-shadow: var(--shadow-lift); transition: top var(--normal) var(--ease), left var(--normal) var(--ease);
}
.tour-pop h4 { margin: 0 0 6px; font-size: 1.05rem; }
.tour-pop p { margin: 0 0 12px; font-size: .95rem; color: var(--muted); }
.tour-pop footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.goals-label { font-size: .85rem; font-weight: 800; letter-spacing: .06em; color: var(--brand); margin: 0 0 .4em; }
.quizshow-link { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; font-size: .88rem; }

/* ---------- 名詞小辭典（glossary.js） ---------- */
.term {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, var(--brand) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: .22em;
  border-radius: 3px; transition: background var(--fast), color var(--fast);
}
.term:hover, .term[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.term-pop {
  position: absolute; z-index: 90; width: min(320px, calc(100vw - 20px)); background: var(--card); color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: var(--radius-m);
  padding: 14px 16px 12px; box-shadow: var(--shadow-lift); animation: pop 220ms var(--ease) both; line-height: 1.65;
}
.term-pop h4 { margin: 2px 0 6px; font-size: 1.05rem; }
.term-pop p { margin: 0 0 8px; font-size: .95rem; }
.term-pop .term-like { color: var(--muted); font-size: .9rem; }
.term-cat { font-size: .75rem; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.term-pop footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: .85rem; font-weight: 700; border-top: 1px dashed var(--line); padding-top: 8px; }
.term-pop footer a { text-decoration: none; }
.term-pop footer a:hover { text-decoration: underline; }

/* ---------- Animations ---------- */
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
.reveal { animation: pop 500ms var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 640px) {
  .brand small { display: none; }
  .site-header [data-action="present"], .site-header [data-action="print"] { display: none; }
  .site-header .wrap { gap: 8px; min-height: 56px; }
  :root[data-mode="teacher"] .timer { display: none; }
  .section-num { font-size: 2rem; }
  .module-nav a { max-width: 100%; flex: 1 1 100%; }
}

/* ---------- 試用閘門：只留單元開頭與開通卡片 ---------- */
body.is-locked main > section:not(.module-hero):not([data-gate-card]) { display: none; }
body.is-locked [data-module-nav] { display: none; }

/* ---------- 分類遊戲 ---------- */
.classify-card {
  font-size: clamp(1.1rem, 1rem + .6vw, 1.4rem); font-weight: 700; background: var(--paper-2); border-radius: var(--radius-m);
  padding: 22px 24px; margin: 10px 0 16px; border: 1px solid var(--line); min-height: 5em; display: flex; align-items: center;
}
.classify-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.classify-choices .btn { flex: 1 1 160px; padding: 14px 16px; }

/* ---------- 排序遊戲 ---------- */
.order-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; counter-reset: ord; }
.order-list li {
  counter-increment: ord; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 8px 10px 8px 48px; position: relative;
}
.order-list li::before {
  content: counter(ord); position: absolute; left: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-2); display: grid; place-items: center; font-weight: 900; font-size: .85rem;
}
.order-list li.is-right { border-color: var(--ok); background: var(--ok-soft); }
.order-list li.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.order-btns { display: flex; gap: 4px; flex: none; }
.order-btns .btn { padding: 4px 10px; }

/* 排序遊戲炫光：交換的兩格滑過去、排對時一格一格亮綠光、排錯的晃一下 */
.fx-order .order-list li { transition: border-color var(--fast), background var(--fast), box-shadow var(--fast); }
.fx-order .order-list li.is-moved { animation: ord-in .32s var(--ease); z-index: 2; box-shadow: 0 10px 24px -12px rgb(29 35 39 / 70%); border-color: var(--brand); }
.fx-order .order-list li.is-moved-back { animation: ord-back .32s var(--ease); }
@keyframes ord-in { from { transform: translateY(calc(var(--dir, 0) * (100% + 8px))) scale(1.03); } }
@keyframes ord-back { from { transform: translateY(calc(var(--dir, 0) * -1 * (100% + 8px))); } }
.fx-order.is-solved .order-list li.is-right { animation: ord-ok .5s var(--ease) var(--d, 0ms) both; }
.fx-order.is-solved .order-list li.is-right::before { background: var(--ok-fill); color: #fff; }
@keyframes ord-ok { 0% { transform: scale(.96); box-shadow: 0 0 0 0 rgb(23 131 90 / 50%); } 60% { transform: scale(1.02); } 100% { box-shadow: 0 0 0 10px rgb(23 131 90 / 0%); } }
.fx-order .order-list li.is-wrong { animation: fx-shake .4s ease; }
.fx-order .order-list li.is-wrong::before { background: var(--danger-fill); color: #fff; }
@media (prefers-reduced-motion: reduce) { .fx-order .order-list li { animation: none !important; } }

/* ---------- 分頁按鈕（data-tabs） ---------- */
.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-row [data-tab], .tab-row [data-admin-tab] { font: inherit; font-weight: 800; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.tab-row [data-tab][aria-pressed="true"], .tab-row [data-admin-tab][aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }

/* ---------- 一步一步的安裝清單 ---------- */
.install-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: ist; }
.install-steps > li {
  counter-increment: ist; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-m);
  padding: 16px 18px 16px 64px; position: relative; box-shadow: var(--shadow);
}
.install-steps > li::before {
  content: counter(ist); position: absolute; left: 16px; top: 14px; width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-fill); color: #fff; display: grid; place-items: center; font-weight: 900;
}
.install-steps .step-title { display: block; font-size: 1.1rem; margin-bottom: .2em; }
.install-steps details { margin-top: 8px; }
.install-steps summary { cursor: pointer; font-weight: 700; color: var(--warn); }
.terminal {
  font-family: var(--mono); font-size: .9rem; background: #1b1a26; color: #e9e7f5; border-radius: var(--radius-s);
  padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; overflow-x: auto; margin: 8px 0;
}
.terminal code::before { content: "$ "; color: #86a8ff; }
.terminal .btn { flex: none; padding: 3px 10px; font-size: .75rem; background: #34314a; color: #fff; border-color: #34314a; }

/* ---------- 對照表（通用） ---------- */
.table-wrap { overflow-x: auto; }
[data-scroll-region]:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.compare { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare th, .compare td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-size: .82rem; color: var(--muted); }
.compare tbody th { font-weight: 800; white-space: nowrap; }
.compare .hl { background: var(--brand-soft); }

/* ---------- 講師作品牆 ---------- */
.wall { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.wall-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; box-shadow: var(--shadow); animation: pop var(--normal) var(--ease); }
.wall-item .when { font-size: .78rem; color: var(--muted); font-weight: 700; }
.wall-item h4 { margin: 4px 0; font-size: 1.02rem; }
.wall-item p { font-size: .88rem; margin: 0; color: var(--muted); }

/* ---------- 自評滑桿 ---------- */
/* ---------- 自評拉桿：每一格都是一個看得懂的程度 ---------- */
.meters { --meter-label: 10em; --meter-out: 9.5em; }
.meter-scale {
  display: flex; justify-content: space-between; margin: 0 var(--meter-out) 6px calc(var(--meter-label) + 12px);
  padding-inline: 4px; font-size: 1.05rem; opacity: .55;
}
.meter-row {
  display: grid; grid-template-columns: var(--meter-label) minmax(0, 1fr) var(--meter-out);
  gap: 12px; align-items: center; padding: 8px 10px; margin-inline: -10px; border-radius: var(--radius-m);
  transition: background var(--fast) var(--ease);
}
.meter-row:hover, .meter-row:focus-within { background: var(--brand-soft); }
.meter-row label { font-weight: 700; }

.meter-row input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; cursor: pointer;
}
/* 軌道：已拉到的部分從淡紫漸層到主色，一眼看出「長到哪裡了」 */
.meter-row input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, #b0c6ff, var(--brand)) 0 / var(--pct, 25%) 100% no-repeat, var(--paper-2);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 8%);
}
.meter-row input[type="range"]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--paper-2); }
.meter-row input[type="range"]::-moz-range-progress { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #b0c6ff, var(--brand)); }
.meter-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); box-shadow: 0 3px 8px rgb(29 35 39 / 35%);
  transition: transform var(--fast) var(--ease);
}
.meter-row input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand);
  box-shadow: 0 3px 8px rgb(29 35 39 / 35%);
}
.meter-row input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
.meter-row input[type="range"]:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 999px; }

.meter-out { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--brand-ink); }
.meter-emoji { font-size: 1.7rem; line-height: 1; display: inline-block; }
.meter-label { font-size: .9rem; line-height: 1.3; }
.meter-out.is-pop .meter-emoji { animation: meter-pop .38s var(--ease); }
@keyframes meter-pop { 0% { transform: scale(.6) rotate(-12deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .meter-out.is-pop .meter-emoji { animation: none; } }

/* 拉桿炫光：越往右顏色越熱（彩虹一路露出來），把手的光圈跟著變色，拉到滿格發金光、噴火花 */
.meter-row { position: relative; }
.meter-row[data-lv="1"] { --lv-c: #86a8ff; }
.meter-row[data-lv="2"] { --lv-c: #86a8ff; }
.meter-row[data-lv="3"] { --lv-c: #86a8ff; }
.meter-row[data-lv="4"] { --lv-c: #86a8ff; }
.meter-row[data-lv="5"] { --lv-c: #f59e0b; }
.meter-row input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, transparent var(--pct, 25%), var(--paper-2) var(--pct, 25%)),
    linear-gradient(90deg, #86a8ff, #86a8ff 25%, #86a8ff 50%, #86a8ff 75%, #fbbf24);
}
.meter-row input[type="range"]::-moz-range-progress { background: linear-gradient(90deg, #86a8ff, #86a8ff, #86a8ff, #86a8ff, #fbbf24); }
.meter-row input[type="range"]::-webkit-slider-thumb {
  border-color: var(--lv-c, var(--brand));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--lv-c, var(--brand)) 25%, transparent), 0 3px 10px color-mix(in srgb, var(--lv-c, var(--brand)) 50%, transparent);
  transition: transform var(--fast) var(--ease), border-color var(--fast), box-shadow var(--fast);
}
.meter-row input[type="range"]::-moz-range-thumb {
  border-color: var(--lv-c, var(--brand));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--lv-c, var(--brand)) 25%, transparent);
}
.meter-row input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }
.meter-row[data-lv="5"] .meter-emoji { filter: drop-shadow(0 0 8px rgb(251 191 36 / 80%)); animation: fx-flicker 1.4s ease-in-out infinite; }
.meter-row[data-lv="5"] .meter-out.is-pop .meter-emoji { animation: meter-pop .38s var(--ease), fx-flicker 1.4s .38s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .meter-row[data-lv="5"] .meter-emoji, .meter-row[data-lv="5"] .meter-out.is-pop .meter-emoji { animation: none; } }

@media (max-width: 560px) {
  .meter-scale { display: none; }
  .meter-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .meter-row label { grid-column: 1 / -1; }
}
@media print {
  .meter-row input[type="range"] { display: none; }
  .meter-row { grid-template-columns: 1fr auto; }
}

/* ---------- 產生器輸出 ---------- */
.gen-out { font-family: var(--mono); font-size: .86rem; white-space: pre-wrap; background: #1b1a26; color: #e9e7f5; border-radius: var(--radius-m); padding: 14px 16px; min-height: 8em; margin: 0; }
/* 產生器輸出炫光：像一個終端機視窗（左上三顆燈），產生新內容時掃過一道光，複製成功閃綠光 */
.gen-out {
  position: relative; padding-top: 38px; border: 1px solid #2c2a4d;
  background: radial-gradient(80% 60% at 100% 0%, rgb(31 79 191 / 18%), transparent 60%), #1b1a26;
  box-shadow: 0 18px 40px -24px rgb(29 35 39 / 70%); transition: box-shadow var(--normal), border-color var(--normal);
}
.gen-out::before {
  content: ""; position: absolute; top: 14px; left: 16px; width: 10px; height: 10px; border-radius: 50%;
  background: #ff5f57; box-shadow: 16px 0 #febc2e, 32px 0 #28c840;
}
.gen-out.is-new { border-color: #86a8ff; box-shadow: 0 0 0 3px rgb(134 168 255 / 25%), 0 18px 40px -20px rgb(134 168 255 / 90%); }
.gen-out.is-new::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgb(134 168 255 / 28%) 50%, transparent 100%) 0 -100% / 100% 50% no-repeat;
  animation: gen-scan .9s ease-out both;
}
@keyframes gen-scan { to { background-position: 0 200%; } }
.gen-out.is-copied { border-color: #34d399; box-shadow: 0 0 0 3px rgb(52 211 153 / 35%), 0 0 30px -6px rgb(52 211 153 / 80%); }
@media (prefers-reduced-motion: reduce) { .gen-out.is-new::after { animation: none; display: none; } }
@media print { .gen-out { padding-top: 14px; box-shadow: none; } .gen-out::before, .gen-out::after { display: none; } }
.form-grid { display: grid; gap: 12px; }
.form-grid label { font-weight: 700; font-size: .92rem; display: grid; gap: 4px; }

/* ---------- 課後任務勾選、講義題目 ---------- */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.checklist label > span, .checklist label { min-width: 0; overflow-wrap: anywhere; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--ok); flex: none; }
.checklist input:checked + * { color: var(--muted); }

/* 勾選清單炫光：上方進度條、勾下去時一圈光往外擴＋火花、文字畫上刪除線，全部完成灑彩帶 */
.ck-progress { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.ck-track { flex: 1; height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.ck-track i {
  position: relative; display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, #86a8ff, #34d399); transition: width .5s var(--ease);
}
.ck-track i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 55%) 50%, transparent 70%) 150% 0 / 250% 100% no-repeat;
  animation: fx-shine 2.4s ease-in-out infinite;
}
.ck-progress.is-all .ck-track i { background: linear-gradient(90deg, #34d399, #fbbf24, #86a8ff); box-shadow: 0 0 12px rgb(52 211 153 / 60%); }
.ck-count { font-weight: 800; font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ck-progress.is-all .ck-count { color: var(--ok); }
/* 安裝步驟清單（install-steps）也是勾選清單，但有自己的卡片外框和左側步驟數字，不能套這裡的留白 */
.checklist:not(.install-steps) li { position: relative; padding: 6px 10px; margin-inline: -10px; border-radius: var(--radius-m); transition: background var(--fast); }
.checklist:not(.install-steps) li:hover { background: var(--brand-soft); }
.checklist li.is-pop { animation: ck-pop .4s var(--ease); }
.checklist li.is-pop input { animation: ck-ring .6s ease-out; }
@keyframes ck-pop { 40% { transform: scale(1.02); } }
@keyframes ck-ring { from { box-shadow: 0 0 0 0 rgb(23 131 90 / 55%); } to { box-shadow: 0 0 0 14px rgb(23 131 90 / 0%); } }
.ck-line {
  background: linear-gradient(currentColor, currentColor) 0 62% / 0 2px no-repeat;
  transition: background-size .45s var(--ease), color var(--normal);
}
.checklist input:checked + .ck-text .ck-line { background-size: 100% 2px; }
@media (prefers-reduced-motion: reduce) {
  .ck-track i::after, .checklist li.is-pop, .checklist li.is-pop input { animation: none; }
  .ck-track i, .ck-line { transition: none; }
}

.print-q { margin-bottom: 10pt; break-inside: avoid; }
.print-q ol { margin: 4pt 0 0; padding-left: 1.4em; list-style: upper-alpha; }

/* ---------- 翻轉課程三階段 ---------- */
.phase { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 3px 12px; }
.phase-pre { background: var(--brand-soft); color: var(--brand); }
.phase-in { background: var(--teacher-soft); color: var(--teacher); }
.phase-post { background: var(--ok-soft); color: var(--ok); }
.ws-how { margin-bottom: 14px; display: grid; gap: 4px; }
.ws-how p { margin: 0; }
.ws-how b { display: inline-block; min-width: 7.5em; color: var(--teacher); }
.ws-how .muted { margin-top: 6px; font-size: .88rem; }

.workshop {
  border: 2px solid var(--teacher); border-radius: var(--radius-l); padding: clamp(18px, 3vw, 28px); background: var(--card);
}
.workshop ol { padding-left: 1.3em; }
.workshop li { margin-bottom: .4em; }
.workshop .time { font-weight: 800; color: var(--teacher); font-variant-numeric: tabular-nums; }

/* ---------- 講義（學習單）：螢幕上隱藏，列印時出現 ---------- */
.print-only { display: none; }
.blank { display: inline-block; min-width: 7em; border-bottom: 1.5px solid currentColor; }
.write-lines { height: 5.4em; background: repeating-linear-gradient(transparent 0 1.75em, var(--line) 1.75em calc(1.75em + 1px)); }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  .site-header, .module-nav, .site-footer, .timer, .slide-counter, .toast, .no-print, .screen-only { display: none !important; }
  .print-only { display: block !important; }
  :root { --paper: #fff; --card: #fff; --ink: #111; --muted: #444; --line: #bbb; color-scheme: light; }
  html { font-size: 11pt; }
  body { background: #fff; line-height: 1.6; }
  .teacher { display: none !important; }
  .slide { padding: 10pt 0; border-top: 1px solid #ccc; break-inside: avoid-page; min-height: 0 !important; }
  .module-hero { padding: 0 0 8pt; }
  .module-hero::before, .aurora { display: none !important; }
  .module-hero h1 { font-size: 22pt; }
  .card, .goals li, .step, .flip-face { box-shadow: none !important; }
  .step { opacity: 1 !important; }
  .flip { min-height: 0 !important; }
  .flip-inner { display: block !important; }
  .flip-inner { transform: none !important; }
  .flip-face { position: static !important; transform: none !important; backface-visibility: visible; margin-bottom: 6pt; }
  .flip-back { background: #f4f4f4 !important; color: #111 !important; }
  .flip-hint { display: none; }
  .code { background: #f4f4f4 !important; color: #111 !important; }
  .code-line .ln { color: #888; }
  a { color: inherit; text-decoration: none; }
  .term { text-decoration: none; }
  .term-pop { display: none !important; }
  .tour-backdrop, .tour-spot, .tour-pop { display: none !important; }
}

/* 證書上的驗證編號 */
.cert-verify { margin: 10px 0 0; font-size: .78rem; letter-spacing: .04em; color: #6b6880; text-align: center; }

/* ---------- 區段目錄（長頁面的錨點）---------- */
/* 貼在頁首下方，捲到哪一段就標哪一項，讓人隨時知道「我在哪、還有什麼」 */
.page-nav {
  position: sticky; top: 64px; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.page-nav .wrap { overflow-x: auto; scrollbar-width: none; }
.page-nav .wrap::-webkit-scrollbar { display: none; }
.page-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 7px 0; white-space: nowrap; }
.page-nav a {
  display: block; padding: 6px 13px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: .88rem; font-weight: 700; transition: all var(--fast) var(--ease);
}
.page-nav a:hover { color: var(--ink); background: var(--paper-2); }
.page-nav a.is-here { background: var(--brand-fill); color: #fff; }
.page-nav[hidden] { display: none; }
@media print { .page-nav { display: none; } }

/* 目前所在的頁面，導覽列上要看得出來 */
.header-tools .is-here { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 有目錄時，錨點跳轉不要被兩條固定列蓋住 */
:root:not(.presenting) body:has(.page-nav:not([hidden])) .slide[id] { scroll-margin-top: 118px; }
/* 投影時不需要區段目錄：投影機上多一條小字只是雜訊，換段用方向鍵 */
:root.presenting .page-nav { display: none; }

/* ---------- 手機：頁首不要一直蓋著內容 ---------- */
/* 實測 375px 寬時，頁首按鈕折成兩排（134px）再加區段目錄（52px），
   畫面有 23% 被固定列蓋住，學員課前多半用手機讀，這個代價太高。
   手機上頁首改成一排、可以左右滑，而且不跟著捲；只留細的區段目錄貼在最上面。 */
@media (max-width: 720px) {
  .site-header { position: static; }
  .site-header .wrap { flex-wrap: nowrap; min-height: 56px; gap: 10px; }
  .brand > span:last-child { white-space: nowrap; font-size: .92rem; }
  .header-tools {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: 0;
    padding-block: 6px; mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .header-tools::-webkit-scrollbar { display: none; }
  .header-tools > * { flex: 0 0 auto; }
  /* 手機上品牌名稱只留「第幾單元」那行，騰出位置，登入鈕才不會被擠出畫面；搶答是投影用的，收起來 */
  .brand > span:last-child { font-size: 0; }
  .brand > span:last-child small { font-size: .8rem; }
  .header-tools [data-auth-slot] { order: -1; }
  .header-tools [data-tour="quizshow"] { display: none; }
  .page-nav { top: 0; }
  :root:not(.presenting) body:has(.page-nav:not([hidden])) .slide[id] { scroll-margin-top: 64px; }
}

/* 上課前 vs 現在：用和拉桿同一組圖示，表格窄一點才不會被卡片裁掉 */
.growth-table { width: 100%; table-layout: auto; }
.growth-table th, .growth-table td { white-space: nowrap; padding-inline: 8px; }
.growth-table td:first-child { white-space: normal; }
.growth-stage { font-size: 1.45rem; line-height: 1; cursor: help; }

/* =====================================================================
   互動元件升級：測驗、分類卡（所有單元共用）
   ===================================================================== */

/* ---------- 共用：彩帶 ---------- */
.fx-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.fx-confetti i {
  position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px;
  animation-name: fx-fall; animation-timing-function: cubic-bezier(.3, .6, .5, 1); animation-fill-mode: forwards;
}
@keyframes fx-fall { to { transform: translateY(560px) rotate(var(--r, 360deg)); opacity: 0; } }

/* ---------- 共用：分數圓環 ---------- */
.fx-ring { position: relative; width: 150px; height: 150px; margin: 10px auto 6px; }
.fx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-ring circle { fill: none; stroke-width: 11; }
.fx-ring-bg { stroke: var(--paper-2); }
.fx-ring-fg {
  stroke: var(--brand); stroke-linecap: round;
  stroke-dasharray: var(--c); stroke-dashoffset: var(--c);
  animation: fx-ring 1s cubic-bezier(.2, .8, .2, 1) .1s forwards;
}
.fx-ring.is-pass .fx-ring-fg { stroke: var(--ok); }
.fx-ring.is-miss .fx-ring-fg { stroke: var(--warn); }
@keyframes fx-ring { to { stroke-dashoffset: var(--off); } }
.fx-ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fx-ring-num b { font: 900 2.7rem/1 "Inter", sans-serif; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.fx-ring-num small { color: var(--muted); font-weight: 700; font-size: .85rem; }

/* ---------- 測驗 ---------- */
.fx-quiz { position: relative; overflow: hidden; }
.fx-classify { position: relative; } /* 不裁切：卡片飛出去一點點是故意的，彩帶層自己會裁 */
.qz-bar { display: flex; gap: 5px; margin: 4px 0 16px; }
.qz-bar i { flex: 1; height: 7px; border-radius: 999px; background: var(--paper-2); transition: background var(--normal) var(--ease); }
.qz-bar i.now { background: linear-gradient(90deg, var(--brand), #86a8ff); animation: fx-glow 1.6s ease-in-out infinite; }
.qz-bar i.ok { background: var(--ok-fill); }
.qz-bar i.bad { background: var(--danger-fill); }
@keyframes fx-glow { 50% { box-shadow: 0 0 0 3px var(--brand-soft); } }

.qz-streak { font-weight: 900; color: #ea580c; font-size: .95rem; min-height: 1.2em; }
.qz-streak.is-pop { animation: fx-pop .45s var(--ease); }
@keyframes fx-pop { from { transform: scale(.4); opacity: 0; } }

.qz-card { animation: fx-slide .38s var(--ease) both; }
@keyframes fx-slide { from { opacity: 0; transform: translateX(24px); } }
.fx-quiz .quiz-q { font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem); font-weight: 800; line-height: 1.55; margin: 0 0 4px; }

.fx-quiz .option {
  position: relative; padding: 14px 16px; border-radius: var(--radius-m); background: var(--card);
  border: 1.5px solid var(--line); box-shadow: 0 1px 0 var(--line);
  transition: transform var(--fast) var(--ease), border-color var(--fast), box-shadow var(--fast), background var(--fast), opacity var(--fast);
}
.fx-quiz .option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 10px 22px -14px rgb(29 35 39 / 70%); }
.fx-quiz .option:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.fx-quiz .option .key { transition: transform var(--fast) var(--ease); }
.fx-quiz .option:hover:not(:disabled) .key { transform: scale(1.1); background: var(--brand-fill); color: #fff; }
.fx-quiz .option.is-right { animation: fx-right .5s var(--ease); box-shadow: 0 0 0 4px rgb(23 131 90 / 15%); }
.fx-quiz .option.is-right::after { content: "✓"; position: absolute; right: 16px; top: 50%; translate: 0 -50%; font-weight: 900; color: var(--ok); animation: fx-pop .4s .1s both; }
.fx-quiz .option.is-wrong { animation: fx-shake .4s ease; }
.fx-quiz .option.is-dim { opacity: .45; }
@keyframes fx-right { 40% { transform: scale(1.03); } }
@keyframes fx-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.qz-keys { margin: 4px 0 0; font-size: .8rem; }
@media (hover: none) { .qz-keys { display: none; } }

.qz-feedback { display: flex; gap: 12px; align-items: flex-start; animation: fx-slide .35s var(--ease) both; }
.qz-feedback p { margin: 4px 0 0; }
.qz-fb-icon { font-size: 1.6rem; line-height: 1; }
.qz-next { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.qz-next .muted { font-size: .82rem; }

.qz-result { text-align: center; animation: fx-slide .4s var(--ease) both; }
.qz-verdict { font-weight: 900; font-size: 1.15rem; margin: 0; }
.qz-verdict.ok { color: var(--ok); }
.qz-verdict.bad { color: var(--warn); }
.qz-recap { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.qz-recap span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; cursor: help; }
.qz-recap .ok { background: var(--ok-soft); color: var(--ok); }
.qz-recap .bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- 炫光層：測驗與分類卡共用 ----------
   本專案選擇走「炫」的路線（不套全域 300ms 上限），但底線照守：
   特效全是裝飾層（pointer-events: none），播放中照樣能點；「減少動態」全部關掉；列印不出現。 */
@property --fx-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes fx-spin { to { --fx-a: 360deg; } }

/* 外框流光：一圈彩色光沿著卡片邊緣繞。連對 3 題以上變成火焰色、繞得更快 */
.fx-quiz::before, .fx-classify::before, .fx-order::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 0;
  background: conic-gradient(from var(--fx-a), transparent 0 55%, #86a8ff 70%, #86a8ff 80%, #fbbf24 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .55; transition: opacity var(--normal);
  animation: fx-spin 5s linear infinite;
}
.fx-quiz:hover::before, .fx-quiz:focus-within::before,
.fx-classify:hover::before, .fx-classify:focus-within::before,
.fx-order:hover::before, .fx-order:focus-within::before { opacity: 1; }
.fx-quiz.fx-hot::before {
  opacity: 1; animation-duration: 1.6s;
  background: conic-gradient(from var(--fx-a), transparent 0 40%, #f97316 60%, #fbbf24 72%, #ef4444 84%, transparent 96%);
}
.fx-quiz.fx-hot { box-shadow: var(--shadow), 0 0 42px -14px #f97316; }
.fx-quiz.fx-hot .qz-streak { animation: fx-flicker .9s ease-in-out infinite; text-shadow: 0 0 12px rgb(249 115 22 / 55%); }
@keyframes fx-flicker { 50% { transform: scale(1.08) rotate(-2deg); } }

/* 答對／答錯：整張卡閃一下光 */
.fx-quiz::after, .fx-classify::after, .fx-order::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; z-index: 0;
}
.fx-hit-ok::after { box-shadow: inset 0 0 0 3px var(--ok), inset 0 0 60px -10px var(--ok); animation: fx-hit .7s ease-out; }
.fx-hit-bad::after { box-shadow: inset 0 0 0 3px var(--danger), inset 0 0 60px -10px var(--danger); animation: fx-hit .5s ease-out; }
@keyframes fx-hit { 0% { opacity: 0; } 20% { opacity: .9; } 100% { opacity: 0; } }

/* 火花 */
.fx-sparks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 21; border-radius: inherit; }
.fx-sparks i {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 10px currentColor; animation: fx-spark .75s cubic-bezier(.15, .8, .3, 1) forwards;
}
.fx-sparks i:nth-child(3n) { width: 5px; height: 12px; border-radius: 3px; }
@keyframes fx-spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* 選項：游標所在的位置亮起一圈光 */
.fx-quiz .option:hover:not(:disabled), .fx-classify .cl-choice:hover:not(:disabled) {
  background-image: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgb(134 168 255 / 22%), transparent 65%);
}
/* 答對的選項：一道光從左掃到右 */
.fx-quiz .option.is-right, .fx-classify .cl-choice.is-right {
  background-image: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 70%) 50%, transparent 65%);
  background-size: 250% 100%; background-repeat: no-repeat; background-position: 150% 0;
  animation: fx-right .5s var(--ease), fx-shine .9s .1s ease-out both;
}
@keyframes fx-shine { to { background-position: -60% 0; } }

/* 進度條：剛答完的那一格從左邊長出來 */
.fx-quiz .qz-bar i.just { transform-origin: left; animation: fx-grow .45s var(--ease); }
.fx-quiz .qz-bar i.ok.just { box-shadow: 0 0 12px var(--ok); }
@keyframes fx-grow { from { transform: scaleX(0); } }

/* 成績：過關的圓環發光，全對再加一座獎盃 */
.qz-result.is-pass .fx-ring svg { filter: drop-shadow(0 0 10px rgb(23 131 90 / 45%)); }
.qz-result.is-perfect .fx-ring::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from var(--fx-a), #86a8ff, #86a8ff, #fbbf24, #34d399, #86a8ff);
  -webkit-mask: radial-gradient(closest-side, transparent 84%, #000 86%, #000 99%, transparent);
  mask: radial-gradient(closest-side, transparent 84%, #000 86%, #000 99%, transparent);
  animation: fx-spin 3s linear infinite; opacity: .8;
}
.fx-trophy { font-size: 3rem; line-height: 1; margin-top: 4px; animation: fx-trophy .8s var(--ease) .5s both; filter: drop-shadow(0 6px 14px rgb(251 191 36 / 55%)); }
@keyframes fx-trophy { from { transform: translateY(24px) scale(.3) rotate(-25deg); opacity: 0; } }
.qz-result .qz-recap span { animation: fx-pop .4s var(--ease) calc(var(--d, 0ms) + .3s) both; }

/* 分類卡：卡片跟著游標傾斜，加一道反光 */
.fx-classify .cl-stack { transition: transform .2s ease-out; transform-style: preserve-3d; }
.fx-classify .cl-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--normal);
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / 55%), transparent 55%);
}
.fx-classify .cl-card:hover::after { opacity: 1; }
/* 答完蓋一個印章：對 / 錯 */
.fx-classify .cl-card.is-right::before, .fx-classify .cl-card.is-wrong::before {
  /* 貼在卡片上緣（半露在外框上），手機上卡片窄，放在裡面會壓到題目的字 */
  position: absolute; top: -16px; right: 14px; z-index: 2; background: var(--card); padding: 2px 10px; border: 3px solid; border-radius: 10px;
  font: 900 .95rem/1.4 var(--font); rotate: 12deg; animation: fx-stamp .4s var(--ease) .15s both;
}
.fx-classify .cl-card.is-right::before { content: "✓ 正確"; color: var(--ok); }
.fx-classify .cl-card.is-wrong::before { content: "✗ 再想想"; color: var(--danger); }
@keyframes fx-stamp { from { transform: scale(2.4); opacity: 0; } }
.fx-classify .cl-score { position: relative; }
.fx-plus { position: absolute; right: -6px; top: -4px; font: 900 .95rem "Inter", sans-serif; color: var(--ok); pointer-events: none; animation: fx-rise .9s ease-out forwards; }
@keyframes fx-rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-26px); opacity: 0; } }

/* 內容要浮在流光外框之上 */
.fx-order { position: relative; }
.fx-quiz > *, .fx-classify > *, .fx-order > * { position: relative; z-index: 1; }
.fx-quiz > .fx-confetti, .fx-classify > .fx-confetti, .fx-order > .fx-confetti,
.fx-quiz > .fx-sparks, .fx-classify > .fx-sparks, .fx-order > .fx-sparks { position: absolute; z-index: 20; }

@media (prefers-reduced-motion: reduce) {
  .fx-quiz::before, .fx-classify::before, .fx-order::before, .fx-quiz.fx-hot .qz-streak, .fx-quiz .qz-bar i.just, .fx-quiz .option.is-right,
  .fx-classify .cl-choice.is-right, .qz-result.is-perfect .fx-ring::before, .fx-trophy, .qz-result .qz-recap span,
  .fx-classify .cl-card::before, .fx-plus { animation: none !important; }
  .fx-quiz .option.is-right, .fx-classify .cl-choice.is-right { background-image: none; }
  .fx-classify .cl-stack { transform: none !important; }
  .fx-plus, .fx-sparks { display: none; }
}
@media print {
  .fx-quiz::before, .fx-quiz::after, .fx-classify::before, .fx-classify::after, .fx-order::before, .fx-order::after,
  .fx-sparks, .fx-trophy { display: none; }
}

/* ---------- 分類卡 ---------- */
.cl-score { font-weight: 800; color: var(--muted); }
.cl-score b { color: var(--ok); font-size: 1.15rem; }
.cl-score.is-pop b { display: inline-block; animation: fx-pop .45s var(--ease); }

.cl-stage { perspective: 900px; padding: 8px 0 26px; } /* 下方多留一點：卡片飛出去時微微旋轉，寬卡片的角才不會壓到選項 */
.cl-stack { position: relative; }
/* 後面露出下一張、下下張，看得出「還有幾張」 */
.cl-stack[data-left="2"]::before, .cl-stack[data-left="3"]::before,
.cl-stack[data-left="3"]::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 92%; height: 100%; translate: -50% 0;
  border-radius: var(--radius-l); background: var(--card); border: 1.5px solid var(--line); z-index: 0;
}
.cl-stack[data-left="3"]::after { bottom: -16px; width: 84%; opacity: .6; }
.cl-card {
  position: relative; z-index: 1; margin: 0; min-height: 120px; display: grid; place-content: center; text-align: center;
  padding: 26px 28px; border-radius: var(--radius-l); background: linear-gradient(160deg, var(--card), var(--brand-soft));
  border: 1.5px solid #d8dbfb; box-shadow: 0 18px 40px -22px rgb(29 35 39 / 55%);
  font-size: clamp(1.08rem, 1rem + .45vw, 1.28rem); font-weight: 800; line-height: 1.6;
  animation: fx-deal .45s var(--ease) both;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1), border-color var(--fast), background var(--fast);
}
.cl-no { position: absolute; top: 12px; left: 16px; font: 800 .78rem "Inter", sans-serif; color: var(--muted); }
@keyframes fx-deal { from { opacity: 0; transform: translateY(18px) rotate(-2deg) scale(.96); } }
.cl-card.is-flying { transform: translateX(var(--fly, 0)) rotate(calc(var(--fly, 0px) / 26px * 1deg)) scale(.98); }
.cl-card.is-right { border-color: var(--ok); background: linear-gradient(160deg, var(--card), var(--ok-soft)); }
.cl-card.is-wrong { border-color: var(--danger); background: linear-gradient(160deg, var(--card), var(--danger-soft)); }

.cl-choices { display: grid; gap: 12px; }
.cl-n2 { grid-template-columns: 1fr 1fr; }
.cl-n3 { grid-template-columns: repeat(3, 1fr); }
.cl-n4 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .cl-n3, .cl-n4 { grid-template-columns: 1fr; } }
.cl-choice {
  display: flex; align-items: center; gap: 10px; justify-content: center; text-align: left;
  font: inherit; font-weight: 800; font-size: 1rem; padding: 16px 18px; cursor: pointer;
  border-radius: var(--radius-m); background: var(--card); color: var(--ink); border: 2px solid var(--line);
  transition: transform var(--fast) var(--ease), border-color var(--fast), box-shadow var(--fast), background var(--fast), opacity var(--fast);
}
.cl-choice:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 12px 24px -14px rgb(29 35 39 / 70%); }
.cl-choice:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.cl-key { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--paper-2); font: 800 .85rem "Inter", sans-serif; }
.cl-choice.is-right { border-color: var(--ok); background: var(--ok-soft); }
.cl-choice.is-right .cl-key { background: var(--ok-fill); color: #fff; }
.cl-choice.is-wrong { border-color: var(--danger); background: var(--danger-soft); animation: fx-shake .4s ease; }
.cl-choice.is-wrong .cl-key { background: var(--danger-fill); color: #fff; }
.cl-choice.is-dim { opacity: .45; }
.cl-choice:disabled { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .qz-card, .qz-feedback, .qz-result, .qz-streak.is-pop, .qz-bar i.now, .fx-quiz .option.is-right, .fx-quiz .option.is-wrong,
  .fx-quiz .option.is-right::after, .cl-card, .cl-score.is-pop b, .cl-choice.is-wrong, .fx-ring-fg { animation: none !important; }
  .fx-ring-fg { stroke-dashoffset: var(--off); }
  .cl-card.is-flying { transform: none; }
  .fx-confetti { display: none; }
}
@media print { .fx-confetti, .qz-keys { display: none; } }


/* ==========================================================================
   可以按的 vs. 只能看的：全站統一的樣子
   - 可以按：白板上的磁鐵（白底、鋁色邊、軟影子）；滑過浮起一點、按下去壓進板面，游標是手指
   - 只能看：平的。沒有按鍵厚度、沒有膠囊外框，滑過不會動、不會發光
   新增互動元件時，把 class 加進下面這串就好（scripts/check_affordance.js 會抓漏網的）
   ========================================================================== */
:root {
  /* 磁鐵的邊與面：可以按的東西都長這樣 */
  --op-line: var(--line-strong);
  --op-edge: var(--line-strong);
  --op-bg: var(--card);
}
:root :is(.option, .cl-choice, .chip, .nw-pick, .tab-row [data-tab], .tab-row [data-admin-tab], .su-cohort,
  .toggle-list label, .checklist:not(.install-steps) li > label, .map-jump a, .show-learn a, a.review-item) {
  border: 1.5px solid var(--op-line); background: var(--op-bg); color: var(--ink);
  box-shadow: var(--magnet); cursor: pointer;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast), border-color var(--fast), background var(--fast);
}
:root :is(.option, .cl-choice, .chip, .nw-pick, .tab-row [data-tab], .tab-row [data-admin-tab], .su-cohort,
  .toggle-list label, .checklist:not(.install-steps) li > label, .map-jump a, .show-learn a, a.review-item):hover:not(:disabled) {
  border-color: var(--brand); box-shadow: var(--magnet-up); transform: translateY(-1px);
}
/* 按下去：磁鐵壓進板面 */
:root :is(.option, .cl-choice, .chip, .nw-pick, .tab-row [data-tab], .tab-row [data-admin-tab], .su-cohort,
  .toggle-list label, .checklist:not(.install-steps) li > label, .map-jump a, .show-learn a, a.review-item):active:not(:disabled) {
  transform: translateY(1px); box-shadow: var(--magnet-down);
}
:root :is(.option, .cl-choice, .chip, .nw-pick, .tab-row [data-tab], .tab-row [data-admin-tab], .su-cohort, .flip, .code-line, .term):focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}
/* 選中（分頁、篩選標籤）：藍色磁鐵，壓在板上 */
:root :is(.chip, .tab-row [data-tab], .tab-row [data-admin-tab])[aria-pressed="true"] {
  background: var(--brand-fill); color: #fff; border-color: var(--brand-fill); box-shadow: var(--magnet-down); transform: translateY(1px);
}
/* 答完了就不能再按：從磁鐵變成寫在板上的字，平的 */
:root :is(.option, .cl-choice):disabled { box-shadow: none; transform: none; cursor: default; background: transparent; border-color: var(--line); }
:root :is(.option, .cl-choice).is-right { border-color: var(--ok); background: var(--ok-soft); }
:root :is(.option, .cl-choice).is-wrong { border-color: var(--danger); background: var(--danger-soft); }
:root .su-cohort.is-closed { box-shadow: none; cursor: not-allowed; transform: none; }
:root .option:hover:not(:disabled) { transform: translateY(-1px); } /* 原本往右滑，跟其他按鈕不一致 */

/* 一般按鈕：白色磁條；主要按鈕：藍色磁條 */
:root .btn { border-radius: var(--radius-m); }
:root .btn:not(:disabled) { box-shadow: var(--magnet); }
:root .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger) { border-color: var(--op-line); }
:root .btn:hover:not(:disabled) { box-shadow: var(--magnet-up); }
:root .btn:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--magnet-down); }

/* 勾選清單：整列都是可以按的，勾完變綠、壓下去 */
:root .checklist:not(.install-steps) li { padding: 0; margin-inline: 0; }
:root .checklist:not(.install-steps) li:hover { background: none; }
:root .checklist:not(.install-steps) li > label { padding: 10px 14px; border-radius: var(--radius-m); align-items: center; }
:root .checklist input { width: 22px; height: 22px; margin-top: 0; accent-color: var(--brand-fill); }
:root .checklist:not(.install-steps) li > label:has(input:checked) {
  background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); box-shadow: none; transform: translateY(2px);
}
:root .checklist:not(.install-steps) li > label:has(input:checked) input { accent-color: var(--ok-fill); }

/* 翻牌卡：正面就是一顆大按鈕，右下角一直寫著「點我翻面」 */
:root .flip-front { border: 1.5px solid var(--op-line); background: var(--op-bg); box-shadow: var(--magnet); }
:root .flip:hover .flip-front { border-color: var(--brand); box-shadow: var(--magnet-up); }
:root .flip:hover .flip-back, :root .flip:focus-visible .flip-face { box-shadow: var(--shadow); }
:root .flip-inner, :root .flip.is-flipped .flip-inner { transition: transform var(--normal) var(--ease); }
:root .flip-inner { transform: none; }
:root .flip.is-flipped .flip-inner { transform: rotateY(180deg); }
:root .flip-face::after, :root .flip-front::before, :root .flip-back::before { display: none; }
:root .flip-hint {
  bottom: 12px; right: 12px; padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800;
  background: var(--brand-fill); color: #fff;
}
:root .flip-back .flip-hint { background: rgb(255 255 255 / 16%); color: var(--invert-ink); }

/* 可以點的程式碼：每一行左邊有一條淡紫線，上面寫著可以點 */
:root .code.is-clickable { position: relative; padding-top: 40px; }
:root .code.is-clickable::before {
  content: "👆 每一行都可以點：點你覺得有問題的那一行"; position: absolute; top: 12px; left: 16px;
  font: 800 .8rem var(--font); color: #c7c3ff;
}
:root .code.is-clickable .code-line { border-left-color: rgb(139 133 255 / 40%); }
:root .code.is-clickable .code-line:hover { background: rgb(139 133 255 / 20%); border-left-color: #86a8ff; }

/* 拉桿：粗一點的軌道、大顆的把手 */
:root input[type="range"]:not(.meter-row input) { -webkit-appearance: none; appearance: none; height: 34px; background: transparent; cursor: grab; }
:root input[type="range"]:not(.meter-row input):active { cursor: grabbing; }
:root input[type="range"]:not(.meter-row input)::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: var(--paper-2); border: 1.5px solid var(--op-line); }
:root input[type="range"]:not(.meter-row input)::-moz-range-track { height: 10px; border-radius: 999px; background: var(--paper-2); border: 1.5px solid var(--op-line); }
:root input[type="range"]:not(.meter-row input)::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10.5px; border-radius: 50%;
  background: var(--brand-fill); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--brand-fill), 0 3px 6px rgb(29 35 39 / 30%);
}
:root input[type="range"]:not(.meter-row input)::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand-fill); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--brand-fill);
}
:root input[type="range"]:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* 展開／收合 */
summary { cursor: pointer; }
summary::marker { color: var(--brand); }

/* ---------- 只能看的：拿掉「像按鈕」的外觀 ---------- */
/* 標籤（.pill）和課前／課中／課後（.phase）原本是膠囊形狀，跟可以按的標籤長得一樣。改成「● 文字」 */
:root .pill, :root .phase { background: none; border: 0; border-radius: 0; padding: 0; }
:root .pill::before, :root .phase::before { content: "●"; font-size: .7em; margin-right: .35em; vertical-align: .12em; }
:root .flip-back .pill { color: color-mix(in srgb, var(--invert-ink) 85%, transparent); }
/* 學習目標：只是清單，不是可以勾的格子 */
:root .goals li { box-shadow: none; }
:root .goals li::before { background: none; width: auto; height: auto; font-size: 1rem; top: 13px; }
/* 整塊測驗、分類遊戲、排序遊戲的外框流光：外框本身不能按，滑過不再發亮（連對時的火焰保留，那是回饋） */
:root :is(.fx-quiz, .fx-classify, .fx-order):not(.fx-hot)::before { display: none; }
/* 分類題目卡不能按：拿掉跟著游標的反光 */
:root .fx-classify .cl-card::after { display: none; }

/* 教學示意圖：裡面的按鈕都是畫出來的，右上角標明「示意圖．不能按」 */
.shot { position: relative; }
.shot, .shot * { cursor: default; }
.shot::after {
  content: "示意圖．不能按"; position: absolute; top: 6px; right: 8px; font-size: .7rem; font-weight: 800; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line); border-radius: 4px; padding: 1px 6px; pointer-events: none;
}
.shot-bar span { margin-right: 96px; }

@media (prefers-reduced-motion: reduce) {
  :root :is(.option, .cl-choice, .chip, .nw-pick, .tab-row [data-tab], .tab-row [data-admin-tab], .su-cohort,
    .toggle-list label, .checklist:not(.install-steps) li > label, .map-jump a, .show-learn a, a.review-item) { transition: none; transform: none !important; }
  :root .flip-inner, :root .flip.is-flipped .flip-inner { transition: none; }
}
@media print {
  :root :is(.option, .cl-choice, .chip, .checklist li > label, .flip-front) { box-shadow: none; background: none; }
  .shot::after, :root .code.is-clickable::before { display: none; }
}
/* 分類遊戲的題目卡只是題目，不能按：用一般卡片的樣子，跟下面可以按的選項分開 */
:root .fx-classify .cl-card:not(.is-right):not(.is-wrong) { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
/* 單元編號只是標示，不是按鈕 */
:root .module-hero .eyebrow b { background: none; color: var(--brand); padding: 0; font-size: 1.15rem; }
:root input[type="checkbox"], :root input[type="radio"] { cursor: pointer; }

/* ---------- 頁首：永遠一排、矮一點，往下捲時不要切掉一大塊內容 ---------- */
/* 原本工具按鈕折成兩排，加上講師模式的橫幅，桌機上頁首高達 180px，捲動時把內容切得很難看 */
.site-header .wrap { width: min(1440px, 100% - 32px); flex-wrap: nowrap; min-height: 58px; }
.brand { flex: none; }
.header-tools { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; gap: 4px; }
.header-tools::-webkit-scrollbar { display: none; }
.header-tools > * { flex: 0 0 auto; }
/* 頁首是導覽列：按鈕做成輕的樣子（沒有按鍵厚度），滑過有底色、游標是手指 */
:root .site-header .btn { box-shadow: none; border-color: transparent; background: transparent; padding: 6px 9px; transform: none; }
/* 「？ 教學」固定在最右邊，不跟著其他按鈕被擠出畫面 */
.site-header .btn-help { flex: none; }
:root .site-header .btn:hover { background: var(--brand-soft); border-color: transparent; }
:root .site-header .btn-help { border-color: var(--brand); }
:root .site-header .is-here { background: var(--brand-soft); color: var(--brand); }
.site-header { box-shadow: 0 8px 18px -16px rgb(28 27 41 / 45%); }
.teacher-banner { padding: 3px 12px; font-size: .78rem; }
html { scroll-padding-top: 76px; }
.header-tools.is-overflowing { mask-image: linear-gradient(90deg, #000 90%, transparent); padding-right: 24px; }

/* ==========================================================================
   會議室白板（2026-09 改版）
   講師站在白板前把一件事講清楚：黑筆寫大字、紅筆圈重點、藍筆拉引線、綠筆打勾。
   - 墨色只有四支白板筆＋便利貼黃（講師模式的紫筆除外）；不用漸層、彩虹、發光
   - 寫在板上的字是平的；貼上去的紙有膠帶；可以按的是磁鐵（見上面「可以按的」）
   - 手寫字（--hand）只給標題、編號、標註；內文一律印刷體，長輩才讀得清楚
   上面舊的「炫光層」（彩虹外框、發光、掃光）在這裡被關掉，待清理
   ========================================================================== */

/* ---------- 頁首：白板下緣的筆槽（平的鋁色面＋一道實心的槽邊） ---------- */
:root .site-header {
  background: color-mix(in srgb, var(--paper-2) 94%, transparent);
  border-bottom: 4px solid var(--line-strong);
  box-shadow: 0 8px 16px -14px rgb(29 35 39 / 45%);
}
:root .brand { font-weight: 800; }
/* 課名前面的 V：一顆藍色圓磁鐵 */
:root .brand-mark {
  border-radius: 50%; background: var(--brand-fill);
  font-family: var(--hand); font-size: 1.2rem; box-shadow: var(--magnet);
}
:root .progress-bar { height: 4px; }
:root .progress-bar span { background: var(--brand); border-radius: 0 4px 4px 0; }
:root .teacher-banner { background: var(--teacher); }

/* ---------- 字：標題是講師的手寫，內文是印刷體 ---------- */
:root h1, :root h2 { font-family: var(--hand-text); font-weight: 700; letter-spacing: 0; }
:root h2 { font-size: clamp(1.6rem, 1.2rem + 1.7vw, 2.4rem); line-height: 1.3; }
:root h3, :root .h3 { font-weight: 800; }
:root .lead { color: var(--muted); }
::selection { background: color-mix(in srgb, var(--sticky) 75%, transparent); color: var(--ink); }
:root { caret-color: var(--brand); accent-color: var(--brand); }
:root a { text-underline-offset: .2em; text-decoration-thickness: 1.5px; }

/* ---------- 單元開頭：寫在白板正中間的那一段 ---------- */
:root .module-hero::before { display: none; }
/* 左上角的單元編號：像講師先在板角寫下今天第幾堂 */
:root .module-hero .eyebrow {
  font-family: var(--hand-text); color: var(--muted); font-size: 1.05rem; letter-spacing: 0; text-transform: none; font-weight: 700;
}
:root .module-hero .eyebrow b {
  font-family: var(--hand); font-size: 2rem; line-height: 1; color: var(--ink);
  border-bottom: 3px solid var(--ink); border-radius: 0; padding: 0 4px 2px;
}
:root .module-hero h1 { font-size: var(--text-hero); line-height: 1.38; margin: .3em 0 .4em; max-width: 14em; }
/* 重點：黑字，紅筆手繪圈起來 */
:root .module-hero h1 em { color: inherit; }
:root .module-hero h1 em { padding-inline: .14em; margin-inline: .1em .04em; }
/* 紅筆手畫的圈：開口、收尾多畫一截，像真的用白板筆圈起來；左右留白，筆畫不會壓到字 */
:root .module-hero h1 em::after {
  inset: -.04em -.26em -.08em -.34em; height: auto; z-index: -1; border: 0; border-radius: 0; background: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M22 12 C70 2 150 3 186 14 C199 20 197 42 170 51 C120 61 50 59 18 48 C2 42 3 20 30 11 C48 6 70 5 92 6' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M22 12 C70 2 150 3 186 14 C199 20 197 42 170 51 C120 61 50 59 18 48 C2 42 3 20 30 11 C48 6 70 5 92 6' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transform: rotate(-1.2deg);
}
:root .module-hero h1 em:nth-of-type(2)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M176 10 C130 2 60 3 20 13 C3 19 4 42 30 50 C80 60 150 59 182 47 C198 40 197 18 168 10 C150 6 128 5 104 6' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M176 10 C130 2 60 3 20 13 C3 19 4 42 30 50 C80 60 150 59 182 47 C198 40 197 18 168 10 C150 6 128 5 104 6' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); transform: rotate(.8deg);
}
:root .module-hero .lead { font-size: clamp(1.1rem, 1.02rem + .4vw, 1.32rem); max-width: 38em; line-height: 1.85; }

/* 學習目標：三張用紙膠帶貼在板上的便利貼（只能看，不能按：平貼、滑過不動） */
:root .goals-label { font-family: var(--hand-text); color: var(--ink); font-size: 1.25rem; letter-spacing: 0; margin-top: 8px; }
:root .goals { gap: 22px 18px; margin-top: 14px; }
:root .goals li {
  background: var(--sticky); color: var(--sticky-ink); border: 0; border-radius: 2px 2px 3px 14px / 2px 2px 3px 6px;
  padding: 22px 18px 18px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 1px 1px rgb(29 35 39 / 10%), 0 12px 16px -12px rgb(29 35 39 / 40%);
  transform: rotate(-.8deg);
}
:root .goals li:nth-child(2) { transform: rotate(.6deg); }
:root .goals li:nth-child(3) { transform: rotate(-.3deg); }
:root .goals li::before {
  content: ""; left: 50%; top: -9px; width: 56px; height: 18px; translate: -50% 0; rotate: -3deg;
  border-radius: 1px; background: var(--tape); font-size: 0;
}
/* 課前／課中／課後：寫在板角的藍筆小字 */
:root .meta-row { font-family: var(--hand-text); font-size: 1rem; gap: 6px 20px; }
:root .phase { font-weight: 700; font-size: 1rem; }
:root .phase::before { content: "—"; font-size: 1em; vertical-align: 0; margin-right: .3em; }
:root .phase-pre { color: var(--brand); }
:root .phase-in { color: var(--ink); }
:root .phase-post { color: var(--ok); }

/* ---------- 段落標題：藍筆圈起來的編號，旁邊是標題，下面一行小字標註 ---------- */
:root .slide { border-top: 0; position: relative; }
:root .slide + .slide::before {
  /* 段落之間：擦過白板留下的一道淡痕，不是一條硬線 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}
:root .section-head { align-items: flex-start; gap: 18px; }
:root .section-head .section-num { margin-top: .1em; }
:root .section-head > div { display: flex; flex-direction: column; }
:root .section-head h2 { margin-bottom: .15em; }
/* 原本在標題上面的小標籤，改成寫在標題底下的藍筆註記 */
:root .section-head .kicker {
  order: 1; font-family: var(--hand-text); font-size: 1.05rem; letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--brand);
}
:root .section-head > div > p { order: 2; margin-top: .35em; }
:root .section-num {
  flex: none; display: grid; place-items: center; width: 2.1em; height: 2.1em;
  font-family: var(--hand); font-size: 1.6rem; font-weight: 700; color: var(--brand); -webkit-text-stroke: 0;
  border: 2.5px solid var(--brand); border-radius: 46% 54% 52% 48% / 54% 46% 55% 45%; transform: rotate(-4deg);
}
:root .kicker { font-family: var(--hand-text); letter-spacing: 0; text-transform: none; font-size: 1.05rem; }

/* ---------- 紙：用紙膠帶貼在板上的 A4 ---------- */
:root .card {
  position: relative; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 1px 1px rgb(29 35 39 / 6%), 0 14px 26px -18px rgb(29 35 39 / 40%);
}
/* 紙膠帶只貼在「真的是一張紙」的東西上：工作坊講義、首頁的報名頁截圖、便利貼。一般卡片不貼，免得膠帶變壁紙 */
:root .ws-how.card::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 72px; height: 20px; translate: -50% 0; rotate: 2deg;
  background: var(--tape); border-radius: 1px; pointer-events: none;
}

/* ---------- 打個比方：藍筆框起來 ---------- */
:root .analogy {
  position: relative; border: 2px solid var(--brand); border-radius: var(--hand-box); background: transparent;
  padding: 18px 22px; margin: 18px 0; font-weight: 500;
}
:root .analogy strong { color: var(--brand); font-family: var(--hand-text); font-size: 1.12em; }
/* 提醒框：紅筆（危險）、綠筆（可以）、便利貼黃（注意），一樣是手畫的框 */
:root .callout { border-width: 2px; border-radius: var(--hand-box); }
:root .callout-danger { border-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
:root .callout-ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 60%, transparent); }
:root .callout-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--sticky)); background: var(--warn-soft); }
/* 講師筆記：紫筆虛線框 */
:root .teacher-note { border: 2px dashed var(--teacher); border-radius: var(--hand-box); background: var(--teacher-soft); }
:root .teacher-note > b:first-child { font-family: var(--hand-text); font-size: 1.1rem; }

/* 標籤：寫在板上的小字，用筆的顏色 */
:root .pill { font-weight: 800; }
:root .pill-warn { color: var(--warn); }

/* ---------- 測驗：答對綠筆打勾、答錯紅筆劃掉 ---------- */
:root :is(.fx-quiz, .fx-classify, .fx-order)::before { display: none !important; }
:root .fx-quiz.fx-hot { box-shadow: 0 1px 1px rgb(29 35 39 / 6%), 0 14px 26px -18px rgb(29 35 39 / 40%); }
:root .fx-quiz.fx-hot .qz-streak { text-shadow: none; }
:root .qz-streak { color: var(--danger); font-family: var(--hand-text); font-size: 1.1rem; }
:root .qz-bar i { border-radius: 2px; height: 6px; }
:root .qz-bar i.now { background: var(--brand); animation: none; }
:root .fx-quiz .quiz-q { font-family: var(--font); }
:root .fx-quiz .option, :root .fx-classify .cl-choice { background-image: none !important; }
:root .fx-quiz .option:hover:not(:disabled) .key { background: var(--brand-fill); color: #fff; transform: none; }
:root .option .key, :root .cl-key { border-radius: 50%; font-family: var(--hand); font-size: 1rem; background: var(--paper-2); }
:root .fx-quiz .option.is-right { box-shadow: none; animation: none; }
:root .fx-quiz .option.is-right::after {
  content: ""; right: 14px; width: 30px; height: 26px; background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26'%3E%3Cpath d='M3 14 L11 22 L27 3' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26'%3E%3Cpath d='M3 14 L11 22 L27 3' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: wb-draw .26s ease-out both;
}
:root .option.is-wrong .opt-text, :root .cl-choice.is-wrong {
  background-image: linear-gradient(var(--danger), var(--danger)); background-repeat: no-repeat;
  background-position: 0 58%; background-size: 100% 2.5px;
}
:root .option.is-wrong .opt-text { animation: wb-strike .24s ease-out both; }
:root .fx-quiz .option.is-wrong, :root .cl-choice.is-wrong { animation: none; }
@keyframes wb-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wb-strike { from { background-size: 0 2.5px; } }
:root .fx-hit-ok::after, :root .fx-hit-bad::after { animation: none; }
:root .fx-sparks { display: none; }
:root .fx-trophy { filter: none; }
:root .qz-result.is-pass .fx-ring svg { filter: none; }
:root .qz-result.is-perfect .fx-ring::before { display: none; }

/* 分類卡：題目是貼在板上的一張紙，不是發光卡片 */
:root .cl-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 1px 1px rgb(29 35 39 / 6%), 0 14px 26px -18px rgb(29 35 39 / 40%);
}
:root .cl-card.is-right { background: var(--ok-soft); }
:root .cl-card.is-wrong { background: var(--danger-soft); }
:root .fx-classify .cl-card.is-right::before, :root .fx-classify .cl-card.is-wrong::before {
  font-family: var(--hand); border-width: 2.5px; border-radius: var(--hand-box); background: var(--card);
}
:root .cl-stack[data-left]::before, :root .cl-stack[data-left]::after { border-radius: 3px; }

/* ---------- 其他舊的彩色特效，改回白板筆色 ---------- */
:root .steps .step:not(:last-child)::after { background: var(--brand); }
:root .step::before, :root .order-list li::before { font-family: var(--hand); }
:root .install-steps > li::before { border-radius: 50%; font-family: var(--hand); box-shadow: var(--magnet); }
:root .meter-row input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--brand) var(--pct, 25%), var(--paper-2) var(--pct, 25%));
}
:root .meter-row input[type="range"]::-moz-range-progress { background: var(--brand); }
:root .meter-row[data-lv] { --lv-c: var(--brand); }
:root .meter-row[data-lv="5"] { --lv-c: var(--ok-fill); }
:root .meter-row[data-lv="5"] .meter-emoji { filter: none; animation: none; }
:root .meter-row[data-lv="5"] .meter-label { background: none; color: var(--ok); }
:root .ck-track i { background: var(--ok-fill); }
:root .ck-track i::after { display: none; }
:root .ck-progress.is-all .ck-track i { background: var(--ok-fill); box-shadow: none; }
:root .gen-out { background: #1b2226; border-color: #2c363c; box-shadow: var(--shadow); }
:root .gen-out.is-new { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
:root .gen-out.is-new::after { display: none; }
:root .gen-out.is-copied { border-color: var(--ok-fill); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-fill) 35%, transparent); }
:root :is(.code, .terminal, textarea.code-input) { background: #1b2226; }
:root .terminal code::before { color: #86a8ff; }
:root .code.is-clickable .code-line { border-left-color: rgb(134 168 255 / 40%); }
:root .code.is-clickable .code-line:hover { background: rgb(134 168 255 / 16%); border-left-color: #86a8ff; }
:root .code.is-clickable::before { color: #b0c6ff; }
:root .fx-reveal-on .analogy[data-reveal].is-in::after { display: none; }
:root .flip-back { background: var(--invert-bg); }
:root .flip-hint { border-radius: var(--radius-m); }
:root .toast { border-radius: var(--radius-m); }
:root .tour-spot { border-radius: 8px; }
:root .term { text-decoration-color: color-mix(in srgb, var(--brand) 70%, transparent); }

/* 手機：板子小，圈圈和便利貼收斂一點 */
@media (max-width: 640px) {
  :root .section-num { font-size: 1.25rem; }
  :root .goals li, :root .goals li:nth-child(n) { transform: none; }
  :root .analogy { padding: 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  :root .fx-quiz .option.is-right::after, :root .option.is-wrong .opt-text { animation: none; }
}
@media print {
  :root .card::before, :root .goals li::before { display: none; }
  :root .goals li { background: none; border: 1.5px solid #999; box-shadow: none; transform: none; }
  :root .site-header { background: none; }
}

/* 課中工作坊：黑筆手畫的框（學員也看得到，所以不用講師紫） */
:root .workshop { border: 2px solid var(--ink); border-radius: var(--hand-box); background: transparent; }
:root .workshop .time { color: var(--ink); font-family: var(--hand-text); }
:root .ws-how { border-left-width: 1px; border-left-color: color-mix(in srgb, var(--line) 70%, transparent); }
:root .ws-how b { color: var(--brand); }

/* ---------- 審查修正：拿掉剩下的紅綠燈；頁首圖示 ---------- */
:root .gen-out::before { display: none; }
:root .gen-out { padding-top: 14px; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
:root .site-header .btn { gap: 6px; }
/* 標題像粗的白板筆：文楷最粗只到 700，再描一圈同色細邊讓筆畫變粗 */
:root h1 { -webkit-text-stroke: .022em currentColor; paint-order: stroke fill; }
:root h2 { -webkit-text-stroke: .012em currentColor; paint-order: stroke fill; }

/* 審查排序第 3 項：工作坊的三個欄位用線條圖示（原本是 emoji，各系統長得不一樣） */
:root .ws-how p > b:first-child { display: inline-flex; align-items: center; gap: 6px; }
:root .ws-how p > b:first-child::before { content: ""; width: 1.15em; height: 1.15em; flex: none; background: currentColor; -webkit-mask: var(--ws-ico) center / contain no-repeat; mask: var(--ws-ico) center / contain no-repeat; }
:root .ws-how p:nth-of-type(1) > b:first-child { --ws-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 5a3 3 0 0 1 0 6M21 20c0-2.8-1.8-5.2-4.3-5.8'/%3E%3C/svg%3E"); }
:root .ws-how p:nth-of-type(2) > b:first-child { --ws-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='7' width='16' height='13' rx='2'/%3E%3Cpath d='M9 7V5a3 3 0 0 1 6 0v2M4 12h16'/%3E%3C/svg%3E"); }
:root .ws-how p:nth-of-type(3) > b:first-child { --ws-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='18' height='4'/%3E%3Cpath d='M5 12v9h14v-9M12 8v13M12 8c-2-4-6-4-6-1s6 1 6 1c2-4 6-4 6-1s-6 1-6 1'/%3E%3C/svg%3E"); }
:root .must-read b .ico { margin-right: 4px; }
:root .lp-icon .ico, :root .lp-tool .lp-icon .ico { width: 1em; height: 1em; color: var(--brand); }
:root .lp-path--security .lp-icon .ico { color: var(--warn); }

/* 審查排序第 5 項：一排同樣大小的卡片，改成「一張用膠帶貼在板上的紙，用筆畫線分成幾欄」
   只看得懂的內容卡才這樣做（直接子元素是 .card 的 .grid-3）；手機上自動變成上下分段 */
:root .slide .grid-3:has(> .card) {
  gap: 0; position: relative; background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 3px; box-shadow: 0 1px 1px rgb(29 35 39 / 6%), 0 14px 26px -18px rgb(29 35 39 / 40%);
}

:root .slide .grid-3 > .card { background: transparent; border: 0; border-radius: 0; box-shadow: -1.5px 0 0 var(--line), 0 -1.5px 0 var(--line); }
:root .slide .grid-3 > .card::before { display: none; }
@media print { :root .slide .grid-3:has(> .card)::before { display: none; } }

/* ---------- 審查排序第 4 項：段落小標只留「這段要做什麼」，統一成圖示＋一行字 ----------
   玩（藍）、課中（黑）、延伸（綠）、測驗（綠）、真實案例（紅）。純裝飾的小標已從單元裡刪掉 */
:root .section-head .kicker.mode { display: inline-flex; align-items: center; gap: 6px; font-size: 1.05rem; }
:root .section-head .kicker.mode::before {
  content: ""; width: 1.15em; height: 1.15em; flex: none; background: currentColor;
  -webkit-mask: var(--mode-ico) center / contain no-repeat; mask: var(--mode-ico) center / contain no-repeat;
}
:root .kicker.mode-play { --mode-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13V5.5a1.5 1.5 0 0 1 3 0V12M11 11.5v-2a1.5 1.5 0 0 1 3 0V12M14 10.5a1.5 1.5 0 0 1 3 0V12M17 11.5a1.5 1.5 0 0 1 3 0V15a6 6 0 0 1-6 6h-2a6 6 0 0 1-5-2.7L4.3 14.5a1.5 1.5 0 0 1 2.4-1.8L8 14'/%3E%3C/svg%3E"); color: var(--brand); }
:root .kicker.mode-class { --mode-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 5a3 3 0 0 1 0 6M21 20c0-2.8-1.8-5.2-4.3-5.8'/%3E%3C/svg%3E"); color: var(--ink); }
:root .kicker.mode-extra { --mode-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); color: var(--ok); }
:root .kicker.mode-quiz { --mode-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cpath d='M8 12.5l3 3 5-6'/%3E%3C/svg%3E"); color: var(--ok); }
:root .kicker.mode-case { --mode-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3L2 20h20z'/%3E%3Cpath d='M12 10v4M12 17.5v.01'/%3E%3C/svg%3E"); color: var(--danger); }

/* ---------- 聯絡表單（contact.js：聯絡表單、作品投稿、意見回饋） ---------- */
.ct-form { display: grid; gap: 14px; margin-top: 12px; }
.ct-form input, .ct-form select, .ct-form textarea { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: var(--radius-s); border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.ct-form input:focus, .ct-form select:focus, .ct-form textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.ct-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.ct-note { font-size: .85rem; margin: 0; }
/* 機器人陷阱欄位：移到畫面外，真人看不到（不用 display:none，有些機器人會跳過隱藏欄位） */
.ct-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ct-form .su-done, .su-done { padding: 20px 22px; border-radius: var(--radius-m); background: var(--ok-soft); }
.su-done b { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.fb-stars { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.fb-stars legend { font-weight: 700; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.fb-stars label { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; cursor: pointer; }
.fb-stars input { width: 20px; height: 20px; accent-color: var(--brand-fill); }

/* 單元 03「講師的三個鍵」：畫成鍵盤上的鍵帽（只在這一段，其他地方的 kbd 維持原樣） */
#three-keys kbd { display: inline-block; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; background: var(--card); color: var(--ink); font-weight: 700; line-height: 1.5; white-space: nowrap; }
.key-caps { font-size: 1.3rem; margin: 0 0 6px; }
.key-caps kbd { padding: 4px 12px; }

/* ---------- 評分修正（2026-10）：全站共用 ---------- */
/* 「用這一課的題目玩課堂搶答」是講師用的，學員模式不顯示 */
:root:not([data-mode="teacher"]) .quizshow-link { display: none; }
/* 勾選框、單選鈕太小不好按 */
:root input[type="checkbox"], :root input[type="radio"] { min-width: 20px; min-height: 20px; }

/* ---------- 評分修正（2026-10，第二輪） ---------- */
/* 標題上面的空間要比下面多：段落之間分得開，標題跟它的內容黏在一起 */
:root .slide { padding-top: calc(var(--space-section) * .8); }
:root .section-head { margin-bottom: 18px; }
/* 單元裡的「試一下」小互動：跟著上面的說明，不另開一段 */
:root .try-it { margin-top: 28px; }
:root .try-it h3 { font-family: var(--hand-text); font-size: 1.3rem; margin-bottom: .2em; }

/* 投影模式：給後排看的白板，不是給講師點的網站
   頁首只留一條細的單元名稱（工具列、進度條收起來，Esc 離開投影）；內容加寬；互動元件放大 */
:root.presenting .site-header .header-tools, :root.presenting .site-header .btn-help, :root.presenting .progress-bar { display: none; }
:root.presenting .site-header .wrap { min-height: 44px; }
:root.presenting .site-header .brand-mark { width: 26px; height: 26px; font-size: .9rem; }
:root.presenting .slide { scroll-margin-top: 52px; }
:root.presenting main.wrap { width: min(1480px, 100% - 64px); }
:root.presenting :is(.agency-scale, .gate-tool, .chip, .gate-actions .btn) { font-size: 1rem; }

/* ---------- 評分修正（2026-10，第三輪）：全站共用元件 ---------- */
/* 工作坊時間表：時間和內容分開，手機上時間自成一行，講師在後排也指得到「現在第幾段」 */
:root .workshop .time { display: inline-block; min-width: 5.5em; margin-right: .6em; }
@media (max-width: 640px) { :root .workshop .time { display: block; margin-right: 0; } }
/* 內容區裡可以按的東西至少 44px 高（手機手指按得到） */
:root main :is(.chip, .btn-sm, .tab-row [data-tab]) { min-height: 44px; }
:root main details > summary { min-height: 44px; display: list-item; padding-block: 10px; } /* list-item 保留展開三角形；flex 會把它吃掉 */
:root .gate-tool summary { display: list-item; padding-block: 10px; min-height: 0; }

/* ---------- 手機點擊目標至少 44px（頁首按鈕、區段目錄、跳轉連結、頁尾連結） ---------- */
@media (max-width: 720px) {
  :root .site-header .btn, :root .map-jump a { min-height: 44px; }
  :root .page-nav a { min-height: 44px; display: flex; align-items: center; }
  .page-nav ul { padding-block: 4px; }
  .site-footer a { padding-block: 12px; }
  .brand { min-height: 44px; }
  .fb-stars label { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
}
