/* ============================================================
   /assets/site.css — 共享外壳样式
   深海蓝底域 · 纸张叠层面板 · 刊头导航
   ============================================================ */

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

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

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

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

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
}

a {
  color: inherit;
}

address {
  font-style: normal;
}

/* ---------- 2. 变量 ---------- */
:root {
  --deep: #061A2B;
  --harbor: #0C2A42;
  --steel: #1F4661;
  --paper: #FBFCFD;
  --mist: #E7EEF4;
  --cyan: #34E5D2;
  --teal: #0E9E92;
  --orange: #FF7A3C;
  --orange-lift: #FF8F60;
  --jade: #21B98A;
  --slate: #8CA6BC;
  --ink: #0E1D29;
  --ink-soft: #33475A;
  --on-deep: #B9CBD9;

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

  --edge: clamp(20px, 5vw, 64px);
  --pad: clamp(20px, 3vw, 44px);
  --wrap: 1280px;
  --radius: 2px;
  --stack-shadow: 8px 8px 0 rgba(31, 70, 97, 0.45);
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--deep);
  background-image:
    radial-gradient(1200px 520px at 78% -8%, rgba(52, 229, 210, 0.09), transparent 62%),
    radial-gradient(900px 480px at 6% 12%, rgba(31, 70, 97, 0.55), transparent 68%);
  background-repeat: no-repeat;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.25; }

strong, b { font-weight: 700; }

::selection {
  background: rgba(52, 229, 210, 0.28);
  color: var(--paper);
}

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

.panel :focus-visible,
.panel--mist :focus-visible {
  outline-color: var(--teal);
}

/* ---------- 4. 工具类 ---------- */
.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;
  left: 50%;
  top: -140px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 10px 20px;
  background: var(--cyan);
  color: var(--deep);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.18s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline-offset: -4px;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--edge);
}

.wrap--narrow {
  max-width: 960px;
}

.prose {
  max-width: min(38em, 100%);
  font-size: 17px;
  line-height: 1.85;
}

.stack > * + * {
  margin-top: clamp(24px, 3.5vw, 48px);
}

.page {
  padding-top: clamp(24px, 4vw, 56px);
}

main {
  display: block;
}

#main-content {
  scroll-margin-top: 140px;
}

/* ---------- 5. 刊头 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, #0A2438 0%, #061A2B 100%);
  border-bottom: 1px solid var(--steel);
  box-shadow: 0 10px 24px rgba(3, 12, 20, 0.45);
}

.masthead__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  max-width: 1440px;
  margin-inline: auto;
  padding: clamp(12px, 1.6vw, 18px) var(--edge) 10px;
}

.masthead__rail {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.masthead__rail--start {
  justify-content: flex-start;
}

.masthead__rail--end {
  justify-content: flex-end;
}

.masthead__brand {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 2px 6px;
}

.masthead__mark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.6vw, 1.65rem);
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--paper);
  transition: color 0.2s ease;
}

.masthead__line {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--cyan);
}

.masthead__brand::after {
  content: "";
  display: block;
  height: 1px;
  width: 0;
  margin: 7px auto 0;
  background: var(--cyan);
  transition: width 0.24s ease;
}

.masthead__brand:hover .masthead__mark {
  color: var(--cyan);
}

.masthead__brand:hover::after,
.masthead__brand:focus-visible::after {
  width: 56%;
}

.masthead__cta {
  white-space: nowrap;
}

.baseline-badge {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid rgba(52, 229, 210, 0.35);
  border-radius: var(--radius);
  background: rgba(52, 229, 210, 0.07);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------- 6. 主导航 ---------- */
.site-nav {
  border-top: 1px solid rgba(31, 70, 97, 0.9);
  background: rgba(6, 26, 43, 0.62);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.2vw, 30px);
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--edge);
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 13px 2px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--on-deep);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

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

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after {
  transform: scaleX(1);
}

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

.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  background: transparent;
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

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

.nav-toggle[aria-expanded="true"] {
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 14px;
  height: 10px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
}

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

/* ---------- 7. 阅读进度 ---------- */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(52, 229, 210, 0.1);
  pointer-events: none;
}

.progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ---------- 8. 页脚 ---------- */
.site-foot {
  margin-top: clamp(56px, 9vw, 120px);
  border-top: 1px solid var(--steel);
  background: linear-gradient(180deg, #0A2334 0%, #061A2B 100%);
  color: var(--on-deep);
  font-size: 14.5px;
}

.site-foot__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(36px, 6vw, 72px) var(--edge) clamp(20px, 3vw, 32px);
}

.site-foot__mast {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  padding-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 1px solid rgba(31, 70, 97, 0.9);
}

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

.site-foot__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--paper);
}

.site-foot__tag {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.site-foot__baseline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--slate);
  white-space: nowrap;
}

.site-foot__baseline .mono {
  color: var(--paper);
}

.site-foot__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.15fr);
  gap: clamp(24px, 3.4vw, 44px);
  padding: clamp(28px, 4vw, 44px) 0;
}

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

.site-foot__col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--slate);
}

.site-foot__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
}

.site-foot__list a {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--on-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.site-foot__list a:hover {
  color: var(--cyan);
  border-bottom-color: rgba(52, 229, 210, 0.45);
}

.site-foot__list a:focus-visible {
  color: var(--cyan);
}

.site-foot__contact {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--on-deep);
  overflow-wrap: anywhere;
}

.site-foot__key {
  display: inline-block;
  min-width: 2.9em;
  margin-right: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.site-foot__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: clamp(18px, 2.4vw, 26px);
  border-top: 1px solid rgba(31, 70, 97, 0.9);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.site-foot__legal-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-foot__legal-item::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: rgba(52, 229, 210, 0.55);
  border-radius: 50%;
}

