/* ==========================================================================
   竞技宝主站 — 共享样式 / assets/site.css
   夜战战术板：炭黑底盘、深墨绿分区、荧光青绿数据层、信号橙警示层
   ========================================================================== */

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

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

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

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

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

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

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

:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid #39F5C8;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #07120E;
  --deep: #0E2A20;
  --moss: #5E7F63;
  --stone: #6F7A73;
  --clay: #B56A4F;
  --mint: #39F5C8;
  --alert: #FF6A3D;
  --snow: #F2F7F4;
  --paper: #E8E1D2;
  --glass: rgba(168, 255, 230, 0.14);

  --line: rgba(94, 127, 99, 0.34);
  --line-strong: rgba(94, 127, 99, 0.62);
  --ghost-line: rgba(242, 247, 244, 0.16);

  --font-display: "Saira Condensed", "Oswald", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --rail-w: 264px;
  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 56px);

  --radius: 2px;
  --speed: 180ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- Base ---------- */
body {
  background-color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(94, 127, 99, 0.10) 1px, transparent 1px),
    linear-gradient(180deg, rgba(94, 127, 99, 0.07) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px;
  color: var(--snow);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--mint); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 7.4vw, 6.2rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.24; }

p { max-width: 72ch; }

strong { font-weight: 700; }

/* ---------- Utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 28px);
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--mint);
  flex: none;
}

.eyebrow--mint { color: var(--mint); }
.eyebrow--alert { color: var(--alert); }
.eyebrow--alert::before { background: var(--alert); }

.eyebrow--rot {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.34em;
}

.eyebrow--rot::before { width: 1px; height: 26px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(20px, 3vw, 36px);
}

.section-head__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--clay);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
}

.section-head__note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--stone);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  transform: translateY(-160%);
  transition: transform var(--speed) var(--ease);
}

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

/* ---------- Shell ---------- */
.site-shell {
  width: 100%;
}

/* ---------- Header : 移动顶栏 ---------- */
.site-header {
  position: relative;
  z-index: 60;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  background: rgba(7, 18, 14, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar__brand,
.rail__brand,
.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  background: var(--deep);
  border: 1px solid var(--line-strong);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}

.brand-mark--lg {
  width: 46px;
  height: 46px;
  font-size: 15px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--snow);
  white-space: nowrap;
}

.brand-text small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--stone);
  white-space: nowrap;
}

.topbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  color: var(--snow);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  background: rgba(14, 42, 32, 0.72);
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.topbar__toggle:hover { border-color: var(--mint); color: var(--mint); }

.topbar__bars {
  position: relative;
  width: 16px;
  height: 2px;
  background: currentColor;
  flex: none;
}

.topbar__bars::before,
.topbar__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform var(--speed) var(--ease);
}

.topbar__bars::before { top: -5px; }
.topbar__bars::after { top: 5px; }

.topbar__toggle[aria-expanded="true"] .topbar__bars { background: transparent; }
.topbar__toggle[aria-expanded="true"] .topbar__bars::before { transform: translateY(5px) rotate(45deg); }
.topbar__toggle[aria-expanded="true"] .topbar__bars::after { transform: translateY(-5px) rotate(-45deg); }

.topbar__nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--deep);
  border-bottom: 1px solid var(--line-strong);
  padding: 8px var(--gutter) 22px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

.topbar__nav[data-open] { display: block; }

.nav-list {
  display: flex;
  flex-direction: column;
}

.nav-list__item { border-bottom: 1px solid rgba(94, 127, 99, 0.22); }

.topbar__nav .nav-list__item a {
  display: block;
  padding: 15px 4px;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--snow);
  transition: color var(--speed) var(--ease), padding-left var(--speed) var(--ease);
}

.topbar__nav .nav-list__item a:hover { color: var(--mint); padding-left: 10px; }

.topbar__nav .nav-list__item a[aria-current="page"] {
  color: var(--mint);
  padding-left: 10px;
  border-left: 2px solid var(--mint);
}

.topbar__cta {
  display: inline-flex;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

/* ---------- Header : 桌面侧边轨道 ---------- */
.rail { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color var(--speed) var(--ease),
              color var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--solid {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--mint);
}

.btn--solid:hover { background: var(--snow); border-color: var(--snow); }

.btn--ghost {
  background: transparent;
  color: var(--snow);
  border-color: var(--line-strong);
}

.btn--ghost:hover { border-color: var(--mint); color: var(--mint); }

.btn--alert {
  background: var(--alert);
  color: var(--ink);
  border-color: var(--alert);
}

.btn--alert:hover { background: #ff855f; border-color: #ff855f; }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px);
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel--solid { background: var(--deep); }

.panel--glass {
  background: var(--glass);
  border: 1px solid rgba(168, 255, 230, 0.26);
  backdrop-filter: blur(8px);
}

.panel--edge::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 26px;
  height: 26px;
  border-top: 2px solid var(--mint);
  border-left: 2px solid var(--mint);
  pointer-events: none;
}

/* ---------- Data & tags ---------- */
.data-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--snow);
}

.data-num--mint { color: var(--mint); }
.data-num--alert { color: var(--alert); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--stone);
  white-space: nowrap;
}

.tag--mint { border-color: rgba(57, 245, 200, 0.5); color: var(--mint); }
.tag--alert { border-color: rgba(255, 106, 61, 0.55); color: var(--alert); }

