/* ==========================================================================
   hth 华体会赛事 · 共享样式 /assets/site.css
   深空蓝 × 竞技橙 × 信号绿 —— 极简文字建筑 / 斜切面板 / 等宽数据
   ========================================================================== */

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

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

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

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

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

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

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

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

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 色彩 */
  --ink-900: #0A1626;
  --ink-800: #12305A;
  --blue-600: #1F5FA8;
  --orange: #FF6A2B;
  --orange-soft: #FFB784;
  --green: #A9F05A;
  --rock: #2B3644;
  --clay: #C4785B;
  --moss: #5E7F63;
  --paper: #F6F3EA;
  --sand: #EAE4D6;
  --text: #0E1A28;
  --line: rgba(14, 26, 40, 0.14);
  --line-strong: rgba(14, 26, 40, 0.28);
  --line-light: rgba(246, 243, 234, 0.16);
  --paper-dim: rgba(246, 243, 234, 0.76);

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

  /* 节奏 */
  --gap: 8px;
  --header-h: 86px;
  --shell: 1240px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --pill: 999px;
  --cut: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

@media (min-width: 980px) {
  :root { --header-h: 98px; }
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--paper);
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

strong { font-weight: 800; }

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

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

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

/* 文字建筑 */
.display {
  font-family: var(--sans);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--text);
}

.display-xl { font-size: clamp(2.5rem, 6vw, 6.5rem); }
.display-lg { font-size: clamp(1.9rem, 3.6vw, 3.5rem); line-height: 1.04; }
.display-md { font-size: clamp(1.35rem, 2.2vw, 2rem); line-height: 1.16; }

.prose { max-width: 62ch; }
.prose p + p { margin-top: 1em; }
.prose h2 { margin-top: 1.8em; font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
.prose h2 + p { margin-top: 0.7em; }
.prose ul { margin-top: 1em; }
.prose li { position: relative; padding-left: 20px; margin-top: 0.45em; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 2px;
  background: var(--orange);
}

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.7;
  color: var(--rock);
  max-width: 56ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--blue-600);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background: var(--orange);
}

.section--ink .eyebrow { color: var(--green); }

.data-num {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

.rule-slant {
  height: 2px;
  border: 0;
  background: linear-gradient(90deg, var(--orange), rgba(255, 106, 43, 0));
  transform: skewY(-2deg);
  transform-origin: left center;
}

/* ---------- 4. 容器与网格 ---------- */
.container {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

.container--narrow { max-width: 880px; }

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

.section--sand { background: var(--sand); }

.section--ink {
  background: var(--ink-900);
  color: var(--paper);
}

.section--ink .lede,
.section--ink .prose,
.section--ink .prose p { color: var(--paper-dim); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 899px) {
  .grid-12 > [class*="span-"] { grid-column: 1 / -1; }
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease),
              border-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
              color 0.16s var(--ease);
}

.btn::after {
  content: "→";
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--orange);
  color: var(--ink-900);
}

.btn-primary:hover {
  background: var(--orange-soft);
  box-shadow: 0 10px 26px rgba(255, 106, 43, 0.32);
}

.btn-ink {
  background: var(--ink-900);
  color: var(--paper);
}

.btn-ink:hover { background: var(--ink-800); }

.btn-light {
  border-color: var(--line-light);
  color: var(--paper);
}

.btn-light:hover {
  border-color: var(--green);
  background: rgba(169, 240, 90, 0.12);
}

/* ---------- 6. 面板 / 标签 / 筛选 ---------- */
.panel {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--line);
  padding: clamp(20px, 2.6vw, 32px);
  clip-path: var(--cut);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              border-color 0.18s var(--ease);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0;
  background: var(--orange);
  transition: width 0.22s var(--ease);
}

.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(10, 22, 38, 0.1);
}

.panel:hover::after { width: 100%; }

.panel--dark {
  background: var(--ink-800);
  border-color: var(--line-light);
  color: var(--paper);
}

