:root {
  --bg: #F5F0E8;
  --bg-deep: #1A2A3A;
  --bg-deep-2: #223448;
  --ink: #2E2E2E;
  --moss: #6B8E23;
  --clay: #C4572C;
  --volt: #C6FF00;
  --alert: #FF6B35;
  --white: #FFFFFF;
  --line: #D3D0C8;
  --tag: #E8E4DB;
  --text-muted: #6B6B62;
  --font-heading: Montserrat, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-data: 'Roboto Mono', 'SF Mono', Consolas, monospace;
  --rail-w: 284px;
  --header-h: 64px;
  --shadow-card: 8px 8px 0 rgba(45, 62, 80, .14);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--volt); color: var(--bg-deep); }

:focus-visible {
  outline: 3px solid var(--alert);
  outline-offset: 2px;
  border-radius: 2px;
}

main#main-content { flex: 1 0 auto; width: 100%; }

/* ── Skip link ─────────────────────────────── */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 400;
  display: inline-block;
  padding: 10px 18px;
  background: var(--volt);
  color: var(--bg-deep);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border: 2px solid var(--bg-deep);
  border-radius: 0 12px 0 12px;
  transform: translateY(calc(-100% - 24px));
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ── Scroll progress ───────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 320;
  background: rgba(26, 42, 58, .30);
  pointer-events: none;
}
.scroll-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--volt) 0%, var(--alert) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ── Shared brand lockup ───────────────────── */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-sigil {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--volt);
  color: var(--bg-deep);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  border-radius: 3px 14px 3px 14px;
  box-shadow: 3px 3px 0 rgba(196, 87, 44, .75);
  transition: transform .2s ease;
}
.brand-lockup:hover .brand-sigil { transform: rotate(2deg); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.28; }
.brand-name { font-family: var(--font-heading); font-weight: 900; font-size: 20px; letter-spacing: -.01em; line-height: 1.15; color: var(--volt); }
.brand-tagline { font-size: 12px; letter-spacing: .08em; color: rgba(245, 240, 232, .60); }

.version-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--volt);
  border: 1px solid rgba(198, 255, 0, .42);
  border-radius: 0 9px 0 9px;
  background: rgba(198, 255, 0, .08);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 0 2px rgba(198, 255, 0, .24);
  animation: livePulse 2.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(198, 255, 0, .26); }
  50% { box-shadow: 0 0 0 6px rgba(198, 255, 0, .06); }
}

/* ── Header base ───────────────────────────── */
.site-header {
  background: var(--bg-deep);
  color: var(--white);
}
.track-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.track-signal {
  display: flex;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(198, 255, 0, .18);
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .06em;
  line-height: 1.5;
  color: rgba(245, 240, 232, .54);
}

.nav-toggle { display: none; }

/* ── Header: desktop side rail ─────────────── */
@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    z-index: 180;
    border-right: 1px solid rgba(198, 255, 0, .22);
  }

  .brand-track {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 32px 26px 28px 30px;
    overflow-y: auto;
  }
  .brand-track::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10px;
    width: 1px;
    background: repeating-linear-gradient(to bottom, rgba(198, 255, 0, .20) 0 6px, transparent 6px 12px);
    pointer-events: none;
  }

  .track-head { padding-left: 10px; }

  .nav-primary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 52px;
    padding-left: 10px;
  }

  .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-left: 3px solid transparent;
    border-radius: 0 10px 0 10px;
    color: rgba(245, 240, 232, .74);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .02em;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, padding-left .18s ease;
  }
  .nav-link:hover {
    color: var(--volt);
    background: rgba(198, 255, 0, .07);
    border-left-color: var(--volt);
    padding-left: 18px;
  }
  .nav-link[aria-current="page"] {
    color: var(--bg-deep);
    background: var(--volt);
    border-left-color: var(--alert);
    padding-left: 18px;
  }
  .nav-link::after {
    content: "›";
    position: absolute;
    right: 13px;
    top: 50%;
    line-height: 1;
    font-size: 18px;
    font-weight: 900;
    opacity: 0;
    transform: translateY(-50%) translateX(-6px);
    transition: transform .18s ease, opacity .18s ease;
  }
  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  .track-signal { margin-top: auto; }
}

