/* ==========================================================================
   AOA赛场 — shared shell stylesheet (/assets/site.css)
   reset · tokens · typography · header · footer · primitives
   ========================================================================== */

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

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

body,
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, pre {
  margin: 0;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

/* ---------- tokens ---------- */
:root {
  --ink-900: #07120F;
  --ink-800: #0C1E19;
  --ink-700: #14302A;
  --grid-600: #1E3B33;
  --moss-500: #4E7A5E;
  --rock-400: #8C9A93;
  --mist-100: #E8F0EA;
  --pulse-400: #35F0A8;
  --pulse-700: #0B7A53;
  --amber-400: #F2B237;
  --clay-500: #B4623C;
  --sand-200: #D9CDB6;

  --rail-w: 88px;
  --bar-h: 66px;
  --gutter: clamp(16px, 4vw, 40px);
  --frame: 1180px;

  --font-display: "Barlow Condensed", "Oswald", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-12: 12px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-21: 21px;
  --fs-28: 28px;
  --fs-40: 40px;
  --fs-64: 64px;
  --fs-96: 96px;

  --rule: 1px solid var(--grid-600);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- base ---------- */
html { scroll-padding-top: calc(var(--bar-h) + 24px); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  position: relative;
  min-height: 100vh;
  background: var(--ink-900);
  color: var(--mist-100);
  font-family: var(--font-body);
  font-size: var(--fs-17);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* blueprint grid + night-light wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(30, 59, 51, .55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 59, 51, .55) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .5;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 380px at 88% -6%, rgba(53, 240, 168, .10), transparent 70%),
    radial-gradient(520px 320px at 2% 96%, rgba(242, 178, 55, .06), transparent 72%);
}

::selection {
  background: var(--pulse-400);
  color: var(--ink-900);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--pulse-400);
  outline-offset: 3px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--pulse-400);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  letter-spacing: .08em;
  transform: translateY(-180%);
  transition: transform .18s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- main content offset ---------- */
#main-content {
  position: relative;
  z-index: 1;
  padding-block: calc(var(--bar-h) + clamp(28px, 5vw, 56px)) clamp(56px, 8vw, 96px);
  padding-inline: var(--gutter);
  min-height: 60vh;
}

@media (min-width: 1024px) {
  #main-content {
    padding-left: calc(var(--rail-w) + var(--gutter));
  }
}

.container {
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
}

/* ==========================================================================
   header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
}

.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--bar-h);
  padding-inline: var(--gutter);
  background: rgba(7, 18, 15, .94);
  border-bottom: 1px solid var(--grid-600);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body[data-scrolled="true"] .header-bar {
  box-shadow: 0 12px 28px rgba(3, 9, 7, .55);
}

@media (min-width: 1024px) {
  .header-bar {
    padding-left: calc(var(--rail-w) + var(--gutter));
    gap: 22px;
  }
}

/* brand */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  flex: none;
}

.brand-mark__glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  background: var(--pulse-400);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: var(--fs-21);
  font-weight: 700;
  line-height: 1;
  transform: skewX(-6deg);
}

.brand-mark__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 1px;
}

.brand-mark__name {
  font-family: var(--font-display);
  font-size: var(--fs-21);
  font-weight: 700;
  letter-spacing: .05em;
  transform: skewX(-4deg);
  transform-origin: left center;
}

.brand-mark__desc {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .14em;
  color: var(--rock-400);
}

.brand-mark:hover .brand-mark__desc { color: var(--pulse-400); }

/* header utilities */
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  min-width: 216px;
  border: 1px solid var(--grid-600);
  background: rgba(12, 30, 25, .78);
  color: var(--rock-400);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .07em;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}

.search-entry:hover,
.search-entry:focus-visible {
  border-color: var(--pulse-700);
  background: var(--ink-800);
  color: var(--mist-100);
}

.search-entry__icon {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  flex: none;
}

.search-entry__icon::before {
  content: "";
  position: absolute;
  inset: 0 4px 4px 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.search-entry__icon::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 6px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: right center;
}

.search-entry__hint {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-entry__key {
  margin-left: auto;
  padding: 0 5px;
  border: 1px solid var(--grid-600);
  color: var(--moss-500);
  line-height: 1.5;
}

.search-entry--wide {
  width: 100%;
  min-width: 0;
  height: 44px;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: var(--fs-15);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  text-align: center;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.btn--primary {
  background: var(--pulse-400);
  color: var(--ink-900);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--pulse-700);
  color: var(--mist-100);
}

.btn--ghost {
  background: transparent;
  border-color: var(--grid-600);
  color: var(--mist-100);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--pulse-400);
  color: var(--pulse-400);
}

