/* ============================================================
   万搏CN · /assets/site.css
   共享外壳：reset / 设计令牌 / 中文排版 / 头部轨道导航 / 页脚 / 通用组件
   ============================================================ */

/* ---------- 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, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { width: 100%; border-collapse: collapse; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- 设计令牌 ---------- */
:root {
  --navy: #0E1B2C;
  --navy-2: #17293F;
  --steel: #24405F;
  --mist: #8C9AAB;
  --cream: #F4EFE6;
  --paper: #E7DFD1;
  --orange: #FF6A2B;
  --orange-soft: #FFB48A;
  --orange-ink: #A8400F;
  --teal: #1FA98C;
  --ink: #241C16;

  --ink-soft: rgba(36, 28, 22, 0.66);
  --line-soft: rgba(36, 64, 95, 0.16);
  --line-dark: rgba(140, 154, 171, 0.26);

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

  --rail-w: 252px;
  --gutter: 20px;
  --radius: 4px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-soft: 0 10px 30px rgba(14, 27, 44, 0.10);
}

/* ---------- 基础排版 ---------- */
body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: inherit;
  line-height: 1.18;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.25rem); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.125rem); font-weight: 900; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.125rem, 1rem + 0.7vw, 1.5rem); font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 1.0625rem; font-weight: 700; }

p { line-height: 1.75; }

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

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 2px; }
.site-footer :focus-visible,
.rail :focus-visible { outline-color: var(--orange-soft); }

