/* ============================================================
   AOBOCN · 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, figure, blockquote, dl, dd, table, caption { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--moss-700); }

/* ---------- 变量 ---------- */
:root {
  --ink-900: #06120E;
  --ink-850: #0A1B15;
  --moss-700: #1D3A2E;
  --stone-500: #7E8C85;
  --stone-300: #B9C2BB;
  --bone-100: #EDEAE0;
  --cyan-400: #2EE6C8;
  --orange-500: #FF8A2B;
  --clay-600: #B06A3C;
  --cyan-800: #0F5E55;
  --flag-500: #E4573D;

  --grid-rgba: rgba(126, 140, 133, .08);
  --hairline: 1px solid var(--moss-700);
  --hairline-soft: 1px solid rgba(29, 58, 46, .7);

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

  --shell: 1360px;
  --gutter: 24px;
  --header-h: 100px;
  --radius: 0;
}

@media (max-width: 700px) {
  :root { --gutter: 18px; --header-h: 60px; }
}

/* ---------- 基础排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink-900);
  color: var(--bone-100);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 38px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
}

#main-content { display: block; padding-top: var(--header-h); }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

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

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 200;
  transform: translateY(-180%);
  padding: 10px 16px;
  background: var(--orange-500);
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform .16s ease-out;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 焦点 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 2px; }
.btn:focus-visible { outline-offset: 3px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn--primary {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: var(--ink-900);
}
.btn--primary:hover { background: #FFA45C; border-color: #FFA45C; }
.btn--ghost {
  background: transparent;
  border-color: var(--moss-700);
  color: var(--bone-100);
}
.btn--ghost:hover { border-color: var(--cyan-400); color: var(--cyan-400); }
.btn--quiet {
  padding-left: 0; padding-right: 0;
  background: transparent;
  border-color: transparent;
  color: var(--stone-300);
}
.btn--quiet:hover { color: var(--cyan-400); }

/* ---------- 页头 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: transparent;
  border-bottom: 1px solid rgba(29, 58, 46, .85);
  transition: background-color .2s ease, border-color .2s ease;
}
.site-header[data-scrolled] {
  background: var(--ink-850);
  border-bottom-color: var(--moss-700);
}

.header-rail {
  max-height: 34px;
  overflow: hidden;
  border-bottom: var(--hairline-soft);
  transition: max-height .24s ease, opacity .24s ease;
}
.site-header[data-scrolled] .header-rail {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
}
.header-rail__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 33px;
}
.header-rail__stamp {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--stone-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-rail__quick {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--cyan-400);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.header-rail__quick:hover { border-bottom-color: var(--cyan-400); }

.header-bar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 66px;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: var(--bone-100);
}
.brand__mark {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--bone-100);
}
.brand__mark::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 3px;
  margin-left: 8px;
  background: var(--cyan-400);
}
.brand__line {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .08em;
  color: var(--stone-500);
}
.brand:hover .brand__mark { color: var(--cyan-400); }

.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}
.site-nav__list { display: flex; align-items: center; gap: 2px; }
.site-nav__link {
  position: relative;
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--stone-300);
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease;
}
.site-nav__link:hover { color: var(--bone-100); background: rgba(29, 58, 46, .6); }
.site-nav__link[aria-current="page"] { color: var(--cyan-400); }
.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 3px;
  height: 1px;
  background: var(--cyan-400);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 36px;
  border: 1px solid var(--moss-700);
  border-radius: var(--radius);
  color: var(--bone-100);
}
.nav-toggle:hover { border-color: var(--cyan-400); }
.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
}

.header-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: rgba(126, 140, 133, .16);
}
.header-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan-400);
  transition: width .1s linear;
}

@media (max-width: 1120px) {
  .header-actions__ghost { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    display: none;
    background: var(--ink-850);
    border-top: var(--hairline);
    border-bottom: var(--hairline);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 6px 0;
  }
  .site-nav[data-open] { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__link {
    padding: 15px var(--gutter);
    font-size: 15px;
    border-left: 2px solid transparent;
  }
  .site-nav__link:hover { background: rgba(29, 58, 46, .5); }
  .site-nav__link[aria-current="page"] {
    border-left-color: var(--orange-500);
    background: rgba(29, 58, 46, .5);
  }
  .site-nav__link[aria-current="page"]::after { display: none; }
}

@media (max-width: 700px) {
  .header-rail { display: none; }
  .header-bar__inner { height: 60px; gap: 12px; }
  .brand__mark { font-size: 17px; }
  .brand__mark::after { width: 14px; height: 2px; }
  .brand__line { font-size: 9px; }
  .header-actions .btn--primary { padding: 9px 12px; font-size: 12px; }
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 96px;
  background: var(--ink-850);
  border-top: var(--hairline);
  color: var(--stone-300);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 132px;
  height: 2px;
  background: var(--cyan-400);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(120px, 1fr));
  gap: 32px 24px;
  padding: 56px 0 40px;
  border-bottom: var(--hairline);
}

.footer-brand { display: grid; align-content: start; gap: 12px; }
.footer-brand__mark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--bone-100);
}
.footer-brand__stamp {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--moss-700);
  font-size: 11px;
  line-height: 1;
  color: var(--cyan-400);
}
.footer-brand__note {
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.8;
  color: var(--stone-500);
}
.footer-brand__year {
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--stone-500);
}

.footer-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan-400);
}
.footer-group__title::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--clay-600);
  flex: 0 0 auto;
}
.footer-group__list { display: grid; gap: 8px; }
.footer-group__link {
  display: inline-block;
  padding: 1px 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--stone-300);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.footer-group__link:hover { color: var(--bone-100); border-bottom-color: var(--cyan-400); }

.footer-meta {
  display: grid;
  gap: 6px;
  padding: 22px 0 44px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.9;
  letter-spacing: .02em;
  color: var(--stone-500);
}
.footer-meta__contact { color: var(--stone-300); }

@media (max-width: 960px) {
  .site-footer { margin-top: 64px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
    padding: 44px 0 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

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

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .col-2, .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9, .col-10, .col-12 { grid-column: 1 / -1; }
  .col-half { grid-column: span 2; }
}

.grid-surface {
  background-image:
    linear-gradient(to right, var(--grid-rgba) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-rgba) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- 导视 ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--stone-500);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--cyan-400);
  flex: 0 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--bone-100);
}
@media (max-width: 700px) { .section-title { font-size: 28px; } }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--stone-500);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--cyan-400); }
.crumbs__sep { color: var(--moss-700); }
.crumbs [aria-current="page"] { color: var(--stone-300); }

.toc { position: sticky; top: calc(var(--header-h) + 20px); }
.toc__title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--stone-500);
}
.toc__list { border-left: 1px solid var(--moss-700); }
.toc__link {
  display: block;
  margin-left: -1px;
  padding: 7px 0 7px 12px;
  border-left: 1px solid transparent;
  font-size: 13px;
  line-height: 1.6;
  color: var(--stone-500);
  text-decoration: none;
  transition: color .16s ease, border-color .16s ease;
}
.toc__link:hover { color: var(--bone-100); }
.toc__link[aria-current] { color: var(--cyan-400); border-left-color: var(--cyan-400); }
.toc__num {
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: inherit;
}

/* ---------- 堆叠面板 ---------- */
.panel-stack { display: block; }
.panel {
  position: relative;
  background: var(--ink-850);
  border: var(--hairline);
  border-radius: var(--radius);
}
.panel-stack > .panel + .panel { margin-top: -8px; }
.panel-stack > .panel:nth-child(even) { margin-left: 16px; }
@media (max-width: 700px) {
  .panel-stack > .panel:nth-child(even) { margin-left: 0; }
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: var(--hairline);
  background: rgba(29, 58, 46, .3);
}
.panel__num {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan-400);
}
.panel__title {
  flex: 1 1 auto;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel__meta {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-500);
}
.panel__toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--moss-700);
  border-radius: var(--radius);
  color: var(--stone-300);
}
.panel__toggle:hover { border-color: var(--cyan-400); color: var(--cyan-400); }
.panel__toggle-icon {
  position: relative;
  display: block;
  width: 11px; height: 11px;
}
.panel__toggle-icon::before,
.panel__toggle-icon::after {
  content: "";
  position: absolute;
  left: 0; top: 5px;
  width: 11px; height: 1px;
  background: currentColor;
  transition: transform .16s ease;
}
.panel__toggle-icon::after { transform: rotate(90deg); }
.panel__toggle[aria-expanded="false"] .panel__toggle-icon::after { transform: rotate(0deg); }
.panel__body { padding: 22px 20px 24px; }
.panel[data-collapsed] .panel__body { display: none; }

