/* ==========================================================================
   乐天堂服务 · 共享样式 /assets/site.css
   圆心坐标系统：深空底 · 星图蓝分区 · 霓虹青绿强调 · 暖橙坐标点
   ========================================================================== */

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

html, body { margin: 0; padding: 0; }

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

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

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

ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; }
a { color: inherit; }

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. 设计变量 ---------- */
:root {
  --ink: #060B1F;
  --ink-2: #0C1533;
  --line: #1D2B57;
  --line-soft: rgba(29, 43, 87, 0.6);

  --neon: #2FE3C0;
  --neon-soft: #8BFFE4;
  --orange: #FF9A3C;
  --link: #4B6BFF;
  --warn: #FFD166;

  --white: #E8EEFF;
  --muted: #9FB0D6;

  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1280px;
  --gutter: clamp(18px, 4.2vw, 56px);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 124px;
}

/* ---------- 3. 基础层 ---------- */
body {
  background-color: var(--ink);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 同心圆光晕 + 坐标点阵：固定在最底层，不参与滚动 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% -12%, rgba(47, 227, 192, 0.1), transparent 58%),
    radial-gradient(circle at 88% 92%, rgba(75, 107, 255, 0.12), transparent 55%),
    repeating-radial-gradient(circle at 50% 38%, transparent 0 119px, rgba(29, 43, 87, 0.5) 119px 120px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(rgba(159, 176, 214, 0.22) 1px, transparent 1px);
  background-size: 34px 34px;
}

#main-content {
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.16;
  letter-spacing: 0.02em;
}

::selection { background: rgba(47, 227, 192, 0.28); color: var(--white); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(75, 107, 255, 0.22);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--neon-soft);
}

/* ---------- 4. 布局骨架 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ed-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
}

.ed-grid__note {
  grid-column: 1 / span 2;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 12px);
}

.ed-grid__body { grid-column: 4 / span 8; }

.ed-grid__aside { grid-column: 10 / span 3; align-self: start; }

.rule {
  height: 1px;
  border: 0;
  margin: clamp(28px, 4vw, 56px) 0;
  background: var(--line);
}

[data-section] { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ---------- 5. 文字层级 ---------- */
.display-1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.06;
  letter-spacing: 0.02em;
}

.display-2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.6vw, 48px);
  line-height: 1.14;
  letter-spacing: 0.02em;
}

.display-3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.25;
}

.lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.85;
  color: var(--muted);
  max-width: 62ch;
}

.coord-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
}

.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  padding-top: 0.9em;
  border-top: 1px solid var(--line);
  font-size: clamp(24px, 2.6vw, 32px);
  color: var(--white);
}

.prose h3 {
  margin: 1.7em 0 0.5em;
  font-size: 20px;
  color: var(--white);
}

.prose p { margin: 0 0 1.1em; }

.prose ul,
.prose ol { display: grid; gap: 0.6em; margin: 0 0 1.3em; }

.prose li { position: relative; padding-left: 20px; }

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 8px;
  height: 1px;
  background: var(--neon);
}

.prose a {
  color: var(--neon-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 255, 228, 0.4);
}

.prose a:hover { border-bottom-color: var(--neon); }

.prose strong { color: var(--white); font-weight: 700; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 10px 18px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background-color 0.22s var(--ease), border-color 0.22s var(--ease), color 0.22s var(--ease);
}

.btn--solid {
  background: var(--neon);
  border-color: var(--neon);
  color: #04141A;
  font-weight: 700;
}

.btn--solid:hover { background: var(--neon-soft); border-color: var(--neon-soft); }

.btn--ghost { color: var(--muted); }

.btn--ghost:hover { color: var(--neon-soft); border-color: rgba(47, 227, 192, 0.6); }

