/* ==========================================================================
   星空赛场 / Site Kit — /assets/site.css
   共享外壳：reset、变量、中文排版、命令栏、导航、按钮、卡片、
   面包屑、图片容器、页脚、响应式与无障碍。
   ========================================================================== */

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

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

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

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

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

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

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

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

/* ---------- 02. 设计变量 ---------- */
:root {
  /* 深空底色 */
  --space-900: #050B1A;
  --space-800: #0A1630;
  --space-700: #132447;
  --line-600: #253A63;
  --line-soft: rgba(37, 58, 99, 0.58);

  /* 强调色 */
  --gold-500: #F5C451;
  --gold-300: #FFE29A;
  --cyan-500: #35E0D6;
  --cyan-300: #8BF3EC;

  /* 主客场专用色 */
  --home: #FF7A4A;
  --away: #6F8CFF;

  /* 文本 */
  --text-1: #F2F5FA;
  --text-2: #A8B4CE;
  --text-3: #7385A8;

  /* 字体族 */
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* 间距刻度 4/8/12/20/32/56/88 */
  --step-1: 4px;
  --step-2: 8px;
  --step-3: 12px;
  --step-4: 20px;
  --step-5: 32px;
  --step-6: 56px;
  --step-7: 88px;

  /* 版心 */
  --shell: 1280px;
  --gutter: 24px;

  --radius: 3px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-hover: 150ms;
  --t-state: 220ms;
  --t-reveal: 320ms;
}

/* ---------- 03. 基础与中文排版 ---------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--text-1);
  background-color: var(--space-900);
  background-image:
    radial-gradient(1100px 640px at 84% -8%, rgba(53, 224, 214, 0.09), transparent 70%),
    radial-gradient(880px 520px at 3% 0%, rgba(245, 196, 81, 0.07), transparent 72%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--text-1);
}

h1 { font-size: clamp(32px, 3.6vw, 48px); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 2.6vw, 32px); }
h3 { font-size: clamp(18px, 1.8vw, 24px); }
h4 { font-size: 18px; }

p { color: var(--text-2); }

strong, b { color: var(--text-1); font-weight: 700; }

::selection {
  background: var(--gold-500);
  color: var(--space-900);
}

.num,
[class*="__val"],
code, kbd, samp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
}

#main-content {
  display: block;
  position: relative;
  z-index: 1;
}

/* ---------- 04. 无障碍 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan-500);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--space-900);
  background: var(--gold-500);
  border-radius: var(--radius);
  transition: top var(--t-state) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline-color: var(--space-900);
}

/* ---------- 05. 容器与章节 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
}

.section + .section {
  margin-top: var(--step-7);
}

.section--alt {
  background: var(--space-800);
  border-block: 1px solid var(--line-600);
}

/* ---------- 06. 命令栏（页头） ---------- */
.command-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--space-900);
  border-bottom: 1px solid var(--line-600);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .command-bar {
    background: rgba(5, 11, 26, 0.86);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
  }
}

.command-bar__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--step-5);
  padding-block: 14px;
  transition: padding-block var(--t-state) var(--ease);
}

.command-bar[data-condensed="true"] .command-bar__inner {
  padding-block: 9px;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--step-3);
  min-width: 0;
}

.brand__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-500);
  background: linear-gradient(160deg, rgba(245, 196, 81, 0.18), rgba(245, 196, 81, 0));
  border: 1px solid var(--gold-500);
  border-radius: var(--radius);
  transition: background var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
}

.brand:hover .brand__mark,
.brand:focus-visible .brand__mark {
  color: var(--space-900);
  background: var(--gold-500);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand__tagline {
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--text-2);
  white-space: nowrap;
  max-height: 20px;
  overflow: hidden;
  transition: max-height var(--t-state) var(--ease), opacity 160ms var(--ease);
}

.command-bar[data-condensed="true"] .brand__tagline {
  max-height: 0;
  opacity: 0;
}

/* 栏目索引 */
.nav {
  justify-self: center;
  min-width: 0;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.nav__item { min-width: 0; }

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  white-space: nowrap;
  transition:
    color var(--t-hover) var(--ease),
    border-color var(--t-hover) var(--ease),
    background var(--t-hover) var(--ease);
}

.nav__idx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  transition: color var(--t-hover) var(--ease);
}

.nav__label { white-space: nowrap; }

