/* =========================================================
   site.css — 共享外壳：reset / tokens / header / footer / 通用组件
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(78px + 16px);
}

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

body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, figcaption, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}
ul, ol { list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---------- tokens ---------- */
:root {
  --ink: #0A1420;
  --moss: #102A25;
  --lime: #A8FF3E;
  --ember: #FF5A36;
  --gold: #D8B26A;
  --paper: #E6D8B8;
  --white: #F2F7F5;
  --mist: #7E9A93;
  --deep: #0F3B4A;

  --rail-w: 96px;
  --bar-h: 78px;
  --bar-h-tight: 64px;
  --top-pad: 78px;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 26px;

  --font-display: "Oswald", "Archivo Narrow", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --hair: rgba(126, 154, 147, .20);
  --hair-gold: rgba(216, 178, 106, .28);
}

/* ---------- base ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 620px at 80% -12%, rgba(15, 59, 74, .55), transparent 62%),
    radial-gradient(900px 520px at 6% 14%, rgba(16, 42, 37, .92), transparent 62%);
  background-repeat: no-repeat;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1024px) {
  body { background-attachment: fixed; }
}

::selection { background: var(--lime); color: #06110A; }

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

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

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: calc(var(--rail-w) + 16px);
  z-index: 200;
  padding: 10px 20px;
  transform: translateY(-180%);
  background: var(--lime);
  color: #06110A;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  border-radius: 999px;
  transition: transform .24s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header { position: relative; z-index: 80; }

/* ---- 左侧品牌轨道 ---- */
.brand-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 22px;
  background: linear-gradient(180deg, #102A25 0%, #0B1A22 52%, #0F3B4A 100%);
  border-right: 1px solid var(--hair-gold);
}

.rail-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.rail-mark__cn {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .40em;
  color: var(--white);
  transition: color .24s var(--ease);
}
.rail-mark__sub {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .32em;
  color: var(--mist);
  transition: color .24s var(--ease);
}
.rail-mark:hover .rail-mark__cn { color: var(--lime); }
.rail-mark:hover .rail-mark__sub { color: var(--gold); }

.rail-scale {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 0;
  min-height: 0;
}
.rail-scale__line {
  width: 1px;
  flex: 1;
  min-height: 24px;
  background: linear-gradient(180deg, transparent, rgba(216, 178, 106, .55), transparent);
}
.rail-scale__num {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gold);
}

.rail-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: var(--radius-m);
  color: var(--mist);
  transition: color .24s var(--ease), background .24s var(--ease);
}
.rail-toggle:hover,
.rail-toggle:focus-visible { color: var(--lime); background: rgba(168, 255, 62, .08); }
.rail-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}
.rail-toggle__bars i {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--ease), width .3s var(--ease);
}
.rail-toggle__bars i:last-child { width: 13px; }
.rail-toggle__label {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
}
.rail-toggle[aria-expanded="true"] .rail-toggle__bars i:first-child { transform: translateY(3.5px) rotate(45deg); }
.rail-toggle[aria-expanded="true"] .rail-toggle__bars i:last-child { width: 22px; transform: translateY(-3.5px) rotate(-45deg); }

/* ---- 顶部导航条 ---- */
.site-bar {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--bar-h);
  z-index: 85;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 0 clamp(18px, 3.2vw, 52px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: height .32s var(--ease), background .32s var(--ease), border-color .32s var(--ease);
}
.site-header[data-scrolled] .site-bar {
  height: var(--bar-h-tight);
  background: rgba(10, 20, 32, .90);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--hair-gold);
}

.site-bar__tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--mist);
  white-space: nowrap;
}
.site-bar__sep { color: var(--gold); margin: 0 7px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.8vw, 26px);
}
.site-nav__list a {
  position: relative;
  display: block;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--mist);
  text-decoration: none;
  white-space: nowrap;
  transition: color .22s var(--ease);
}
.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--lime);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s var(--ease);
}
.site-nav__list a:hover { color: var(--white); }
.site-nav__list a:hover::after { transform: scaleX(.45); }
.site-nav__list a[aria-current="page"] { color: var(--white); }
.site-nav__list a[aria-current="page"]::after { transform: scaleX(1); }

