/* =========================================================
   九号娱乐 · 共享样式 /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, p, ul, ol, li, dl, dt, dd, figure, blockquote, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg, video { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

/* ---------- 2. tokens ---------- */
:root {
  --ink: #0B1A26;
  --ink-2: #132A3A;
  --line: #2A4658;
  --paper: #F4EFE4;
  --cream: #E7DFCE;
  --gold: #D8A33C;
  --cinnabar: #C0432B;
  --jade: #4E7A73;
  --muted: #8A8578;
  --white: #FFFFFF;
  --text-dark: #16232E;

  --rail: 88px;
  --maxw: 1180px;
  --gutter: clamp(20px, 4vw, 56px);

  --fs-hero: clamp(46px, 9vw, 96px);
  --fs-h2: clamp(28px, 4.4vw, 56px);
  --fs-h3: clamp(21px, 2.6vw, 34px);
  --fs-h4: 22px;
  --fs-body: 17px;
  --fs-small: 14px;
  --fs-micro: 12px;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  --font-narrow: "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --ease: .18s ease;
}

/* ---------- 3. base ---------- */
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.85;
  letter-spacing: .01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-narrow); font-weight: 800; line-height: 1.14; letter-spacing: -.02em; }
::selection { background: var(--gold); color: var(--ink); }

#main-content {
  display: block;
  margin-left: var(--rail);
  background: var(--paper);
  color: var(--text-dark);
  min-height: 70vh;
}

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

