/*
  AI 101 · 設計方向（2026-09 版）
  ------------------------------------------------------------
  定位：給香港中小學老師的自學課程。語氣沉穩、像一本排版認真的教材，
  不像範本網站。只做淺色版（規格 §3）。

  色彩
  - 米白底 #FBFAF7，白色只用於「可操作或需要閱讀的面板」（卡片、表格、提示詞）。
  - 墨色 #1B1F29／次要 #525866；分隔線 #E6E2DA；表單邊框 #8C887F（>= 3:1）。
  - 每頁只有一個主色（--accent），主頁及提示詞庫用暖橙，課堂頁跟隨該課顏色。
    淺色 --accent 只作色塊或大字；文字、按鈕一律用深色 --accent-deep（白字 >= 4.5:1）。
  - 四課色只在「路線圖」「課程卡」「品牌標誌」同時出現，代表整個課程。

  字體：Noto Sans TC（400/500/700/900），不加第二套字體；層次靠字重與字級。
  字級：13 · 14 · 15 · 17（內文）· 19 · 22 · 28 · 36–60（標題用 clamp）
  行高：內文 1.8，標題 1.25–1.3。
  間距：4 · 8 · 12 · 16 · 20 · 24 · 32 · 48 · 64 · 96（--s-*）

  形狀：面板 10px 圓角；按鈕、輸入欄、標籤 8px／6px。不用膠囊形。
  陰影：只在可點擊卡片 hover 時出現一層帶暖色的淡陰影。
  動態：只有 hover／focus 回饋（transform／opacity），遵守 prefers-reduced-motion。

  元件
  - 頁首：四色方格標誌＋名稱；導覽以「編號＋字」表示四課，目前頁以淺底深字標示。
  - 課堂頁：主色深底標題帶＋課程位置；桌面版左側黏性「本課步驟」導覽（app.js 由 h2 生成）；
    步驟不再是方框，而是以分隔線、留白及大號步驟編號分段。
  - 自我檢查 .check：主色淺底面板＋圓形勾號，是全站最易辨認的「檢查點」。
  - 提示詞：面板＋標題列（左：標籤，右：複製按鈕）；卡片內以「完整指令」列作標題列。
*/

