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

:root {
  --sand: #E8DDCB;
  --paper: #F7F0E4;
  --ink: #2E2723;
  --ochre: #A24E2A;
  --signal: #0E7C7B;
  --deep: #173B3F;
  --mute: #8C9BA5;
  --mist: #FBF7EF;
  --violet: #6A4C93;
  --line: #C9BBA6;
  --line-soft: rgba(46, 39, 35, 0.13);
  --ink-soft: rgba(46, 39, 35, 0.68);
  --mist-soft: rgba(251, 247, 239, 0.68);
  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  --maxw: 1280px;
  --pad: clamp(20px, 5vw, 72px);
  --radius: 3px;
  --shadow-soft: 0 1px 0 rgba(46, 39, 35, 0.04), 0 12px 30px -24px rgba(23, 59, 63, 0.65);
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--sand);
  background-image: linear-gradient(to right, rgba(201, 187, 166, 0.42) 1px, transparent 1px);
  background-size: 96px 100%;
  background-position: 0 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-nav-open { overflow: hidden; }

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

a { color: inherit; }

button { font: inherit; }

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

:target { scroll-margin-top: 104px; }

/* ---------- 中文排版 ---------- */

h1, h2, h3, h4, .h1, .h2, .h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1, .h1 {
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

h2, .h2 {
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  letter-spacing: -0.035em;
  line-height: 1.14;
}

h3, .h3 {
  font-weight: 700;
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

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

ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

strong { font-weight: 700; }

.lead {
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: 62ch;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0.04em;
}

.data-num {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

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

/* ---------- 骨架与网格 ---------- */

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

.section { padding: clamp(44px, 6.5vw, 96px) 0; }
.section--tight { padding: clamp(28px, 4vw, 56px) 0; }

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

.span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { min-width: 0; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ochre);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--ochre);
  flex: none;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn--solid { background: var(--signal); color: var(--mist); border-color: var(--signal); }
.btn--solid:hover { background: var(--deep); border-color: var(--deep); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); }

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

/* ---------- 面包屑 ---------- */

.breadcrumb { margin: clamp(18px, 3vw, 30px) 0 0; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(46, 39, 35, 0.55);
}

.breadcrumb__item { display: flex; align-items: center; gap: 8px; }
.breadcrumb__item + .breadcrumb__item::before { content: "/"; color: var(--line); }

.breadcrumb__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.breadcrumb__link:hover { color: var(--signal); border-bottom-color: var(--signal); }
.breadcrumb__item [aria-current="page"] { color: var(--ochre); }

/* ---------- 图片容器基础规则 ---------- */

.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  background-color: var(--paper);
  background-image:
    linear-gradient(135deg, rgba(14, 124, 123, 0.10), rgba(162, 78, 42, 0.09) 55%, rgba(106, 76, 147, 0.08));
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(to right, rgba(46, 39, 35, 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(46, 39, 35, 0.10) 1px, transparent 1px);
  background-size: 40px 40px;
}

.media-frame--wide { aspect-ratio: 16 / 8; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 4 / 5; }

.media-frame__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(46, 39, 35, 0.6);
}

.media-caption__idx { color: var(--ochre); font-weight: 600; }

/* ---------- 标签 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(46, 39, 35, 0.7);
  white-space: nowrap;
}

.tag--signal { border-color: rgba(14, 124, 123, 0.42); color: var(--signal); }
.tag--ochre { border-color: rgba(162, 78, 42, 0.42); color: var(--ochre); }
.tag--violet { border-color: rgba(106, 76, 147, 0.42); color: var(--violet); }

/* ---------- 目录高亮 ---------- */

.toc-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.toc-link:hover { color: var(--signal); }
.toc-link.is-active { color: var(--signal); font-weight: 600; }

/* ---------- 显现 ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ============================================================
   头部：悬浮胶囊导航
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  isolation: isolate;
  padding: 14px var(--pad) 10px;
  transition: padding 0.25s var(--ease);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(232, 221, 203, 0.97) 0%, rgba(232, 221, 203, 0.9) 62%, rgba(232, 221, 203, 0) 100%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.site-header.is-condensed { padding-top: 6px; padding-bottom: 6px; }

.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
}

.skip-link {
  position: absolute;
  left: var(--pad);
  top: 10px;
  z-index: 200;
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--deep);
  color: var(--mist);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* 品牌浮岛 */

.brand-island {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 18px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.brand-island:hover { border-color: rgba(14, 124, 123, 0.5); }

.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--deep);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-line {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
}

/* 栏目浮岛 */

