:root {
  color-scheme: light;
  --bg: #fffaf1;
  --ink: #2d2118;
  --muted: #6f6258;
  --orange: #f47b20;
  --accent: #a8440a;
  --stroke: #eadcc9;
  --surface: rgba(255,255,255,.86);
  --nav: rgba(255,255,255,.94);
  --tint: #fff0d9;
  --shadow: rgba(81,44,9,.09);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1128;
  --ink: #e2e8f0;
  --muted: #a9b6cc;
  --orange: #ff9e00;
  --accent: #65dbee;
  --stroke: #293751;
  --surface: rgba(19,30,57,.85);
  --nav: rgba(10,17,40,.96);
  --tint: #1a2947;
  --shadow: rgba(0,0,0,.22);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.8 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: .21em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
.wrap { width: min(100% - 48px, 1040px); margin-inline: auto; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 4; background: var(--bg); padding: 8px 16px; }
.skip:focus { top: 10px; }
.site-header {
  position: sticky;
  z-index: 3;
  top: 0;
  background: var(--nav);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
}
.nav { position: relative; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--ink); font-size: 1.28rem; font-weight: 900; letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.brand span { display: inline-block; margin-left: 3px; padding: 0 5px; border-radius: 5px; color: #341b06; background: #ffbb60; font-size: .8em; }
.nav-menu { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(6px,1.55vw,19px); margin: 0; padding: 0; list-style: none; font-size: .875rem; font-weight: 660; }
.nav-menu a { color: var(--ink); text-decoration: none; }
.nav-menu a:hover { color: var(--accent); }
.nav-menu .facebook { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.facebook img { width: 23px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--tint); }
.theme-toggle, .menu-toggle { background: var(--surface); border: 1px solid var(--stroke); border-radius: 9px; padding: 4px 9px; white-space: nowrap; }
.menu-toggle { display: none; }
.hero { padding-top: clamp(42px,8vw,84px); text-align: center; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .1em; margin-bottom: .55rem; }
h1 { margin: 0; font-size: clamp(2.65rem,7vw,5.25rem); font-weight: 900; letter-spacing: -.055em; }
h1 span { display: block; margin-top: .58rem; font-size: clamp(1.24rem,3vw,2.15rem); letter-spacing: .025em; }
.lead { margin: 1.15rem auto 1.65rem; color: var(--muted); text-wrap: balance; font-size: clamp(1rem,2vw,1.17rem); }
.hero-figure { margin: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--stroke); box-shadow: 0 14px 38px var(--shadow); background: var(--surface); }
.hero-figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.jump-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; padding: 20px 0 4px; }
.jump-nav a, .watch-moments button {
  padding: 5px 13px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 670;
  text-decoration: none;
  background: var(--surface);
}
.jump-nav a:hover, .watch-moments button:hover { background: var(--tint); }
.section { max-width: 860px; margin: 0 auto; padding: clamp(42px,7vw,70px) 0 0; }
.section + .section { border-top: 1px solid var(--stroke); margin-top: clamp(34px,6vw,57px); padding-top: clamp(32px,5vw,49px); }
h2 { margin: 0 0 1rem; font-size: clamp(1.65rem,4vw,2.45rem); font-weight: 850; letter-spacing: -.025em; }
.section > p { color: var(--muted); }
video { display: block; width: 100%; height: auto; aspect-ratio: 16/9; background: #150e0c; border-radius: 14px; }
.video-info { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 14px; margin: .7rem 0 1rem; color: var(--muted); font-size: .92rem; }
details { border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface); padding: .68rem 1rem; }
summary { cursor: pointer; font-weight: 700; }
details p { margin-top: .7rem; }
.transcript ol { margin: .7rem 0 .3rem; padding-left: 1.55rem; }
.transcript time { font-variant-numeric: tabular-nums; color: var(--muted); padding-right: .42rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.65rem minmax(0,1fr); column-gap: .85rem; border: 1px solid var(--stroke); border-radius: 12px; padding: clamp(12px,3vw,20px); background: var(--surface); }
.steps li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; align-self: start; width: 2.65rem; aspect-ratio: 1; border-radius: 9px; background: var(--tint); color: var(--accent); font-weight: 850; }
.steps h3 { margin: .1rem 0 .4rem; font-size: 1.18rem; }
.steps p { margin: 0; color: var(--muted); }
.comparison { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; overflow: hidden; }
.compare-controls { display: flex; gap: 8px; padding: .75rem; }
.compare-controls button { border: 1px solid var(--stroke); border-radius: 8px; padding: 4px 15px; background: var(--surface); }
.compare-controls button[aria-pressed="true"] { background: var(--tint); border-color: var(--orange); color: var(--accent); font-weight: 800; }
.comparison figure { margin: 0; }
.comparison img { width: 100%; }
figcaption { margin: 0; padding: .7rem 1rem; }
figcaption strong { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.watch-moments { display: flex; align-items: start; flex-wrap: wrap; gap: 8px; margin: .9rem 0 1.15rem; }
.tip { background: var(--tint); border-inline-start: 4px solid var(--orange); border-radius: 6px; padding: .65rem .9rem; }
.tip strong { color: var(--ink); }
pre { overflow: auto; background: var(--tint); padding: .7rem; border-radius: 6px; font-size: .84rem; }
.file-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: .8rem; }
.terms { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.terms div { padding: 13px 16px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--surface); }
.terms dt { font-weight: 820; font-size: 1.08rem; }
.terms span { color: var(--accent); font-weight: 700; font-size: .81rem; margin-left: .35em; white-space: nowrap; }
.terms dd { margin: .15rem 0 0; color: var(--muted); }
.sources { margin-bottom: 65px !important; }
.sources ul { padding-left: 1.4rem; }
.site-footer { border-top: 1px solid var(--stroke); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 22px; padding: 22px 0; }
.footer-brand { color: var(--ink); text-decoration: none; font-weight: 750; }
.footer-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: .88rem; }
.footer-coffee-btn { white-space: nowrap; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--stroke); background: var(--tint); padding: 5px 10px; }
dialog { width: min(100% - 36px,440px); padding: 32px 26px; border: 1px solid var(--stroke); border-radius: 16px; text-align: center; background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgba(11,13,22,.68); }
dialog h2 { font-size: 1.55rem; margin-top: .5rem; }
.close { position: absolute; top: 5px; right: 9px; width: 34px; height: 34px; line-height: 1; font-size: 1.5rem; border: none; background: transparent; border-radius: 7px; }
.sponsor-link { display: inline-block; text-decoration: none; background: #ffcc48; color: #2d2118; font-weight: 750; padding: 6px 14px; border-radius: 8px; }
@media (max-width: 840px) {
  .menu-toggle { display: block; }
  .nav-menu { display: none; position: absolute; top: 100%; right: 0; width: min(100%,270px); padding: 14px 16px; background: var(--bg); border: 1px solid var(--stroke); border-radius: 0 0 12px 12px; box-shadow: 0 8px 20px var(--shadow); }
  .nav-menu[data-open] { display: grid; gap: 5px; }
  .nav-menu a { display: block; padding: 4px 0; }
}
@media (max-width: 550px) {
  .wrap { width: calc(100% - 32px); }
  .hero-figure { border-radius: 12px; }
  .terms { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 2.05rem minmax(0,1fr); column-gap: .65rem; }
  .steps li::before { width: 2.05rem; }
}
