/* ===========================================================
   微玩赛事合作 · 共享样式 /assets/site.css
   框架式导航 + 纵向叙事长卷 + 赛后数据机房语言
   =========================================================== */

/* ---------- 1. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  --scroll-progress: 0;
  scroll-padding-top: calc(var(--top-h, 56px) + 16px);
}

body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. tokens ---------- */
:root {
  /* 色板 */
  --ink-900: #0B1220;
  --ink-800: #16202F;
  --ice-100: #E9EEF5;
  --paper:   #F7F9FC;
  --slate:   #3A4759;
  --steel:   #8394AB;
  --orange:  #FF6A1A;
  --orange-d:#E2560C;
  --mint:    #16E0A8;
  --mint-ink:#0A8F6B;
  --violet:  #7A5CFF;
  --frost:   #6FB6FF;
  --alert:   #FF3B5C;

  /* 字体 */
  --font-display: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif:   "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --font-mono:    "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  /* 尺寸 */
  --rail-w: 88px;
  --top-h: 56px;
  --status-h: 40px;
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1440px;
  --readw: 720px;

  /* 形状 */
  --edge: 2px solid var(--ink-900);
  --shadow-hard: 6px 6px 0 var(--ink-900);
  --shadow-soft: 4px 4px 0 var(--ink-900);
}

/* ---------- 3. base ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  padding-top: var(--top-h);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.75;
  color: var(--slate);
  background-color: var(--ice-100);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

:focus-visible {
  outline: 3px solid var(--frost);
  outline-offset: 2px;
}
.rail :focus-visible,
.site-footer :focus-visible,
.topbar :focus-visible { outline-color: var(--mint); }

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

/* ---------- 4. skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-900);
  background: var(--orange);
  border: var(--edge);
  box-shadow: var(--shadow-soft);
  transform: translateY(-160%);
  transition: transform .18s ease;
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 5. 页头 · 竖轨 ---------- */
.site-header { position: relative; }

.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 12px;
  background: var(--ink-900);
  color: var(--ice-100);
  border-right: 2px solid #000;
}

.rail__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 14px;
  border-bottom: 1px solid rgba(233, 238, 245, .16);
}

.rail__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--ink-900);
  background: var(--orange);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .6);
}

.rail__name {
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .06em;
  text-align: center;
  color: var(--steel);
}

.rail__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 8px;
  scrollbar-width: thin;
}

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

.nav-link {
  display: block;
  position: relative;
  padding: 9px 4px;
  font-size: 12.5px;
  line-height: 1.25;
  letter-spacing: .04em;
  text-align: center;
  color: var(--ice-100);
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.nav-link:hover {
  color: #fff;
  background: rgba(22, 224, 168, .12);
  border-color: rgba(22, 224, 168, .5);
}
.nav-link[aria-current="page"] {
  color: var(--ink-900);
  font-weight: 800;
  background: var(--orange);
  border-color: var(--ink-900);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .65);
}

.rail__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(233, 238, 245, .16);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--steel);
}
.rail__meta b { color: var(--mint); font-weight: 700; }

/* ---------- 6. 页头 · 顶条 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--top-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px 0 var(--gutter);
  background: var(--ink-800);
  color: var(--ice-100);
  border-bottom: 2px solid var(--ink-900);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(var(--scroll-progress));
  transform-origin: left center;
}

.topbar__line {
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__utils {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.util {
  display: block;
  padding: 6px 10px;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--ice-100);
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.util:hover,
.util:focus-visible {
  color: var(--mint);
  border-bottom-color: var(--mint);
}

.topbar__cta { flex: none; }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--ink-900);
  background: var(--paper);
  border: var(--edge);
  box-shadow: var(--shadow-soft);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink-900); }
.btn--orange { background: var(--orange); color: var(--ink-900); }
.btn--orange:hover { background: #FF8039; }
.btn--dark { background: var(--ink-900); color: var(--ice-100); box-shadow: 4px 4px 0 var(--orange); }
.btn--ghost {
  background: transparent;
  color: var(--ice-100);
  border-color: var(--ice-100);
  box-shadow: 4px 4px 0 var(--orange);
}

/* ---------- 8. 移动导航按钮 ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ice-100);
  border: 2px solid var(--ice-100);
}
.nav-toggle:hover { color: var(--mint); border-color: var(--mint); }
.nav-toggle__bars { display: grid; gap: 3px; width: 18px; }
.nav-toggle__bars i {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.site-header[data-open] .nav-toggle__bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- 9. 页脚 ---------- */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--ink-900);
  color: var(--ice-100);
  border-top: 2px solid var(--ink-900);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 36px 32px;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 64px) var(--gutter) 32px;
}

.footer__mark {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.footer__tag {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
}
.footer__note {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--steel);
}

.footer__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mint);
}
.footer__list { display: grid; gap: 9px; }
.footer__list a {
  font-size: 15px;
  color: var(--ice-100);
  border-bottom: 1px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.footer__list a:hover,
.footer__list a:focus-visible {
  color: var(--mint);
  border-bottom-color: var(--mint);
}

.footer__contact {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--gutter) 30px;
  font-size: 14px;
}
.footer__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  color: var(--steel);
}
.footer__key {
  flex: none;
  min-width: 48px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
}

.statusbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 24px;
  min-height: var(--status-h);
  padding: 9px var(--gutter);
  background: var(--ink-800);
  border-top: 2px solid var(--orange);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--steel);
}
.statusbar__item--end { margin-left: auto; color: var(--ice-100); }

/* ---------- 10. 布局工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(48px, 7vw, 96px); }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.band {
  display: block;
  width: 100%;
  height: 16px;
  background: linear-gradient(100deg, var(--ink-900) 0 58%, var(--orange) 58% 76%, var(--mint) 76% 100%);
}

.grid-lines {
  background-image: repeating-linear-gradient(to bottom, rgba(131, 148, 171, .18) 0 1px, transparent 1px 8px);
}

.noise { position: relative; }
.noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .6;
}

/* ---------- 11. 章节标题块 ---------- */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.section-num {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--violet);
}
.section-num::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--violet);
  box-shadow: 2px 2px 0 var(--ink-900);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink-900);
}
.section-sub {
  max-width: 46ch;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--slate);
}

/* ---------- 12. 卡片与标签 ---------- */
.card {
  padding: 22px;
  background: var(--paper);
  border: var(--edge);
  box-shadow: var(--shadow-hard);
}
.card--dark {
  background: var(--ink-800);
  color: var(--ice-100);
  border-color: var(--ink-900);
  box-shadow: 6px 6px 0 var(--orange);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  color: var(--slate);
}
.tag--orange { color: var(--orange-d); }
.tag--mint { color: var(--mint-ink); }
.tag--violet { color: var(--violet); }

/* ---------- 13. 正文与面包屑 ---------- */
.prose {
  max-width: var(--readw);
  font-size: 17px;
  line-height: 1.8;
  color: var(--slate);
}
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink-900);
}
.prose h3 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink-900);
}
.prose a {
  color: var(--frost);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose ul,
.prose ol { list-style: disc; padding-left: 1.4em; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--steel);
}
.breadcrumb li { display: flex; align-items: center; gap: 10px; }
.breadcrumb li + li::before { content: "/"; color: var(--steel); }
.breadcrumb a {
  color: var(--slate);
  border-bottom: 1px solid var(--steel);
  transition: color .16s ease, border-color .16s ease;
}
.breadcrumb a:hover,
.breadcrumb a:focus-visible { color: var(--orange-d); border-bottom-color: var(--orange); }

/* ---------- 14. 图片容器基础规则 ---------- */
.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--ink-800);
  border: var(--edge);
  box-shadow: var(--shadow-hard);
}
.img-frame > img,
.img-frame > svg,
.img-frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(1.08);
}
.img-frame--wide { aspect-ratio: 21 / 9; }
.img-frame--tall { aspect-ratio: 4 / 5; }
.img-frame--square { aspect-ratio: 1 / 1; }
.img-frame__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mint);
  background: var(--ink-900);
}

/* ---------- 15. 返回顶部（由 site.js 注入） ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 64px;
  z-index: 120;
  display: grid;
  place-items: center;
  gap: 0;
  width: 58px;
  height: 58px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-900);
  background: var(--orange);
  border: var(--edge);
  box-shadow: 4px 4px 0 var(--ink-900);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity .2s ease, transform .2s ease;
}
.to-top > span:first-child { font-size: 15px; line-height: 1; }
.to-top[data-visible] { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { background: #FF8039; }

/* ---------- 16. 响应式 ---------- */
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  body { padding-left: 0; }

  .rail {
    top: 0;
    width: min(78vw, 300px);
    padding: 14px 12px 18px;
    transform: translateX(-102%);
    transition: transform .24s ease;
    box-shadow: none;
  }
  .site-header[data-open] .rail {
    transform: translateX(0);
    box-shadow: 8px 0 0 rgba(11, 18, 32, .4);
  }

  .rail__brand { flex-direction: row; align-items: center; gap: 12px; padding-bottom: 16px; }
  .rail__name { text-align: left; font-size: 13px; letter-spacing: .04em; color: var(--ice-100); }

  .rail__nav { padding-top: 12px; }
  .nav-list { gap: 6px; }
  .nav-link {
    padding: 12px 14px;
    text-align: left;
    font-size: 15px;
    letter-spacing: .02em;
    border: 1px solid rgba(233, 238, 245, .14);
  }
  .nav-link[aria-current="page"] { box-shadow: 4px 4px 0 rgba(0, 0, 0, .65); }

  .rail__meta { text-align: left; flex-direction: row; justify-content: space-between; font-size: 10.5px; }

  .topbar { left: 0; padding-inline: 14px; gap: 10px; }
  .topbar__utils { display: none; }
  .topbar__line { font-size: 11px; letter-spacing: .1em; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .topbar__cta { display: none; }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .statusbar__item--end { margin-left: 0; }
}

@media (max-width: 560px) {
  :root { --top-h: 52px; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__note { max-width: none; }
  .to-top { right: 12px; bottom: 84px; width: 52px; height: 52px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .statusbar { gap: 4px 14px; font-size: 10.5px; }
}

/* ---------- 17. 动效退化 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .to-top { transform: none; }
  .rail { transition: none; }
}
