/*
 * SprueKit website styles — Precision Workbench Editorial (replica-design).
 * Tokens generated from replica/design/tokens.json and validated with contrast.py (0 AA failures).
 * Rules: colours only via tokens, system fonts only, light mode only,
 * zero JS, no inline styles (CSP: default-src 'none'; style-src 'self'; img-src 'self').
 */

:root {
  /* Color roles */
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --surface-alt: #EFEBE2;
  --surface-tint: #E6E0D3;
  --border: #DDD6C7;
  --border-strong: #B7AEA0;
  --border-input: #5E6B67;
  --text: #1E2927;
  --text-muted: #525D59;
  --accent: #0E5C57;
  --accent-hover: #0A4642;
  --accent-soft: #DCEDEA;
  --on-accent: #FFFFFF;
  --on-accent-muted: #D1E8E4;
  --danger: #B42318;
  --danger-soft: #FEE4E2;
  --success: #166534;
  --success-soft: #DCFCE7;
  --warning: #9A3412;
  --warning-soft: #FFEDD5;

  /* Semantic surfaces & grid hairlines */
  --header-bg: rgba(246, 243, 236, 0.92);
  --grid-line: rgba(30, 41, 39, 0.045);
  --on-accent-surface: rgba(255, 255, 255, 0.09);
  --on-accent-border: rgba(255, 255, 255, 0.22);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-cjk: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-display: clamp(2.25rem, 4.4vw, 3.625rem);
  --fs-h1: clamp(1.875rem, 3.2vw, 2.625rem);
  --fs-h2: clamp(1.3125rem, 2vw, 1.625rem);
  --fs-h3: 1.125rem;
  --fs-lede: clamp(1.0625rem, 1.4vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --lh-body: 1.65;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 48px;
  --s-9: 64px;
  --s-10: 96px;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(30, 41, 39, 0.05), 0 4px 12px rgba(30, 41, 39, 0.06);
  --shadow-elevated: 0 4px 12px rgba(30, 41, 39, 0.08), 0 16px 36px rgba(30, 41, 39, 0.08);
  --shadow-plate: 0 8px 24px rgba(30, 41, 39, 0.10), 0 2px 6px rgba(30, 41, 39, 0.06);

  /* Motion */
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Layout */
  --gutter: 20px;
  --wide: 1140px;
  --measure: 68ch;
  --header-h: 64px;
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

:lang(zh) {
  font-family: var(--font-cjk);
}

html:lang(zh) body {
  line-height: 1.8;
}

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

img {
  height: auto;
  display: block;
}

/* ---------- text ---------- */

h1,
h2,
h3 {
  color: var(--text);
  font-style: normal;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 var(--s-4);
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.28;
  font-weight: 750;
  margin: var(--s-8) 0 var(--s-3);
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.35;
  font-weight: 700;
  margin: var(--s-6) 0 var(--s-2);
}

html:lang(zh) h1,
html:lang(zh) h2,
html:lang(zh) h3 {
  letter-spacing: 0;
}

html:lang(zh) h1 {
  line-height: 1.28;
}

html:lang(zh) h2,
html:lang(zh) h3 {
  line-height: 1.42;
}

p,
ul,
ol {
  margin: 0 0 var(--s-4);
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin-bottom: var(--s-1);
}

strong {
  font-weight: 700;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color var(--motion-fast) var(--motion-ease);
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 1px 6px;
}

.meta {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-muted);
}

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- primitives: tags, pills, buttons ---------- */

.spec-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  margin-bottom: var(--s-4);
}

html:lang(zh) .spec-tag {
  font-family: var(--font-cjk);
  letter-spacing: 0.03em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.status-pill--accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.status-pill--success {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success);
}

.status-pill--warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning);
}

.status-pill--danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 10px 22px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: background var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}

.button:active {
  transform: translateY(0);
}

.button.secondary {
  background: var(--bg);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.button.secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.button.sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--fs-sm);
}

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-2);
  z-index: 40;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.bar {
  max-width: var(--wide);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: var(--s-2) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-6);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: auto;
  padding: var(--s-1) 0;
}

.logo img {
  height: 30px;
  width: auto;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-2);
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

.site-nav a:hover {
  background: var(--surface-alt);
  color: var(--accent);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.nav-short {
  display: none;
}

@media (max-width: 700px) {
  :root {
    --header-h: 112px;
  }

  .bar {
    gap: var(--s-2) var(--s-3);
    padding-top: var(--s-2);
    padding-bottom: var(--s-2);
  }

  .lang-switch {
    order: 2;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
    border-top: 1px solid var(--border);
    padding-top: var(--s-1);
  }

  .site-nav ul {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .nav-long {
    display: none;
  }

  .nav-short {
    display: inline;
  }

  .site-nav a {
    min-height: 34px;
    padding: 4px 8px;
  }
}

.lang-switch ul {
  list-style: none;
  margin: 0;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  gap: 2px;
}

.lang-switch li {
  margin: 0;
  display: flex;
}

.lang-switch a,
.lang-switch span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--motion-fast) var(--motion-ease),
    background var(--motion-fast) var(--motion-ease);
}

