/* AI Engineer Europe 2026：影片庫（版型 A，照 Apple Developer 影片庫）。
   白底、淺灰色塊、系統字、藍色連結；縮圖是唯一的顏色，主題磚只帶一層很淡的色相。
   顏色全部是 :root 上的變數，深色在 prefers-color-scheme 與 data-theme 兩處重設（主題鈕按過以後者為準）。 */
:root {
  --bg: #FFFFFF; --bg2: #F5F5F7; --line: #E5E5EA; --line2: #F0F0F2;
  --ink: #1D1D1F; --ink2: #424245; --mute: #6E6E73; --link: #0066CC; --focus: #0071E3;
  --chip-l: 96%; --chip-ink-l: 30%; --chip-s: 60%;
  --shade: rgba(0, 0, 0, .72); --bar: rgba(255, 255, 255, .9);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg2: #1C1C1E; --line: #2C2C2E; --line2: #1C1C1E;
    --ink: #F5F5F7; --ink2: #D1D1D6; --mute: #98989D; --link: #2997FF; --focus: #2997FF;
    --chip-l: 16%; --chip-ink-l: 82%; --chip-s: 35%;
    --shade: rgba(0, 0, 0, .78); --bar: rgba(0, 0, 0, .85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg2: #1C1C1E; --line: #2C2C2E; --line2: #1C1C1E;
  --ink: #F5F5F7; --ink2: #D1D1D6; --mute: #98989D; --link: #2997FF; --focus: #2997FF;
  --chip-l: 16%; --chip-ink-l: 82%; --chip-s: 35%;
  --shade: rgba(0, 0, 0, .78); --bar: rgba(0, 0, 0, .85);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
ul, ol { list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap, .col, .tools, .grid, .rel, .gh, .gl, .foot { margin-left: max(16px, calc((100% - 1200px) / 2)); margin-right: max(16px, calc((100% - 1200px) / 2)); }

/* ---------------------------------------------------------------- 上緣：大會列 + 站內列 */
.gn { display: flex; gap: 22px; align-items: center; min-height: 40px; padding: 0 max(16px, calc((100% - 1200px) / 2));
  background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink2);
  overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.gn a { color: var(--ink2); }
.gn b { color: var(--ink); font-weight: 600; }
.gn .sep { margin: 0 -14px; color: var(--mute); }
.gn .lab { color: var(--mute); margin-right: -10px; }
.ln { position: sticky; top: 0; z-index: 5; display: flex; gap: 22px; align-items: center; min-height: 52px;
  padding: 0 max(16px, calc((100% - 1200px) / 2)); background: var(--bar); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); font-size: 13.5px; }
.ln a { color: var(--ink2); }
.ln a[aria-current] { color: var(--ink); font-weight: 600; }
.ln .brand { font-size: 19px; font-weight: 600; color: var(--ink); margin-right: auto; letter-spacing: -.01em; }
.ln a, .ln .brand { white-space: nowrap; }
.tgl { font-size: 17px; line-height: 1; color: var(--mute); padding: 6px 2px; }
.tgl:hover { color: var(--ink); }

/* ---------------------------------------------------------------- 縮圖：16:9 框，404 佔位圖換成文字框 */
.pv { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--bg2); }
.pv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pv i { position: absolute; right: 8px; bottom: 8px; background: var(--shade); color: #FFF; font: 600 11px/1.5 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 1px 6px; border-radius: 5px; font-style: normal; font-variant-numeric: tabular-nums; }
.fb { display: none; }
.gone img { display: none; }
.gone .fb { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font-weight: 600; color: var(--mute); font-size: 14px; }

/* ---------------------------------------------------------------- 首頁 */
.col { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: center; margin-top: 28px; padding: 36px; background: var(--bg2); border-radius: 18px; }
.ey { font-size: 12px; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.col h1 { font-size: 38px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; margin: 4px 0 12px; }
.col p { color: var(--ink2); line-height: 1.75; }
.col .meta { margin-top: 12px; font-size: 13.5px; color: var(--mute); }
.col-v { display: block; color: var(--ink); }
.col-v .big { border-radius: 12px; }
.col-v small { display: block; margin-top: 8px; font-size: 13px; color: var(--mute); }
.col-v:hover { text-decoration: none; }
.col-v:hover small { color: var(--ink); }

h2 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
h2 small { font-size: 13px; color: var(--mute); font-weight: 400; letter-spacing: 0; }
.tools h2 { margin: 34px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { text-align: left; padding: 14px 14px 12px; border-radius: 12px; min-height: 78px; display: flex; flex-direction: column; justify-content: space-between;
  gap: 6px; border: 2px solid transparent; background: hsl(var(--h, 220) var(--chip-s) var(--chip-l)); }
.tile b { font-size: 15px; font-weight: 600; line-height: 1.35; color: hsl(var(--h, 220) 55% var(--chip-ink-l)); }
.tile small { font-size: 12px; color: var(--mute); }
.tile[data-f="-1"] { background: var(--ink); }
.tile[data-f="-1"] b { color: var(--bg); }
.tile[data-f="-1"] small { color: var(--mute); }
.tile.on { border-color: var(--focus); }
.tile:hover { border-color: var(--line); }
.tile.on:hover { border-color: var(--focus); }
.tp:empty { display: none; }
.tp { margin-top: 16px; padding: 18px 20px; border-left: 3px solid var(--focus); background: var(--bg2); border-radius: 0 12px 12px 0; }
.tp h3 { font-size: 17px; margin-bottom: 6px; }
.tp p { font-size: 14.5px; line-height: 1.85; color: var(--ink2); max-width: 70em; }
.bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 20px; margin: 34px 0 16px; }
.bar h2 { margin: 0; }
.q input { font: inherit; font-size: 14px; width: 280px; max-width: 100%; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); }
.q input:focus { outline: 2px solid var(--focus); outline-offset: 0; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 20px; margin-bottom: 56px; }
.cd { display: block; color: var(--ink); }
.cd:hover { text-decoration: none; }
.cd:hover b { color: var(--link); }
.cd b { display: block; font-size: 15px; font-weight: 600; line-height: 1.45; margin-top: 10px; }
.cd small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mute); }
.none { grid-column: 1 / -1; padding: 40px 0; color: var(--mute); }

