/* ============================================================
   多宝平台主站 · /assets/site.css
   夜间战术板 · 侧轨导航 · 精密网格
   ============================================================ */

/* ---------- 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, figure, blockquote, dl, dd, dt, ul, ol, li { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- 2. tokens ---------- */
:root {
  --ink: #050814;
  --indigo: #0B1230;
  --panel: #121B44;
  --panel-2: #0E1739;
  --line: #2A3766;
  --gold: #F2B544;
  --gold-soft: rgba(242, 181, 68, .14);
  --teal: #2EE6C5;
  --orange: #FF7A3D;
  --mist: #8FA6C8;
  --paper: #F4F7FF;

  --font-display: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  --container: 1180px;
  --rail-w: 274px;
  --bar-h: 62px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 3. base ---------- */
body {
  min-height: 100vh;
  background-color: var(--indigo);
  background-image:
    radial-gradient(110% 55% at 84% -10%, rgba(242, 181, 68, .13), transparent 62%),
    radial-gradient(85% 45% at 2% 0%, rgba(46, 230, 197, .09), transparent 60%);
  background-repeat: no-repeat;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, rgba(42, 55, 102, .55) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(to bottom, rgba(42, 55, 102, .45) 0 1px, transparent 1px 92px);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 22%, transparent 84%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 22%, transparent 84%);
}

main { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.05rem; }

p { line-height: 1.85; }

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

