/* ============================================================
   jbo-resource.com.cn — 共享样式表 /assets/site.css
   档案感技术手册：堆叠面板 · 左右分置导航 · 双色体系
   ============================================================ */

:root {
  --ink-900: #071A32;
  --ink-800: #0E2A4E;
  --ink-700: #1D4B7E;
  --cyan-500: #35E3CE;
  --cyan-100: #A8F5EA;
  --cyan-deep: #0E7C71;
  --amber-500: #FF9A2E;
  --amber-deep: #8A4A00;
  --mist-200: #E7EDF5;
  --paper-000: #F7F9FC;
  --graphite: #17212B;
  --grey-500: #5A6B7C;
  --hair: #C3D0DE;
  --hair-dark: rgba(195, 208, 222, .18);

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

  --shell-max: 1240px;
  --shell-pad: clamp(18px, 4vw, 32px);

  --shadow-1: 0 1px 2px rgba(7, 26, 50, .08);
  --shadow-2: 0 18px 40px -26px rgba(7, 26, 50, .55);

  --masthead-h: 84px;
  --masthead-h-tight: 56px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 320ms;
}

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

html { -webkit-text-size-adjust: 100%; }

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

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

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

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

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

:focus-visible {
  outline: 2px solid var(--cyan-500);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 基础与中文排版 ---------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--graphite);
  background-color: var(--mist-200);
  background-image:
    linear-gradient(180deg, rgba(14, 42, 78, .07) 0, rgba(231, 237, 245, 0) 520px),
    repeating-linear-gradient(0deg, rgba(7, 26, 50, .022) 0 1px, transparent 1px 72px);
  background-repeat: no-repeat, repeat;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.22;
  color: var(--ink-900);
}

h1 { font-size: clamp(32px, 4.4vw, 44px); }
h2 { font-size: clamp(24px, 2.6vw, 28px); }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }

p { line-height: 1.75; }

strong { font-weight: 700; color: var(--ink-900); }

::selection { background: var(--cyan-100); color: var(--ink-900); }

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

.measure { max-width: 38em; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  background: var(--cyan-500);
  border-radius: 0 0 4px 4px;
  transition: top 180ms var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- 等宽编号 / 版本号 ---------- */
.folio {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.5;
  color: var(--grey-500);
}
.folio--accent { color: var(--cyan-deep); }
.folio--onDark { color: rgba(247, 249, 252, .42); }

/* ---------- 头部 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink-900);
  color: var(--paper-000);
  border-bottom: 1px solid rgba(53, 227, 206, .26);
  box-shadow: 0 10px 30px -24px rgba(7, 26, 50, .9);
}

.masthead__rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(53, 227, 206, .14);
  pointer-events: none;
  overflow: hidden;
}
.masthead__rail > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan-500), #8CF5E9);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--masthead-h);
  padding-block: 10px;
  transition: min-height 240ms var(--ease), padding 240ms var(--ease);
}
.masthead.is-tight .masthead__inner {
  min-height: var(--masthead-h-tight);
  padding-block: 6px;
}

.masthead__brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand-mark__glyph {
  display: inline-block;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.2;
  color: var(--ink-900);
  background: var(--cyan-500);
  border-radius: 2px;
}
.brand-mark__text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper-000);
}

.brand-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  line-height: 1.4;
  color: rgba(247, 249, 252, .48);
  transition: opacity 200ms var(--ease);
}
.masthead.is-tight .brand-tagline { opacity: 0; }

.masthead__nav { display: flex; align-items: center; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-block;
  padding: 9px 12px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(247, 249, 252, .76);
  border-bottom: 2px solid transparent;
  border-radius: 2px;
  transition: color 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease);
}
.nav-link:hover {
  color: var(--cyan-500);
  background: rgba(53, 227, 206, .09);
}
.nav-link[aria-current="page"] {
  color: var(--paper-000);
  border-bottom-color: var(--cyan-500);
  background: rgba(53, 227, 206, .11);
}

.nav-item--cta { margin-left: 12px; }
.nav-link--cta {
  padding: 9px 18px;
  font-weight: 700;
  color: var(--ink-900);
  background: var(--amber-500);
  border-bottom-color: transparent;
  border-radius: 3px;
}
.nav-link--cta:hover {
  color: var(--ink-900);
  background: #FFAB52;
}
.nav-link--cta[aria-current="page"] {
  color: var(--ink-900);
  background: #FFAB52;
  border-bottom-color: transparent;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--paper-000);
  border: 1px solid rgba(53, 227, 206, .42);
  border-radius: 3px;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan-500); background: rgba(53, 227, 206, .1); }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--cyan-500);
  transition: transform 200ms var(--ease), top 200ms var(--ease);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 8px; }
[data-nav-toggle][aria-expanded="true"] .nav-toggle__bars::before { top: 4px; transform: rotate(45deg); }
[data-nav-toggle][aria-expanded="true"] .nav-toggle__bars::after { top: 4px; transform: rotate(-45deg); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: filter 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.btn--amber { background: var(--amber-500); color: var(--ink-900); }
.btn--amber:hover { filter: brightness(1.06); }
.btn--cyan { background: var(--cyan-500); color: var(--ink-900); }
.btn--cyan:hover { filter: brightness(1.06); }
.btn--ghost {
  background: var(--paper-000);
  color: var(--ink-800);
  border-color: var(--hair);
}
.btn--ghost:hover { border-color: var(--ink-700); color: var(--ink-900); }
.btn--onDark {
  background: transparent;
  color: var(--cyan-500);
  border-color: rgba(53, 227, 206, .48);
}
.btn--onDark:hover { background: rgba(53, 227, 206, .12); border-color: var(--cyan-500); }
.btn--sm { padding: 9px 16px; font-size: 14px; }

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  padding: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--grey-500);
}
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--hair);
}
.crumbs a { color: var(--grey-500); transition: color 160ms var(--ease); }
.crumbs a:hover { color: var(--ink-700); }
.crumbs [aria-current="page"] { color: var(--ink-800); font-weight: 500; }

/* ---------- 堆叠面板 / 章节 ---------- */
.section {
  padding-block: clamp(44px, 6vw, 84px);
  border-top: 1px solid var(--hair);
}
.section:first-of-type { border-top: 0; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding-bottom: 18px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--hair);
}
.section__head h2 { flex: 0 0 auto; }
.section__head p { flex: 1 1 260px; min-width: 0; color: var(--grey-500); font-size: 15px; }

