/* Aeolith — design tokens and base layout (M0-4)
   Constraints carried over from the validated Chinese build:
   - never lay content out in a row with flex (use vertical lists)
   - no horizontal scrolling at 360 / 390 / 768 / 1024 / 1440
   - single accent colour, no second accent
   - page element widths must not be capped in `ch` units
*/

:root {
  /* colours (附录 B4) */
  --accent: #1A4FD6;
  --accent-ink: #FFFFFF;
  --accent-weak: #EAF0FE;
  --ink: #0B1220;
  --ink-soft: #39414F;
  --muted: #5B6473;
  --paper: #FFFFFF;
  --paper-alt: #F6F8FC;
  --line: #E4E8EF;

  /* scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-22: 1.375rem;
  --fs-28: 1.75rem;
  --fs-36: 2.25rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --wrap: 1080px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden; /* belt-and-braces against horizontal scroll */
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--s4); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-36); }
h2 { font-size: var(--fs-28); }
h3 { font-size: var(--fs-18); }
p { margin: 0 0 var(--s4); }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--paper-alt); padding: 1px 5px; border-radius: var(--r-sm); }
pre {
  background: var(--ink);
  color: #E8ECF4;
  padding: var(--s4);
  border-radius: var(--r-md);
  overflow-x: auto; /* code blocks may scroll internally */
}
pre code { background: none; padding: 0; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
.narrow { max-width: 720px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: var(--s2) var(--s4);
  z-index: 10;
}
.skip-link:focus { left: var(--s4); top: var(--s4); }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-header__inner {
  display: block;
  padding-top: var(--s3);
  padding-bottom: var(--s3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-18);
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-16);
  line-height: 1;
}
.brand__word { letter-spacing: -0.02em; }

.site-nav { margin-top: var(--s2); }
.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav__list li { padding: var(--s1) 0; }
.site-nav__list a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--fs-14);
}
.site-nav__list a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--accent-weak) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}
.hero__inner { padding-top: var(--s7); padding-bottom: var(--s7); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 var(--s3);
}
.hero__title { max-width: 22em; }
.hero__lede {
  font-size: var(--fs-18);
  color: var(--ink-soft);
  max-width: 46em;
  margin-bottom: var(--s6);
}

/* ---------- checker ---------- */
.checker { margin: 0 0 var(--s4); }
.checker__label {
  display: block;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: var(--s2);
}
.checker__row { display: block; }
.checker__input {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: var(--s3) var(--s4);
  font-size: var(--fs-16);
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--s2);
}
.checker__input:focus {
  outline: 3px solid var(--accent-weak);
  border-color: var(--accent);
}
.checker__note { font-size: var(--fs-13); color: var(--muted); margin: 0; }

.btn {
  display: inline-block;
  padding: var(--s3) var(--s5);
  font-size: var(--fs-16);
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #1540AD; }

.notice {
  margin: var(--s5) 0 0;
  padding: var(--s3) var(--s4);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: var(--fs-14);
  color: var(--ink-soft);
}

/* ---------- generic sections ---------- */
.section { padding: var(--s7) 0; border-bottom: 1px solid var(--line); }
.section--tight { padding: var(--s6) 0; }
.section__title { margin-bottom: var(--s3); }
.section__lede { color: var(--ink-soft); max-width: 48em; margin-bottom: var(--s6); }
.lede { font-size: var(--fs-18); color: var(--ink-soft); }
.fineprint { font-size: var(--fs-13); color: var(--muted); }

/* ---------- 15-point groups (vertical lists only) ---------- */
.groups { list-style: none; margin: 0; padding: 0; }
.group { margin-bottom: var(--s6); }
.group__title {
  display: block;
  margin-bottom: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--line);
}
.group__badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: var(--s2);
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-13);
  vertical-align: middle;
}
.items { list-style: none; margin: 0; padding: 0; }
.item {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item__code {
  display: inline-block;
  min-width: 34px;
  margin-right: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--accent);
}
.item__text { color: var(--ink-soft); }

/* ---------- steps ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.step { padding: var(--s3) 0 var(--s3) var(--s6); position: relative; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: var(--s3);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: var(--fs-13);
  font-weight: 700;
}
.step__title { margin-bottom: var(--s1); }
.step p { color: var(--ink-soft); margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--paper-alt);
  padding: var(--s6) 0;
  font-size: var(--fs-14);
  color: var(--muted);
}
.site-footer__tagline { color: var(--ink-soft); max-width: 46em; }
.site-footer__links { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.site-footer__links li { padding: 2px 0; }
.site-footer__legal { font-size: var(--fs-13); margin: 0; }

/* ---------- >= 768px ---------- */
@media (min-width: 768px) {
  h1 { font-size: 2.75rem; }
  .site-header__inner { display: flex; align-items: center; justify-content: space-between; }
  .site-nav { margin-top: 0; }
  .site-nav__list { display: flex; gap: var(--s5); }
  .site-nav__list li { padding: 0; }
  .checker__row { display: flex; align-items: stretch; gap: var(--s2); }
  .checker__input { margin-bottom: 0; flex: 0 1 380px; }
  .btn { white-space: nowrap; }
}
