/* ==========================================================================
   BOXI SPORTS — /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 页头 / 页脚 / 通用按钮 / 网格 / 基础组件
   ========================================================================== */

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

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

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

:root {
  /* 珠宝色分区 */
  --ink-900: #07140F;
  --panel-800: #0E2A22;
  --line-700: #17453A;
  --indigo-700: #2A2A5E;
  --wine-800: #3A1220;

  /* 数据高亮 */
  --signal-500: #FF6B2C;
  --data-400: #2EC4FF;

  /* 状态色 */
  --card-red: #E4342A;
  --card-yellow: #FFC61A;

  /* 纸面与旁注 */
  --paper-050: #F2F7F4;
  --muted-400: #8FA79E;

  /* 度量 */
  --rail-w: 188px;
  --topbar-h: 76px;
  --gutter: clamp(16px, 3vw, 40px);
  --gap: clamp(10px, 1.6vw, 18px);
  --maxw: 1440px;
  --radius: 2px;
  --shadow-hard: 0 2px 0 rgba(0, 0, 0, .42);
  --shadow-signal: 0 2px 0 var(--signal-500);

  /* 字体 */
  --font-display: "Oswald", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  --font-body: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Roboto Mono", Menlo, Consolas, monospace;
}

@media (max-width: 1023px) {
  :root { --topbar-h: 64px; }
}

/* ---------- 页面底座：夜场墨黑绿 + 战术板网格 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink-900);
  background-image:
    repeating-linear-gradient(90deg, rgba(46, 196, 255, .035) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(46, 196, 255, .035) 0 1px, transparent 1px 96px);
  background-attachment: fixed;
  color: var(--paper-050);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  padding-top: var(--topbar-h);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }
}

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--paper-050);
}

h1 { font-size: clamp(34px, 5vw, 66px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 20px; line-height: 1.28; }
h4 { font-size: 17px; line-height: 1.3; }

p { margin-bottom: 1em; max-width: 34em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; color: var(--paper-050); }

small { font-size: 13px; }

code, kbd, samp, time, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a { color: var(--data-400); transition: color .14s ease, border-color .14s ease; }
a:hover { color: var(--signal-500); }

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

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

#main-content { scroll-margin-top: calc(var(--topbar-h) + 16px); }

hr {
  border: 0;
  border-top: 1px solid var(--line-700);
  margin: 0;
}

/* ---------- 跳至主内容 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  transform: translateY(-200%);
  display: inline-block;
  padding: 10px 18px;
  background: var(--signal-500);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .06em;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  transition: transform .16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--ink-900);
  outline: 2px solid var(--paper-050);
  outline-offset: 2px;
}

/* ==========================================================================
   页头
   ========================================================================== */
.site-header { position: relative; z-index: 90; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 96;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 22px);
  padding: 0 clamp(12px, 2vw, 28px);
  background: rgba(7, 20, 15, .95);
  border-bottom: 1px solid var(--line-700);
  box-shadow: 0 2px 0 rgba(46, 196, 255, .12);
  transition: height .18s ease, background-color .18s ease;
}

.site-header[data-compact] .topbar {
  height: calc(var(--topbar-h) * .62);
  background: rgba(7, 20, 15, .99);
}

@media (min-width: 1024px) {
  .topbar { left: var(--rail-w); }
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--paper-050);
}

.brand:hover { color: var(--paper-050); }

.brand__mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  background: var(--signal-500);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
  box-shadow: 3px 3px 0 rgba(46, 196, 255, .55);
  transition: transform .16s ease;
}

.brand:hover .brand__mark { transform: translate(-1px, -1px); }

.brand__mark::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: var(--ink-900);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
  gap: 2px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper-050);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted-400);
}

.site-header[data-compact] .brand__name { font-size: 17px; }
.site-header[data-compact] .brand__mark { width: 30px; height: 30px; }

/* 状态灯 */
.topbar__meta {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted-400);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .topbar__meta { display: inline-flex; }
}

