/* ==========================================================================
   Welcome to Shenzhen · APEC 2026
   Global design system.  Single source of truth for tokens + shared classes.
   ========================================================================== */

:root {
  --ink: #06141f;
  --ink-2: #0b2133;
  --ink-3: #14324a;
  --paper: #f4f8fa;
  --card: #ffffff;
  --surface-muted: #eaf1f4;
  color-scheme: light;

  --teal: #0e7c86;
  --teal-d: #085b63;
  --azure: #1e93e8;
  --azure-d: #0f6cae;
  --seafoam: #3fd0c9;
  --coral: #ff6b4a;
  --gold: #f2b544;

  --text: #10202c;
  --muted: #5d7285;
  --line: rgba(6, 20, 31, 0.1);
  --line-2: rgba(6, 20, 31, 0.06);

  --grad-hero: linear-gradient(150deg, #04101a 0%, #062b3e 42%, #0a5f6b 78%, #16a3a0 100%);
  --grad-brand: linear-gradient(96deg, #0e7c86 0%, #1e93e8 62%, #3fd0c9 100%);
  --grad-warm: linear-gradient(96deg, #ff6b4a 0%, #f2b544 100%);
  --grad-card: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(6,20,31,0.04) 100%);

  --shadow-s: 0 1px 2px rgba(6, 20, 31, 0.06), 0 2px 8px rgba(6, 20, 31, 0.05);
  --shadow-m: 0 2px 6px rgba(6, 20, 31, 0.06), 0 12px 32px rgba(6, 20, 31, 0.09);
  --shadow-l: 0 10px 40px rgba(6, 20, 31, 0.16), 0 2px 8px rgba(6, 20, 31, 0.08);

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --r-pill: 999px;

  --wrap: 1180px;
  --pad: clamp(1rem, 4vw, 2.5rem);
  --sec-y: clamp(3rem, 7vw, 5.5rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  line-height: 1.7;
  font-size: 16px;
  overflow-wrap: break-word;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--azure-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: .35em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
:focus-visible { outline: 3px solid var(--azure); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--sec-y); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }
.section--alt { background: var(--card); }
.section--ink { background: var(--ink-2); color: rgba(255,255,255,.86); }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink .lede, .section--ink .muted { color: rgba(255,255,255,.68); }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.75rem; }

/* ---------- type ---------- */
.display, h1.display {
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.lede { font-size: clamp(1.02rem, 2vw, 1.22rem); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: var(--mono); }
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--teal);
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad-brand);
}
.section-head { max-width: 68ch; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); }

/* ---------- header ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--card); color: var(--text); padding: .7rem 1rem; border-radius: 0 0 var(--r-s) 0;
}
.skip-link:focus { left: 0; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 20, 31, 0.86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: .98rem; letter-spacing: -0.01em; }
.brand-text span { font-size: .62rem; letter-spacing: .18em; color: var(--seafoam); text-transform: uppercase; }

.nav { margin-left: auto; display: flex; align-items: center; }
.nav ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav a {
  display: block; padding: .5rem .62rem; border-radius: var(--r-pill);
  color: rgba(255,255,255,.8); font-size: .875rem; font-weight: 600; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--grad-brand); color: #fff; }
.nav a.is-cta { background: var(--coral); color: #fff; }
.nav a.is-cta:hover { background: #ff8163; }
.nav-toggle {
  display: none; margin-left: auto; background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-s);
  padding: .45rem .7rem; font-size: .95rem; cursor: pointer; line-height: 1;
}

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: rgba(6, 20, 31, 0.98); border-bottom: 1px solid rgba(255,255,255,.1);
    display: none; padding: .6rem var(--pad) 1.1rem;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: .1rem; }
  .nav a { padding: .7rem .8rem; border-radius: var(--r-s); font-size: .95rem; }
}

/* ---------- language switching ---------- */
[data-lang="zh"] .lang-en { display: none !important; }
[data-lang="en"] .lang-zh { display: none !important; }

.lang-switch {
  display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-pill); padding: 2px; margin-left: .35rem;
}
.lang-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: rgba(255, 255, 255, 0.72); font: inherit; font-size: .8rem; font-weight: 700;
  padding: .3rem .68rem; border-radius: var(--r-pill); line-height: 1.3;
  transition: background .15s ease, color .15s ease;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button.is-on { background: var(--grad-brand); color: #fff; }
@media (max-width: 1080px) {
  .lang-switch { margin-left: auto; order: 2; }
  .nav-toggle { order: 3; margin-left: .4rem; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--grad-hero);
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 8vw, 6rem);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 380px at 82% 8%, rgba(63, 208, 201, .22), transparent 68%),
    radial-gradient(600px 300px at 8% 92%, rgba(255, 107, 74, .16), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.2rem, 6.4vw, 4.15rem); letter-spacing: -0.035em; }