/* ---------- 横向主题带 ---------- */
.band {
  margin: 32px 0;
  padding: 14px 0;
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  background: rgba(10, 27, 21, .72);
}
.band--accent { border-left: 3px solid var(--cyan-400); }
.band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.band__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--stone-500);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--moss-700);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--stone-300);
  background: transparent;
  text-decoration: none;
}
.tag--cyan { border-color: var(--cyan-400); color: var(--cyan-400); }
.tag--clay { border-color: transparent; background: var(--clay-600); color: var(--bone-100); }
.tag--orange { border-color: transparent; background: var(--orange-500); color: var(--ink-900); }
.tag--flag { border-color: transparent; background: var(--flag-500); color: var(--ink-900); }

.cat-label {
  display: inline-block;
  padding: 4px 9px;
  background: var(--clay-600);
  color: var(--bone-100);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .1em;
}

/* ---------- 数据表达 ---------- */
.metric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--cyan-400);
}
.metric--orange { color: var(--orange-500); }
.metric__unit {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--stone-500);
}

.data-table { width: 100%; font-size: 13px; }
.data-table caption {
  caption-side: top;
  padding-bottom: 8px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--stone-500);
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(29, 58, 46, .9);
}
.data-table thead th {
  border-bottom-color: var(--moss-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--stone-500);
}
.data-table tbody tr:nth-child(even) { background: rgba(29, 58, 46, .35); }
.data-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--bone-100);
}

