/* =========================================================
   轻健计算器 FitWell Calc — 全局样式
   设计基调：米白 / 浅灰背景 + 青绿（主）+ 珊瑚橙（辅）
   氛围：清新、友好、可信赖，像健康 App 的工具页
   ========================================================= */

:root {
  /* 颜色 */
  --bg: #f7faf9;
  --bg-alt: #f1f7f5;
  --surface: #ffffff;
  --surface-soft: #eef7f5;      /* 结果面板浅青绿 */
  --border: #e2ece9;
  --border-strong: #cfe3de;

  --text: #1d2b28;
  --text-soft: #4d625d;
  --muted: #7b8d88;

  --primary: #12a594;
  --primary-dark: #0d8478;
  --primary-soft: #e3f5f2;
  --accent: #ff7a59;
  --accent-dark: #ee5f3c;
  --accent-soft: #ffeee8;

  --warn: #e8a33d;
  --ok: #38a169;

  /* 圆角与阴影 */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(29, 43, 40, .05);
  --shadow: 0 6px 18px rgba(29, 43, 40, .07);
  --shadow-hover: 0 14px 32px rgba(18, 165, 148, .16);

  /* 字体 */
  --font: "Inter", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0 0 .5em;
}
p { margin: 0 0 1em; }

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

.num, .stat-num, td.num, th.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--primary);
  color: #fff; padding: 10px 16px; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border: 1px solid transparent; border-radius: 999px;
  font-size: 15px; font-weight: 600; font-family: var(--font);
  cursor: pointer; text-decoration: none; transition: all .18s ease;
  background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--primary-dark); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.result-empty svg { width: 40px; height: 40px; color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- 页头 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #3ec9b6); color: #fff; flex: none;
}
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .04em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600;
  color: var(--text-soft);
}
.nav a:hover { background: var(--primary-soft); color: var(--primary-dark); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav a.btn { padding: 10px 18px; margin-left: 8px; color: #fff; background: var(--primary); }
.nav a.btn:hover { background: var(--primary-dark); color: #fff; }
.nav-toggle {
  display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: #fff; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 3px auto; background: var(--text); border-radius: 2px; }

/* ---------------- 面包屑 ---------------- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb span { margin: 0 6px; opacity: .6; }

/* ---------------- Hero ---------------- */
.hero { padding: 72px 0 56px; text-align: center; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-dark); margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); letter-spacing: -.025em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--text-soft); max-width: 640px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-size: 13px; color: var(--muted); }

/* ---------------- 通用区块 ---------------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(24px, 3.2vw, 34px); }
.section-head p { color: var(--text-soft); max-width: 620px; margin: 0 auto; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px; }

/* ---------------- 卡片网格 ---------------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 26px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--text-soft); font-size: 15px; margin-bottom: 14px; }
.card-link { display: inline-block; font-weight: 600; font-size: 15px; color: var(--primary-dark); }

.tool-card { display: flex; flex-direction: column; }
.tool-icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark); margin-bottom: 16px;
}
.tool-icon.alt { background: var(--accent-soft); color: var(--accent-dark); }
.tool-example {
  margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border-strong);
  font-size: 13px; color: var(--muted);
}
.tool-example strong { font-family: var(--font-num); color: var(--text-soft); font-weight: 600; }

/* 适用人群 */
.audience-card { text-align: left; }
.audience-card .tool-icon { margin-bottom: 14px; }
.audience-card h3 { font-size: 17px; }
.audience-card p { margin-bottom: 0; font-size: 14.5px; }

/* 博客卡片 */
.post-card h3 { font-size: 18px; }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-family: var(--font-num); }
.post-excerpt { color: var(--text-soft); font-size: 15px; }

/* FAQ 预览 */
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px 22px; margin-bottom: 14px;
}
.faq-item h3 { font-size: 16.5px; margin-bottom: 6px; }
.faq-item p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* ---------------- 工具页布局 ---------------- */
.tool-layout {
  display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 26px;
  align-items: start; padding: 26px 0 60px;
}
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm);
}
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 18px; }
.panel-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.panel-result { background: var(--surface-soft); border-color: var(--border-strong); }
.panel-result .panel-title .dot { background: var(--accent); }