.nav-island {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.nav-main { display: flex; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item { display: flex; }

.nav-link {
  display: block;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-link:hover { background: rgba(14, 124, 123, 0.09); color: var(--signal); }

.nav-link[aria-current="page"] {
  background: rgba(14, 124, 123, 0.13);
  border-color: rgba(14, 124, 123, 0.3);
  color: var(--deep);
  font-weight: 700;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--deep);
  border-radius: 999px;
  background: var(--deep);
  color: var(--mist);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-cta::after {
  content: "\2192";
  font-family: var(--font-mono);
  font-size: 12px;
  transition: transform 0.18s var(--ease);
}

.nav-cta:hover { background: var(--signal); border-color: var(--signal); }
.nav-cta:hover::after { transform: translateX(3px); }

/* 移动按钮与遮罩 */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s var(--ease);
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.site-header[data-open] .nav-toggle__bars { background: transparent; }
.site-header[data-open] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.site-header[data-open] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(23, 59, 63, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.site-header[data-open] .nav-scrim { opacity: 1; pointer-events: auto; }

/* ============================================================
   页脚
   ============================================================ */

.site-footer {
  margin-top: clamp(40px, 6vw, 80px);
  padding: clamp(44px, 7vw, 88px) var(--pad) 0;
  background: var(--deep);
  color: var(--mist);
  border-top: 1px solid rgba(251, 247, 239, 0.14);
}

.footer-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.95fr);
  gap: clamp(28px, 4vw, 64px);
  padding-bottom: clamp(32px, 5vw, 60px);
  border-bottom: 1px solid rgba(251, 247, 239, 0.16);
}

.footer-mark {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: var(--mist);
}

.footer-mark::after {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  margin-top: 16px;
  background: var(--ochre);
}

.footer-tagline {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--mist-soft);
}

.footer-note {
  margin: 0;
  max-width: 34ch;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: rgba(251, 247, 239, 0.5);
}

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

.footer-col { min-width: 0; }

.footer-col__title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(251, 247, 239, 0.55);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 15px;
  color: rgba(251, 247, 239, 0.86);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.footer-link::before {
  content: "";
  flex: none;
  width: 12px;
  height: 1px;
  background: rgba(251, 247, 239, 0.4);
  transition: width 0.18s var(--ease), background-color 0.18s var(--ease);
}

.footer-link:hover { color: var(--mist); }
.footer-link:hover::before { width: 20px; background: var(--ochre); }

.footer-contact { min-width: 0; }

.footer-contact__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(251, 247, 239, 0.14);
  font-size: 14px;
}

.footer-contact__row:last-child { border-bottom: 0; }

.footer-contact__key {
  flex: none;
  min-width: 44px;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(251, 247, 239, 0.5);
}

.footer-contact__val {
  color: rgba(251, 247, 239, 0.92);
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 20px 0 30px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(251, 247, 239, 0.55);
}

.footer-legal, .footer-copy { margin: 0; }

/* ============================================================
   工具：阅读进度 / 返回顶部
   ============================================================ */

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: 2px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s linear;
}

.read-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--ochre), var(--signal));
}

.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 26px);
  bottom: clamp(14px, 3vw, 26px);
  z-index: 100;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  box-shadow: 0 10px 26px -18px rgba(23, 59, 63, 0.9);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--deep); border-color: var(--deep); color: var(--mist); }

.to-top__arrow {
  display: block;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg) translate(1px, 1px);
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1180px) {
  .nav-link { padding: 8px 9px; font-size: 13px; }
  .nav-cta { padding: 8px 13px; font-size: 12.5px; }
  .brand-line { display: none; }
}

@media (max-width: 1023px) {
  .header-inner { gap: 10px; }

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

  .nav-island {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 80;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    visibility: hidden;
    transform: translateY(calc(100% + 28px));
    box-shadow: 0 -12px 44px -24px rgba(23, 59, 63, 0.7);
    transition: transform 0.28s var(--ease), visibility 0.28s var(--ease);
  }

  .site-header[data-open] .nav-island {
    visibility: visible;
    transform: translateY(0);
  }

  .nav-main { width: 100%; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
  }

  .nav-item { width: 100%; }

  .nav-link {
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 15px;
  }

  .nav-link[aria-current="page"] { border-radius: 12px; }

  .nav-cta {
    justify-content: center;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
  }

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

  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 6; }

  .to-top { bottom: 84px; }
}

@media (max-width: 767px) {
  body {
    font-size: 16px;
    background-image: none;
  }

  .site-header { padding-top: 10px; padding-bottom: 8px; }

  .brand-island { padding: 6px 14px 6px 7px; gap: 9px; }
  .brand-mark { width: 30px; height: 30px; font-size: 11px; }
  .brand-name { font-size: 14px; }

  .section { padding: 40px 0; }

  .grid-12 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: 1 / -1; }

  .btn { width: 100%; }

  .footer-bottom { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-brand { grid-column: auto; }
  .footer-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
  .footer-contact__row { flex-direction: column; gap: 2px; }
  .footer-contact__key { min-width: 0; padding-top: 0; }
}

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

  .js [data-reveal] { opacity: 1; transform: none; }
  .to-top { transform: none; }
  .nav-cta:hover::after { transform: none; }
}
