/* ============================================================
   南宫赛事 · 共享样式表 /assets/site.css
   夜间赛场战术板：深墨蓝基底 + 电光青数据 + 荧光橙标记
   ============================================================ */

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

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

body { margin: 0; }

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 { font: inherit; color: inherit; }

a { color: inherit; }

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 暗场基底 */
  --ink-975: #03070E;
  --ink-950: #050B14;
  --ink-900: #07111F;
  --ink-800: #0C1B2E;
  --ink-700: #0F2338;
  --line: #16324F;
  --mute: #7C8DA3;
  --paper: #F4F1E8;

  /* 数据高亮 */
  --cyan: #36E2FF;
  --cyan-deep: #0E8FA8;
  --orange: #FF7A1A;
  --orange-soft: #FFC38F;

  /* 字体 */
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* 尺寸与节奏 */
  --shell: min(1320px, calc(100% - 2.25rem));
  --gap: clamp(1rem, 2.4vw, 1.9rem);
  --shadow-hard: 6px 6px 0 var(--ink-975);
  --dur: 0.22s;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  background-color: var(--ink-900);
  background-image:
    linear-gradient(90deg, rgba(22, 50, 79, 0.42) 0 1px, transparent 1px 100%);
  background-size: 88px 100%;
  background-repeat: repeat-x;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 6vw, 4.2rem); line-height: 0.96; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

p { max-width: 34em; }

strong { font-weight: 700; color: var(--cyan); }

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

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

#main-content { display: block; scroll-margin-top: 7.5rem; }

/* ---------- 4. 布局工具 ---------- */
.container {
  width: var(--shell);
  margin-inline: auto;
}

.section {
  padding-block: clamp(2.75rem, 7vw, 6rem);
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (min-width: 900px) {
  .grid--5-7 { grid-template-columns: 5fr 7fr; }
  .grid--7-5 { grid-template-columns: 7fr 5fr; }
  .grid--3-9 { grid-template-columns: 3fr 9fr; }
  .grid--cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.lead {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.85;
  color: #D9D6CA;
  max-width: 30em;
}

/* ---------- 5. skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 200;
  padding: 0.6rem 1.1rem;
  background: var(--cyan);
  color: var(--ink-975);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 2px solid var(--cyan);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.1rem;
  border: 2px solid var(--line);
  background: var(--ink-800);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink-975);
  box-shadow: 4px 4px 0 var(--ink-975);
}

.btn--primary:hover {
  background: var(--orange-soft);
  border-color: var(--orange-soft);
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink-975);
}

.btn--ghost {
  background: transparent;
  border-color: var(--cyan-deep);
  color: var(--cyan);
}

.btn--ghost:hover {
  background: rgba(54, 226, 255, 0.1);
  border-color: var(--cyan);
}

/* ---------- 7. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink-950);
  border-bottom: 2px solid var(--line);
}

.header-rail {
  background: var(--ink-975);
  border-bottom: 1px solid rgba(22, 50, 79, 0.85);
  overflow: hidden;
  max-height: 4rem;
  opacity: 1;
  transition: max-height 0.3s var(--ease), opacity 0.22s var(--ease);
}

.site-header.is-condensed .header-rail {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
}

.header-rail__inner {
  width: var(--shell);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.42rem;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--mute);
}

.header-rail__note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: none;
  color: var(--paper);
}

.header-rail__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--orange);
  transform: translateY(-1px);
}

.header-rail__meta {
  max-width: none;
  color: var(--cyan-deep);
  white-space: nowrap;
}

.header-main {
  background: var(--ink-950);
}

.header-main__inner {
  width: var(--shell);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1.5rem;
  padding-block: clamp(0.7rem, 1.4vw, 1rem);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.18rem;
  text-decoration: none;
  color: var(--paper);
  line-height: 1;
}

.brand__mark {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand__line {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.brand:hover .brand__mark { color: var(--cyan); }

/* 移动导航按钮 */
.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  background: transparent;
  border: 2px solid var(--line);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

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

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

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

.nav-toggle__label {
  line-height: 1;
}

/* 导航本体：手机端为可展开抽屉 */
.nav {
  flex: 1 0 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.8rem;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: max-height 0.34s var(--ease), opacity 0.22s var(--ease),
    visibility 0.34s var(--ease);
}

.nav[data-open] {
  max-height: 36rem;
  visibility: visible;
  opacity: 1;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.nav__list {
  display: flex;
  flex-direction: column;
}

.nav__item {
  border-bottom: 1px solid rgba(22, 50, 79, 0.7);
}

.nav__link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.25rem;
  border: 0;
  color: var(--paper);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), padding var(--dur) var(--ease);
}

.nav__link:hover {
  color: var(--cyan);
  background: rgba(14, 143, 168, 0.12);
}

.nav__index {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cyan-deep);
}

.nav__link[aria-current="page"] {
  color: var(--cyan);
  box-shadow: inset 3px 0 0 var(--cyan);
  padding-left: 0.75rem;
}

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

.nav__cta {
  align-self: flex-start;
}

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

.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-deep) 0%, var(--cyan) 62%, var(--orange) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.12s linear;
}

/* 桌面导航 */
@media (min-width: 900px) {
  .nav-toggle { display: none; }

  .nav {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    max-height: none;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    border-top: 0;
    padding-top: 0;
    transition: none;
  }

  .nav__list {
    flex-direction: row;
    gap: 0.15rem;
  }

  .nav__item { border-bottom: 0; }

  .nav__link {
    width: auto;
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
    border: 1px solid transparent;
  }

  .nav__link:hover {
    border-color: var(--line);
  }

  .nav__link[aria-current="page"] {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--ink-975);
    box-shadow: none;
    padding-left: 0.6rem;
  }

  .nav__link[aria-current="page"] .nav__index { color: var(--ink-800); }

  .nav__cta { margin-left: 0.6rem; }
}

