:root {
  --ink: #0B1B2B;
  --ink-2: #102A3E;
  --line: #1E4359;
  --cyan: #35E0D0;
  --cyan-soft: rgba(53, 224, 208, 0.12);
  --violet: #7A5CFF;
  --orange: #FF8A3D;
  --stone: #8C9AA6;
  --paper: #F2EDE4;
  --moss: #5E8F6B;
  --clay: #B5643C;

  --grid: 24px;
  --wrap: 1240px;
  --cut: 12px;

  --font-display: "Oswald", "Barlow Condensed", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-editorial: "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(30, 67, 89, 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 67, 89, 0.34) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

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

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

/* ---------- 基础布局 ---------- */

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--wide { padding: 64px 0; border-block: 1px solid var(--line); background: rgba(16, 42, 62, 0.45); }

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

.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ---------- 章节头 ---------- */

.section-head {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  text-transform: uppercase;
}

.section-head__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.section-head__note {
  max-width: 62ch;
  font-size: 14px;
  color: var(--stone);
}

/* ---------- 面板 ---------- */

.panel {
  border: 1px solid var(--line);
  background: rgba(16, 42, 62, 0.6);
}

.panel--cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.panel--inset { background: var(--ink-2); }

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--stone);
  text-transform: uppercase;
}

.panel__body { padding: 18px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn--primary { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }
.btn--primary:hover { background: #5eebdd; border-color: #5eebdd; }
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn--quiet { border-color: transparent; color: var(--stone); padding-inline: 12px; }
.btn--quiet:hover { color: var(--cyan); }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; }

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  background: rgba(30, 67, 89, 0.45);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tag--zone { color: var(--violet); border-color: rgba(122, 92, 255, 0.65); }
.tag--version { color: var(--orange); border-color: rgba(255, 138, 61, 0.6); }
.tag--archive { color: var(--clay); border-color: rgba(181, 100, 60, 0.65); }
.tag--ok { color: var(--moss); border-color: rgba(94, 143, 107, 0.7); }

/* ---------- 数据 ---------- */

.mono-text {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.stat { display: flex; flex-direction: column; gap: 6px; }

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--orange);
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- 索引列表 ---------- */

.index-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.index-list__row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.18s var(--ease);
}

.index-list__row:hover { background: rgba(53, 224, 208, 0.06); }

.index-list__key {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.index-list__value { font-size: 15px; color: var(--paper); }

/* ---------- 折叠组 ---------- */

.fold {
  border: 1px solid var(--line);
  background: rgba(16, 42, 62, 0.55);
}

.fold + .fold { margin-top: -1px; }

.fold__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.fold__head:hover { background: var(--cyan-soft); color: var(--cyan); }

.fold__sign {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
}

.fold__sign::before,
.fold__sign::after {
  content: "";
  position: absolute;
  background: var(--cyan);
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}

.fold__sign::before { left: 0; top: 7px; width: 16px; height: 2px; }
.fold__sign::after { left: 7px; top: 0; width: 2px; height: 16px; }
.fold[data-open] .fold__sign::after { transform: scaleY(0); opacity: 0; }

.fold__body {
  padding: 4px 18px 20px;
  border-top: 1px solid var(--line);
  color: var(--stone);
  font-size: 15px;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--stone);
}

.breadcrumb__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb__item + .breadcrumb__item::before { content: "/"; color: var(--line); }
.breadcrumb__item a { color: var(--stone); text-decoration: none; }
.breadcrumb__item a:hover { color: var(--cyan); }

/* ---------- 正文 ---------- */

.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.75;
}

.prose > * + * { margin-top: 0.9em; }
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 1.6em;
}
.prose h3 { font-size: 18px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose strong { color: var(--cyan); }
.prose code { font-family: var(--font-mono); font-size: 0.92em; color: var(--orange); }

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

.media-box {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--ink-2);
  background-image: repeating-linear-gradient(135deg, rgba(53, 224, 208, 0.06) 0 2px, transparent 2px 9px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.media-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-box__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(11, 27, 43, 0.9), rgba(11, 27, 43, 0));
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--paper);
}

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

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

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.reveal.is-visible,
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 跳过链接 ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--cyan);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: top 0.18s var(--ease);
}

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

/* ---------- 头部 ---------- */

.site-header {
  position: relative;
  background-color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 52%, var(--orange));
  z-index: 200;
  pointer-events: none;
}

.header-status {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(53, 224, 208, 0.1), rgba(122, 92, 255, 0.12) 55%, rgba(11, 27, 43, 0) 100%);
}

.header-status__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--stone);
}

.header-status__meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mono-tag {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--stone);
  text-transform: uppercase;
}