.btn--line {
  border-color: rgba(255, 154, 60, 0.55);
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.btn--line:hover { background: rgba(255, 154, 60, 0.12); border-color: var(--orange); color: var(--warn); }

/* ---------- 7. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.tag--neon { color: var(--neon); border-color: rgba(47, 227, 192, 0.5); background: rgba(47, 227, 192, 0.07); }
.tag--warn { color: var(--warn); border-color: rgba(255, 209, 102, 0.45); background: rgba(255, 209, 102, 0.08); }
.tag--coord { color: var(--orange); border-color: rgba(255, 154, 60, 0.45); background: rgba(255, 154, 60, 0.07); }

/* ---------- 8. 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.crumbs__link { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.crumbs__link:hover { color: var(--neon-soft); border-bottom-color: var(--neon); }
.crumbs__sep { color: rgba(159, 176, 214, 0.45); }
.crumbs__current { color: var(--white); }

/* ---------- 9. 档案卡 ---------- */
.panel {
  position: relative;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 21, 51, 0.88), rgba(12, 21, 51, 0.42));
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel__title { font-family: var(--font-display); font-size: clamp(20px, 2vw, 24px); color: var(--white); }

.panel__meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }

.panel__body { color: var(--muted); font-size: 16px; }

.panel__foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- 10. 标签页 ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.tabs__btn {
  padding: 12px 18px;
  border: 1px solid transparent;
  border-bottom: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tabs__btn:hover { color: var(--neon-soft); }

.tabs__btn[aria-selected="true"] {
  position: relative;
  top: 1px;
  color: var(--white);
  border-color: var(--line);
  background: rgba(12, 21, 51, 0.92);
}

.tabs__panel { display: none; padding-top: 20px; }
.tabs__panel.is-active { display: block; }

/* ---------- 11. 步骤清单 ---------- */
.checklist { display: grid; border-top: 1px solid var(--line); }

.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.checklist__box {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 1px solid var(--line);
  background: transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.checklist__box:hover { border-color: var(--neon); }

.checklist__item.is-done { color: var(--white); }

.checklist__item.is-done .checklist__box {
  border-color: var(--neon);
  background: rgba(47, 227, 192, 0.14);
}

.checklist__item.is-done .checklist__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--neon);
  border-bottom: 2px solid var(--neon);
  transform: rotate(42deg);
}

.checklist__text { flex: 1 1 auto; }

/* ---------- 12. 复制条 ---------- */
.copy-row {
  display: flex;
  align-items: stretch;
  max-width: 520px;
  border: 1px solid var(--line);
  background: rgba(6, 11, 31, 0.65);
}

.copy-row__value {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--neon-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  flex: 0 0 auto;
  padding: 0 16px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.copy-btn:hover { color: var(--neon); }

.copy-btn.is-copied { background: var(--neon); color: #04141A; }

/* ---------- 13. 数据卡 ---------- */
.stat { padding-left: 16px; border-left: 1px solid var(--line); }

.stat__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--neon);
}

.stat__cap { font-size: 13px; letter-spacing: 0.06em; color: var(--muted); }

/* ---------- 14. 显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 15. 目录 ---------- */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.toc__title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc__item { margin-bottom: 10px; }

.toc__link {
  display: block;
  margin-left: -12px;
  padding-left: 10px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.toc__link:hover { color: var(--white); }

.toc__link.is-active { color: var(--neon); border-left-color: var(--neon); }

/* ---------- 16. 图文容器 ---------- */
.frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--ink-2);
  background-image:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 46px, rgba(29, 43, 87, 0.75) 46px 47px),
    linear-gradient(160deg, rgba(47, 227, 192, 0.08), transparent 60%);
  isolation: isolate;
}

.frame::before {
  content: "";
  display: block;
  padding-top: var(--frame-ratio, 60%);
}

.frame__media,
.frame > img,
.frame > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: rgba(6, 11, 31, 0.86);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.frame--wide { --frame-ratio: 44%; }
.frame--square { --frame-ratio: 100%; }
.frame--tall { --frame-ratio: 132%; }

