/* ============================================================
   工位穴位 · 视觉系统
   风格取法：暖奶油纸底 / 2px 纯墨描边 / 零模糊硬投影 /
   径向波点纹理 / 圆体标题 + 等宽小标签 / 主卡微倾斜
   ============================================================ */

:root {
  /* 纸与墨 */
  --paper: #fff4dd;
  --card: #fffdf7;
  --ink: #26201a;
  --ink-2: #5c5347;
  --ink-3: #877b6b;
  --dot-ink: #26201a1a;

  /* 主色与粉彩 */
  --accent: #ff5c2b;
  --accent-hover: #ee4518;
  --on-accent: #fffdf7;
  --peach: #ffb07a;
  --mint: #b9e6a6;
  --rose: #ffb9cc;
  --sky: #a5dcff;
  --sun: #ffd84d;
  --on-sun: #3a2f10;
  --on-peach: #3d2312;
  --on-mint: #20340f;
  --on-rose: #3d1522;
  --on-sky: #10293c;

  /* 形 */
  --border: 2px solid var(--ink);
  --radius: 14px;
  --shadow-ink: var(--ink);
  --shadow-sm: 3px 3px 0 var(--shadow-ink);
  --shadow: 4px 4px 0 var(--shadow-ink);
  --shadow-lg: 6px 6px 0 var(--shadow-ink);

  /* 字 */
  --font-display: 'Baloo 2', 'Arial Rounded MT Bold', 'GenSen Rounded',
    'PingFang SC', 'Hiragino Sans GB', system-ui, sans-serif;
  --font-localized: 'GenSen Rounded', 'PingFang SC', 'Microsoft YaHei',
    'Hiragino Sans GB', sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas,
    monospace;
}

:root[data-theme='dark'] {
  --paper: #211d19;
  --card: #2e2925;
  --ink: #f4ece2;
  --ink-2: #c7bcb2;
  --ink-3: #a89e95;
  --dot-ink: #f6e8cf14;
  --accent: #f95526;
  --accent-hover: #ff6a3d;
  --on-accent: #2a1a15;
  --peach: #ffc79a;
  --mint: #a8e295;
  --rose: #ffb3c9;
  --sky: #9fd4f5;
  --sun: #ffd94f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  transition: background .25s ease, color .25s ease;
}

:lang(zh), [lang='zh-CN'] { font-family: var(--font-localized); }

::selection { background: var(--sun); color: var(--on-sun); }

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
a:hover { color: var(--accent); }

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── 顶栏 ─────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: var(--border);
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  transition: transform .1s ease;
}
.theme-toggle:hover { transform: translate(-1px, -1px); }
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: none; }

/* ── 主卡（微倾斜 + 波点） ─────────────────────── */
.hero {
  position: relative;
  background: var(--card);
  background-image: radial-gradient(var(--dot-ink) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 26px 30px 28px;
  transform: rotate(-.4deg);
  overflow: hidden;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-label .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  border: 1.5px solid var(--ink);
  flex: none;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6.2vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 8px;
}

.hero h1 .hl {
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 6px;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  display: inline-block;
  transform: rotate(-1.2deg);
}

.hero-sub {
  font-family: var(--font-localized);
  font-size: 15px;
  color: var(--ink-2);
  margin: 0;
  max-width: 46ch;
}

.hero-figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(48px, 8vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hero-figure .unit {
  font-family: var(--font-localized);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0;
}

.hero-foot {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 12px 0 0;
}

/* ── 区块标题 ─────────────────────────────────── */
.section { margin-top: 40px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0;
}

.section-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
  white-space: nowrap;
}

/* ── 症状按钮组 ───────────────────────────────── */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.symptom {
  position: relative;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 13px 14px 12px;
  display: block;
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1),
    box-shadow .12s ease, background .15s ease;
}

.symptom:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.symptom:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow-ink);
}

.symptom .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 5px;
}

.symptom .name {
  font-family: var(--font-localized);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
  display: block;
}

.symptom .chip-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}

.symptom:hover .chip-dot { transform: scale(1.18); }

