/* ============================================================
   天博看台 · 共享样式 /assets/site.css
   夜间看台 + 技术蓝图网格：轨道导航、切角面板、等宽数据
   ============================================================ */

/* ---------- 1. 变量 ---------- */
:root {
  --ink: #071A16;
  --panel: #0E2A23;
  --zone: #123C35;
  --cyan: #39FFD0;
  --orange: #FF8A3D;
  --wine: #6E1F35;
  --indigo: #2A2140;
  --mist: #E8F5F0;
  --sage: #8FB7AC;
  --gold: #FFD166;
  --edge: #1E4D43;
  --edge-soft: rgba(57, 255, 208, 0.18);
  --edge-hard: rgba(57, 255, 208, 0.42);
  --rail-w: 276px;
  --cut: 12px;
  --bp-gap: 16px;
  --font-display: "Arial Narrow", "Helvetica Neue", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- 2. 重置与中文排版 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--mist);
  background:
    radial-gradient(1200px 620px at 88% -12%, rgba(57, 255, 208, 0.07), transparent 62%),
    radial-gradient(900px 520px at -12% 108%, rgba(110, 31, 53, 0.30), transparent 62%),
    var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 蓝图网格底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(30, 77, 67, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 77, 67, 0.55) 1px, transparent 1px);
  background-size: 68px 68px;
  opacity: 0.42;
}

.site-header, .site-footer, #main-content, main { position: relative; z-index: 1; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.22;
  margin: 0 0 0.6em;
  color: var(--mist);
}

h1 { font-size: clamp(38px, 6vw, 72px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: clamp(20px, 2.2vw, 24px); }

p { margin: 0 0 1em; }

a { color: var(--cyan); text-underline-offset: 3px; }

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

::selection { background: var(--cyan); color: #04120F; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. 工具类 ---------- */
.cut {
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut))
  );
}

.wrap {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

.section { padding: 56px 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 28px;
}

.section-head__title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: clamp(24px, 3vw, 34px);
  margin: 0;
}

.idx {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.stat {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1;
  color: var(--orange);
  letter-spacing: -0.02em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--sage);
  background: var(--zone);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.diag-rule {
  height: 1px;
  border: 0;
  margin: 28px 0;
  background: repeating-linear-gradient(90deg, var(--edge) 0 10px, transparent 10px 20px);
}

.panel {
  background: var(--panel);
  padding: 22px;
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut))
  );
}

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
}

.btn--solid {
  background: var(--cyan);
  color: #04120F;
}
.btn--solid:hover { background: #7BFFE2; }

.btn--line {
  background: var(--zone);
  color: var(--mist);
  box-shadow: inset 0 0 0 1px var(--edge-hard);
}
.btn--line:hover {
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--cyan);
}

.btn--warm {
  background: var(--wine);
  color: #FFE7D6;
  box-shadow: inset 0 0 0 1px rgba(255, 138, 61, 0.45);
}
.btn--warm:hover { background: #8A2A44; color: #FFFFFF; }

/* ---------- 5. 头部与轨道导航 ---------- */
.skip-link {
  position: absolute;
  left: 14px;
  top: -72px;
  z-index: 90;
  padding: 10px 16px;
  background: var(--cyan);
  color: #04120F;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, #0B251F, #071A16);
  border-bottom: 1px solid var(--edge);
}

.rail {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.rail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 70;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--mist);
}

.brand__mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  background:
    linear-gradient(135deg, var(--cyan) 0 46%, transparent 46%),
    var(--zone);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 24% 100%, 0 76%);
}
.brand__mark::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.2; }

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.06em;
}

.brand__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--sage);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: var(--zone);
  color: var(--mist);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--edge-hard);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: box-shadow 0.2s ease, color 0.2s ease;
}
.nav-toggle:hover { color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}
.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--cyan);
  transition: transform 0.24s ease, opacity 0.24s ease, width 0.24s ease;
}
.nav-toggle__bars i:nth-child(2) { width: 68%; }

.site-header[data-open] .nav-toggle__bars i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bars i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* 移动端抽屉 */
.rail__nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(88vw, 360px);
  height: 100dvh;
  padding: 84px 20px 28px;
  overflow-y: auto;
  background: linear-gradient(180deg, #0E2A23, #081914);
  border-left: 1px solid var(--edge);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.4, 0.1, 0.2, 1), visibility 0.32s linear;
}

.site-header[data-open] .rail__nav,
.rail__nav[data-open] {
  transform: translateX(0);
  visibility: visible;
}

.rail__legend {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--sage);
  text-transform: uppercase;
}
.rail__legend::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 9px;
  background: repeating-linear-gradient(90deg, var(--edge) 0 8px, transparent 8px 16px);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 13px;
  color: var(--mist);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.03em;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.nav-link__idx {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sage);
  font-variant-numeric: tabular-nums;
}
.nav-link:hover {
  background: var(--zone);
  border-left-color: var(--cyan);
  color: #FFFFFF;
}
.nav-link:hover .nav-link__idx { color: var(--cyan); }
.nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(57, 255, 208, 0.16), rgba(57, 255, 208, 0));
  border-left-color: var(--cyan);
  color: var(--cyan);
}
.nav-link[aria-current="page"] .nav-link__idx { color: var(--cyan); }