/* ---------- 工具类 ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.muted { color: var(--ink-soft); }
.lead { font-size: 1.125rem; line-height: 1.8; color: var(--ink-soft); max-width: 42em; }
.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;
}

/* ---------- 跳至主内容 ---------- */
.skip-link {
  position: absolute;
  top: -64px;
  left: 12px;
  z-index: 120;
  padding: 10px 18px;
  background: var(--navy);
  color: var(--cream);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- 头部外壳 ---------- */
.site-header {
  position: relative;
  z-index: 60;
}

/* 顶部信息条（玻璃层） */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 239, 230, 0.86);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  border-bottom: 1px solid var(--line-soft);
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(1280px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  min-height: 76px;
  padding: 12px 0;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand__mark {
  display: inline-flex;
  align-items: center;
  font-size: 1.3125rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.brand__mark::before {
  content: "";
  width: 12px; height: 12px;
  margin-right: 9px;
  background: var(--orange);
}
.brand__tag {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.masthead__tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.masthead__filter {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--mist);
  white-space: nowrap;
}

/* 状态徽标 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(31, 169, 140, 0.12);
  border: 1px solid rgba(31, 169, 140, 0.38);
  color: #0d6a56;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 169, 140, 0.18);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn--solid { background: var(--orange); color: #2A1206; }
.btn--solid:hover { background: var(--orange-soft); color: var(--ink); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: rgba(36, 64, 95, 0.35); }
.btn--ghost:hover { border-color: var(--navy); background: rgba(36, 64, 95, 0.07); }
.btn--navy { background: var(--navy); color: var(--cream); }
.btn--navy:hover { background: var(--steel); }
.btn--block { width: 100%; }

/* ---------- 移动抽屉按钮 ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(36, 64, 95, 0.35);
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
}
.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.25s var(--ease), top 0.25s var(--ease), background-color 0.25s var(--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); }

/* ---------- 左侧章节导航轨 ---------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 22px 22px;
  background: linear-gradient(180deg, #0E1B2C 0%, #17293F 62%, #0E1B2C 100%);
  color: var(--cream);
}
.rail__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.36em;
  color: var(--mist);
}
.rail__list { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.rail__item { display: block; }
.rail__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 12px;
  border-left: 3px solid transparent;
  border-radius: 3px;
  color: #D6DDE6;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.rail__link:hover {
  background: rgba(255, 180, 138, 0.10);
  border-left-color: var(--orange-soft);
  color: #FFFFFF;
}
.rail__link[aria-current="page"] {
  background: rgba(255, 106, 43, 0.16);
  border-left-color: var(--orange);
  color: #FFFFFF;
}
.rail__num { font-size: 0.75rem; color: var(--orange); letter-spacing: 0.06em; }
.rail__link[aria-current="page"] .rail__num { color: var(--orange-soft); }
.rail__text { font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; }
.rail__foot {
  padding-top: 14px;
  border-top: 1px solid var(--line-dark);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--mist);
}

@media (min-width: 1080px) {
  body { padding-left: var(--rail-w); }
  .rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    z-index: 70;
    overflow-y: auto;
    border-right: 1px solid var(--line-dark);
  }
}

@media (max-width: 1079px) {
  .rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(84vw, 320px);
    z-index: 80;
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform 0.3s var(--ease);
    box-shadow: 14px 0 40px rgba(14, 27, 44, 0.35);
  }
  .rail[data-open] { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
  .masthead__filter { display: none; }
  .site-header[data-nav-open]::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(14, 27, 44, 0.6);
  }
  body.is-nav-open { overflow: hidden; }
}

/* ---------- 移动端底部工具栏 ---------- */
.toolbar { display: none; }

@media (max-width: 1079px) {
  .toolbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 55;
    display: flex;
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(14, 27, 44, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--orange);
  }
  .toolbar__link {
    flex: 1 1 0;
    padding: 11px 12px;
    text-align: center;
    border: 1px solid var(--line-dark);
    border-radius: 3px;
    color: var(--cream);
    font-size: 0.875rem;
    font-weight: 700;
  }
  .toolbar__link--solid {
    background: var(--orange);
    border-color: transparent;
    color: #2A1206;
  }
  body { padding-bottom: 76px; }
}

@media (max-width: 719px) {
  .masthead__inner { gap: 12px; min-height: 66px; padding: 10px 0; }
  .masthead__tools .btn--ghost,
  .masthead__tools .chip { display: none; }
  .brand__mark { font-size: 1.1875rem; }
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--navy);
  color: var(--cream);
}
.footer__band {
  height: 8px;
  background: linear-gradient(90deg, var(--orange) 0 34%, var(--teal) 34% 46%, var(--steel) 46% 100%);
}
.footer__inner {
  width: min(1160px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 54px 0 28px;
}
.footer__sign {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border: 1px solid var(--line-dark);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  background: rgba(244, 239, 230, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.footer__brand { display: flex; flex-direction: column; gap: 6px; }
.footer__mark { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.01em; color: #FFFFFF; }
.footer__signoff { font-size: 0.9375rem; letter-spacing: 0.08em; color: var(--orange-soft); }
.footer__note {
  max-width: 34em;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--mist);
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr);
  gap: 32px;
  margin-top: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--line-dark);
}
.footer__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--orange-soft);
}
.footer__list { display: flex; flex-direction: column; gap: 4px; }
.footer__link {
  display: inline-block;
  padding: 5px 0;
  color: #C9D2DD;
  font-size: 0.9375rem;
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.footer__link:hover { color: var(--orange-soft); padding-left: 5px; }
.footer__contact {
  padding: 16px 18px;
  border-left: 3px solid var(--orange);
  background: rgba(244, 239, 230, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  line-height: 1.9;
  color: #C9D2DD;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
  font-size: 0.8125rem;
  color: var(--mist);
}
.footer__legal .mono { color: var(--cream); }
.footer__maintain { font-size: 0.75rem; letter-spacing: 0.08em; }

@media (max-width: 980px) {
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .footer__cols { grid-template-columns: 1fr; gap: 26px; }
  .footer__inner { padding-top: 40px; }
}

/* ---------- 容器与章节 ---------- */
.shell { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.shell--narrow { width: min(820px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.shell--wide { width: min(1340px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--orange-ink);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  color: var(--orange-ink);
}
.section-head h2 { margin-top: 2px; }

/* ---------- 色带 ---------- */
.band { height: 10px; background: var(--navy); }
.band--orange { background: var(--orange); }
.band--teal { background: var(--teal); }
.band--split {
  background: linear-gradient(90deg, var(--navy) 0 46%, var(--orange) 46% 78%, var(--teal) 78% 100%);
}

/* ---------- 长文 ---------- */
.prose {
  max-width: 42em;
  font-size: 1.0625rem;
  color: var(--ink);
}
.prose > * + * { margin-top: 1.2em; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-top: 0.5em; line-height: 1.75; }
.prose a {
  color: var(--orange-ink);
  border-bottom: 1px solid rgba(168, 64, 15, 0.42);
  transition: background-color 0.2s var(--ease);
}
.prose a:hover { background: rgba(255, 180, 138, 0.35); }

/* ---------- 卡片 ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.card__title { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.card__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--orange-ink);
}
.card__body { font-size: 0.9375rem; line-height: 1.8; color: var(--ink-soft); }
.card--dark {
  background: var(--navy-2);
  border-color: var(--line-dark);
  color: var(--cream);
}
.card--dark .card__body { color: var(--mist); }
.card--glass {
  background: rgba(244, 239, 230, 0.08);
  border: 1px solid rgba(244, 239, 230, 0.24);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--cream);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(36, 64, 95, 0.2);
  border-radius: 2px;
  background: var(--paper);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tag--orange {
  background: rgba(255, 106, 43, 0.12);
  border-color: rgba(255, 106, 43, 0.45);
  color: var(--orange-ink);
}
.tag--teal {
  background: rgba(31, 169, 140, 0.12);
  border-color: rgba(31, 169, 140, 0.42);
  color: #0d6a56;
}

/* ---------- 网格 ---------- */
.grid { display: grid; gap: 20px; }
.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)); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- 标签页（同级内容切换） ---------- */
.tabs { display: flex; flex-direction: column; gap: 18px; }
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.tabs__btn {
  padding: 10px 16px;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tabs__btn:hover { color: var(--navy); }
.tabs__btn[aria-selected="true"],
.tabs__btn.is-active {
  color: var(--navy);
  border-bottom-color: var(--orange);
}
.tabs__panel { padding-top: 6px; }
.tabs__panel[hidden] { display: none; }
.tabs--dark .tabs__list { border-bottom-color: var(--line-dark); }
.tabs--dark .tabs__btn { color: var(--mist); }
.tabs--dark .tabs__btn[aria-selected="true"] { color: var(--cream); }

/* ---------- 图片容器（页面阶段填充占位） ---------- */
.figure { margin: 0; display: block; }
.figure__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--paper);
  background-image:
    linear-gradient(135deg, rgba(36, 64, 95, 0.10) 25%, transparent 25%, transparent 50%,
      rgba(36, 64, 95, 0.10) 50%, rgba(36, 64, 95, 0.10) 75%, transparent 75%);
  background-size: 18px 18px;
  aspect-ratio: 16 / 10;
}
.figure__media img,
.figure__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure--wide .figure__media { aspect-ratio: 21 / 9; }
.figure--tall .figure__media { aspect-ratio: 3 / 4; }
.figure--line .figure__media {
  background-image: none;
  background-color: transparent;
  border: 1px dashed rgba(36, 64, 95, 0.32);
}
.figure--dark .figure__media {
  background-color: var(--navy-2);
  background-image:
    linear-gradient(135deg, rgba(140, 154, 171, 0.14) 25%, transparent 25%, transparent 50%,
      rgba(140, 154, 171, 0.14) 50%, rgba(140, 154, 171, 0.14) 75%, transparent 75%);
  border: 1px solid var(--line-dark);
}
.figure__cap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.figure__cap .mono { color: var(--orange-ink); }

/* ---------- 面包屑 ---------- */
.crumbs {
  padding: 16px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.crumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumbs__item { display: inline-flex; align-items: center; gap: 8px; }
.crumbs__link { transition: color 0.2s var(--ease); }
.crumbs__link:hover { color: var(--orange-ink); }
.crumbs__sep { color: rgba(36, 28, 22, 0.35); }
.crumbs__item[aria-current="page"] { color: var(--ink); font-weight: 700; }
.crumbs--onDark { color: var(--mist); }
.crumbs--onDark .crumbs__item[aria-current="page"] { color: var(--cream); }
.crumbs--onDark .crumbs__sep { color: rgba(140, 154, 171, 0.6); }
.crumbs--onDark .crumbs__link:hover { color: var(--orange-soft); }

/* ---------- 滚动渐显 ---------- */
html[data-js="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}
html[data-js="on"] [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html[data-js="on"] [data-reveal] { transform: none; }
  .card:hover { transform: none; }
  .btn--solid:hover { transform: none; }
  .rail { transition: none; }
}