.nav__link:hover {
  color: var(--text-1);
  border-color: var(--line-600);
  background: rgba(19, 36, 71, 0.6);
}

.nav__link:hover .nav__idx { color: var(--cyan-500); }

.nav__link[aria-current="page"] {
  color: var(--cyan-500);
  border-color: rgba(53, 224, 214, 0.42);
  background: rgba(53, 224, 214, 0.08);
}

.nav__link[aria-current="page"] .nav__idx { color: var(--cyan-500); }

/* 右侧状态区 */
.command-bar__meta {
  display: flex;
  align-items: center;
  gap: var(--step-3);
  justify-self: end;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border: 1px solid var(--line-600);
  border-radius: var(--radius);
  white-space: nowrap;
}

.meta-chip__key { color: var(--text-3); }

.meta-chip__val {
  font-size: 11px;
  color: var(--gold-300);
}

.meta-chip__sep { color: var(--line-600); }

.section-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.section-readout__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-500);
  box-shadow: 0 0 0 3px rgba(53, 224, 214, 0.16);
}

.section-readout [data-section-name] {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 移动端索引按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-1);
  border: 1px solid var(--line-600);
  border-radius: var(--radius);
  transition: border-color var(--t-hover) var(--ease), background var(--t-hover) var(--ease);
}

.nav-toggle:hover {
  border-color: var(--cyan-500);
  background: rgba(53, 224, 214, 0.08);
}

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

.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--t-state) var(--ease), opacity var(--t-state) var(--ease);
}

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

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

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

/* 阅读进度 */
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.read-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-500), var(--gold-500));
  transition: width 120ms linear;
}

/* ---------- 07. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background var(--t-hover) var(--ease),
    color var(--t-hover) var(--ease),
    border-color var(--t-hover) var(--ease);
}

.btn--gold {
  color: #05101F;
  background: var(--gold-500);
  border-color: var(--gold-500);
}

.btn--gold:hover {
  background: var(--gold-300);
  border-color: var(--gold-300);
}

.btn--ghost {
  color: var(--text-1);
  border-color: var(--line-600);
}

.btn--ghost:hover {
  color: var(--cyan-300);
  border-color: var(--cyan-500);
  background: rgba(53, 224, 214, 0.08);
}

/* ---------- 08. 卡片 ---------- */
.card {
  position: relative;
  padding: var(--step-4);
  background: var(--space-700);
  border: 1px solid var(--line-600);
  border-radius: var(--radius);
}

.card--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  overflow: hidden;
}

.pair-side {
  min-width: 0;
  padding: var(--step-4);
}

.pair-side--home {
  border-top: 2px solid var(--home);
  background: linear-gradient(180deg, rgba(255, 122, 74, 0.10), rgba(255, 122, 74, 0));
}

.pair-side--away {
  border-top: 2px solid var(--away);
  border-left: 1px solid var(--line-600);
  background: linear-gradient(180deg, rgba(111, 140, 255, 0.10), rgba(111, 140, 255, 0));
}

.card--spec {
  padding: 2px 0 2px var(--step-4);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line-600);
  border-radius: 0;
}

.card--spec::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 10px;
  height: 1px;
  background: var(--line-600);
}

.card--entry {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--step-4);
  align-items: start;
  padding: var(--step-4);
  background: var(--space-700);
  border: 1px solid var(--line-600);
  border-radius: var(--radius);
}

.entry-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.9;
  color: var(--text-3);
}

/* 主客场标签 */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mark::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: currentColor;
}

.mark--home { color: var(--home); }
.mark--away { color: var(--away); }

/* ---------- 09. 面包屑 ---------- */
.breadcrumb {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
}

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

.breadcrumb__list li + li::before {
  content: "/";
  color: var(--line-600);
}

.breadcrumb__list a {
  color: var(--text-2);
  transition: color var(--t-hover) var(--ease);
}

.breadcrumb__list a:hover { color: var(--cyan-500); }

.breadcrumb__list [aria-current="page"] { color: var(--text-1); }

