/* =========================================================
   聚合入口 · /assets/site.css
   共享外壳：tokens / reset / 排版 / 页头 / 页脚 / 基础组件
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  --mineral: #0E3B3A;
  --plateau: #17635E;
  --salt: #F7F5EF;
  --salt-2: #EDEAE1;
  --ink: #1B2224;
  --red: #B23A2E;
  --yellow: #E8B02A;
  --yellow-ink: #3A2A05;
  --mist: #C9DDD8;
  --moss: #6F7F79;
  --night: #08201F;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail-w: 96px;
  --status-h: 40px;
  --mobilebar-h: 0px;
  --header-h: calc(var(--status-h) + var(--mobilebar-h));

  --maxw: 1180px;
  --radius: 3px;
  --edge: 1px solid rgba(14, 59, 58, 0.14);
  --edge-strong: 1px solid rgba(14, 59, 58, 0.3);
  --shadow-soft: 0 10px 26px -20px rgba(14, 59, 58, 0.55);
}

@media (max-width: 900px) {
  :root {
    --rail-w: 0px;
    --status-h: 34px;
    --mobilebar-h: 56px;
  }
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

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

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

ul[class],
ol[class] { list-style: none; padding-left: 0; }

img, svg, picture, video { display: block; max-width: 100%; }

button { font: inherit; color: inherit; }

::selection { background: rgba(232, 176, 42, 0.45); color: var(--mineral); }

/* ---------- 3. 中文排版基线 ---------- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--header-h) 0 0 var(--rail-w);
  background: var(--salt);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { display: block; flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--mineral);
}

h1 { font-size: clamp(30px, 4vw, 40px); }
h2 { font-size: clamp(22px, 2.4vw, 26px); }
h3 { font-size: 18px; letter-spacing: -0.01em; }
h4 { font-size: 16px; letter-spacing: 0; }

p + p { margin-top: 1.2em; }

a {
  color: var(--plateau);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--mineral); }

strong, b { font-weight: 700; }

.mono,
.seq,
time,
code,
kbd,
samp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ---------- 4. 焦点与可访问性 ---------- */
:focus-visible {
  outline: 2px solid var(--plateau);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--yellow);
}

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

