/* =========================================================
   /assets/site.css — 36官网旧版 · 共享外壳
   档案册装订体系：墨蓝封套 / 暖纸白内页 / 琥珀金索引
   ========================================================= */

/* ---------- 1. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 124px;
}

body, h1, h2, h3, h4, h5, p, ul, ol, li, figure, figcaption, blockquote, dl, dt, dd {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

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

button {
  font: inherit;
  color: inherit;
  background: 0 0;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0E1B2A;
  --ink-deep: #0A1521;
  --panel: #14283D;
  --line: #2E4661;
  --line-soft: rgba(46, 70, 97, .55);
  --paper: #F4F1E9;
  --mist: #DCE4EA;
  --text: #101820;
  --amber: #C9933A;
  --amber-soft: #E0B463;
  --cinnabar: #B44A3C;
  --sage: #7E9078;
  --slate: #6B7A8A;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);

  --font-sans: "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --edge: 1px solid var(--line);
  --shadow-panel: 0 10px 22px rgba(5, 12, 20, .22);
  --shadow-paper: 0 8px 18px rgba(16, 24, 32, .07);
}

/* ---------- 3. 基础排版（中文优先） ---------- */
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.012em;
}

h1 { font-size: clamp(32px, 4.6vw, 56px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }

p { line-height: 1.75; }

strong, b { font-weight: 800; }

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

/* ---------- 4. 工具类 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--amber);
}

/* ---------- 5. skip link ---------- */
.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--amber);
  color: #132132;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  transform: translateY(-180%);
  transition: transform .2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

/* ---------- 6. 页头：框架式导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink);
  border-bottom: var(--edge);
}

/* 6.1 编号条 */
.header-rail {
  background: var(--ink-deep);
  border-bottom: 1px solid var(--line-soft);
}

.header-rail__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
  padding-block: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--slate);
}

.header-rail__id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--mist);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-rail__badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  font-size: 10px;
  color: var(--slate);
}

.header-rail__status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 1px 10px;
  border: 1px solid var(--line);
  color: var(--sage);
  font-size: 10px;
  letter-spacing: .1em;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(126, 144, 120, .18);
}

/* 6.2 品牌与导航条 */
.header-bar {
  background: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}

.header-bar__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 74px;
  transition: min-height .2s ease;
}

.site-header[data-condensed] .header-bar__inner {
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  order: 1;
}

.brand__mark {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background-image: repeating-linear-gradient(180deg, var(--amber) 0 2px, transparent 2px 7px);
  background-size: 12px 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand__title {
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper);
  white-space: nowrap;
  transition: color .18s ease;
}

.brand:hover .brand__title { color: var(--amber-soft); }

.brand__desc {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .13em;
  color: var(--slate);
  white-space: nowrap;
}

/* 6.3 导航（桌面横向编号条） */
.site-nav {
  margin-left: auto;
  order: 4;
}

.site-nav__list {
  display: flex;
  align-items: stretch;
  gap: clamp(2px, .8vw, 10px);
}

.site-nav__item { min-width: 0; }

.site-nav__link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 8px 9px;
  border-top: 2px solid transparent;
  color: var(--mist);
  font-size: 13px;
  line-height: 1.25;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.site-nav__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--slate);
  transition: color .18s ease;
}

.site-nav__label { white-space: nowrap; }

.site-nav__link:hover {
  color: var(--paper);
  border-top-color: rgba(201, 147, 58, .6);
  background: rgba(201, 147, 58, .05);
}

.site-nav__link:hover .site-nav__num { color: var(--amber); }

.site-nav__link[aria-current="page"] {
  color: var(--paper);
  border-top-color: var(--amber);
  background: rgba(201, 147, 58, .1);
}

.site-nav__link[aria-current="page"] .site-nav__num { color: var(--amber); }

/* 6.4 页头资料入口 */
.header-action {
  order: 3;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  background: var(--amber);
  color: #132132;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
  border-radius: 2px;
  transition: background-color .18s ease, color .18s ease;
}