:root {
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --sunk: #F4F2ED;
  --ink: #1B1F29;
  --ink-2: #525866;
  --line: #E6E2DA;
  --line-strong: #D3CEC4;
  --field: #8C887F;
  --home: #ea7a2b;
  --home-deep: #a34d10;
  --l1: #2F6FDE;
  --l2: #1E9E76;
  --l3: #D6456A;
  --l4: #8A4FD8;
  --accent: var(--home);
  --accent-deep: var(--home-deep);
  --accent-soft: #FDF1E7;
  --accent-line: #F2CDB0;
  --warn-bg: #FFF6E6;
  --warn-line: #EBC98D;
  --warn-ink: #7A4B00;
  --radius: 10px;
  --radius-sm: 8px;
  --wrap: 72rem;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-12: 48px; --s-16: 64px; --s-24: 96px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
body[data-lesson="1"] { --accent: var(--l1); --accent-deep: #1F55B8; --accent-soft: #EEF3FD; --accent-line: #BFD2F5; }
body[data-lesson="2"] { --accent: var(--l2); --accent-deep: #167A5B; --accent-soft: #EBF7F2; --accent-line: #B5E0CF; }
body[data-lesson="3"] { --accent: var(--l3); --accent-deep: #B0314F; --accent-soft: #FCEEF2; --accent-line: #F2C1CE; }
body[data-lesson="4"] { --accent: var(--l4); --accent-deep: #6D38B5; --accent-soft: #F4EEFC; --accent-line: #D8C5F3; }

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img, iframe { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: .01em; }
/* 中文標題只在標點、空格處換行 */
h1, h2 { word-break: keep-all; line-break: strict; text-wrap: balance; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 2px; border-radius: 4px; }
strong { font-weight: 700; }
[id] { scroll-margin-top: var(--s-6); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-6); }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 16px; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm); z-index: 20; box-shadow: 0 0 0 1px var(--line); }

/* ---------- 頁首 ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 900; font-size: 17px; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 24px; height: 24px; flex: none; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.site-nav a:hover { background: var(--sunk); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.nav-n { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.nav-l1 .nav-n { color: #1F55B8; }
.nav-l2 .nav-n { color: #167A5B; }
.nav-l3 .nav-n { color: #B0314F; }
.nav-l4 .nav-n { color: #6D38B5; }
.nav-lib { margin-left: 6px; }
.nav-lib::before { content: ""; width: 1px; height: 18px; background: var(--line); margin: 0 12px 0 -12px; }
@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 0; padding-top: 8px; padding-bottom: 4px; }
  .site-nav { justify-content: space-between; margin: 0 -8px; }
  .site-nav a { padding: 0 8px; }
  .nav-lib { margin-left: 0; }
  .nav-lib::before { display: none; }
}

/* ---------- 主頁：開頭 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.home-hero { padding: var(--s-12) 0 var(--s-16); }
.home-hero-inner { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: var(--s-12); align-items: start; }
.home-hero-text { padding-top: var(--s-4); }
.eyebrow { margin: 0 0 var(--s-4); color: var(--ink-2); font-size: 15px; font-weight: 500; letter-spacing: .06em; }
.home-hero h1 { margin: 0 0 var(--s-3); font-size: clamp(44px, 6vw, 72px); font-weight: 900; line-height: 1.05; letter-spacing: -.01em; }
.home-hero .hero-sub { margin: 0 0 var(--s-5); font-size: clamp(19px, 2vw, 23px); font-weight: 700; color: var(--accent-deep); }
.home-hero .lead { margin: 0; max-width: 34em; font-size: 18px; line-height: 1.85; color: var(--ink); }
.home-hero .audience-note { margin: var(--s-5) 0 0; max-width: 38em; padding: 12px 16px; font-size: 15px; line-height: 1.8; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hero-cta { margin: var(--s-6) 0 0; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--radius-sm);
  background: var(--home-deep); color: #fff; font-size: 16px; font-weight: 700; text-decoration: none;
  transition: filter .15s var(--ease), transform .1s var(--ease);
}
.btn-primary::after { content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h9M8.5 4.5 12 8l-3.5 3.5' fill='none' stroke='black' stroke-width='1.8' 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 16 16'%3E%3Cpath d='M3 8h9M8.5 4.5 12 8l-3.5 3.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.btn-primary:hover { filter: brightness(.92); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }
@media (max-width: 1023px) {
  .home-hero-inner { grid-template-columns: 1fr; gap: var(--s-8); }
  .home-hero-text { padding-top: 0; }
  .demo { max-width: 720px; }
}
@media (max-width: 760px) {
  .home-hero { padding: var(--s-8) 0 var(--s-12); }
  .home-hero .lead { font-size: 17px; }
}

/* ---------- 主頁：示意動畫 ----------
   視窗是通用的聊天／應用程式外框（不是 Google 介面的複製品），標題列只放原樣縮小的官方標誌。
   動畫只作用於周邊介面及結果；標誌本身不加任何動畫或效果。
   沒有 JS 或選了「減少動態效果」時，.scene 不會加上 .is-live，直接顯示每段的完成畫面。 */
.demo { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; container-type: inline-size; }
.demo-stage { order: 1; position: relative; container-type: inline-size; }
.demo-tabs { order: 2; display: grid; grid-template-columns: auto auto auto auto; gap: 6px; }
@container (max-width: 560px) { .demo-tabs { grid-template-columns: 1fr 1fr; } }
.demo-controls { order: 3; margin: 0; display: flex; justify-content: flex-end; }
.demo-tabs [role="tab"] {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13.5px; white-space: nowrap; font-weight: 700; line-height: 1.3; cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
.demo-tabs [role="tab"]:hover { border-color: var(--c-deep); color: var(--ink); }
.demo-tabs [role="tab"][aria-selected="true"] { border-color: var(--c-deep); color: var(--c-deep); box-shadow: inset 0 0 0 1px var(--c-deep); }
.demo-tabs [role="tab"]:focus-visible { outline-color: var(--c-deep); }
.tab-n { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--c-deep); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.tab-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--c); transform-origin: left; transform: scaleX(var(--p, 0)); }
[aria-selected="false"] > .tab-progress { display: none; }
.demo-pause {
  min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.demo-pause:hover { color: var(--ink); }
.scene:focus-visible { outline-offset: 4px; }
.demo-cap { margin: var(--s-3) 0 0; min-height: 3.5em; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.demo-cap a { display: table; font-weight: 700; color: var(--c-deep, var(--accent-deep)); }

/* 視窗 */
.win {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 16 / 11; overflow: hidden;
  font-size: clamp(10px, 2.25cqw, 14.5px); line-height: 1.6; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 1px 0 rgba(60, 45, 20, .04), 0 24px 48px -28px rgba(60, 45, 20, .35);
}
@container (max-width: 520px) { .win { aspect-ratio: 1 / 1; font-size: clamp(10.5px, 3cqw, 13px); } }
.win p { margin: 0; }
.win img { display: inline-block; vertical-align: middle; object-fit: contain; }
.win-bar { flex: none; display: flex; align-items: center; gap: .6em; height: 2.9em; padding: 0 1em; background: #FAF9F6; border-bottom: 1px solid var(--line); }
.win-bar img { width: 1.35em; height: 1.35em; }
.win-name { font-weight: 700; font-size: .95em; }
.win-tag { margin-left: auto; padding: .05em .55em; border: 1px solid var(--line-strong); border-radius: 6px; font-size: .78em; color: var(--ink-2); }
.win-body { position: relative; flex: 1; min-height: 0; padding: 1em; overflow: hidden; }
.pane { position: relative; min-width: 0; min-height: 0; padding: .8em; background: #FCFBF8; border: 1px solid var(--line); border-radius: .7em; overflow: hidden; }
.pane-h { display: flex; align-items: center; gap: .4em; margin-bottom: .5em !important; font-size: .8em; font-weight: 700; color: var(--ink-2); }
.pane-h img { width: 1.2em; height: 1.2em; }
.sk { display: block; height: .55em; margin: .5em 0; border-radius: 1em; background: #ECE9E2; }
.sk.short { width: 55%; } .sk.mid { width: 75%; }
.win table { width: 100%; border-collapse: collapse; font-size: .84em; line-height: 1.45; }
.win th, .win td { padding: .38em .6em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; word-break: normal; font-weight: 400; color: var(--ink); }
.win th { background: var(--sunk); font-size: 1em; letter-spacing: 0; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

/* 輸入欄 */
.composer {
  position: absolute; left: 1em; right: 1em; bottom: 1em; min-height: 3em; padding: .65em 3.2em .65em 1.1em;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 1.5em; font-size: .92em; line-height: 1.55;
}
.composer-text:empty { display: none; }
.composer-text:not(:empty) + .composer-ph { display: none; }
.composer-text:not(:empty)::after { content: ""; display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -.15em; background: var(--ink); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.composer-ph { color: #6B6F7A; }
.send {
  position: absolute; right: .45em; bottom: .45em; width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--ink);
  transition: transform .15s var(--ease), background-color .15s var(--ease);
}
.send::before { content: ""; position: absolute; inset: 0; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 15V5M5.5 9.5 10 5l4.5 4.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 60% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 15V5M5.5 9.5 10 5l4.5 4.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 60% no-repeat; }

/* 1 用 */
.use-body .chat { display: flex; flex-direction: column; gap: .8em; padding-bottom: 4.4em; }
.bubble { align-self: flex-end; max-width: 82%; padding: .65em 1em; border-radius: 1.2em 1.2em .35em 1.2em; background: #EEF3FD; font-size: .92em; line-height: 1.6; }
.reply-line { display: flex; align-items: center; gap: .5em; margin-bottom: .5em !important; font-weight: 700; font-size: .92em; }
.reply-line img { width: 1.15em; height: 1.15em; }
@container (max-width: 520px) { .win .col-t { display: none; } }

/* 2 讀 */
.nb-body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: .8em; }
.nb-add { display: inline-block; margin-bottom: .6em !important; padding: .25em .7em; border: 1px dashed var(--line-strong); border-radius: 2em; font-size: .8em; color: var(--ink-2); }
.nb-file { display: flex; align-items: center; gap: .55em; padding: .5em .6em; background: var(--surface); border: 1px solid var(--line); border-radius: .5em; font-size: .85em; font-weight: 500; box-shadow: 0 6px 14px -10px rgba(40, 40, 40, .4); }
.pdf { flex: none; padding: .05em .35em; border-radius: .25em; background: #C5221F; color: #fff; font-size: .7em; font-weight: 700; letter-spacing: .04em; }
.nb-summary { margin-top: 1em; }
.nb-actions { display: flex; flex-wrap: wrap; gap: .4em; margin-bottom: .8em; }
.chip { padding: .25em .8em; border: 1px solid var(--line-strong); border-radius: 2em; font-size: .8em; background: var(--surface); transition: transform .15s var(--ease); }
.chip-main { border-color: #B5E0CF; background: #EBF7F2; color: #167A5B; font-weight: 700; }
.nb-report { padding: .7em; border: 1px solid var(--line); border-radius: .6em; background: var(--surface); }
.nb-report-h { display: flex; align-items: baseline; gap: .5em; margin-bottom: .6em !important; font-weight: 700; }
.nb-report-h small { font-size: .75em; font-weight: 500; color: #167A5B; }
.nb-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .5em; }
.tile { display: flex; align-items: center; gap: .5em; padding: .5em; border: 1px solid var(--line); border-radius: .5em; font-size: .82em; font-weight: 500; }
.ic { flex: none; position: relative; width: 1.9em; height: 1.9em; border-radius: .4em; background: #EBF7F2; }
.ic::before, .ic::after { content: ""; position: absolute; background: #1E9E76; border-radius: 1em; }
.ic-map::before { width: .45em; height: .45em; left: .72em; top: .72em; box-shadow: -.5em -.45em 0 -.08em #1E9E76, .5em -.45em 0 -.08em #1E9E76, 0 .55em 0 -.08em #1E9E76; }
.ic-card::before { left: .45em; top: .5em; width: 1em; height: .9em; border-radius: .15em; background: none; border: .12em solid #1E9E76; }
.ic-info::before { left: .45em; bottom: .45em; width: .25em; height: .6em; box-shadow: .38em -.3em 0 0 #1E9E76, .76em -.15em 0 0 #1E9E76; border-radius: .1em; }
.ic-quiz::before { left: .5em; top: .55em; width: .9em; height: .15em; box-shadow: 0 .35em 0 0 #1E9E76, 0 .7em 0 0 #1E9E76; }

/* 3 造 */
.cv-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: .8em; }
.cv-chat { display: flex; flex-direction: column; padding-bottom: 4.6em; }
.cv-chat .bubble { max-width: 100%; }
.cv-chat .composer { left: .6em; right: .6em; bottom: .6em; }
.cv-preview { display: flex; flex-direction: column; }
.cv-code { position: absolute; left: .8em; right: .8em; top: 2.4em; }
.scene:not(.is-live) .cv-code, .cv-code.is-gone { display: none; }
.cv-title { display: flex; justify-content: space-between; align-items: baseline; gap: .5em; margin-bottom: .7em !important; font-weight: 900; font-size: 1.05em; color: #B0314F; }
.cv-score { font-size: .78em; font-weight: 500; color: var(--ink-2); }
.cv-score b { color: var(--ink); }
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45em; }
.card { display: flex; align-items: center; justify-content: center; min-height: 2.5em; border: 2px solid #E6E3DC; border-radius: .55em; background: var(--surface); font-weight: 700; transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .15s var(--ease); }
.card.is-sel { border-color: #B0314F; background: #FCEEF2; }
.scene:not(.is-live) .card.is-ok, .card.is-ok.is-on { border-color: #167A5B; background: #E6F6F0; color: #167A5B; }

/* 4 連 */
.as-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .8em; }
.as-id { display: flex; gap: 1em; margin-bottom: .6em !important; font-size: .85em; color: var(--ink-2); }
.as-id b { color: var(--ink); }
.as-q { margin-bottom: .5em !important; font-weight: 700; font-size: .92em; }
.as-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .35em; margin-bottom: .7em; }
.as-opts span { padding: .3em .6em; border: 1px solid var(--line-strong); border-radius: .4em; font-size: .85em; background: var(--surface); transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.scene:not(.is-live) .as-opts .is-pick, .as-opts .is-pick.is-on { border-color: #6D38B5; background: #F4EEFC; color: #6D38B5; font-weight: 700; }
.as-foot { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; }
.btn { display: inline-block; padding: .35em 1.1em; border-radius: .4em; background: #6D38B5; color: #fff; font-size: .85em; font-weight: 700; transition: transform .15s var(--ease); }
.as-score { font-weight: 700; font-size: .9em; }
.as-sheet { padding: .6em .6em 0; background: var(--surface); }
.win .sheet { font-size: .78em; font-variant-numeric: tabular-nums; }
.win .sheet th, .win .sheet td { padding: .3em .45em; border: 1px solid #E1E1E1; }
.win .sheet tr:first-child th { background: #F1F3F4; color: #3C4043; }
.win .sheet th:first-child, .win .sheet tr > th { width: 1.8em; background: #F1F3F4; color: #5F6368; text-align: center; font-weight: 500; }
.win .sheet tr.is-new td { background: #E6F4EA; font-weight: 700; }
.sheet-tabs { display: flex; gap: .3em; margin-top: .6em !important; font-size: .75em; color: var(--ink-2); }
.sheet-tabs span { padding: .2em .7em; border-radius: .3em .3em 0 0; }
.sheet-tabs .is-active { background: #E6F4EA; color: #137333; font-weight: 700; }
@container (max-width: 520px) {
  .nb-body, .cv-body, .as-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .cv-chat { padding-bottom: 4.4em; }
  .nb-summary { display: none; }
}

/* 動畫狀態（只在 .is-live 時隱藏未出現的部分） */
.demo-cursor { position: absolute; left: 0; top: 0; z-index: 2; width: 22px; height: 22px; pointer-events: none; opacity: 0; transform: translate(60%, 60%); transition: transform .75s cubic-bezier(.3, .7, .2, 1), opacity .3s var(--ease); }
.demo.is-playing .demo-cursor.is-shown { opacity: 1; }
.demo-cursor.is-click { transition: transform .12s var(--ease); }
.is-press { transform: scale(.94); }
.scene.is-live [data-step], .scene.is-live [data-row] { opacity: 0; transform: translateY(.5em); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.scene.is-live [data-step].is-in, .scene.is-live [data-row].is-in { opacity: 1; transform: none; }
.scene.is-live .nb-file[data-step] { transform: translate(35%, -160%) rotate(4deg); transition: opacity .3s var(--ease), transform .8s cubic-bezier(.2, .8, .2, 1.1); }
.scene.is-live .nb-file.is-in { transform: none; }
.scene.is-live .cv-game[data-step] { transform: none; }
.scene.is-live .sheet tr[data-step] { transform: translateY(-.6em); }
.scene.is-live .sheet tr[data-step].is-in { transform: none; }
.scene.is-live .sheet tr[data-step].is-in td { animation: rowflash 1.6s var(--ease); }
@keyframes rowflash { 0% { background: #CEEAD6; } 100% { background: #E6F4EA; } }
.scene:not(.is-live) .composer-text { display: none; }
@media (prefers-reduced-motion: reduce) { .demo-cursor { display: none; } .composer-text::after { animation: none; } }

/* ---------- 主頁：工具列 ---------- */
.tool-strip { padding: var(--s-6) 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-inner { display: flex; align-items: center; gap: var(--s-4) var(--s-12); flex-wrap: wrap; }
.tool-strip h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; }
.tool-list { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-8); margin: 0; padding: 0; list-style: none; }
.tool-list li { display: flex; align-items: center; gap: 10px; }
.tool-list img { height: 24px; width: auto; }
.tool-list img[alt="Google"] { height: 20px; }
.tool-list span { display: flex; flex-direction: column; font-size: 15px; font-weight: 700; line-height: 1.3; }
.tool-list small { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 760px) { .tool-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); } }

/* ---------- 主頁：區段 ---------- */
.home-section { padding: var(--s-16) 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: var(--s-8); }
.section-head h2 { margin: 0; font-size: 28px; font-weight: 700; }
.section-head .time { margin: var(--s-2) 0 0; color: var(--ink-2); font-size: 16px; }
.before-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.before-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-6) var(--s-8) var(--s-8); }
.before-col h3 { margin: 0 0 var(--s-4); font-size: 19px; }
.checklist, .rules { list-style: none; margin: 0; padding: 0; counter-reset: item; }
.checklist li, .rules li { counter-increment: item; position: relative; padding-left: 44px; }
.checklist li { padding-top: 6px; padding-bottom: 6px; }
.checklist li::before {
  content: counter(item); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--accent-line); color: var(--accent-deep); background: var(--accent-soft);
  font-size: 14px; font-weight: 700; line-height: 25px; text-align: center;
}
.rules li { padding-top: var(--s-3); padding-bottom: var(--s-3); border-top: 1px solid var(--line); }
.rules li:first-child { border-top: 0; padding-top: 0; }
.rules li::before {
  content: counter(item, decimal-leading-zero); position: absolute; left: 0; top: var(--s-3);
  color: var(--accent-deep); font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.8;
}
.rules li:first-child::before { top: 0; }
.before-col .check { margin-bottom: 0; }
@media (max-width: 860px) {
  .home-section { padding: var(--s-12) 0; }
  .before-grid { grid-template-columns: 1fr; }
  .before-col { padding: var(--s-5) var(--s-5) var(--s-6); }
}

.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.lesson-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 200px;
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: var(--radius);
  padding: var(--s-6) var(--s-8) var(--s-6); color: var(--ink); text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -12px rgba(60, 45, 20, .22); border-color: var(--c); }
.lesson-card .num { position: relative; color: var(--c-deep); font-weight: 700; font-size: 15px; }
.lesson-card h3 { position: relative; margin: var(--s-1) 0 var(--s-3); font-size: 24px; font-weight: 700; }
.lc-meta { position: relative; margin: 0; display: flex; flex-direction: column; color: var(--ink-2); font-size: 15px; line-height: 1.7; max-width: 80%; }
.lc-time { color: var(--ink); font-weight: 500; }
.lc-sep { display: none; }
.lc-glyph { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 112px; font-weight: 900; line-height: 1; color: var(--c-soft); pointer-events: none; }
.lc-go { position: relative; margin-top: auto; align-self: flex-start; width: 22px; height: 22px; color: var(--c-deep); transition: transform .2s var(--ease); }
.lesson-card:hover .lc-go { transform: translateX(4px); }
.library-note {
  margin: var(--s-6) 0 0; padding: var(--s-4) var(--s-6); border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink);
}
.library-note a { font-weight: 700; }
@media (max-width: 760px) {
  .lesson-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .lesson-card { padding: var(--s-5); min-height: 0; }
  .lesson-card h3 { font-size: 21px; }
  .lc-go { margin-top: var(--s-4); }
}
@media (max-width: 1000px) {
  .lc-glyph { font-size: 72px; top: 16px; right: 16px; transform: none; }
  .lesson-card .num, .lesson-card h3 { padding-right: 76px; }
}

/* ---------- 課堂頁：標題帶 ---------- */
.lesson-hero { background: var(--accent-deep); color: #fff; padding: var(--s-12) 0 var(--s-12); }
.lesson-hero-inner { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-6); }
.lesson-hero-text { width: min(100%, 48rem); }
.lesson-hero .num { margin: 0 0 var(--s-2); font-weight: 700; font-size: 15px; letter-spacing: .04em; color: #fff; }
.lesson-hero h1 { text-wrap: balance; margin: 0 0 var(--s-5); font-size: clamp(28px, 4vw, 42px); font-weight: 900; line-height: 1.25; }
.lesson-hero p { margin: 0; max-width: 42em; font-size: 17px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.lesson-meta li { padding: 0 var(--s-4); border-left: 1px solid rgba(255, 255, 255, .4); }
.lesson-meta li:first-child { padding-left: 0; border-left: 0; font-weight: 700; }
.course-track { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; flex: none; }
.course-track a {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 56px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid rgba(255, 255, 255, .45); color: #fff; font-weight: 700; font-size: 15px; line-height: 1;
  text-decoration: none; transition: background-color .15s var(--ease);
}
.course-track a:hover { background: rgba(255, 255, 255, .14); }
.course-track a:focus-visible { outline-color: #fff; }
.course-track span { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.course-track a[aria-current="page"] { background: #fff; border-color: #fff; color: var(--accent-deep); }
@media (max-width: 760px) {
  .lesson-hero { padding: var(--s-8) 0; }
  .lesson-hero-inner { gap: var(--s-5); }
  .lesson-meta { flex-direction: column; }
  .lesson-meta li { padding: 0; border: 0; }
}
@media (max-width: 600px) { .course-track { display: none; } }

/* ---------- 課堂頁：兩欄版面 ---------- */
.lesson-layout { display: grid; grid-template-columns: 1fr; padding-top: var(--s-12); }
.lesson-body { min-width: 0; max-width: 48rem; }
@media (min-width: 1080px) {
  .lesson-layout.has-toc { grid-template-columns: 232px minmax(0, 1fr); gap: var(--s-16); }
}
.toc { display: none; }
@media (min-width: 1080px) {
  .toc:not([hidden]) { display: block; position: sticky; top: var(--s-6); align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; padding-bottom: var(--s-6); }
}
.toc-title { margin: 0 0 var(--s-3); padding-left: 12px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 10px 8px 12px; margin-left: -1px;
  border-left: 2px solid transparent; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; text-decoration: none;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.toc a:hover { color: var(--ink); background: var(--sunk); }
.toc a[aria-current="location"] { color: var(--accent-deep); border-left-color: var(--accent-deep); font-weight: 700; background: var(--accent-soft); }
.toc-n {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; color: var(--ink-2); background: var(--surface);
}
.toc-n.is-plain { border-color: transparent; background: none; }
.toc-n.is-plain::before { content: ""; display: block; width: 6px; height: 6px; margin: 7px auto 0; border-radius: 50%; background: var(--line-strong); }
.toc a[aria-current="location"] .toc-n { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.toc a[aria-current="location"] .toc-n.is-plain { background: none; border-color: transparent; }
.toc a[aria-current="location"] .toc-n.is-plain::before { background: var(--accent-deep); }

.toc-compact { margin: 0 0 var(--s-8); }
.toc-compact > summary { padding-right: var(--s-4); background: var(--surface); }
.toc-compact[open] > summary { border-bottom-color: var(--line); }
.toc-compact ol { list-style: none; margin: 0; padding: var(--s-2); background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.toc-compact a { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px; border-radius: var(--radius-sm); color: var(--ink); font-size: 15px; line-height: 1.5; text-decoration: none; }
.toc-compact a:hover { background: var(--sunk); }
.toc-compact a[aria-current="location"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.toc-compact a[aria-current="location"] .toc-n { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
@media (min-width: 1080px) { .toc-compact { display: none; } }

/* ---------- 課堂頁：步驟 ---------- */
.lesson-body > section { padding: var(--s-12) 0; border-top: 1px solid var(--line); }
.lesson-body > section:first-child,
.lesson-body > .note + section { border-top: 0; padding-top: 0; }
.lesson-body > .note:first-child { margin: 0 0 var(--s-12); }
.lesson-body > section > h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 var(--s-2); font-size: 27px; font-weight: 700; }
.step-num { flex: none; color: var(--accent-deep); font-size: 1.25em; font-weight: 400; line-height: 1; transform: translateY(2px); }
.time {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--s-5); color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.lesson-body .time::before {
  content: ""; width: 15px; height: 15px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5V8l2.5 1.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='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 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5V8l2.5 1.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.lesson-body h3 { margin: var(--s-8) 0 var(--s-3); font-size: 19px; font-weight: 700; }
.lesson-body p { margin: var(--s-3) 0; }
.lesson-body ol, .lesson-body ul { padding-left: 1.4em; margin: var(--s-3) 0; }
.lesson-body li { margin: 6px 0; padding-left: 4px; }
.lesson-body li::marker { color: var(--accent-deep); font-weight: 700; }

/* 自我檢查（檢查點） */
.check {
  position: relative; margin: var(--s-6) 0; padding: var(--s-4) var(--s-5) var(--s-4) 60px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); color: var(--ink);
}
.check::before { content: "做到這步，你應該看到："; display: block; margin-bottom: 2px; font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--accent-deep); }
.check::after {
  content: ""; position: absolute; left: 18px; top: 18px; width: 26px; height: 26px; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.3 12.5 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat, var(--accent-deep);
}

/* 提示與警告 */
.note, .warn { position: relative; border-radius: var(--radius); padding: 14px var(--s-5) 14px 52px; margin: var(--s-5) 0; font-size: 16px; line-height: 1.75; }
.note {
  background: var(--sunk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.25' fill='none' stroke='%23525866' stroke-width='1.5'/%3E%3Cpath d='M10 9v5' stroke='%23525866' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='6.2' r='1' fill='%23525866'/%3E%3C/svg%3E") 18px 16px / 20px no-repeat;
  color: var(--ink);
}
.warn {
  background: var(--warn-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5 18 17H2z' fill='none' stroke='%23A36200' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M10 8v4.2' stroke='%23A36200' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.6' r='1' fill='%23A36200'/%3E%3C/svg%3E") 18px 16px / 20px no-repeat;
  border: 1px solid var(--warn-line);
}
.warn strong:first-child { display: block; color: var(--warn-ink); }
.warn p { margin: 4px 0 0; }

/* 表格 */
.table-wrap { margin: var(--s-5) 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.65; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th, td:first-child { word-break: keep-all; }
th { white-space: nowrap; }
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
th { background: var(--sunk); color: var(--ink-2); font-size: 13.5px; font-weight: 700; letter-spacing: .03em; }
td:first-child { font-weight: 500; color: var(--ink); }
td code { white-space: nowrap; }
th:first-child, td:first-child { white-space: nowrap; }
td { overflow-wrap: break-word; }
.example table { min-width: 26rem; }
#troubleshoot td:first-child { width: 38%; white-space: normal; font-weight: 700; }
code { background: var(--sunk); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; font-size: .9em; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

/* 中學例／小學例 */
.example-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-4); margin: var(--s-5) 0; }
.example { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lesson-body .example > h3 { margin: 0; padding: 12px var(--s-4); font-size: 15px; font-weight: 700; background: var(--sunk); border-bottom: 1px solid var(--line); }
.ex-tag { color: var(--accent-deep); }
.example > p { margin: var(--s-3) var(--s-4); font-size: 16px; }
.example > .prompt { margin: 0; border: 0; border-radius: 0; }
.example > .snippet { margin: var(--s-3) var(--s-4); }
.example > .table-wrap { margin: var(--s-3); }
.demo-frame { display: block; width: 100%; height: 560px; border: 0; background: var(--bg); }

/* 提示詞面板 */
.prompt { margin: var(--s-5) 0; background: #FAF9F6; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.prompt-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 4px 4px 4px var(--s-4); background: var(--sunk); border-bottom: 1px solid var(--line); }
.prompt-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink-2); }
.prompt-label::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 3.5h11M2.5 8h11M2.5 12.5h7' stroke='black' stroke-width='1.6' stroke-linecap='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 16 16'%3E%3Cpath d='M2.5 3.5h11M2.5 8h11M2.5 12.5h7' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
pre { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 1.8; color: var(--ink); }
.prompt pre, details > pre { padding: var(--s-4) var(--s-5); max-height: 420px; overflow: auto; }
.snippet { padding: 10px 14px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; }

.copy {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent-deep); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: filter .15s var(--ease), transform .1s var(--ease);
}
.copy::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M10.5 3.5v-.5A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v5A1.5 1.5 0 0 0 4 9.5h.5' fill='none' stroke='black' stroke-width='1.5'/%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 16 16'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M10.5 3.5v-.5A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v5A1.5 1.5 0 0 0 4 9.5h.5' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.copy:hover { filter: brightness(.9); }
.copy:active { transform: translateY(1px); }
.copy:focus-visible { outline-offset: 3px; }

/* 可展開面板：提示詞卡「完整指令」及後備程式碼 */
details { position: relative; margin: var(--s-4) 0; }
details > summary {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px var(--s-4);
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none;
  transition: background-color .15s var(--ease);
}
details > summary:hover { background: #EDEAE3; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; width: 10px; height: 10px; flex: none; background: currentColor; transition: transform .15s var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1.5 6.5 5 3 8.5' fill='none' stroke='black' stroke-width='1.6' 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 10 10'%3E%3Cpath d='M3 1.5 6.5 5 3 8.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
details[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
details[open] > summary::before { transform: rotate(90deg); }
details > pre { background: #FAF9F6; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
details > .copy { display: flex; width: 100%; margin-top: var(--s-2); }
.pcard, .lesson-body { container-type: inline-size; }
@container (min-width: 480px) {
  details > summary { padding-right: 232px; }
  details > .copy { position: absolute; top: 4px; right: 4px; width: auto; margin: 0; }
}
.code-panel > pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; white-space: pre; }

.example { display: flex; flex-direction: column; }
.example > .prompt { flex: 1; background: #FAF9F6; }
.example .prompt-bar { background: var(--surface); }

/* 「還可以這樣用」、小結、想學更多 */
#summary a[href^="lesson-"] { font-weight: 700; }
.group-title { margin: var(--s-8) 0 var(--s-3); font-size: 18px; font-weight: 700; }
.lesson-body > #summary { margin-top: var(--s-4); padding: var(--s-8); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); }
.lesson-body > #summary > h2 { font-size: 22px; }
.lesson-body > #summary .table-wrap { background: var(--surface); }
.lesson-body > #summary + .more-video { border-top: 0; }
.lesson-body > .more-video { position: relative; padding: var(--s-8) 0 var(--s-8) 72px; }
/* 播放圖示屬於連結本身（連結的偽元素），點擊圖示即開啟影片 */
.more-video a::before {
  content: ""; position: absolute; left: 0; top: var(--s-8); width: 52px; height: 52px; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.5 5.5v9l7-4.5z' fill='white'/%3E%3C/svg%3E") 55% 50% / 22px no-repeat, var(--ink);
}
.lesson-body > .more-video > h2 { font-size: 20px; margin-bottom: 0; }
.more-video p { margin: 4px 0 0; }
@media (max-width: 760px) {
  .lesson-layout { padding-top: var(--s-8); }
  .lesson-body > section { padding: var(--s-8) 0; }
  .lesson-body > section > h2 { font-size: 23px; gap: 10px; }
  .lesson-body > #summary { padding: var(--s-5); }
  .check { padding-left: 54px; }
  .check::after { left: 16px; }
  .note, .warn { padding-left: 46px; }
  .note, .warn { background-position: 15px 16px; }
  .lesson-body > .more-video { padding: var(--s-8) 0 var(--s-8) 64px; }
  .more-video a::before { width: 44px; height: 44px; }
}

/* ---------- 提示詞卡片 ---------- */
.pcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s-5); }
.pcard {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: var(--radius); padding: var(--s-5) var(--s-6);
}
[data-prompt-id] > .pcard { margin: var(--s-5) 0; }
.pcard-head { display: flex; align-items: flex-start; gap: var(--s-3); }
.pcard-head h4 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.4; }
.pcard-id {
  flex: none; margin-top: 2px; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-deep);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s-3) 0 var(--s-2) !important; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tag:first-child { border-color: var(--accent-line); color: var(--accent-deep); }
.pcard p { margin: 6px 0; font-size: 15.5px; line-height: 1.75; }
.pcard-when { color: var(--ink-2); }
.pcard-when strong { color: var(--ink); }
.pcard details { margin: var(--s-4) 0 var(--s-2); }
.pcard-lesson a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.pcard-lesson a::after { content: ""; width: 14px; height: 14px; margin-left: 6px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h9M8.5 4.5 12 8l-3.5 3.5' fill='none' stroke='black' stroke-width='1.6' 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 16 16'%3E%3Cpath d='M3 8h9M8.5 4.5 12 8l-3.5 3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.pcard .pcard-lesson { margin: var(--s-2) 0 0; }
.pcard .pcard-credit { margin: auto 0 0; padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.pcard details + .pcard-credit, .pcard-lesson + .pcard-credit { margin-top: var(--s-3); }
.pcard-credit a { white-space: nowrap; display: inline-block; padding: 11px 4px; margin: -11px 0; }
@media (max-width: 600px) { .pcard { padding: var(--s-4); } }

/* ---------- 提示詞庫 ---------- */
/* 每張卡跟隨示範該課的顏色 */
#lib-results .pcard:has(.pcard-lesson a[href^="lesson-1"]) { --accent: #2F6FDE; --accent-deep: #1F55B8; --accent-soft: #EEF3FD; --accent-line: #BFD2F5; }
#lib-results .pcard:has(.pcard-lesson a[href^="lesson-2"]) { --accent: #1E9E76; --accent-deep: #167A5B; --accent-soft: #EBF7F2; --accent-line: #B5E0CF; }
#lib-results .pcard:has(.pcard-lesson a[href^="lesson-3"]) { --accent: #D6456A; --accent-deep: #B0314F; --accent-soft: #FCEEF2; --accent-line: #F2C1CE; }
#lib-results .pcard:has(.pcard-lesson a[href^="lesson-4"]) { --accent: #8A4FD8; --accent-deep: #6D38B5; --accent-soft: #F4EEFC; --accent-line: #D8C5F3; }
.lib-hero { background: var(--accent-soft); color: var(--ink); border-top: 4px solid var(--home); }
.lib-hero .num { color: var(--accent-deep); }
.lib-hero p:not(.num) { color: var(--ink-2); }
.lib-hero .wrap > * { max-width: 46rem; }
.filters {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: var(--s-4);
  margin: calc(var(--s-8) * -1) 0 0; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-5);
  box-shadow: 0 12px 32px -20px rgba(60, 45, 20, .3);
}
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); }
.filters select, .filters input {
  font: inherit; font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--ink);
  min-height: 46px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--radius-sm); background-color: var(--surface);
}
.filters select {
  -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23525866' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 12px no-repeat;
}
.filters input { padding-left: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.75' fill='none' stroke='%23525866' stroke-width='1.6'/%3E%3Cpath d='m10.5 10.5 3 3' stroke='%23525866' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 12px center / 16px no-repeat; }
.filters input::placeholder { color: #6B6F7A; opacity: 1; }
.filters select:focus-visible, .filters input:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 1px; border-color: var(--accent-deep); }
#lib-count { margin: var(--s-8) 0 var(--s-4); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.lib-hero + .wrap { padding-bottom: var(--s-8); }
.lib-hero { padding-bottom: var(--s-16); }
@media (max-width: 860px) { .filters { grid-template-columns: 1fr 1fr; } .filters label:last-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .filters { grid-template-columns: 1fr; padding: var(--s-4); gap: var(--s-3); } }
.load-error { color: #A11D38; font-weight: 700; }

/* ---------- 頁腳 ---------- */
.site-footer { margin-top: var(--s-16); padding: var(--s-12) 0 var(--s-12); background: var(--sunk); border-top: 1px solid var(--line); font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--s-16); row-gap: var(--s-6); align-items: start; }
.footer-grid p { margin: 0; }
.footer-info p + p { margin-top: var(--s-2); }
.footer-mark { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 16px; color: var(--ink); }
.footer-tm { grid-column: 1 / -1; margin-top: calc(var(--s-2) * -1) !important; font-size: 13px; }
.footer-legal { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid var(--line-strong); color: var(--ink-2); }
.footer-mark .brand-mark { width: 20px; height: 20px; }
.site-footer a { color: var(--ink); }
.footer-channel a { font-weight: 700; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; row-gap: var(--s-4); } }

/* ---------- 動態偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .lesson-card:hover { transform: none; }
}