.rail__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--edge);
}

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

.rail__tagline {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sage);
}

.rail__meter {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: rgba(30, 77, 67, 0.55);
}
.rail__meter-bar {
  display: block;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, var(--cyan), var(--gold));
  transition: height 0.12s linear;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 0;
  border: 0;
  background: rgba(3, 14, 12, 0.74);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity 0.28s ease, visibility 0.28s linear;
}
.site-header[data-open] .nav-scrim {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1023px) {
  body[data-nav-open] { overflow: hidden; }
}

/* 桌面：左侧常驻轨道 */
@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    height: 100vh;
    height: 100dvh;
    border-bottom: 0;
    border-right: 1px solid var(--edge);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .rail {
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 26px 20px 22px;
    overflow-y: auto;
  }

  .rail__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    z-index: auto;
  }

  .nav-toggle { display: none; }

  .rail__nav {
    position: static;
    transform: none;
    visibility: visible;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    background: transparent;
    border-left: 0;
    flex: 1;
  }

  .nav-link { font-size: 17px; padding: 10px 12px; }

  .rail__meter { display: block; }

  .nav-scrim { display: none; }
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  margin-top: 72px;
  background: linear-gradient(180deg, #0A2119, #050F0C 78%);
  border-top: 1px solid var(--edge);
}

.footer__inner {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
  padding: 54px 0 26px;
  display: grid;
  gap: 34px;
}

.footer__brand-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.footer__brand-note {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.footer__summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--sage);
  max-width: 34ch;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 26px 20px;
}

.footer__col-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--sage);
  text-transform: uppercase;
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer__link {
  position: relative;
  display: inline-block;
  color: var(--mist);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.18s ease;
}
.footer__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.22s ease;
}
.footer__link:hover { color: var(--cyan); }
.footer__link:hover::after,
.footer__link:focus-visible::after { width: 100%; }

.footer__note {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--sage);
}

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

.footer__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--sage);
}

.footer__value {
  font-size: 15px;
  color: var(--mist);
  word-break: break-word;
}

.footer__meta {
  border-top: 1px dashed var(--edge);
  padding: 16px 0 20px;
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
}

.footer__icp,
.footer__copyright {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--sage);
}

@media (min-width: 768px) {
  .footer__inner { grid-template-columns: 1fr 1.5fr; }
}

@media (min-width: 1100px) {
  .footer__inner { grid-template-columns: 1.05fr 1.75fr 1.05fr; }
}

/* ---------- 7. 内容基础组件 ---------- */
.prose {
  max-width: 74ch;
  font-size: 17px;
  line-height: 1.8;
  color: var(--mist);
}
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose h2 { font-size: clamp(24px, 3vw, 32px); }
.prose h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0.01em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--cyan);
  color: var(--sage);
  font-family: var(--font-serif);
}
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--zone);
  padding: 1px 6px;
  color: var(--gold);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--sage);
}
.crumbs a { color: var(--sage); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs > * + *::before {
  content: "／";
  margin-right: 6px;
  color: var(--edge-hard);
}

.bp-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: var(--bp-gap);
}
.bp-grid > * { grid-column: 1 / -1; min-width: 0; }

@media (min-width: 768px) {
  .bp-6 { grid-column: span 6; }
  .bp-8 { grid-column: span 8; }
  .bp-12 { grid-column: span 12; }
  .bp-16 { grid-column: span 16; }
  .bp-18 { grid-column: span 18; }
  .bp-24 { grid-column: span 24; }
}

/* 图片与 SVG 容器基础规则 */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(140deg, var(--indigo), #0B1F1B);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  clip-path: polygon(
    0 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% 100%,
    18px 100%,
    0 calc(100% - 18px)
  );
}
.media > img,
.media > svg,
.media > picture,
.media > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }

.media__slot {
  display: grid;
  place-items: center;
  min-height: 160px;
  height: 100%;
  padding: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sage);
  background-image:
    linear-gradient(to right, rgba(57, 255, 208, 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(57, 255, 208, 0.10) 1px, transparent 1px);
  background-size: 28px 28px;
}

.media__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--mist);
  background: linear-gradient(180deg, rgba(7, 26, 22, 0), rgba(7, 26, 22, 0.88));
}

/* 滚动显现 */
body[data-reveal="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
body[data-reveal="on"] [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 8. 平板上调 ---------- */
@media (min-width: 768px) {
  .section { padding: 72px 0; }
  .rail__actions { flex-direction: row; }
  .rail__actions .btn { flex: 1; }
}

@media (min-width: 1024px) {
  .rail__actions { flex-direction: column; }
  .section { padding: 84px 0; }
}

/* ---------- 9. 减少动效 ---------- */
@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;
  }
  body[data-reveal="on"] [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