/* ---------- 正文与旁注 ---------- */
.prose {
  max-width: 42rem;
  font-size: 15px;
  line-height: 1.85;
  color: var(--stone-300);
}
.prose p + p { margin-top: 1.2em; }
.prose strong { color: var(--bone-100); font-weight: 500; }
.prose h2 {
  margin: 1.8em 0 .6em;
  font-size: 24px;
  color: var(--bone-100);
}
.prose a {
  color: var(--cyan-400);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 230, 200, .4);
}
.prose a:hover { border-bottom-color: var(--cyan-400); }

.aside-note {
  padding-left: 14px;
  border-left: 2px solid var(--moss-700);
  font-size: 13px;
  line-height: 1.8;
  color: var(--stone-300);
}
.aside-note--flag { border-left-color: var(--flag-500); }

/* ---------- 图片容器（供页面阶段放置占位） ---------- */
.frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--ink-850);
  border: var(--hairline);
  border-radius: var(--radius);
}
.frame > img,
.frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) contrast(1.02) brightness(.9);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 18, 14, .2), rgba(6, 18, 14, .62)),
    repeating-linear-gradient(0deg, rgba(126, 140, 133, .05) 0 1px, transparent 1px 4px);
}
.frame--16x9 { aspect-ratio: 16 / 9; }
.frame--4x3 { aspect-ratio: 4 / 3; }
.frame--1x1 { aspect-ratio: 1 / 1; }
.frame--tall { aspect-ratio: 3 / 4; }
.frame--wide { aspect-ratio: 21 / 9; }
.frame-fallback {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(126, 140, 133, .1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(126, 140, 133, .1) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- 显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s ease-out, transform .16s ease-out;
}
[data-reveal="in"] { opacity: 1; transform: none; }

/* ---------- 降低动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