.symptom[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}
.symptom[aria-pressed='true'] .tag { color: var(--on-accent); opacity: .72; }
.symptom[aria-pressed='true'] .chip-dot { background: var(--sun); }

.tone-peach { background: var(--peach); color: var(--on-peach); }
.tone-mint  { background: var(--mint);  color: var(--on-mint); }
.tone-rose  { background: var(--rose);  color: var(--on-rose); }
.tone-sky   { background: var(--sky);   color: var(--on-sky); }
.tone-sun   { background: var(--sun);   color: var(--on-sun); }

/* ── 方案头 ───────────────────────────────────── */
.plan-head {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.plan-head .badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  border: var(--border);
  border-radius: 10px;
  padding: 5px 12px;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  white-space: nowrap;
}

.plan-head .blurb {
  font-family: var(--font-localized);
  color: var(--ink-2);
  font-size: 14px;
  margin: 0;
  flex: 1 1 220px;
}

.progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.progress i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  display: block;
}
.progress i.done { background: var(--mint); }

/* ── 主体两栏 ─────────────────────────────────── */
/* HTML 顺序 = 手机顺序（清单 → 按压台 → 人体图）；
   桌面用显式定位把人体图换到左栏、按压台拉通整行。 */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 372px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.card--map  { grid-column: 1; grid-row: 1; }
.card--list { grid-column: 2; grid-row: 1; }
.press-card { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }

@media (max-width: 780px) {
  .workbench { grid-template-columns: 1fr; }
  .card--map, .card--list, .press-card {
    grid-column: 1;
    grid-row: auto;
  }
}

.card {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  margin: 0 0 3px;
  letter-spacing: -.01em;
}

.card-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 0 0 12px;
  letter-spacing: .04em;
}

/* ── 分段切换 ─────────────────────────────────── */
.seg {
  display: inline-flex;
  border: var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  background: var(--card);
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 11px;
  cursor: pointer;
  line-height: 1.2;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}

.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed='true'] { background: var(--sun); color: var(--on-sun); }
.seg button:hover:not([aria-pressed='true']) { background: var(--dot-ink); }

.map-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ── 人体图 ───────────────────────────────────── */
.map {
  background: var(--dot-ink);
  background-image: radial-gradient(var(--dot-ink) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  padding: 4px 0;
  position: relative;
}

.map svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.map #view-back.is-off { display: none; }

.map .fig-body {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.map .fig-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: .55;
}

.map .fig-face {
  fill: var(--ink);
  opacity: .72;
}

/* 穴位点 */
.pt {
  cursor: pointer;
}
.pt .hit { fill: transparent; }
.pt .ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.pt .core {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1.8;
  transition: fill .16s ease, r .16s cubic-bezier(.34, 1.56, .64, 1);
}
.pt .label {
  font-family: var(--font-localized);
  font-size: 12px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

/* 默认：全部穴位的小圆点 */
.pt .core { r: 4; opacity: .5; }
.pt:hover .core { r: 5.5; opacity: 1; fill: var(--peach); }

/* 本方案高亮 */
.pt.active .core {
  r: 9;
  opacity: 1;
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 2.2;
}
.pt.active .ring { opacity: 1; animation: ping 1.9s cubic-bezier(.2, .7, .3, 1) infinite; }
/* 只给选中的那一个点名；镜像的那侧不再重复标字 */
.pt.sel:not([data-mirror]) .label { opacity: 1; fill: var(--ink); font-size: 15px; }

.pt.sel .core {
  r: 11;
  fill: var(--sun);
  stroke: var(--ink);
  stroke-width: 2.8;
}
.pt.sel .ring { opacity: 1; stroke: var(--ink); animation: none; }
.pt.dim { opacity: .25; }

.pt.done .core { fill: var(--mint); }
.pt.done .ring { opacity: 0; }

@keyframes ping {
  0%   { transform: scale(.55); opacity: .9; }
  70%  { transform: scale(2); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pt.active .ring { animation: none; opacity: .7; }
  * { transition-duration: .01ms !important; }
}

.map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 12px 0 0;
}

.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: inline-block;
}

/* ── 穴位清单 ─────────────────────────────────── */
.point-list { display: flex; flex-direction: column; gap: 10px; }

.point-row {
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  padding: 12px 13px;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
  position: relative;
}

.point-row:hover { background: var(--dot-ink); }
.point-row.sel {
  background: var(--sun);
  color: var(--on-sun);
  box-shadow: 3px 3px 0 var(--shadow-ink);
  transform: translate(-1px, -1px);
}

.point-row.done { background: var(--mint); color: var(--on-mint); }

.point-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.point-code {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  padding: 1px 6px;
  opacity: .8;
}

.point-name {
  font-family: var(--font-localized);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
}

.point-idx {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  opacity: .6;
}

.point-meta {
  font-size: 13px;
  line-height: 1.55;
  margin: 7px 0 0;
  opacity: .92;
}
.point-meta b { font-weight: 700; }
.point-meta + .point-meta { margin-top: 3px; }
.point-meta .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  opacity: .6;
  margin-right: 5px;
}