.lang-switch a {
  color: var(--text-muted);
}

.lang-switch a:hover {
  color: var(--accent);
  background: transparent;
  text-decoration: none;
}

.lang-switch span[aria-current="true"] {
  background: var(--bg);
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

/* ---------- layout containers ---------- */

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main section,
[id] {
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: var(--s-7) 0 var(--s-6);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: center;
}

@media (min-width: 920px) {
  .hero {
    padding: var(--s-8) 0 var(--s-7);
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--s-8);
  }
}

.hero-text h1 {
  font-size: var(--fs-display);
  line-height: 1.06;
  margin: 0 0 var(--s-4);
}

html:lang(zh) .hero-text h1 {
  line-height: 1.22;
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--text);
  max-width: 36ch;
  margin: 0 0 var(--s-5);
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin: 0 0 var(--s-6);
  box-shadow: var(--shadow-card);
}

.soon::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.hero-action {
  margin: 0;
}

.plate {
  margin: 0;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  box-shadow: var(--shadow-plate);
}

.plate img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.plate figcaption {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
}

/* Borderless editorial photo for Hero & feature plates */
.hero-art {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.hero-art img {
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-plate);
}

.hero-art figcaption {
  border-top: 0;
  padding-top: 0;
  margin-top: var(--s-3);
}

/* ---------- sprue runner divider ---------- */

.runner-wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s-4) var(--gutter) 0;
  color: var(--border-strong);
}

.runner {
  width: 100%;
  height: 24px;
  display: block;
}

/* ---------- workbench section ---------- */

.sheet {
  padding: var(--s-6) 0 var(--s-8);
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: start;
}

@media (min-width: 960px) {
  .sheet-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--s-8);
  }
}

.section-title {
  font-size: var(--fs-h1);
  line-height: 1.18;
  margin-top: 0;
}

.step-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: var(--s-3) 0 var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.step-list li {
  counter-increment: step;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.step-list li::before {
  content: "0" counter(step);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.methods {
  margin: var(--s-3) 0 var(--s-4);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}

@media (min-width: 600px) {
  .methods {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-4);
  }

  .methods > div + div {
    border-left: 1px solid var(--border);
    padding-left: var(--s-4);
  }
}

.methods > div {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.methods dt {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  margin-bottom: 2px;
}

.methods dd {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--text-muted);
}

/* Workbench example card (compact ledger) */

.example {
  margin: 0;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-elevated);
}

.example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-1);
}

.example-tag {
  display: inline-block;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: var(--r-pill);
}

.example-title {
  margin: var(--s-1) 0 var(--s-3);
  font-size: var(--fs-h3);
}

.overall {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
}

.overall-text {
  margin: var(--s-2) 0 0;
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.figure {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.seg-strip {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  margin-top: 6px;
}

.seg-strip-parts {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 0;
}

.seg {
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-tint);
}

.seg.on {
  background: var(--accent);
}

.parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.part {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: var(--s-2) 0;
}

.part:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.part-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

.part-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.part-step {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: var(--r-pill);
}

.part .meta {
  margin: 1px 0 0;
  font-size: var(--fs-xs);
}

.example figcaption {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- paints & recipes ---------- */

.pair {
  padding: var(--s-7) 0;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pair-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}

@media (min-width: 820px) {
  .pair-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
  }
}

.pair-media {
  display: none;
}

.pair-item {
  background: transparent;
  border: 0;
  border-top: 2px solid var(--accent);
  border-radius: 0;
  padding: var(--s-4) 0 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.pair-item h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-h3);
  font-weight: 750;
}

.pair-item h2 {
  margin-top: 0;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}

.swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
}

.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
}

.swatch-dot--teal {
  background: var(--accent);
}

.swatch-dot--ink {
  background: var(--text);
}

.swatch-dot--empty {
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-alt),
    var(--surface-alt) 3px,
    var(--border-strong) 3px,
    var(--border-strong) 4px
  );
}

.recipe-eq {
  margin-top: auto;
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

html:lang(zh) .recipe-eq {
  font-family: var(--font-cjk);
}

/* ---------- around the bench ---------- */

.around {
  padding: var(--s-7) 0 var(--s-8);
}

.around-grid > h2 {
  margin-top: 0;
  margin-bottom: var(--s-5);
  font-size: var(--fs-h1);
}

.pair-head,
.around-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: center;
  margin-bottom: var(--s-6);
}

@media (min-width: 860px) {
  .pair-head,
  .around-head {
    grid-template-columns: 0.95fr 1.05fr;
    gap: var(--s-8);
  }

  .pair-head {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .pair-head > .plate {
    order: -1;
  }
}

.pair-head h2,
.around-head h2 {
  margin: 0 0 var(--s-3);
  font-size: var(--fs-h1);
}

.pair-head .plate,
.around-head .plate {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.pair-head .plate img,
.around-head .plate img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.pair-head .plate figcaption,
.around-head .plate figcaption {
  border-top: 0;
  padding-top: 0;
}

.around-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}

@media (min-width: 820px) {
  .around-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-7);
  }
}