/* ---------- Breadcrumbs ---------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--stone);
  padding: 18px 0 0;
}

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--moss);
}

.crumbs a { color: var(--stone); border-bottom: 1px solid transparent; transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease); }
.crumbs a:hover { color: var(--mint); border-bottom-color: var(--mint); }
.crumbs [aria-current="page"] { color: var(--snow); }

/* ---------- Prose ---------- */
.prose { max-width: 74ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.2em; list-style: disc; }
.prose a { color: var(--mint); border-bottom: 1px solid rgba(57, 245, 200, 0.4); }
.prose a:hover { border-bottom-color: var(--mint); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--mint);
  background: rgba(57, 245, 200, 0.08);
  padding: 2px 6px;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
}

.timeline__node {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--snow);
}

.timeline__node::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: -27px;
  width: 9px;
  height: 9px;
  background: var(--ink);
  border: 1px solid var(--mint);
  transform: rotate(45deg);
}

.timeline__node[data-pulse]::before { animation: nodePulse 2.6s var(--ease) infinite; }

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57, 245, 200, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(57, 245, 200, 0); }
}

/* ---------- Media frames ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--deep);
  border: 1px solid var(--line);
}

.media-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.04);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 18, 14, 0) 42%, rgba(7, 18, 14, 0.72) 100%);
  pointer-events: none;
}

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

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--mint), var(--alert));
  z-index: 90;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(56px, 8vw, 110px);
  padding: clamp(32px, 5vw, 60px) var(--gutter) 26px;
  background: var(--ink);
  border-top: 1px solid var(--line-strong);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 34%;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), transparent);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3.4vw, 44px);
  max-width: var(--wrap);
  margin-inline: auto;
}

.footer__brand { max-width: 34ch; }

.footer__line {
  margin-top: 16px;
  font-size: 14px;
  color: var(--stone);
  line-height: 1.7;
}

.footer__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 14px;
}

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

.footer__list a {
  display: inline-block;
  font-size: 14px;
  color: var(--snow);
  border-bottom: 1px solid transparent;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.footer__list a:hover { color: var(--mint); border-bottom-color: var(--mint); }

.footer__data {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--stone);
  margin-bottom: 12px;
  line-height: 1.6;
}

.footer__data span { color: var(--snow); font-size: 12.5px; letter-spacing: 0.01em; }

.footer__bar {
  max-width: var(--wrap);
  margin: clamp(28px, 4vw, 44px) auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 26px;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--stone);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer__legal a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--stone);
  transition: color var(--speed) var(--ease);
}

.footer__legal a:hover { color: var(--mint); }

.to-top {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  padding: 11px 16px;
  background: var(--deep);
  border: 1px solid var(--line-strong);
  color: var(--snow);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.to-top[data-visible] { display: inline-flex; }
.to-top:hover { border-color: var(--mint); color: var(--mint); }

/* ---------- Responsive : tablet ---------- */
@media (min-width: 760px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer__meta--data { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; }
  .footer__meta--data .footer__title { grid-column: 1 / -1; }
  .to-top { right: 24px; bottom: 24px; }
}

@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 1.6fr 0.8fr 0.8fr 1.3fr; }
  .footer__meta--data { display: block; grid-column: auto; }
}

/* ---------- Responsive : desktop rail ---------- */
@media (min-width: 1120px) {
  .site-shell { padding-left: var(--rail-w); }

  .topbar { display: none; }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 26px 22px 26px 26px;
    background:
      linear-gradient(180deg, rgba(14, 42, 32, 0.96) 0%, rgba(7, 18, 14, 0.98) 62%);
    border-right: 1px solid var(--line-strong);
    overflow-y: auto;
  }

  .rail::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 96px;
    background: var(--mint);
  }

  .rail__brand { padding-bottom: 4px; }

  .rail__rule {
    display: block;
    height: 1px;
    background: var(--line);
    margin: 22px 0;
    flex: none;
  }

  .rail__nav { flex: 1 1 auto; }

  .rail__nav .nav-list { gap: 2px; }

  .rail__nav .nav-list__item { border: 0; }

  .rail__link {
    position: relative;
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 12px;
    font-family: var(--font-display);
    font-size: 15.5px;
    letter-spacing: 0.01em;
    color: var(--stone);
    border-left: 2px solid transparent;
    transition: color var(--speed) var(--ease),
                background-color var(--speed) var(--ease),
                border-color var(--speed) var(--ease);
  }

  .rail__link:hover {
    color: var(--snow);
    background: rgba(57, 245, 200, 0.06);
    border-left-color: var(--moss);
  }

  .rail__link[aria-current="page"] {
    color: var(--mint);
    background: rgba(57, 245, 200, 0.09);
    border-left-color: var(--mint);
  }

  .rail__num {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--clay);
  }

  .rail__link[aria-current="page"] .rail__num { color: var(--mint); }

  .rail__cta {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  .rail__note {
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.26em;
    color: rgba(111, 122, 115, 0.72);
    writing-mode: vertical-rl;
    align-self: flex-end;
    max-height: 200px;
  }

  .scroll-progress { left: var(--rail-w); width: calc(100% - var(--rail-w)); }

  .to-top { right: 28px; bottom: 28px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .timeline__node[data-pulse]::before { animation: none; }
  .btn:hover { transform: none; }
}
