/* ============ 主题变量 ============ */
:root {
  --bg: #f4f5f7;
  --topbar-bg: rgba(244, 245, 247, .82);
  --card: #ffffff;
  --card-2: #fafbfc;
  --text: #17181c;
  --text-2: #6b7280;
  --text-3: #a0a6b0;
  --line: #e8eaed;
  --brand: #0f9d58;
  --brand-ink: #ffffff;
  --brand-soft: #e7f5ed;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --macro-pro: #3b82f6;
  --macro-carb: #f59e0b;
  --macro-fat: #ec4899;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabh: 54px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --topbar-bg: rgba(14, 16, 19, .82);
    --card: #181b21;
    --card-2: #1e222a;
    --text: #f1f2f4;
    --text-2: #9aa1ac;
    --text-3: #6b7280;
    --line: #262a32;
    --brand: #22c55e;
    --brand-ink: #06210f;
    --brand-soft: #12301d;
    --danger: #f87171;
    --danger-soft: #2c1618;
    --macro-pro: #60a5fa;
    --macro-carb: #fbbf24;
    --macro-fat: #f472b6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

/* ============ 基础 ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; min-height: 100dvh; }

h1, h2, h3, p { margin: 0; }
button { font-family: inherit; font-size: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font-family: inherit; }

.num { font-variant-numeric: tabular-nums; }

/* ============ 布局 ============ */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-t) + 12px) 20px 10px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
.topbar-sub { font-size: 13px; color: var(--text-3); margin-top: 1px; min-height: 19px; }

#main { flex: 1; }

.wrap {
  padding: 4px 16px calc(var(--tabh) + var(--safe-b) + 28px);
  max-width: 620px;
  margin: 0 auto;
}

.page { display: none; }
.page.is-active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-title:last-child { margin-bottom: 0; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.row-between .card-title { margin-bottom: 0; }

.mini-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--brand-soft);
}
.mini-btn.primary { background: var(--brand); color: var(--brand-ink); }
.mini-btn:active { opacity: .6; }

/* ============ 热量环 ============ */
.ring-card { display: flex; align-items: center; gap: 20px; }
.ring-card.compact { padding: 14px 16px; }

.ring-wrap { position: relative; flex: none; width: 120px; height: 120px; }
.ring-wrap.small { width: 86px; height: 86px; }

