/* =========================================================
   乐竞赛场 /assets/site.css
   共享外壳：reset、变量、中文排版、框架导航、页脚、通用组件
   ========================================================= */

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

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

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

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

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

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

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

/* ---------- 2. tokens ---------- */
:root {
  --ink-turf: #07130F;
  --charcoal-panel: #14181A;
  --line-chalk: #24312C;
  --chalk-white: #EAF3EF;
  --muted-sage: #9DB0A8;
  --neon-cyan: #35F2C0;
  --signal-orange: #FF7A2F;
  --league-ice: #7BD8FF;
  --season-amber: #FFC65C;
  --whistle-red: #FF4D6D;
  --fog: #5C6B65;

  --rail-w: 252px;
  --rail-h-mobile: 66px;
  --shell-max: 1240px;
  --pad-x: clamp(16px, 3.4vw, 44px);

  --font-head: "Barlow Condensed", "Oswald", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body: "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --cut: clamp(16px, 2vw, 24px);
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  background: var(--ink-turf);
  color: var(--chalk-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: .01em;
  color: var(--chalk-white);
}

h1 { font-size: clamp(38px, 6vw, 72px); line-height: 1.05; }
h2 { font-size: clamp(26px, 4vw, 44px); }
h3 { font-size: clamp(20px, 2.4vw, 28px); }

p { max-width: 72ch; }

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color .16s var(--ease);
}

a:hover { color: #8FF7DD; }

strong, b { color: var(--chalk-white); font-weight: 600; }

::selection {
  background: rgba(53, 242, 192, .28);
  color: #FFFFFF;
}

#main-content {
  display: block;
  outline: none;
}

/* ---------- 4. 焦点与动效降级 ---------- */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .46s var(--ease), transform .46s var(--ease);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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

/* ---------- 5. 跳转链接与滚动进度 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-220%);
  padding: 10px 18px;
  background: var(--neon-cyan);
  color: var(--ink-turf);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
  border-radius: 2px;
  transition: transform .18s var(--ease);
}

.skip-link:hover { color: var(--ink-turf); }
.skip-link:focus { transform: translateY(0); color: var(--ink-turf); }

.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: 3px;
  z-index: 70;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--signal-orange));
  pointer-events: none;
}

/* ---------- 6. 框架式导航（头部） ---------- */
.site-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, rgba(53, 242, 192, .07), rgba(7, 19, 15, 0) 260px),
    var(--charcoal-panel);
  border-right: 1px solid var(--line-chalk);
}

.site-rail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-cyan) 0 42%, var(--signal-orange) 42% 100%);
}

.site-rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 46%;
  background: linear-gradient(180deg, var(--neon-cyan), rgba(53, 242, 192, 0));
  opacity: .65;
  pointer-events: none;
}

/* 品牌 */
.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid var(--line-chalk);
  color: var(--chalk-white);
}

.rail-brand:hover { color: var(--chalk-white); }

.rail-mark {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--signal-orange));
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
}

.rail-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--charcoal-panel);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
}

.rail-brand-text { display: block; min-width: 0; }

.rail-name {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: .05em;
}

.rail-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--muted-sage);
}

/* 移动目录按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: transparent;
  border: 1px solid var(--line-chalk);
  border-radius: 4px;
  color: var(--chalk-white);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}

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

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 14px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform .18s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* 导航轨 */
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.rail-nav-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--fog);
  text-transform: uppercase;
}

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

.rail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--chalk-white);
  font-size: 15px;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}

.rail-link:hover {
  background: rgba(53, 242, 192, .08);
  border-left-color: rgba(53, 242, 192, .5);
  color: #FFFFFF;
}

.rail-link[aria-current="page"] {
  background: rgba(53, 242, 192, .12);
  border-left-color: var(--neon-cyan);
  color: var(--neon-cyan);
  font-weight: 600;
}

.rail-num {
  min-width: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--fog);
}

.rail-link[aria-current="page"] .rail-num { color: var(--neon-cyan); }

.rail-text { min-width: 0; }

/* 轨道底部 */
.rail-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line-chalk);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-line {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--fog);
  max-width: none;
}