.panel--dark:hover { box-shadow: 0 18px 40px rgba(4, 10, 20, 0.45); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
              box-shadow 0.16s var(--ease), color 0.16s var(--ease);
}

.chip:hover { border-color: var(--blue-600); }

.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink-900);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(169, 240, 90, 0.5);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--pill);
  background: var(--sand);
  color: var(--rock);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tag--green {
  background: rgba(169, 240, 90, 0.2);
  border: 1px solid rgba(94, 127, 99, 0.55);
  color: #2F4A18;
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumb { font-size: 13px; color: var(--rock); }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

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

.breadcrumb-list li + li::before {
  content: "/";
  margin: 0 8px;
  color: rgba(14, 26, 40, 0.3);
}

.breadcrumb-list a { transition: color 0.16s var(--ease); }
.breadcrumb-list a:hover { color: var(--blue-600); }
.breadcrumb-list [aria-current="page"] { color: var(--text); font-weight: 700; }

/* ---------- 8. 视觉容器（无位图占位） ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-light);
  background-color: var(--ink-800);
  background-image: linear-gradient(135deg, var(--ink-800), var(--ink-900));
  clip-path: var(--cut);
}

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

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

.media-frame--grid {
  background-image:
    linear-gradient(rgba(169, 240, 90, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 240, 90, 0.16) 1px, transparent 1px),
    linear-gradient(135deg, var(--ink-800), var(--ink-900));
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

/* ---------- 9. 数据表 ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  background: #FFFFFF;
}

.data-table { min-width: 560px; font-size: 15px; }

.data-table th {
  text-align: left;
  padding: 13px 16px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--rock);
  background: var(--sand);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:nth-child(odd) { background: rgba(234, 228, 214, 0.4); }
.data-table tbody tr:hover { background: rgba(255, 106, 43, 0.08); }
.data-table th:first-child,
.data-table td:first-child { position: sticky; left: 0; background: inherit; }

/* ---------- 10. 章节跟随 ---------- */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  font-size: 14px;
}