/* ── Header: mobile & tablet ───────────────── */
@media (max-width: 1023.98px) {
  body { padding-top: var(--header-h); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 200;
    border-bottom: 2px solid var(--volt);
  }

  .brand-track {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px 0 16px;
  }
  .brand-track::before { display: none; }
  .track-head { width: 100%; align-items: center; }
  .brand-sigil { width: 38px; height: 38px; font-size: 18px; box-shadow: 2px 2px 0 rgba(196, 87, 44, .75); }
  .brand-name { font-size: 17px; }
  .brand-tagline { display: none; }
  .version-badge { font-size: 10px; padding: 2px 8px; }
  .track-signal { display: none; }

  .nav-primary {
    position: fixed;
    right: 18px;
    bottom: 96px;
    z-index: 220;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: min(340px, calc(100vw - 36px));
    margin: 0;
    padding: 20px;
    background: rgba(34, 52, 72, .97);
    border: 1px solid rgba(198, 255, 0, .45);
    border-radius: 3px 26px 3px 26px;
    box-shadow: 10px 10px 0 rgba(196, 87, 44, .50);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.96);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
  }
  .nav-primary[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .nav-primary .nav-link {
    justify-content: center;
    padding: 11px 8px;
    border: 1px solid rgba(245, 240, 232, .16);
    border-radius: 3px 12px 3px 12px;
    background: rgba(245, 240, 232, .04);
    color: rgba(245, 240, 232, .85);
  }
  .nav-primary .nav-link:hover {
    padding-left: 8px;
    border-color: var(--volt);
    background: rgba(198, 255, 0, .10);
    color: var(--volt);
  }
  .nav-primary .nav-link[aria-current="page"] {
    border-color: var(--alert);
    background: var(--volt);
    color: var(--bg-deep);
  }

  .nav-toggle {
    position: fixed;
    right: 18px;
    bottom: 26px;
    z-index: 240;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 2px solid var(--volt);
    border-radius: 50%;
    background: var(--bg-deep);
    color: var(--volt);
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(198, 255, 0, .28), 6px 6px 0 rgba(196, 87, 44, .85);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
  }
  .nav-toggle:hover { background: rgba(198, 255, 0, .12); }
  .nav-toggle[aria-expanded="true"] {
    background: var(--alert);
    border-color: var(--alert);
    box-shadow: 6px 6px 0 var(--bg-deep);
  }

  .burger-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 2px 0;
    border-radius: 1px;
    background: currentColor;
    transition: transform .22s ease, opacity .22s ease;
  }
  .nav-toggle[aria-expanded="true"] .burger-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .burger-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .burger-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ── Footer ────────────────────────────────── */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(rgba(198, 255, 0, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 255, 0, .05) 1px, transparent 1px);
  background-size: 32px 32px;
  color: rgba(245, 240, 232, .82);
  border-top: 3px solid var(--volt);
}
.site-footer::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -42px;
  width: 300px;
  height: 150px;
  background: repeating-linear-gradient(-45deg, rgba(198, 255, 0, .14) 0 2px, transparent 2px 14px);
  transform: rotate(-4deg);
  pointer-events: none;
}
.footer-meta,
.footer-grid,
.footer-base { position: relative; z-index: 1; }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 18px;
  padding: 16px 36px;
  border-bottom: 1px solid rgba(198, 255, 0, .18);
}
.footer-datastamp,
.footer-status {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(198, 255, 0, .74);
}

.footer-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 2fr 2fr 3fr;
  gap: 44px 34px;
  padding: 52px 36px 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.footer-trust {
  max-width: 36ch;
  padding-left: 16px;
  border-left: 3px solid var(--alert);
  color: rgba(245, 240, 232, .72);
  font-size: 15px;
  line-height: 1.7;
}
.footer-brandline {
  color: rgba(245, 240, 232, .52);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
}
.footer-brandline::before { content: "▍"; color: var(--volt); margin-right: 6px; }

.footer-heading {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--volt);
}
.footer-heading i {
  margin-right: 6px;
  font-family: var(--font-data);
  font-style: normal;
  font-size: 12px;
  color: var(--alert);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-nav-legal {
  border-left: 1px solid rgba(198, 255, 0, .14);
  padding-left: 18px;
}
.footer-link {
  display: inline-block;
  width: fit-content;
  color: rgba(245, 240, 232, .70);
  text-decoration: none;
  font-size: 14px;
  transition: color .16s ease, padding-left .16s ease;
}
.footer-link:hover { color: var(--volt); padding-left: 4px; }

.footer-contact { display: flex; flex-direction: column; gap: 12px; }
.contact-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: rgba(245, 240, 232, .80);
  font-size: 13px;
  line-height: 1.6;
}
.contact-row::before {
  content: attr(data-label);
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--alert);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 28px;
  padding: 18px 36px 24px;
  border-top: 1px solid rgba(198, 255, 0, .16);
  font-family: var(--font-data);
  font-size: 12px;
  color: rgba(245, 240, 232, .52);
}