/* ---------- 17. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(6, 11, 31, 0.97);
  border-bottom: 1px solid var(--line);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 120;
  padding: 10px 16px;
  background: var(--neon);
  color: #04141A;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

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

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
  background: rgba(29, 43, 87, 0.6);
}

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

.masthead {
  max-height: 180px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  transition: max-height 0.34s var(--ease), opacity 0.22s var(--ease), border-color 0.3s var(--ease);
}

.site-header.is-condensed .masthead {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  min-height: 66px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand__mark {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.brand__mark::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(47, 227, 192, 0.55);
  border-radius: 50%;
}

.brand__mark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(47, 227, 192, 0.85);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.25; }

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--white);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.masthead__note {
  margin-left: auto;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.masthead__actions { display: flex; gap: 10px; flex: 0 0 auto; }

.nav-bar {
  position: relative;
  background: linear-gradient(90deg, rgba(12, 21, 51, 0.92), rgba(6, 11, 31, 0.92));
}

.nav-bar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
}

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

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(10px, 1.7vw, 26px);
}

.nav-list__item { flex: 0 0 auto; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  padding: 16px 1px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 0.22s var(--ease);
}

.nav-link__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(159, 176, 214, 0.7);
  transition: color 0.22s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 2px;
  background: var(--neon);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.28s var(--ease);
}

.nav-link:hover { color: var(--white); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link:hover .nav-link__num { color: var(--orange); }

.nav-link[aria-current="page"] { color: var(--white); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] .nav-link__num { color: var(--orange); }

.nav-bar__coord {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(159, 176, 214, 0.5);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.nav-toggle__lines { display: inline-flex; flex-direction: column; gap: 4px; width: 20px; }

.nav-toggle__lines i {
  display: block;
  height: 1px;
  background: var(--neon);
  transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__lines i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__lines i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__lines i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- 18. 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(56px, 8vw, 120px);
  background: var(--ink-2);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 1.3fr;
  gap: 0;
}

.footer-col {
  padding: clamp(28px, 3.4vw, 46px) clamp(16px, 2vw, 28px);
}

.footer-col + .footer-col { border-left: 1px solid var(--line); }
.footer-col:first-child { padding-left: 0; }

.footer-brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--white);
}

.footer-tagline {
  margin-top: 12px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.footer-coord {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 154, 60, 0.85);
}

.footer-heading {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--neon);
}

.footer-list { display: grid; gap: 10px; }

.footer-link {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-link:hover { color: var(--neon-soft); border-bottom-color: var(--neon); }

.footer-text {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.footer-contact { display: grid; gap: 12px; }

.footer-contact__item { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }

.footer-contact__key {
  flex: 0 0 44px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--orange);
}

.footer-contact__val {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  word-break: break-word;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px clamp(18px, 3vw, 40px);
  padding: 20px 0 34px;
  border-top: 1px solid var(--line);
}

.footer-legal {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.footer-legal__links { display: flex; flex-wrap: wrap; gap: 18px; }

.footer-copy {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(159, 176, 214, 0.65);
}

/* ---------- 19. 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 36px);
  bottom: clamp(16px, 3vw, 36px);
  z-index: 70;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(12, 21, 51, 0.94);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), visibility 0.24s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { color: var(--neon); border-color: var(--neon); }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1100px) {
  .nav-bar__coord { display: none; }
}

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .footer-col:nth-child(-n + 2) { border-top: 0; }
  .ed-grid__note,
  .ed-grid__body,
  .ed-grid__aside { grid-column: 1 / -1; position: static; }
  .toc { position: static; }
}

@media (max-width: 900px) {
  :root { --header-h: 60px; }

  .masthead__note { display: none; }
  .masthead__inner { flex-wrap: wrap; gap: 14px; }
  .masthead__actions { margin-left: auto; }
  .masthead__actions .btn { padding: 8px 13px; font-size: 13px; }

  .nav-toggle { display: inline-flex; }
  .nav-bar__inner { justify-content: flex-start; }

  .primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    padding: 6px var(--gutter) 18px;
    background: var(--ink-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 26px 44px rgba(0, 0, 0, 0.5);
  }

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

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list__item { border-bottom: 1px solid var(--line); }
  .nav-list__item:last-child { border-bottom: 0; }

  .nav-link { display: flex; padding: 15px 0; font-size: 16px; }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--neon); }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col { border-top: 1px solid var(--line); }
  .footer-col:first-child { border-top: 0; }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .footer-copy { margin-left: 0; }
  .copy-row { flex-direction: column; }
  .copy-btn { padding: 12px 14px; border-left: 0; border-top: 1px solid var(--line); }
  .to-top { right: 14px; bottom: 14px; }
}

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

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