.btn--sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: var(--fs-13);
  letter-spacing: .04em;
}

.btn--block { width: 100%; }

/* mobile toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 1px solid var(--grid-600);
  background: rgba(12, 30, 25, .82);
  color: var(--mist-100);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .12em;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}

.nav-toggle[aria-expanded="true"] {
  border-color: var(--pulse-400);
  color: var(--pulse-400);
}

.nav-toggle__box {
  position: relative;
  display: block;
  width: 18px;
  height: 11px;
  flex: none;
}

.nav-toggle__box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform .22s var(--ease), opacity .16s var(--ease);
}

.nav-toggle__box span:nth-child(1) { top: 0; }
.nav-toggle__box span:nth-child(2) { top: 4.5px; }
.nav-toggle__box span:nth-child(3) { top: 9px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(1) {
  transform: translateY(4.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(2) { opacity: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(3) {
  transform: translateY(-4.5px) rotate(-45deg);
}

/* scroll progress */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--pulse-700), var(--pulse-400) 72%, var(--amber-400));
  box-shadow: 0 0 12px rgba(53, 240, 168, .5);
  transition: width .12s linear;
}

/* ---------- vertical rail navigation ---------- */
.rail-nav {
  position: fixed;
  top: var(--bar-h);
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 110;
  display: flex;
  flex-direction: column;
  padding: 18px 0 14px;
  overflow-y: auto;
  background: rgba(7, 18, 15, .96);
  border-right: 1px solid var(--grid-600);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.rail-nav__head {
  margin: 0 0 14px;
  padding: 0 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--grid-600);
}

.rail-nav__cap,
.rail-nav__range {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .14em;
  line-height: 1.4;
}

.rail-nav__cap { color: var(--rock-400); }
.rail-nav__range { color: var(--moss-500); }

.rail-nav__list {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
}

.rail-nav__list::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--grid-600);
}

.rail-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 54px;
  padding: 9px 4px 9px 10px;
  color: var(--rock-400);
  transition: color .2s var(--ease), background .2s var(--ease);
}

.rail-link::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 17px;
  width: 7px;
  height: 1px;
  background: var(--moss-500);
}

.rail-link__index {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .12em;
  line-height: 1;
  color: var(--moss-500);
}

.rail-link__label {
  font-size: var(--fs-12);
  line-height: 1.3;
  letter-spacing: .02em;
  font-weight: 500;
}

.rail-link:hover,
.rail-link:focus-visible {
  color: var(--mist-100);
  background: rgba(30, 59, 51, .55);
}

.rail-link[aria-current="page"] { color: var(--pulse-400); }

.rail-link[aria-current="page"] .rail-link__index { color: var(--amber-400); }

.rail-link[aria-current="page"]::before { background: var(--pulse-400); }

.rail-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 14.5px;
  width: 5px;
  height: 5px;
  background: var(--pulse-400);
  box-shadow: 0 0 0 3px rgba(53, 240, 168, .16), 0 0 12px rgba(53, 240, 168, .7);
  animation: rail-pulse 2.4s ease-in-out infinite;
}

@keyframes rail-pulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

.rail-nav__extra { display: none; }

