@view-transition { navigation: auto; }

:root {
  color-scheme: dark;
  --bg: #070a0f;
  --bg-2: #0a0f16;
  --surface: #0d131b;
  --surface-2: #111a24;
  --tray: #111821;
  --opt: #16202b;
  --opt-hover: #1c2835;
  --btn-grey: #1f2a36;
  --line: rgb(var(--fg) / 0.07);
  --line-2: rgb(var(--fg) / 0.11);
  --dash: rgb(var(--fg) / 0.12);
  --ink: #eef2f5;
  --ink-2: #c3ccd4;
  --muted: #93a1ad;
  --faint: #7a8894;
  --gold: #d6bd8a;
  --gold-hi: #ecd9ae;
  --teal: #5fd3c1;
  --copper: #f0a066;
  --accent: var(--gold);
  --on-accent: #121317;
  --sans: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --num: "Barlow Condensed", "Noto Sans TC", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.25, 0.5, 1);
  --gutter: 64px;
  /* 主題變數：淺色主題（Bay.M）在 theme.css 覆寫 */
  --fg: 255 255 255;
  --shadow: 1;
  --scrim: rgba(3,5,8,.66);
  --cer-bg: rgba(4,6,9,.95);
  --toolbar-bg: rgba(10,15,22,.8);
  --now-bg: linear-gradient(180deg, rgba(20,30,40,.9), rgba(10,15,22,.92));
  --ctrl-bg: linear-gradient(180deg, #0b1118, #080c12);
  --dot: #3a4653;
  --faint-2: #52606d;
  --scroll: #25303b;
  --num-grad: linear-gradient(180deg, #f4f7f9, #7f8b96);
  --pill-bg: var(--gold);
  --pill-fg: #0b0f14;
  --pill-shadow: 0 8px 24px rgba(214,189,138,.25);
  --on-video-line: rgba(255,255,255,.18);
  --on-gold: #121317;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
  background:
    radial-gradient(70% 50% at 50% -10%, rgba(95, 211, 193, 0.06), transparent 70%),
    linear-gradient(rgb(var(--fg) / .022) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgb(var(--fg) / .022) 1px, transparent 1px) 0 0 / 64px 64px,
    var(--bg);
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.wrap { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }

/* ---------- header ---------- */
.site-head { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; z-index: 3; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand svg { width: 38px; height: 38px; flex-shrink: 0; }
.brand-words { display: flex; flex-direction: column; gap: 5px; }
.brand-zh { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: 0.3em; line-height: 1; }
.brand-en { font-family: var(--mono); font-size: 10px; letter-spacing: 0.28em; color: var(--faint); line-height: 1; }
.nav { display: flex; align-items: center; gap: 32px; font-size: 15px; font-weight: 500; }
.nav > a:not(.btn), .nav > button { color: var(--ink-2); background: none; border: 0; padding: 0; font-size: 15px; font-weight: 500; transition: color .2s; }
.nav > a:not(.btn):hover, .nav > button:hover { color: var(--ink); }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-width: 0; }
.crumbs .sep { color: var(--faint-2); }
.crumbs b { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lang, .nav > a.lang { white-space: nowrap; flex-shrink: 0; height: 36px; min-width: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--ink-2) !important; transition: border-color .2s, color .2s; }
.lang:hover { border-color: rgb(var(--fg) / .3); color: var(--ink) !important; }
.lang::before { content: ""; width: 12px; height: 12px; margin-right: 6px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18'/%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 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18'/%3E%3C/svg%3E") center / contain no-repeat; }

/* 英文頁：句子較長，標題縮小並允許換行 */
html[lang="en"] .hero h1 { font-size: 60px; letter-spacing: -0.02em; line-height: 1.08; }
html[lang="en"] .hero h1 .line { white-space: normal; }
html[lang="en"] .h2 { letter-spacing: -0.02em; }
html[lang="en"] .card-title { font-size: 20px; }
html[lang="en"] .stage h1 { font-size: 48px; letter-spacing: -0.01em; }

/* ---------- buttons ---------- */
.btn {
  height: 52px; padding: 0 10px 0 24px; border-radius: 999px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 16px; font-weight: 700; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .3s, color .3s, border-color .3s, box-shadow .3s, filter .2s;
}
.btn:active { transform: scale(0.97); }
.btn .ic { width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .3s var(--spring); }
.btn:hover .ic { transform: translateX(2px); }
.btn .ic svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 1px rgb(var(--fg) / .08) inset, 0 12px 36px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-primary .ic { background: color-mix(in srgb, var(--on-accent) 14%, transparent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: rgb(var(--fg) / .025); border-color: var(--line-2); color: var(--ink); }
.btn-ghost .ic { background: rgb(var(--fg) / .06); color: var(--accent); }
.btn-ghost:hover { border-color: rgb(var(--fg) / .22); }
.btn-sm { height: 44px; font-size: 14px; padding: 0 7px 0 18px; gap: 10px; }
.btn-sm .ic { width: 30px; height: 30px; }
.btn-plain { padding: 0 24px; }
.btn-grey { background: var(--btn-grey); color: var(--ink); font-weight: 500; font-size: 15px; padding: 0 22px; }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--btn-grey); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.icon-btn::after { content: ""; position: absolute; inset: -6px; }
.icon-btn svg { width: 12px; height: 12px; }

/* ---------- labels ---------- */
.kicker { display: flex; align-items: center; gap: 16px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.24em; color: var(--ink-2); text-transform: uppercase; }
.kicker::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
.kicker b { color: var(--accent); font-weight: 500; }
h1, h2, h3 { margin: 0; }
.display { font-weight: 900; letter-spacing: -0.01em; line-height: 1.08; }
.h2 { font-size: 64px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.1; }
.grad { background: linear-gradient(100deg, var(--teal) 10%, var(--gold) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: 88px; padding-bottom: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: 56px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 30px; }
.hero h1 { font-size: 72px; }
.hero h1 .line { display: block; white-space: nowrap; }
.hero-sub { margin: 0; font-size: 20px; line-height: 1.75; color: var(--ink-2); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { font-size: 13px; color: var(--muted); letter-spacing: .04em; }

.now {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px 14px 18px;
  background: var(--now-bg); border: 1px solid var(--line-2); border-radius: 26px;
  box-shadow: 0 50px 120px rgb(0 0 0 / calc(.55 * var(--shadow))), 0 0 0 1px rgba(95,211,193,.05) inset;
  transform: perspective(1600px) rotateY(-7deg) rotateX(2deg); transform-origin: 20% 50%;
  transition: transform .8s var(--ease);
}
.now:hover { transform: perspective(1600px) rotateY(0) rotateX(0); }
.now-top { display: flex; align-items: center; gap: 12px; padding: 4px 8px 0; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--ink-2); }
.now-top .live { width: 7px; height: 7px; border-radius: 999px; background: var(--copper); box-shadow: 0 0 10px var(--copper); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.now-top span:last-child { color: var(--faint); }
.now-segs { display: flex; gap: 4px; padding: 0 6px; }
.now-segs i { height: 3px; border-radius: 2px; background: rgb(var(--fg) / .1); position: relative; overflow: hidden; }
.now-segs i b { position: absolute; inset: 0; background: var(--nc, var(--teal)); transform-origin: left; transform: scaleX(0); }
.now-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 6px 0; }
.now-title { font-size: 22px; font-weight: 900; min-width: 0; }

.media { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: #060b13; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media img { transition: transform .6s var(--ease), opacity .3s; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, auto) 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 120px; }
.stat { display: flex; align-items: flex-end; gap: 14px; padding: 26px 48px 26px 0; }
.stat + .stat { padding-left: 40px; border-left: 1px solid var(--line); }
.stat b { font-family: var(--num); font-weight: 700; font-size: 76px; line-height: .8; background: var(--num-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 15px; color: var(--ink-2); padding-bottom: 2px; }
.stats p { margin: 0; align-self: center; justify-self: end; text-align: right; font-size: 14px; line-height: 1.8; color: var(--muted); padding-left: 24px; }

/* ---------- sections ---------- */
.section { padding-bottom: 120px; display: flex; flex-direction: column; gap: 28px; }
.section-lede { margin: -8px 0 16px; font-size: 18px; color: var(--ink-2); }

/* ---------- route cards ---------- */
.routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.route-card {
  --accent: var(--rc); text-align: left; display: flex; flex-direction: column; gap: 22px; padding: 28px 26px 26px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 6%, var(--surface)), var(--surface) 40%);
  border: 1px solid var(--line-2); border-radius: 22px; transition: transform .32s var(--ease), border-color .32s, box-shadow .32s;
}
.route-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--rc) 40%, transparent); box-shadow: 0 24px 60px rgb(0 0 0 / calc(.45 * var(--shadow))); }
.route-head { display: flex; align-items: center; gap: 18px; padding-bottom: 22px; border-bottom: 1px dashed var(--dash); }
.route-head .route-num { font-family: var(--num); font-weight: 700; font-size: 46px; line-height: .9; color: var(--rc); }
.route-head div { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; }
.route-head b { font-size: 20px; font-weight: 900; }
.route-head div > span { font-size: 14px; color: var(--muted); }
.circle { width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; background: color-mix(in srgb, var(--rc, var(--accent)) 14%, transparent); color: var(--rc, var(--accent)); display: flex; align-items: center; justify-content: center; transition: transform .3s var(--spring), background-color .3s, color .3s; }
.circle svg { width: 15px; height: 15px; }
.route-card:hover .circle { transform: rotate(45deg); background: var(--rc); color: var(--on-rc, #0b0f14); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: rgb(var(--fg) / .04); border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }
.chip svg { width: 12px; height: 12px; color: var(--rc); }
button.chip { height: 44px; padding: 0 20px; font-size: 15px; transition: background-color .2s, transform .2s; }
button.chip:hover { background: rgb(var(--fg) / .08); }

/* ---------- course toolbar ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px; background: var(--toolbar-bg); border: 1px solid var(--line-2); border-radius: 999px; }
.tabs { position: relative; display: flex; overflow-x: auto; scrollbar-width: none; }
.tab-pill { position: absolute; top: 0; left: 0; height: 48px; border-radius: 999px; background: var(--pill-bg); box-shadow: var(--pill-shadow); transition: transform .42s var(--spring), width .42s var(--spring), background-color .4s; }
.tab { position: relative; height: 48px; padding: 0 20px; background: transparent; border: 0; border-radius: 999px; font-size: 16px; font-weight: 700; color: var(--ink-2); white-space: nowrap; transition: color .3s; }
.tab[aria-selected="true"] { color: var(--pill-fg); }
.tab .num { margin-left: 6px; font-size: 18px; opacity: .75; }
.search { width: 340px; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; transition: border-color .2s; flex-shrink: 1; min-width: 0; }
.search:focus-within { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.search svg { width: 16px; height: 16px; flex-shrink: 0; }
.search input { flex-grow: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.result-count { margin: 4px 0 0 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--faint); }
.result-count b { color: var(--ink-2); font-weight: 500; }

/* ---------- course groups ---------- */
.group { --accent: var(--rc); display: flex; flex-direction: column; gap: 22px; margin-top: 44px; }
.group-head { display: grid; grid-template-columns: 56px 1fr auto; column-gap: 16px; align-items: end; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.group-head svg { width: 48px; height: 48px; color: var(--rc); grid-row: 2; }
.group-code { grid-column: 2; font-family: var(--mono); font-size: 12px; letter-spacing: .24em; color: var(--muted); margin-bottom: 10px; }
.group-title { grid-column: 2; grid-row: 2; font-size: 40px; font-weight: 900; line-height: 1; display: flex; align-items: baseline; gap: 14px; }
.group-title .num { font-size: 30px; color: var(--faint-2); }
.group-desc { grid-column: 3; grid-row: 2; font-size: 14px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.card {
  --accent: var(--cc); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden;
  transition: transform .32s var(--ease), border-color .32s, box-shadow .32s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--cc) 38%, transparent); box-shadow: 0 24px 60px rgb(0 0 0 / calc(.5 * var(--shadow))); }
.card .media { border-radius: 0; }
.card .media video { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; }
.card .media.playing video { opacity: 1; }
.card:hover .media img { transform: scale(1.04); }
.dur { position: absolute; right: 12px; bottom: 12px; height: 24px; padding: 0 10px; display: flex; align-items: center; background: rgba(5,8,12,.8); border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: #c3ccd4; }
.card-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 18px; flex-grow: 1; }
.card-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.card-row .mono { letter-spacing: .18em; color: var(--muted); }
.status { font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.status.new { color: var(--gold); }
.status.new::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.status.seen { color: var(--cc); }
.status.seen svg { width: 13px; height: 13px; }
.card-title { font-size: 21px; font-weight: 900; line-height: 1.35; }
.card-hook { font-size: 14px; line-height: 1.75; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.6; color: var(--faint); }
.card-foot svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--cc); transition: transform .3s var(--spring); }
.card:hover .card-foot svg { transform: translate(2px, -2px); }
.enter-r { animation: inR .42s var(--ease) both; }
.enter-l { animation: inL .42s var(--ease) both; }
.enter-n { animation: fade .3s ease both; }
@keyframes inR { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes inL { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.empty { position: relative; margin-top: 28px; padding: 72px 24px 60px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: var(--surface); border: 1px dashed var(--dash); border-radius: 24px; }
.empty-title { font-size: 26px; font-weight: 900; }
.empty-title .q { color: var(--gold); }
.scribble { color: var(--gold); }
.empty p { margin: 0; font-size: 15px; color: var(--muted); }
.scribble { width: 120px; height: 70px; margin: -4px 0 -6px 140px; }
.scribble path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.1s .25s cubic-bezier(.6,0,.3,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- bottom band + footer ---------- */
.band-cta { margin: 56px 0 0; display: flex; align-items: center; gap: 28px; padding: 30px 32px; background: linear-gradient(90deg, rgba(95,211,193,.07), rgba(214,189,138,.04) 60%, transparent), var(--surface); border: 1px solid var(--line-2); border-radius: 24px; }
.band-cta .ring { width: 48px; height: 48px; flex-shrink: 0; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--teal) 50%, transparent); color: var(--teal); display: flex; align-items: center; justify-content: center; }
.band-cta .ring svg { width: 18px; height: 18px; }
.band-cta div { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; }
.band-cta b { font-size: 19px; font-weight: 900; }
.band-cta span { font-size: 14px; color: var(--muted); }
.foot { padding-top: 36px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13px; line-height: 1.8; color: var(--faint); }
.foot .mono { letter-spacing: .3em; }
.giant { margin-top: 48px; text-align: center; font-family: var(--num); font-weight: 700; font-size: clamp(96px, 17vw, 250px); line-height: .8; letter-spacing: .02em; background: linear-gradient(180deg, rgb(var(--fg) / .07), rgb(var(--fg) / 0) 85%); -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none; overflow: hidden; }

/* ---------- morph ---------- */
.m-in { display: inline-block; animation: rise .36s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- tray ---------- */
.tray-layer { position: fixed; inset: 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .26s ease both; }
.tray-layer.closing .scrim { animation: fade .22s ease reverse both; }
.tray {
  position: absolute; width: 460px; max-width: calc(100vw - 20px); max-height: calc(100vh - 32px); overflow: auto; background: var(--tray);
  border: 1px solid rgb(var(--fg) / .1); border-radius: 30px;
  box-shadow: 0 40px 120px rgb(0 0 0 / calc(.6 * var(--shadow))), inset 0 1px 0 rgb(var(--fg) / .05);
  animation: grow .34s cubic-bezier(.2,.9,.25,1.08) both; transform-origin: 30% 0;
  transition: height .38s cubic-bezier(.3,1.1,.4,1);
}
.tray-layer.closing .tray { animation: shrink .2s ease both; }
@keyframes grow { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes shrink { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.tray-page { animation: fade .3s ease both; }
.tray-page.from-r { animation: inR .34s var(--ease) both; }
.tray-page.from-l { animation: inL .34s var(--ease) both; }
.tray-pad { padding: 24px 24px 22px; display: flex; flex-direction: column; gap: 18px; }
.tray-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tray-icon { width: 40px; height: 40px; color: var(--gold); }
.tray-title { font-size: 22px; font-weight: 900; }
.tray-text { margin: 0; font-size: 15px; line-height: 1.8; color: var(--muted); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 16px; padding: 14px 16px; width: 100%; background: var(--opt); border: 0; border-radius: 18px; text-align: left; transition: background-color .2s, transform .2s; }
.opt:hover { background: var(--opt-hover); }
.opt:active { transform: scale(.985); }
.opt-num { width: 44px; flex-shrink: 0; font-family: var(--num); font-weight: 700; font-size: 32px; line-height: 1; color: var(--rc); }
.opt-text { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.opt-text b { font-size: 16px; font-weight: 900; }
.opt-text span { font-size: 13px; line-height: 1.6; color: var(--muted); }
.opt > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--faint); }
.band { position: relative; padding: 20px 20px 24px 24px; background: var(--accent); color: var(--on-accent); overflow: hidden; }
.band-mark { position: absolute; right: -30px; top: -26px; width: 170px; height: 170px; opacity: .16; }
.band-top { position: relative; display: flex; justify-content: space-between; margin-bottom: 22px; }
.band .icon-btn { background: color-mix(in srgb, var(--on-accent) 14%, transparent); color: var(--on-accent); }
.band-kicker { position: relative; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; }
.band-title { position: relative; display: block; margin-top: 6px; font-weight: 900; font-size: 26px; }
.steps { margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.steps .n { width: 24px; font-family: var(--num); font-weight: 700; font-size: 20px; color: var(--accent); }
.steps .t { flex-grow: 1; }
.steps .d { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.steps .ok { width: 16px; height: 16px; color: var(--accent); }
.steps button { all: unset; cursor: pointer; display: flex; gap: 14px; width: 100%; align-items: flex-start; }
.steps button:hover .t { color: var(--accent); }
.steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.steps .tm { font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 3px; width: 40px; flex-shrink: 0; }
.steps li.cur .t { color: var(--accent); }
.hint { font-size: 12px; line-height: 1.6; color: var(--faint); text-align: center; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn-grey { height: 52px; }
.row-btns .btn-primary { flex-grow: 1; font-size: 15px; padding: 0 20px; }
.bullets { display: flex; flex-direction: column; gap: 12px; }
.bullets div { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); }
.bullets svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.kbd { display: inline-flex; min-width: 26px; height: 24px; padding: 0 7px; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; font-family: var(--mono); font-size: 12px; color: var(--ink); }

/* ---------- lesson layout ---------- */
.lesson-page { background: radial-gradient(60% 40% at 60% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%), var(--bg); }
/* 頁首用實色：iOS Safari 會取固定頁首的顏色延伸到網址列後面；半透明取不到，內容就會從上面透出來 */
.lesson-head { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: var(--bg); padding-top: env(safe-area-inset-top); }
.lesson-head .site-head { max-width: none; }
.shell { display: grid; grid-template-columns: 312px minmax(0, 1fr); min-height: calc(100vh - 73px); }
.side { position: sticky; top: 73px; height: calc(100vh - 73px); overflow-y: auto; border-right: 1px solid var(--line); padding: 14px 16px 40px 18px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.side h4 { margin: 22px 0 8px 10px; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .24em; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.side h4 i { width: 6px; height: 6px; border-radius: 999px; background: var(--rc); }
.side-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 4px 10px; padding: 11px 12px 11px 10px; border-radius: 14px; border: 1px solid transparent; transition: background-color .2s; }
.side-item:hover { background: rgb(var(--fg) / .03); }
.side-item .n { grid-row: span 2; font-family: var(--num); font-weight: 700; font-size: 20px; color: var(--faint); }
.side-item small { font-size: 11px; color: var(--faint); }
.side-item b { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.side-item .ok { grid-row: span 2; width: 15px; height: 15px; color: var(--rc); }
.side-item[aria-current="page"] { background: color-mix(in srgb, var(--rc) 8%, var(--surface)); border-color: color-mix(in srgb, var(--rc) 35%, transparent); box-shadow: inset 3px 0 0 var(--rc); }
.side-item[aria-current="page"] .n, .side-item[aria-current="page"] b { color: var(--rc); }
.chapters { list-style: none; margin: 6px 0 10px 28px; padding: 4px 0 4px 18px; border-left: 1px solid var(--line-2); }
.chapters button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 14px; color: var(--muted); transition: color .2s, background-color .2s; }
.chapters button:hover { color: var(--ink); background: rgb(var(--fg) / .03); }
.chapters button:focus-visible { outline: 2px solid var(--accent); }
.chapters i { width: 6px; height: 6px; border-radius: 999px; background: var(--dot); flex-shrink: 0; transition: background-color .3s, box-shadow .3s; }
.chapters .on button { color: var(--ink); }
.chapters .on i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.chapters .past i { background: color-mix(in srgb, var(--accent) 55%, var(--dot)); }

.stage { padding: 34px 48px 60px; display: flex; flex-direction: column; gap: 22px; max-width: 1180px; width: 100%; }
.stage-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.stage-top > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .24em; color: var(--accent); }
.eyebrow span { color: var(--ink-2); letter-spacing: .12em; }
.stage h1 { font-size: 56px; font-weight: 900; line-height: 1.1; view-transition-name: lesson-title; }
.pill { height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgb(var(--fg) / .03); font-size: 14px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.pill i { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pill .mono { font-weight: 400; color: var(--muted); }

/* ---------- player ---------- */
.player { position: relative; border-radius: 24px; overflow: hidden; background: #060b13; border: 1px solid var(--line-2); box-shadow: 0 40px 100px rgb(0 0 0 / calc(.5 * var(--shadow))); }
.player video { width: 100%; aspect-ratio: 16 / 9; cursor: pointer; }
.player:fullscreen { border-radius: 0; border: 0; display: flex; flex-direction: column; justify-content: center; background: #000; }
.player:fullscreen .stage-video { width: 100%; }
.player:fullscreen video { max-height: 100vh; object-fit: contain; }
.sound {
  position: absolute; right: 18px; top: 18px; height: 46px; padding: 0 20px 0 16px; display: flex; align-items: center; gap: 10px;
  background: rgba(5,8,12,.62); border: 1px solid var(--on-video-line); border-radius: 999px; color: #eef2f5; font-size: 15px; font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .3s, background-color .2s;
}
.sound:hover { background: rgba(5,8,12,.82); }
.sound svg { width: 18px; height: 18px; }
.big-play { position: absolute; left: 50%; top: 50%; z-index: 1; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); background: rgba(5,8,12,.55); color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 10%, transparent); transition: opacity .25s, transform .3s var(--spring); }
.big-play svg { width: 28px; height: 28px; margin-left: 4px; }
.big-play:hover { transform: scale(1.06); }
.player.is-playing .big-play { opacity: 0; pointer-events: none; transform: scale(.9); }
/* 控制列放在影片下方：影片底部燒了字幕與 LOGO，不能蓋住 */
.controls { padding: 12px 16px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--ctrl-bg); border-top: 1px solid var(--line); }
.player:fullscreen .controls { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(3,5,8,.88); transition: opacity .3s; }
.player.is-playing.idle .sound, .player:fullscreen.is-playing.idle .controls { opacity: 0; }
.player.is-playing.idle video { cursor: none; }
.stage-video { position: relative; view-transition-name: lesson-media; }
.scrub { position: relative; display: flex; gap: 4px; height: 18px; align-items: center; cursor: pointer; touch-action: none; }
.scrub .sg { position: relative; height: 4px; border-radius: 3px; background: rgb(var(--fg) / .18); overflow: hidden; transition: height .2s; }
.scrub:hover .sg { height: 7px; }
.scrub .sg b { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.scrub .tip { position: absolute; bottom: 24px; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; background: rgba(5,8,12,.9); color: #eef2f5; border: 1px solid var(--line-2); font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.scrub:hover .tip { opacity: 1; }
.ctrl-row { display: flex; align-items: center; gap: 12px; }
.ctrl { width: 38px; height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; transition: background-color .2s; }
.ctrl:hover { background: rgb(var(--fg) / .1); }
.ctrl svg { width: 18px; height: 18px; }
.ctrl-row .time { font-family: var(--mono); font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ctrl-row .chap { margin-left: 6px; font-size: 13px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ctrl-row .sp { flex-grow: 1; }

.now-chapter { min-height: 44px; text-align: center; font-size: 28px; font-weight: 900; letter-spacing: .02em; color: var(--ink-2); }
.now-chapter .tag { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: .2em; color: var(--accent); margin-right: 14px; vertical-align: middle; }
.points { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.points-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.points-head .mono { font-size: 12px; letter-spacing: .24em; color: var(--muted); }
.points-head .acts { display: flex; gap: 8px; }
.point { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.75; }
.point .num { width: 22px; flex-shrink: 0; font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--accent); }
.mark { position: relative; }
.mark .btn { border-color: var(--accent); color: var(--accent); background: transparent; }
.mark .btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.mark .btn svg { width: 15px; height: 15px; }
.spark { position: absolute; left: 50%; top: 50%; border-radius: 999px; pointer-events: none; animation: burst 1.1s cubic-bezier(.15,.7,.3,1) both; }
@keyframes burst { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); } }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; height: 46px; padding: 0 20px 0 14px; display: flex; align-items: center; gap: 10px; transform: translateX(-50%); background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 15px; font-weight: 700; box-shadow: 0 16px 40px rgb(0 0 0 / calc(.45 * var(--shadow))); animation: toast .5s cubic-bezier(.2,.9,.25,1.1) both; white-space: nowrap; }
.toast svg { width: 16px; height: 16px; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pn a { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; transition: border-color .25s, transform .25s var(--ease); }
.pn a:hover { border-color: color-mix(in srgb, var(--pc, var(--accent)) 45%, transparent); transform: translateY(-2px); }
.pn a.next { text-align: right; }
.pn .mono { font-size: 11px; letter-spacing: .18em; color: var(--pc, var(--accent)); }
.pn b { font-size: 21px; font-weight: 900; }
.pn span:last-child { font-size: 13px; color: var(--muted); }
.pn .off { visibility: hidden; }
.keys { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.keys .kbd { margin: 0 2px; }

/* ---------- ceremony ---------- */
.ceremony { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(60% 50% at 50% 35%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--cer-bg); animation: fade .4s ease both; overflow: hidden; }
.ceremony .star { position: absolute; border-radius: 999px; animation: tw 2.4s ease-in-out infinite; }
@keyframes tw { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.cer-box { position: relative; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 34px; text-align: center; }
.cer-close { position: absolute; right: 0; top: -8px; }
.cer-stack { position: relative; width: 300px; height: 190px; animation: pop .7s cubic-bezier(.2,.9,.25,1.15) .1s both; }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.9) rotate(-3deg); } to { opacity: 1; transform: none; } }
.cer-stack .back { position: absolute; left: 24px; right: 24px; top: 0; height: 170px; border-radius: 24px; opacity: .35; transform: rotate(-5deg); }
.cer-stack .mid { position: absolute; left: 12px; right: 12px; top: 6px; height: 170px; border-radius: 24px; opacity: .5; transform: rotate(4deg); }
.cer-card { position: absolute; inset: 14px 0 0 0; height: 176px; padding: 20px 22px; border-radius: 26px; background: var(--accent); color: var(--on-accent); display: flex; flex-direction: column; justify-content: space-between; text-align: left; box-shadow: 0 30px 60px rgb(0 0 0 / calc(.5 * var(--shadow))), inset 0 1px 0 rgb(var(--fg) / .4); }
.cer-card .row { display: flex; justify-content: space-between; align-items: flex-start; }
.cer-card svg.mk { width: 34px; height: 34px; }
.cer-pill { height: 26px; padding: 0 10px; display: flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--on-accent) 14%, transparent); border-radius: 999px; font-size: 12px; font-weight: 700; }
.cer-pill svg { width: 12px; height: 12px; }
.cer-card .mono { font-size: 12px; letter-spacing: .2em; }
.cer-card b { display: block; margin-top: 4px; font-weight: 900; font-size: 24px; }
.cer-title { font-weight: 900; font-size: 34px; line-height: 1.4; }
.cer-title .u { position: relative; display: inline-block; color: var(--accent); }
.cer-title .u svg { position: absolute; left: -4px; bottom: -10px; width: calc(100% + 8px); height: 14px; overflow: visible; }
.cer-title .u path { stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw .9s .7s cubic-bezier(.6,0,.3,1) forwards; }
.cer-text { margin: -16px 0 0; font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.cer-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.cer-actions .btn { width: 100%; }

/* ---------- mobile lesson list button ---------- */
.list-btn { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  :root { --gutter: 40px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 56px; }
  .hero h1 { font-size: 68px; }
  .now { transform: none; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, auto); }
  .stats p { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .list-btn { display: inline-flex; }
  .stage { margin-inline: auto; padding-inline: var(--gutter); }
}
@media (max-width: 900px) {
  .routes { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav > a:not(.btn):not(.lang), .nav > button { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; border-radius: 26px; }
  .search { width: 100%; }
  .group-head { grid-template-columns: 48px 1fr; }
  .group-desc { grid-column: 1 / -1; grid-row: 3; margin-top: 12px; }
  .h2 { font-size: 48px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { background-size: auto, 40px 40px, 40px 40px, auto; }
  .site-head { height: 64px; }
  .brand-en { display: none; }
  .nav .btn { height: 42px; font-size: 14px; padding: 0 5px 0 14px; gap: 8px; }
  .nav .btn .ic { width: 30px; height: 30px; }
  .crumbs > :not(:last-child) { display: none !important; }
  .lesson-head .crumbs, .map-btn { display: none !important; }
  .lesson-head .site-head { padding-inline: 16px !important; }
  .kicker { letter-spacing: .14em; font-size: 12px; }
  .now-top span:last-child { display: none; }
  .hero { padding-top: 32px; gap: 36px; }
  .hero h1 { font-size: 38px; }
  html[lang="en"] .hero h1 { font-size: 36px; }
  .nav .lang { padding: 0 10px; }
  .nav .lang::before { display: none; }
  html[lang="en"] .stage h1 { font-size: 32px; }
  .nav { gap: 10px; }
  .hero-sub { font-size: 16px; }
  .hero-cta .btn { flex-grow: 1; }
  .stats { margin-bottom: 80px; }
  .stat { padding: 20px 14px 20px 0; gap: 8px; flex-direction: column; align-items: flex-start; }
  .stat + .stat { padding-left: 14px; }
  .stat b { font-size: 52px; }
  .stat span { font-size: 13px; }
  .h2 { font-size: 38px; }
  .section { padding-bottom: 80px; }
  .grid { grid-template-columns: 1fr; }
  .group-title { font-size: 30px; }
  .band-cta { flex-direction: column; align-items: flex-start; }
  .stage { padding: 20px 16px 48px; }
  .stage-top { flex-direction: column; align-items: flex-start; }
  .stage h1 { font-size: 38px; }
  .player { border-radius: 16px; }
  .sound { height: 38px; font-size: 13px; right: 10px; top: 10px; padding: 0 14px 0 12px; }
  .controls { padding: 8px 8px 8px; }
  .ctrl-row .chap { display: none; }
  .now-chapter { font-size: 20px; }
  .pn { grid-template-columns: 1fr; }
  .pn a.next { text-align: left; }
  .pn .off { display: none; }
  .keys { display: none; }
  .tray { left: 10px !important; right: 10px; width: auto; max-width: none; top: auto !important; bottom: 10px; border-radius: 32px; transform-origin: 50% 100%; max-height: calc(100vh - 80px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .scribble path, .cer-title .u path { stroke-dashoffset: 0; }
  .spark { display: none; }
  .now { transform: none; }
  @view-transition { navigation: none; }
}