.back-hint {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  padding: 0 5px;
  vertical-align: 1px;
  opacity: .75;
}

/* ── 大按压按钮 ───────────────────────────────── */
/* 现在是 .workbench 的 grid 子项，间距交给 gap，别再加 margin-top */
.press-card {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  background-image: radial-gradient(var(--dot-ink) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

@media (max-width: 620px) {
  .press-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

.press {
  position: relative;
  width: 168px;
  height: 168px;
  flex: none;
  border-radius: 50%;
  border: var(--border);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 5px 5px 0 var(--shadow-ink);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: transform .08s ease, box-shadow .08s ease,
    background .15s ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.press:hover { background: var(--accent-hover); }

.press.squish {
  transform: scale(.9);
  box-shadow: 2px 2px 0 var(--shadow-ink);
}

.press.running { background: var(--mint); color: var(--on-mint); }

.press.done { background: var(--sun); color: var(--on-sun); }

.press-ring {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.press-ring circle { fill: none; stroke-linecap: round; }
.press-ring .bg { stroke: var(--dot-ink); stroke-width: 6; }
.press-ring .fg {
  stroke: var(--ink);
  stroke-width: 6;
  stroke-dasharray: 611.63;
  stroke-dashoffset: 611.63;
  transition: stroke-dashoffset .3s linear;
}

.press-inner {
  display: grid;
  place-items: center;
  gap: 3px;
  line-height: 1.1;
  z-index: 1;
}

.press-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.press-lbl {
  font-family: var(--font-localized);
  font-size: 12px;
  font-weight: 700;
  opacity: .82;
}

.press-meta .who {
  font-family: var(--font-localized);
  font-weight: 800;
  font-size: clamp(20px, 3.4vw, 26px);
  line-height: 1.2;
  margin: 0 0 4px;
}

.press-meta .code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  padding: 1px 7px;
  margin-bottom: 8px;
}

.press-meta .how {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 12px;
  max-width: 44ch;
}

.press-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 620px) {
  .press-actions { justify-content: center; }
}

.btn {
  border: var(--border);
  background: var(--card);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 13px;
  cursor: pointer;
  line-height: 1.2;
  transition: transform .1s ease, box-shadow .1s ease, background .12s ease;
}
.btn:hover { background: var(--dot-ink); transform: translate(-1px, -1px); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }

.btn.ghost { background: transparent; }

/* ── 提示条 ───────────────────────────────────── */
.tip {
  margin-top: 16px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--sun);
  color: var(--on-sun);
  box-shadow: var(--shadow-sm);
  padding: 13px 16px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tip .k {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  padding: 1px 6px;
  flex: none;
  margin-top: 2px;
  opacity: .8;
}

.tip p { margin: 0; }

/* ── 统计条 ───────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat {
  border: var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 13px 15px;
}

.stat dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 4px;
}

.stat dd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.1;
}

.stat .u {
  font-family: var(--font-localized);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0;
  margin-left: 3px;
}

.stat:nth-child(1) { background: var(--accent); color: var(--on-accent); }
.stat:nth-child(1) dt, .stat:nth-child(1) .u { color: var(--on-accent); opacity: .75; }
.stat:nth-child(2) { background: var(--mint); color: var(--on-mint); }
.stat:nth-child(2) dt, .stat:nth-child(2) .u { color: var(--on-mint); opacity: .8; }
.stat:nth-child(3) { background: var(--sky); color: var(--on-sky); }
.stat:nth-child(3) dt, .stat:nth-child(3) .u { color: var(--on-sky); opacity: .8; }
.stat:nth-child(4) { background: var(--sun); color: var(--on-sun); }
.stat:nth-child(4) dt, .stat:nth-child(4) .u { color: var(--on-sun); opacity: .8; }

/* ── 穴位详情 ─────────────────────────────────── */
.detail[hidden] { display: none; }

.detail {
  margin-top: 16px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 15px 17px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.detail .big-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  border: var(--border);
  border-radius: 8px;
  padding: 5px 9px;
  background: var(--sun);
  color: var(--on-sun);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  flex: none;
  white-space: nowrap;
}

.detail h3 {
  font-family: var(--font-localized);
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 5px;
  line-height: 1.2;
}

.detail .row {
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 3px;
}

.detail .row .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-right: 6px;
}

.detail .close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  flex: none;
}
.detail .close:hover { color: var(--accent); }

/* ── 页脚 ─────────────────────────────────────── */
.foot {
  margin-top: 44px;
  border-top: 2px dashed var(--ink);
  padding-top: 22px;
  font-size: 13px;
  color: var(--ink-2);
}

.foot h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 8px;
  letter-spacing: -.01em;
}