/* ---------- 9. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn--action {
  background: var(--orange);
  border-color: var(--orange);
  color: #180A02;
}

.btn--action:hover {
  background: var(--orange-lift);
  border-color: var(--orange-lift);
}

.btn--action:active {
  transform: translateY(1px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--steel);
  color: var(--paper);
}

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

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

.btn--paper:hover {
  background: var(--mist);
  border-color: var(--mist);
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13.5px;
}

.btn--lg {
  padding: 14px 26px;
  font-size: 16px;
}

.panel .btn--ghost {
  border-color: #B9C7D2;
  color: var(--ink);
}

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

/* ---------- 10. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.65;
  white-space: nowrap;
}

.tag--entry {
  background: var(--orange);
  color: #180A02;
}

.tag--triage {
  background: var(--jade);
  color: #04170F;
}

.tag--resource {
  background: var(--slate);
  color: #0A1A26;
}

.tag--outline {
  background: transparent;
  border: 1px solid rgba(52, 229, 210, 0.5);
  color: var(--cyan);
}

.panel .tag--outline {
  border-color: rgba(14, 158, 146, 0.45);
  color: var(--teal);
}

/* ---------- 11. 纸张叠层面板 ---------- */
.panel {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--stack-shadow);
}

.panel--deep {
  background: var(--harbor);
  color: #DCE8F2;
  border-color: var(--steel);
  box-shadow: 8px 8px 0 rgba(3, 12, 20, 0.55);
}

.panel--mist {
  background: var(--mist);
  color: var(--ink);
}

.panel--tight {
  padding: clamp(16px, 2vw, 26px);
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel--deep :focus-visible {
  outline-color: var(--cyan);
}

/* ---------- 12. 章节头 ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}

.section-no {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.panel .section-no {
  color: var(--teal);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.section-sub {
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate);
}

.panel .section-sub {
  color: #5B7387;
}

/* ---------- 13. 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(16px, 2.4vw, 26px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--slate);
}

.crumbs a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.crumbs a:hover {
  border-bottom-color: currentColor;
}

.crumbs__sep {
  color: var(--steel);
}

.crumbs [aria-current="page"] {
  color: #DCE8F2;
}

.panel .crumbs {
  color: #5B7387;
}

.panel .crumbs a {
  color: var(--teal);
}

.panel .crumbs__sep {
  color: #9FB2C1;
}

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

/* ---------- 14. 栅格 ---------- */
.grid {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
}

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

/* ---------- 15. 图片容器基础规则 ---------- */
.figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #0C2A42 0%, #123A56 55%, #0C2A42 100%);
}

.figure > img,
.figure > picture,
.figure > picture > img,
.figure > svg,
.figure > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(52, 229, 210, 0.14) 50%, transparent 58%);
}

.figure--16x9 { aspect-ratio: 16 / 9; }
.figure--4x3  { aspect-ratio: 4 / 3; }
.figure--1x1  { aspect-ratio: 1 / 1; }
.figure--21x9 { aspect-ratio: 21 / 9; }

.figure-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  line-height: 1.7;
  color: var(--slate);
}

.panel .figure-caption {
  color: #5B7387;
}

/* ---------- 16. 锚点目录（页面阶段使用） ---------- */
[data-spy] a {
  position: relative;
  display: block;
  padding-left: 14px;
  text-decoration: none;
  transition: color 0.18s ease;
}

[data-spy] a[aria-current="true"] {
  color: var(--cyan);
}

[data-spy] a[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--cyan);
}

.panel [data-spy] a[aria-current="true"] {
  color: var(--teal);
}

.panel [data-spy] a[aria-current="true"]::before {
  background: var(--teal);
}

/* ---------- 17. 显现动效 ---------- */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

[data-reveal].is-in {
  animation: riseIn 0.26s ease both;
}

/* ---------- 18. 平板 ---------- */
@media (max-width: 1080px) {
  .site-foot__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .masthead__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions";
    padding: 11px var(--edge);
  }

  .masthead__rail--start {
    display: none;
  }

  .masthead__brand {
    grid-area: brand;
    text-align: left;
    padding-left: 0;
  }

  .masthead__brand::after {
    margin-left: 0;
  }

  .masthead__rail--end {
    grid-area: actions;
    gap: 8px;
  }

  .baseline-badge {
    display: none;
  }

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

  .site-nav {
    display: none;
    border-top: 1px solid var(--steel);
  }

  .site-nav[data-open="true"] {
    display: block;
  }

  .site-nav__list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    padding: 6px var(--edge) 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .site-nav__link {
    white-space: nowrap;
    padding: 10px 12px;
  }

  .site-nav__link::after {
    left: 12px;
    right: 12px;
    bottom: 4px;
  }

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

/* ---------- 19. 手机 ---------- */
@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .site-foot__grid {
    grid-template-columns: 1fr;
  }

  .site-foot__legal {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-foot__mast {
    align-items: flex-start;
  }

  .section-head {
    gap: 8px 12px;
  }
}

@media (max-width: 480px) {
  .masthead__cta {
    padding: 7px 10px;
    font-size: 12.5px;
    letter-spacing: 0;
  }

  .masthead__line {
    font-size: 9.5px;
    letter-spacing: 0.14em;
  }

  .nav-toggle {
    padding: 9px;
  }

  .nav-toggle__label {
    display: none;
  }
}

/* ---------- 20. 减少动效 ---------- */
@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;
  }

  [data-reveal].is-in {
    animation: none;
  }

  .progress__bar {
    transition: none;
  }
}