/* ---------- 4. skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-200%);
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 5. header · mobile bar + drawer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  min-height: var(--bar-h);
  padding: 0 clamp(14px, 4vw, 22px);
  background: rgba(11, 18, 48, .95);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}
.brand__mark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 18px;
  height: 24px;
  flex: none;
}
.brand__mark i { display: block; width: 4px; height: 100%; background: var(--gold); }
.brand__mark i:nth-child(2) { height: 56%; background: var(--teal); }
.brand__mark i:nth-child(3) { height: 78%; background: var(--mist); }
.brand__text { display: block; }
.brand__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: .08em;
  transition: color .18s var(--ease);
}
.brand__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: .64rem;
  line-height: 1.5;
  letter-spacing: .18em;
  color: var(--mist);
}
.brand:hover .brand__name { color: var(--gold); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .16em;
  cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.nav-toggle:hover { border-color: var(--gold); color: var(--gold); }
.nav-toggle__bars { display: grid; gap: 5px; width: 16px; }
.nav-toggle__bars i {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform .22s var(--ease);
}
.site-header[data-open="true"] .nav-toggle__bars i:first-child { transform: translateY(3.5px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle__bars i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.nav-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100dvh - var(--bar-h) - 8px);
  overflow-y: auto;
  padding: 6px clamp(14px, 4vw, 22px) 26px;
  background: var(--indigo);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(3, 6, 20, .62);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s linear;
}
.site-header[data-open="true"] .nav-drawer {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.site-nav__item { border-top: 1px solid var(--line); }
.site-nav__item:last-child { border-bottom: 1px solid var(--line); }

.site-nav__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 2px;
  color: var(--paper);
  text-decoration: none;
  transition: color .18s var(--ease);
}
.site-nav__idx {
  min-width: 2.4ch;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--mist);
  transition: color .18s var(--ease);
}
.site-nav__label {
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: .06em;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  height: 1px;
  width: 0;
  background: var(--teal);
  transition: width .28s var(--ease);
}
.site-nav__link:hover { color: var(--gold); }
.site-nav__link:hover .site-nav__idx { color: var(--gold); }
.site-nav__link:hover::after { width: 24px; }

.site-nav__link[aria-current="page"] { color: var(--gold); }
.site-nav__link[aria-current="page"] .site-nav__idx { color: var(--gold); }
.site-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 1.4em;
  background: var(--gold);
}

.rail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
}

.quick-guide {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(242, 181, 68, .55);
  border-radius: 2px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: .8rem;
  letter-spacing: .06em;
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.quick-guide:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(46, 230, 197, .45);
  border-radius: 2px;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
}
.status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
}

.rail-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.rail-progress__bar {
  display: block;
  height: 100%;
  width: calc(var(--p, 0) * 1%);
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

html.nav-open { overflow: hidden; }

/* ---------- 6. header · desktop rail ---------- */
@media (min-width: 1000px) {
  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 30px 26px 20px;
    background: linear-gradient(180deg, #0d1538 0%, var(--indigo) 52%, #070c22 100%);
    border-bottom: 0;
    border-right: 1px solid var(--line);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: hidden;
  }

  .rail-top { flex-direction: column; align-items: flex-start; gap: 0; width: auto; }
  .brand__name { font-size: 1.32rem; }
  .brand__tag { font-size: .66rem; letter-spacing: .2em; }
  .nav-toggle { display: none; }

  .nav-drawer {
    position: static;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav { margin-top: 30px; }
  .site-nav__list { display: flex; flex-direction: column; }
  .site-nav__link { padding: 11px 2px; }
  .site-nav__label { font-size: 1.02rem; }

  .rail-meta {
    margin-top: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  .quick-guide { font-size: .78rem; padding: 8px 12px; }

  .rail-progress {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
  }
  .rail-progress__bar {
    width: 100%;
    height: calc(var(--p, 0) * 1%);
    background: linear-gradient(180deg, var(--teal), var(--gold));
  }
}

/* ---------- 7. footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(48px, 8vw, 90px);
  padding: clamp(40px, 6vw, 64px) 0 26px;
  background: linear-gradient(180deg, rgba(5, 8, 20, 0) 0%, #050814 32%, #04060f 100%);
  border-top: 1px solid var(--line);
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 44px);
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.footer__brandline {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.5;
  letter-spacing: .06em;
  color: var(--paper);
}
.footer__lede {
  margin-top: 12px;
  max-width: 34ch;
  font-size: .92rem;
  line-height: 1.8;
  color: var(--mist);
}
.footer__cta { margin-top: 22px; }

.footer__col-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .24em;
  color: var(--teal);
}

.footer__list { display: grid; gap: 10px; }

.footer__link {
  color: var(--mist);
  font-size: .92rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.footer__link:hover { color: var(--paper); border-bottom-color: var(--gold); }

.footer__meta { display: grid; gap: 14px; }
.footer__meta-line { display: grid; gap: 3px; }
.footer__label {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .14em;
  color: var(--mist);
}
.footer__value {
  font-size: .92rem;
  line-height: 1.6;
  color: var(--paper);
}
.footer__value--mono {
  font-family: var(--font-mono);
  font-size: .84rem;
  letter-spacing: .02em;
  word-break: break-all;
}
.footer__micro {
  margin-top: 16px;
  font-size: .78rem;
  line-height: 1.75;
  color: rgba(143, 166, 200, .85);
}

.footer__base {
  max-width: var(--container);
  margin: clamp(32px, 5vw, 52px) auto 0;
  padding: 18px clamp(18px, 4vw, 40px) 0;
  border-top: 1px solid var(--line);
}
.footer__base-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--mist);
}
.footer__copy,
.footer__region,
.footer__icp { line-height: 1.7; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- 8. back to top ---------- */
.to-top {
  position: fixed;
  right: clamp(12px, 3vw, 26px);
  bottom: clamp(14px, 3vw, 26px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(11, 18, 48, .94);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .14em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s linear,
              border-color .2s var(--ease), color .2s var(--ease);
}
.to-top[data-visible="true"] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--gold); color: var(--gold); }
.to-top__glyph { font-size: .95rem; line-height: 1; }

/* ---------- 9. shared components ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.section { padding-block: clamp(44px, 7vw, 88px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .22em;
  color: var(--teal);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--teal); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.22;
  letter-spacing: .01em;
}
.section-lede {
  margin-top: 14px;
  max-width: 58ch;
  font-size: 1rem;
  color: var(--mist);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: .94rem;
  line-height: 1.4;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 700;
}
.btn--primary:hover { background: #FFC862; border-color: #FFC862; }
.btn--ghost { border-color: rgba(46, 230, 197, .5); color: var(--teal); }
.btn--ghost:hover { background: rgba(46, 230, 197, .1); }
.btn--quiet { padding-inline: 0; border-color: transparent; color: var(--mist); }
.btn--quiet:hover { color: var(--gold); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--mist);
}
.chip--gold { color: var(--gold); border-color: rgba(242, 181, 68, .5); }
.chip--teal { color: var(--teal); border-color: rgba(46, 230, 197, .5); }
.chip--orange { color: var(--orange); border-color: rgba(255, 122, 61, .55); }

.breadcrumb { font-size: .78rem; letter-spacing: .04em; color: var(--mist); }
.breadcrumb__list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.breadcrumb__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb__sep { color: var(--line); }
.breadcrumb__link {
  color: var(--mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.breadcrumb__link:hover { color: var(--paper); border-bottom-color: var(--gold); }
.breadcrumb__item[aria-current="page"] { color: var(--paper); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 26px);
}
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--aside {
    grid-template-columns: minmax(0, 1fr) 306px;
    gap: clamp(28px, 3.4vw, 48px);
    align-items: start;
  }
}

.card {
  position: relative;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width .3s var(--ease);
}
.card:hover::before { width: 56px; }
.card__title { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.4; }
.card__meta {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  color: var(--mist);
}
.card__body { margin-top: 10px; font-size: .94rem; line-height: 1.75; color: var(--mist); }

.figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(155deg, #16204d 0%, #0a1030 58%, #050814 100%);
}
.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, rgba(143, 166, 200, .16) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(to bottom, rgba(143, 166, 200, .12) 0 1px, transparent 1px 46px);
}
.figure__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 9px 14px;
  background: linear-gradient(180deg, rgba(5, 8, 20, 0) 0%, rgba(5, 8, 20, .88) 72%);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--mist);
}
.figure--wide { aspect-ratio: 21 / 9; }
.figure--tall { aspect-ratio: 3 / 4; }
.figure--square { aspect-ratio: 1 / 1; }
@media (max-width: 520px) {
  .figure--wide { aspect-ratio: 16 / 9; }
}

.prose {
  max-width: 66ch;
  font-size: 1rem;
  line-height: 1.9;
  color: #DCE4F7;
}
.prose p + p,
.prose p + ul,
.prose ul + p { margin-top: 1.05em; }
.prose h2 {
  margin-top: 2em;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--paper);
}
.prose h3 {
  margin-top: 1.6em;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--paper);
}
.prose a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 230, 197, .4);
}
.prose a:hover { border-bottom-color: var(--teal); }
.prose ul { padding-left: 0; }
.prose ul li { position: relative; margin-top: .5em; padding-left: 1.1em; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 6px;
  height: 1px;
  background: var(--gold);
}

/* ---------- 10. utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.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;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

[data-spy-link].is-active { color: var(--gold); }

/* ---------- 11. focus & motion ---------- */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

@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;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- 12. print ---------- */
@media print {
  .site-header,
  .nav-drawer,
  .to-top { display: none !important; }
  body { padding-left: 0 !important; background: #fff; color: #111; }
  body::before { display: none; }
  .site-footer { background: #fff; color: #111; border-top: 1px solid #ccc; }
}
