/* ==========================================================================
   AI Agent Literacy — 每週頁面（也給 404 用）
   和首頁同一套風格：黑白為主、琥珀色點綴、影片放在一段膠捲裡。
   一週只有一頁：標題，接著每支影片一段（影片、片段、幾則重點），不再往下分頁。
   ========================================================================== */
:root {
  --bg: #ebe9e4;
  --ink: #111111;
  --ink-2: #4a4843;
  --ink-3: #7a776f;
  --line: rgba(17, 17, 17, .14);
  --btn: rgba(17, 17, 17, .06);
  --btn-hover: rgba(17, 17, 17, .12);
  --accent: #a36500;
  --film: #0d0c0b;
  --hole: #ebe9e4;

  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --gutter: clamp(16px, 3.2vw, 44px);  /* 和首頁一樣，頂列的位置才不會跳 */
  --wide: 72rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
/* 簡中用簡體字型（assets/i18n.js 選到時才載入） */
:root:lang(zh-Hans) { --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070707; --ink: #f1efe9; --ink-2: #b9b6ae; --ink-3: #85827b;
    --line: rgba(241, 239, 233, .16); --btn: rgba(241, 239, 233, .07); --btn-hover: rgba(241, 239, 233, .14);
    --accent: #f0b545; --film: #151412; --hole: #d9d6ce;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070707; --ink: #f1efe9; --ink-2: #b9b6ae; --ink-3: #85827b;
  --line: rgba(241, 239, 233, .16); --btn: rgba(241, 239, 233, .07); --btn-hover: rgba(241, 239, 233, .14);
  --accent: #f0b545; --film: #151412; --hole: #d9d6ce;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.75;
  text-spacing-trim: trim-start; /* 全形括號「（」排在行首時不留半個字的空白 */
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, p, ol { margin: 0; }
code { font-family: var(--font-mono); font-size: .9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

/* 片基的顆粒感（靜態） */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 頂列和頁尾橫跨整個畫面（和首頁一樣靠左右兩邊），只有中間的內容限制寬度、置中 */
.page { width: 100%; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; padding: 0 var(--gutter); }
.page > main { width: 100%; max-width: var(--wide); margin-inline: auto; padding-bottom: clamp(3rem, 7vw, 5rem); }

/* ---------- 頂列（和首頁一樣） ---------- */
.top { display: flex; align-items: flex-start; gap: .5rem; padding-top: max(14px, env(safe-area-inset-top)); }
.brand { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; min-width: 0; padding-top: .35rem; margin-right: auto; }
.brand-name { font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
/* 窄螢幕頂列有四顆按鈕時副標會換行：balance 讓「Week 3 – 16」整段留在第二行，不會只剩「16」 */
.brand-sub { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; color: var(--ink-3); text-wrap: balance; }
.brand:hover .brand-name { text-decoration: underline; text-underline-offset: .2em; }
.pill {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 2.5rem; min-width: 2.5rem; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--btn); font-size: .86rem; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s;
}
.pill:hover { background: var(--btn-hover); }
.pill svg { width: 1.05rem; height: 1.05rem; flex: none; }
.pill.icon-only { width: 2.5rem; padding: 0; }
.pill.icon-only span { display: none; }
.pill.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* 頂列的「作品集」按鈕：在作品集頁時反白；很窄的手機只留圖示 */
.pill.nav-works[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 430px) {
  .pill.nav-works { width: 2.5rem; padding: 0; }
  .pill.nav-works span { display: none; }
}

/* 語言選單（assets/i18n.js 加在主題按鈕前面）：看起來是一顆小按鈕，點下去是瀏覽器原生的選單 */
.lang-switch { position: relative; flex: none; padding: 0 .85rem; }
.lang-short { font-size: .8rem; font-weight: 700; }
.lang-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; font: inherit; }
.lang-switch:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) {
  .lang-switch { width: 2.5rem; padding: 0; }
  .lang-switch svg { display: none; }
}

/* ---------- 標題 ---------- */
.head { padding-block: clamp(2.2rem, 7vw, 4.5rem) clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; gap: .7rem; max-width: 46rem; }
.kicker { display: flex; align-items: center; gap: .55rem; font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-2); }
.kicker .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); flex: none; }
.head h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); font-weight: 700; line-height: 1.14; letter-spacing: .005em; text-wrap: balance; }
.head .lede { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink-2); line-height: 1.75; text-wrap: pretty; }
/* 非繁中時的說明：影片畫面裡的字是繁中（繁中時是空的，不顯示） */
.lang-note { font-size: .86rem; color: var(--ink-3); line-height: 1.6; }
.lang-note:empty { display: none; }