.rail-line-strong { color: var(--muted-sage); }

.rail-cta {
  display: block;
  padding: 11px 14px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--ink-turf);
  background: var(--neon-cyan);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 86% 100%, 0 100%);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}

.rail-cta:hover { background: var(--signal-orange); color: #180800; }

/* ---------- 7. 页脚 ---------- */
.site-foot {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  padding: clamp(38px, 5vw, 64px) var(--pad-x) 26px;
  background:
    repeating-linear-gradient(-6deg, rgba(53, 242, 192, .028) 0 1px, transparent 1px 10px),
    var(--charcoal-panel);
  border-top: 1px solid var(--line-chalk);
  color: var(--muted-sage);
  font-size: 14px;
}

.site-foot::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(320px, 45%);
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), rgba(53, 242, 192, 0));
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr);
  gap: clamp(22px, 3vw, 46px);
}

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

.foot-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .06em;
  color: var(--chalk-white);
  max-width: none;
}

.foot-mark-chip {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--signal-orange));
  clip-path: polygon(0 0, 100% 0, 100% 65%, 65% 100%, 0 100%);
}

.foot-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted-sage);
  max-width: 40ch;
}

.foot-facts { display: grid; gap: 10px; }

.foot-fact { display: grid; gap: 2px; }

.foot-fact dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--fog);
}

.foot-fact dd {
  color: var(--chalk-white);
  font-size: 13px;
  line-height: 1.6;
}

.foot-col-title {
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-chalk);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--chalk-white);
}

.foot-col-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 28px;
  height: 1px;
  background: var(--neon-cyan);
}

.foot-list { display: grid; gap: 9px; }

.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--chalk-white);
  font-size: 14px;
  transition: color .16s var(--ease);
}

.foot-link::before {
  content: "";
  width: 6px;
  height: 1px;
  background: var(--line-chalk);
  transition: width .16s var(--ease), background-color .16s var(--ease);
}

.foot-link:hover { color: var(--neon-cyan); }
.foot-link:hover::before { width: 16px; background: var(--neon-cyan); }

.foot-contact {
  display: grid;
  gap: 8px;
  margin-top: clamp(26px, 3.4vw, 42px);
  padding-top: 20px;
  border-top: 1px solid var(--line-chalk);
}

.foot-contact-line {
  font-size: 14px;
  line-height: 1.8;
  color: var(--chalk-white);
  max-width: none;
}

.foot-contact-note {
  font-size: 13px;
  color: var(--muted-sage);
  max-width: 80ch;
}

.foot-key {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border: 1px solid rgba(255, 122, 47, .45);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--signal-orange);
  vertical-align: 1px;
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-chalk);
  font-size: 12px;
  color: var(--fog);
}

.foot-note { max-width: 68ch; }
.foot-copy { font-family: var(--font-mono); letter-spacing: .04em; max-width: none; }

/* ---------- 8. 布局容器与栅格 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 24px);
}

/* ---------- 9. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .06em;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.btn-primary { background: var(--neon-cyan); color: var(--ink-turf); }
.btn-primary:hover { background: var(--signal-orange); color: #180800; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-chalk);
  color: var(--chalk-white);
}

.btn-ghost:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* 切角面板 */
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(18px, 2.2vw, 28px);
  background: var(--charcoal-panel);
  border: 1px solid var(--line-chalk);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted-sage);
}

.panel-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.15;
  letter-spacing: .02em;
  color: var(--chalk-white);
}

.panel-body { display: flex; flex-direction: column; gap: 12px; }

.panel-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line-chalk);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--fog);
}

/* 章节头 */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: clamp(18px, 2.6vw, 32px);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--neon-cyan);
}

.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
  color: var(--chalk-white);
}

.section-lead {
  max-width: 66ch;
  color: var(--muted-sage);
}