.mono-tag--live {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  font-weight: 700;
}

.header-masthead { position: relative; }

.header-masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}

.header-masthead__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  padding: 30px 0 22px;
}

.masthead-kicker {
  justify-self: start;
  font-family: var(--font-editorial);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.masthead-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--paper);
}

.masthead-brand:hover .masthead-brand__name { color: #5eebdd; }
.masthead-brand__mark { color: var(--paper); }
.masthead-brand__name { color: var(--cyan); transition: color 0.18s var(--ease); }

.masthead-sub {
  justify-self: end;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--stone);
}

.header-nav {
  position: relative;
  background: rgba(16, 42, 62, 0.72);
  border-bottom: 1px solid var(--line);
}

.header-nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}

.site-nav { flex: 1 1 auto; min-width: 0; }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.site-nav__list::-webkit-scrollbar { height: 3px; }
.site-nav__list::-webkit-scrollbar-thumb { background: var(--line); }
.site-nav__list > li { flex: none; scroll-snap-align: start; }

.site-nav__link {
  display: block;
  padding: 8px 14px;
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
  white-space: nowrap;
}

.site-nav__link:hover { color: var(--cyan); background: var(--cyan-soft); }

.site-nav__link[aria-current="page"] {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--ink);
  font-weight: 700;
}

.header-focus {
  display: flex;
  flex: none;
  gap: 8px;
  margin-left: auto;
}

.focus-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid;
  white-space: nowrap;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.focus-chip--map {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(53, 224, 208, 0.08);
}

.focus-chip--map:hover { background: var(--cyan); color: var(--ink); }

.focus-chip--live {
  border-color: rgba(122, 92, 255, 0.8);
  color: #b7a6ff;
  background: rgba(122, 92, 255, 0.12);
}

.focus-chip--live:hover { background: var(--violet); color: var(--paper); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

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

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

.nav-toggle__bars i {
  display: block;
  height: 2px;
  background: currentColor;
}

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

.site-footer {
  position: relative;
  margin-top: 96px;
  background-color: var(--ink-2);
  border-top: 1px solid var(--line);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 46%, var(--orange));
}

.footer-wrap { padding: 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 44px 32px;
  padding: 56px 0 44px;
}

.footer-brand-col { display: grid; gap: 12px; align-content: start; }

.footer-brand {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-decoration: none;
}

.footer-brand__mark { color: var(--cyan); }

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.footer-note {
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.7;
  color: var(--stone);
}

.footer-col__title {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-editorial);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--paper);
}

.footer-col__list {
  display: grid;
  gap: 8px;
  list-style: none;
}

.footer-col__list span,
.footer-col__list a {
  font-size: 14px;
  color: var(--stone);
  text-decoration: none;
}

.footer-col__list a { transition: color 0.18s var(--ease); }
.footer-col__list a:hover { color: var(--cyan); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--stone);
}

.footer-contact { color: var(--stone); }
.footer-address { color: var(--stone); }
.footer-meta { font-size: 12px; color: var(--stone); }

.copy-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--stone);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.copy-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.copy-btn[data-state="done"] { border-color: var(--moss); color: var(--moss); }
.copy-btn[data-state="fail"] { border-color: var(--orange); color: var(--orange); }

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

@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: span 2; }
}

@media (max-width: 900px) {
  .blueprint-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .span-4, .span-6, .span-8 { grid-column: span 6; }
  .span-12 { grid-column: span 6; }

  .header-masthead__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 0 18px;
    gap: 10px;
  }

  .masthead-kicker { justify-self: center; }
  .masthead-sub { justify-self: center; text-align: center; }

  .header-nav__inner { flex-wrap: wrap; min-height: 54px; padding: 6px 0; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 150;
    padding: 10px 16px 16px;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
  }

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

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

  .site-nav__link {
    padding: 12px 14px;
    border-color: transparent;
    border-bottom: 1px solid rgba(30, 67, 89, 0.6);
  }

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

  .header-focus { margin-left: 0; }
  .focus-chip { padding: 6px 10px; font-size: 12px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .section { padding: 44px 0; }
  .section--wide { padding: 44px 0; }

  .blueprint-grid { grid-template-columns: minmax(0, 1fr); }
  .span-4, .span-6, .span-8, .span-12 { grid-column: span 1; }

  .header-status__meta { display: none; }
  .header-status__inner { justify-content: space-between; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; padding: 40px 0 32px; }
  .footer-brand-col { grid-column: span 1; }

  .index-list__row { grid-template-columns: 64px minmax(0, 1fr); row-gap: 4px; }
  .index-list__row > :last-child { grid-column: 2; }

  .focus-chip { font-size: 11px; padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
}
