/* The scene pages' own stylesheet: the app's CSS is hashed and purged, so these tokens are copied from
   frontend/src/index.css (tests/test_scenes.py keeps them equal). */
:root {
  --paper: #ffffff; --paper-2: #eeeeee; --surface: #ffffff;
  --ink: #222222; --ink-2: #555555; --muted: #6e6e6e;
  --line: #dddddd; --line-2: #bbbbbb;
  --link: #2255aa; --link-ink: #ffffff; --focus: #222222;
  --new-bg: #e3edf9; --saved-bg: #f8edb9;
  --ok: #3a7d44; --warn: #b8392b;
  --tap: 36px;
  --font-sans: Arial, Helvetica, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-cjk: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  --text-sm: 13px; --text-sm--line-height: 1.45;
  --text-base: 14px; --text-base--line-height: 1.45;
  --text-lg: 17px; --text-lg--line-height: 1.3;
  --text-hz: 22px; --text-hz--line-height: 1.9;
  --text-hz-sm: 20px; --text-hz-sm--line-height: 1.6;
  --text-prompt: 32px; --text-prompt--line-height: 1.3;
  --text-head: 40px; --text-head--line-height: 1.15;
  --text-label: 11px; --text-label--line-height: 1.3;
  color-scheme: light;
}
@media (hover: none), (max-width: 640px) { :root { --tap: 44px; } }

*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans);
  font-size: var(--text-base); line-height: var(--text-base--line-height);
}
:lang(zh) { font-family: var(--font-cjk); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { a:hover { color: var(--ink); } }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.top { position: sticky; top: 0; z-index: 20; max-width: 1040px; margin: 0 auto; padding: 0 16px; background: var(--paper); }
.top-in { display: flex; align-items: center; gap: 12px; height: 44px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.brand img { transform: translateY(-4px); image-rendering: pixelated; }
.top-in .signin-link { margin-left: auto; display: inline-flex; align-items: center; min-height: var(--tap); font-size: var(--text-sm); }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin-bottom: 8px; font-size: var(--text-prompt); line-height: var(--text-prompt--line-height); font-weight: 700; letter-spacing: -0.01em; }
.sub { font-size: var(--text-lg); line-height: var(--text-lg--line-height); color: var(--ink-2); }
h2 { margin-bottom: 12px; font-size: var(--text-lg); line-height: var(--text-lg--line-height); }
.hero { display: grid; gap: 20px; }
.hero .box { margin-top: 20px; }
.still img { border: 1px solid var(--line-2); }
.still figcaption { margin-top: 8px; font-size: var(--text-sm); color: var(--ink-2); }
section { margin-top: 32px; }
#form, #form-end { scroll-margin-top: 56px; }

.lbl { margin: 16px 0 2px; font-size: var(--text-label); line-height: var(--text-label--line-height); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.steps { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.steps li { display: flex; gap: 6px; border: 1px solid var(--line-2); padding: 4px 10px; font-size: var(--text-sm); }
.steps li b { color: var(--muted); font-weight: 400; }

.row { padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.hz { font-size: var(--text-hz-sm); line-height: var(--text-hz-sm--line-height); }
.py { font-size: var(--text-sm); color: var(--ink-2); }
.py .en { color: var(--ink); }
.who { font-size: var(--text-label); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.note-line { margin-top: 12px; font-size: var(--text-sm); color: var(--ink-2); }

.w {
  margin: 0 1px; padding: 0 2px; border: 0; background: var(--new-bg); color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 4px;
}
.wp { max-width: 360px; margin: 8px 0 12px; border: 1px solid var(--line-2); background: var(--surface); }
.wp .bt { display: flex; align-items: center; }
.wp .x { margin-left: auto; min-height: var(--tap); padding: 0 6px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 16px; font-weight: 400; cursor: pointer; }
.wp .x:hover { color: var(--ink); }
.wp .bb { padding: 10px 16px 12px; }
.wp .han { font-size: var(--text-hz); line-height: var(--text-hz--line-height); }
.status { display: inline-flex; margin: 8px 0 6px; border: 1px solid var(--line-2); font-size: var(--text-sm); }
.status span { padding: 3px 10px; }
.status .sel { background: var(--new-bg); font-weight: 700; }

details { margin-top: 12px; }
summary { display: flex; align-items: center; min-height: var(--tap); cursor: pointer; color: var(--link); font-size: var(--text-sm); font-weight: 700; }

.box { margin-top: 0; border: 1px solid var(--line-2); background: var(--surface); }
.box > .bt, .wp > .bt { margin: 0; padding: 6px 16px; border-bottom: 1px solid var(--line-2); background: var(--paper-2); font-size: var(--text-sm); line-height: var(--text-sm--line-height); font-weight: 700; }
.box > .bb { padding: 16px; }
.signin-form { display: flex; flex-wrap: wrap; gap: 8px; }
.email { flex: 1 1 12rem; min-width: 12rem; }
.email input { width: 100%; min-height: var(--tap); padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 0; background: var(--surface); color: var(--ink); font: inherit; }
.email input::placeholder { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 4px 14px; border: 1px solid var(--link); border-radius: 0; background: var(--link); color: var(--link-ink); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { .btn:enabled:hover { filter: brightness(1.1); } }
.btn:disabled { cursor: default; opacity: 0.55; }
.btn[aria-busy="true"] { cursor: wait; }
.err { flex-basis: 100%; font-size: var(--text-sm); color: var(--warn); }
.fine { margin-top: 12px; font-size: var(--text-sm); color: var(--ink-2); }
.sent { display: grid; gap: 12px; }
.ok { border: 1px solid var(--line); border-left: 3px solid var(--ok); padding: 12px 16px; font-size: var(--text-sm); }
.sent .fine { margin-top: 0; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--link); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkbtn:disabled { cursor: default; opacity: 0.55; }
@media (hover: hover) { .linkbtn:enabled:hover { color: var(--ink); } }

.related { display: grid; gap: 12px; }
.related a { display: block; color: var(--ink); text-decoration: none; }
.related img { border: 1px solid var(--line-2); }
.related b { display: block; margin-top: 6px; color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.foot { max-width: 1040px; margin: 0 auto; padding: 16px; border-top: 1px solid var(--line); font-size: var(--text-sm); }

@media (min-width: 768px) {
  h1 { font-size: var(--text-head); line-height: var(--text-head--line-height); }
  .hero { grid-template-columns: 1fr 1fr; gap: 20px 40px; align-items: start; }
  .related { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition: none !important; animation: none !important; } }