/* 表单 */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; }
.field .hint { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.input, .select {
  width: 100%; padding: 11px 14px; font-size: 16px; font-family: var(--font);
  color: var(--text); background: #fff;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input.num-input { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.input:focus, .select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.segmented { display: flex; gap: 8px; }
.segmented button {
  flex: 1; padding: 10px 8px; font-size: 14.5px; font-weight: 600; font-family: var(--font);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-soft);
  border-radius: var(--r-sm); cursor: pointer; transition: all .15s;
}
.segmented button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* 结果区 */
.result-empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.result-empty svg { margin-bottom: 12px; opacity: .55; }
.result-empty p { font-size: 14.5px; margin: 0; }

.result-headline { text-align: center; padding: 6px 0 18px; }
.result-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.result-big {
  font-family: var(--font-num); font-size: clamp(40px, 7vw, 58px); font-weight: 700;
  line-height: 1.05; color: var(--primary-dark); letter-spacing: -.02em;
}
.result-big small { font-size: .34em; font-weight: 600; color: var(--text-soft); margin-left: 6px; }
.result-tag {
  display: inline-block; margin-top: 10px; padding: 5px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; background: #fff; color: var(--text);
  border: 1px solid var(--border-strong);
}
.result-tag.good { background: #e6f6ee; color: #237a4d; border-color: #bfe6d1; }
.result-tag.warn { background: #fdf3e2; color: #97631a; border-color: #f4dfb8; }
.result-tag.risk { background: var(--accent-soft); color: var(--accent-dark); border-color: #ffd5c6; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-box { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.stat-box .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-box .stat-num { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.25; margin-top: 2px; }
.stat-box .stat-unit { font-size: 13px; font-weight: 600; color: var(--text-soft); margin-left: 3px; }
.stat-box .stat-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat-box.highlight { border-color: var(--primary); background: linear-gradient(180deg, #fff, var(--primary-soft)); }
.stat-box.highlight .stat-num { color: var(--primary-dark); }
.stat-box.alt-highlight { border-color: var(--accent); background: linear-gradient(180deg, #fff, var(--accent-soft)); }
.stat-box.alt-highlight .stat-num { color: var(--accent-dark); }

.sub-title { font-size: 15px; font-weight: 700; margin: 24px 0 10px; color: var(--text); }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
table.data thead th {
  background: var(--bg-alt); font-weight: 700; font-size: 13.5px; color: var(--text-soft);
  text-align: left; white-space: nowrap;
}
table.data th.num, table.data td.num { text-align: right; }
table.data tbody tr:nth-child(even) { background: #fbfdfc; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tr.is-current { background: var(--primary-soft) !important; font-weight: 600; }
table.data td .badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--bg-alt); color: var(--text-soft);
}
table.data td .badge.good { background: #e6f6ee; color: #237a4d; }
table.data td .badge.warn { background: #fdf3e2; color: #97631a; }
table.data td .badge.risk { background: var(--accent-soft); color: var(--accent-dark); }

/* 进度条 */
.bar { height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.bar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-soft); }
.bar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

.note-box {
  background: #fff; border: 1px solid var(--border-strong); border-left: 4px solid var(--primary);
  border-radius: var(--r-sm); padding: 14px 16px; font-size: 14px; color: var(--text-soft); margin-top: 20px;
}
.note-box.accent { border-left-color: var(--accent); }
.note-box strong { color: var(--text); }

/* ---------------- 内容页（Markdown 渲染） ---------------- */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; padding: 26px 0 64px; align-items: start; }
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 40px; box-shadow: var(--shadow-sm); }
.page-head { padding: 34px 0 6px; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 10px; }
.page-lead { font-size: 17px; color: var(--text-soft); max-width: 760px; }
.article h2 { font-size: 22px; margin-top: 1.7em; padding-top: .3em; }
.article h3 { font-size: 18px; margin-top: 1.4em; }
.article h2 + p, .article h3 + p { margin-top: .4em; }
.article ul, .article ol { padding-left: 1.25em; margin: 0 0 1.1em; }
.article li { margin-bottom: .45em; }
.article blockquote {
  margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--primary);
  background: var(--surface-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-soft);
}
.article blockquote p:last-child { margin-bottom: 0; }
.article hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.article code {
  font-family: var(--font-num); font-size: .92em; background: var(--bg-alt);
  padding: 2px 6px; border-radius: 6px; color: var(--primary-dark);
}
.article table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14.5px; }
.article table th { background: var(--bg-alt); text-align: left; padding: 10px 12px; font-size: 13.5px; }
.article table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.article table tbody tr:nth-child(even) { background: #fbfdfc; }
.article .table-wrap { margin: 1.2em 0; }

.toc { position: sticky; top: 90px; }
.toc-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.toc-box h4 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc-box ol { list-style: none; padding: 0; margin: 0; font-size: 14.5px; }
.toc-box li { margin-bottom: 8px; }
.toc-box a { color: var(--text-soft); }
.toc-box a:hover { color: var(--primary-dark); }
.toc-cta { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.related { background: var(--surface-soft); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 24px; margin-top: 28px; }
.related h3 { font-size: 17px; margin-bottom: 12px; }
.related ul { padding-left: 1.1em; margin: 0; font-size: 15px; }
.related li { margin-bottom: 6px; }

.post-list { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--bg-alt); font-size: 13px; color: var(--text-soft); margin: 0 6px 6px 0; }
.pill.accent { background: var(--accent-soft); color: var(--accent-dark); }

/* FAQ 总览 */
.faq-group { margin-bottom: 30px; }
.faq-group h2 { font-size: 20px; margin-bottom: 14px; }

/* 联系页 */
.contact-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px 0; border-bottom: 1px dashed var(--border-strong); }
.contact-card:last-child { border-bottom: none; }
.contact-card h3 { font-size: 16px; margin-bottom: 4px; }
.contact-card p { margin: 0; font-size: 14.5px; color: var(--text-soft); }

/* ---------------- 页脚 ---------------- */
.site-footer { background: #fff; border-top: 1px solid var(--border); margin-top: 40px; padding: 52px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr 1fr; gap: 32px; padding-bottom: 36px; }
.footer-col h4 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0 0 14px; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: 14.5px; color: var(--text-soft); }
.footer-col a:hover { color: var(--primary-dark); }
.footer-brand { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 10px; display: block; }
.footer-about { font-size: 14.5px; color: var(--text-soft); max-width: 300px; }
.footer-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.footer-badges span {
  font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
}
.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0 34px; text-align: center; }
.footer-bottom p { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .tool-layout { grid-template-columns: 1fr; }
  .content-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border); flex-direction: column;
    align-items: stretch; padding: 12px 24px 20px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 6px; border-radius: var(--r-sm); }
  .nav-toggle { display: block; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero { padding: 46px 0 36px; }
  .section { padding: 40px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 26px; }
  .article { padding: 24px 20px; border-radius: var(--r-lg); }
  .panel { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