.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.ring-fg {
  fill: none;
  stroke: var(--brand);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .55s cubic-bezier(.4, 0, .2, 1), stroke .3s;
}
.ring-fg.over { stroke: var(--danger); }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-num { font-size: 30px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ring-num.small { font-size: 21px; }
.ring-unit { font-size: 11px; color: var(--text-3); margin-top: -3px; }

.ring-info { flex: 1; min-width: 0; }
.ring-goal { font-size: 14px; color: var(--text-2); }
.ring-goal b { color: var(--text); font-weight: 600; }
.ring-left { font-size: 13px; color: var(--text-3); margin-top: 3px; }

/* ============ 营养条 ============ */
.macros { display: flex; flex-direction: column; gap: 11px; }

.macro-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.macro-name { color: var(--text-2); }
.macro-val { color: var(--text-3); font-variant-numeric: tabular-nums; }
.macro-val b { color: var(--text); font-weight: 600; }

.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.bar.pro > i { background: var(--macro-pro); }
.bar.carb > i { background: var(--macro-carb); }
.bar.fat > i { background: var(--macro-fat); }

/* ============ 列表条目 ============ */
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.item-right { font-size: 14px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.item-del { color: var(--text-3); font-size: 18px; padding: 4px 2px 4px 10px; flex: none; }

.empty { font-size: 13.5px; color: var(--text-3); padding: 6px 0 2px; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  vertical-align: 1px;
}
.tag.grey { background: var(--line); color: var(--text-2); }

/* ============ 统计行 ============ */
.stat-row { display: flex; gap: 10px; margin-bottom: 12px; }
.stat-box { flex: 1; background: var(--card); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow); }
.stat-num { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* ============ 大按钮 ============ */
.btn-row { display: flex; gap: 10px; margin-bottom: 12px; }
.btn-row.col { flex-direction: column; margin-bottom: 0; }

.big-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 10px;
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 600;
}
.big-btn-ico { font-size: 24px; line-height: 1.2; }
.big-btn small { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.big-btn:active { transform: scale(.975); background: var(--card-2); }

.wide-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.wide-btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.wide-btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.wide-btn:active { opacity: .7; }

/* ============ 日期切换 ============ */
.date-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.date-nav-label { font-size: 15px; font-weight: 600; }
.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 19px;
  line-height: 1;
  color: var(--text-2);
}
.nav-btn:disabled { opacity: .35; }
.nav-btn:active:not(:disabled) { background: var(--card-2); }

/* ============ 表单 ============ */
.field-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.field-row:first-of-type { border-top: 0; }
.field-row label { flex: 1; font-size: 15px; color: var(--text-2); }
.field-row input {
  width: 96px;
  padding: 9px 11px;
  font-size: 16px; /* 小于 16px 时 iOS 会自动放大页面 */
  text-align: right;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
.field-row input:focus { border-color: var(--brand); }

.muted-line { font-size: 13px; color: var(--text-3); margin-top: 8px; }

/* ============ 图表 ============ */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; padding-top: 18px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
  width: 70%;
  max-width: 34px;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: var(--brand);
  opacity: .85;
  transition: height .5s cubic-bezier(.4, 0, .2, 1);
}
.chart-bar.today { opacity: 1; box-shadow: 0 0 0 2px var(--brand-soft); }
.chart-bar.zero { background: var(--line); }
.chart-val { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chart-day { font-size: 11px; color: var(--text-3); }

.disclaimer { font-size: 12px; line-height: 1.7; color: var(--text-3); padding: 4px 4px 0; text-align: center; }

/* ============ 底部标签栏 ============ */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  padding-bottom: var(--safe-b);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  height: var(--tabh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
}
.tab svg { width: 23px; height: 23px; }
.tab.is-active { color: var(--brand); }
.tab:active { opacity: .55; }

/* ============ 底部抽屉 ============ */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  transform: translateY(101%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: var(--safe-b);
}
.sheet.show { transform: none; }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.sheet-head h2 { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.sheet-cancel, .sheet-done { font-size: 15px; padding: 6px 4px; flex: none; }
.sheet-cancel { color: var(--text-2); }
.sheet-done { color: var(--brand); font-weight: 600; }
.sheet-done:disabled { color: var(--text-3); opacity: .5; }

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(20px + var(--safe-b));
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
}

/* ============ 抽屉内控件 ============ */
.sec-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin: 16px 2px 8px; }
.sec-label:first-child { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500;
}
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.chip:active { opacity: .65; }

.inp {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}
.inp:focus { border-color: var(--brand); }
.inp-row { display: flex; gap: 10px; align-items: center; }
.inp-row .inp { flex: 1; }
.inp-suffix { font-size: 14px; color: var(--text-3); flex: none; }

.search-list { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; }
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--card);
  border-radius: 12px;
  text-align: left;
}
.search-item.on { box-shadow: inset 0 0 0 2px var(--brand); }
.search-item-main { flex: 1; min-width: 0; }
.search-item-name { font-size: 15px; font-weight: 500; }
.search-item-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.search-item-kcal { font-size: 14px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; flex: none; }

.set-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.set-row .inp { padding: 10px 12px; }
.set-row .set-idx { width: 26px; font-size: 13px; color: var(--text-3); flex: none; text-align: center; }
.set-row .set-del { color: var(--text-3); font-size: 19px; padding: 0 2px; flex: none; }