/* 關掉 JS：磚與搜尋按了不會有反應，藏起來；185 張卡都在 */
html:not(.js) .tools .tiles, html:not(.js) .tools .q, html:not(.js) .tools > h2 { display: none; }

/* ---------------------------------------------------------------- 單場頁 */
.pl { background: #000; }
.poster { display: block; position: relative; max-width: 960px; margin: 0 auto; aspect-ratio: 16 / 9; color: #FFF; }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster i { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #000;
  display: grid; place-items: center; font-size: 26px; font-style: normal; padding-left: 4px; transition: transform .15s; }
.poster:hover i { transform: scale(1.06); }
.poster.gone .fb { display: grid; place-items: center; height: 100%; padding: 24px; font-size: 22px; font-weight: 600; text-align: center; }
.ep { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.sh { margin-top: 30px; }
.sh h1 { font-size: 32px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 6px 0 8px; }
.en { color: var(--mute); font-size: 14px; }
.ld { font-size: 17px; line-height: 1.8; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.chip { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: hsl(var(--h, 220) var(--chip-s) var(--chip-l)); color: hsl(var(--h, 220) 55% var(--chip-ink-l)); font-weight: 500; }
.chip:hover { text-decoration: none; filter: brightness(.97); }
.yt { margin-left: auto; font-size: 14px; font-weight: 500; }

.tb { margin-top: 26px; }
.tb-n { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tb-n button { padding: 10px 14px; font-size: 15px; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tb-n button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); font-weight: 600; }
.pane-h { font-size: 20px; margin: 26px 0 10px; }
/* 只有 JS 在的時候才收成分頁；關掉 JS 時三塊依序攤開，分頁列藏起來 */
html:not(.js) .tb-n { display: none; }
html.js .pane:not(.on) { display: none; }
html.js .pane-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sm li { padding: 11px 0; line-height: 1.8; border-bottom: 1px solid var(--line2); }
.sm b { display: block; font-weight: 600; }
.pane h3 { font-size: 17px; margin: 28px 0 8px; }
.qs li { padding: 12px 0; border-bottom: 1px solid var(--line2); }
.qs blockquote p { line-height: 1.75; }
.qs blockquote p[lang="en"] { font-weight: 500; }
.qs blockquote p + p { color: var(--ink2); font-size: 14.5px; }
.tc { font: 500 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ext li { padding: 6px 0; line-height: 1.75; font-size: 15px; }
.ext li::before { content: "—"; color: var(--mute); margin-right: 8px; }
.hint { font-size: 13.5px; color: var(--mute); margin-bottom: 6px; }
.ch .tl-a { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); color: var(--ink); }
.ch .tl-a:hover { text-decoration: none; background: var(--bg2); }
.ch time { color: var(--link); font: 500 13px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ch b { display: block; font-weight: 600; font-size: 15px; }
.ch small { display: block; color: var(--mute); font-size: 14px; line-height: 1.7; }
.terms > div { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.terms dt { font-weight: 600; color: var(--link); }
.terms dd { font-size: 14.5px; line-height: 1.75; color: var(--ink2); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.pn a { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.5; }
.pn a small { display: block; color: var(--mute); font-weight: 400; font-size: 12.5px; }
.pn .next { text-align: right; }
.rel { margin-top: 48px; }
.rel h2 { margin-bottom: 16px; }
.rel .grid { margin-left: 0; margin-right: 0; }

/* ---------------------------------------------------------------- 術語速查 */
.gh { margin-top: 30px; }
.gh h1 { font-size: 32px; font-weight: 700; }
.gh p { color: var(--ink2); margin: 6px 0 16px; max-width: 46em; }
.gh .gc { font-size: 13px; color: var(--mute); margin: 10px 0 0; }
.gl { margin-top: 18px; margin-bottom: 56px; columns: 2; column-gap: 40px; }
.term { break-inside: avoid; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.term dt { font-weight: 600; }
.term dt small { font-weight: 400; color: var(--mute); font-size: 12px; margin-left: 6px; }
.term dd { font-size: 14px; line-height: 1.7; color: var(--ink2); margin-top: 3px; }
.term dd a { font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace; margin-right: 8px; }

/* ---------------------------------------------------------------- 頁尾 */
.foot { margin-top: 64px; padding: 22px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); line-height: 1.8; }
.foot p + p { margin-top: 6px; display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 窄螢幕 */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .col { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  .grid, .g4 { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .col { padding: 22px; margin-top: 16px; }
  .col h1 { font-size: 28px; }
  .sh h1, .gh h1 { font-size: 25px; }
  .gl { columns: 1; }
  .ln { gap: 14px; }
  .ln .brand { font-size: 15.5px; }
  .ln { font-size: 13px; }
  .q input { width: 100%; }
  .bar .q { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .grid, .g4 { grid-template-columns: 1fr; }
  .tile { min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
