:root {
  /* 主色：蓝白 */
  --blue: #206bc4;
  --blue-600: #1a5a9e;
  --blue-50: #eef4fb;
  --blue-100: #dbe9f7;
  /* 亮色点缀 */
  --teal: #0ca678;
  --teal-50: #e6f7f1;
  --indigo: #5b6bdc;
  --indigo-50: #eceefc;
  --amber: #f59e0b;
  --amber-50: #fef3e2;
  --coral: #f0506e;
  --coral-50: #fdeaee;
  /* 状态 */
  --green: #1f9d57;
  --green-50: #e7f6ee;
  --red: #e03131;
  --red-50: #fdeaea;
  /* 中性 */
  --bg: #f5f8fc;
  --surface: #ffffff;
  --border: #e3e9f1;
  --border-strong: #cdd7e3;
  --text: #1f2a37;
  --muted: #6b7785;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

/* ===== 顶部品牌栏 + 阶段导航（稳定外壳） ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-top {
  max-width: 860px;
  margin: 0 auto;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
}
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 15.5px; }

.brand-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11.5px;
  color: #8a5a00;
  background: var(--amber-50);
  border: 1px solid #f1d59c;
  padding: 5px 11px;
  border-radius: 999px;
  line-height: 1.35;
  max-width: 50%;
  text-align: center;
}
.back-link {
  margin-left: auto;
  font-size: 13.5px;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}
.back-link:active { opacity: .7; }

.stage-nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 12px 9px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stage-nav::-webkit-scrollbar { display: none; }
.stage-pill {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 20px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s ease;
}
.stage-pill:hover { border-color: var(--blue-100); color: var(--blue); }
.stage-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 500;
}

/* ===== 容器 / 页面标题 ===== */
.container { max-width: 860px; margin: 0 auto; padding: 16px; }
.crumb { font-size: 12.5px; color: var(--blue); margin-bottom: 4px; font-weight: 500; }
.page-title { font-size: 20px; font-weight: 600; margin: 0; }
.page-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 14px; }

/* ===== 首页引导卡 ===== */
.intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.intro-title { font-weight: 600; font-size: 15px; }
.intro-text { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ===== 阶段面板 ===== */
.stage-panel { display: none; }
.stage-panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stage-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex: 0 0 auto;
}
.stage-title { font-weight: 600; font-size: 16px; }
.stage-desc { font-size: 12.5px; color: var(--muted); }

/* ===== 工具卡片网格 ===== */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow);
  transition: transform .08s ease, border-color .12s ease;
}
.tool-card:active { transform: scale(.985); }
.tool-card:hover { border-color: var(--blue-100); }
.tool-card .ic { font-size: 24px; }
.tool-card .t { font-weight: 600; font-size: 14.5px; margin-top: 4px; }
.tool-card .d { font-size: 12px; color: var(--muted); }
.tool-card .badge {
  align-self: flex-start;
  margin-top: 8px;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 11px;
  font-weight: 500;
}
.badge.warn { background: var(--amber-50); color: #b8740a; }

.tool-card.empty {
  border-style: dashed;
  background: #fbfcfe;
  box-shadow: none;
  opacity: .92;
}
.tool-card.empty .ic { filter: grayscale(.4); opacity: .7; }

.stage-hint { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }

/* ===== 计算器面板（plan/verify 内部沿用） ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 12px; font-size: 15px; }

.tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: 8px;
  background: var(--blue-50);
  color: var(--blue);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
}
.tab.active { background: var(--blue); color: #fff; font-weight: 500; }

label { display: block; font-size: 13px; margin: 12px 0 4px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }

.btn {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  margin-top: 16px;
  cursor: pointer;
  font-weight: 500;
}
.btn:active { background: var(--blue-600); }

.result { margin-top: 16px; display: none; }
.result.show { display: block; }
.result .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.result .row .k { color: var(--muted); flex: 0 0 auto; }
.result .row .v { font-weight: 600; text-align: right; }
.verdict {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  padding: 13px;
  border-radius: 10px;
  margin: 12px 0;
}
.verdict.ok { background: var(--green-50); color: var(--green); }
.verdict.no { background: var(--red-50); color: var(--red); }

.disclaimer {
  background: var(--red-50);
  border: 1px solid #f3b5b5;
  color: #b33939;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 18px;
  line-height: 1.5;
}
.tip { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ===== 关注我们区块（footer 内） ===== */
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.follow { max-width: 380px; margin: 0 auto 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.follow-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.follow-qr { display: block; width: 140px; height: 140px; margin: 0 auto 8px; border: 1px solid var(--border); border-radius: 8px; object-fit: cover; }
.follow-qr-ph { width: 140px; height: 140px; margin: 0 auto 8px; border: 1px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--muted); padding: 8px; }
.follow-desc { font-size: 12px; color: var(--muted); text-align: center; }
.follow-article { display: inline-block; margin: 0 auto 8px; font-size: 13px; color: var(--blue); text-decoration: none; border: 1px solid var(--blue-100); background: var(--blue-50); border-radius: 14px; padding: 5px 12px; }
.follow-article:hover { background: var(--blue-100); }
.follow-article.empty { color: var(--muted); border-color: var(--border); background: #f5f7fa; cursor: default; }

/* 方法学原理引导块（plan 页） */
.principle { margin-top: 18px; padding: 14px 16px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius); text-align: left; }
.principle-title { font-weight: 600; font-size: 14px; color: var(--blue); margin-bottom: 6px; }
.principle-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.principle-qr { display: block; width: 120px; height: 120px; margin: 10px auto 0; border: 1px solid var(--border); border-radius: 8px; object-fit: cover; }

/* 分享结果按钮 */
.share-bar { margin-top: 14px; }
.share-btn { width: 100%; padding: 11px; background: #fff; color: var(--blue); border: 1px solid var(--blue); border-radius: 10px; font-size: 15px; cursor: pointer; }
.share-btn:active { background: var(--blue-50); }

/* 复制链接 Toast */
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: rgba(31, 42, 55, .92); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; }

/* 微信内分享提示浮层 */
.wx-tip { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 200; display: flex; align-items: flex-start; justify-content: flex-end; }
.wx-tip-box { margin: 10px 14px; background: #fff; padding: 14px 18px; border-radius: 10px; font-size: 14px; line-height: 1.6; position: relative; max-width: 240px; text-align: left; }
.wx-tip-box span { position: absolute; top: 4px; right: 10px; font-size: 18px; color: var(--muted); cursor: pointer; }
