:root {
  --bg: #0f0b09;
  --text: #f6eee7;
  --muted: #a3958a;
  --faint: #5c4f46;
  --line: rgba(255, 236, 220, .12);
  --ok: #5cc98a;
  --warn: #f5a524;
  --fail: #e5534b;
  --fade-line: linear-gradient(90deg, transparent, rgba(255, 236, 220, .08), transparent);
  --accent: #f08a33;
  --amber: #f5a524;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  --num: "Helvetica Neue", Helvetica, Arial, "PingFang SC", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a, button { -webkit-tap-highlight-color: transparent; }

.m-only { display: none; }

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

/* ---------- 背景：星空（canvas）+ 暖色光晕 ---------- */

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.glow::before,
.glow::after {
  content: "";
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .7;
  transition: opacity 1.2s;
  animation: drift 26s ease-in-out infinite alternate;
}

.glow::before {
  top: -35vmax;
  left: -20vmax;
  background: radial-gradient(circle, rgba(240, 138, 51, .22), transparent 62%);
}

.glow::after {
  bottom: -40vmax;
  right: -25vmax;
  background: radial-gradient(circle, rgba(150, 70, 160, .16), transparent 62%);
  animation-duration: 32s;
  animation-direction: alternate-reverse;
}

@keyframes drift {
  to { transform: translate(8vmax, 6vmax) scale(1.08); }
}

/* 测速时光晕变亮 */
body:has(.stage[data-phase="download"]) .glow::before,
body:has(.stage[data-phase="upload"]) .glow::before {
  opacity: 1;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 11, 9, .55);
}

.header-in {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
}

.logo svg { color: var(--accent); }

.nav {
  display: flex;
  gap: 28px;
  margin-right: auto;
  font-size: 14px;
}

.nav a {
  position: relative;
  color: var(--muted);
  padding: 6px 0;
  transition: color .2s;
}

.nav a:hover,
.nav a[aria-current] { color: var(--text); }

.nav a[aria-current]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* 语言切换 */
.lang-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.lang-pick select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: var(--muted);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a3958a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / 11px;
  border: 0;
  padding: 4px 16px 4px 0;
  cursor: pointer;
  transition: color .2s;
}

.lang-pick select:hover { color: var(--text); }
.lang-in-menu { display: none; }
.lang-pick option { color: #1d1512; }

.lang-pick select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.cta {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: #1c0f05;
  background: var(--accent);
  padding: 8px 18px;
  border-radius: 999px;
  transition: transform .2s, box-shadow .2s;
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.menu-btn span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s;
}

.header[data-open] .menu-btn span:first-child { transform: translateY(4px) rotate(45deg); }
.header[data-open] .menu-btn span:last-child { transform: translateY(-4px) rotate(-45deg); }

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(240, 138, 51, .35);
}

/* ---------- 主体（fast.com 式布局） ---------- */

.stage {
  flex: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 7vh 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 测速节点下拉菜单 */
.node-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}

.node-pick-k::after { content: "："; }
:lang(en) .node-pick-k::after { content: ":"; }

.node-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 236, 220, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 220, .1);
  border: 0;
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}

.node-btn:hover,
.node-pick.is-open .node-btn {
  background: rgba(240, 138, 51, .08);
  box-shadow: inset 0 0 0 1px rgba(240, 138, 51, .45);
}

.node-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.node-flag {
  display: inline-flex;
  color: var(--muted);
}

.node-flag img {
  display: block;
  width: 20px;
  height: 15px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
}

.node-name { font-weight: 600; white-space: nowrap; }

.node-ms {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.node-ms[data-level="fast"] { color: var(--ok); }
.node-ms[data-level="mid"]  { color: var(--warn); }
.node-ms[data-level="slow"] { color: var(--accent); }
.node-ms[data-level="down"] { color: var(--faint); }

.node-caret {
  color: var(--muted);
  transition: transform .2s;
}

.node-pick.is-open .node-caret { transform: rotate(180deg); }

.node-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 280px;
  max-width: calc(100vw - 32px);
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  text-align: left;
  background: #1a1411;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 236, 220, .1);
  animation: pop .18s ease-out;
}

.node-list:focus { outline: none; }

.node-list li {
  display: grid;
  grid-template-columns: auto 1fr auto 14px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
}

.node-list li.is-active { background: rgba(255, 236, 220, .07); }
.node-list li[aria-disabled] { opacity: .45; cursor: not-allowed; }

.node-check { visibility: hidden; color: var(--accent); }
.node-list li[aria-selected="true"] .node-check { visibility: visible; }

.title {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 700;
  text-align: center;
}

.hero {
  display: flex;
  align-items: stretch;
  gap: 20px;
  margin: 10px 0 28px;
}

.num {
  font-family: var(--num);
  font-size: clamp(110px, 24vw, 220px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--faint);
  transition: color .5s;
}

.stage[data-phase="download"] .num { color: #c9b8a9; }
.stage[data-phase="upload"] .num,
.stage[data-phase="done"] .num { color: var(--text); }

.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.2vw 0 .6vw;
}