.dot-live {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--signal-500);
  box-shadow: 0 0 0 3px rgba(255, 107, 44, .18);
  animation: dotPulse 2.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 107, 44, .16); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 107, 44, .04); }
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

@media (max-width: 719px) {
  .topbar__actions { margin-left: auto; }
  .topbar__actions .btn--ghost { display: none; }
}

/* 抽屉按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 10px;
  border: 1px solid var(--line-700);
  border-radius: var(--radius);
  color: var(--paper-050);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background-color .14s ease;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: var(--data-400);
  color: var(--data-400);
  background: rgba(46, 196, 255, .07);
}

.nav-toggle__bars { display: grid; gap: 3px; }

.nav-toggle__bars i {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: .35; }

@media (max-width: 479px) {
  .nav-toggle__label { display: none; }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
}

/* ---------- 侧边轨道导航 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 94;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: calc(var(--topbar-h) + 20px) 0 22px;
  background: var(--ink-900);
  border-right: 1px solid var(--line-700);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-700); }

.rail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-700);
  border-radius: var(--radius);
  color: var(--paper-050);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease;
}

.rail__close:hover { border-color: var(--signal-500); color: var(--signal-500); }

@media (min-width: 1024px) {
  .rail__close { display: none; }
}

.rail__head {
  padding: 0 18px 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-700);
}

.rail__kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--signal-500);
}

.rail__title {
  display: block;
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .3em;
  color: var(--paper-050);
}

.rail__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}

.rail__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 18px;
  border-left: 3px solid transparent;
  color: var(--muted-400);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: color .14s ease, background-color .14s ease, border-color .14s ease;
}

.rail__idx {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  color: #4C6B60;
  transition: color .14s ease;
}

.rail__link:hover {
  color: var(--paper-050);
  background: var(--panel-800);
  border-left-color: var(--line-700);
}

.rail__link:hover .rail__idx { color: var(--data-400); }

.rail__link[aria-current="page"] {
  color: var(--paper-050);
  background: var(--panel-800);
  border-left-color: var(--signal-500);
}

.rail__link[aria-current="page"] .rail__idx { color: var(--signal-500); }

.rail__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: var(--signal-500);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.rail__foot {
  margin-top: 18px;
  padding: 16px 18px 0;
  border-top: 1px solid var(--line-700);
}

.rail__note {
  margin: 0 0 12px;
  max-width: none;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-400);
}

@media (max-width: 1023px) {
  .rail {
    width: min(86vw, 320px);
    z-index: 108;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 6px 0 0 rgba(255, 107, 44, .38);
  }

  .rail[data-open] { transform: translateX(0); }
}

/* ---------- 滚动进度 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  background: linear-gradient(90deg, var(--signal-500), var(--data-400));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  will-change: transform;
}

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: clamp(12px, 2vw, 26px);
  bottom: clamp(12px, 2vw, 26px);
  z-index: 112;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--panel-800);
  border: 1px solid var(--line-700);
  border-radius: var(--radius);
  box-shadow: var(--shadow-signal);
  color: var(--paper-050);
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease,
              background-color .16s ease, color .16s ease;
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--signal-500);
  border-color: var(--signal-500);
  color: var(--ink-900);
}

/* ==========================================================================
   通用按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .38);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease,
              transform .12s ease, box-shadow .12s ease;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn--primary {
  background: var(--signal-500);
  border-color: var(--signal-500);
  color: var(--ink-900);
}

.btn--primary:hover {
  background: #FF8347;
  border-color: #FF8347;
  color: var(--ink-900);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-700);
  color: var(--paper-050);
}

.btn--ghost:hover {
  border-color: var(--data-400);
  color: var(--data-400);
  background: rgba(46, 196, 255, .08);
}

.btn--sm { padding: 9px 13px; font-size: 12.5px; }
.btn--block { display: flex; width: 100%; }

/* ==========================================================================
   布局与通用组件
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(30px, 4.5vw, 62px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 20px;
  margin-bottom: clamp(16px, 2.6vw, 28px);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-700);
}

.section-head h1,
.section-head h2 { margin: 0; flex: 1 1 auto; }

.kicker {
  display: inline-block;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--signal-500);
}

/* 面包屑 */
.breadcrumb {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  color: var(--muted-400);
}

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