/* ---------- 10. 表格 ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--space-700);
  border: 1px solid var(--line-600);
  border-radius: var(--radius);
}

.table-scroll table { min-width: 640px; }

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--space-800);
}

/* ---------- 11. 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(150deg, var(--space-700), var(--space-800));
  border: 1px solid var(--line-600);
  border-radius: var(--radius);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 11, 26, 0) 48%, rgba(5, 11, 26, 0.76) 100%);
}

.media > img,
.media > picture > img,
.media > svg,
.media > video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-reveal) var(--ease);
}

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

.media__caption {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--text-3);
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: var(--step-7);
  background: var(--space-800);
  border-top: 1px solid var(--line-600);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.15fr;
  gap: var(--step-6);
  padding-block: var(--step-6) var(--step-5);
}

.brand--footer { margin-bottom: var(--step-4); }

.footer-brand__note {
  max-width: 34em;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
}

.footer-brand__since {
  margin-top: var(--step-3);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.footer-brand__since .num { color: var(--gold-300); }

.footer-col__title {
  margin-bottom: var(--step-4);
  padding-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--gold-500);
  border-bottom: 1px solid var(--line-600);
}

.footer-nav__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px var(--step-4);
}

.footer-nav__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  transition: color var(--t-hover) var(--ease);
}

.footer-nav__list a::before {
  content: "";
  flex: none;
  width: 5px;
  height: 1px;
  background: var(--line-600);
  transition: width var(--t-hover) var(--ease), background var(--t-hover) var(--ease);
}

.footer-nav__list a:hover { color: var(--cyan-300); }

.footer-nav__list a:hover::before {
  width: 12px;
  background: var(--cyan-500);
}

.footer-contact__list { display: grid; gap: 10px; }

.footer-contact__row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--step-3);
  align-items: baseline;
}

.footer-contact__row dt {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.footer-contact__row dd {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
  word-break: break-word;
}

.footer-contact__row dd.num {
  font-size: 14px;
  color: var(--text-1);
}

.footer-orbit {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--line-600) 14%,
    var(--cyan-500) 34%,
    var(--line-600) 46%,
    var(--gold-500) 62%,
    var(--line-600) 76%,
    transparent 100%
  );
  opacity: 0.72;
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--step-3);
  padding-block: 16px;
}

.footer-legal,
.footer-meta {
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.footer-legal .num { color: var(--text-2); }

/* ---------- 13. 滚动显现钩子 ---------- */
[data-reveal].is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- 14. 响应式：平板 ---------- */
@media (max-width: 1100px) {
  .command-bar__inner {
    grid-template-columns: 1fr auto;
    column-gap: var(--step-3);
  }

  .meta-chip { display: none; }

  .nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--t-state) var(--ease), opacity 180ms var(--ease);
  }

  .nav[data-open] {
    max-height: 460px;
    opacity: 1;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: var(--step-3);
    padding-top: var(--step-2);
    border-top: 1px solid var(--line-600);
  }

  .nav__item { width: 100%; }

  .nav__item + .nav__item { border-top: 1px solid var(--line-soft); }

  .nav__link {
    width: 100%;
    justify-content: flex-start;
    padding: 13px 8px;
    font-size: 15px;
    border-color: transparent;
    border-radius: 0;
  }

  .nav__link:hover { background: rgba(19, 36, 71, 0.7); }

  .nav__link[aria-current="page"] {
    background: linear-gradient(90deg, rgba(53, 224, 214, 0.14), rgba(53, 224, 214, 0));
    border-color: transparent;
    box-shadow: inset 2px 0 0 var(--cyan-500);
  }

  .nav__idx {
    width: 34px;
    flex: none;
    font-size: 11px;
  }

  .nav-toggle { display: inline-flex; }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--step-5);
  }

  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- 15. 响应式：手机 ---------- */
@media (max-width: 700px) {
  :root {
    --gutter: 18px;
    --step-6: 40px;
    --step-7: 56px;
  }

  body { font-size: 15px; }

  .command-bar__inner { padding-block: 12px; }

  .command-bar[data-condensed="true"] .command-bar__inner { padding-block: 9px; }

  .brand__mark { width: 32px; height: 32px; font-size: 15px; }

  .brand__name { font-size: 15px; }

  .section-readout { max-width: 110px; }

  .card--pair { grid-template-columns: 1fr; }

  .pair-side--away {
    border-left: 0;
    border-top: 1px solid var(--line-600);
  }

  .card--entry {
    grid-template-columns: 1fr;
    gap: var(--step-2);
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--step-5);
  }

  .footer-nav__list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px) {
  .section-readout { display: none; }

  .footer-nav__list { grid-template-columns: 1fr; }

  .site-footer__base {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--step-2);
  }

  .footer-contact__row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- 16. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .read-progress__bar { transition: none; }
}