.toc-link {
  display: block;
  padding: 8px 0 8px 14px;
  border-left: 2px solid var(--line);
  color: var(--rock);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.toc-link:hover { color: var(--text); }

.toc-link.is-active,
.toc-link[aria-current="true"] {
  color: var(--text);
  font-weight: 800;
  border-left-color: var(--orange);
}

/* ---------- 11. 显现动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.34s var(--ease), transform 0.34s var(--ease);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------- 12. 头部 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 120;
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--paper);
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(4, 10, 20, 0.32);
  transform: translateY(-220%);
  transition: transform 0.18s var(--ease);
}

.skip-link:focus { transform: translateY(0); }

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 0;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--orange), var(--green));
  transition: width 0.12s linear;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  padding: 14px clamp(12px, 2.4vw, 28px) 0;
  pointer-events: none;
}

.nav-capsule {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--shell);
  padding: 9px 12px 9px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line-light);
  background: rgba(10, 22, 38, 0.9);
  color: var(--paper);
  box-shadow: 0 14px 36px rgba(4, 10, 20, 0.3);
  transition: padding 0.24s var(--ease), background 0.24s var(--ease),
              max-width 0.24s var(--ease);
}

.site-header[data-condensed="true"] .nav-capsule {
  max-width: 1140px;
  padding: 5px 10px 5px 14px;
  background: rgba(10, 22, 38, 0.74);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  color: var(--paper);
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(169, 240, 90, 0.42);
  background: linear-gradient(140deg, var(--blue-600), var(--ink-800));
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  overflow: hidden;
}

.brand-mark-dot {
  position: absolute;
  left: 6px;
  bottom: 7px;
  width: 15px;
  height: 3px;
  border-radius: 2px;
  background: var(--orange);
  box-shadow: 0 -7px 0 -1px rgba(169, 240, 90, 0.9);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-tag {
  display: none;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(246, 243, 234, 0.55);
  white-space: nowrap;
}

@media (min-width: 560px) {
  .brand-tag { display: block; }
}

.site-header[data-condensed="true"] .brand-tag { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 9px 15px;
  border-radius: var(--pill);
  border: 1px solid rgba(246, 243, 234, 0.24);
  color: var(--paper);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--orange);
  background: rgba(255, 106, 43, 0.16);
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease);
}

.site-header[data-open="true"] .nav-toggle-bars span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.site-header[data-open="true"] .nav-toggle-bars span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.primary-nav {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 26px;
  border: 1px solid var(--line-light);
  background: rgba(10, 22, 38, 0.98);
  box-shadow: 0 26px 52px rgba(4, 10, 20, 0.48);
}

.site-header[data-open="true"] .primary-nav { display: flex; }

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

.nav-link {
  position: relative;
  display: block;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(246, 243, 234, 0.8);
  transition: color 0.16s var(--ease), background 0.16s var(--ease),
              box-shadow 0.16s var(--ease);
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(246, 243, 234, 0.08);
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  background: rgba(255, 106, 43, 0.18);
  box-shadow: inset 3px 0 0 var(--orange);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--pill);
  background: var(--orange);
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease),
              box-shadow 0.16s var(--ease);
}

.nav-cta::after {
  content: "→";
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
}

.nav-cta:hover {
  background: var(--orange-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 106, 43, 0.36);
}

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

  .primary-nav {
    position: static;
    display: flex;
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 2px;
    margin-inline: auto;
  }

  .nav-link {
    padding: 9px 14px;
    border-radius: var(--pill);
    font-size: 14px;
  }

  .nav-link[aria-current="page"] {
    background: rgba(255, 106, 43, 0.16);
    box-shadow: none;
  }

  .nav-link[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    transform: translateX(-50%);
  }
}

/* ---------- 13. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 112px);
  background: var(--ink-900);
  color: var(--paper-dim);
  overflow: hidden;
}

.footer-slash {
  display: block;
  height: clamp(22px, 3.4vw, 42px);
  background: linear-gradient(90deg, var(--orange), var(--blue-600) 52%, var(--green));
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.footer-inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(32px, 4.6vw, 64px) clamp(16px, 4vw, 40px) clamp(20px, 3vw, 36px);
  display: grid;
  gap: clamp(28px, 4vw, 56px);
}

@media (min-width: 820px) {
  .footer-inner {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.55fr);
    align-items: start;
  }
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }

.footer-brand-link {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--paper);
  transition: color 0.16s var(--ease);
}

.footer-brand-link:hover { color: var(--orange-soft); }

.footer-brand-note {
  max-width: 34ch;
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(246, 243, 234, 0.62);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(246, 243, 234, 0.55);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(169, 240, 90, 0.18);
  animation: status-pulse 2.8s var(--ease) infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(169, 240, 90, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(169, 240, 90, 0.04); }
}

.footer-nav {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.footer-col { min-width: 0; }

.footer-col-title {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--green);
  margin-bottom: 10px;
}

.footer-list { display: flex; flex-direction: column; }

.footer-link {
  display: inline-block;
  padding: 6px 0;
  font-size: 15px;
  color: rgba(246, 243, 234, 0.72);
  transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}

.footer-link:hover {
  color: var(--paper);
  transform: translateX(4px);
}

.footer-meta {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(16px, 2.4vw, 26px) clamp(16px, 4vw, 40px) clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  font-size: 12.5px;
  line-height: 1.7;
}

.footer-contact { color: rgba(246, 243, 234, 0.62); }

.footer-legal {
  color: rgba(246, 243, 234, 0.46);
  letter-spacing: 0.02em;
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 9px 18px;
  border-radius: var(--pill);
  border: 1px solid rgba(246, 243, 234, 0.28);
  color: var(--paper);
  font-size: 13px;
  font-weight: 800;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
              transform 0.16s var(--ease);
}

.to-top::after {
  content: "↑";
  font-family: var(--mono);
  font-size: 12px;
}

.to-top:hover {
  border-color: var(--green);
  background: rgba(169, 240, 90, 0.12);
  transform: translateY(-2px);
}

/* ---------- 14. 降级动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

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

  .status-dot { animation: none; }
}

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