/* =========================================================
   华体会赛场 · HTH V4 — 共享样式表 /assets/site.css
   夜间赛事控制台 + 复古出版索引
   ========================================================= */

:root {
  --ink: #061826;
  --panel: #0D2B45;
  --panel-2: #0A2237;
  --paper: #F4E9D2;
  --brown: #1C1510;
  --signal: #39F3B0;
  --action: #FF8A3D;
  --accent: #E4572E;
  --muted: #8FA6B8;
  --rust: #6F5B3E;
  --line: rgba(143, 166, 184, 0.22);
  --line-strong: rgba(143, 166, 184, 0.42);
  --maxw: 1280px;
  --gutter: 24px;
  --font-display: "Oswald", "Barlow Condensed", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(13, 43, 69, 0.55) 0%, rgba(6, 24, 38, 0) 42%),
    repeating-linear-gradient(90deg, rgba(143, 166, 184, 0.05) 0 1px, transparent 1px 96px);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.6em;
  color: var(--paper);
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
a:hover { color: var(--signal); border-bottom-color: var(--signal); }

ul, ol { margin: 0 0 1.1em; padding-left: 1.2em; }
li { margin-bottom: 0.35em; }

button { font: inherit; color: inherit; }

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

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

/* ---------- 通用排版 ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 12px;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(57, 243, 176, 0.16);
  flex: 0 0 auto;
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}
.section:first-of-type { border-top: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding-bottom: 14px;
  margin: 0 0 32px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: clamp(24px, 3vw, 34px);
  margin: 0;
}

/* ---------- 网格 ---------- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}
.grid-12 > * { min-width: 0; }

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

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }

.btn-action {
  background: var(--action);
  border-color: var(--action);
  color: #20120A;
  border-bottom-color: var(--action);
}
.btn-action:hover {
  background: #FFA366;
  border-color: #FFA366;
  color: #20120A;
}

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

/* ---------- 面板与正文 ---------- */
.console-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 24px;
}

.paper-panel {
  background: var(--paper);
  color: var(--brown);
  border-radius: 2px;
  padding: 32px;
  box-shadow: 0 18px 40px -28px rgba(28, 21, 16, 0.9);
}
.paper-panel h2,
.paper-panel h3,
.paper-panel h4 { color: var(--brown); }
.paper-panel a { color: #8A3A16; border-bottom-color: rgba(138, 58, 22, 0.4); }
.paper-panel a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(22px, 2.4vw, 30px); margin-top: 1.6em; }
.prose h3 { font-size: clamp(18px, 2vw, 22px); margin-top: 1.4em; }
.prose ul,
.prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 0.5em; }
.prose > :first-child { margin-top: 0; }

/* ---------- 面包屑 ---------- */
.breadcrumb { margin: 0 0 28px; }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.breadcrumb-list li { margin: 0; display: inline-flex; align-items: center; }
.breadcrumb-list li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--rust);
}
.breadcrumb-list a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.breadcrumb-list a:hover { color: var(--signal); border-bottom-color: var(--signal); }
.breadcrumb-list [aria-current="page"] { color: var(--paper); }

/* ---------- 索引链接（章节高亮） ---------- */
.index-link {
  display: block;
  padding: 7px 0 7px 12px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.index-link:hover {
  color: var(--paper);
  border-left-color: var(--line-strong);
  border-bottom-color: transparent;
}
.index-link[data-active="true"] {
  color: var(--signal);
  border-left-color: var(--signal);
}

/* ---------- 媒体容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-2);
  aspect-ratio: 16 / 10;
  margin: 0;
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: linear-gradient(180deg, rgba(6, 24, 38, 0) 0%, rgba(6, 24, 38, 0.9) 100%);
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ---------- 数据表 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-bottom: 10px;
}
.data-table th,
.data-table td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.data-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.data-table td.mono { color: var(--signal); }
.data-table tbody tr:hover td { background: rgba(57, 243, 176, 0.05); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.tag--signal { border-color: rgba(57, 243, 176, 0.5); color: var(--signal); }
.tag--accent { border-color: rgba(228, 87, 46, 0.55); color: #FF9C7A; }

/* ---------- 复制按钮 ---------- */
.copy-btn {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.copy-btn:hover { color: var(--signal); border-color: var(--signal); }
.copy-btn[data-copied] { color: var(--action); border-color: var(--action); }

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -120px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 2px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  border-bottom: 0;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--ink); }