/* ---------- 5. 布局工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

.section { padding-block: clamp(36px, 6vw, 72px); }
.section + .section { border-top: var(--edge); }

.grid {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
}

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

@media (max-width: 860px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
}

.rule {
  height: 1px;
  border: 0;
  margin-block: 24px;
  background: rgba(14, 59, 58, 0.18);
}

/* ---------- 6. 索引元件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--plateau);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--yellow);
}

.seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.seq--lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: var(--edge-strong);
  border-radius: 999px;
  background: var(--salt-2);
  color: var(--plateau);
  font-size: 12px;
  line-height: 1.6;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--mist);
  color: var(--mineral);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.tag--new {
  background: var(--yellow);
  color: var(--yellow-ink);
}

.tag--classic {
  background: rgba(178, 58, 46, 0.1);
  border: 1px solid rgba(178, 58, 46, 0.35);
  color: var(--red);
}

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--moss);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: rgba(111, 127, 121, 0.55);
}

.breadcrumbs a { color: var(--plateau); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---------- 7. 容器与材质 ---------- */
.card {
  padding: clamp(16px, 2.4vw, 24px);
  background: var(--salt-2);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* 玻璃层：仅用于浮层、拼贴叠片，勿在其上承载关键正文 */
.glass {
  background: rgba(201, 221, 216, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 图片占位容器：页面阶段放入 img / picture / 内联 svg 即可自适应 */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: var(--edge);
  border-radius: var(--radius);
  background-color: var(--salt-2);
  background-image:
    repeating-linear-gradient(45deg, rgba(14, 59, 58, 0.055) 0 1px, transparent 1px 12px);
}

.media img,
.media picture,
.media svg,
.media > * {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.6em 1.1em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn--primary {
  background: var(--plateau);
  color: var(--salt);
}
.btn--primary:hover { background: var(--mineral); color: var(--salt); }

.btn--line {
  background: transparent;
  border-color: rgba(247, 245, 239, 0.4);
  color: var(--salt);
}
.btn--line:hover {
  background: rgba(247, 245, 239, 0.12);
  border-color: var(--yellow);
  color: var(--salt);
}

.btn--yellow {
  background: var(--yellow);
  color: var(--yellow-ink);
}
.btn--yellow:hover { background: #F2C24C; color: var(--yellow-ink); }

.btn--sm {
  padding: 3px 11px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* ---------- 9. 折叠组 ---------- */
.fold { border-top: var(--edge); }
.fold:last-child { border-bottom: var(--edge); }

.fold__trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 0;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--mineral);
  cursor: pointer;
}

.fold__trigger::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
  color: var(--plateau);
  transition: transform 0.2s ease;
}

.fold[data-open] .fold__trigger::after {
  content: "−";
  transform: rotate(180deg);
}

.fold__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.fold[data-open] .fold__panel { grid-template-rows: 1fr; }

.fold__panel > * { overflow: hidden; }

.fold__inner {
  padding-bottom: 16px;
  font-size: 15.5px;
  color: rgba(27, 34, 36, 0.86);
}

/* ---------- 10. 显现 ---------- */
[data-reveal] {
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

[data-reveal].is-pending {
  opacity: 0;
  transform: translateY(8px);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 11. 长文 ---------- */
.prose { max-width: 68ch; }
.prose p + p { margin-top: 1.2em; }
.prose h2 { margin-top: 1.9em; }
.prose h3 { margin-top: 1.5em; }
.prose ul,
.prose ol {
  margin-top: 0.8em;
  padding-left: 1.35em;
}
.prose li + li { margin-top: 0.4em; }

/* =========================================================
   页头
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 90;
  background: var(--mineral);
  color: var(--salt);
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 10px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.18s ease;
}

.skip-link:focus { top: 0; color: var(--yellow-ink); }

/* 顶部状态条 */
.site-status {
  position: relative;
  height: var(--status-h);
  background: var(--mineral);
  border-bottom: 1px solid rgba(201, 221, 216, 0.18);
}

.site-status__inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
  height: 100%;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(12px, 2.4vw, 26px);
}

.site-status__brandline {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--salt);
  white-space: nowrap;
}

.site-status__tagline {
  font-size: 12px;
  color: rgba(247, 245, 239, 0.6);
  white-space: nowrap;
}

.site-status__chip {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  white-space: nowrap;
}

.site-status__util {
  font-size: 11.5px;
  color: rgba(247, 245, 239, 0.64);
  white-space: nowrap;
}

.site-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* 移动端品牌条 */
.site-mobilebar { display: none; }

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(247, 245, 239, 0.34);
  border-radius: var(--radius);
  color: var(--salt);
  cursor: pointer;
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.nav-toggle__text {
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* 左侧序号栏杆 */
.site-rail {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  z-index: 88;
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  padding: 14px 8px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--mineral);
  color: var(--salt);
  border-right: 1px solid rgba(201, 221, 216, 0.16);
}

.site-rail__head {
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(201, 221, 216, 0.16);
}

.site-rail__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--salt);
  text-decoration: none;
}

.site-rail__brandmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
}

.site-rail__brandsub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(247, 245, 239, 0.5);
  text-align: center;
}

.site-rail__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-rail__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 4px;
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  color: rgba(247, 245, 239, 0.74);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.site-rail__link:hover {
  color: var(--salt);
  background: rgba(201, 221, 216, 0.1);
}

.site-rail__link[aria-current="page"] {
  color: var(--salt);
  background: rgba(23, 99, 94, 0.72);
  border-left-color: var(--yellow);
}

.site-rail__link[aria-current="page"] .seq { color: var(--yellow); }

.site-rail__label {
  font-size: 11.5px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: center;
}