.slab {
  display: block;
  padding: clamp(20px, 2.8vw, 34px);
  background: var(--paper-000);
  border: 1px solid var(--hair);
  border-radius: 4px;
  box-shadow: var(--shadow-1);
}
.slab--dark {
  background: var(--ink-800);
  border-color: rgba(53, 227, 206, .24);
  color: rgba(247, 249, 252, .84);
  box-shadow: var(--shadow-2);
}
.slab--dark h2,
.slab--dark h3,
.slab--dark h4 { color: var(--paper-000); }
.slab--dark strong { color: var(--cyan-500); }
.slab--mist { background: var(--mist-200); box-shadow: none; }

/* ---------- 正文 ---------- */
.prose {
  max-width: 38em;
  font-size: 16px;
  line-height: 1.75;
  color: var(--graphite);
}
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 42px; margin-bottom: 12px; }
.prose h3 { margin-top: 30px; margin-bottom: 10px; }
.prose h4 { margin-top: 24px; margin-bottom: 8px; }
.prose ul,
.prose ol {
  margin-top: 14px;
  padding-left: 22px;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 6px; }
.prose blockquote {
  padding: 12px 0 12px 18px;
  border-left: 3px solid var(--cyan-500);
  color: var(--grey-500);
}

/* ---------- 栅格 ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.4vw, 26px);
}
.grid--7-5 { grid-template-columns: 7fr 5fr; }
.grid--8-4 { grid-template-columns: 8fr 4fr; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 图片容器基础规则（页面阶段放置图片） ---------- */
.frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hair);
  border-radius: 4px;
  background-color: var(--mist-200);
  background-image:
    linear-gradient(rgba(29, 75, 126, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 75, 126, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: var(--shadow-1);
}
.frame > img,
.frame > svg,
.frame > picture,
.frame > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame--wide { aspect-ratio: 21 / 9; }
.frame--tall { aspect-ratio: 4 / 5; }
.frame--square { aspect-ratio: 1 / 1; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--cyan-100);
  border: 1px solid rgba(14, 42, 78, .08);
  border-radius: 2px;
}
.tag--amber {
  color: var(--amber-deep);
  background: rgba(255, 154, 46, .16);
  border-color: rgba(255, 154, 46, .34);
}
.tag--neutral {
  color: var(--grey-500);
  background: var(--mist-200);
  border-color: var(--hair);
}

/* ---------- 可展开索引组 ---------- */
.fold {
  background: var(--paper-000);
  border: 1px solid var(--hair);
  border-radius: 4px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.fold + .fold { margin-top: 10px; }

.fold__head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  color: var(--ink-900);
  transition: background-color 180ms var(--ease);
}
.fold__head:hover { background: var(--mist-200); }
.fold__head:focus-visible { outline-offset: -3px; }