/* =========================================================
   页头
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.header-progress {
  height: 2px;
  width: 100%;
  background: rgba(143, 166, 184, 0.14);
  overflow: hidden;
}
.header-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--signal) 0%, var(--signal) 70%, var(--action) 100%);
  transition: width 0.12s linear;
}

.header-rail {
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.rail-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 7px var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}

.rail-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.rail-item b { color: var(--paper); font-weight: 600; }
.rail-mono { font-family: var(--font-mono); }
.rail-end { margin-left: auto; }

.header-main {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: 78px;
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  border-bottom: 0;
  color: var(--paper);
}
.brand:hover { color: var(--paper); border-bottom: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-cn {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-en {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

/* 导航 */
.nav-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.nav { display: flex; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li { margin: 0; }

.nav-list a {
  display: inline-block;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  color: rgba(244, 233, 210, 0.82);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-list a:hover {
  color: var(--paper);
  border-bottom-color: var(--signal);
}
.nav-list a[aria-current="page"] {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.nav-cta { flex: 0 0 auto; }

/* 移动按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-toggle:hover { border-color: var(--signal); color: var(--signal); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 12px;
}
.nav-toggle-bars i {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(1) { transform: translateY(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(-5px) rotate(-45deg); }

/* 遮罩 */
.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 0;
  border: 0;
  background: rgba(2, 10, 17, 0.74);
  cursor: pointer;
}
.nav-scrim[data-open] { display: block; }

.nav-open { overflow: hidden; }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  margin-top: 96px;
  background: var(--ink);
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.15fr 1.5fr 1.05fr;
  gap: 40px 48px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--gutter) 40px;
}

.footer-brand { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

.footer-lockup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.footer-lockup-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: var(--signal);
}

.footer-statement {
  margin: 0;
  max-width: 32ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-col-title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
}

.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col-list li { margin: 0; }
.footer-col-list a {
  display: inline-block;
  padding: 5px 0;
  border-bottom: 1px solid transparent;
  color: rgba(244, 233, 210, 0.74);
  font-size: 14px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-col-list a:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.readout-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.readout-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(143, 166, 184, 0.26);
}
.readout-item:last-child { border-bottom: 0; }

.readout-key {
  flex: 0 0 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.readout-value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--paper);
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.footer-note { margin: 0; flex: 1 1 320px; color: var(--muted); }
.footer-legal { margin: 0; color: var(--muted); letter-spacing: 0.06em; }
.footer-copy { margin: 0; color: var(--muted); letter-spacing: 0.06em; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1180px) {
  .nav-wrap { gap: 20px; }
  .nav-list { gap: 16px; }
  .nav-list a { font-size: 13px; }
  .header-main { gap: 22px; }
}

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-statement { max-width: 46ch; }
}

@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }

  .nav-wrap {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    width: min(340px, 86vw);
    margin-left: 0;
    padding: 96px var(--gutter) 40px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    background: var(--ink);
    border-left: 1px solid var(--line-strong);
    transform: translateX(102%);
    visibility: hidden;
    overflow-y: auto;
    transition: transform 0.26s var(--ease);
  }
  .nav-wrap[data-open] {
    transform: translateX(0);
    visibility: visible;
  }

  .nav { display: block; width: 100%; }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .nav-list a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
    border-left: 2px solid transparent;
    padding-left: 12px;
  }
  .nav-list a:hover,
  .nav-list a[aria-current="page"] {
    border-bottom-color: var(--line);
    border-left-color: var(--signal);
    color: var(--signal);
  }

  .nav-cta { width: 100%; }

  .rail-inner { gap: 18px; font-size: 10px; }
  .rail-item:first-child { display: none; }
}

@media (max-width: 900px) {
  .grid-12 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 4; }
  .section { padding: 56px 0; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }

  body { font-size: 15.5px; }

  .header-main { min-height: 66px; gap: 14px; }
  .brand-mark { width: 38px; height: 38px; font-size: 12px; }
  .brand-cn { font-size: 16px; }
  .brand-en { letter-spacing: 0.18em; }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px var(--gutter) 28px;
  }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .footer-bottom { padding: 18px var(--gutter) 32px; }
  .paper-panel { padding: 22px; }
  .console-panel { padding: 18px; }
}

@media (max-width: 460px) {
  .rail-item.rail-mono:not(.rail-end) { display: none; }
  .footer-cols { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .nav-toggle { width: auto; }
  .copy-btn { width: auto; }
}

/* =========================================================
   可访问性 · 减弱动效
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .header-progress-bar { transition: none; }
  .btn:active { transform: none; }
}