@media (max-width: 1023.98px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 28px; padding: 44px 24px 40px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer-meta { padding: 14px 20px; }
  .footer-grid { grid-template-columns: 1fr; padding: 36px 20px 32px; }
  .footer-nav-legal { border-left: 0; padding-left: 0; }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 20px 22px; }
}

/* ── Shared base components ────────────────── */
.container {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
}

.section { padding-block: clamp(56px, 9vw, 120px); }
.section-dark {
  background: var(--bg-deep);
  color: rgba(245, 240, 232, .85);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--clay);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "●";
  font-size: 9px;
  color: var(--moss);
}

.page-title {
  margin: 0;
  color: var(--bg-deep);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: .98;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.section-dark .page-title { color: var(--white); }

.lede {
  max-width: 66ch;
  color: #4D4B45;
  font-size: 18px;
  line-height: 1.6;
}
.section-dark .lede { color: rgba(245, 240, 232, .74); }

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--tag);
  border-left: 3px solid var(--clay);
  border-radius: 1px 8px 1px 8px;
  color: var(--bg-deep);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
}
.section-dark .tag { background: rgba(245, 240, 232, .10); color: var(--volt); }

.stat {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
  color: var(--bg-deep);
}
.stat em { font-style: normal; color: var(--clay); }
.section-dark .stat { color: var(--volt); }
.section-dark .stat em { color: var(--alert); }

.stat-label {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 2px 14px 2px 14px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--clay); color: #FFFFFF; box-shadow: 5px 5px 0 rgba(26, 42, 58, .25); }
.btn-primary:hover { background: #A94A22; }
.btn-data { background: var(--volt); color: var(--bg-deep); box-shadow: 5px 5px 0 var(--moss); }
.btn-ghost { border-color: var(--bg-deep); color: var(--bg-deep); }
.btn-ghost:hover { background: rgba(26, 42, 58, .06); }
.section-dark .btn-ghost { border-color: rgba(245, 240, 232, .6); color: var(--white); }
.section-dark .btn-ghost:hover { background: rgba(245, 240, 232, .08); }

.card {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px 18px 3px 18px;
  box-shadow: 6px 6px 0 rgba(45, 62, 80, .10);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 10px 10px 0 rgba(45, 62, 80, .14); }
.card[data-tilt] { transform: rotate(-1.2deg); }
.card[data-tilt]:hover { transform: rotate(-1.2deg) translateY(-3px); }
.card-dark {
  background: var(--bg-deep);
  border-color: var(--bg-deep);
  color: rgba(245, 240, 232, .82);
  box-shadow: 6px 6px 0 rgba(198, 255, 0, .14);
}
.card-dark:hover { box-shadow: 10px 10px 0 rgba(198, 255, 0, .20); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

@media (max-width: 1023.98px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(90deg, rgba(198, 255, 0, .10) 1px, transparent 1px),
    linear-gradient(rgba(198, 255, 0, .10) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: 3px 22px 3px 22px;
  box-shadow: var(--shadow-card);
}
.media-frame::after {
  content: "GRAPHIC / 图像位";
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 4px 10px;
  background: rgba(26, 42, 58, .84);
  border-radius: 2px 8px 2px 8px;
  color: var(--volt);
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .18em;
}
.media-frame[data-label]::after { content: attr(data-label); }
.media-frame[data-ratio="tall"] { aspect-ratio: 3 / 4; }
.media-frame[data-ratio="wide"] { aspect-ratio: 21 / 9; }
.media-frame[data-ratio="square"] { aspect-ratio: 1 / 1; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 14px 0;
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 12px;
}
.breadcrumb a { color: var(--moss); text-decoration: none; }
.breadcrumb a:hover { color: var(--clay); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 700; }

.rule {
  position: relative;
  height: 1px;
  margin: 40px 0;
  border: 0;
  background: var(--line);
}
.rule::after {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--moss);
}

.data-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-data);
  font-size: 14px;
}
.data-line .data-value { margin-left: auto; font-weight: 700; color: var(--bg-deep); }
.data-line .data-value em { font-style: normal; color: var(--clay); }

details.fold {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px 14px 3px 14px;
  box-shadow: 4px 4px 0 rgba(45, 62, 80, .08);
}
details.fold summary {
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; margin-left: 8px; color: var(--clay); font-family: var(--font-data); }
details.fold[open] summary::after { content: "–"; }
details.fold .fold-body { padding: 0 20px 18px; color: #4D4B45; font-size: 15px; }

/* ── Scroll reveal (JS 增强) ───────────────── */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.js [data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}

/* ── Reduced motion ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .live-dot { animation: none; }
}