.site-rail__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(201, 221, 216, 0.16);
}

.site-rail__foot .mono {
  font-size: 10px;
  color: rgba(247, 245, 239, 0.55);
}

.site-scrim { display: none; }

@media (max-height: 720px) and (min-width: 901px) {
  .site-rail__link { padding: 7px 4px; gap: 5px; }
  .site-rail__head { padding-bottom: 10px; margin-bottom: 8px; }
}

/* ---------- 页头响应式 ---------- */
@media (max-width: 900px) {
  .site-status__tagline,
  .site-status__util,
  .site-status .btn { display: none; }

  .site-status__brandline { font-size: 11.5px; }
  .site-status__chip { font-size: 10.5px; }

  .site-mobilebar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--mobilebar-h);
    padding-inline: 14px;
    background: var(--mineral);
    border-top: 1px solid rgba(201, 221, 216, 0.14);
  }

  .site-mobilebar__brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--salt);
    text-decoration: none;
  }

  .site-mobilebar__chip {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--yellow-ink);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
  }

  .nav-toggle { display: inline-flex; }

  .site-rail {
    top: 0;
    bottom: 0;
    width: min(84vw, 320px);
    padding: 20px 18px 24px;
    border-right: 0;
    transform: translateX(-104%);
    transition: transform 0.24s ease-out;
    box-shadow: 0 24px 60px -30px #000;
    z-index: 100;
  }

  .site-rail[data-open] { transform: none; }

  .site-rail__head { padding-bottom: 16px; margin-bottom: 14px; }

  .site-rail__brand {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }

  .site-rail__brandmark { font-size: 17px; }
  .site-rail__brandsub { font-size: 10px; }

  .site-rail__link {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
  }

  .site-rail__label { font-size: 14px; text-align: left; }

  .site-rail__foot {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
  }

  .site-rail__foot .mono { font-size: 11px; }

  .site-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(8, 32, 31, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .site-scrim[data-open] {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open { overflow: hidden; }
}

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  background: var(--night);
  color: var(--salt-2);
  font-size: 14px;
}

.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--yellow) 0 22%,
    var(--red) 22% 38%,
    var(--plateau) 38% 74%,
    var(--mist) 74% 100%
  );
}

.site-footer__top {
  padding-block: clamp(32px, 5vw, 56px);
  background-image: repeating-linear-gradient(
    115deg,
    rgba(201, 221, 216, 0.05) 0 1px,
    transparent 1px 22px
  );
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 0.85fr 0.85fr 0.9fr;
  gap: clamp(20px, 3vw, 44px);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

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

.site-footer__wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--salt);
}

.site-footer__note {
  max-width: 34ch;
  margin: 10px 0 18px;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(237, 234, 225, 0.7);
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(237, 234, 225, 0.72);
  word-break: break-all;
}

.site-footer__contact li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.site-footer__contact .mono {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--mist);
  letter-spacing: 0.08em;
}

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

.site-footer__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--yellow);
  margin-bottom: 14px;
}

.site-footer__title::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  margin-top: 8px;
  background: var(--yellow);
}

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

.site-footer__list a {
  display: inline-block;
  font-size: 14px;
  color: rgba(237, 234, 225, 0.78);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.site-footer__list a:hover {
  color: var(--salt);
  border-bottom-color: var(--yellow);
}

.site-footer__basewrap {
  border-top: 1px solid rgba(201, 221, 216, 0.16);
  background: rgba(14, 59, 58, 0.35);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px clamp(18px, 4vw, 48px) 22px;
}

.site-footer__legal {
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(237, 234, 225, 0.55);
}

.site-footer__legal--meta {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: rgba(201, 221, 216, 0.72);
}

@media (max-width: 1080px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__note { max-width: none; }
  .site-footer__base { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- 深底按钮的焦点补偿 ---------- */
.btn--yellow:focus-visible { outline-color: var(--mineral); }

/* ---------- 动效降级 ---------- */
@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;
  }

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