@media (max-width: 620px) {
  .header-rail__meta { display: none; }
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 8vw, 6rem);
  background: var(--ink-950);
  border-top: 2px solid var(--line);
  color: var(--paper);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(22, 50, 79, 0.85) 0 1px,
    transparent 1px 96px
  );
  opacity: 0.55;
  pointer-events: none;
}

.footer-main {
  position: relative;
  width: var(--shell);
  margin-inline: auto;
  padding-block: clamp(2.4rem, 5vw, 4rem);
  display: grid;
  gap: 2.4rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (min-width: 1080px) {
  .footer-main {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
    gap: 3rem;
    align-items: start;
  }
  .footer-brand { grid-column: auto; }
}

.footer-brand__annot {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: none;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--cyan-deep);
}

.footer-brand__mark {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.03em;
  color: var(--paper);
  max-width: none;
}

.footer-brand__tagline {
  margin-top: 0.9rem;
  max-width: 26em;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--mute);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
}

.footer-col__title {
  max-width: none;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.footer-col__list {
  display: grid;
  gap: 0.5rem;
}

.footer-link {
  display: inline-block;
  font-size: 0.94rem;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer-link:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.footer-contact__row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding-block: 0.5rem;
  border-bottom: 1px dashed rgba(22, 50, 79, 0.95);
}

.footer-contact__k {
  flex: 0 0 3.2rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--mute);
}

.footer-contact__v {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--paper);
  word-break: break-word;
}

.footer-contact__note {
  margin-top: 0.9rem;
  max-width: 30em;
  font-size: 12px;
  line-height: 1.75;
  color: var(--mute);
}

.footer-legal {
  position: relative;
  background: var(--ink-975);
  border-top: 1px solid var(--line);
}

.footer-legal__inner {
  width: var(--shell);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.6rem;
  padding-block: 1rem;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--mute);
}

.footer-legal__copy {
  max-width: none;
  color: var(--mute);
}

.footer-legal__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.3rem;
}

.footer-legal__item {
  display: inline-flex;
  align-items: center;
}

.footer-legal__link {
  color: var(--mute);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer-legal__link:hover { color: var(--cyan); }

/* ---------- 9. 页面阶段组件 ---------- */
.chapter {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.2rem;
  align-items: start;
  margin-bottom: 1.6rem;
}

.chapter__num {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--cyan);
}

.chapter__title {
  align-self: center;
  color: var(--paper);
}

.chapter__annot {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--mute);
}

@media (min-width: 900px) {
  .chapter__annot {
    justify-self: start;
    padding-left: 0.9rem;
    border-left: 2px solid var(--line);
  }
}

.panel {
  background: var(--ink-800);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-hard);
  padding: clamp(1.1rem, 2.4vw, 1.8rem);
}

.panel p { color: #DCD9CD; }

.data-card {
  position: relative;
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: clamp(1rem, 2vw, 1.4rem);
  background: var(--ink-800);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-hard);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.data-card::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -2px;
  width: 36px;
  height: 3px;
  background: var(--orange);
}

.data-card:hover,
.data-card:focus-within {
  border-color: var(--cyan);
  background-image: repeating-linear-gradient(
    90deg,
    rgba(22, 50, 79, 0.55) 0 1px,
    transparent 1px 22px
  );
  box-shadow: 6px 6px 0 rgba(54, 226, 255, 0.22);
  transform: translateY(-2px);
}

.data-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--mute);
}

.data-card__value {
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--cyan);
  transition: color var(--dur) var(--ease);
}

.data-card:hover .data-card__value { color: var(--paper); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(54, 226, 255, 0.07);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.tag--alert {
  border-color: var(--orange);
  background: rgba(255, 122, 26, 0.14);
  color: var(--orange);
}

.index-list {
  border-top: 1px solid var(--line);
}

.index-list__item {
  border-bottom: 1px solid var(--line);
}

.index-list__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
  color: var(--paper);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
    padding-left var(--dur) var(--ease);
}

.index-list__link:hover {
  color: var(--cyan);
  background: rgba(14, 143, 168, 0.1);
  padding-left: 0.6rem;
}

.index-list__link.is-active {
  color: var(--cyan);
  box-shadow: inset 3px 0 0 var(--cyan);
  padding-left: 0.6rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 1.4rem;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb__link {
  color: var(--mute);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.breadcrumb__link:hover { color: var(--cyan); }

.breadcrumb__sep {
  color: var(--line);
}

.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 2px solid var(--line);
  background: var(--ink-800);
  box-shadow: var(--shadow-hard);
}

.media-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 11, 20, 0) 58%, rgba(5, 11, 20, 0.78) 100%);
  pointer-events: none;
}

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

.media-frame--placeholder {
  background-color: var(--ink-800);
  background-image:
    repeating-linear-gradient(90deg, rgba(22, 50, 79, 0.9) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, rgba(22, 50, 79, 0.9) 0 1px, transparent 1px 40px);
}

/* ---------- 10. 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .data-card:hover { transform: none; }
  .btn--primary:hover { transform: none; }
  .scroll-progress__bar { transition: none; }
}

/* ---------- 11. 打印友好 ---------- */
@media print {
  body { background: #FFFFFF; color: #101010; }
  .site-header, .site-footer, .scroll-progress { display: none; }
  .panel, .data-card, .media-frame { box-shadow: none; border-color: #999999; }
}