.unit {
  font-family: var(--num);
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 700;
  line-height: 1;
}

/* 圆形按钮：测试中转圈，测完变成重测 */
.spin {
  position: relative;
  width: clamp(52px, 9vw, 76px);
  height: clamp(52px, 9vw, 76px);
  border-radius: 50%;
  border: 3px solid var(--line);
  background: none;
  color: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .3s, transform .2s, box-shadow .3s;
}

.spin::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: rotate .9s linear infinite;
}

.spin-icon { opacity: 0; transition: opacity .3s; }

.stage[data-phase="done"] .spin,
.stage[data-phase="error"] .spin {
  border-color: var(--accent);
}

.stage[data-phase="done"] .spin::before,
.stage[data-phase="error"] .spin::before { display: none; }

.stage[data-phase="done"] .spin-icon,
.stage[data-phase="error"] .spin-icon { opacity: 1; }

.spin:not(:disabled):hover {
  transform: rotate(-30deg);
  box-shadow: 0 0 28px rgba(240, 138, 51, .4);
}

.spin:disabled { cursor: default; }

.spin:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@keyframes rotate { to { transform: rotate(360deg); } }

/* 延迟 / 上传 分组 */
.groups {
  width: 100%;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 32px 48px;
}

.group h2 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.cols {
  display: flex;
  gap: 32px;
}

.metric {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.k {
  font-size: 14px;
  color: var(--muted);
}

.v b {
  font-family: var(--num);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  transition: color .4s;
}

.v i {
  font-style: normal;
  margin-left: 4px;
  font-size: 14px;
  color: var(--muted);
}

/* 上传测试进行中时数字为品牌橙并轻微闪烁，测完恢复白色 */
.stage[data-phase="upload"] #upload {
  color: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .55; } }

/* 数值刚出现时轻微上浮 */
.pop { animation: pop .45s cubic-bezier(.2, .8, .2, 1); }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
}

.v b { display: inline-block; }

.extra { width: 100%; }

.extra summary {
  display: none; /* 仅移动端显示 */
}

.info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 24px;
  margin: 28px 0 0;
  padding-top: 18px;
  background: var(--fade-line) top / 100% 1px no-repeat;
}

.info dt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.info dt svg { color: var(--accent); }

.info dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

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

.footer {
  position: relative;
  background: rgba(15, 11, 9, .6);
  font-size: 13px;
  color: var(--muted);
}

.footer::before,
.header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--fade-line);
  pointer-events: none;
}

.footer::before { top: 0; }
.header::after { bottom: 0; }

.footer-in {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-brand strong {
  color: var(--text);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-links a { transition: color .2s; }
.footer-links a:hover { color: var(--text); }

/* ---------- IP 检测页 ---------- */

.ip-page {
  flex: 1;
  width: min(1000px, 100%);
  margin: 0 auto;
  padding: 7vh 24px 64px;
}

.ip-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lead {
  margin: 8px 0 20px;
  color: var(--muted);
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 236, 220, .05);
  font-size: 15px;
  font-weight: 500;
}

.verdict-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.verdict[data-state="loading"] .verdict-dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.verdict[data-state="ok"] .verdict-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.verdict[data-state="warn"] .verdict-dot { background: var(--warn); }
.verdict[data-state="fail"] .verdict-dot { background: var(--fail); }

.ip-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.ip-card {
  padding: 22px 22px 20px;
  border-radius: 14px;
  background: rgba(255, 236, 220, .035);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 220, .06);
  transition: box-shadow .3s;
}

.ip-card[data-state="ok"]:hover { box-shadow: inset 0 0 0 1px rgba(240, 138, 51, .35); }

.ip-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ip-card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

[data-state="loading"] > header .state { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
[data-state="ok"] > header .state { background: var(--ok); }
[data-state="fail"] > header .state { background: var(--fail); }

.ip-addr {
  margin: 14px 0 2px;
  font-family: var(--num);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ip-card[data-state="loading"] .ip-addr { color: var(--faint); font-size: 20px; }
.ip-card[data-state="fail"] .ip-addr { color: var(--fail); }

.ip-loc {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  opacity: .8;
}

.ip-note {
  margin: 16px 0 0;
  padding-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--fade-line) top / 100% 1px no-repeat;
}

.sites { margin-top: 48px; }

.sites-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sites-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  color: var(--accent);
  background: rgba(240, 138, 51, .1);
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .2s;
}

.btn-ghost:hover:not(:disabled) { background: rgba(240, 138, 51, .18); }
.btn-ghost:disabled { opacity: .45; cursor: default; }

.site-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.site {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 236, 220, .035);
  animation: pop .35s ease-out both;
}

.site-name { font-weight: 600; }

.site-tag {
  align-self: center;
  font-size: 11px;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 236, 220, .06);
}

.site-ms {
  grid-column: 1 / -1;
  font-family: var(--num);
  font-size: 14px;
  color: var(--muted);
}

