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

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

:root {
  --abyss: #06182B;
  --nightfall: #0E2C4A;
  --reef: #1B4B72;
  --cloud: #F5F8FB;
  --mist: #E3EBF2;
  --stone: #9FB3C4;
  --ink: #22303C;
  --neon: #12E0C4;
  --coral: #FF6A45;
  --coral-deep: #E1522F;
  --panel: #FFFFFF;
  --stone-soft: rgba(159, 179, 196, 0.82);
  --hair: rgba(6, 24, 43, 0.14);
  --hair-strong: rgba(6, 24, 43, 0.28);
  --hair-on-dark: rgba(159, 179, 196, 0.22);

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-ui: var(--font-display);
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-data: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --step-1: 12px;
  --step-2: 13px;
  --step-3: 15px;
  --step-4: 17px;
  --step-5: 21px;
  --step-6: 26px;
  --step-7: 34px;
  --step-8: 48px;
  --step-9: 76px;

  --shell: min(1180px, calc(100% - 40px));
  --radius-pill: 999px;
  --radius-card: 16px;
  --lift: 0 6px 18px rgba(6, 24, 43, 0.12);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-read="lg"] {
  --step-2: 14px;
  --step-3: 16px;
  --step-4: 19px;
}

html[data-contrast="high"] {
  --hair: rgba(6, 24, 43, 0.42);
  --hair-strong: #06182B;
  --stone: #54697C;
  --stone-soft: rgba(159, 179, 196, 0.95);
  --mist: #D5E3EE;
}

body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-4);
  line-height: 1.9;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--abyss);
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 0; }

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

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(18, 224, 196, 0.3);
}

.visually-hidden {
  position: absolute;
  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;
  left: 16px;
  top: -120px;
  z-index: 200;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--abyss);
  color: var(--cloud);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: top 0.18s var(--ease);
}

.skip-link:focus {
  top: 14px;
}

/* ---------- 页头 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(245, 248, 251, 0.96) 0%, rgba(245, 248, 251, 0.86) 70%, rgba(245, 248, 251, 0.4) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.header-shell {
  width: var(--shell);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-pod {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px 8px 20px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(6, 24, 43, 0.06);
  transition: padding 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.site-header[data-compact="true"] .nav-pod {
  padding: 5px 8px 5px 16px;
  box-shadow: 0 8px 22px rgba(6, 24, 43, 0.1);
}

.brand-plate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.brand-plate__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--abyss);
}

.brand-plate__sub {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  line-height: 1.2;
  color: var(--stone);
}

.pod-cluster {
  display: contents;
}

.primary-nav {
  margin: 0 auto;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.primary-nav__link {
  display: inline-block;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.primary-nav__link:hover {
  background: var(--mist);
}

.primary-nav__link[aria-current="page"] {
  background: var(--abyss);
  color: var(--cloud);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tool-chip {
  padding: 7px 13px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--reef);
  background: transparent;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}

.tool-chip:hover {
  border-color: var(--abyss);
  color: var(--abyss);
}

.tool-chip[aria-pressed="true"] {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--abyss);
}

.cta-pill {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: var(--coral);
  color: #FFFFFF;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}

.cta-pill:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 16px;
}

.nav-toggle__bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--abyss);
  transition: transform 0.18s var(--ease);
}

.nav-pod[data-open] .nav-toggle__bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-pod[data-open] .nav-toggle__bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.chapter-rail {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 22px 2px;
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.site-header[data-compact="true"] .chapter-rail {
  display: flex;
}

.chapter-rail__section {
  color: var(--reef);
  letter-spacing: 0.12em;
}

.chapter-rail__sep {
  color: var(--stone);
}

.chapter-rail__jump {
  border-bottom: 1px dotted var(--stone);
  color: var(--ink);
  letter-spacing: 0.08em;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.chapter-rail__jump:hover {
  color: var(--coral-deep);
  border-color: var(--coral);
}

.chapter-rail__jump[data-static="true"] {
  border-bottom-color: transparent;
  color: var(--stone);
  cursor: default;
}

/* ---------- 版心与分区 ---------- */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.shell--narrow {
  width: min(760px, calc(100% - 40px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(56px, 8vw, 104px) 0;
}

.section--mist {
  background: var(--mist);
}

.section--dark {
  background: var(--abyss);
  color: #D8E3EC;
  overflow: hidden;
}

.section--dark::before {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -30%;
  width: 58%;
  height: 90%;
  background: radial-gradient(closest-side, rgba(18, 224, 196, 0.14), rgba(18, 224, 196, 0));
  pointer-events: none;
}

.section--dark .chapter-title,
.section--dark .display {
  color: var(--cloud);
}

.section--dark .body-text {
  color: #C9D8E4;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
  margin-bottom: clamp(24px, 3.5vw, 44px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.4vw, 32px);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 32px);
}

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

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

/* ---------- 排版 ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--abyss);
}

.chapter-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--abyss);
}

.lede {
  font-family: var(--font-body);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.8;
  color: var(--reef);
}

.body-text {
  font-family: var(--font-body);
  font-size: var(--step-4);
  line-height: 1.9;
  color: var(--ink);
}

.caption {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  color: var(--stone);
}

/* ---------- 展陈件 ---------- */

.exhibit-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--reef);
}

