/* ============================================================
   肠专家 changzhuanjia.cn —— 设计系统
   暖米纸 / 深紫 / 辅助紫 / 鎏金 / 墨
   ============================================================ */

:root {
  --paper: #FAF6EF;
  --paper-deep: #F3EDDF;
  --purple: #4B2E83;
  --purple-soft: #7A5FB5;
  --gold: #C9A227;
  --gold-soft: #E4CE7A;
  --ink: #2E2445;
  --ink-light: #6B6284;
  --card-radius: 24px;
  --shadow-soft: 0 10px 30px rgba(75, 46, 131, 0.10);
  --shadow-lift: 0 18px 44px rgba(75, 46, 131, 0.16);
  --font-title: "Noto Serif SC", "STSong", "SimSun", serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--gold-soft); color: var(--ink); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250, 246, 239, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.nav-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  color: var(--purple);
  white-space: nowrap;
}

.brand svg { flex: none; }

.brand small {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-light);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--ink-light);
  white-space: nowrap;
  transition: color 0.25s, background 0.25s;
}

.nav-links a:hover { color: var(--purple); background: rgba(122, 95, 181, 0.08); }

.nav-links a.active {
  color: var(--purple);
  font-weight: 600;
  background: rgba(75, 46, 131, 0.08);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.nav-page {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--gold);
  white-space: nowrap;
  padding-left: 8px;
  border-left: 1px solid rgba(201, 162, 39, 0.4);
}

/* ---------- 布局容器 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

main { padding-top: var(--nav-h); }

section { padding: 96px 0; }

.section-label {
  writing-mode: vertical-rl;
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--gold);
  border-right: 1px solid rgba(201, 162, 39, 0.5);
  padding-right: 12px;
}

.gold-divider {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.55), transparent);
  margin: 0 auto;
  max-width: 720px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 64px 28px 72px;
}

.hero-kicker {
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--gold);
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 700;
  color: var(--purple);
  line-height: 1.35;
  margin-bottom: 22px;
}

.hero .sub {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--ink-light);
  max-width: 620px;
}

.hero-art {
  margin-top: 44px;
  width: 100%;
  max-width: 980px;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 1px solid rgba(201, 162, 39, 0.25);
}

.hero-art img { width: 100%; height: auto; }

.scroll-hint {
  margin-top: 40px;
  color: var(--gold);
  font-size: 22px;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---------- 症状卡（第 1 页） ---------- */
.symptom-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.symptom-head h2 {
  font-family: var(--font-title);
  font-size: clamp(26px, 3.4vw, 36px);
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 20px;
}

.counter {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--purple);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  padding: 10px 24px;
  white-space: nowrap;
}
.counter b { color: var(--gold); font-size: 24px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.sym-card {
  position: relative;
  background: #fff;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sym-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }

.sym-card.selected {
  border-color: var(--purple);
  box-shadow: 0 18px 44px rgba(75, 46, 131, 0.22);
}

.sym-card .badge {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  background: var(--gold);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.45);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sym-card.selected .badge { opacity: 1; transform: scale(1); }

.sym-card img {
  width: 100%;
  aspect-ratio: 1024 / 914;
  object-fit: cover;
}

.sym-card .body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }

.sym-card h3 {
  font-family: var(--font-title);
  font-size: 21px;
  color: var(--purple);
  margin-bottom: 8px;
}

.sym-card p { color: var(--ink-light); font-size: 15px; flex: 1; }

.sym-card .pick {
  align-self: flex-end;
  margin-top: 16px;
  border: 1.5px solid var(--purple-soft);
  color: var(--purple);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.sym-card .pick:hover { background: rgba(122, 95, 181, 0.1); }

.sym-card.selected .pick {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

/* 提示条 */
.hint-bar {
  margin-top: 44px;
  background: linear-gradient(120deg, var(--purple), #5d3d9e);
  color: #fff;
  border-radius: var(--card-radius);
  padding: 30px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lift);
  /* 默认隐藏，由 JS 在 >=2 条时展开；无 JS 时保持隐藏不影响阅读 */
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.5s ease, margin 0.5s ease, opacity 0.5s ease;
}

.hint-bar.show {
  max-height: 300px;
  padding: 30px 36px;
  margin-top: 44px;
  opacity: 1;
}

.hint-bar .text {
  font-family: var(--font-title);
  font-size: clamp(18px, 2.4vw, 24px);
}

.btn-gold {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 13px 32px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.4);
  transition: transform 0.25s, box-shadow 0.25s;
  white-space: nowrap;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(201, 162, 39, 0.5); }

.btn-ghost {
  display: inline-block;
  border: 1.5px solid var(--purple);
  color: var(--purple);
  font-weight: 600;
  font-size: 16px;
  padding: 13px 32px;
  border-radius: 999px;
  transition: background 0.25s, color 0.25s, transform 0.25s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--purple); color: #fff; transform: translateY(-2px); }

/* ---------- 叙事段（第 2 页） ---------- */
.story { padding: 72px 0; }

.story-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.story-row.flip .story-media { order: 2; }

.story-media {
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 1px solid rgba(201, 162, 39, 0.25);
}
.story-media img { width: 100%; height: auto; }

.story-text .num {
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 14px;
}

.story-text h3 {
  font-family: var(--font-title);
  font-size: clamp(24px, 3vw, 32px);
  color: var(--purple);
  line-height: 1.5;
  margin-bottom: 18px;
}

.story-text p { color: var(--ink-light); font-size: 16.5px; }

.story-quote {
  border-left: 3px solid var(--gold);
  padding-left: 20px;
  font-family: var(--font-title);
  color: var(--purple);
  font-size: 17.5px;
}

/* ---------- 链条图（第 2 页） ---------- */
.chain { max-width: 560px; margin: 0 auto; }

.chain-step {
  background: #fff;
  border: 1.5px solid rgba(122, 95, 181, 0.3);
  border-radius: 18px;
  padding: 18px 28px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 19px;
  color: var(--purple);
  box-shadow: var(--shadow-soft);
}

.chain-step.final {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--gold-soft);
  font-size: 21px;
}

.chain-arrow {
  display: flex;
  justify-content: center;
  padding: 6px 0;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
}

/* ---------- 5R 卡（第 3 页） ---------- */
.r-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.r-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-soft);
  border-top: 4px solid var(--gold);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.r-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }

