/* ============================================================
   知健康 · 体检卡商城 - 共享样式表（全站统一一份）
   主题：清爽医疗浅色（每页可在 <style> 覆盖 accent）
   规则：圆角体系 = 面板 12px / 交互元素胶囊
   ============================================================ */

:root {
  /* 表面 */
  --bg: #f6faf9;
  --bg-raised: #ffffff;
  --bg-inset: #eef5f3;
  --border: #dfe9e6;
  --border-soft: #e9f1ee;
  --border-strong: #c5d6d0;

  /* 文字 */
  --text: #16241f;
  --text-2: #4e6058;
  --text-3: #7c8d86;

  /* 主题色（每页在 <style> 中覆盖） */
  --accent: #0d9488;
  --accent-rgb: 13, 148, 136;
  --on-accent: #ffffff;

  /* 价格色 */
  --price: #e0492f;
  --price-rgb: 224, 73, 47;

  /* 字体 */
  --font-sans: "Segoe UI Variable Display", "Segoe UI", -apple-system,
    BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  /* 布局 */
  --content-max: 1160px;
  --nav-h: 60px;
  --radius: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(22, 36, 31, 0.05), 0 8px 24px rgba(22, 36, 31, 0.07);
  --shadow-hover: 0 2px 6px rgba(22, 36, 31, 0.08), 0 14px 34px rgba(22, 36, 31, 0.12);
}

/* ---------------- reset ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(var(--accent-rgb), 0.22);
  color: var(--text);
}

/* 阅读进度条 */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 90;
  background: rgba(var(--accent-rgb), 0.9);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@supports (animation-timeline: scroll()) {
  .reading-progress {
    animation: progress-grow linear both;
    animation-timeline: scroll(root block);
  }
}

@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------------- 顶部导航 ---------------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.topnav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), 0.7));
  position: relative;
  flex-shrink: 0;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2.5px solid var(--on-accent);
  border-top-color: transparent;
  transform: rotate(-45deg);
}

.brand-name {
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-3);
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav-links a {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.topnav-links a:hover,
.topnav-links a.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.09);
}

.topnav-cta {
  flex-shrink: 0;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.32);
}

.btn-primary:hover { box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.42); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.btn-ghost:hover { background: rgba(var(--accent-rgb), 0.08); }

.btn-sm { padding: 7px 16px; font-size: 13.5px; }
.btn-lg { padding: 13px 30px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(var(--accent-rgb), 0.14), transparent 65%),
    radial-gradient(700px 360px at 8% 0%, rgba(var(--accent-rgb), 0.08), transparent 60%);
  border-bottom: 1px solid var(--border-soft);
}

.hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 64px 24px 56px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.25;
  letter-spacing: 0.01em;
  font-weight: 800;
}

.hero-desc {
  margin: 0 0 24px;
  color: var(--text-2);
  font-size: 16px;
  max-width: 560px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: 13.5px;
  color: var(--text-2);
}

.chip b { color: var(--accent); font-weight: 700; }

.chip-cta {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.32);
}

.chip-cta:hover { transform: translateY(-1px); }

.hero-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}

.hero-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.hero-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 14px;
}

.hero-panel li + li { margin-top: 8px; }
.hero-panel b { color: var(--text); }

/* ---------------- 布局 ---------------- */
.layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.layout-toc {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 40px;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  font-size: 13.5px;
}

.toc-title {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
}

.toc a { color: var(--text-2); }
.toc a:hover, .toc a.active { color: var(--accent); }

/* ---------------- 章节 ---------------- */
.chapter { margin-bottom: 64px; }

.chapter-head { margin-bottom: 26px; }

.chapter-no {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}

h2 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0;
  color: var(--text-2);
  max-width: 720px;
}

/* ---------------- 产品卡片 ---------------- */
.topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--topic-rgb, var(--accent-rgb)), 1), rgba(var(--topic-rgb, var(--accent-rgb)), 0.35));
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(var(--topic-rgb, var(--accent-rgb)), 0.4);
}

.topic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-no {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(var(--topic-rgb, var(--accent-rgb)), 1);
  background: rgba(var(--topic-rgb, var(--accent-rgb)), 0.1);
  padding: 3px 11px;
  border-radius: var(--radius-pill);
}

.topic-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--price);
  background: rgba(var(--price-rgb), 0.09);
  padding: 3px 11px;
  border-radius: var(--radius-pill);
}

.topic-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.topic-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.topic-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.topic-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.topic-price .now {
  font-size: 24px;
  font-weight: 800;
  color: var(--price);
}