.exhibit-label::before {
  content: "";
  display: block;
  width: 22px;
  height: 1px;
  background: currentColor;
}

.exhibit-label--vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.34em;
}

.exhibit-label--vertical::before {
  width: 1px;
  height: 22px;
}

.section--dark .exhibit-label {
  color: var(--neon);
}

.rot-note {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--stone);
}

/* ---------- 信息牌 ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px 18px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(6, 24, 43, 0.04);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--lift);
}

.card__index {
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--coral-deep);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 1.35;
  color: var(--abyss);
}

.card__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--stone);
}

.section--dark .card {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hair-on-dark);
  box-shadow: none;
}

.section--dark .card__title {
  color: var(--cloud);
}

.section--dark .card__foot {
  border-top-color: var(--hair-on-dark);
  color: var(--stone-soft);
}

/* ---------- 数据浮层 ---------- */

.data-layer {
  display: inline-grid;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--neon);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-data);
  color: var(--cloud);
}

.data-layer__value {
  font-family: var(--font-data);
  font-size: var(--step-6);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--neon);
}

.data-layer__label {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--stone);
}

/* ---------- 步骤条 ---------- */

.step-list {
  counter-reset: step;
  display: grid;
  gap: 0;
}

.step-list > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
}

.step-list > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--abyss);
  background: var(--neon);
  border-radius: 6px;
  padding: 2px 8px;
  margin-top: 4px;
}

.section--dark .step-list > li {
  border-bottom-color: var(--hair-on-dark);
}

/* ---------- 图片容器 ---------- */

.figure-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--hair);
  background: linear-gradient(150deg, var(--mist) 0%, var(--cloud) 44%, #EAF1F6 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

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

.figure-frame--tall { aspect-ratio: 4 / 5; }
.figure-frame--wide { aspect-ratio: 21 / 9; }

.figure-frame__tag {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--reef);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn--coral {
  background: var(--coral);
  color: #FFFFFF;
}

.btn--coral:hover {
  background: var(--coral-deep);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--hair-strong);
  color: var(--abyss);
}

.btn--ghost:hover {
  background: var(--mist);
}

.section--dark .btn--ghost {
  border-color: var(--hair-on-dark);
  color: var(--cloud);
}

/* ---------- 页脚 ---------- */

.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 120px);
  padding: clamp(120px, 14vw, 190px) 0 32px;
  background: var(--abyss);
  color: var(--mist);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(56px, 9vw, 120px);
  background: var(--cloud);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
}

.site-footer::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, rgba(18, 224, 196, 0), rgba(18, 224, 196, 0.55));
  pointer-events: none;
}

.footer-shell {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 5vw, 64px);
}

.footer-brand__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--cloud);
  margin: 0;
}

.footer-brand__sub {
  margin: 10px 0 0;
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--neon);
}

.footer-brand__line {
  margin: 22px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--stone);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-col__title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair-on-dark);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cloud);
}

.footer-col a {
  display: inline-block;
  padding: 5px 0;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--mist);
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}

.footer-col a:hover {
  color: var(--neon);
  transform: translateX(3px);
}

.footer-meta {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin: clamp(32px, 4.5vw, 52px) auto 0;
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--hair-on-dark);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 32px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--stone);
}

.footer-contact {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}

.footer-contact__item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.footer-contact__key {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--neon);
}

.footer-meta__note {
  margin: 0;
  max-width: 56ch;
  color: var(--stone-soft);
}

.footer-legal {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-content: start;
}

.footer-icp {
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.footer-signature {
  font-family: var(--font-ui);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--stone-soft);
}

.footer-year {
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1120px) {
  .tool-chip--optional {
    display: none;
  }
}

@media (max-width: 940px) {
  .site-header {
    padding-top: 10px;
  }

  .nav-pod {
    padding: 8px 10px 8px 16px;
  }

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

  .pod-cluster {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 5;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--hair);
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(6, 24, 43, 0.16);
  }

  .nav-pod[data-open] .pod-cluster {
    display: flex;
  }

  .primary-nav {
    margin: 0;
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .primary-nav__link {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
  }

  .header-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--hair);
  }

  .tool-chip--optional {
    display: inline-block;
  }

  .site-header[data-compact="true"] .chapter-rail {
    display: none;
  }

  .footer-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .grid--halves,
  .grid--thirds {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
  }
}

@media (max-width: 560px) {
  :root {
    --shell: min(1180px, calc(100% - 28px));
  }

  .brand-plate__sub {
    letter-spacing: 0.14em;
  }

  .footer-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-contact {
    flex-direction: column;
    gap: 8px;
  }

  .chapter-rail {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .card:focus-within,
  .btn--coral:hover,
  .cta-pill:hover,
  .footer-col a:hover {
    transform: none;
  }
}