.site[data-state="loading"] .site-ms { animation: pulse 1s ease-in-out infinite; }
.site[data-state="ok"] .site-ms { color: var(--ok); }
.site[data-state="warn"] .site-ms { color: var(--warn); }
.site[data-state="slow"] .site-ms { color: var(--accent); }
.site[data-state="fail"] .site-ms { color: var(--fail); }

.fine {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
}

@media (max-width: 900px) {
  .site-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .ip-page { padding: 32px 16px 40px; }
  .lead { font-size: 14px; }
  .verdict { font-size: 14px; padding: 10px 14px; border-radius: 12px; text-align: left; }
  .verdict-dot { flex: none; }
  .ip-cards { grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
  .ip-card { padding: 16px 18px; }
  .ip-note { display: none; }
  .ip-addr { margin-top: 8px; }
  .sites { margin-top: 36px; }
  .site-list { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 关于 / 隐私 / 条款 / 联系 ---------- */

.doc-page {
  flex: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 7vh 24px 72px;
}

.doc {
  line-height: 1.8;
  color: rgba(246, 238, 231, .86);
  animation: pop .4s ease-out;
}

.doc h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.doc h2 {
  margin: 40px 0 10px;
  padding-top: 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  background: var(--fade-line) top / 100% 1px no-repeat;
}

.doc p { margin: 0 0 14px; }

.doc ul {
  margin: 0 0 14px;
  padding-left: 1.2em;
}

.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--accent); }

.doc strong { color: var(--text); font-weight: 600; }

.doc a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.doc a:hover { text-decoration: underline; }

.doc-lead {
  font-size: 17px;
  color: var(--text);
}

.doc-meta {
  font-size: 13px;
  color: var(--muted);
}

.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 24px 0 8px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 236, 220, .035);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 220, .06);
  transition: box-shadow .25s;
}

.doc-card-k { font-size: 13px; color: var(--muted); }
.doc-card-v { font-size: 17px; font-weight: 600; color: var(--text); }
a.doc-card-v { color: var(--accent); overflow-wrap: anywhere; }

.doc-card-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 236, 220, .06);
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.copy-btn:hover { color: var(--text); background: rgba(255, 236, 220, .1); }
.copy-btn.is-done { color: var(--ok); background: rgba(92, 201, 138, .12); }

.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.doc-card-n { font-size: 13px; color: var(--muted); line-height: 1.6; }

.footer-links a[aria-current] { color: var(--text); }

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

@media (max-width: 760px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .header-in { gap: 12px; height: 56px; }
  .logo { margin-right: auto; font-size: 16px; }
  .cta { padding: 7px 14px; font-size: 13px; }
  .menu-btn { display: flex; order: 3; }

  /* 移动端语言切换放进菜单 */
  .lang-in-header { display: none; }
  .lang-in-menu {
    display: flex;
    gap: 8px;
    padding: 14px 0 4px;
    font-size: 16px;
  }
  .lang-in-menu select { font-size: 16px; color: var(--text); }

  /* 导航改为下拉面板 */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 16px 16px;
    background: var(--bg);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .5);
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }

  .header[data-open] .nav {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
  }

  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current] { color: var(--accent); }
  .nav a[aria-current]::after { display: none; }

  /* 结果区在可用高度内垂直居中 */
  .stage { justify-content: center; padding: 24px 16px 28px; }
  .title { font-size: 22px; }

  .hero { gap: 10px; margin: 8px 0 24px; }
  .num { font-size: clamp(84px, 27vw, 150px); }
  .unit { font-size: clamp(24px, 7vw, 36px); }
  .hero-side { padding: 8px 0 4px; }

  /* 四项指标合成 2×2 网格 */
  .m-only { display: inline; }
  .groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
    padding-top: 16px;
    /* 两端渐隐的淡分割线 */
    background: var(--fade-line) top / 100% 1px no-repeat;
  }
  .group, .cols { display: contents; }
  .metric { align-items: center; text-align: center; }
  .group h2 { display: none; }
  .v b { font-size: 34px; }

  .extra { margin-top: 20px; }

  .extra summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
  }

  .extra summary::-webkit-details-marker { display: none; }
  .extra summary svg { transition: transform .25s; }
  .extra[open] summary svg { transform: rotate(180deg); }
  .extra[open] > :not(summary) { animation: pop .3s ease-out; }

  .info {
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
    margin-top: 8px;
    padding-top: 16px;
  }
  .info > div { text-align: center; }
  .info dt { justify-content: center; }

  .footer-in { flex-direction: column; align-items: flex-start; padding-top: 20px; }
  .footer-links { gap: 8px 20px; }
  .doc-page { padding: 32px 16px 48px; }
  .doc h2 { margin-top: 32px; }
}

@media (max-width: 360px) {
  .cta { display: none; }
  .node-pick-k { display: none; }
  .v b { font-size: 30px; }
}

/* 手机横屏：高度不足时压缩主数字 */
@media (max-height: 500px) and (orientation: landscape) {
  .stage { padding-top: 16px; }
  .num { font-size: 96px; }
  .hero { margin-bottom: 16px; }
}

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