/* =========================================================
   杏运赛场 · 共享站点皮肤  /assets/site.css
   ========================================================= */

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

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

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

main { display: block; }

::selection { background: rgba(242, 193, 78, .3); color: #E8EEF4; }

/* ---------- 变量 ---------- */
:root {
  --ink: #0B1B2B;
  --panel: #12293F;
  --panel-soft: #162F47;
  --line: #23405C;
  --text: #E8EEF4;
  --amber: #F2C14E;
  --lime: #57D9A3;
  --orange: #F08A5D;
  --violet: #8E7BEF;
  --muted: #8FA6BC;
  --muted-dim: #5F7C98;
  --paper: #F4EFE4;

  --rail-w: 248px;
  --rail-pad-x: 22px;
  --shell-max: 1200px;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
  --accent: var(--amber);
}

[data-accent="amber"]  { --accent: var(--amber); }
[data-accent="lime"]   { --accent: var(--lime); }
[data-accent="violet"] { --accent: var(--violet); }
[data-accent="orange"] { --accent: var(--orange); }

/* ---------- 基础 ---------- */
body {
  position: relative;
  min-height: 100vh;
  padding-left: var(--rail-w);
  background-color: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 夜间屏幕光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(920px 640px at 84% -12%, rgba(87, 217, 163, .10), transparent 62%),
    radial-gradient(780px 560px at 4% 110%, rgba(142, 123, 239, .12), transparent 60%),
    radial-gradient(560px 420px at 46% 46%, rgba(242, 193, 78, .05), transparent 72%);
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
}
h1 { font-size: clamp(32px, 5vw, 64px); }
h2 { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: 20px; letter-spacing: -.01em; }
h4 { font-size: 16px; letter-spacing: 0; }

p { max-width: 68ch; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-dim); }

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 12px;
  z-index: 200;
  padding: 9px 15px;
  background: var(--amber);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 3px;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .9);
  transform: translateY(-220%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 侧边轨道 ---------- */
.site-header {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  padding: 24px var(--rail-pad-x) 22px;
  background: linear-gradient(180deg, #132B42 0%, #0D2136 100%);
  border-inline-end: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 3px;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(11, 27, 43, .3);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-line {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--text);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: .16em;
  color: var(--muted);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.nav-toggle:hover { border-color: var(--amber); color: var(--amber); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
  height: 14px;
}
.nav-toggle-bars span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--amber);
  border-radius: 1px;
  transition: transform .22s var(--ease), opacity .18s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-toggle-text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
}

/* 导航 */
.site-nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 20px;
}

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

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 10px 9px 12px;
  border-inline-start: 2px solid transparent;
  border-radius: 0 3px 3px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted-dim);
  transition: color .18s var(--ease);
}

.nav-text { font-weight: 500; }

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background-color: rgba(242, 193, 78, .06);
}
.nav-link:hover .nav-index { color: var(--amber); }

.nav-link[aria-current="page"] {
  color: var(--text);
  border-inline-start-color: var(--amber);
  background-image: linear-gradient(90deg, rgba(242, 193, 78, .15), rgba(242, 193, 78, 0));
}
.nav-link[aria-current="page"] .nav-index { color: var(--amber); }

.nav-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}
.nav-cta .btn { width: 100%; justify-content: flex-start; }

.nav-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--muted-dim);
  max-width: none;
}

/* 阅读进度带 */
.rail-progress {
  position: fixed;
  inset-block: 0;
  inset-inline-start: calc(var(--rail-w) - 3px);
  width: 3px;
  z-index: 70;
  pointer-events: none;
}
.rail-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleY(var(--scroll, 0));
  transform-origin: top center;
  background: linear-gradient(180deg, var(--lime) 0%, var(--amber) 58%, var(--violet) 100%);
  opacity: .92;
  transition: transform .12s linear;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}

.btn--primary {
  background: var(--amber);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(11, 27, 43, .28);
}
.btn--primary:hover { background: #FFD166; transform: translateX(1px); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--lime); color: var(--lime); }

/* ---------- 正文容器 ---------- */
#main-content {
  position: relative;
  z-index: 1;
  display: block;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: clamp(28px, 4vw, 60px) clamp(20px, 4vw, 56px) clamp(48px, 7vw, 88px);
  scroll-margin-top: 84px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--panel);
}

.footer-strip { display: flex; height: 4px; }
.footer-strip span { flex: 1 1 0; }
.footer-strip span:nth-child(1) { background: var(--amber); }
.footer-strip span:nth-child(2) { background: var(--lime); }
.footer-strip span:nth-child(3) { background: var(--violet); }
.footer-strip span:nth-child(4) { background: var(--orange); }

.footer-inner {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 64px) clamp(20px, 4vw, 56px) clamp(28px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

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

.footer-note {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 34ch;
}

.footer-contact {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: .02em;
  color: var(--muted-dim);
  word-break: break-word;
  max-width: 40ch;
}

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

.footer-col-title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--paper);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  display: inline-block;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.footer-links a:hover { color: var(--amber); border-bottom-color: var(--amber); }

.footer-base {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: 16px clamp(20px, 4vw, 56px) 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .03em;
  color: var(--muted-dim);
}
.footer-legal,
.footer-copy { max-width: none; }

