:root {
  --bg: #eef4f0;
  --card: #ffffff;
  --ink: #1f2a26;
  --muted: #5f6f68;
  --muted-2: #93a29b;
  --accent: #2f9e6e;
  --accent-2: #1f7a55;
  --danger: #e5484d;
  --border: #e3ebe6;
  --radius: 20px;
  --shadow: 0 8px 30px rgba(31, 42, 38, .08);
  --mono: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.ad-side {
  width: 200px;
  flex: 0 0 200px;
  min-height: 1px;
}

.main {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.page-head {
  text-align: center;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: .5px;
  background: linear-gradient(120deg, #1f2a26, #2f9e6e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-head .sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

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

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #3a4a43;
  margin-bottom: 6px;
}

.num-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7faf8;
  padding: 12px 14px;
  font-size: 18px;
  font-family: var(--mono);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.num-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 158, 110, .15);
}

.num-input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

.calc-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  padding: 13px 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(47, 158, 110, .3);
  transition: filter .15s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}

.calc-btn:hover { filter: brightness(1.07); }

.calc-btn:active { transform: scale(.98); }

.calc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.noscript {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
  margin: 12px 0 0;
}

.disclaimer {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.6;
}

.result {
  margin-top: 20px;
  background: linear-gradient(160deg, #1b2a24, #12201a);
  border-radius: 14px;
  padding: 20px 22px;
  color: #eef4f0;
  text-align: center;
}

.result-bmi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.result-label {
  font-size: 13px;
  color: #9fb8ac;
  letter-spacing: .05em;
}

.bmi-value {
  font-size: 46px;
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1.1;
}

.bmi-category {
  display: inline-block;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}

.bmi-category.under { background: #3b82f6; }
.bmi-category.normal { background: #22c55e; }
.bmi-category.over { background: #f59e0b; }
.bmi-category.obese { background: #ef4444; }

.bmi-advice {
  margin-top: 12px;
  font-size: 13.5px;
  color: #c3d4cc;
  line-height: 1.7;
}

.seo-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  margin-top: 22px;
}

.seo-section h2 { font-size: 20px; margin: 28px 0 14px; }

.seo-section h2:first-child { margin-top: 0; }

.seo-section p { color: #4a5a52; font-size: 14.5px; }

/* SEO 内容区（页面底部） */
.seo-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  color: #374151;
  font-size: 14px;
  line-height: 1.9;
}

.seo-content h2 {
  font-size: 17px;
  color: #1f2937;
  margin: 22px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.seo-content h2:first-child { margin-top: 0; }

.seo-content h3 {
  font-size: 14px;
  color: #1f2937;
  margin: 14px 0 4px;
}

.seo-content ul,
.seo-content ol { padding-left: 22px; }

.seo-content li { margin-bottom: 4px; }

.formula {
  text-align: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-2);
  background: #f0f7f3;
  border-radius: 10px;
  padding: 10px;
}

.table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

th {
  background: #f0f7f3;
  color: #2a3a32;
  font-weight: 700;
}

tbody tr:nth-child(even) { background: #fafcfb; }

.steps { margin: 0; padding-left: 22px; color: #4a5a52; font-size: 14.5px; }

.steps li { margin-bottom: 6px; }

details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #fafcfb;
}

details:last-of-type { margin-bottom: 0; }

summary { font-weight: 600; cursor: pointer; font-size: 15px; }

summary:hover { color: var(--accent); }

details p { color: #5c6b63; font-size: 14px; margin: 8px 0 0; }

@media (max-width: 1200px) {
  .ad-side { display: none; }
}

@media (max-width: 860px) {
  .page { padding: 16px 12px 40px; }

  .calc-card { padding: 18px 16px; }

  .seo-section { padding: 20px 18px; }

  .page-head h1 { font-size: 24px; }

  .page-head .sub { font-size: 13px; }

  .seo-section h2 { font-size: 18px; }

  .bmi-value { font-size: 38px; }
}
