:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7a8d;
  --accent: #18a06a;
  --accent-dark: #0f7d52;
  --border: #e4ebe7;
  --thin: #4a90d9;
  --normal: #18a06a;
  --over: #f5a623;
  --obese: #e5533c;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.app-header { text-align: center; margin-bottom: 24px; }
.app-header h1 { font-size: 26px; font-weight: 700; letter-spacing: 1px; text-shadow: 0 1px 3px rgba(255,255,255,0.9), 0 0 14px rgba(255,255,255,0.75); }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 6px; text-shadow: 0 1px 3px rgba(255,255,255,0.9), 0 0 10px rgba(255,255,255,0.7); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 6px 24px rgba(31, 41, 51, 0.06);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.field { margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 22px; }

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* 性别分段选择 */
.seg {
  display: flex;
  background: #eef2f0;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 0;
  font-size: 15px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s ease;
}
.seg-btn.active {
  background: var(--card);
  color: var(--accent-dark);
  box-shadow: 0 2px 6px rgba(31, 41, 51, 0.10);
}

/* 输入框 */
.input-wrap {
  position: relative;
}
.input-wrap input {
  width: 100%;
  padding: 13px 52px 13px 14px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: #fbfdfc;
}
.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 160, 106, 0.12);
}
.input-wrap .unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.submit-btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: background 0.15s ease;
}
.submit-btn:hover { background: var(--accent-dark); }
.submit-btn:active { transform: translateY(1px); }

/* 结果 */
.result { text-align: center; }
.hidden { display: none; }

.bmi-value { margin-bottom: 6px; }
.bmi-label { display: block; color: var(--muted); font-size: 13px; }
.bmi-number {
  display: block;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}
.category {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.category.c-thin { background: rgba(74,144,217,0.12); color: var(--thin); }
.category.c-normal { background: rgba(24,160,106,0.12); color: var(--normal); }
.category.c-over { background: rgba(245,166,35,0.14); color: #b57a00; }
.category.c-obese { background: rgba(229,83,60,0.12); color: var(--obese); }

/* 刻度条 */
.scale { margin-bottom: 18px; }
.scale-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
.scale-zone { flex: 1; }
.zone-thin { background: var(--thin); }
.zone-normal { background: var(--normal); }
.zone-over { background: var(--over); }
.zone-obese { background: var(--obese); }

.scale-marker {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 18px;
  background: #1f2933;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.4s ease;
}
.scale-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.desc { color: var(--text); font-size: 15px; line-height: 1.7; text-align: left; }
.next-hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  background: #f2f6f4;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  line-height: 1.6;
}

/* 基础代谢 */
.bmr {
  margin-top: 16px;
  padding: 16px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eaf6f0, #f4fbf8);
  border: 1px solid #d3e9de;
}
.bmr-head { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.bmr-value { font-size: 34px; font-weight: 800; color: var(--accent-dark); }
.bmr-unit { font-size: 14px; font-weight: 600; color: var(--muted); }
.bmr-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
}

.footnote {
  text-align: center;
  color: #7c8a99;
  font-size: 12px;
  margin-top: 8px;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}

@media (max-width: 360px) {
  .bmi-number { font-size: 44px; }
}