.hero .lede { color: rgba(255,255,255,.8); }
.hero-panel {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-l);
  padding: clamp(1.2rem, 3vw, 1.9rem);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-panel h2 { font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; color: var(--seafoam); }
.hero-cover {
  border-radius: var(--r-l); overflow: hidden; border: 1px solid rgba(255,255,255,.18);
  box-shadow: var(--shadow-l);
}

/* photographic hero: keep the skyline band in frame, and let it show through the scrim */
.hero--photo {
  background-image:
    linear-gradient(102deg, rgba(4, 14, 24, .78) 0%, rgba(4, 20, 32, .58) 32%, rgba(6, 32, 44, .28) 64%, rgba(8, 44, 52, .16) 100%),
    url("img/hero-cover.jpg");
  background-size: cover;
  background-position: center 36%;
  background-repeat: no-repeat;
}
@media (max-width: 900px) {
  .hero--photo {
    background-image:
      linear-gradient(180deg, rgba(4, 14, 24, .72) 0%, rgba(4, 18, 28, .48) 42%, rgba(6, 28, 40, .34) 100%),
      url("img/hero-cover.jpg");
    background-position: 68% 40%;
  }
}
.hero--photo::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(620px 300px at 76% 104%, rgba(255, 168, 110, .26), transparent 72%),
              radial-gradient(520px 260px at 96% 88%, rgba(63, 208, 201, .20), transparent 70%);
}

/* page hero (inner pages) */
.page-hero {
  background: var(--grad-hero); color: #fff; padding-block: clamp(2.4rem, 6vw, 4.2rem);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(760px 320px at 88% 0%, rgba(63,208,201,.2), transparent 70%);
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(1.85rem, 4.6vw, 3rem); letter-spacing: -0.028em; }
.page-hero .lede { color: rgba(255,255,255,.78); }
.crumbs { font-size: .82rem; color: rgba(255,255,255,.6); margin-bottom: .8rem; }
.crumbs a { color: rgba(255,255,255,.82); }
.crumbs span { opacity: .5; margin-inline: .4rem; }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.25rem; border-radius: var(--r-pill);
  font-weight: 700; font-size: .93rem; border: 1px solid transparent;
  cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 20px rgba(14,124,134,.32); }
.btn--coral { background: var(--coral); color: #fff; box-shadow: 0 6px 20px rgba(255,107,74,.3); }
.btn--ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--line { border-color: var(--line); background: var(--card); color: var(--text); }
.btn--line:hover { border-color: var(--teal); color: var(--teal-d); }
.btn--sm { padding: .5rem .9rem; font-size: .84rem; }

/* ---------- grid + card ---------- */
.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: start; }
@media (max-width: 900px) { .grid--sidebar { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: clamp(1.1rem, 2.4vw, 1.6rem); box-shadow: var(--shadow-s);
  position: relative; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card--pad-lg { padding: clamp(1.4rem, 3vw, 2rem); }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: rgba(14,124,134,.32); }
.card--flat { box-shadow: none; }
.card--ink { background: var(--ink-2); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.85); }
.card--ink h3, .card--ink h4 { color: #fff; }
.card--accent { border-top: 3px solid; border-image: var(--grad-brand) 1; }
.card h3 { font-size: 1.08rem; margin-bottom: .4rem; }
.card h4 { font-size: .98rem; margin-bottom: .35rem; }
.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }
.card-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(14,124,134,.1); color: var(--teal-d); font-size: 1.25rem; margin-bottom: .8rem;
  overflow: hidden; flex: 0 0 auto;
}
.card-icon svg {
  width: 22px; height: 22px; display: block;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.card-icon svg [data-fill="1"] { fill: currentColor; stroke: none; }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-link:hover h3 { color: var(--teal-d); }

/* ---------- stat ---------- */
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat b { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; color: var(--teal-d); }
.stat span { font-size: .84rem; color: var(--muted); }
.card--ink .stat b { color: var(--seafoam); }
.card--ink .stat span { color: rgba(255,255,255,.62); }
.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ---------- chips / tags / pills ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .32rem .72rem; border-radius: var(--r-pill);
  background: rgba(14,124,134,.09); color: var(--teal-d);
  font-size: .8rem; font-weight: 600; border: 1px solid rgba(14,124,134,.16);
}
.chip--coral { background: rgba(255,107,74,.1); color: #d8431f; border-color: rgba(255,107,74,.2); }
.chip--gold { background: rgba(242,181,68,.16); color: #9a6a05; border-color: rgba(242,181,68,.3); }
.chip--ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.22); }
.chip--muted { background: rgba(93,114,133,.1); color: var(--muted); border-color: var(--line); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.badge {
  position: absolute; top: -.55rem; right: 1rem;
  background: var(--grad-warm); color: #fff; font-size: .68rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; padding: .2rem .6rem; border-radius: var(--r-pill);
}

/* ---------- callout ---------- */
.callout {
  border-left: 4px solid var(--teal); background: rgba(14,124,134,.06);
  border-radius: 0 var(--r-m) var(--r-m) 0; padding: 1rem 1.2rem; margin-block: 1.25rem;
}
.callout--warn { border-color: var(--gold); background: rgba(242,181,68,.1); }
.callout--coral { border-color: var(--coral); background: rgba(255,107,74,.07); }
.callout > :last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }
.callout-title { display: block; font-weight: 700; margin-bottom: .25rem; font-size: .92rem; letter-spacing: .01em; }