.header-action::after {
  content: "↓";
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.header-action:hover { background: var(--amber-soft); }

/* 6.5 移动导航按钮 */
.nav-toggle {
  display: none;
  order: 5;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  transition: border-color .18s ease, color .18s ease;
}

.nav-toggle:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.nav-toggle__bars {
  display: grid;
  gap: 3px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}

.site-header[data-nav-open] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.site-header[data-nav-open] .nav-toggle__bars span:nth-child(2) { opacity: 0; }

.site-header[data-nav-open] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

.nav-toggle__text { line-height: 1; }

/* 6.6 阅读进度边线 */
.header-progress {
  height: 2px;
  background: rgba(46, 70, 97, .5);
}

.header-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
  transition: width .15s linear;
}

/* ---------- 7. 页脚：装订封底 ---------- */
.site-footer {
  background: var(--ink-deep);
  color: var(--mist);
  border-top: 2px solid var(--amber);
}

.footer-frame {
  padding-top: clamp(36px, 5vw, 60px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr .9fr 1.25fr;
  gap: clamp(20px, 2.6vw, 36px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

.footer-col { min-width: 0; }

.footer-col + .footer-col {
  border-left: 1px solid var(--line-soft);
  padding-left: clamp(16px, 2vw, 28px);
}

.footer-brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper);
}

.footer-brand__sep { color: var(--amber); }

.footer-brand__sub {
  display: inline;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--slate);
}

.footer-note {
  margin-top: 10px;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--slate);
}

.footer-brand + .footer-note + .btn { margin-top: 16px; }

.footer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--mist);
}

.footer-heading__num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  color: var(--amber);
  font-size: 10px;
  letter-spacing: 0;
}

.doc-list { border-top: 1px solid var(--line-soft); }

.doc-list__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(46, 70, 97, .4);
  font-size: 13.5px;
  color: var(--mist);
}

.doc-list__name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doc-list__meta {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--sage);
  white-space: nowrap;
}

.footer-more {
  display: inline-block;
  margin-top: 14px;
  padding-bottom: 2px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--amber);
  border-bottom: 1px solid rgba(201, 147, 58, .45);
  transition: color .18s ease, border-color .18s ease;
}

.footer-more:hover {
  color: var(--amber-soft);
  border-bottom-color: var(--amber-soft);
}

.footer-links a {
  display: block;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--mist);
  border-bottom: 1px solid rgba(46, 70, 97, .35);
  transition: color .18s ease, padding-left .18s ease, border-color .18s ease;
}

.footer-links li:first-child a { border-top: 1px solid var(--line-soft); }

.footer-links a:hover {
  padding-left: 8px;
  color: var(--amber);
  border-bottom-color: rgba(201, 147, 58, .5);
}

.footer-contact { border-top: 1px solid var(--line-soft); }

.footer-contact__row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(46, 70, 97, .35);
}

.footer-contact__row:last-child { border-bottom: 0; }

.footer-contact dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--slate);
  padding-top: 4px;
}

.footer-contact dd {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--mist);
  overflow-wrap: anywhere;
}

.footer-col--contact .footer-contact { margin-bottom: 2px; }

.footer-base {
  background: var(--ink);
  border-top: 1px solid var(--line);
}

.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--slate);
}