.site-nav__utility {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease), transform .24s var(--ease);
}
.btn--subscribe {
  background: var(--lime);
  color: #06110A;
  font-weight: 700;
}
.btn--subscribe:hover { background: #BFFF63; transform: translateY(-1px); }
.btn--ghost {
  border-color: rgba(126, 154, 147, .45);
  color: var(--mist);
}
.btn--ghost:hover { border-color: var(--lime); color: var(--lime); }
.btn--index {
  border-color: var(--hair-gold);
  color: var(--gold);
}
.btn--index:hover { background: rgba(216, 178, 106, .12); }
.btn--index[aria-expanded="true"] {
  background: var(--gold);
  color: #1A1305;
  border-color: var(--gold);
}

/* =========================================================
   CHAPTER INDEX（JS 注入）
   ========================================================= */
.chapter-index {
  position: fixed;
  left: calc(var(--rail-w) + 22px);
  bottom: 24px;
  z-index: 88;
  width: min(310px, calc(100vw - 48px));
  max-height: min(58vh, 440px);
  overflow-y: auto;
  padding: 16px 10px 12px;
  background: rgba(16, 42, 37, .97);
  border: 1px solid var(--hair-gold);
  border-radius: var(--radius-l);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .26s var(--ease), transform .26s var(--ease), visibility .26s;
}
.chapter-index[data-open] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.chapter-index__head {
  padding: 0 10px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--gold);
  border-bottom: 1px solid var(--hair);
}
.chapter-index__list { padding-top: 8px; }
.chapter-index__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius-s);
  font-size: 14px;
  color: var(--mist);
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chapter-index__link:hover { background: rgba(168, 255, 62, .08); color: var(--white); }
.chapter-index__link[aria-current] { background: rgba(168, 255, 62, .10); color: var(--lime); }
.chapter-index__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  flex: none;
}
.chapter-index__text { line-height: 1.4; }

/* =========================================================
   TO TOP（JS 注入）
   ========================================================= */
.to-top {
  position: fixed;
  right: clamp(16px, 2.4vw, 34px);
  bottom: clamp(16px, 2.4vw, 34px);
  z-index: 88;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: rgba(10, 20, 32, .88);
  border: 1px solid var(--hair-gold);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s, border-color .24s var(--ease);
}
.to-top[data-visible] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--lime); }
.to-top__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.to-top__track { fill: none; stroke: rgba(216, 178, 106, .26); stroke-width: 2; }
.to-top__meter {
  fill: none;
  stroke: var(--lime);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dashoffset .12s linear;
}
.to-top__glyph {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-left: 2px solid var(--lime);
  border-top: 2px solid var(--lime);
  transform: rotate(45deg);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  position: relative;
  margin-top: clamp(72px, 9vw, 140px);
  padding: clamp(52px, 6.5vw, 88px) 0 clamp(28px, 3.6vw, 46px);
  background: linear-gradient(180deg, #0A1420 0%, #102A25 46%, #0A1420 100%);
  border-top: 1px solid var(--hair-gold);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 9px;
  pointer-events: none;
  opacity: .7;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(216, 178, 106, .55) 0 1px,
    transparent 1px 64px
  );
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
  padding-bottom: clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--hair);
}
.footer-brand__mark {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--white);
}
.footer-brand__epoch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
}
.footer-brand__dash {
  display: block;
  width: clamp(28px, 5vw, 72px);
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(216, 178, 106, .15));
}
.footer-brand__unit {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: .18em;
  color: var(--mist);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(26px, 3.2vw, 48px);
  margin-top: clamp(32px, 4vw, 52px);
}

.footer-col__title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--gold);
}
.footer-list { display: flex; flex-direction: column; gap: 10px; }
.footer-list a {
  font-size: 14px;
  line-height: 1.55;
  color: var(--mist);
  text-decoration: none;
  transition: color .2s var(--ease), padding-left .2s var(--ease);
}
.footer-list a:hover { color: var(--lime); padding-left: 4px; }
.footer-list--plain li {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--mist);
}
.footer-list--plain .num { color: var(--white); letter-spacing: .06em; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 22px;
  border-top: 1px solid var(--hair);
}
.footer-base__legal {
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(126, 154, 147, .92);
}
.footer-base__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.footer-base__links a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.footer-base__links a:hover { color: var(--lime); border-bottom-color: var(--lime); }