/* ---------- key-value list ---------- */
.kv { list-style: none; margin: 0; padding: 0; }
.kv li {
  display: grid; grid-template-columns: minmax(88px, 34%) 1fr; gap: .75rem;
  padding: .62rem 0; border-bottom: 1px dashed var(--line); margin: 0;
}
.kv li:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--muted); font-size: .86rem; font-weight: 600; }
.kv .v { font-size: .94rem; }

/* ---------- table ---------- */
.table-wrap {
  overflow-x: auto; overscroll-behavior-x: contain;
  max-width: 100%; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
thead th {
  background: rgba(6,20,31,.045); text-align: left; font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: .68rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(30,147,232,.04); }

/* ---------- steps / timeline ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  position: relative; padding-left: 3rem; padding-bottom: 1.5rem; counter-increment: step;
  border-left: 2px solid var(--line); margin-left: 1rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: -1rem; top: -.15rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  font-size: .84rem; font-weight: 800;
}
.steps h3 { font-size: 1.02rem; margin-bottom: .25rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid; grid-template-columns: 96px 1fr; gap: 1rem;
  padding: .85rem 0; border-bottom: 1px solid var(--line-2);
}
.timeline > li:last-child { border-bottom: 0; }
.timeline .t { font-weight: 800; color: var(--teal-d); font-size: .88rem; }

/* ---------- feature list ---------- */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li::before {
  content: ""; position: absolute; left: .2rem; top: .58rem;
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--grad-brand);
}
.ticks--check li::before {
  content: "✓"; width: auto; height: auto; background: none; color: var(--teal);
  font-weight: 800; left: 0; top: 0;
}

/* ---------- media / figures ---------- */
.media { border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); background: var(--surface-muted); }
.media img { width: 100%; }
.media--tall img { aspect-ratio: 4 / 3; object-fit: cover; }
figure { margin: 0; }
figcaption { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* Official metro map: pan/zoom via native scroll on phone */
.map-frame {
  border-radius: var(--r-m); border: 1px solid var(--line); background: var(--card);
  overflow: auto; -webkit-overflow-scrolling: touch;
  max-height: min(72vh, 820px); overscroll-behavior: contain;
}
.map-frame img {
  width: auto; max-width: none; height: auto;
  min-width: min(100%, 720px); display: block; margin-inline: auto;
}
.map-frame--contain img { width: 100%; min-width: 0; }
@media (min-width: 900px) {
  .map-frame img { width: 100%; min-width: 0; }
}

/* ---------- district tiles ---------- */
.tile {
  position: relative; display: block; border-radius: var(--r-m); overflow: hidden;
  min-height: 168px; color: #fff; padding: 1.1rem; text-decoration: none;
  background: var(--grad-hero); border: 1px solid rgba(255,255,255,.1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,20,31,0) 30%, rgba(6,20,31,.72) 100%);
}
.tile > * { position: relative; z-index: 1; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); text-decoration: none; }
.tile b { display: block; font-size: 1.06rem; }
.tile small { color: rgba(255,255,255,.75); font-size: .8rem; }
.tile .tile-body { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1.05rem; z-index: 2; }