.r-card .r-letter {
  font-family: var(--font-title);
  font-size: 52px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 12px;
}

.r-card h3 {
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--purple);
  margin-bottom: 10px;
}
.r-card h3 span { color: var(--ink-light); font-size: 16px; font-family: var(--font-body); margin-left: 8px; }

.r-card p { color: var(--ink-light); font-size: 15px; }

/* ---------- 金句横幅 ---------- */
.quote-banner {
  background: linear-gradient(120deg, var(--purple) 0%, #5d3d9e 60%, var(--purple-soft) 130%);
  color: #F6EFDD;
  border-radius: var(--card-radius);
  padding: 56px 60px;
  box-shadow: var(--shadow-lift);
  position: relative;
  overflow: hidden;
}

.quote-banner::before {
  content: "“";
  position: absolute;
  top: -30px; left: 24px;
  font-family: var(--font-title);
  font-size: 160px;
  color: rgba(201, 162, 39, 0.35);
  line-height: 1;
}

.quote-banner p {
  position: relative;
  font-family: var(--font-title);
  font-size: clamp(19px, 2.6vw, 26px);
  line-height: 2;
}

/* ---------- 双联图注 ---------- */
.duo-caption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 18px;
  text-align: center;
}

.duo-caption span {
  font-family: var(--font-title);
  font-size: 17px;
  color: var(--purple);
  background: rgba(201, 162, 39, 0.12);
  border: 1px dashed rgba(201, 162, 39, 0.55);
  border-radius: 14px;
  padding: 12px 10px;
}

/* ---------- CTA 区 ---------- */
.cta {
  text-align: center;
  padding: 100px 28px;
}

.cta h2 {
  font-family: var(--font-title);
  font-size: clamp(28px, 4vw, 42px);
  color: var(--purple);
  margin-bottom: 16px;
}

.cta .sub { color: var(--ink-light); font-size: 17px; margin-bottom: 36px; }

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid rgba(201, 162, 39, 0.3);
  padding: 44px 28px 52px;
  text-align: center;
}

footer .disclaimer {
  max-width: 760px;
  margin: 0 auto 14px;
  font-size: 14px;
  color: var(--ink-light);
  line-height: 2;
}

footer .site {
  font-family: var(--font-title);
  color: var(--purple);
  font-size: 16px;
  letter-spacing: 1px;
}
footer .site b { color: var(--gold); }

footer .icp {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-light);
}

footer .icp a {
  color: var(--ink-light);
  text-decoration: none;
}

footer .icp a:hover { color: var(--gold); }

/* ---------- fade-up 滚动渐现 ----------
   无 JS / JS 未加载时 .fade-up 完全可见；
   main.js 在解析完成后给 <html> 加 .fx，才启用隐藏态。 */
.fx .fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fx .fade-up.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fx .fade-up { opacity: 1; transform: none; transition: none; }
  .scroll-hint { animation: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  section { padding: 64px 0; }
  .story-row { grid-template-columns: 1fr; gap: 32px; }
  .story-row.flip .story-media { order: 0; }
  .quote-banner { padding: 40px 28px; }
  .nav-inner { padding: 0 16px; gap: 14px; }
  .brand small { display: none; }
  .nav-page { display: none; }
  .hero { padding: 48px 20px 56px; }
}

@media (max-width: 520px) {
  .duo-caption { grid-template-columns: 1fr; }
  .hint-bar.show { padding: 24px; }
  .symptom-head { flex-direction: column; align-items: flex-start; }
}

/* ---------- 微信咨询弹层 ---------- */
.wx-modal[hidden] { display: none; }

.wx-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wx-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 16, 55, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wx-modal-card {
  position: relative;
  margin: 0;
  width: min(640px, 92vw);
  animation: wx-pop 0.28s ease-out;
}

.wx-modal-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(20, 8, 40, 0.5);
}

.wx-modal-card figcaption {
  margin-top: 14px;
  text-align: center;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  color: #EDE6F9;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.wx-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #C9A227;
  color: #2A1650;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 8, 40, 0.4);
}

.wx-modal-close:hover { background: #DEBE5A; }

@keyframes wx-pop {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wx-modal-card { animation: none; }
}
