/* Layout */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-5);
  }
}

.site-main {
  padding-block: var(--space-5) var(--space-7);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
  color: var(--color-brand);
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-brand);
  color: var(--color-on-brand);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--color-brand);
  background: var(--color-brand-muted);
  text-decoration: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  display: block;
}

.nav-dropdown__menu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
}

.nav-dropdown__menu a:hover {
  background: var(--color-brand-muted);
  color: var(--color-brand);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.mobile-nav {
  display: none;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.mobile-nav.is-open {
  display: block;
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav a {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.mobile-nav a:hover,
.mobile-nav .is-active {
  background: var(--color-brand-muted);
  color: var(--color-brand);
}

.mobile-nav__group {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.mobile-nav__label {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding-block: var(--space-6);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--space-6);
  }
}

.site-footer__title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.site-footer__blurb {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  line-height: 1.6;
}

.site-footer a {
  display: block;
  color: var(--color-text-secondary);
  padding-block: var(--space-1);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-brand);
  text-decoration: underline;
}

.site-footer__copy {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.btn--primary:hover {
  background: var(--color-brand-hover);
  color: var(--color-on-brand);
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn--secondary:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

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

.btn--sm {
  min-height: 36px;
  padding-inline: var(--space-3);
  font-size: var(--text-caption);
}

/* Cards (limited use) */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.card--elevated {
  box-shadow: var(--shadow-sm);
}

/* Hero — 分类导航型，Stripe 风格深蓝渐变 */
.hero-wrap {
  padding-block: var(--space-4) var(--space-6);
}

.hero {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: hidden;
  border-radius: 24px;
  padding: 56px var(--space-5) 72px;
  text-align: center;
  color: #fff;
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(60% 80% at 12% 105%, rgba(59, 104, 252, 0.75) 0%, rgba(59, 104, 252, 0) 62%),
    radial-gradient(55% 75% at 92% 0%, rgba(79, 70, 229, 0.55) 0%, rgba(79, 70, 229, 0) 60%),
    radial-gradient(45% 60% at 70% 110%, rgba(56, 189, 248, 0.28) 0%, rgba(56, 189, 248, 0) 65%),
    linear-gradient(135deg, var(--hero-navy) 0%, var(--hero-indigo) 55%, var(--hero-blue) 120%);
}

@media (min-width: 768px) {
  .hero {
    padding: 88px var(--space-7) 112px;
    border-radius: 32px;
  }
}

/* 装饰层：放射线 + 同心圆环 + 点阵 + 半透明色块 */
.hero__deco {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__deco::before {
  /* 自底部中心向上放射的细线（类似 Stripe 的星芒） */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 150%;
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: repeating-conic-gradient(
    from 270deg at 50% 100%,
    rgba(255, 255, 255, 0.22) 0deg 0.35deg,
    transparent 0.35deg 3deg
  );
  -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 0%, transparent 72%);
}

.hero__deco::after {
  /* 右上角点阵 */
  content: "";
  position: absolute;
  top: 24px;
  right: 24px;
  width: 180px;
  height: 120px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1.2px, transparent 1.4px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(225deg, #000 0%, transparent 75%);
  mask-image: linear-gradient(225deg, #000 0%, transparent 75%);
}

.hero__ring,
.hero__block {
  position: absolute;
}

.hero__ring {
  left: -120px;
  top: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle,
    transparent 0 38px,
    rgba(255, 255, 255, 0.09) 38px 39px
  );
}

.hero__block {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(2px);
}

.hero__block--a {
  right: 7%;
  bottom: 18%;
  width: 96px;
  height: 96px;
  transform: rotate(14deg);
}

.hero__block--b {
  left: 6%;
  bottom: 14%;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  transform: rotate(-12deg);
}

@media (max-width: 767px) {
  .hero__block--a {
    right: -24px;
    bottom: 10%;
  }

  .hero__block--b {
    display: none;
  }

  .hero__deco::after {
    width: 120px;
    height: 80px;
  }
}

.hero__brand {
  margin: 0 auto var(--space-6);
  max-width: 100%;
  white-space: nowrap;
  font-size: clamp(1rem, 4.6vw, 2.5rem);
  font-size: clamp(1rem, 5.2cqi, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  color: #fff;
}

.hero__sub {
  margin: 0 auto var(--space-6);
  max-width: 42rem;
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

.hero__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-5);
  border-radius: 999px;
  background: #fff;
  color: var(--color-brand);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px -6px rgba(5, 12, 50, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.hero__btn:hover {
  background: var(--color-brand-muted);
  color: var(--color-brand-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(5, 12, 50, 0.6);
}

.hero__btn:focus-visible {
  outline-color: #fff;
}

/* 仅窄屏换行：桌面标题保持一行。短语不从字中间断开。 */
.hero__br {
  display: none;
}

.hero__phrase {
  white-space: nowrap;
}

@media (max-width: 767px) {
  .hero {
    padding: 36px 20px 40px;
    border-radius: 20px;
  }

  .hero__br {
    display: block;
  }

  .hero__brand {
    white-space: normal;
    font-size: clamp(1.5rem, 7.4vw, 1.75rem);
    line-height: 1.35;
    margin-bottom: var(--space-5);
  }

  .hero__sub {
    font-size: 0.9375rem;
    line-height: 1.75;
    margin-bottom: var(--space-5);
  }

  .hero__btn {
    min-height: 44px;
    padding-inline: var(--space-4);
  }
}

/* 手机：三个分类按钮一排展示 */
@media (max-width: 640px) {
  .hero__nav {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
  }

  .hero__btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    justify-content: center;
    min-height: 40px;
    padding-inline: 6px;
    gap: 4px;
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
  }

  .hero__btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
}

/* Tool list */
.section-title {
  margin: 0 0 var(--space-4);
  font-size: var(--text-h2);
}

.tool-group {
  margin-bottom: var(--space-6);
  scroll-margin-top: calc(var(--header-h) + var(--space-4));
}

.tool-group .section-title {
  text-align: left;
}

/* 一排三卡：桌面 3 列 / 平板 2 列 / 手机 1 列 */
.tool-list,
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .tool-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tool-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 148px;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tool-item:hover,
.tool-item:focus-visible {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-item.is-disabled {
  opacity: 0.72;
  pointer-events: none;
}

.tool-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.tool-item__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.tool-item:hover .tool-item__icon,
.tool-item:focus-visible .tool-item__icon {
  background: var(--color-brand-muted);
  color: var(--color-brand);
}

.tool-item__arrow {
  color: var(--color-border-strong);
  transition: color 0.2s ease, transform 0.2s ease;
}

.tool-item:hover .tool-item__arrow,
.tool-item:focus-visible .tool-item__arrow {
  color: var(--color-brand);
  transform: translate(2px, -2px);
}

.tool-item__body {
  flex: 1;
  min-width: 0;
}

.tool-item__name {
  margin: 0;
  font-weight: 700;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.tool-item:hover .tool-item__name,
.tool-item:focus-visible .tool-item__name {
  color: var(--color-brand);
}

.tool-item__summary {
  margin: var(--space-1) 0 0;
  font-size: var(--text-caption);
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.tool-item__cta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.badge {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Disclaimer */
.disclaimer {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
}

.disclaimer--finance {
  border-color: #f0d9a8;
  background: #fffbf2;
}

.disclaimer--health {
  border-color: #b7d7ea;
  background: #f3f9fc;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  list-style: none;
  padding: 0;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-2);
  color: var(--color-border-strong);
}

.breadcrumb a {
  color: var(--color-text-secondary);
}

/* Calculator shell */
.calc-shell {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (min-width: 768px) {
  .calc-shell {
    grid-template-columns: 1fr 1fr;
    align-items: stretch; /* 输入 / 结果两张卡片等高 */
    gap: var(--space-5);
  }
}

/* 免责提示：位于计算结果卡片正下方（桌面端右栏第二行） */
.calc-shell__disclaimer {
  margin: 0;
}

@media (min-width: 768px) {
  .calc-shell__disclaimer {
    grid-column: 1 / -1; /* 横跨两列：左对齐参数卡片，右对齐结果卡片 */
    grid-row: 2;
  }
}

/* BMI：两侧标题同高，说明贴在输入卡底部，与右侧体重范围框下沿对齐 */
.calc-shell--bmi .calc-panel__head {
  height: 40px;
}

.calc-shell--bmi .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--bmi .bmi-standard-note {
  margin: auto 0 0;
  padding-top: var(--space-4);
  font-size: var(--text-caption);
  line-height: 1.4;
  color: var(--color-text-muted);
}

.calc-shell--bmi .result-grid {
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: 0;
  grid-auto-rows: auto;
}

.calc-panel {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.calc-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.calc-panel__head h2 {
  margin: 0;
  font-size: var(--text-h3);
}

.calc-panel form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 剩余高度均分到字段之间，避免底部留白 */
}

/* BMI：卡片仍与结果区等高，字段靠上排列，多余高度留在卡片底部 */
.calc-panel form[data-bmi-form] {
  justify-content: flex-start;
}

.form-field {
  margin-bottom: var(--space-3);
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field__label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
  font-size: var(--text-caption);
  color: var(--color-text);
}

.form-field__control {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  overflow: hidden;
}

.form-field__control:focus-within {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-muted);
}

.form-field__control input,
.form-field__control select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--color-text);
}

.form-field__control input:focus,
.form-field__control select:focus {
  outline: none;
}

.form-field__unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 76px; /* 所有单位框统一宽度，分隔线上下对齐 */
  width: 76px;
  padding-inline: var(--space-2);
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  white-space: nowrap;
}

.form-field__error {
  margin-top: var(--space-2);
  font-size: var(--text-caption);
  color: var(--color-error);
}

.form-field__error:empty {
  display: none;
}

.form-field.is-invalid .form-field__control {
  border-color: var(--color-error);
}

.form-hint {
  margin-top: var(--space-2);
  font-size: var(--text-caption);
  color: var(--color-warning);
}

/* Results — 每项数据独立成框 */
.result-main,
.result-metric {
  border-radius: var(--radius);
}

.result-main {
  container-type: inline-size;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: var(--color-brand-muted);
  border: 1px solid var(--color-brand);
}

.result-metric {
  background: rgba(var(--color-brand-rgb), 0.06); /* 比主结果更浅的蓝 */
  border: 1px solid rgba(var(--color-brand-rgb), 0.14);
}

.result-main__label,
.result-metric__label {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  font-weight: 600;
}

.result-main__label {
  margin-bottom: var(--space-1);
}

.result-main__value {
  margin: 0;
  font-size: clamp(1.5rem, 12cqi, calc(var(--text-result-xl) * 1.15));
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
  word-break: normal;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: var(--space-3);
  flex: 1; /* 占满剩余高度，使两侧卡片等高 */
  margin-bottom: var(--space-3);
}

.result-metric {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px var(--space-4);
  min-height: 72px;
}

.result-metric__value {
  line-height: 1.15;
}

.result-metric__hint {
  line-height: 1.3;
}

.result-metric--wide {
  grid-column: 1 / -1;
}

.result-metric__value {
  margin: var(--space-1) 0 0;
  font-size: clamp(1rem, 16cqi, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  word-break: normal;
}

.result-metric__hint {
  margin: var(--space-1) 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.result-note {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

@media (max-width: 767px) {
  /* 有效年利率、倍增时间的说明较长，窄屏独占一行 */
  .result-metric:nth-child(5),
  .result-metric:nth-child(6) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 479px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

/* Long-form article blocks */
.content-block .formula-intro {
  margin-bottom: var(--space-3);
}

.callout {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.callout strong {
  color: var(--color-text);
}

.content-block h3 {
  margin-top: var(--space-5);
}

.steps {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

.steps li {
  margin-bottom: var(--space-2);
}

.steps strong,
.guide-list strong {
  color: var(--color-text);
}

/* Chart */
.chart-host {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.chart-host__canvas-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  max-height: 280px;
}

@media (min-width: 768px) {
  .chart-host__canvas-wrap {
    height: 320px;
    max-height: 360px;
  }
}

.chart-host canvas {
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.chart-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Content sections */
.content-block {
  margin-bottom: var(--space-6);
}

.content-block h2 {
  margin-bottom: var(--space-3);
}

.formula-block {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.formula-block code,
.formula-line {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.7;
}

.case-grid {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .case-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.case-card {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.case-card h3 {
  margin-bottom: var(--space-2);
}

.case-card p {
  margin-bottom: var(--space-3);
  font-size: var(--text-caption);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-caption);
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table th {
  background: var(--color-bg);
  font-weight: 700;
  color: var(--color-text);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.guide-list {
  margin: 0;
  padding-left: 1.25rem;
}

.guide-list li {
  margin-bottom: var(--space-2);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: var(--space-2);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.faq-item__trigger::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--color-text-muted);
}

.faq-item.is-open .faq-item__trigger::after {
  content: "−";
}

.faq-item__panel {
  display: none;
  padding: 0 var(--space-4) var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
}

.faq-item.is-open .faq-item__panel {
  display: block;
}

/* Related tools（网格基础样式与 .tool-list 共用） */
@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Legal prose */
.prose {
  max-width: 720px;
}

.prose h2 {
  margin-top: var(--space-6);
}

.page-lead {
  margin-bottom: var(--space-5);
  font-size: 1.0625rem;
}

/* ==========================================================================
   Utilities（命名沿用 Tailwind，供表单错误提示等少量场景使用）
   ========================================================================== */
.text-rose-500 {
  color: #f43f5e;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

/* ==========================================================================
   BMI 计算器
   ========================================================================== */

/* 两个字段并排（性别 / 年龄） */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.form-row .form-field {
  margin-bottom: 0;
}

.form-field__optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

@media (max-width: 479px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* 体型色彩：色板同时配有文字标签，不单靠颜色传达信息 */
.bmi-result {
  --tone: var(--color-brand);
  --tone-bg: var(--color-brand-muted);
}

.bmi-tone--under {
  --tone: #0369a1;
  --tone-bg: #e8f4fc;
}

.bmi-tone--normal {
  --tone: #1a7f4f;
  --tone-bg: #e8f6ef;
}

.bmi-tone--over {
  --tone: #b45309;
  --tone-bg: #fdf3e3;
}

.bmi-tone--obese {
  --tone: #c0392b;
  --tone-bg: #fdecea;
}

.bmi-tone--neutral {
  --tone: #4b5968;
  --tone-bg: #eef1f4;
}

.bmi-result.result-main {
  background: var(--tone-bg);
  border-color: var(--tone);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bmi-result .result-main__value {
  color: var(--tone);
}

.bmi-result__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.bmi-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--tone);
  background: #fff;
  color: var(--tone);
  font-size: var(--text-caption);
  font-weight: 700;
  white-space: nowrap;
}

.bmi-tag__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

/* 刻度条（BMI 15 – 35） */
.bmi-gauge {
  margin-top: var(--space-4);
}

.bmi-gauge[hidden] {
  display: none;
}

.bmi-gauge__track {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: visible;
}

.bmi-gauge__seg {
  height: 100%;
}

.bmi-gauge__seg--under {
  width: 17.5%;
  background: #7cc0e6;
  border-radius: 999px 0 0 999px;
}

.bmi-gauge__seg--normal {
  width: 27.5%;
  background: #5cbf8c;
}

.bmi-gauge__seg--over {
  width: 20%;
  background: #f0b45c;
}

.bmi-gauge__seg--obese {
  width: 35%;
  background: #e5736a;
  border-radius: 0 999px 999px 0;
}

.bmi-gauge__marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--tone);
  box-shadow: 0 1px 4px rgba(21, 32, 43, 0.3);
  transform: translate(-50%, -50%);
  transition: left 0.25s ease;
}

.bmi-gauge__ticks {
  position: relative;
  height: 1.25rem;
  margin-top: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.bmi-gauge__ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .bmi-gauge__marker,
  .bmi-result.result-main {
    transition: none;
  }
}

/* ==========================================================================
   BMR 基础代谢率计算器
   ========================================================================== */

/* 输入卡字段靠上排列；hidden 属性不被 display 覆盖（form-row 为 grid） */
.calc-panel form[data-bmr-form] {
  justify-content: flex-start;
}

[data-bmr-form] [hidden] {
  display: none !important;
}

.form-field__help {
  margin: var(--space-1) 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* 长选项文字不得撑破栅格列，窄屏否则会横向溢出 */
.calc-shell--bmr {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--bmr > *,
.bmr-charts > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--bmr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-shell--bmr .calc-panel__head {
  height: 40px;
}

.calc-shell--bmr .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--bmr .result-grid {
  flex: 0 0 auto;
  grid-auto-rows: auto;
}

.bmr-result__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.result-main__unit {
  margin-left: 0.35em;
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--color-text-secondary);
}

.calc-shell--bmr .result-main__label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bmr-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.4;
  white-space: nowrap;
}

.bmr-chip:empty {
  display: none;
}

/* 结果区下方的辅助提示 */
.bmr-notes {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.bmr-notes:empty {
  display: none;
}

.bmr-note {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-bg);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.bmr-note--warn {
  border-left-color: var(--color-warning);
  background: #fdf3e3;
  color: #7a3a07;
}

.bmr-note--info {
  border-left-color: var(--color-info);
  background: #e8f4fc;
  color: #1b4f73;
}

/* 双图表区 */
.bmr-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

@media (min-width: 768px) {
  .bmr-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

.bmr-charts > .calc-panel {
  height: 100%;
}

.bmr-charts .chart-note {
  margin-top: auto;
}

.bmr-charts .calc-panel__head {
  margin-bottom: var(--space-2);
}

.chart-sub {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
}

.chart-sub strong {
  color: var(--color-brand);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.chart-note {
  margin: var(--space-3) 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* 图表 1：TDEE 分段条形图 */
.seg-bar {
  position: relative;
}

.seg-bar__track {
  display: flex;
  gap: 2px;
  height: 76px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.seg-bar__track.is-empty {
  background: repeating-linear-gradient(135deg, var(--color-bg) 0 10px, #e9edf1 10px 20px);
}

.seg-bar__seg {
  flex: 0 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--seg-color);
  color: #fff;
  transition: flex-basis 0.35s ease, opacity 0.15s ease;
  outline: none;
}

.seg-bar__seg:focus-visible {
  box-shadow: inset 0 0 0 3px #fff;
}

.seg-bar__text {
  padding-inline: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.seg-bar.has-active .seg-bar__seg:not(.is-active) {
  opacity: 0.45;
}

.bar-legend {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  flex: 1;
  align-content: space-evenly;
  gap: var(--space-3);
}

.bar-legend__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--text-caption);
  color: var(--color-text);
  transition: box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  outline: none;
}

.bar-legend__item.is-active,
.bar-legend__item:focus-visible {
  background: var(--color-bg);
  border-color: var(--seg-color);
  box-shadow: inset 3px 0 0 var(--seg-color);
}

.bar-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--seg-color);
}

.bar-legend__name {
  font-weight: 600;
  line-height: 1.3;
}

.bar-legend__name small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.bar-legend__val {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
}

.bar-legend__val strong {
  color: var(--color-text);
}

.bar-legend__val em {
  margin-left: var(--space-2);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* 图表 2：器官饼图（SVG） */
.pie-stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 320px;
  margin: var(--space-2) 0;
  /* 给悬停提示留出饼图外侧的空间，避免压住卡片说明 */
  padding-block: 52px;
}

.pie {
  width: min(100%, 320px);
  margin: 0;
  overflow: visible;
}

.pie-tip {
  position: absolute;
  z-index: 2;
  margin: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  font-size: var(--text-caption);
  line-height: 1.35;
}

.pie-tip[hidden] {
  display: none;
}

.pie-tip strong {
  color: var(--color-text);
}

.pie-tip span {
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.pie__slice {
  cursor: pointer;
  outline: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.pie__slice.is-active {
  transform: translate(var(--dx), var(--dy));
}

.pie.has-active .pie__slice:not(.is-active) {
  opacity: 0.5;
}

.pie__slice:focus-visible path {
  stroke: var(--color-text);
}

.pie__label {
  fill: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .seg-bar__seg,
  .pie__slice {
    transition: none;
  }
}

/* ==========================================================================
   配速计算器
   ========================================================================== */

.calc-shell--pace {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--pace > *,
.pace-boards > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--pace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-panel form[data-pace-form] {
  justify-content: flex-start;
}

.calc-shell--pace .calc-panel {
  padding: 20px;
}

.calc-shell--pace .form-field {
  margin-bottom: 8px;
}

.calc-shell--pace .form-row .form-field {
  margin-bottom: 0;
}

.calc-shell--pace .seg-toggle button {
  min-height: 36px;
}

.calc-shell--pace .form-field__control input,
.calc-shell--pace .form-field__control select {
  min-height: 40px;
}

.calc-shell--pace .calc-panel__head {
  height: 40px;
  margin-bottom: 10px;
}

.calc-shell--pace .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--pace .chip-row {
  flex-wrap: nowrap;
  gap: 6px;
}

.calc-shell--pace .chip {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 8px;
  font-size: 0.8125rem;
  white-space: nowrap;
  text-align: center;
}

.calc-shell--pace .form-row--mode {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}

.calc-shell--pace .form-row--clock {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .calc-shell--pace .chip-row {
    flex-wrap: wrap;
  }
}

.calc-shell--pace .time-inputs {
  flex-wrap: nowrap;
  gap: 4px;
}

.calc-shell--pace .time-inputs input {
  width: 2.55rem;
  min-width: 0;
  min-height: 40px;
  padding: 6px 2px;
}

.calc-shell--pace .result-main {
  flex: 0 0 auto;
  padding: 10px var(--space-4);
  margin-bottom: 0;
}

/* 上行（配速/时速）夹在「目标配速」与下行（时间/距离）正中间 */
.calc-shell--pace .result-metrics {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: 1fr auto 1fr auto;
  min-height: 0;
  margin: 0;
}

.calc-shell--pace .result-grid--pair:first-child {
  grid-row: 2;
}

.calc-shell--pace .result-grid--pair:last-child {
  grid-row: 4;
}

.calc-shell--pace .result-grid--pair {
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 14px;
  margin-bottom: 0;
  align-content: start;
}

.calc-shell--pace .result-metric {
  min-height: 0;
  padding: 8px 12px;
  justify-content: flex-start;
}

.calc-shell--pace .result-metric__label {
  line-height: 1.2;
}

.calc-shell--pace .result-metric__value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35em;
  font-size: 0.95rem;
  line-height: 1.2;
  margin-top: 1px;
}

.calc-shell--pace .result-metric__alt {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.calc-shell--pace .result-metric__alt::before {
  content: "· ";
}

.calc-shell--pace .result-metric__hint {
  margin-top: 1px;
  font-size: 0.75rem;
  line-height: 1.25;
}

.calc-shell--pace .pace-place {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 0;
  line-height: 1.4;
}

.pace-boards .seg-toggle--sm button {
  min-width: 5.25rem;
  padding-inline: 16px;
}

@media (max-width: 767px) {
  .calc-shell--pace .form-row--mode,
  .calc-shell--pace .form-row--clock {
    grid-template-columns: 1fr;
  }

  .calc-shell--pace .time-inputs input {
    width: 3.25rem;
  }

  .calc-shell--pace .result-main {
    margin-bottom: 10px;
  }

  .calc-shell--pace .result-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
    margin: 0;
  }

  .calc-shell--pace .result-grid--pair {
    grid-row: auto;
    gap: 8px;
  }

  .calc-shell--pace .result-metric {
    padding: 8px 10px;
  }

  .calc-shell--pace .result-metric__value {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 2px;
    font-size: 0.875rem;
  }

  .calc-shell--pace .result-metric__alt {
    font-size: 0.75rem;
  }

  .calc-shell--pace .result-metric__alt::before {
    content: none;
  }

  .calc-shell--pace .pace-place {
    margin-top: 10px;
  }

  .pace-boards .calc-panel__head {
    flex-wrap: wrap;
    height: auto;
    row-gap: 8px;
  }

  .pace-boards .seg-toggle--sm {
    width: 100%;
  }

  .pace-boards .seg-toggle--sm button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 10px;
  }
}

.seg-toggle {
  display: flex;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}

.seg-toggle button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.seg-toggle button:last-child {
  border-right: 0;
}

.seg-toggle button.is-on {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.calc-panel__head .seg-toggle {
  flex: 0 0 auto;
}

.seg-toggle--sm button {
  flex: 0 0 auto;
  min-height: 32px;
  padding-inline: 12px;
  font-size: var(--text-caption);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  font-weight: 600;
  cursor: pointer;
}

.chip.is-on {
  border-color: var(--color-brand);
  background: var(--color-brand-muted);
  color: var(--color-brand);
}

.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.time-inputs input {
  width: 4.25rem;
  min-height: 44px;
  padding: var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.time-inputs input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-muted);
}

.time-inputs span {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.form-field.is-solved .time-inputs input,
.form-field.is-solved .form-field__control {
  background: var(--color-bg);
}

.form-field.is-solved .time-inputs input {
  border-color: var(--color-border);
  color: var(--color-text);
}


.pace-place {
  margin: var(--space-3) 0 0;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.pace-place:empty {
  display: none;
}

.pace-boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

@media (min-width: 960px) {
  .pace-boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

.pace-boards > .calc-panel {
  height: 100%;
}

.milestone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.milestone-list li {
  display: flex;
  flex-direction: column;
  min-width: 4.5rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.milestone-list span {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.milestone-list strong {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.pace-splits {
  max-height: 380px;
}

.pace-splits thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr.is-mark th,
.data-table tr.is-mark td {
  background: #fff8e6;
}

.pace-spectrum {
  position: relative;
  height: 14px;
  margin: var(--space-2) 0 var(--space-4);
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.pace-spectrum:empty {
  display: none;
}

.pace-spectrum__seg {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 999px;
  opacity: 0.9;
}

.pace-spectrum__mark {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 22px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--color-text);
}

.zone-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.zone-line {
  display: grid;
  gap: 2px;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.zone-line:last-child {
  border-bottom: 0;
}

.zone-line__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--color-text);
}

.zone-line__name i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c);
}

.zone-line__pace {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-text);
}

.zone-line__work {
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.zone-line.is-current .zone-line__name {
  color: var(--color-brand);
}

@media (min-width: 640px) {
  .zone-line {
    grid-template-columns: 8.5rem 1fr;
  }

  .zone-line__work {
    grid-column: 1 / -1;
  }
}

/* 参考文献 */
.ref-list {
  margin: 0;
  padding-left: 1.5rem;
  font-size: var(--text-caption);
  line-height: 1.6;
}

.ref-list li {
  margin-bottom: var(--space-2);
}

/* 影响因子卡 */
.factor-grid {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .factor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .factor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.factor-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.factor-card__no {
  align-self: flex-start;
  margin-bottom: var(--space-2);
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--color-brand-muted);
  color: var(--color-brand);
  font-size: 0.75rem;
  font-weight: 700;
}

.factor-card h3 {
  margin: 0 0 var(--space-2);
}

.factor-card p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-caption);
}

.factor-card__meta {
  margin-top: auto !important;
  padding-top: var(--space-2);
  border-top: 1px dashed var(--color-border);
  font-size: 0.8125rem !important;
  color: var(--color-text-muted) !important;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table--wrap td,
.data-table--wrap th {
  white-space: normal;
  min-width: 7rem;
}

.cite {
  color: var(--color-text-muted);
  font-size: 0.875em;
}

/* 公式（KaTeX 渲染后居中；未加载时保留等宽降级文本） */
.formula-line[data-math-rendered] {
  font-family: inherit;
  text-align: center;
  font-size: 1.0625rem;
}

.formula-line .katex-display {
  margin: 0;
}

.data-table .katex {
  font-size: 1em;
}

/* 案例卡（三栏详解） */
.case-grid--3 {
  align-items: start;
}

@media (min-width: 768px) {
  .case-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.case-card--detail {
  display: flex;
  flex-direction: column;
}

.case-card--detail p,
.case-card--detail li {
  font-size: var(--text-caption);
}

.case-card__tag {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: var(--space-2);
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--color-brand-muted);
  color: var(--color-brand);
  font-size: 0.75rem;
  font-weight: 700;
}

.case-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.case-stats > div {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.case-stats dt {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.case-stats dd {
  margin: 0;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.case-card h4 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--text-caption);
  color: var(--color-text);
}

.case-card--detail ul {
  margin-bottom: var(--space-3);
}

.case-card--detail .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* 行动建议：按体型分类四宫格 */
.advice-grid {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .advice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.advice-card {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--tone);
  border-radius: var(--radius);
}

.advice-card h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 0;
  color: var(--tone);
}

.advice-card h3 small {
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--color-text-muted);
}

.advice-card h4 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--text-caption);
  color: var(--color-text);
}

.advice-card ul {
  margin-bottom: 0;
  font-size: var(--text-caption);
}

.advice-card li {
  margin-bottom: var(--space-1);
}

/* 单元格带色点的分类标签 */
.tone-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--tone);
}

.tone-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.data-table .is-diff {
  background: #fff8e6;
}

/* 无缝手风琴：高度平滑展开（grid 0fr → 1fr），收起时内容不可聚焦 */
.faq-list--smooth .faq-item__panel {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0;
  visibility: hidden;
  transition: grid-template-rows 0.28s ease, visibility 0s linear 0.28s;
}

.faq-list--smooth .faq-item.is-open .faq-item__panel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.28s ease, visibility 0s;
}

.faq-list--smooth .faq-item__inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 var(--space-4);
}

.faq-list--smooth .faq-item.is-open .faq-item__inner {
  padding-bottom: var(--space-4);
}

.faq-list--smooth .faq-item__inner p {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
}

.faq-list--smooth .faq-item__inner p:last-child {
  margin-bottom: 0;
}

.faq-list--smooth .faq-item__inner ul {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
}

.faq-list--smooth .faq-item__trigger {
  transition: background 0.15s ease;
}

.faq-list--smooth .faq-item__trigger:hover {
  background: var(--color-bg);
}

@media (prefers-reduced-motion: reduce) {
  .faq-list--smooth .faq-item__panel,
  .faq-list--smooth .faq-item.is-open .faq-item__panel {
    transition: none;
  }
}

/* ==========================================================================
   养老规划计算器（Retirement Runway）
   ========================================================================== */

.calc-shell--ret {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--ret > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--ret {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-shell--ret .calc-panel__head {
  height: 40px;
}

.calc-shell--ret .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-panel form[data-ret-form] {
  justify-content: flex-start;
}

.calc-shell--ret .result-grid {
  flex: 0 0 auto;
  grid-auto-rows: auto;
  margin-bottom: 0;
}

.calc-shell--ret .result-metric {
  justify-content: flex-start;
}

.calc-shell--ret .result-metric__value {
  font-size: clamp(1rem, 11cqi, 1.25rem);
}

.calc-shell--ret .result-metric--hero .result-metric__value {
  /* 略小于上方大结果：保证「¥12,345 / 月」等五位数金额仍能单行显示 */
  font-size: clamp(1.25rem, 12cqi, 1.625rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-brand);
  white-space: nowrap;
}

@media (max-width: 479px) {
  .calc-shell--ret .result-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 高级参数折叠面板（原生 details，无需脚本） */
.adv {
  margin-top: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.adv > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-4);
  list-style: none;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.adv > summary::-webkit-details-marker {
  display: none;
}

.adv > summary small {
  margin-left: var(--space-2);
  font-weight: 400;
  color: var(--color-text-muted);
}

.adv > summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--color-text-muted);
}

.adv[open] > summary::after {
  content: "−";
}

.adv__body {
  padding: 0 var(--space-4) var(--space-4);
}

.adv__body .form-field {
  margin-bottom: var(--space-3);
}

.adv__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.adv__foot p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* 结果区：状态色 + 两张核心大字卡片 */
.ret-result-top {
  --tone: var(--color-brand);
  --tone-bg: var(--color-brand-muted);
}

.ret-tone--good {
  --tone: #1a7f4f;
  --tone-bg: #e8f6ef;
}

.ret-tone--warn {
  --tone: #b45309;
  --tone-bg: #fdf3e3;
}

.ret-tone--bad {
  --tone: #c0392b;
  --tone-bg: #fdecea;
}

.ret-status {
  min-height: 28px;
  margin-bottom: var(--space-2);
}

.ret-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--tone);
  background: #fff;
  color: var(--tone);
  font-size: var(--text-caption);
  font-weight: 700;
  white-space: nowrap;
}

.ret-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.ret-tag[hidden] {
  display: none;
}

.ret-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

@media (max-width: 479px) {
  .ret-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ret-card {
  container-type: inline-size;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--tone);
  border-radius: var(--radius);
  background: var(--tone-bg);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ret-card__label {
  margin: 0 0 var(--space-1);
  font-size: var(--text-caption);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.ret-card__value {
  margin: 0;
  font-size: clamp(1.75rem, 18cqi, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--tone);
  font-variant-numeric: tabular-nums;
}

.ret-card__unit {
  margin-left: 0.2em;
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--color-text-secondary);
}

.ret-card__sub {
  margin: var(--space-1) 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.ret-notes {
  margin-top: var(--space-3);
}

/* 图表区：纵向堆叠，折线图需要横向宽度 */
.ret-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.ret-charts > .calc-panel {
  min-width: 0;
}

.ret-charts .calc-panel__head {
  margin-bottom: var(--space-2);
}

.ret-charts .calc-panel__head .seg-toggle button {
  min-width: 5.5rem;
}

@media (max-width: 599px) {
  .ret-charts .calc-panel__head {
    flex-wrap: wrap;
    height: auto;
    row-gap: var(--space-2);
  }
}

.lc-host {
  position: relative;
  width: 100%;
  margin-top: var(--space-2);
}

.lc-svg {
  display: block;
  max-width: 100%;
  height: auto;
  touch-action: pan-y;
  user-select: none;
  border-radius: var(--radius-sm);
}

.lc-svg:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.lc-hit {
  cursor: crosshair;
}

.lc-hover[hidden] {
  display: none;
}

.lc-tip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  font-size: var(--text-caption);
  line-height: 1.35;
}

.lc-tip[hidden] {
  display: none;
}

.lc-tip strong {
  color: var(--color-text);
}

.lc-tip span {
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.lc-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 0;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  text-align: center;
}

.lc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.lc-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.lc-legend i {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--c);
}

.lc-legend i.is-zone {
  height: 12px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  border: 1px solid var(--c);
}

/* 图表 2：年龄滑块 */
.mix-controls {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-4);
}

.mix-controls__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.mix-controls__age {
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.mix-controls__age strong {
  margin-left: var(--space-1);
  color: var(--color-brand);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.mix-slider {
  width: 100%;
  min-height: 28px;
  margin: 0;
  accent-color: var(--color-brand);
  cursor: pointer;
}

.chip--danger {
  border-color: #e7b5af;
  color: var(--color-error);
}

.chip--danger.is-on {
  border-color: var(--color-error);
  background: #fdecea;
  color: var(--color-error);
}

.mix-summary {
  margin: var(--space-4) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: var(--text-caption);
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* 手机端不展示参考文献 */
@media (max-width: 767px) {
  #references {
    display: none;
  }
}

/* 养老页年龄字段：避免并排时单位栏把输入撑出卡片 */
.calc-shell--ret .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calc-shell--ret .form-row .form-field,
.calc-shell--ret .form-row .form-field__control {
  min-width: 0;
}

.calc-shell--ret .form-row .form-field__unit {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  padding-inline: 0;
}

.ret-charts .bar-legend {
  flex: 0 0 auto;
  align-content: start;
}

.ret-charts .bar-legend__item {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

/* 案例中的“杠杆”表格强调行 */
.data-table tr.is-total td,
.data-table tr.is-total th {
  background: #eaf1ff;
  font-weight: 700;
  color: var(--color-text);
}

/* 含表格的详细案例：整行堆叠，避免表格撑开网格列 */
.case-grid--stack {
  grid-template-columns: minmax(0, 1fr);
}

.case-grid--stack > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .case-grid.case-grid--stack {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 640px) {
  .case-grid--stack .case-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.case-grid--stack .case-card {
  padding: var(--space-5);
}

.case-grid--stack .table-wrap {
  max-width: 44rem;
}

/* 房贷案例：五张表同宽、居中，单元格可换行以免横向滚动 */
#cases .case-grid--stack .table-wrap {
  width: min(100%, 58rem);
  max-width: 58rem;
  margin-inline: auto;
  overflow-x: visible;
}

#cases .case-grid--stack .data-table {
  width: 100%;
  table-layout: fixed;
}

#cases .case-grid--stack .data-table th,
#cases .case-grid--stack .data-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#cases .case-grid--stack .data-table th.num,
#cases .case-grid--stack .data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ret-ref-note {
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   房贷计算器
   ========================================================================== */

/* 最新基准利率条 */
.mort-rates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

@media (min-width: 768px) {
  .mort-rates {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mort-rates__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand);
  border-radius: var(--radius);
}

.mort-rates__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.mort-rates__value {
  font-size: clamp(1rem, 3.8vw, 1.25rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.mort-rates__sub {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.mort-rates__note {
  margin: 0 0 var(--space-5);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* 计算器外壳 */
.calc-shell--mort {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--mort > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--mort {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-shell--mort .calc-panel__head {
  height: 40px;
}

.calc-shell--mort .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-panel form[data-mort-form] {
  justify-content: flex-start;
}

[data-mort-form] [hidden] {
  display: none !important;
}

[data-mort-form] .seg-toggle button {
  padding-inline: var(--space-2);
}

.calc-shell--mort .form-row .form-field,
.calc-shell--mort .form-row .form-field__control {
  min-width: 0;
}

.calc-shell--mort .result-grid {
  flex: 0 0 auto;
  grid-auto-rows: auto;
}

.calc-shell--mort .result-metric {
  justify-content: flex-start;
}

.calc-shell--mort .result-metric__value {
  font-size: clamp(1rem, 11cqi, 1.25rem);
}

.mort-chips {
  margin-top: var(--space-2);
}

.mort-group {
  min-width: 0;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.mort-group__title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
}

.mort-group__mode {
  margin-bottom: var(--space-3);
}

.mort-group__mode .seg-toggle {
  width: fit-content;
  max-width: 100%;
}

.mort-group__mode .seg-toggle button {
  flex: 0 0 auto;
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

.mort-group .form-row {
  margin-bottom: var(--space-2);
}

.mort-group .form-field {
  margin-bottom: 0;
}

.mort-group [data-show][hidden] {
  display: none !important;
}

.mort-rate-readout {
  margin: var(--space-3) 0 var(--space-1);
  font-weight: 700;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}

.mort-derived {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-brand);
  border-radius: var(--radius-sm);
  background: var(--color-brand-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.mort-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.mort-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--color-brand);
}

.mort-check small {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* 结果区 */
.mort-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.mort-tag {
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.mort-tag:first-child {
  border-color: var(--color-brand);
  background: var(--color-brand-muted);
  color: var(--color-brand);
}

.mort-insight {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid #f0d9a8;
  border-radius: var(--radius);
  background: #fffbf2;
}

.mort-insight[hidden],
.mort-jump[hidden],
.mort-split[hidden] {
  display: none;
}

.mort-insight__text {
  margin: 0;
  font-size: var(--text-caption);
  font-weight: 600;
  line-height: 1.55;
  color: var(--color-text);
}

/* 与结果区「贷款本金 / 支付利息总额」同宽的双按钮 */
.mort-jump {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.mort-jump__btn {
  width: 100%;
  min-height: 0;
  height: auto;
  padding: var(--space-4);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
}

.mort-split {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.mort-split li {
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 0.8125rem;
}

.mort-split strong {
  color: var(--color-text);
}

.mort-split span {
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.bmr-note--good {
  border-left-color: var(--color-success);
  background: #e8f6ef;
  color: #14633e;
}

.bmr-note--bad {
  border-left-color: var(--color-error);
  background: #fdecea;
  color: #8f2a20;
}

/* 输入无效时，下方旧结果降低对比度 */
.is-stale {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

/* 图表区 */
.mort-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.mort-charts > .calc-panel {
  min-width: 0;
}

@media (min-width: 960px) {
  .mort-charts {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.mort-charts .calc-panel__head,
.mort-compare .calc-panel__head,
.mort-schedule .calc-panel__head {
  margin-bottom: var(--space-2);
}

.mort-donut-host {
  display: grid;
  place-items: center;
  margin: var(--space-3) 0;
}

.mort-donut {
  width: min(100%, 260px);
}

.mort-charts .bar-legend {
  flex: 0 0 auto;
  align-content: start;
  margin-top: var(--space-2);
}

/* 同屏对比 */
.mort-compare,
.mort-schedule {
  margin-bottom: var(--space-5);
}

.mort-compare__verdict {
  margin: 0 0 var(--space-3);
  font-weight: 600;
  line-height: 1.6;
  color: var(--color-text);
}

.mort-compare__table tbody th {
  min-width: 11rem;
  background: var(--color-surface);
  font-weight: 600;
  white-space: normal;
}

.mort-compare__table-head {
  margin-top: var(--space-5);
}

/* 还款计划表 */
.mort-schedule__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.mort-schedule__size {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.mort-schedule__size select {
  min-height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.mort-table-wrap {
  max-height: 440px;
  overflow: auto;
}

.mort-table-wrap:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.mort-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.mort-table td.num,
.mort-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mort-table tr.is-year-end td {
  border-bottom: 2px solid var(--color-border-strong);
}

.mort-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.mort-pager[hidden] {
  display: none;
}

.mort-pager__label {
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
}

.mort-pager .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 还款方式决策树 */
.mort-tree,
.mort-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mort-tree ul {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 2px solid var(--color-border);
}

.mort-tree li {
  position: relative;
  margin-top: var(--space-3);
}

.mort-tree ul > li::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -18px;
  width: 18px;
  border-top: 2px solid var(--color-border);
}

.mort-tree__q {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: var(--text-caption);
  font-weight: 600;
  line-height: 1.55;
  color: var(--color-text);
}

.mort-tree__q span {
  display: inline-block;
  margin-right: var(--space-2);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--color-brand-muted);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-brand);
}

.mort-tree__a {
  margin: 0 0 var(--space-2);
}

.mort-tree__a span {
  display: inline-block;
  padding: 1px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 0.75rem;
  font-weight: 700;
}

.mort-tree__a--yes {
  color: var(--color-success);
}

.mort-tree__a--no {
  color: var(--color-warning);
}

.mort-tree__r {
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--c);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--text-caption);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.mort-tree__r strong {
  color: var(--color-text);
}

.mort-tree__r--ins {
  --c: #2563eb;
  --bg: #eaf1ff;
}

.mort-tree__r--pri {
  --c: #c2410c;
  --bg: #fff1e8;
}

@media (max-width: 479px) {
  .mort-tree ul {
    margin-left: 8px;
    padding-left: 10px;
  }

  .mort-tree ul > li::before {
    left: -10px;
    width: 10px;
  }
}

/* ==========================================================================
   FFMI 无脂质量指数计算器
   ========================================================================== */

.calc-panel form[data-ffmi-form] {
  justify-content: space-between;
  gap: var(--space-2);
}

/* 两列等宽：避免内容把某一侧撑开 */
.calc-shell--ffmi {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--ffmi > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--ffmi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-shell--ffmi .calc-panel__head {
  height: 40px;
}

.calc-shell--ffmi form > .form-field {
  margin-bottom: 0;
}

.calc-shell--ffmi .form-field__unit {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  padding-inline: 0;
}

.calc-shell--ffmi .form-field__control input,
.calc-shell--ffmi .form-field__control select {
  min-height: 48px;
}

.calc-shell--ffmi .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--ffmi .ffmi-standard-note {
  margin: 0;
  padding-top: var(--space-2);
  font-size: var(--text-caption);
  line-height: 1.45;
  color: var(--color-text-muted);
}

.calc-shell--ffmi .result-grid {
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: 0;
  grid-auto-rows: auto;
}

.ffmi-result {
  --tone: var(--color-brand);
  --tone-bg: var(--color-brand-muted);
}

.ffmi-tone--low { --tone: #0369a1; --tone-bg: #e8f4fc; }
.ffmi-tone--average { --tone: #0f766e; --tone-bg: #e6f6f4; }
.ffmi-tone--good { --tone: #1a7f4f; --tone-bg: #e8f6ef; }
.ffmi-tone--excellent { --tone: #146c43; --tone-bg: #dff5e8; }
.ffmi-tone--ceiling { --tone: #b45309; --tone-bg: #fdf3e3; }
.ffmi-tone--beyond { --tone: #c0392b; --tone-bg: #fdecea; }

.ffmi-result.result-main {
  background: var(--tone-bg);
  border-color: var(--tone);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ffmi-result .result-main__value {
  color: var(--tone);
}

.ffmi-gauge {
  margin-top: var(--space-4);
}

.ffmi-gauge__track {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: 999px;
}

.ffmi-gauge__seg {
  height: 100%;
  flex: none;
}

.ffmi-gauge__marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--tone);
  box-shadow: 0 1px 4px rgba(21, 32, 43, 0.3);
  transform: translate(-50%, -50%);
  transition: left 0.25s ease, border-color 0.2s ease;
  z-index: 1;
}

.ffmi-gauge__marker[hidden] {
  display: none;
}

.ffmi-gauge__ticks {
  position: relative;
  height: 1.25rem;
  margin-top: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.ffmi-gauge__ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.ffmi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.ffmi-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.ffmi-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.ffmi-legend li.is-active {
  color: var(--color-text);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .ffmi-gauge__marker,
  .ffmi-result.result-main {
    transition: none;
  }
}

/* ==========================================================================
   最大心率计算器
   ========================================================================== */

.calc-shell--hrmax {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--hrmax > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--hrmax {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-shell--hrmax .calc-panel__head {
  height: 40px;
  margin-bottom: var(--space-3);
}

.calc-shell--hrmax .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-panel form[data-hr-form] {
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 0;
}

.calc-shell--hrmax form[data-hr-form] > .form-field {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.calc-shell--hrmax .form-field__unit {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  padding-inline: 0;
}

.calc-shell--hrmax .form-field__control input,
.calc-shell--hrmax .form-field__control select {
  min-height: 48px;
}

.calc-shell--hrmax .seg-toggle button {
  white-space: normal;
  line-height: 1.25;
  padding: 8px 8px;
  font-size: 0.8125rem;
}

.hrz-main-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  width: 100%;
}

.hrz-main-row .result-main {
  margin-bottom: 0;
  min-width: 0;
  width: auto;
  padding: var(--space-4);
}

/* 并排后容器变窄，cqi 会压小字号；加到接近整宽时的结果字号 */
.hrz-main-row .result-main__value {
  font-size: clamp(1.75rem, 22cqi, calc(var(--text-result-xl) * 1.15));
}

.hrz-method {
  margin-bottom: var(--space-3);
}

.hrz-method .form-field__label {
  display: block;
  margin-bottom: var(--space-1);
}

.hrz-banner {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-brand-muted);
  color: var(--color-text);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.hrz-chart {
  margin: var(--space-2) 0 var(--space-3);
  padding-top: 30px;
}

.hrz-chart__track {
  position: relative;
  display: flex;
  gap: 3px;
  height: 76px;
  border-radius: 12px;
}

.hrz-chart__track.is-empty {
  background: repeating-linear-gradient(135deg, var(--color-bg) 0 10px, #e9edf1 10px 20px);
  border: 1px solid var(--color-border);
}

.hrz-chart__seg {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-inline: 2px;
  border-radius: 4px;
  background: var(--z);
  color: var(--ink);
  line-height: 1.15;
  text-align: center;
}

.hrz-chart__seg b {
  font-size: 0.75rem;
  font-weight: 800;
}

.hrz-chart__seg span {
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hrz-chart__seg.is-current {
  box-shadow: inset 0 0 0 2px #15202b;
}

.hrz-chart__seg[hidden] {
  display: none;
}

.hrz-chart__needle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #15202b;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: none;
}

.hrz-chart__needle[hidden] {
  display: none;
}

.hrz-chart__pill {
  position: absolute;
  top: -26px;
  left: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: #15202b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}

.hrz-now {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-text);
}

.hrz-zones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hrz-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: baseline;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--z);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.hrz-zone.is-current {
  background: var(--color-bg);
  border-color: var(--z);
}

.hrz-zone__name,
.hrz-zone__bpm,
.hrz-zone__meta {
  margin: 0;
}

.hrz-zone__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--color-text);
}

.hrz-zone__name i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--z);
}

.hrz-zone__bpm {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  white-space: nowrap;
}

.hrz-zone__meta {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

@media (max-width: 380px) {
  .hrz-chart__seg span {
    display: none;
  }

  .hrz-chart__track {
    height: 48px;
  }
}

/* ==========================================================================
   燃脂心率计算器（FatMax）
   ========================================================================== */

.calc-shell--fatburn {
  grid-template-columns: minmax(0, 1fr);
}

.calc-shell--fatburn > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--fatburn {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-shell--fatburn > .fb-charts {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .calc-shell--fatburn > .calc-shell__disclaimer {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

.calc-shell--fatburn .calc-panel__head {
  height: 40px;
  margin-bottom: var(--space-3);
}

.calc-shell--fatburn .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

/* 与输入卡等高：字段间距均分剩余高度 */
.calc-panel form[data-fb-form] {
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 0;
}

.calc-shell--fatburn form[data-fb-form] > .form-field {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.calc-shell--fatburn .form-field__unit {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  padding-inline: 0;
}

.calc-shell--fatburn .form-field__control input {
  min-height: 48px;
}

/* 结果区随卡片拉高，两行结果框与说明文案均匀铺开 */
.calc-shell--fatburn .fb-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 0;
}

.calc-shell--fatburn .fb-results > .result-main {
  margin-bottom: 0;
  padding: var(--space-4) var(--space-4);
}

.calc-shell--fatburn .fb-results .hrz-main-row {
  margin-bottom: 0;
  gap: var(--space-4);
}

.calc-shell--fatburn .fb-results .hrz-main-row .result-main {
  padding: var(--space-4);
}

.fb-result-split {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2em;
  font-variant-numeric: tabular-nums;
}

.fb-algo-note {
  margin: 0;
  font-size: var(--text-caption);
  line-height: 1.55;
  color: var(--color-text-secondary);
  font-style: italic;
}

.calc-shell--fatburn .fb-results .hrz-banner {
  margin: 0;
}

.calc-shell--fatburn .fb-results .hrz-banner[hidden] {
  display: none;
}

.fb-charts .fb-chart-title:first-child {
  margin-top: 0;
}

.fb-chart-title {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-body);
  font-weight: 700;
}

.fb-crossover {
  margin-bottom: var(--space-2);
}

.fb-crossover.is-empty {
  min-height: 160px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--color-bg) 0 10px, #e9edf1 10px 20px);
}

.fb-crossover__svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.fb-crossover__legend {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.fb-crossover__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fb-crossover__legend i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.fb-crossover__legend i.is-dash {
  height: 2px;
  background: repeating-linear-gradient(90deg, #0f766e 0 4px, transparent 4px 7px) !important;
}

.fb-zonebar {
  margin: var(--space-2) 0 var(--space-3);
  padding-top: 30px;
}

.fb-zonebar__track {
  position: relative;
  display: flex;
  gap: 3px;
  height: 76px;
  border-radius: 12px;
}

.fb-zonebar__track.is-empty {
  background: repeating-linear-gradient(135deg, var(--color-bg) 0 10px, #e9edf1 10px 20px);
  border: 1px solid var(--color-border);
}

.fb-zonebar__seg {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-inline: 2px;
  border-radius: 4px;
  background: var(--z);
  color: var(--ink);
  line-height: 1.15;
  text-align: center;
}

.fb-zonebar__seg--fat.is-highlight {
  box-shadow: inset 0 0 0 2px #0b3d24, 0 0 0 2px rgba(31, 138, 77, 0.35);
  z-index: 1;
}

.fb-zonebar__seg.is-current {
  outline: 2px solid #15202b;
  outline-offset: -2px;
}

.fb-zonebar__seg[hidden] {
  display: none;
}

.fb-zonebar__seg b {
  font-size: 0.72rem;
  font-weight: 800;
}

.fb-zonebar__seg span {
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fb-zonebar__needle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #15202b;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: none;
}

.fb-zonebar__needle[hidden] {
  display: none;
}

.fb-zonebar__pill {
  position: absolute;
  top: -26px;
  left: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: #15202b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .fb-zonebar__seg span {
    display: none;
  }

  .fb-zonebar__track {
    height: 52px;
  }
}

/* —— 步行热量计算器 —— */
.calc-shell--walk {
  display: grid;
  gap: var(--space-4);
  align-items: stretch;
}

.calc-shell--walk > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--walk {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-shell--walk > .wc-charts {
    grid-column: 1 / -1;
  }

  .calc-shell--walk > .calc-shell__disclaimer {
    grid-column: 1 / -1;
  }
}

.calc-shell--walk .calc-panel__head {
  height: 40px;
  margin-bottom: var(--space-3);
}

.calc-shell--walk .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--walk form[data-wc-form] > .form-field {
  margin-bottom: var(--space-3);
}

.calc-shell--walk .form-field__control input {
  min-height: 48px;
}

.form-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.form-field__label-row .form-field__label {
  margin-bottom: 0;
}

.wc-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  container-type: inline-size;
}

.wc-results > .result-main,
.wc-result-row > .result-main {
  margin-bottom: 0;
  container-type: normal;
}

.wc-results .result-main__value {
  font-size: clamp(1.5rem, 12cqi, calc(var(--text-result-xl) * 1.15));
}

.wc-result-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (max-width: 420px) {
  .wc-result-row {
    grid-template-columns: 1fr;
  }
}

.wc-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.wc-meta-row p {
  margin: 0;
}

.wc-meta-row strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.wc-section-title,
.wc-chart-title {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-body);
  font-weight: 700;
}

.wc-food-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .wc-food-grid {
    grid-template-columns: 1fr;
  }
}

.wc-food-card {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.wc-food-card__label {
  margin: 0 0 4px;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.wc-food-card__value {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.4;
}

.wc-food-card__value strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.25em;
  color: var(--color-brand);
}

.wc-food-card__hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.wc-charts {
  padding-top: var(--space-2);
}

.wc-speed-chart,
.wc-food-chart {
  margin-bottom: var(--space-4);
}

.wc-speed-chart.is-empty,
.wc-food-chart.is-empty {
  min-height: 120px;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--color-bg) 0 10px, #e9edf1 10px 20px);
  border: 1px solid var(--color-border);
}

.wc-speed-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.wc-food-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.wc-food-bars__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 6px;
  font-size: var(--text-caption);
}

.wc-food-bars__meta strong {
  font-variant-numeric: tabular-nums;
}

.wc-food-bars__track {
  height: 12px;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.wc-food-bars__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 4px;
  transition: width 0.25s ease;
}

.calc-shell--walk .chip-row {
  margin-top: 2px;
}

.calc-shell--walk .chip {
  font-size: 0.78rem;
}

.calc-shell--walk .form-field__unit {
  flex: 0 0 3.75rem;
  width: 3.75rem;
  padding-inline: 0.35rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* —— 跑步热量计算器 —— */
.calc-shell--run {
  display: grid;
  gap: var(--space-4);
  align-items: stretch;
}

.calc-shell--run > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--run {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-shell--run > .wc-charts {
    grid-column: 1 / -1;
  }

  .calc-shell--run > .calc-shell__disclaimer {
    grid-column: 1 / -1;
  }
}

.calc-shell--run .calc-panel__head {
  height: 40px;
  margin-bottom: var(--space-3);
}

.calc-shell--run .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--run form[data-rc-form] > .form-field {
  margin-bottom: var(--space-3);
}

.calc-shell--run .form-field__control input {
  min-height: 48px;
}

.calc-shell--run .form-field__unit {
  flex: 0 0 3.75rem;
  width: 3.75rem;
  padding-inline: 0.35rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.calc-shell--run .chip-row {
  margin-top: 2px;
}

.calc-shell--run .chip {
  font-size: 0.78rem;
}

.calc-shell--run .adv {
  margin-top: 0;
  margin-bottom: var(--space-1);
}

.rc-split {
  margin-bottom: var(--space-4);
}

.rc-split__track {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.rc-split__net {
  display: block;
  background: #2563eb;
  min-width: 2px;
}

.rc-split__rest {
  display: block;
  background: #94a3b8;
  min-width: 2px;
}

.rc-split__legend {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: var(--text-caption);
}

.rc-split__legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.rc-split__legend i.is-net {
  background: #2563eb;
}

.rc-split__legend i.is-rest {
  background: #94a3b8;
}

.rc-split__legend strong {
  font-variant-numeric: tabular-nums;
}

/* —— Jump rope calorie calculator —— */
.calc-shell--jr {
  display: grid;
  gap: var(--space-4);
}

.calc-shell--jr > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--jr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-shell--jr > .wc-charts {
    grid-column: 1 / -1;
  }

  .calc-shell--jr > .calc-shell__disclaimer {
    grid-column: 1 / -1;
  }
}

.calc-shell--jr .calc-panel__head {
  height: 40px;
  margin-bottom: var(--space-3);
}

.calc-shell--jr .calc-panel__head .btn {
  height: 32px;
  min-height: 32px;
  line-height: 1;
}

.calc-shell--jr form[data-jr-form] > .form-field {
  margin-bottom: var(--space-3);
}

.calc-shell--jr .form-field__control input {
  min-height: 48px;
}

.calc-shell--jr .form-field__unit {
  min-width: 3.2em;
}

.calc-shell--jr .chip-row {
  margin-top: 2px;
}

.calc-shell--jr .chip {
  font-size: 0.78rem;
}

.calc-shell--jr .adv {
  margin-top: 0;
  margin-bottom: var(--space-1);
}

.jr-hbar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.jr-hbar__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-caption);
  margin-bottom: 6px;
}

.jr-hbar__meta strong {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.jr-hbar__track {
  height: 14px;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.jr-hbar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #64748b;
  min-width: 2px;
}

.jr-hbar__item.is-highlight .jr-hbar__fill {
  background: #2563eb;
}

.jr-hbar__item.is-highlight .jr-hbar__meta span {
  font-weight: 650;
  color: #1d4ed8;
}

.jr-matrix-card {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, #2563eb 6%, var(--color-surface, #fff));
}

.jr-matrix-card__eq {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-text);
}

.jr-matrix-card__eq strong {
  font-variant-numeric: tabular-nums;
  color: #1d4ed8;
}

/* —— BAC 血液酒精浓度计算器 —— */
.calc-shell--bac {
  display: grid;
  gap: var(--space-4);
  align-items: stretch;
}

.calc-shell--bac > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--bac {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-shell--bac > .bac-charts {
    grid-column: 1 / -1;
  }

  .calc-shell--bac > .calc-shell__disclaimer {
    grid-column: 1 / -1;
  }
}

.calc-shell--bac .calc-panel__head {
  height: 40px;
  margin-bottom: var(--space-3);
}

.calc-shell--bac .form-row {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .calc-shell--bac .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-shell--bac .bac-custom-row {
  margin-bottom: 0;
}

.calc-shell--bac .bac-custom-row .form-field {
  min-width: 0;
  margin-bottom: 0;
}

.calc-shell--bac .bac-custom-row .form-field__unit {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  padding-inline: 0;
  font-size: 0.8125rem;
}

.bac-custom-actions {
  margin: var(--space-2) 0 var(--space-3);
}

.bac-custom-actions .btn {
  width: 100%;
}

.bac-elapsed-row {
  margin-bottom: 0;
}

.bac-elapsed-help {
  margin-top: var(--space-1);
  margin-bottom: 0;
  white-space: nowrap;
}

.bac-preset-row .chip {
  font-size: 0.8125rem;
}

.bac-drink-list {
  margin: var(--space-2) 0 var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bac-drink-empty {
  margin: 0;
  padding: var(--space-3);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.bac-drink-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.bac-drink-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bac-drink-item__main strong {
  font-size: var(--text-body);
}

.bac-drink-item__main span {
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.bac-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bac-result-main {
  background: var(--bac-tone-bg, var(--color-brand-muted));
  border-left: 4px solid var(--bac-tone-border, var(--color-brand));
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bac-result-main--safe {
  --bac-tone-bg: #ecfdf5;
  --bac-tone-border: #16a34a;
}

.bac-result-main--warn {
  --bac-tone-bg: #fffbeb;
  --bac-tone-border: #ca8a04;
}

.bac-result-main--danger {
  --bac-tone-bg: #fef2f2;
  --bac-tone-border: #dc2626;
}

.bac-legal-status {
  margin: var(--space-2) 0 0;
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.4;
}

.bac-legal-short {
  margin: var(--space-1) 0 0;
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.bac-result-sub {
  font-size: clamp(1.125rem, 4cqi, 1.35rem) !important;
  line-height: 1.35;
}

.bac-meta {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-caption);
}

.bac-meta div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.bac-meta dt {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.bac-meta dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.bac-chart {
  min-height: 160px;
}

.bac-chart.is-empty {
  min-height: 160px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--color-bg) 0 10px, #e9edf1 10px 20px);
}

.bac-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.bac-chart-legend {
  margin-top: var(--space-2);
}

.bac-disclaimer {
  border: 1px solid #f59e0b;
  background: #fffbeb;
}

.bac-disclaimer__emphasis {
  font-weight: 700;
  color: #dc2626;
}

/* ——— 血型概率计算器 ——— */
.calc-shell--bloodtype {
  display: grid;
  gap: var(--space-4);
}

.calc-shell--bloodtype > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .calc-shell--bloodtype {
    grid-template-columns: 1fr 1fr;
  }

  .calc-shell--bloodtype > .bt-viz,
  .calc-shell--bloodtype > .calc-shell__disclaimer {
    grid-column: 1 / -1;
  }
}

.calc-shell--bloodtype .calc-panel__head {
  margin-bottom: var(--space-3);
}

.calc-shell--bloodtype .form-row {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 520px) {
  .calc-shell--bloodtype .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.bt-parent {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.bt-parent:last-of-type {
  margin-bottom: 0;
}

.bt-parent__title {
  display: block;
  margin: 0 0 var(--space-3);
  padding: 0 0 var(--space-2);
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--leading-tight);
}

#homo-hetero {
  scroll-margin-top: calc(var(--header-h) + var(--space-4));
}

.bt-parent__adv .form-field__help a {
  margin-left: 0.35em;
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bt-parent__adv .form-field__help a:hover {
  color: var(--color-brand-hover);
}

.bt-parent > .form-row {
  margin-bottom: 0;
}

.bt-parent > .form-row .form-field {
  margin-bottom: 0;
}

.bt-rh-hint {
  margin: var(--space-2) 0 0;
}

.bt-parent__adv {
  margin-top: var(--space-3);
  background: var(--color-surface);
}

.bt-parent__adv .adv__body {
  padding-top: var(--space-2);
}

.bt-parent__adv .form-row .form-field {
  margin-bottom: 0;
}

.bt-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bt-dist__title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--color-text);
}

.bt-rh-row {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-brand-muted);
  border-left: 4px solid var(--color-brand);
}

.bt-result-sub {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
}

.bt-geno-note {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

.bt-warn {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid #f0c36a;
  background: #fff8eb;
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.bt-warn strong {
  color: var(--color-warning);
}

.bt-viz .fb-chart-title {
  margin-bottom: var(--space-3);
}

.bt-punnett-lead {
  margin: 0 0 var(--space-4);
  font-size: 0.9375rem;
  line-height: var(--leading-body);
  color: var(--color-text-secondary);
  text-wrap: pretty;
}

.bt-punnett-wrap {
  width: 100%;
  overflow-x: auto;
}

.bt-punnett {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.875rem;
}

.bt-punnett__caption {
  caption-side: top;
  text-align: left;
  margin-bottom: var(--space-2);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

.bt-punnett th,
.bt-punnett td {
  border: 1px solid var(--color-border-strong);
  padding: var(--space-3);
  text-align: center;
  vertical-align: middle;
}

.bt-punnett__corner {
  width: 18%;
  background: var(--color-bg);
}

.bt-punnett thead th,
.bt-punnett tbody th {
  background: var(--color-brand-muted);
  font-weight: 700;
}

.bt-allele {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--color-brand);
  color: var(--color-on-brand);
  font-weight: 700;
}

.bt-punnett td {
  background: var(--color-surface);
}

.bt-punnett__geno {
  display: block;
  font-size: 1.05rem;
  color: var(--color-text);
}

.bt-punnett__pheno {
  display: block;
  margin-top: 2px;
  color: var(--color-text-secondary);
}

.bt-punnett__pct {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-brand);
}

.bt-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bt-bar__label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 6px;
  font-size: 0.9375rem;
}

.bt-bar__label strong {
  font-variant-numeric: tabular-nums;
}

.bt-bar__track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}

.bt-bar__track::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 24.5%, rgba(21, 32, 43, 0.06) 24.5%, rgba(21, 32, 43, 0.06) 25.5%, transparent 25.5%),
    linear-gradient(to right, transparent 49.5%, rgba(21, 32, 43, 0.1) 49.5%, rgba(21, 32, 43, 0.1) 50.5%, transparent 50.5%),
    linear-gradient(to right, transparent 74.5%, rgba(21, 32, 43, 0.06) 74.5%, rgba(21, 32, 43, 0.06) 75.5%, transparent 75.5%);
  pointer-events: none;
}

.bt-bar__fill {
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.bt-bar.is-zero .bt-bar__label {
  color: var(--color-text-muted);
}

.bt-bar.is-zero .bt-bar__track {
  background: #eef1f4;
}

.bt-bar__cross {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
}

/* —— 心血管风险计算器（China-PAR）—— */
.calc-shell--cvd {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

.calc-shell--cvd > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .calc-shell--cvd {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 左：输入；右：结果 + 仪表盘；下：干预图 / 免责声明贯通两列 */
  .calc-shell--cvd > .cvd-bars-panel,
  .calc-shell--cvd > .calc-shell__disclaimer {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* 并排字段：minmax 防止单位栏把控件撑出卡片 */
.calc-shell--cvd .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calc-shell--cvd .form-row .form-field,
.calc-shell--cvd .form-row .form-field__control,
.calc-shell--cvd .form-field,
.calc-shell--cvd .form-field__control {
  min-width: 0;
}

/* 血脂并排：单位栏略加宽以容纳 mmol/L，标签用短名避免挤爆 */
.calc-shell--cvd .cvd-lipid-row .form-field__unit {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  padding-inline: 0.25rem;
  font-size: 0.6875rem;
}

.calc-shell--cvd .form-field__unit {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  max-width: 40%;
  padding-inline: 0.35rem;
  font-size: 0.75rem;
}

.calc-shell--cvd .calc-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 40px;
  margin-bottom: var(--space-3);
}

.calc-panel__head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.cvd-lipid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-2);
}

.cvd-quick-intro {
  margin: 0 0 var(--space-3);
}

.cvd-age-warn {
  color: #b45309;
}

.cvd-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cvd-result-main {
  border-radius: var(--radius-md, 10px);
  padding: var(--space-4);
  background: var(--cvd-tone-bg, var(--color-brand-muted));
  border-left: 4px solid var(--cvd-tone-border, var(--color-brand));
}

.cvd-tone--low {
  --cvd-tone-bg: #ecfdf5;
  --cvd-tone-border: #16a34a;
}

.cvd-tone--moderate {
  --cvd-tone-bg: #fffbeb;
  --cvd-tone-border: #ca8a04;
}

.cvd-tone--high {
  --cvd-tone-bg: #fef2f2;
  --cvd-tone-border: #dc2626;
}

.cvd-result-main .result-main__value {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.cvd-level-line {
  margin: var(--space-2) 0 0;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.cvd-potential {
  font-size: 0.95rem !important;
  font-weight: 600;
  line-height: 1.45;
  text-wrap: pretty;
}

.cvd-lifetime {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.cvd-clinical {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm, 8px);
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.cvd-gauge-block {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.cvd-gauge-block .fb-chart-title,
.cvd-bars-panel .fb-chart-title {
  margin-top: 0;
}

.cvd-gauge,
.cvd-bars {
  min-height: 180px;
}

.cvd-gauge.is-empty,
.cvd-bars.is-empty {
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  background: #f8fafc;
  border-radius: var(--radius-md, 10px);
}

.cvd-gauge-svg .cvd-gauge-value {
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cvd-gauge-svg .cvd-gauge-sub {
  font-size: 0.75rem;
}

.cvd-gauge-svg .cvd-gauge-age {
  font-size: 0.8125rem;
  font-weight: 600;
}

.cvd-bars-svg .cvd-bar-val {
  font-size: 0.8125rem;
  font-weight: 700;
}

.cvd-bars-svg .cvd-bar-label {
  font-size: 0.75rem;
}

.cvd-bars-svg .cvd-bar-level {
  font-size: 0.6875rem;
}

.cvd-disclaimer {
  margin-top: 0;
}

/* —— Site wrap-up: mobile layout polish —— */
@media (max-width: 767px) {
  .seg-toggle {
    flex-wrap: wrap;
    width: 100%;
  }

  .seg-toggle button,
  .mort-group__mode .seg-toggle button,
  [data-mort-form] .seg-toggle button,
  .seg-toggle--sm button {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
    padding-block: 8px;
  }

  .mort-group__mode .seg-toggle {
    width: 100%;
  }

  .calc-shell--mort .calc-panel__head,
  .calc-shell--bmr .calc-panel__head,
  .calc-shell--ret .calc-panel__head,
  .calc-shell--pace .calc-panel__head,
  .calc-shell--bmi .calc-panel__head,
  .mort-schedule .calc-panel__head,
  .mort-charts .calc-panel__head,
  .mort-compare .calc-panel__head,
  .bmr-charts .calc-panel__head {
    height: auto;
    min-height: 40px;
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }

  .calc-shell--pace .time-inputs {
    flex-wrap: wrap;
  }
}

@media (max-width: 479px) {
  .calc-shell--ret .result-metric--hero .result-metric__value {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