.add-line { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 11px; border-radius: 12px; border: 1px dashed var(--line); color: var(--brand); font-size: 14.5px; font-weight: 600; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabh) + var(--safe-b) + 24px);
  z-index: 90;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(24, 26, 32, .93);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: 84vw;
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .toast { background: rgba(240, 242, 245, .94); color: #16181c; }
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 热量来源占比 ============ */
.mix-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.mix-bar > i { display: block; height: 100%; transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; font-size: 12px; color: var(--text-2); }
.mix-legend span { display: flex; align-items: center; gap: 5px; }
.mix-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.warn { color: var(--danger); font-weight: 600; }

/* ============ 训练:动作卡片与组 ============ */
.ex-card { background: var(--card); border-radius: 14px; padding: 13px 14px; margin-top: 12px; }

.ex-head { display: flex; align-items: center; gap: 8px; }
.ex-name { flex: 1; min-width: 0; text-align: left; font-size: 15.5px; font-weight: 600; padding: 2px 0; }
.ex-name:active { opacity: .6; }

.last-hint {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
  background: var(--brand-soft);
  border-radius: 9px;
  padding: 7px 10px;
  margin-top: 10px;
}
.link-btn { color: var(--brand); font-weight: 600; font-size: 12px; text-decoration: underline; padding: 0 3px; }

.set-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.set-row .inp { padding: 10px 12px; text-align: center; min-width: 0; }

.set-type {
  width: 34px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}
.set-type.on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.set-done {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 17px;
  line-height: 1;
}
.set-done.ok { background: var(--brand); color: var(--brand-ink); border-color: transparent; }

.set-del { width: 24px; flex: none; color: var(--text-3); font-size: 19px; }

.set-extra { background: var(--card-2); border-radius: 12px; padding: 11px 12px; margin: -2px 0 10px; }
.set-extra .inp { padding: 9px 11px; background: var(--card); }

.ex-line { font-size: 12.5px; line-height: 2; color: var(--text-2); }
.set-chip {
  display: inline-block;
  background: var(--card-2);
  border-radius: 7px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  font-variant-numeric: tabular-nums;
}
.set-chip em { font-style: normal; font-size: 11px; color: var(--brand); margin-left: 4px; }

.hist-group { margin-top: 2px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ============ 组间休息计时器 ============ */
.rest-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabh) + var(--safe-b) + 12px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(24, 26, 32, .95);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.32, .72, 0, 1), opacity .25s;
}
.rest-bar.show { transform: none; opacity: 1; pointer-events: auto; }
.rest-time { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; min-width: 50px; }
.rest-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.rest-track > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--brand); }
.rest-actions { display: flex; gap: 8px; flex: none; }
.rest-btn { font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: 9px; background: rgba(255, 255, 255, .16); color: inherit; }

@media (prefers-color-scheme: dark) {
  .rest-bar { background: rgba(240, 242, 245, .95); color: #16181c; }
  .rest-track { background: rgba(0, 0, 0, .15); }
  .rest-btn { background: rgba(0, 0, 0, .09); }
  .install-bar { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
}

/* ============ 更新提示 / 安装引导 ============ */
.update-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabh) + var(--safe-b) + 74px);
  z-index: 65;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.update-bar.show { display: flex; }
.update-bar button { font-size: 13.5px; font-weight: 700; padding: 7px 14px; border-radius: 9px; background: rgba(255, 255, 255, .22); color: inherit; }

.install-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabh) + var(--safe-b) + 12px);
  z-index: 70;
  padding: 14px 36px 14px 16px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
}
.install-bar b { color: var(--text); }
.install-close { position: absolute; top: 5px; right: 7px; font-size: 20px; color: var(--text-3); padding: 4px 7px; }

/* ============ iOS 基础修正 ============ */
html { -webkit-text-size-adjust: 100%; }

/* 双击不再触发缩放,点按响应更快 */
button, .chip, .tab, .mini-btn, .set-done, .set-type, .search-item { touch-action: manipulation; }

/* 按钮文字不该被长按选中,输入框要能选 */
button { -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
body { -webkit-touch-callout: none; }

/* 数字输入的上下箭头在手机上只会碍事 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ============ 肌群训练分布 ============ */
.muscle-row { padding: 7px 0; border-top: 1px solid var(--line); }
.muscle-row:first-child { border-top: 0; }
.muscle-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.muscle-name { width: 40px; flex: none; font-weight: 600; }
.muscle-val { flex: 1; color: var(--text-2); font-variant-numeric: tabular-nums; }
.muscle-tag { flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; }
.muscle-tag.none { color: var(--text-3); background: var(--line); }
.muscle-tag.low { color: #b45309; background: #fef3c7; }
.muscle-tag.ok { color: var(--brand); background: var(--brand-soft); }
.muscle-tag.over { color: var(--danger); background: var(--danger-soft); }
.muscle-track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.muscle-track > i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }

/* ============ 训练热力图 ============ */
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 3px;
  justify-content: center;
}
.heat-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--line); }
.heat-cell.fut { background: transparent; }
.heat-cell.lv1 { background: #c8e6d9; }
.heat-cell.lv2 { background: #7fd3a5; }
.heat-cell.lv3 { background: #37b57d; }
.heat-cell.lv4 { background: #0f9d58; }
.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; }
.heat-legend .lv0 { background: var(--line); }
.heat-legend .lv1 { background: #c8e6d9; }
.heat-legend .lv2 { background: #7fd3a5; }
.heat-legend .lv3 { background: #37b57d; }
.heat-legend .lv4 { background: #0f9d58; }

/* ============ 体重趋势 ============ */
.weight-summary { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.weight-summary b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.wsvg { width: 100%; height: auto; display: block; }
.wline { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wsvg circle { fill: var(--brand); }
.wg { stroke: var(--line); stroke-width: 1; }
.wt { fill: var(--text-3); font-size: 10px; }