/* ---------- accordion ---------- */
.faq { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--card); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; font-size: .97rem;
  list-style: none; display: flex; gap: .8rem; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--teal); font-weight: 800; font-size: 1.15rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { background: rgba(14,124,134,.05); }
.faq .faq-body { padding: 0 1.2rem 1.1rem; }
.faq .faq-body > :last-child { margin-bottom: 0; }

/* ---------- toc ---------- */
.toc { position: sticky; top: 82px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc a {
  display: block; padding: .42rem .7rem; border-radius: var(--r-s);
  font-size: .87rem; color: var(--muted); border-left: 2px solid var(--line);
}
.toc a:hover, .toc a.is-active {
  background: rgba(14,124,134,.07); color: var(--teal-d); border-left-color: var(--teal);
  text-decoration: none;
}
@media (max-width: 900px) { .toc { position: static; } }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.62);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; font-size: .9rem;
}
.footer-grid {
  display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.3fr) repeat(auto-fit, minmax(150px, 1fr));
  padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.site-footer h3 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: rgba(255,255,255,.68); }
.site-footer a:hover { color: var(--seafoam); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; justify-content: space-between;
  padding-top: 1.5rem; font-size: .8rem; color: rgba(255,255,255,.45);
}

/* ---------- source note ---------- */
.note-src {
  border: 1px dashed var(--line); border-radius: var(--r-m);
  background: rgba(6,20,31,.02); padding: .9rem 1.1rem;
  font-size: .84rem; color: var(--muted);
}
.note-src > :last-child { margin-bottom: 0; }
.note-src b { color: var(--text); }

/* ---------- utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card--hover:hover, .tile:hover { transform: none; }
}
.back-to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad-brand); color: #fff; font-size: 1.1rem; box-shadow: var(--shadow-m);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- progressive highlight on scroll ---------- */
.timeline > li, .steps > li {
  transition: opacity .35s ease, transform .35s ease, border-color .35s ease;
}
.timeline > li.is-in, .steps > li.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .timeline > li:not(.is-in), .steps > li:not(.is-in) {
    opacity: .42; transform: translateY(6px);
  }
  .timeline > li.is-in .t, .steps > li.is-in::before { color: var(--teal-d); }
}

/* ---------- dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #07141c;
    --card: #102433;
    --surface-muted: #0c1c28;
    --text: #e6f0f5;
    --muted: #a9bccd;
    --line: rgba(232, 244, 248, 0.12);
    --line-2: rgba(232, 244, 248, 0.07);
    --teal-d: #7ee0dc;
    --azure-d: #8ecfff;
    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-m: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-l: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
  .chip--coral { color: #ffb0a0; }
  .chip--gold { color: #f3d48a; }
  .card-icon { background: rgba(63, 208, 201, 0.12); color: var(--seafoam); }
  thead th { background: rgba(255, 255, 255, 0.05); }
  tbody tr:hover { background: rgba(142, 207, 255, 0.08); }
  .note-src { background: rgba(255, 255, 255, 0.04); }
}

/* ---------- printable pocket card ---------- */
.print-card {
  border: 1px dashed var(--line); border-radius: var(--r-m);
  padding: 1.1rem 1.25rem; background: var(--card);
}
.print-card h3 { margin-bottom: .35rem; }
@media print {
  .site-header, .site-footer, .back-to-top, .toc, .lang-switch, .nav-toggle,
  .hero, .page-hero, .btn-row, .chip-row { display: none !important; }
  :root { color-scheme: light; }
  body { background: #fff; font-size: 11pt; color: #000; }
  .card, .print-card, .callout, .faq details { break-inside: avoid; box-shadow: none; }
  .print-only { display: block !important; }
  a[href]::after { content: none; }
  .lang-zh, .lang-en { display: none !important; }
  [data-lang="en"] .lang-en, [data-lang="zh"] .lang-zh { display: block !important; }
  [data-lang="en"] span.lang-en, [data-lang="zh"] span.lang-zh { display: inline !important; }
  .print-card {
    border: 1.5pt solid #222; border-radius: 0; padding: 12mm;
    page-break-inside: avoid; max-width: 100%;
  }
  .print-card h2, .print-card h3 { color: #000; }
}
.print-only { display: none; }