/* 标签 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line-chalk);
  border-radius: 999px;
  background: rgba(255, 255, 255, .02);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-sage);
  white-space: nowrap;
}

.chip-league { border-color: rgba(123, 216, 255, .45); color: var(--league-ice); }
.chip-season { border-color: rgba(255, 198, 92, .45); color: var(--season-amber); }
.chip-ref    { border-color: rgba(255, 122, 47, .5);  color: var(--signal-orange); }
.chip-live   { border-color: rgba(53, 242, 192, .5);  color: var(--neon-cyan); }
.chip-warn   { border-color: rgba(255, 77, 109, .5);  color: var(--whistle-red); }

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .06em;
  white-space: nowrap;
}

.badge-goal {
  background: rgba(53, 242, 192, .14);
  border-color: rgba(53, 242, 192, .5);
  color: var(--neon-cyan);
}

.badge-ref {
  background: rgba(255, 122, 47, .14);
  border-color: rgba(255, 122, 47, .5);
  color: var(--signal-orange);
}

.badge-rev {
  background: rgba(255, 198, 92, .14);
  border-color: rgba(255, 198, 92, .5);
  color: var(--season-amber);
}

/* 数字与字段标签 */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-sage);
}

/* 面包屑 */
.breadcrumb { padding-block: 20px 8px; }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--fog);
}

.breadcrumb-list li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line-chalk);
}

.breadcrumb-link { color: var(--muted-sage); }
.breadcrumb-link:hover { color: var(--neon-cyan); }
.breadcrumb-current { color: var(--chalk-white); }

/* ---------- 10. 可复用图片容器 ---------- */
.media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-chalk);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(53, 242, 192, .08), transparent 60%),
    linear-gradient(140deg, #0D1A16, #14181A 58%, #0A1411);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(-8deg, rgba(234, 243, 239, .05) 0 1px, transparent 1px 6px);
  opacity: .7;
  pointer-events: none;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(.92) brightness(.96);
}

.media-16x9 { aspect-ratio: 16 / 9; }
.media-4x3  { aspect-ratio: 4 / 3; }
.media-3x4  { aspect-ratio: 3 / 4; }
.media-square { aspect-ratio: 1 / 1; }

.media-cut {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}

.media-caption {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fog);
  max-width: 60ch;
}

/* ---------- 11. 通用节奏类 ---------- */
.stack { display: flex; flex-direction: column; gap: clamp(14px, 2vw, 24px); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.muted { color: var(--muted-sage); }

.rule {
  height: 1px;
  border: 0;
  background: var(--line-chalk);
}

/* ---------- 12. 响应式 ---------- */
@media (min-width: 901px) and (max-width: 1120px) {
  :root { --rail-w: 212px; }
  .rail-link { font-size: 14px; padding: 8px 8px 8px 10px; }
}

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-top: var(--rail-h-mobile);
  }

  .scroll-progress {
    top: var(--rail-h-mobile);
    left: 0;
  }

  .site-rail {
    inset: 0 0 auto 0;
    width: auto;
    height: var(--rail-h-mobile);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line-chalk);
  }

  .site-rail::after { display: none; }

  .rail-brand {
    padding: 0;
    border-bottom: 0;
    gap: 10px;
  }

  .rail-mark { flex-basis: 32px; width: 32px; height: 32px; }
  .rail-name { font-size: 19px; }
  .rail-sub { display: none; }

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

  .rail-nav {
    position: fixed;
    top: var(--rail-h-mobile);
    left: 0;
    right: 0;
    z-index: 59;
    display: none;
    flex: 0 0 auto;
    max-height: calc(100vh - var(--rail-h-mobile));
    overflow-y: auto;
    padding: 16px 16px 22px;
    gap: 12px;
    background: var(--charcoal-panel);
    border-bottom: 1px solid var(--line-chalk);
  }

  .rail-nav[data-open] { display: flex; }

  .rail-link {
    padding: 13px 12px;
    font-size: 16px;
    border-radius: 0 10px 10px 0;
  }

  .rail-foot { display: none; }
}

@media (max-width: 860px) {
  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
  }

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

@media (max-width: 560px) {
  .foot-grid { grid-template-columns: minmax(0, 1fr); }

  .foot-legal { flex-direction: column; }

  .foot-contact-line { font-size: 13px; }

  .btn { width: 100%; }
}