.footer-copy,
.footer-icp { color: var(--slate); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-legal a {
  color: var(--mist);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.footer-legal a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.btn--gold {
  background: var(--amber);
  color: #132132;
}

.btn--gold:hover { background: var(--amber-soft); }

.btn--ghost {
  border-color: var(--line);
  color: var(--mist);
}

.btn--ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn--ink {
  background: var(--ink);
  color: var(--paper);
}

.btn--ink:hover { background: var(--panel); }

/* ---------- 9. 面包屑 ---------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--slate);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}

.crumbs a {
  color: var(--mist);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.crumbs a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.crumbs [aria-current="page"] { color: var(--paper); }

/* ---------- 10. 章节与栅格 ---------- */
.section { padding-block: clamp(40px, 6vw, 80px); }

.section--paper {
  background: var(--paper);
  color: var(--text);
}

.section--deep {
  background: var(--panel);
  color: var(--paper);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 11. 面板与标签 ---------- */
.panel {
  border: var(--edge);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.panel--paper {
  border-color: rgba(16, 24, 32, .14);
  background: var(--paper);
  color: var(--text);
  box-shadow: var(--shadow-paper);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 11px 16px;
  border-bottom: var(--edge);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--slate);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  line-height: 1.7;
  white-space: nowrap;
}

.tag--live { color: var(--sage); }
.tag--warn { color: var(--cinnabar); }
.tag--index { color: var(--amber); }

/* ---------- 12. 图片容器基础（页面阶段放置图片） ---------- */
.media {
  position: relative;
  border: 1px solid rgba(16, 24, 32, .14);
  background: var(--mist);
  overflow: hidden;
}

.media__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--mist);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
}

.media__inner img,
.media__inner svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--square .media__inner { aspect-ratio: 1 / 1; }
.media--wide .media__inner { aspect-ratio: 21 / 9; }

.media__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 12px;
  border-top: 1px solid rgba(16, 24, 32, .14);
  background: var(--paper);
  color: var(--slate);
  font-size: 12px;
  line-height: 1.6;
}

.media__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--amber);
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1180px) {
  .site-nav__link { padding-inline: 6px; font-size: 12.5px; }
}

@media (max-width: 1020px) {
  html { scroll-padding-top: 108px; }

  .brand__title { font-size: 16px; }
  .brand__desc { font-size: 9.5px; letter-spacing: .1em; }

  .nav-toggle { display: inline-flex; }
  .header-action { order: 2; margin-left: auto; }
  .brand { order: 1; margin-right: auto; }
  .site-nav { order: 3; margin-left: 0; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    background: var(--ink-deep);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(5, 12, 20, .45);
    transition: max-height .24s ease, visibility .24s ease;
  }

  .site-nav[data-open] {
    max-height: min(72vh, 460px);
    overflow-y: auto;
    visibility: visible;
  }

  .site-nav__list {
    display: block;
    padding: 10px var(--gutter) 18px;
  }

  .site-nav__link {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 13px 4px;
    border-top: 0;
    border-left: 2px solid transparent;
    font-size: 15px;
    transition: color .18s ease, border-color .18s ease, padding-left .18s ease, background-color .18s ease;
  }

  .site-nav__item + .site-nav__item .site-nav__link {
    border-top: 1px solid rgba(46, 70, 97, .5);
  }

  .site-nav__link:hover {
    border-top-color: transparent;
    border-left-color: rgba(201, 147, 58, .6);
    padding-left: 12px;
  }

  .site-nav__link[aria-current="page"] {
    border-top-color: transparent;
    border-left-color: var(--amber);
    background: rgba(201, 147, 58, .1);
  }

  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-col + .footer-col {
    border-left: 0;
    padding-left: 0;
  }

  .footer-col {
    border-top: 1px solid var(--line-soft);
    padding-top: 18px;
  }

  .footer-col--brand {
    border-top: 0;
    padding-top: 0;
  }

  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-bar__inner { min-height: 64px; }
  .site-header[data-condensed] .header-bar__inner { min-height: 56px; }
  .header-rail__status { font-size: 9.5px; padding-inline: 8px; }
  .header-rail__id .mono { font-size: 10px; }
  .footer-grid { gap: 20px; padding-bottom: 28px; }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .doc-list__name { white-space: normal; }
  .footer-base__inner { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .brand__desc { display: none; }
  .header-action { padding: 8px 11px; font-size: 12px; }
  .header-rail__badge { display: none; }
  .header-rail__inner { font-size: 10px; }
}

@media (max-width: 380px) {
  .brand__title { font-size: 14px; }
  .header-action { padding: 7px 9px; font-size: 11.5px; }
  .nav-toggle { padding: 7px 8px; }
  .nav-toggle__text { display: none; }
}

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

  .header-progress__fill { transition: none !important; }
  .site-nav { transition: none !important; }
}