.fold__index {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--cyan-deep);
}
.fold__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.45;
}
.fold__arrow {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 1.5px solid var(--grey-500);
  border-bottom: 1.5px solid var(--grey-500);
  transform: rotate(45deg);
  transition: transform 240ms var(--ease);
}
.fold__head[aria-expanded="true"] .fold__arrow { transform: rotate(-135deg); }

.fold__panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 240ms var(--ease), visibility 0s linear 240ms;
}
.fold__head[aria-expanded="true"] + .fold__panel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 240ms var(--ease), visibility 0s linear 0s;
}
.fold__inner { min-height: 0; overflow: hidden; }
.fold__body {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--hair);
  font-size: 15px;
  line-height: 1.75;
  color: var(--graphite);
}
.fold__body > * + * { margin-top: 12px; }

/* ---------- 进入视口渐显 ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}
html.js [data-reveal].is-inview {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

/* ---------- 页脚 ---------- */
.colophon {
  margin-top: clamp(56px, 8vw, 110px);
  background: var(--ink-900);
  color: var(--paper-000);
  border-top: 1px solid rgba(53, 227, 206, .28);
}

.colophon__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.4fr;
  gap: clamp(28px, 4vw, 56px);
  padding-block: clamp(44px, 6vw, 68px);
}

.colophon__block { min-width: 0; }

.colophon__wordmark {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper-000);
}
.colophon__lede {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  line-height: 1.7;
  color: rgba(247, 249, 252, .5);
}
.colophon__block--brand .folio { margin-top: 16px; }

.colophon__title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  color: rgba(247, 249, 252, .46);
}

.colophon__links {
  display: grid;
  gap: 9px;
  font-size: 14.5px;
}
.colophon__links a {
  color: rgba(247, 249, 252, .78);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}
.colophon__links a:hover {
  color: var(--cyan-500);
  border-bottom-color: rgba(53, 227, 206, .5);
}

.colophon__meta { display: grid; gap: 13px; }
.colophon__meta > div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: start;
}
.colophon__meta dt {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  line-height: 1.5;
  color: rgba(247, 249, 252, .44);
}
.colophon__meta dd {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(247, 249, 252, .82);
  word-break: break-word;
}

.colophon__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
  padding-block: 20px 28px;
  border-top: 1px solid var(--hair-dark);
  font-size: 13px;
  color: rgba(247, 249, 252, .55);
}
.colophon__legal { line-height: 1.6; }

.colophon__base-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.colophon__base-links a {
  color: rgba(247, 249, 252, .6);
  transition: color 180ms var(--ease);
}
.colophon__base-links a:hover { color: var(--cyan-500); }

.colophon__version { white-space: nowrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .colophon__grid { grid-template-columns: 1.3fr 1fr; }
  .colophon__block:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .masthead { position: sticky; }
  .masthead__brand { flex-direction: row; align-items: center; gap: 12px; }
  .brand-tagline { display: none; }
  .nav-toggle { display: inline-flex; }

  .masthead__nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: block;
    padding: 8px 0 18px;
    background: var(--ink-800);
    border-top: 1px solid rgba(53, 227, 206, .22);
    border-bottom: 1px solid rgba(53, 227, 206, .22);
    box-shadow: var(--shadow-2);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 260ms var(--ease), opacity 180ms var(--ease), visibility 0s linear 260ms;
  }
  .masthead__nav[data-open] {
    max-height: 76vh;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
    transition: max-height 260ms var(--ease), opacity 180ms var(--ease), visibility 0s linear 0s;
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link {
    display: block;
    padding: 13px var(--shell-pad);
    font-size: 16px;
    border-bottom: 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    color: rgba(247, 249, 252, .82);
  }
  .nav-link[aria-current="page"] {
    border-left-color: var(--cyan-500);
    border-bottom-color: transparent;
    background: rgba(53, 227, 206, .1);
  }
  .nav-item--cta { margin: 14px var(--shell-pad) 0; }
  .nav-link--cta {
    padding: 13px 18px;
    text-align: center;
    border-left-color: transparent;
    border-radius: 3px;
  }
  .nav-link--cta[aria-current="page"] { border-left-color: transparent; }

  .grid--7-5,
  .grid--8-4,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }

  .colophon__grid { grid-template-columns: 1fr; gap: 32px; }
  .colophon__block:last-child { grid-column: auto; }
  .colophon__base { justify-content: flex-start; }
}

@media (max-width: 560px) {
  :root { --masthead-h: 68px; }
  .brand-mark__text { font-size: 17px; }
  .section__head { margin-bottom: 22px; }
  .slab { border-radius: 3px; }
  .colophon__meta > div { grid-template-columns: 1fr; gap: 2px; }
  .colophon__meta dt { padding-top: 0; }
  .colophon__base { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- 无障碍：减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .fold__panel { visibility: visible; }
}
