/* ============================================================
   天行赛场 ORBIT STADIUM — /assets/site.css
   共享外壳：轨道侧导航、页脚、基础排版与通用组件
   色彩节奏：深空黑底 → 蓝图网格 → 天行橙主强调 → 赛道青次强调
   ============================================================ */

/* ── 1. 变量 ─────────────────────────────────────────────── */
:root {
  --ink: #05070D;
  --panel: #0B1322;
  --panel-2: #0E1728;
  --blueprint: #14233A;
  --orange: #FF6A1A;
  --ember: #FF9A5C;
  --cyan: #24E0CF;
  --ice: #9DF6EF;
  --green: #3DF2A0;
  --amber: #FFC857;
  --text: #F3F7FF;
  --muted: #9BA9BF;
  --line: rgba(36, 224, 207, 0.12);
  --line-soft: rgba(155, 169, 191, 0.18);
  --line-strong: rgba(36, 224, 207, 0.30);

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

  --rail-w: 264px;
  --bar-h: 64px;
  --radius: 2px;
  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(36, 224, 207, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 224, 207, 0.042) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px;
  background-position: -1px -1px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, picture { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; }

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

::selection {
  background: rgba(255, 106, 26, 0.75);
  color: #12060A;
}

/* ── 3. 中文排版 ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  margin: 0 0 0.55em;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.98;
  color: var(--text);
}
h1 { font-size: clamp(2.6rem, 7.5vw, 4.6rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.35rem); line-height: 1.06; }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.2; letter-spacing: -0.02em; }
h4 { font-size: 1rem; line-height: 1.35; letter-spacing: 0; }

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

a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cyan); }

strong { font-weight: 700; color: var(--text); }
small { font-size: 0.82em; }

/* ── 4. 跳转链接 ─────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  padding: 0.7rem 1.15rem;
  background: var(--orange);
  color: #14060A;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); color: #14060A; }
.skip-link:focus-visible { outline-color: var(--text); }

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

/* ── 5. 头部：品牌条 ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(5, 7, 13, 0.96);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(255, 106, 26, 0.14);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--bar-h);
  padding: 0.5rem clamp(0.9rem, 4vw, 1.6rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 35, 58, 0.7);
}
.brand__mark::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  background: var(--cyan);
}
.brand__mark-ring {
  width: 15px;
  height: 15px;
  border: 2px solid var(--orange);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-32deg);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.brand__latin {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: rgba(157, 246, 239, 0.7);
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(255, 106, 26, 0.42);
  background: rgba(255, 106, 26, 0.1);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--ember);
  white-space: nowrap;
}
.version-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
}
.version-chip__text { display: inline; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(20, 35, 58, 0.75);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--cyan); }
.nav-toggle__bar {
  display: block;
  width: 16px;
  height: 2px;
  margin-inline: auto;
  background: var(--ice);
  transition: transform 0.22s var(--ease), opacity 0.16s var(--ease);
}
.site-header[data-open="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── 6. 头部：轨道导航与联赛模块 ─────────────────────────── */
.rail {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.1rem clamp(0.9rem, 4vw, 1.6rem) 1.6rem;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.rail-nav__label {
  margin: 0 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: rgba(157, 246, 239, 0.52);
}

.rail-nav__list { display: grid; gap: 2px; }

.rail-nav__link {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.52rem 0.55rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.rail-nav__link:hover {
  color: var(--text);
  border-left-color: var(--line-strong);
  background: rgba(36, 224, 207, 0.07);
}
.rail-nav__index {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(155, 169, 191, 0.55);
}
.rail-nav__text { display: inline; }

.rail-nav__link[aria-current="page"] {
  color: var(--text);
  border-left-color: var(--orange);
  background: linear-gradient(90deg, rgba(255, 106, 26, 0.18), rgba(255, 106, 26, 0));
}
.rail-nav__link[aria-current="page"] .rail-nav__index { color: var(--orange); }

.rail-league {
  position: relative;
  padding: 0.85rem 0.8rem 0.9rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(36, 224, 207, 0.09), transparent 62%),
    rgba(20, 35, 58, 0.55);
}
.rail-league::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 2px;
  background: var(--cyan);
}
.rail-league__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(157, 246, 239, 0.66);
}

.league-chips { display: flex; flex-wrap: wrap; gap: 0.32rem; }

