/* ===== BMI计算器 基础样式 ===== */
:root {
  --primary: #0e7a5f;
  --primary-dark: #0a5f4a;
  --primary-light: #e6f4f0;
  --accent: #f59e0b;
  --text: #263238;
  --text-light: #607080;
  --bg: #f6f8f9;
  --card: #ffffff;
  --border: #e3e9ec;
  --danger: #d64545;
  --warning: #e08a00;
  --ok: #0e7a5f;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(14, 82, 95, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}
.logo-text { font-size: 18px; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-light); font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--primary); text-decoration: none; border-bottom-color: var(--primary); }

/* ===== 通用区块 ===== */
.page-main { padding: 40px 0 60px; }
.section { padding: 36px 0; }
.section-title { font-size: 26px; margin-bottom: 8px; line-height: 1.4; }
.section-sub { color: var(--text-light); margin-bottom: 24px; }

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

/* ===== Hero + 计算器 ===== */
.hero { padding: 44px 0 10px; text-align: center; }
.hero h1 { font-size: 34px; margin-bottom: 12px; line-height: 1.35; }
.hero p { color: var(--text-light); max-width: 640px; margin: 0 auto; }

.calculator-wrap { padding: 28px 0 8px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: start; }

.calc-form .field { margin-bottom: 18px; }
.calc-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.calc-form label small { font-weight: 400; color: var(--text-light); }
.input-row { display: flex; align-items: center; gap: 10px; }
.input-row input {
  width: 100%;
  padding: 12px 14px;
  font-size: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}
.input-row input:focus { border-color: var(--primary); }
.input-row .unit { color: var(--text-light); font-size: 14px; white-space: nowrap; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-reset {
  margin-top: 10px;
  background: #fff;
  color: var(--text-light);
  border: 1px solid var(--border);
}
.btn-reset:hover { background: var(--bg); color: var(--text); }

.calc-result { text-align: center; }
.calc-result .bmi-big { font-size: 60px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.calc-result .bmi-cat { font-size: 20px; font-weight: 700; margin: 6px 0 4px; }
.calc-result .bmi-tip { color: var(--text-light); font-size: 14px; }
.cat-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.hidden { display: none !important; }

/* BMI 分类表 */
.bmi-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.bmi-table th, .bmi-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: center; font-size: 15px; }
.bmi-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.bmi-table tr.active { background: #fff8e6; font-weight: 700; }

/* ===== 常见问题 ===== */
.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--primary);
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-answer { padding: 0 22px 18px; color: var(--text-light); }

/* ===== 文章卡片 ===== */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-top: 24px; }
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.article-card:hover { border-color: var(--primary); }
.article-card h3 { font-size: 18px; line-height: 1.5; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--primary); }
.article-card p { color: var(--text-light); font-size: 15px; flex: 1; }
.article-card .read-more { font-weight: 600; font-size: 14px; }

/* ===== 文章详情 ===== */
.breadcrumb { font-size: 14px; color: var(--text-light); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.article-body { max-width: 780px; margin: 0 auto; }
.article-body h1 { font-size: 30px; margin-bottom: 10px; line-height: 1.4; }
.article-meta { color: var(--text-light); font-size: 14px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.article-body h2 { font-size: 22px; margin: 32px 0 12px; line-height: 1.4; }
.article-body h3 { font-size: 18px; margin: 24px 0 10px; }
.article-body p { margin-bottom: 14px; color: #37474f; }
.article-body ul, .article-body ol { margin: 0 0 14px 22px; }
.article-body li { margin-bottom: 6px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 12px; font-size: 15px; }
.article-body th { background: var(--primary-light); color: var(--primary-dark); }
.article-note { background: var(--primary-light); border-radius: 8px; padding: 14px 18px; font-size: 14px; color: var(--primary-dark); margin: 18px 0; }

.related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.related h2 { font-size: 20px; margin-bottom: 14px; }
.related ul { list-style: none; }
.related li { margin-bottom: 8px; }

/* ===== Footer ===== */
.site-footer { background: #1d2a30; color: #b8c4cb; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 44px 20px 24px; }
.footer-title { color: #fff; font-size: 16px; margin-bottom: 12px; }
.site-footer p { font-size: 14px; margin-bottom: 8px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #b8c4cb; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #33434b; padding: 16px 20px; font-size: 13px; color: #8fa0a8; }
.footer-bottom p { margin-bottom: 4px; }
.footer-bottom a { color: #b8c4cb; }


/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translate(-50%, -12px);
  background: #1d2a30;
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 300;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--danger); }

/* ===== 文章插图 ===== */
.figure { margin: 20px 0 26px; text-align: center; }
.figure svg {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.figure figcaption { font-size: 13px; color: var(--text-light); margin-top: 8px; }

/* ===== 响应式 ===== */
@media (max-width: 820px) {
  .calc-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 28px; }
  .section-title { font-size: 22px; }
}
@media (max-width: 560px) {
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 14px; }
  .logo-text { display: none; }
  .card { padding: 20px; }
  .bmi-big { font-size: 48px; }
}