.foot p { margin: 0 0 9px; max-width: 62ch; }

.foot .disclaimer {
  border: var(--border);
  border-radius: 12px;
  background: var(--rose);
  color: var(--on-rose);
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  margin-bottom: 16px;
}

.foot .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

/* ── 飞字 ─────────────────────────────────────── */
.floaty {
  position: fixed;
  z-index: 99;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
  pointer-events: none;
  animation: floatUp .75s cubic-bezier(.22, 1, .36, 1) forwards;
  text-shadow: 2px 2px 0 var(--card);
}

@keyframes floatUp {
  0%   { transform: translate(-50%, 0) scale(.7); opacity: 0; }
  22%  { transform: translate(-50%, -14px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -62px) scale(1); opacity: 0; }
}

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

/* ============================================================
   多端适配
   断点：1080 宽屏 · 900 常规桌面 · 780 平板/手机横屏 · 620 手机 · 400 小屏
   横屏手机另用 max-height 处理（横向宽、纵向矮，竖屏断点会失效）
   ============================================================ */

/* ── 基础：iOS 安全区 + 禁止横屏字号自动膨胀 ─────────── */
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

.page {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.topbar {
  padding-top: calc(22px + env(safe-area-inset-top));
}

/* ── 人体图：任何屏都不许长到把按压按钮顶出屏幕 ───────── */
.map svg {
  max-height: 62vh;
  max-height: 62svh;      /* 小屏浏览器动态地址栏收起来时更准 */
}

/* ── 触摸设备：放大点选区，去掉双击延迟 ───────────────── */
@media (pointer: coarse) {
  .pt .hit { r: 30; }

  .btn,
  .seg button,
  .theme-toggle {
    min-height: 44px;
  }

  .seg button { padding: 10px 14px; }

  .symptom,
  .point-row,
  .btn,
  .seg button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── hover 效果只在真鼠标下生效（否则手机上会「粘住」） ── */
@media (hover: none) {
  .symptom:hover,
  .btn:hover,
  .theme-toggle:hover,
  .seg button:hover:not([aria-pressed='true']) {
    transform: none;
    box-shadow: var(--shadow-sm);
    background: var(--card);
  }

  .btn:hover { box-shadow: 2px 2px 0 var(--shadow-ink); }
  .seg button:hover:not([aria-pressed='true']) { background: transparent; }

  .pt:hover .core { r: 4; opacity: .5; fill: var(--card); }
  .pt.active:hover .core { r: 9; fill: var(--accent); }
  .pt.sel:hover .core { r: 11; fill: var(--sun); }
}

/* ── ≤900：桌面窄一点，按压台收紧 ────────────────────── */
@media (max-width: 900px) {
  .page { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hero { padding: 22px 22px 24px; }
  .workbench { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); }
  .press { width: 148px; height: 148px; }
  .press-num { font-size: 40px; }
}

/* ── ≤780：平板竖屏 / 手机横屏 —— 两栏改单栏 ───────────── */
@media (max-width: 780px) {
  .workbench { grid-template-columns: 1fr; }
  .map svg { max-height: 54vh; max-height: 54svh; }
}

/* ── ≤620：手机竖屏 ─────────────────────────────────── */
@media (max-width: 620px) {
  .page { padding-left: max(16px, env(safe-area-inset-left));
          padding-right: max(16px, env(safe-area-inset-right)); }

  .hero { padding: 20px 18px 22px; border-radius: 12px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 40px); }
  .hero-sub { font-size: 14px; }
  .hero-figure { font-size: clamp(40px, 13vw, 56px); margin-top: 14px; }

  .section { margin-top: 32px; }
  .section h2 { font-size: 22px; }
  .section-sub { display: none; }         /* 手机上省一行的呼吸位 */

  .symptom-grid { gap: 9px; }
  .symptom { padding: 11px 12px 10px; border-radius: 12px; }
  .symptom .name { font-size: 16px; }
  .symptom .tag { font-size: 9px; }

  .card { padding: 14px; }
  .point-row { padding: 11px 12px; }
  .point-name { font-size: 17px; }
  .point-meta { font-size: 13.5px; line-height: 1.62; }  /* 正文别太小 */

  .press-card { padding: 20px 16px; text-align: center; }
  .press { width: min(168px, 58vw); height: min(168px, 58vw); }
  .press-meta .how { font-size: 13.5px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 11px 13px; }
  .stat dd { font-size: 26px; }

  .tip { padding: 12px 14px; font-size: 13.5px; }
  .detail { padding: 13px 14px; flex-wrap: wrap; gap: 10px; }
  .detail h3 { font-size: 18px; }

  .foot { margin-top: 36px; font-size: 13px; }
}

/* ── ≤400：小屏兜底（iPhone SE 一代 / 老安卓） ───────── */
@media (max-width: 400px) {
  .hero h1 { font-size: 26px; }
  .hero h1 .hl { padding: 0 4px; }
  .symptom-grid { grid-template-columns: 1fr; }   /* 单列，名字不挤 */
  .press-actions { gap: 6px; }
  .seg button { padding: 9px 10px; font-size: 11.5px; }
  .plan-head { padding: 13px 14px; gap: 10px; }
  .plan-head .badge { font-size: 19px; padding: 4px 9px; }
  .progress { display: none; }                     /* 单列时进度圆点太占地方 */
}

/* ── 横屏手机：宽但矮，强制单栏并压扁人体图 ─────────── */
@media (max-height: 560px) and (orientation: landscape) {
  .workbench { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
  .map svg { max-height: 72vh; max-height: 72svh; }
  .hero { padding: 16px 20px; }
  .hero-figure { font-size: 40px; margin-top: 10px; }
  .section { margin-top: 24px; }
  .press-card { grid-template-columns: auto minmax(0, 1fr); text-align: left; }
  .press { width: 112px; height: 112px; }
  .press-num { font-size: 30px; }
  .press-actions { justify-content: flex-start; }
}

/* ── 超宽屏：别让一行文字太长到不好读 ────────────────── */
@media (min-width: 1400px) {
  .page { max-width: 1000px; }
}

/* ── 打印：留一份能贴在工位上的纸版 ──────────────────── */
@media print {
  body { background: #fff; }
  .topbar, .theme-toggle, .press-card, .map-bar, .symptom-grid,
  .foot .meta, .detail .close, .btn { display: none !important; }
  .card, .hero, .plan-head, .point-row { box-shadow: none; }
  .point-row { break-inside: avoid; }
  .workbench { grid-template-columns: 1fr; }
}