.breadcrumb li::after {
  content: "/";
  margin-inline: 8px 4px;
  color: var(--line-700);
}

.breadcrumb li:last-child::after { content: none; }

.breadcrumb a { color: var(--muted-400); }
.breadcrumb a:hover { color: var(--data-400); }
.breadcrumb [aria-current="page"] { color: var(--paper-050); }

/* Bento 网格 */
.bento {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

.bento > * { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(12, 1fr); }
  .bento > .span-3 { grid-column: span 3; }
  .bento > .span-4 { grid-column: span 4; }
  .bento > .span-6 { grid-column: span 6; }
  .bento > .span-8 { grid-column: span 8; }
  .bento > .span-9 { grid-column: span 9; }
  .bento > .span-12 { grid-column: span 12; }
}

/* 纸面卡片 */
.card {
  position: relative;
  padding: clamp(16px, 2vw, 22px);
  background: var(--panel-800);
  border: 1px solid var(--line-700);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 3px;
  background: var(--signal-500);
}

.card--indigo { background: var(--indigo-700); border-color: #3D3D80; }
.card--indigo::before { background: var(--data-400); }

.card--wine { background: var(--wine-800); border-color: #58202F; }
.card--wine::before { background: var(--card-red); }

.card--paper {
  background: var(--paper-050);
  border-color: var(--paper-050);
  color: var(--ink-900);
}

.card--paper::before { background: var(--ink-900); }
.card--paper h2, .card--paper h3, .card--paper h4 { color: var(--ink-900); }
.card--paper strong { color: var(--ink-900); }

/* 图像容器基础规则（页面阶段放置占位或图片） */
.media {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-700);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 78% 22%, rgba(46, 196, 255, .22), transparent 52%),
    linear-gradient(155deg, var(--indigo-700) 0%, var(--ink-900) 74%);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(242, 247, 244, .07) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(242, 247, 244, .07) 0 1px, transparent 1px 46px);
}

.media:has(img)::after { display: none; }

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

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

.media__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted-400);
}

/* 显现（JS 驱动，无 JS 时正常显示） */
[data-reveal="out"] {
  opacity: 0;
  transform: translateY(8px);
}

[data-reveal="in"] {
  opacity: 1;
  transform: none;
  transition: opacity .32s ease, transform .32s ease;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(44px, 6vw, 92px);
  background: var(--panel-800);
  border-top: 2px solid var(--line-700);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--signal-500) 0 26px,
    transparent 26px 52px
  );
  opacity: .55;
}

.footer__grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(30px, 4vw, 58px) var(--gutter) clamp(20px, 3vw, 36px);
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 1.05fr 1fr 1.45fr 1fr; }
}

.footer__title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--signal-500);
}

.footer__brand {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper-050);
}

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

.footer__list a {
  display: inline-block;
  font-size: 14.5px;
  color: var(--paper-050);
  opacity: .84;
  border-bottom: 1px solid transparent;
  transition: opacity .14s ease, color .14s ease, border-color .14s ease;
}

.footer__list a:hover {
  opacity: 1;
  color: var(--data-400);
  border-bottom-color: var(--data-400);
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted-400);
}

.footer__contact span:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--paper-050);
  word-break: break-all;
}

.footer__meta {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line-700);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--muted-400);
}

.footer__bottom {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 14px var(--gutter) 26px;
  border-top: 1px solid var(--line-700);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
}

.footer__note {
  margin: 0;
  max-width: none;
  font-size: 12.5px;
  color: var(--muted-400);
}

.footer__copy {
  margin: 0;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted-400);
}

/* ==========================================================================
   动效降级
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  [data-reveal="out"] {
    opacity: 1;
    transform: none;
  }

  .to-top {
    opacity: 1;
    visibility: hidden;
    transform: none;
  }

  .to-top[data-visible] {
    visibility: visible;
  }
}