.topic-price .now::before {
  content: "¥";
  font-size: 14px;
  font-weight: 700;
  margin-right: 1px;
}

.topic-price .was {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: line-through;
}

.topic-go {
  font-size: 14px;
  font-weight: 600;
  color: rgba(var(--topic-rgb, var(--accent-rgb)), 1);
}

/* ---------------- 流程步骤 ---------------- */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.flow-step {
  display: flex;
  gap: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.step-dot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body h4 {
  margin: 2px 0 6px;
  font-size: 15.5px;
}

.step-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
}

/* ---------------- 详情页 ---------------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 32px;
  align-items: start;
}

.detail-main h2 {
  margin-top: 0;
}

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h3::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}

.panel ul,
.panel ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 14.5px;
}

.panel li + li { margin-top: 7px; }

.panel b, .panel strong { color: var(--text); }

.buy-panel {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.buy-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.buy-price .now {
  font-size: 40px;
  font-weight: 800;
  color: var(--price);
  line-height: 1;
}

.buy-price .now::before {
  content: "¥";
  font-size: 20px;
  font-weight: 700;
}

.buy-price .was {
  color: var(--text-3);
  text-decoration: line-through;
  font-size: 15px;
}

.buy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.buy-tags .chip { font-size: 12.5px; padding: 5px 12px; }

.buy-note {
  font-size: 12.5px;
  color: var(--text-3);
  margin: 12px 0 0;
  line-height: 1.7;
}

/* 项目清单表格 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.spec-table th {
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:first-child { white-space: nowrap; font-weight: 600; color: var(--text); }
.spec-table td:last-child { color: var(--text-2); }

/* 常见问题 */
.faq details {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 40px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
}

.faq details[open] summary::after { content: "–"; }

.faq .faq-a {
  padding: 0 18px 16px;
  color: var(--text-2);
  font-size: 14.5px;
  margin: 0;
}

/* ---------------- 页脚 ---------------- */
.pagefoot {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-raised);
}

.pagefoot-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 24px 28px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.pager-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s, transform 0.15s;
}

.pager-card.next:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  transform: translateY(-2px);
}

.pager-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pager-title {
  display: block;
  font-weight: 700;
  font-size: 15.5px;
}

.pager-desc {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.pagefoot-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------------- 购买弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(10, 22, 18, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-mask.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-raised);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 28px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s;
  box-shadow: 0 24px 60px rgba(10, 22, 18, 0.3);
}

.modal-mask.open .modal { transform: none; }

.modal h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.modal .modal-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--text-2);
}

.modal-field {
  margin-bottom: 14px;
}

.modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-2);
}

.modal-field input,
.modal-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-field input:focus,
.modal-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.modal-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 13.5px;
  line-height: 1.6;
}

.modal-msg.show { display: block; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal { position: relative; }

/* ---------------- 浮动客服 ---------------- */
.float-consult {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.float-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.4);
  transition: transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  font-family: inherit;
}

.float-btn:hover { transform: translateY(-2px); }
.float-btn.back { background: var(--bg-raised); color: var(--text-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-card); }

/* ---------------- 关注我们 ---------------- */
.follow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 640px;
}

.follow-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.follow-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 36, 66, 0.45);
}

.follow-card img {
  width: 200px;
  margin: 0 auto 12px;
  border-radius: 8px;
}

.follow-card h4 { margin: 0 0 4px; font-size: 16px; }
.follow-card p { margin: 0; font-size: 13.5px; color: var(--text-2); }

/* 小红书 / 微信浮动按钮 */
.float-btn.xhs {
  background: #ff2442;
  box-shadow: 0 8px 22px rgba(255, 36, 66, 0.4);
}

.float-btn.wechat {
  background: #07c160;
  box-shadow: 0 8px 22px rgba(7, 193, 96, 0.4);
}

/* 联系方式弹窗（小红书 / 微信共用） */
.xhs-card,
.wechat-card { max-width: 320px; text-align: center; }

.xhs-qr,
.wechat-qr {
  width: 240px;
  margin: 4px auto 14px;
  border-radius: 10px;
}

.xhs-card h3,
.wechat-card h3 { margin: 0 0 4px; }

.xhs-meta,
.wechat-meta {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-2);
}

.xhs-tip,
.wechat-tip {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------------- 滚动浮现 ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 44px 24px 40px; }
  .layout-toc { grid-template-columns: 1fr; }
  .toc { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .buy-panel { position: static; }
  .pager { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topnav-links { display: none; }
  .topnav-cta { display: none; }
  h1 { font-size: 28px; }
}