/* ==========================================================================
   footer
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 1;
  padding-block: clamp(36px, 6vw, 68px) 26px;
  padding-inline: var(--gutter);
  background: linear-gradient(180deg, rgba(12, 30, 25, .92), var(--ink-900) 72%);
  border-top: 1px solid var(--grid-600);
}

@media (min-width: 1024px) {
  .site-footer { padding-left: calc(var(--rail-w) + var(--gutter)); }
}

.footer-frame {
  max-width: var(--frame);
  margin-inline: auto;
}

.footer-top {
  display: grid;
  gap: clamp(26px, 5vw, 52px);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: minmax(220px, 1fr) 1.7fr;
    align-items: start;
  }
}

.footer-brand__mark {
  font-family: var(--font-display);
  font-size: var(--fs-28);
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.1;
  transform: skewX(-4deg);
  transform-origin: left center;
}

.footer-brand__line {
  margin-top: 6px;
  font-size: var(--fs-15);
  color: var(--rock-400);
}

.footer-brand__coords {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .14em;
  color: var(--moss-500);
}

.footer-cols {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.footer-col__title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grid-600);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--amber-400);
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-col__list a {
  font-size: var(--fs-15);
  color: var(--rock-400);
  transition: color .18s var(--ease);
}

.footer-col__list a:hover,
.footer-col__list a:focus-visible { color: var(--pulse-400); }

.footer-contact {
  margin-top: clamp(26px, 5vw, 44px);
  padding-top: 18px;
  border-top: 1px solid var(--grid-600);
  display: grid;
  gap: 6px;
}

.footer-contact__line {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  letter-spacing: .02em;
  color: var(--mist-100);
  overflow-wrap: anywhere;
}

.footer-contact__note {
  font-size: var(--fs-13);
  line-height: 1.7;
  color: var(--rock-400);
  max-width: 76ch;
}

.footer-base {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--grid-600);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .08em;
  color: var(--rock-400);
}

.footer-base__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-base__legal a { color: var(--rock-400); }

.footer-base__legal a:hover,
.footer-base__legal a:focus-visible { color: var(--pulse-400); }

.footer-base__icp { color: var(--moss-500); }

@media (min-width: 900px) {
  .footer-base__icp { margin-left: auto; }
}

/* ==========================================================================
   primitives used by page-level layouts
   ========================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rock-400);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-40);
  line-height: 1;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  color: var(--mist-100);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--sand-200);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .08em;
  line-height: 1.5;
}

.tag--dark {
  background: var(--ink-700);
  color: var(--mist-100);
  border: 1px solid var(--grid-600);
}

.tag--amber {
  background: transparent;
  border: 1px solid var(--amber-400);
  color: var(--amber-400);
}

.hairline {
  border: 0;
  border-top: 1px solid var(--grid-600);
  margin-block: clamp(22px, 4vw, 38px);
}

.prose {
  max-width: 68ch;
  font-size: var(--fs-17);
  line-height: 1.75;
}

.prose p + p { margin-top: 1.2em; }

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin-top: 1.8em;
  margin-bottom: .5em;
}

.prose h2 { font-size: var(--fs-28); }
.prose h3 { font-size: var(--fs-21); }

.prose a {
  color: var(--pulse-400);
  border-bottom: 1px solid var(--pulse-700);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .08em;
  color: var(--rock-400);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--moss-500);
}

.breadcrumb a { color: var(--rock-400); }
.breadcrumb a:hover,
.breadcrumb a:focus-visible { color: var(--pulse-400); }

/* image containers (page stage drops media inside) */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink-800);
  border: 1px solid var(--grid-600);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 3 / 4; }

.media-frame__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: 5px 10px;
  background: rgba(7, 18, 15, .86);
  color: var(--sand-200);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .08em;
  line-height: 1.5;
}

/* segmented control (accessible tabs) */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--grid-600);
  background: var(--ink-800);
}

.segmented__btn {
  min-height: 44px;
  padding: 0 18px;
  border-right: 1px solid var(--grid-600);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  letter-spacing: .08em;
  color: var(--rock-400);
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}

.segmented__btn:last-child { border-right: 0; }

.segmented__btn:hover { color: var(--mist-100); }

.segmented__btn[aria-selected="true"] {
  background: var(--ink-700);
  color: var(--pulse-400);
  box-shadow: inset 0 -2px 0 var(--pulse-400);
}

.segment-panel[hidden] { display: none; }

/* ==========================================================================
   responsive: rail collapses into a bottom drawer
   ========================================================================== */
@media (max-width: 1023px) {
  .header-tools { display: none; }
  .nav-toggle { display: inline-flex; }

  .rail-nav {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 84vh;
    padding: 16px var(--gutter) calc(18px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--grid-600);
    background: var(--ink-900);
    transform: translateY(101%);
    transition: transform .3s var(--ease);
    overflow-y: auto;
  }

  .rail-nav[data-open="true"] {
    transform: translateY(0);
    box-shadow: 0 -18px 40px rgba(3, 9, 7, .6);
  }

  .rail-nav__head {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 0 10px;
    margin-bottom: 12px;
  }

  .rail-nav__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-left: 0;
  }

  .rail-nav__list::before { display: none; }

  .rail-link {
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid var(--grid-600);
    background: rgba(12, 30, 25, .6);
  }

  .rail-link::before { display: none; }

  .rail-link[aria-current="page"] {
    border-color: var(--pulse-700);
    background: var(--ink-800);
  }

  .rail-link[aria-current="page"]::after {
    left: auto;
    right: 12px;
    top: 14px;
  }

  .rail-link__index { font-size: var(--fs-12); }

  .rail-link__label { font-size: var(--fs-15); }

  .rail-nav__extra {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--grid-600);
  }
}

@media (max-width: 420px) {
  .brand-mark__desc { display: none; }
  .segmented__btn { padding: 0 13px; }
}

/* ==========================================================================
   reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .rail-link[aria-current="page"]::after { opacity: 1; }
}