/* ---------- 排版工具 ---------- */
.idx {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}

.num {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .01em;
}

.meta-line {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .08em;
  color: var(--muted-dim);
  max-width: none;
}

.lede {
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
  max-width: 62ch;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: clamp(22px, 3vw, 36px);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.6;
  color: var(--accent);
  max-width: none;
}

.section-title {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
}

.section-lede {
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
  max-width: 62ch;
}

.rule-strip {
  width: 100%;
  height: 4px;
  border-radius: 1px;
  background: var(--accent);
}

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: clamp(20px, 3vw, 34px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted-dim);
}
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "/"; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .18s var(--ease); }
.crumbs a:hover { color: var(--amber); }
.crumbs [aria-current="page"] { color: var(--amber); }

/* ---------- 面板与标签 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: inset 0 1px 0 rgba(232, 238, 244, .05),
              0 18px 34px -28px rgba(0, 0, 0, .9);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.panel--lift:hover {
  transform: translateY(-3px);
  border-color: rgba(87, 217, 163, .42);
  box-shadow: inset 0 1px 0 rgba(232, 238, 244, .07),
              0 28px 48px -30px rgba(0, 0, 0, .95);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: .08em;
  color: var(--muted);
}
.tag--amber  { color: var(--amber); }
.tag--lime   { color: var(--lime); }
.tag--violet { color: var(--violet); }
.tag--orange { color: var(--orange); }
.tag--paper  { color: var(--ink); background: var(--paper); border-color: var(--paper); }

/* ---------- 网格与流布局 ---------- */
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.stack { display: flex; flex-direction: column; gap: clamp(16px, 2vw, 24px); }
.stack--lg { gap: clamp(28px, 4vw, 48px); }

/* ---------- 表格 ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table caption {
  padding: 12px 14px 0;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted-dim);
}

.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: left;
  white-space: nowrap;
  color: var(--muted);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(35, 64, 92, .55);
  vertical-align: top;
  line-height: 1.7;
}
.data-table tbody tr:last-child td { border-bottom-color: var(--line); }
.data-table tbody tr:hover { background: rgba(87, 217, 163, .05); }
.data-table .num { font-family: var(--font-mono); font-weight: 700; }
.data-table td p { max-width: none; }

/* ---------- 图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    radial-gradient(120% 120% at 78% 10%, rgba(87, 217, 163, .16), transparent 58%),
    radial-gradient(90% 90% at 10% 96%, rgba(142, 123, 239, .16), transparent 60%),
    linear-gradient(150deg, #162F47 0%, #0B1B2B 100%);
}
.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--4x3  { aspect-ratio: 4 / 3; }
.media-frame--1x1  { aspect-ratio: 1 / 1; }
.media-frame--wide { aspect-ratio: 21 / 9; }

.media-frame__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(35, 64, 92, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 64, 92, .55) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .32;
}

.media-frame__cap {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(0deg, rgba(11, 27, 43, .88), rgba(11, 27, 43, 0));
}

/* ---------- 显现动画 ---------- */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.js-motion [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 平板 / 移动 ---------- */
@media (max-width: 1023px) {
  body { padding-left: 0; }

  .site-header {
    position: sticky;
    inset-block: auto;
    inset-inline: auto;
    top: 0;
    width: 100%;
    padding: 12px clamp(16px, 4vw, 28px);
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #132B42 0%, #0F2438 100%);
    overflow: visible;
  }

  .rail-head {
    width: 100%;
    align-items: center;
    padding-bottom: 0;
    border-bottom: 0;
  }

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

  .site-nav {
    position: fixed;
    inset-block: 64px 0;
    inset-inline-end: 0;
    width: min(340px, 86vw);
    z-index: 1;
    padding: 22px clamp(18px, 4vw, 26px) 28px;
    background: var(--panel);
    border-inline-start: 1px solid var(--line);
    box-shadow: 0 0 0 100vmax rgba(6, 14, 23, .72);
    transform: translateX(103%);
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform .28s var(--ease), opacity .22s var(--ease), visibility .28s linear;
  }

  .site-nav[data-open] {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-list { gap: 4px; }
  .nav-link { font-size: 16px; padding: 11px 12px; }
  .nav-cta { padding-top: 26px; }
  .nav-meta { margin-top: 18px; }

  .rail-progress {
    position: absolute;
    inset: auto 0 -1px 0;
    width: auto;
    height: 3px;
  }
  .rail-progress-fill {
    transform: scaleX(var(--scroll, 0));
    transform-origin: left center;
    background: linear-gradient(90deg, var(--lime) 0%, var(--amber) 58%, var(--violet) 100%);
  }

  #main-content {
    padding-inline: clamp(16px, 4vw, 28px);
    scroll-margin-top: 96px;
  }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .brand-mark { width: 34px; height: 34px; font-size: 16px; }
  .brand-line { font-size: 13px; }
  .brand-sub { font-size: 9px; letter-spacing: .12em; }
  body { font-size: 15px; }
  .data-table { min-width: 460px; }
}

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

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

  .js-motion [data-reveal] { opacity: 1; transform: none; }
  .rail-progress-fill { transition: none; }
  .panel--lift:hover { transform: none; }
}