/* ---------- 每支影片一段（section.unit） ---------- */
.unit + .unit { margin-top: clamp(3.4rem, 9vw, 6rem); }
.unit-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .9rem; margin-bottom: 1rem; font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 700; line-height: 1.3; }
.unit-num { font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .14em; color: var(--accent); }
/* 標題、片段名稱裡的（…）、(…)：video.js 把它包成一段，要換行就整組一起換，不會剩下孤零零的「（Windows）」 */
.np { white-space: nowrap; }
.np-fw.ls { margin-left: -.5em; } /* video.js 發現字型沒有把行首「（」左邊的半個字空白收掉時，補上這一行 */

/* ---------- 影片：放在一段膠捲裡 ---------- */
.film {
  position: relative; background: var(--film); border-radius: 14px;
  padding: clamp(26px, 3.4vw, 40px) clamp(10px, 1.6vw, 18px);
}
.film::before, .film::after {
  content: ""; position: absolute; left: clamp(10px, 1.6vw, 18px); right: clamp(10px, 1.6vw, 18px); height: clamp(8px, 1vw, 12px);
  background: repeating-linear-gradient(90deg, var(--hole) 0 clamp(10px, 1.3vw, 16px), transparent 0 clamp(20px, 2.6vw, 32px));
  border-radius: 2px; opacity: .92;
}
.film::before { top: clamp(9px, 1.2vw, 14px); }
.film::after { bottom: clamp(9px, 1.2vw, 14px); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.player video { display: block; width: 100%; height: 100%; background: #000; }
/* 影片還在做的一支（例如作業）：膠捲裡先放一張圖 */
.player img.still { display: block; width: 100%; height: 100%; object-fit: cover; }
/* video.js 在影片載入失敗時加上的說明 */
.video-error { position: absolute; left: 0; right: 0; bottom: 0; padding: .8rem 1rem; background: rgba(0, 0, 0, .78); color: #fff; font-size: .92rem; line-height: 1.6; }

/* 片段：影片下面一條時間軸，點了直接跳過去 */
.chapters { list-style: none; margin: 0; padding: 1.1rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem 1rem; }
.chapters button {
  appearance: none; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  padding: .7rem 0 .55rem; border: 0; border-top: 2px solid var(--line); background: none; cursor: pointer; text-align: left;
  transition: border-color .2s;
}
.chapters .k { font-family: var(--font-mono); font-size: .74rem; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; }
.chapters .t { font-size: .95rem; font-weight: 700; color: var(--ink-2); line-height: 1.45; }
.chapters button:hover { border-top-color: var(--ink-3); }
.chapters button:hover .t { color: var(--ink); }
.chapters button[aria-current="true"] { border-top-color: var(--accent); }
.chapters button[aria-current="true"] .t { color: var(--ink); }
.chapters button[aria-current="true"] .k { color: var(--accent); }

/* ---------- 重點：幾則短文字，不加小標題 ---------- */
.points { list-style: none; padding: clamp(2.4rem, 6vw, 4rem) 0 0; margin: 0; counter-reset: p; display: flex; flex-direction: column; max-width: 50rem; }
.points li {
  counter-increment: p; display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 1rem; align-items: baseline;
  padding: 1.3rem 0; border-top: 1px solid var(--line);
}
.points li:last-child { border-bottom: 1px solid var(--line); }
.points li::before { content: counter(p, decimal-leading-zero); font-family: var(--font-mono); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1; color: var(--ink-3); letter-spacing: -.02em; }
.points p { font-size: clamp(1.02rem, 1.7vw, 1.14rem); line-height: 1.8; text-wrap: pretty; }
.points strong { font-weight: 700; }
.points code { background: var(--btn); border-radius: 6px; padding: .05em .4em; white-space: nowrap; }
/* 窄螢幕：很長的路徑（例如 /Users/an/Desktop/Project/output/report.md）不能撐寬頁面，需要時在路徑裡換行 */
@media (max-width: 760px) {
  .points code { white-space: normal; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
}

/* ---------- 作業影片下面的一句開場白和照片授權（Week 4 影片 03） ---------- */
.hw-lead { max-width: 46rem; margin-top: 1.4rem; font-size: clamp(1.02rem, 1.7vw, 1.14rem); line-height: 1.8; color: var(--ink-2); text-wrap: pretty; }
.hw-credit { max-width: 46rem; margin-top: 1rem; font-size: .8rem; line-height: 1.6; color: var(--ink-3); }
.hw-credit a { color: inherit; }
/* 作業的下載位置（2026-10-19 老師：「用顏色醒目下載位置」）：作業段落裡去哪裡拿作業檔案、作業資料的連結加 class="hw-dl"
   （四種語言的 data-* 裡也要加）：橘色粗體＋淡淡的螢光筆底，和一般說明文字分開。淺色底 #c2410c、深色底 #ffa64d，對比都 ≥ 4.5。 */
.hw-dl { --dl: #c2410c; --dl-bg: rgba(251, 146, 60, .24);
  color: var(--dl); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .22em;
  background: linear-gradient(transparent 56%, var(--dl-bg) 56%); padding: 0 .08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hw-dl:hover, .hw-dl:focus-visible { background: var(--dl-bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hw-dl { --dl: #ffa64d; --dl-bg: rgba(255, 166, 77, .18); } }
:root[data-theme="dark"] .hw-dl { --dl: #ffa64d; --dl-bg: rgba(255, 166, 77, .18); }

/* ---------- 作業（section.unit-hw）：同一個畫面先播說明影片，播完按「開始玩」溶接成範例遊戲（2026-10-20 改版，老師：左右兩格不順；原本左邊影片、右邊遊戲）
   上面一行「1 看說明影片 → 2 玩空中之島」隨時切換（.hw-step，選到的那一個字變深、底下一條強調色的線）。
   遊戲（iframe）載好才淡入（0.9 秒），底下的影片停在最後一格（就是遊戲一開始的視角）。程式在 video.js。 ---------- */
.hw-steps { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .8rem; margin: 0 0 .9rem; }
.hw-step { display: inline-flex; align-items: baseline; gap: .45rem; padding: .25rem 0 .3rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); font: inherit; font-weight: 700; cursor: pointer; transition: color .25s, border-color .25s; }
.hw-step:hover, .hw-step:focus-visible { color: var(--ink-2); }
.hw-step[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.hw-n { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); }
.hw-arrow { color: var(--ink-3); }
/* 作業裡要照抄的範本（figure.hw-verify，2026-10-21 Week 7 r4：VERIFY.md 第 1 批「老師想的測試」）：放在重點那一點裡（li > .hw-li），右上角「複製」（video.js） */
.hw-li { min-width: 0; }
.hw-verify { margin: 1rem 0 .3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--btn); overflow: hidden; }
.hw-verify figcaption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .6rem .5rem 1rem; border-bottom: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); }
.hw-verify pre { margin: 0; padding: .9rem 1rem 1rem; font-family: var(--font-mono); font-size: .84rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.hw-copy { flex: none; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; transition: color .2s, border-color .2s; }
.hw-copy:hover, .hw-copy:focus-visible { color: var(--ink); border-color: var(--ink-3); }
.hw-copy.is-done { color: var(--accent); border-color: var(--accent); }
.hw-stage { background: #121417; }
.hw-stage[data-mode="game"] video { pointer-events: none; }
.hw-game { position: absolute; inset: 0; z-index: 1; visibility: hidden; }
.hw-stage[data-mode="game"] .hw-game { visibility: visible; }
.hw-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; opacity: 0; transform: scale(1.012); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.hw-game.is-ready .hw-frame { opacity: 1; transform: none; }
.hw-stage[data-mode="video"] .hw-frame { opacity: 0; transition-duration: .5s; }
.hw-loading { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); padding: .2rem .75rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; font-weight: 700; pointer-events: none; }
.hw-game.is-ready .hw-loading { display: none; }
.hw-acts { position: absolute; right: .55rem; top: .5rem; z-index: 2; display: flex; gap: .35rem; }
.hw-acts > * { padding: .14rem .6rem; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font: inherit; font-size: .76rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.hw-acts > *:hover { background: rgba(0, 0, 0, .75); }
.hw-acts > [hidden] { display: none; }
/* 影片播完的過場（2026-10-21，video.js 的 breakIn）：上面蓋一張畫布，影片最後一格從中央一塊一塊挖開，露出底下的遊戲。
   過場時遊戲的 iframe 直接顯示（no-fade，不做原本的淡入放大），才不會和挖開的格子對不齊。遊戲還在載入時（is-waiting）影片停在最後一格、下面顯示「載入中…」 */
.hw-fx { position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%; pointer-events: none; }
.hw-game.no-fade .hw-frame { opacity: 1; transform: none; transition: none; }
.hw-stage.is-waiting .hw-game { visibility: visible; }
.hw-stage.is-waiting .hw-acts { display: none; }
@media (prefers-reduced-motion: reduce) { .hw-frame { transform: none; } }

/* ---------- 課堂練習（section.unit-lab）：不是影片，膠捲裡是左右兩台筆電（Mac｜Windows），點哪一台就進哪一個練習 ----------
   版面和影片段落一樣（標題、膠捲、重點），清單上它也是一格（video.js 用 data-thumb 當縮圖）。
   筆電外框是這裡用 CSS 畫的，螢幕裡放練習環境的截圖。video.js 的 labDuo 依滑鼠位置在 .lab-side 加 is-on / is-off：
   滑鼠在哪一半，那一台亮起來（往前一點、放大一點、背後一圈琥珀色的光，螢幕掃過一道光），另一台暗下來；
   中間那一帶看滑鼠往哪邊移動（往左 Mac、往右 Windows）。手機和鍵盤一樣能用：沒有滑鼠時兩台都亮著，直接點。 */
.lab-duo {
  display: grid; grid-template-columns: 1fr 1fr; isolation: isolate;
  background: radial-gradient(120% 85% at 50% 118%, #23252c 0%, #121317 52%, #0b0c0f 100%);
  container-type: inline-size;
}
/* 中間一條很淡的分隔線 */
.lab-duo::after {
  content: ""; position: absolute; left: 50%; top: 16%; bottom: 16%; width: 1px; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .12) 30%, rgba(255, 255, 255, .12) 70%, rgba(255, 255, 255, 0));
  transition: opacity .45s var(--ease);
}
.lab-duo.is-choosing::after { opacity: 0; }
.lab-side {
  position: relative; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(.55rem, 3.4cqi, 1.35rem); min-width: 0; padding: 7% 5% 6%;
  color: #ececef; text-decoration: none; -webkit-tap-highlight-color: transparent; container-type: inline-size;
}
.lab-side:focus-visible { outline: 2px solid #f0b545; outline-offset: -8px; border-radius: 8px; }
/* 背後的光：亮起來的那一台才有 */
.lab-side::before {
  content: ""; position: absolute; inset: -10% 0 0; z-index: -1; pointer-events: none;
  background: radial-gradient(52% 46% at 50% 44%, rgba(240, 181, 69, .2) 0%, rgba(240, 181, 69, .06) 55%, rgba(240, 181, 69, 0) 75%);
  opacity: 0; transition: opacity .5s var(--ease);
}

/* 筆電：寬度是這一半的 82%，上蓋 16:10 螢幕加邊框，下面是機身 */
.lp {
  position: relative; display: block; width: 82%;
  transform-origin: 50% 80%;
  filter: brightness(.9) saturate(.92);
  transition: transform .55s var(--ease), filter .55s var(--ease);
}
.lp-lid { position: relative; display: block; padding: 2.6% 2.6% 3%; border-radius: 4.2% / 6.4%; background: #0a0a0c; }
.lp-screen { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: .9% / 1.4%; background: #000; }
.lp-screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 螢幕掃過的一道光（亮起來的那一刻掃一次） */
.lp-glint {
  position: absolute; inset: -30% -80%; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .34) 50%, rgba(255, 255, 255, 0) 58%);
  transform: translateX(-62%);
}
.lab-side.is-flash .lp-glint { animation: lab-glint .8s cubic-bezier(.32, .62, .3, 1) both; }
@keyframes lab-glint {
  0% { opacity: 0; transform: translateX(-62%); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateX(62%); }
}
/* 機身下的影子 */
.lp::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: -5.5%; height: 9%; z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); transition: opacity .55s var(--ease);
}
/* Mac：鋁合金外框、瀏海、銀色機身（正中間有一個開蓋用的凹口） */
.lp-mac .lp-lid { box-shadow: 0 0 0 1.5px #b8bbc1, 0 0 0 2.5px #8c9097, inset 0 0 0 1px #26272b; }
.lp-notch { position: absolute; top: 2.6%; left: 50%; width: 10.5%; height: 3.4%; transform: translateX(-50%); border-radius: 0 0 .45em .45em / 0 0 .5em .5em; background: #0a0a0c; }
.lp-mac .lp-base {
  position: relative; display: block; width: 116%; margin: 0 0 0 -8%; aspect-ratio: 100 / 3.3;
  border-radius: 0 0 46% 46% / 0 0 100% 100%;
  background: linear-gradient(180deg, #eceef1 0%, #c9ccd1 38%, #9a9ea5 78%, #6f737a 100%);
}
.lp-mac .lp-base::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 14%; height: 42%; transform: translateX(-50%);
  border-radius: 0 0 .6em .6em / 0 0 .5em .5em; background: linear-gradient(180deg, #a5a9b0, #cfd2d6);
}
/* Windows：深灰外框、窄邊框、上緣中間一顆鏡頭、比較平的深色機身 */
.lp-win .lp-lid { padding: 2.2% 2.2% 3.4%; border-radius: 2.6% / 4%; box-shadow: 0 0 0 1.5px #3b3e44, 0 0 0 2.5px #24262a, inset 0 0 0 1px #1b1c1f; }
.lp-cam { position: absolute; top: .9%; left: 50%; width: .9%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #1d2633; box-shadow: inset 0 0 0 1px #2c3747; }
.lp-win .lp-base {
  position: relative; display: block; width: 110%; margin: 0 0 0 -5%; aspect-ratio: 100 / 2.9;
  border-radius: 0 0 28% 28% / 0 0 100% 100%;
  background: linear-gradient(180deg, #5a5e65 0%, #3d4046 40%, #26282c 100%);
}
.lp-win .lp-base::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 18%; height: 34%; transform: translateX(-50%);
  border-radius: 0 0 .5em .5em / 0 0 .4em .4em; background: linear-gradient(180deg, #2c2e33, #45484e);
}

/* 說明：系統名稱，下面一顆「進入遠端電腦 →」；亮起來的那一台按鈕變成琥珀色 */
.lab-cap { display: flex; flex-direction: column; align-items: center; gap: clamp(.35rem, 2.2cqi, .7rem); transition: opacity .45s var(--ease); }
.lab-os { font-size: clamp(.92rem, 6.2cqi, 1.6rem); font-weight: 700; letter-spacing: .02em; line-height: 1.15; color: #f3f3f5; }
.lab-cta {
  display: inline-flex; align-items: center; gap: .45em; padding: .42em 1.05em; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .3); color: #e6e6ea; white-space: nowrap;
  font-size: clamp(.68rem, 3.4cqi, .95rem); font-weight: 600; line-height: 1.4;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}
.lab-cta .arrow { font-family: var(--font-mono); transition: transform .35s var(--ease); }

/* 亮起來／暗下來 */
.lab-side.is-on::before { opacity: 1; }
.lab-side.is-on .lp { transform: translateY(-2.5%) scale(1.05); filter: brightness(1.05) saturate(1.04); }
.lab-side.is-on .lab-cta { background: #f0b545; border-color: #f0b545; color: #141210; }
.lab-side.is-on .lab-cta .arrow { transform: translateX(.18em); }
.lab-side.is-off .lp { transform: scale(.955); filter: brightness(.46) saturate(.55); }
.lab-side.is-off .lp::after { opacity: .5; }
.lab-side.is-off .lab-cap { opacity: .42; }

@media (max-width: 760px) {
  .lab-side { padding: 6% 3.5% 5%; }
  .lab-cta { padding: .34em .8em; }
}
@media (prefers-reduced-motion: reduce) {
  .lp, .lab-side::before, .lab-cap, .lab-cta, .lab-cta .arrow { transition-duration: .01s; }
  .lab-side.is-on .lp, .lab-side.is-off .lp { transform: none; }
  .lab-side.is-flash .lp-glint { animation: none; }
}
.lab-intro { max-width: 46rem; margin-top: 1.4rem; font-size: clamp(1.02rem, 1.7vw, 1.14rem); line-height: 1.8; color: var(--ink-2); text-wrap: pretty; }
.lab-note { max-width: 46rem; margin-top: .6rem; font-size: .86rem; line-height: 1.6; color: var(--ink-3); }

/* ---------- 一週兩支以上影片：播放清單（video.js 產生 .reel，並在 main 加上 .has-reel） ----------
   和片段、重點同一套樣子：細線分隔、等寬編號、黃色標出目前這支，不用卡片。 */
.page > main.has-reel { max-width: 84rem; display: grid; grid-template-columns: minmax(0, 1fr) 17.5rem; column-gap: clamp(1.6rem, 3vw, 2.8rem); align-items: start; }
main.has-reel > .head, main.has-reel > .pager { grid-column: 1 / -1; }
main.has-reel > .unit { grid-column: 1; grid-row: 2; margin-top: 0; } /* 一次只顯示一支，不需要影片之間的間距 */
.reel { grid-column: 2; grid-row: 2; position: sticky; top: 1.2rem; }
.reel-label { font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); padding: .55rem 0 .95rem; }
.reel ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.reel-item {
  appearance: none; position: relative; width: 100%; display: grid; grid-template-columns: 6.8rem minmax(0, 1fr); gap: .85rem; align-items: start;
  padding: 1rem 0 1.05rem; border: 0; background: none; text-align: left; cursor: pointer;
}
.reel li:last-child .reel-item { border-bottom: 1px solid var(--line); }
/* 補充教材前面的小標：和「本週影片」同一種字，上面一條細線收住前一支 */
.reel-sep { border-top: 1px solid var(--line); margin-top: .4rem; font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); padding: 1.3rem 0 .4rem; }
/* 上緣的細線就是觀看進度：看到哪裡就填到哪裡 */
.reel-bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--line); overflow: hidden; }
.reel-bar > span { position: absolute; inset: 0; background: var(--ink-3); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .6s var(--ease), background-color .3s; }
.reel-item[aria-current="true"] .reel-bar > span { background: var(--accent); }
.reel-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.reel-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .62; transition: opacity .3s, transform .6s var(--ease); }
.reel-item:hover .reel-thumb img, .reel-item[aria-current="true"] .reel-thumb img { opacity: 1; }
.reel-item:hover .reel-thumb img { transform: scale(1.04); }
.reel-len { position: absolute; right: .3rem; bottom: .3rem; padding: .05rem .32rem; border-radius: 4px; background: rgba(0, 0, 0, .72); color: #fff; font: 700 .66rem/1.5 var(--font-mono); }
.reel-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.reel-n { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-mono); font-size: .74rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); }
.reel-item[aria-current="true"] .reel-n { color: var(--accent); }
.reel-item.is-done .reel-n::after { content: "✓"; color: var(--ink-3); }
/* 播放中：編號前的小點輕輕呼吸 */
.reel-item.is-playing .reel-n::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: var(--accent); animation: reel-breathe 1.8s ease-in-out infinite; }
@keyframes reel-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.reel-t { font-size: .95rem; font-weight: 700; line-height: 1.45; color: var(--ink-2); transition: color .2s; }

/* 先看哪幾支（section 的 data-needs，video.js 畫）：清單左邊的空隙裡一條細線，從要先看的那幾支匯到這一支，線旁直寫「先看」。
   不用框和底色：一條手感的細線、一個小箭頭、兩個字。看完了線變淡、字變 ✓。 */
.reel-needs { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.reel-needs path { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .55; transition: opacity .3s, stroke .3s, stroke-width .3s; }
.reel-needs.is-hot path { opacity: 1; stroke-width: 1.8; }
.reel-needs.is-met path { stroke: var(--ink-3); opacity: .45; }
.reel-needs-k {
  position: absolute; transform: translate(-50%, -50%); writing-mode: vertical-rl; padding: .35rem 0; background: var(--bg);
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .3em; line-height: 1; color: var(--accent); opacity: .8;
  pointer-events: none; transition: opacity .3s, color .3s;
}
.reel-needs-k.is-hot { opacity: 1; }
.reel-needs.is-met + .reel-needs-k { color: var(--ink-3); letter-spacing: 0; }
.reel-item.is-need .reel-thumb img { opacity: 1; }
.reel-item.is-need .reel-t { color: var(--ink); }

/* 影片標題下面那一行：「先看」＋小縮圖（點了換過去）；看完的打勾 */
.needs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin: -.2rem 0 1.1rem; }
.needs-k { font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .14em; color: var(--accent); }
.needs-k::after { content: "→"; margin-left: .55rem; letter-spacing: 0; }
.needs-plus { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-3); }
.needs-a { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-2); text-decoration: none; font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
.needs-a img { display: block; width: 4rem; height: 2.25rem; object-fit: cover; border-radius: 4px; opacity: .7; transition: opacity .3s; }
.needs-a:hover, .needs-a:focus-visible { color: var(--ink); }
.needs-a:hover img, .needs-a:focus-visible img { opacity: 1; }
.needs-a.is-done .needs-n::after { content: " ✓"; color: var(--ink-3); }
.reel-item:hover .reel-t, .reel-item[aria-current="true"] .reel-t { color: var(--ink); }

/* 換影片時：播放器和重點輕輕淡入（只往上移 10px），重點一則接一則 */
.unit.is-entering { animation: unit-in .5s var(--ease) both; }
.unit.is-entering .points li { animation: unit-in .5s var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 60ms); }
@keyframes unit-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 影片播完：畫面中間出現「下一支」，點了才播 */
.next-up {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  display: inline-flex; align-items: center; gap: .7rem; max-width: calc(100% - 2rem); padding: .8rem 1.15rem .8rem 1.3rem;
  border: 0; border-radius: 999px; background: #f0b545; color: #141210; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: next-in .45s var(--ease) both;
}
.next-k { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .1em; opacity: .72; white-space: nowrap; }
.next-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-up svg { width: 1rem; height: 1rem; flex: none; }
@keyframes next-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---------- 上一週／下一週（course.js 產生內容） ---------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: clamp(2.6rem, 6vw, 4rem); font-size: .9rem; }
.pager a, .pager span { font-weight: 700; text-decoration: none; }
.pager a:hover { text-decoration: underline; text-underline-offset: .2em; }
.pager span { color: var(--ink-3); font-weight: 500; }

/* 頁尾：貼在最下面，上緣一條橫跨整個畫面的細線；左、中（版權）、右三欄，中間那欄真正置中 */
.foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline; gap: .4rem 1.2rem;
  margin-top: auto; margin-inline: calc(var(--gutter) * -1); padding: 1.3rem var(--gutter) max(1.4rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: .78rem; color: var(--ink-3);
}
.foot a { color: var(--ink-3); }
.foot > :nth-child(3) { justify-self: end; }

@media (max-width: 760px) {
  .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .points li { grid-template-columns: 2.8rem minmax(0, 1fr); gap: .6rem; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .foot > :nth-child(3) { justify-self: start; }
  /* 手機：清單放在播放器上方，橫排；三支以上可以左右滑 */
  .page > main.has-reel { display: block; }
  .reel { position: static; margin-bottom: 1.6rem; }
  .reel-label { padding-top: 0; }
  .reel ol { flex-direction: row; gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; }
  .reel li { flex: 1 0 10rem; min-width: 0; scroll-snap-align: start; }
  .reel-item { grid-template-columns: 1fr; gap: .6rem; padding: .9rem 0 .2rem; }
  .reel li:last-child .reel-item { border-bottom: 0; }
  /* 橫排時，每一組的小標是前面的一小欄：左邊一條細線把組和組分開，字和項目的上緣對齊 */
  .reel li.reel-sep { flex: 0 0 auto; max-width: 5.6rem; margin: 0; padding: .9rem 0 0 .9rem; border-top: 0; border-left: 1px solid var(--line); line-height: 1.5; letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
  .unit.is-entering, .unit.is-entering .points li, .next-up, .reel-item.is-playing .reel-n::before { animation: none; }
}

/* 頁尾的「授權說明」連結（接在版權那一行後面） */
.foot-lic { margin-left: .45em; white-space: nowrap; }
