/* 布局：单栏长页（最宽 1120px）。首屏左文右「体脂刻度尺」，其后每节都是「标题 + 内容」。
   视觉：体测报告单 + 训练日志。冷灰纸面，杠铃片蓝做主色，荧光笔黄只用来标出「薄肌区间」和重点。
   字体：中文用系统黑体（国内网络也能秒开），数字用 Barlow Condensed 窄体，像体测单和杠铃片上的读数。 */
:root {
  --paper: #EEF1F5;
  --surface: #FFFFFF;
  --sunken: #E2E6ED;
  --ink: #131720;
  --muted: #566074;
  --line: #D3D9E3;
  --accent: #2346D6;
  --accent-soft: #DCE3FC;
  --on-accent: #FFFFFF;
  --hi: #F7C600;
  --hi-soft: #FFF1B3;
  --on-hi: #1D1800;
  --good: #1B7D52;
  --bad: #BF3428;
  --z-low: #C4CCD9;
  --z-lean: #9DB0F2;
  --z-normal: #D2D8E2;
  --z-high: #F0C392;
  --z-obese: #E9A096;

  --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-num: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;

  --radius: 6px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1015;
    --surface: #151A23;
    --sunken: #1D232F;
    --ink: #E6E9EF;
    --muted: #98A1B3;
    --line: #2A3242;
    --accent: #8098FF;
    --accent-soft: #1F2A55;
    --on-accent: #0D1015;
    --hi: #F2C230;
    --hi-soft: #3A3112;
    --on-hi: #1D1800;
    --good: #4DC28B;
    --bad: #EF7466;
    --z-low: #3A4252;
    --z-lean: #3E519E;
    --z-normal: #2C3441;
    --z-high: #6E4C26;
    --z-obese: #73322C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1015;
  --surface: #151A23;
  --sunken: #1D232F;
  --ink: #E6E9EF;
  --muted: #98A1B3;
  --line: #2A3242;
  --accent: #8098FF;
  --accent-soft: #1F2A55;
  --on-accent: #0D1015;
  --hi: #F2C230;
  --hi-soft: #3A3112;
  --on-hi: #1D1800;
  --good: #4DC28B;
  --bad: #EF7466;
  --z-low: #3A4252;
  --z-lean: #3E519E;
  --z-normal: #2C3441;
  --z-high: #6E4C26;
  --z-obese: #73322C;
  color-scheme: dark;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-zh);
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
button { font: inherit; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.n { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.12em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border-radius: 4px; border: 1px solid transparent;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.btn.danger { border-color: var(--bad); color: var(--bad); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 24px; min-height: 56px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
  font-weight: 800; font-size: 17px; letter-spacing: .04em; white-space: nowrap;
}
.brand svg { width: 26px; height: 26px; fill: var(--accent); flex: none; }
.topnav {
  display: flex; gap: 2px; margin-left: auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--muted); text-decoration: none; white-space: nowrap;
  font-size: 14px; padding: 6px 10px; border-radius: 4px;
}
.topnav a:hover { color: var(--ink); background: var(--sunken); }
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; gap: 0; padding-block: 8px 4px; min-height: 0; }
  .topnav { margin-left: -10px; width: calc(100% + 10px); }
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px; align-items: center;
  padding-block: 64px 48px;
}
.eyebrow { font-size: 14px; color: var(--muted); letter-spacing: .04em; margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(44px, 7vw, 84px); font-weight: 900;
  line-height: 1.08; letter-spacing: -.01em;
}
.hero h1 em {
  font-style: normal;
  text-decoration: underline; text-decoration-color: var(--hi);
  text-decoration-thickness: .16em; text-underline-offset: .1em;
  text-decoration-skip-ink: none;
}
.lead { margin-top: 24px; font-size: 18px; color: var(--muted); max-width: 32em; }
.lead strong { color: var(--ink); }
.formula {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 24px; font-weight: 800; font-size: 17px;
}
.formula span { padding: 4px 12px; border: 1.5px solid var(--ink); border-radius: 4px; }
.formula span.mark { background: var(--hi); border-color: var(--hi); color: var(--on-hi); }
.formula i { font-style: normal; font-family: var(--font-num); font-size: 24px; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 40px 32px; }
}