/* ---------- 4. skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px; left: calc(var(--rail) + 12px);
  z-index: 300;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-size: var(--fs-small);
  letter-spacing: .06em;
  transform: translateY(-180%);
  transition: transform var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 5. header / 侧边轨道 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 18px;
  background: var(--ink);
  border-right: 1px solid var(--line);
  color: var(--paper);
}
.header-bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.brand {
  display: block;
  width: 64px;
  margin: 0 auto;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  transition: color var(--ease);
}
.brand-mark {
  display: block;
  margin: 0 auto;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-narrow);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .2em;
  color: var(--paper);
  transition: color var(--ease);
}
.brand-subline { display: none; }
.brand:hover .brand-mark { color: var(--gold); }

.nav-toggle { display: none; }
.nav-toggle-label { font-size: var(--fs-small); letter-spacing: .08em; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after { display: block; width: 16px; height: 1.5px; background: var(--gold); }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { content: ""; position: absolute; top: -5px; left: 0; }
.nav-toggle-bars::after { content: ""; position: absolute; top: 5px; left: 0; }

.site-nav {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-list { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.nav-item { width: 100%; }
.nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 5px 0 5px 8px;
  border-left: 2px solid transparent;
  color: var(--paper);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.nav-index { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); transition: color var(--ease); }
.nav-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 12.5px;
  letter-spacing: .16em;
  line-height: 1;
  transition: color var(--ease);
}
.nav-link:hover { background: var(--ink-2); }
.nav-link:hover .nav-label { color: var(--gold); }
.nav-link[aria-current="page"] { background: var(--ink-2); border-left-color: var(--gold); }
.nav-link[aria-current="page"] .nav-label { color: var(--gold); }
.nav-link[aria-current="page"] .nav-index { color: var(--gold); }

.utility-search {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  transition: background var(--ease), color var(--ease);
}
.utility-search-label {
  display: block;
  margin: 0 auto;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 11px;
  letter-spacing: .18em;
  line-height: 1;
}
.utility-search:hover { background: var(--ink-2); color: var(--gold); }

.rail-progress {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 2px;
  background: rgba(42, 70, 88, .55);
}
.rail-progress-fill {
  display: block;
  width: 100%; height: 100%;
  background: var(--gold);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
  transition: transform .12s linear;
}

/* ---------- 6. footer ---------- */
.site-footer {
  margin-left: var(--rail);
  padding: clamp(40px, 6vw, 72px) var(--gutter) 24px;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
}
.footer-brand-line {
  font-family: var(--font-narrow);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -.01em;
  max-width: 24ch;
}
.footer-note { margin-top: 12px; font-size: var(--fs-small); line-height: 1.8; color: var(--muted); max-width: 34ch; }
.footer-meta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--muted);
}
.footer-icp { color: var(--gold); }
.footer-heading {
  font-family: var(--font-narrow);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--gold);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.footer-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.footer-link {
  font-size: var(--fs-small);
  color: var(--paper);
  opacity: .84;
  transition: color var(--ease), opacity var(--ease);
}
.footer-link:hover { color: var(--gold); opacity: 1; }
.footer-base {
  max-width: var(--maxw);
  margin: clamp(32px, 5vw, 56px) auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.footer-copyright { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.legal-list { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.legal-list .footer-link { font-size: 12.5px; color: var(--muted); }
.legal-list .footer-link:hover { color: var(--gold); }

/* ---------- 7. 版心与底色分区 ---------- */
.section { padding: clamp(48px, 7vw, 96px) var(--gutter); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section--paper { background: var(--paper); color: var(--text-dark); }
.section--cream { background: var(--cream); color: var(--text-dark); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink-2 { background: var(--ink-2); color: var(--paper); }

/* ---------- 8. 文字角色 ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; flex: 0 0 auto; width: 24px; height: 1px; background: var(--gold); }
.section--ink .eyebrow, .section--ink-2 .eyebrow, .site-footer .eyebrow { color: var(--gold); }

.lede { font-family: var(--font-serif); font-size: clamp(18px, 2vw, 24px); line-height: 1.75; }
.conclusion {
  font-family: var(--font-narrow);
  font-weight: 900;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  letter-spacing: -.01em;
  border-left: 3px solid var(--gold);
  padding-left: 16px;
}
.prose { max-width: 64ch; font-size: var(--fs-body); line-height: 1.85; }
.prose p + p { margin-top: 1.2em; }
.rail-note {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
  border-left: 1px solid rgba(138, 133, 120, .5);
  padding-left: 12px;
  max-width: 24ch;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.key-number {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}
.section--ink .key-number, .section--ink-2 .key-number { color: var(--white); }
.divider { height: 1px; border: 0; background: var(--line); opacity: .6; margin: clamp(24px, 4vw, 44px) 0; }

/* ---------- 9. 按钮 / 标记 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 14px;
  letter-spacing: .08em;
  line-height: 1;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn::after { content: "\2192"; font-family: var(--font-mono); font-size: 13px; }
.btn:hover { background: var(--gold); color: var(--ink); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: transparent; color: var(--gold); }
.btn--ghost { border-color: var(--line); color: inherit; }
.btn--ghost:hover { background: var(--ink-2); color: var(--paper); border-color: var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  line-height: 1.6;
}
.chip--gold { border-color: var(--gold); color: var(--gold); }
.chip--cinnabar { border-color: var(--cinnabar); color: var(--cinnabar); }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--jade);
  vertical-align: middle;
}
.status-dot--cinnabar { background: var(--cinnabar); }
.status-dot--gold { background: var(--gold); }

/* ---------- 10. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin: 0 10px; color: var(--line); opacity: .7; }

/* ---------- 11. 数据表 / 索引 ---------- */
.data-table { width: 100%; font-size: 15px; border-top: 1px solid var(--line); }
.data-table caption {
  text-align: left;
  padding-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
}
.data-table th {
  padding: 12px 14px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--muted);
  white-space: nowrap;
}
.section--ink .data-table th, .section--ink-2 .data-table th { background: var(--ink-2); color: var(--gold); }
.data-table td { padding: 14px; border-bottom: 1px solid rgba(42, 70, 88, .28); vertical-align: top; }
.data-table tbody tr { transition: background var(--ease); }
.data-table tbody tr:hover { background: rgba(216, 163, 60, .08); }
.data-table tbody td:first-child { border-left: 2px solid transparent; transition: border-color var(--ease); }
.data-table tbody tr:hover td:first-child,
.data-table tbody tr:focus-within td:first-child { border-left-color: var(--gold); }
.data-table tbody tr:focus-visible { outline: 1px solid var(--gold); outline-offset: -1px; }
.data-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.index-list { border-top: 1px solid var(--line); }
.index-list li { border-bottom: 1px solid var(--line); }
.index-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 16px 6px;
  transition: background var(--ease), padding-left var(--ease);
}
.index-list a:hover { background: rgba(216, 163, 60, .08); padding-left: 14px; }
.index-list .idx { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: var(--gold); }

/* ---------- 12. 网格 ---------- */
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ---------- 13. 图像容器 ---------- */
.figure {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: 1px solid var(--line);
  overflow: hidden;
}
.figure::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(216, 163, 60, .14) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(216, 163, 60, .14) 0 1px, transparent 1px 48px);
}
.figure--wide { aspect-ratio: 21 / 9; }
.figure--tall { aspect-ratio: 4 / 5; }
.figure-img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.figure-cap {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
}

/* ---------- 14. 样本切换 ---------- */
.sample-switch { display: inline-flex; border: 1px solid var(--line); }
.sample-btn {
  padding: 7px 14px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
  transition: background var(--ease), color var(--ease);
}
.sample-btn:first-child { border-left: 0; }
.sample-btn:hover { background: var(--ink-2); color: var(--paper); }
.sample-btn[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* ---------- 15. 焦点反馈 ---------- */
.nav-link:focus-visible,
.brand:focus-visible,
.utility-search:focus-visible,
.nav-toggle:focus-visible,
.footer-link:focus-visible,
.index-list a:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.nav-link:focus-visible .nav-index { color: var(--gold); }

/* ---------- 16. 平板与手机 ---------- */
@media (max-width: 1079px) {
  .skip-link { left: 12px; }
  #main-content { margin-left: 0; }

  .site-header {
    position: sticky;
    top: 0; left: auto; right: auto; bottom: auto;
    width: 100%;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .header-bar {
    position: relative;
    z-index: 130;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    width: 100%;
    background: var(--ink);
  }
  .brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: auto;
    margin: 0;
    padding: 0 0 0 10px;
    border-bottom: 0;
    border-left: 2px solid var(--gold);
    text-align: left;
  }
  .brand-mark { writing-mode: horizontal-tb; text-orientation: mixed; font-size: 19px; letter-spacing: .04em; }
  .brand-subline { display: inline; font-size: 11px; letter-spacing: .04em; color: var(--muted); }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); transition: background var(--ease); }
  .nav-toggle:hover { background: var(--ink-2); }

  .site-nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(82vw, 320px);
    z-index: 120;
    display: block;
    padding: 78px 20px 32px;
    background: var(--ink-2);
    border-right: 1px solid var(--line);
    transform: translateX(-104%);
    transition: transform .22s ease;
    overflow-y: auto;
  }
  .site-header[data-open] .site-nav { transform: translateX(0); }
  .nav-list { align-items: stretch; gap: 2px; }
  .nav-link { flex-direction: row; align-items: center; gap: 14px; padding: 13px 12px; }
  .nav-label { writing-mode: horizontal-tb; text-orientation: mixed; font-size: 16px; letter-spacing: .06em; }
  .nav-index { font-size: 11px; }

  .utility-search { border-top: 1px solid var(--line); padding: 11px 16px; text-align: left; color: var(--gold); }
  .utility-search-label { writing-mode: horizontal-tb; text-orientation: mixed; font-size: 13px; letter-spacing: .06em; }

  .rail-progress { top: auto; left: 0; right: 0; bottom: -1px; width: 100%; height: 2px; }
  .rail-progress-fill { transform: scaleX(var(--p, 0)); transform-origin: left; }

  .site-footer { margin-left: 0; }
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }

  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .col-4, .col-6, .col-8, .col-12 { grid-column: span 6; }
}

@media (max-width: 640px) {
  .brand-subline { display: none; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .footer-base { flex-direction: column; align-items: flex-start; }
  .grid-12 { grid-template-columns: 1fr; }
  .col-4, .col-6, .col-8, .col-12 { grid-column: span 1; }
  .index-list a { grid-template-columns: 48px 1fr; gap: 12px; }
}

/* ---------- 17. 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