/* =========================================================
   SHARED CONTENT COMPONENTS
   ========================================================= */
.wrap {
  width: min(1240px, 100% - 2 * clamp(20px, 4.4vw, 72px));
  margin-inline: auto;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--mist);
}
.breadcrumbs a { color: var(--mist); text-decoration: none; transition: color .2s var(--ease); }
.breadcrumbs a:hover { color: var(--lime); }
.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: rgba(126, 154, 147, .5);
}

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

.panel {
  padding: clamp(20px, 3vw, 32px);
  background: linear-gradient(150deg, rgba(16, 42, 37, .92), rgba(10, 20, 32, .92));
  border: 1px solid var(--hair);
  border-radius: var(--radius-l);
}

.stat {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(38px, 7vw, 88px);
  line-height: .95;
  letter-spacing: -.01em;
  color: var(--lime);
}

/* 图片容器基础规则：页面阶段把 <img> 放进来即可 */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: linear-gradient(135deg, #102A25 0%, #0F3B4A 58%, #0A1420 100%);
  aspect-ratio: 16 / 9;
  isolation: isolate;
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame--arch img {
  filter: grayscale(.58) sepia(.26) contrast(1.06) brightness(.9);
}
.media-frame--arch::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(230, 216, 184, .14);
  mix-blend-mode: overlay;
}

/* =========================================================
   REVEAL PROTOCOL
   ========================================================= */
[data-reveal-pending] {
  opacity: 0;
  transform: translateX(24px);
}
[data-reveal-pending][data-revealed] {
  opacity: 1;
  transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1279px) {
  .site-bar__tagline { display: none; }
}

@media (max-width: 1023px) {
  body {
    padding-left: 0;
    padding-top: 62px;
  }

  .brand-rail {
    inset: 0 0 auto 0;
    width: auto;
    height: 62px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--hair-gold);
    background: linear-gradient(90deg, #102A25 0%, #0B1A22 62%, #0F3B4A 100%);
  }

  .rail-mark { flex-direction: row; align-items: center; gap: 10px; }
  .rail-mark__cn {
    writing-mode: horizontal-tb;
    font-size: 14px;
    letter-spacing: .20em;
  }
  .rail-mark__sub {
    writing-mode: horizontal-tb;
    font-size: 9px;
    letter-spacing: .26em;
  }

  .rail-scale { display: none; }

  .rail-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
  }
  .rail-toggle__label {
    writing-mode: horizontal-tb;
    font-size: 10px;
    letter-spacing: .18em;
  }

  .site-bar {
    position: static;
    height: auto;
    padding: 0;
    display: block;
    background: none;
    border: 0;
  }

  .site-nav {
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 84;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 0 18px;
    padding: 28px 20px 48px;
    background: linear-gradient(180deg, rgba(10, 20, 32, .985), #0A1420 100%);
    border-top: 1px solid var(--hair-gold);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav__list {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    border-top: 1px solid var(--hair);
  }
  .site-nav__list li { border-bottom: 1px solid var(--hair); }
  .site-nav__list a {
    padding: 15px 4px;
    font-size: 15px;
    letter-spacing: .04em;
    color: var(--white);
    white-space: normal;
  }
  .site-nav__list a::after { display: none; }
  .site-nav__list a[aria-current="page"] { color: var(--lime); }

  .site-nav__utility {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    margin-top: 26px;
  }
  .site-nav__utility .btn { flex: 1 1 auto; padding: 13px 18px; }

  .skip-link { left: 16px; }

  .chapter-index {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 54vh;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }

  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 620px) {
  .site-nav__list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand__mark { letter-spacing: .10em; }
  .footer-base__links { gap: 8px 16px; }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .site-nav__list a { font-size: 12px; }
  .btn { padding: 9px 15px; font-size: 11.5px; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  [data-reveal-pending] {
    opacity: 1;
    transform: none;
  }

  .to-top__meter { transition: none; }
  .btn--subscribe:hover { transform: none; }
  .footer-list a:hover { padding-left: 0; }
}