/* 体脂刻度尺 */
.ruler-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; scroll-margin-top: 80px;
}
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-title { font-size: 15px; font-weight: 800; letter-spacing: .08em; }
.seg-toggle { display: inline-flex; background: var(--sunken); border-radius: 5px; padding: 3px; }
.seg-toggle button,
.seg-toggle label span {
  display: inline-block; border: 0; background: transparent; color: var(--muted);
  font-size: 14px; padding: 4px 16px; border-radius: 3px; cursor: pointer;
}
.seg-toggle button[aria-pressed="true"],
.seg-toggle input:checked + span {
  background: var(--surface); color: var(--ink); font-weight: 700;
  box-shadow: 0 1px 2px rgb(0 0 0 / .14);
}
.seg-toggle label { position: relative; }
.seg-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.rc-read { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.rc-value {
  font-family: var(--font-num); font-weight: 700; font-size: 76px; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.rc-value small { font-size: .42em; margin-left: 2px; color: var(--muted); font-weight: 600; }
.zone-chip {
  display: inline-block; font-size: 14px; font-weight: 800;
  padding: 2px 10px; border-radius: 4px;
  background: var(--sunken); color: var(--ink);
}
.zone-chip.is-target { background: var(--hi); color: var(--on-hi); }
.rc-desc { margin-top: 8px; color: var(--muted); min-height: 3.4em; }

.ruler { position: relative; margin-top: 18px; }
.ruler-track { display: flex; height: 36px; border-radius: 4px; overflow: hidden; }
.ruler-seg { flex: 1 1 0; height: 100%; }
.ruler-seg + .ruler-seg { border-left: 2px solid var(--surface); }
.z-low { background: var(--z-low); }
.z-lean { background: var(--z-lean); }
.z-target { background: var(--hi); }
.z-normal { background: var(--z-normal); }
.z-high { background: var(--z-high); }
.z-obese { background: var(--z-obese); }

.ruler input[type="range"] {
  position: absolute; left: 0; top: -6px; width: 100%; height: 48px; margin: 0;
  background: transparent; cursor: ew-resize;
  -webkit-appearance: none; appearance: none;
}
.ruler input[type="range"]::-webkit-slider-runnable-track { height: 48px; background: transparent; }
.ruler input[type="range"]::-moz-range-track { height: 48px; background: transparent; }
.ruler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 8px; height: 48px; border-radius: 3px;
  background: var(--ink); border: 2px solid var(--surface);
}
.ruler input[type="range"]::-moz-range-thumb {
  width: 8px; height: 48px; border-radius: 3px;
  background: var(--ink); border: 2px solid var(--surface);
}
.ruler input[type="range"]:focus-visible { outline: none; }
.ruler input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.ruler input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--accent); }

.ruler-labels { display: flex; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.ruler-labels span { flex: 1 1 0; display: flex; justify-content: center; white-space: nowrap; min-width: 0; }
.ruler-labels span.is-target { color: var(--ink); font-weight: 800; }
.ruler-ticks {
  position: relative; height: 20px; margin-top: 4px;
  font-family: var(--font-num); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted);
}
.ruler-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.ruler-ticks span.edge-l { transform: none; }
.ruler-ticks span.edge-r { transform: translateX(-100%); }
.rc-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 14px; font-weight: 700;
}
.swatch-hi { width: 14px; height: 14px; border-radius: 2px; background: var(--hi); flex: none; }
.rc-hint { font-weight: 400; color: var(--muted); margin-left: auto; font-size: 13px; }