.league-chip {
  padding: 0.24rem 0.48rem;
  border: 1px solid rgba(155, 169, 191, 0.3);
  border-radius: 1px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.league-chip:hover { color: var(--ice); border-color: rgba(36, 224, 207, 0.55); }
.league-chip[aria-pressed="true"] {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04131A;
  font-weight: 700;
}
.league-chip[aria-pressed="true"]:hover { background: var(--ice); border-color: var(--ice); color: #04131A; }

.rail-league__note {
  margin: 0.6rem 0 0;
  font-size: 0.68rem;
  line-height: 1.5;
  color: rgba(155, 169, 191, 0.75);
}

.rail-actions {
  display: grid;
  gap: 0.4rem;
  margin-top: auto;
}

.rail-progress {
  display: none;
  height: 2px;
  background: rgba(36, 224, 207, 0.14);
  overflow: hidden;
}
.rail-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  transition: width 0.1s linear;
}

/* ── 7. 移动端抽屉 ───────────────────────────────────────── */
@media (max-width: 1023px) {
  .rail {
    position: fixed;
    inset-inline: 0;
    top: var(--bar-h);
    bottom: 0;
    z-index: 70;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0s linear 0.22s;
  }
  .site-header[data-open="true"] .rail {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0s linear 0s;
  }
  .rail-nav__link { font-size: 1rem; padding-block: 0.72rem; }
  .rail-league { margin-top: 0.25rem; }
}

/* ── 8. 桌面端：左侧固定轨道 ─────────────────────────────── */
@media (min-width: 1024px) {
  :root { --rail-w: 264px; }

  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    background:
      linear-gradient(180deg, #080D18 0%, #05070D 58%, #06090F 100%);
    border-bottom: 0;
    border-right: 1px solid var(--line-strong);
    box-shadow: 1px 0 0 rgba(36, 224, 207, 0.07);
  }

  .site-header__bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    min-height: 0;
    padding: 1.5rem 1.2rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .brand { margin-right: 0; }
  .nav-toggle { display: none; }

  .rail {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.1rem 1.2rem 1.2rem;
    background: transparent;
    border-top: 0;
    gap: 1.1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(36, 224, 207, 0.35) transparent;
  }
  .rail::-webkit-scrollbar { width: 6px; }
  .rail::-webkit-scrollbar-thumb { background: rgba(36, 224, 207, 0.3); }

  .rail-progress { display: block; flex: 0 0 auto; }
}

@media (min-width: 1280px) {
  :root { --rail-w: 288px; }
  .site-header__bar { padding: 1.9rem 1.4rem 1.1rem; }
  .rail { padding-inline: 1.4rem; }
}

/* ── 9. 页脚 ─────────────────────────────────────────────── */
.site-footer {
  position: relative;
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(2.4rem, 5vw, 3.6rem) clamp(1rem, 4vw, 3rem) 1.6rem;
  background:
    linear-gradient(180deg, rgba(11, 19, 34, 0.96), rgba(5, 7, 13, 0.98));
  border-top: 1px solid var(--line-strong);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--orange), var(--cyan) 42%, transparent 82%);
}

.site-footer__top {
  display: grid;
  gap: 2.1rem;
  max-width: 1160px;
  margin-inline: auto;
}

.footer-brand__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.footer-brand__latin {
  margin: 0.3rem 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: rgba(157, 246, 239, 0.65);
}
.footer-brand__tagline {
  margin: 0;
  max-width: 26ch;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--muted);
}

.footer-nav {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.footer-col__title {
  margin: 0 0 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(157, 246, 239, 0.66);
}
.footer-col__list { display: grid; gap: 0.42rem; }
.footer-link {
  display: inline-block;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}
.footer-link:hover { color: var(--orange); transform: translateX(2px); }

.footer-contact__list { display: grid; gap: 0.65rem; }
.footer-contact__row { display: grid; gap: 0.05rem; }
.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: rgba(157, 246, 239, 0.6);
}
.footer-contact__value {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}
.footer-note {
  margin: 0.9rem 0 0;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(255, 200, 87, 0.55);
  font-size: 0.74rem;
  line-height: 1.65;
  color: rgba(155, 169, 191, 0.85);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.4rem;
  max-width: 1160px;
  margin: 2.2rem auto 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.footer-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(155, 169, 191, 0.85);
}
.footer-meta--icp { color: rgba(157, 246, 239, 0.6); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-left: auto;
}
.footer-legal__link {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.footer-legal__link:hover { color: var(--ice); border-bottom-color: var(--orange); }

@media (min-width: 768px) {
  .site-footer__top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.5fr); }
  .footer-contact { grid-column: 1 / -1; }
}
@media (min-width: 1080px) {
  .site-footer__top {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr) minmax(0, 1.05fr);
  }
  .footer-contact { grid-column: auto; }
}

/* ── 10. 通用按钮 ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #14060A;
  box-shadow: 0 0 0 rgba(255, 106, 26, 0);
}
.btn--primary:hover {
  background: var(--ember);
  border-color: var(--ember);
  color: #14060A;
  box-shadow: 0 0 18px rgba(255, 106, 26, 0.35);
}
.btn--ghost {
  background: transparent;
  border-color: rgba(36, 224, 207, 0.42);
  color: var(--ice);
}
.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(36, 224, 207, 0.08);
}
.btn--block { width: 100%; }

/* ── 11. 布局与内容容器 ──────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.75rem);
}

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .grid--split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ice); }
.breadcrumb__sep { color: rgba(36, 224, 207, 0.45); }

.eyebrow {
  display: inline-block;
  margin: 0 0 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.14rem 0.45rem;
  border: 1px solid var(--line-strong);
  background: rgba(36, 224, 207, 0.08);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ice);
}

/* ── 12. 图片容器（页面阶段放占位图） ───────────────────── */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(150deg, rgba(36, 224, 207, 0.12), transparent 58%),
    linear-gradient(0deg, #05070D, #0B1322);
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, rgba(255, 106, 26, 0.16), transparent 52%);
  pointer-events: none;
}
.media-frame > img { width: 100%; height: 100%; object-fit: cover; }
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 3 / 4; }

/* ── 13. 滚动显现 ────────────────────────────────────────── */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ── 14. 降级动效 ────────────────────────────────────────── */
@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;
    transition-delay: 0ms !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: opacity 220ms linear;
    transition-delay: 0ms;
  }

  .rail-nav__link:hover,
  .footer-link:hover { transform: none; }
}