.around-list > div {
  background: transparent;
  border: 0;
  border-top: 2px solid var(--accent);
  border-radius: 0;
  padding: var(--s-4) 0 0;
  box-shadow: none;
}

.around-list > div:hover {
  transform: none;
  box-shadow: none;
}

.around-list dt {
  font-size: var(--fs-h3);
  font-weight: 750;
  color: var(--text);
  margin-bottom: var(--s-2);
}

.around-list dd {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--text-muted);
}

/* ---------- offline & backup (deep accent band) ---------- */

.deep {
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--s-8) 0;
}

.deep h2,
.deep h3 {
  color: var(--on-accent);
}

.deep-points {
  list-style: none;
  padding: 0;
  margin: var(--s-5) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}

@media (min-width: 780px) {
  .deep-points {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-6);
  }
}

.deep-points li {
  margin: 0;
  padding: var(--s-3) 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--on-accent-border);
  border-radius: 0;
  font-weight: 600;
  font-size: var(--fs-body);
}

.deep-note {
  background: var(--on-accent-surface);
  border: 1px solid var(--on-accent-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  max-width: 68ch;
}

.deep-note h3 {
  margin-top: 0;
}

.deep-note p {
  margin-bottom: 0;
  color: var(--on-accent-muted);
}

.deep-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  align-items: center;
}

@media (min-width: 900px) {
  .deep-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--s-8);
  }
}

.deep-art {
  margin: 0;
  background: transparent;
  border: 0;
  padding: 0;
}

.deep-art img {
  width: 100%;
  border-radius: var(--r-md);
}

.deep-art figcaption {
  margin-top: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--on-accent-muted);
}

/* ---------- community ---------- */

.community {
  padding: var(--s-7) 0;
  border-bottom: 1px solid var(--border);
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  align-items: center;
}

.page-media {
  margin: 0 0 var(--s-5);
  max-width: 440px;
}

.page-media img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.page-media figcaption {
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.not-found-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: center;
}

@media (min-width: 780px) {
  .not-found-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
  }
}

.not-found-art {
  margin: 0;
}

.not-found-art img {
  width: 100%;
  border-radius: var(--r-lg);
}

@media (min-width: 820px) {
  .community-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: var(--s-7);
  }
}

.community-grid .label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  margin-bottom: var(--s-3);
}

html:lang(zh) .community-grid .label {
  font-family: var(--font-cjk);
}

.community-grid h2 {
  margin: 0;
}

.community-grid p:last-child {
  margin-bottom: 0;
}

/* ---------- secondary pages & legal docs ---------- */

.page,
.doc-page,
.doc-main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s-8) var(--gutter) var(--s-9);
}

.page-col {
  max-width: 760px;
}

.page-lede {
  font-size: var(--fs-lede);
  color: var(--text-muted);
  margin-bottom: var(--s-6);
}

.contact-block {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin: var(--s-6) 0;
  box-shadow: none;
}

.contact-block h2 {
  margin-top: 0;
}

.contact-block p:last-child {
  margin-bottom: 0;
}

.contact-mail {
  font-size: var(--fs-lg);
  padding: var(--s-2) var(--s-4);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  display: inline-block;
}

.quick-links ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.quick-links li {
  margin: 0;
}

.doc-head {
  margin: 0 0 var(--s-7);
  padding: var(--s-6);
  background-color: var(--surface-alt);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
}

.doc-head h1 {
  margin-bottom: var(--s-3);
}

.doc-head .page-lede {
  margin-bottom: 0;
}

.doc-head .callout {
  margin: var(--s-3) 0 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: none;
  display: inline-block;
  padding: var(--s-2) var(--s-4);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.doc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: start;
}

@media (min-width: 960px) {
  .doc-layout {
    grid-template-columns: 272px minmax(0, 1fr);
    gap: var(--s-8);
  }
}

.toc {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

@media (min-width: 960px) {
  .toc {
    position: sticky;
    top: calc(var(--header-h) + var(--s-5));
  }
}

.toc-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 0 0 var(--s-3);
  padding: 0 var(--s-2);
}

html:lang(zh) .toc-title {
  font-family: var(--font-cjk);
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px var(--s-3);
}

@media (min-width: 960px) {
  .toc ul {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.toc li {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.toc a {
  display: block;
  padding: 6px var(--s-2);
  border-radius: var(--r-xs);
  color: var(--text);
  text-decoration: none;
  transition: background var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

.toc a:hover {
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
}

.doc {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  max-width: var(--measure);
}

.doc > h2 {
  position: relative;
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-strong);
}

.doc > h2::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: var(--r-pill);
}

.doc > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc > h2:first-child::before {
  display: none;
}

.doc.faq > h3 {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}

.callout {
  margin: var(--s-4) 0 var(--s-5);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--warning {
  background: var(--warning-soft);
  border-color: var(--warning-soft);
  border-left-color: var(--warning);
}

.table-wrap {
  margin: var(--s-5) 0 var(--s-7);
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  text-align: left;
}

.table-wrap th,
.table-wrap td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table-wrap thead th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text);
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  padding: var(--s-7) 0 var(--s-8);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}

.footer-nav li {
  margin: 0;
}

.footer-nav a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer p {
  margin: 0;
}