/* ---------- 五条底线 ---------- */
.basics { padding-block: 24px 16px; }
.basics h2 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.pillars {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line);
}
.pillars li { padding: 18px 18px 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.pillars li + li { border-left: 1px solid var(--line); }
.pillars li:first-child { padding-left: 0; }
.p-num {
  font-family: var(--font-num); font-weight: 700; font-size: 40px; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.p-num small { font-family: var(--font-zh); font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.pillars b { font-size: 16px; }
.pillars p { font-size: 14px; color: var(--muted); line-height: 1.6; }
@media (max-width: 960px) {
  .pillars { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pillars li { grid-column: span 2; padding-left: 18px; }
  .pillars li:nth-child(4), .pillars li:nth-child(5) { grid-column: span 3; border-top: 1px solid var(--line); }
  .pillars li:nth-child(4) { border-left: 0; padding-left: 0; }
}
@media (max-width: 600px) {
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillars li, .pillars li:nth-child(4), .pillars li:nth-child(5) {
    grid-column: auto; padding: 14px 0; border-left: 0;
    grid-template-columns: 9.5em minmax(0, 1fr); column-gap: 14px;
  }
  .pillars li + li { border-top: 1px solid var(--line); }
  .pillars .p-num { grid-row: span 2; font-size: 30px; }
}

/* ---------- 通用节 ---------- */
.section { padding-block: 72px 16px; scroll-margin-top: 64px; }
.sec-head { max-width: 46em; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; letter-spacing: -.005em; }
.sec-head p { margin-top: 12px; color: var(--muted); font-size: 17px; }
.sec-head p b { color: var(--ink); }
.sub-h { font-size: 20px; font-weight: 800; margin-top: 48px; }
.sub-p { margin-top: 6px; color: var(--muted); font-size: 15px; }
@media (max-width: 720px) { .section { padding-block: 56px 8px; } }

/* ---------- 人群方案 ---------- */
.picker { display: grid; gap: 12px; margin-bottom: 20px; }
.picker-row { display: flex; align-items: flex-start; gap: 14px; }
.picker-label { flex: none; width: 4em; padding-top: 12px; font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 14px 8px; border-radius: 4px; cursor: pointer; line-height: 1.35;
  transition: border-color .15s, background .15s;
}
.chip b { font-size: 15px; }
.chip small { font-size: 12px; color: var(--muted); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .85; }
.chip.is-suggest:not([aria-pressed="true"]) { border-color: var(--hi); box-shadow: inset 0 -3px 0 var(--hi); }
@media (max-width: 600px) {
  .picker-row { flex-direction: column; gap: 6px; }
  .picker-label { padding-top: 0; }
}

.gpanel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; display: grid; gap: 32px;
}
.gp-kind { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .06em; margin-bottom: 6px; }
.gp-head h3 { font-size: 32px; font-weight: 900; }
.gp-head h3 span { display: inline-block; font-size: 17px; font-weight: 500; color: var(--muted); margin-left: 12px; }
.gpanel h4 { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px; }
.gp-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.gp-top > div { min-width: 0; }
.signs { display: grid; gap: 6px; margin-bottom: 24px; }
.signs li { position: relative; padding-left: 18px; }
.signs li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 7px; height: 7px; background: var(--ink); border-radius: 1px; }
.idea { font-size: 18px; font-weight: 700; line-height: 1.7; }
.specs { border-top: 3px solid var(--ink); }
.specs > div {
  display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.specs dt { font-size: 14px; color: var(--muted); }
.specs dd { font-weight: 700; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week li {
  min-height: 78px; padding: 10px; border-radius: 4px;
  display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; line-height: 1.35;
}
.week li span { font-size: 12px; font-weight: 500; opacity: .8; }
.week .d-s { background: var(--accent); color: var(--on-accent); }
.week .d-c { background: var(--hi-soft); color: var(--ink); }
.week .d-r { border: 1px dashed var(--line); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend .l-s { background: var(--accent); }
.legend .l-c { background: var(--hi-soft); border: 1px solid var(--hi); }
.legend .l-r { border: 1px dashed var(--muted); }

.gp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.gp-cols > div { min-width: 0; }
.tips li, .traps li { position: relative; padding: 10px 0 10px 28px; border-top: 1px solid var(--line); }
.tips li::before, .traps li::before { position: absolute; left: 2px; top: 10px; font-weight: 900; }
.tips li::before { content: "✓"; color: var(--good); }
.traps li::before { content: "✕"; color: var(--bad); }
.gp-note { background: var(--hi-soft); color: var(--ink); padding: 12px 16px; border-radius: 4px; font-size: 15px; }
.gp-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.gp-foot > div { min-width: 0; }
.move-links { display: flex; flex-wrap: wrap; gap: 8px; }
.move-links a {
  font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
  padding: 5px 12px; border-radius: 4px; background: var(--sunken);
}
.move-links a:hover { background: var(--accent-soft); color: var(--accent); }
.expect { font-size: 17px; font-weight: 700; }

@media (max-width: 860px) {
  .gpanel { padding: 22px 18px; gap: 26px; }
  .gp-top, .gp-cols, .gp-foot { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .gp-head h3 span { display: block; margin: 4px 0 0; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 计算器 ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.calc-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.sample-tag {
  grid-column: 1 / -1; justify-self: start;
  font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 4px;
  background: var(--hi-soft); color: var(--ink);
}
.field { display: grid; gap: 6px; align-content: start; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.full, .check.full { grid-column: 1 / -1; }
.field > label, .field > legend { font-size: 14px; font-weight: 700; padding: 0; }
.seg-field legend { margin-bottom: 6px; }
.opt { font-weight: 500; font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.unit-input {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
}
.unit-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unit-input input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); outline: none;
  font-family: var(--font-num); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 6px 10px;
}
.unit-input input::placeholder { font-family: var(--font-zh); font-size: 14px; font-weight: 400; color: var(--muted); }
.unit-input span { padding-right: 12px; font-size: 14px; color: var(--muted); }
.calc-form select {
  width: 100%; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink);
  font: inherit; font-size: 15px;
}
.calc-form select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.calc-out {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: sticky; top: 76px;
}
.out-type { background: var(--accent); color: var(--on-accent); padding: 22px 24px; display: grid; gap: 12px; }
.out-type .ot-label { font-size: 13px; font-weight: 700; opacity: .85; letter-spacing: .06em; }
.ot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ot-name { font-size: 34px; font-weight: 900; line-height: 1.1; }
.ot-name small { font-size: 15px; font-weight: 500; opacity: .85; margin-left: 8px; }
.out-type .btn { background: var(--on-accent); color: var(--accent); min-height: 38px; font-size: 15px; }
.ot-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.ot-extra button {
  border: 1px solid currentColor; background: transparent; color: inherit;
  border-radius: 4px; padding: 2px 10px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.ot-extra button:hover { background: var(--on-accent); color: var(--accent); }
.out-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric { padding: 18px 24px; display: grid; gap: 4px; align-content: start; border-bottom: 1px solid var(--line); min-width: 0; }
.metric:nth-child(odd) { border-right: 1px solid var(--line); }
.metric.wide { grid-column: 1 / -1; border-right: 0; }
.m-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.m-val { font-family: var(--font-num); font-weight: 700; font-size: 40px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.m-val small { font-size: .45em; font-weight: 600; color: var(--muted); margin-left: 3px; }
.m-sub { font-size: 14px; color: var(--muted); }
.m-sub .zone-chip { font-size: 12px; padding: 1px 8px; margin-right: 6px; }
.out-note { padding: 14px 24px 18px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.out-error { padding: 28px 24px; display: grid; gap: 8px; }
.out-error b { font-size: 18px; color: var(--bad); }
.out-error p { color: var(--muted); }

@media (max-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-out { position: static; }
}
@media (max-width: 420px) {
  .calc-form { padding: 18px 16px; gap: 14px 12px; }
  .metric { padding: 14px 16px; }
  .m-val { font-size: 32px; }
  .out-type { padding: 18px 16px; }
  .out-note { padding-inline: 16px; }
}

/* ---------- 动作库 ---------- */
.rules {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border-top: 3px solid var(--ink); margin-bottom: 32px;
}
.rules li { padding: 14px 18px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.rules li:first-child { padding-left: 0; }
.rules li + li { border-left: 1px solid var(--line); }
.rules b { font-size: 16px; }
.rules span { font-size: 14px; color: var(--muted); line-height: 1.6; }
@media (max-width: 860px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules li:nth-child(3) { border-left: 0; padding-left: 0; }
  .rules li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .rules { grid-template-columns: minmax(0, 1fr); }
  .rules li, .rules li + li { padding-left: 0; border-left: 0; }
  .rules li + li { border-top: 1px solid var(--line); }
}

.ex-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ex-filter button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 5px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.ex-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.ex-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 90px; min-width: 0;
}
.ex-card.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 45% { box-shadow: 0 0 0 4px var(--hi); } 100% { box-shadow: 0 0 0 4px transparent; } }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ex-head h3 { font-size: 21px; font-weight: 900; }
.ex-part { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); padding: 0 8px; border-radius: 3px; }
.ex-muscles { font-size: 14px; color: var(--muted); margin-top: -8px; }
.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ladder li { padding: 8px 9px; border-radius: 3px; font-size: 13px; font-weight: 700; line-height: 1.35; display: grid; gap: 2px; align-content: start; }
.ladder li span { font-size: 11px; font-weight: 600; opacity: .75; letter-spacing: .06em; }
.ladder li:nth-child(1) { background: var(--sunken); color: var(--ink); }
.ladder li:nth-child(2) { background: var(--accent-soft); color: var(--ink); }
.ladder li:nth-child(3) { background: var(--accent); color: var(--on-accent); }
.cues { display: grid; gap: 4px; font-size: 14px; }
.cues li { position: relative; padding-left: 16px; }
.cues li::before { content: ""; position: absolute; left: 1px; top: .72em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }
.ex-err { font-size: 14px; color: var(--muted); }
.ex-err b { color: var(--bad); }
.ex-dose {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 14px; font-weight: 700;
}

.templates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.tpl { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tpl caption {
  caption-side: top; text-align: left; font-weight: 900; font-size: 15px;
  padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: var(--radius) var(--radius) 0 0;
}
.tpl th, .tpl td { padding: 8px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.tpl tr:first-child th, .tpl tr:first-child td { border-top: 0; }
.tpl th { font-weight: 600; }
.tpl td { font-family: var(--font-num); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.tpl-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
@media (max-width: 960px) { .templates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .templates { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 饮食 ---------- */
.hands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 16px; border-top: 3px solid var(--ink); }
.hands li { padding: 16px 18px 18px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.hands li:first-child { padding-left: 0; }
.hands li + li { border-left: 1px solid var(--line); }
.h-amt { font-family: var(--font-num); font-weight: 700; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.h-amt small { font-family: var(--font-zh); font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.hands b { font-size: 16px; margin-top: 4px; }
.hands p { font-size: 14px; color: var(--muted); line-height: 1.6; }
@media (max-width: 860px) {
  .hands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hands li:nth-child(3) { border-left: 0; padding-left: 0; }
  .hands li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

.pb { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; align-items: start; }
.pb-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.pb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.pb-row:nth-child(odd) { border-right: 1px solid var(--line); }
.pb-row.has { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.pb-food { display: grid; min-width: 0; line-height: 1.35; }
.pb-food b { font-size: 15px; }
.pb-food span { font-size: 12px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.stepper button {
  width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.stepper button:hover { background: var(--sunken); }
.stepper button:disabled { color: var(--line); cursor: default; background: transparent; }
.stepper output { min-width: 26px; text-align: center; font-family: var(--font-num); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.pb-sum {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: grid; gap: 12px; position: sticky; top: 76px;
}
.pb-big { font-family: var(--font-num); font-weight: 700; font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; }
.pb-big small { font-size: .4em; color: var(--muted); font-weight: 600; margin-left: 4px; }
.pb-bar { height: 12px; background: var(--sunken); border-radius: 3px; overflow: hidden; position: relative; }
.pb-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; transition: width .25s; }
.pb-bar.done i { background: var(--good); }
.pb-msg { font-weight: 700; }
.pb-msg.ok { color: var(--good); }
.pb-tip { font-size: 13px; color: var(--muted); }
.pb-clear { justify-self: start; }
@media (max-width: 860px) {
  .pb { grid-template-columns: minmax(0, 1fr); }
  .pb-sum { position: static; order: -1; }
}
@media (max-width: 560px) {
  .pb-list { grid-template-columns: minmax(0, 1fr); }
  .pb-row:nth-child(odd) { border-right: 0; }
}

.menus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.menu header { padding-bottom: 12px; border-bottom: 3px solid var(--ink); }
.menu h4 { font-size: 20px; font-weight: 900; }
.menu header p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.menu dl > div { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.menu dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.menu dt { font-weight: 800; font-size: 14px; }
.menu dd { font-size: 15px; }
.menu dd.g { font-family: var(--font-num); font-weight: 700; font-size: 16px; white-space: nowrap; color: var(--accent); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .menus { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 12 周 ---------- */
.roadmap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: none; }
.roadmap li { padding: 0 20px 4px; display: grid; gap: 6px; align-content: start; position: relative; min-width: 0; }
.roadmap li:first-child { padding-left: 0; }
.roadmap li + li { border-left: 1px solid var(--line); }
.rm-wk {
  font-family: var(--font-num); font-weight: 700; font-size: 15px; letter-spacing: .02em;
  display: block; padding-top: 12px; border-top: 6px solid var(--accent);
}
.roadmap li:nth-child(1) .rm-wk { border-top-color: var(--accent-soft); }
.roadmap li:nth-child(2) .rm-wk { border-top-color: color-mix(in srgb, var(--accent) 55%, var(--accent-soft)); }
.roadmap li:nth-child(4) .rm-wk { border-top-color: var(--hi); }
.roadmap b { font-size: 22px; font-weight: 900; }
.roadmap p { font-size: 15px; }
.rm-feel { font-size: 14px; color: var(--muted); padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; }
@media (max-width: 860px) {
  .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .roadmap li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  .roadmap { grid-template-columns: minmax(0, 1fr); }
  .roadmap li, .roadmap li + li { padding-left: 0; padding-right: 0; border-left: 0; }
}

.tracker { margin-top: 24px; }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 48px; }
.tr-head .sub-h { margin-top: 0; }
.tr-progress { display: flex; align-items: center; gap: 10px; font-family: var(--font-num); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.tr-bar { width: 140px; height: 10px; background: var(--sunken); border-radius: 3px; overflow: hidden; display: inline-block; }
.tr-bar i { display: block; height: 100%; width: 0; background: var(--good); transition: width .25s; }
.tr-head .btn { margin-left: auto; }
.tr-scroll { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tr-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.tr-table th, .tr-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.tr-table thead th { font-size: 13px; color: var(--muted); font-weight: 700; background: var(--sunken); }
.tr-table tbody th { text-align: left; white-space: nowrap; font-weight: 700; }
.tr-table tbody th small { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: 12px; }
.tr-table tbody tr:last-child th, .tr-table tbody tr:last-child td { border-bottom: 0; }
.tr-table tr.phase-start th, .tr-table tr.phase-start td { border-top: 2px solid var(--ink); }
.tr-table tbody tr:first-child th, .tr-table tbody tr:first-child td { border-top: 0; }
.tr-table tr.all-done th { color: var(--good); }
.tr-table input { width: 20px; height: 20px; accent-color: var(--good); cursor: pointer; }

/* ---------- 误区 ---------- */
.faq { max-width: 52em; border-top: 3px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 40px 16px 0; position: relative;
  font-size: 17px; font-weight: 800;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 12px;
  font-family: var(--font-num); font-size: 26px; font-weight: 600; color: var(--muted);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; color: var(--muted); max-width: 44em; }

/* ---------- 页脚 ---------- */
.footer { margin-top: 80px; border-top: 1px solid var(--line); padding-block: 28px 40px; }
.footer-in { display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.footer-in b { color: var(--ink); }
.refs { font-size: 13px; }
