/* ==========================================================
   中医体质测评 · 样式表
   设计目标：中老年友好 —— 大字号、高对比、大点击区、少动效
   ========================================================== */

:root{
  --bg:        #FAF6EF;
  --card:      #FFFFFF;
  --ink:       #2B2622;
  --ink-soft:  #5C5349;
  --muted:     #8A8075;
  --line:      #E9E1D4;
  --primary:   #A83A2C;
  --primary-d: #8C2E22;
  --primary-l: #FBEDEA;
  --gold:      #C79A3E;
  --green:     #3F7A54;
  --radius:    14px;
  --shadow:    0 2px 10px rgba(58,44,28,.06);
}

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

html,body{
  margin:0; padding:0;
  background:var(--bg);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Source Han Sans SC",sans-serif;
  font-size:17px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}

body{ max-width:560px; margin:0 auto; padding:0 16px 48px; }

/* ---------- 视图切换 ---------- */
.view{ display:none; animation:fade .25s ease; }
.view.active{ display:block; }
@keyframes fade{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }

/* ---------- 落地页 ---------- */
.hero{ padding:44px 0 28px; text-align:center; }

.hero-badge{
  display:inline-block;
  font-size:13px; letter-spacing:.4px;
  color:var(--primary);
  background:var(--primary-l);
  border:1px solid #F1D9D4;
  padding:6px 14px; border-radius:999px;
  margin-bottom:22px;
}

.hero-title{
  font-size:34px; line-height:1.35; font-weight:800;
  margin:0 0 18px; letter-spacing:.5px;
}
.hero-title::after{
  content:""; display:block; width:52px; height:4px;
  background:var(--primary); border-radius:2px; margin:20px auto 0;
}

.hero-sub{
  font-size:16px; color:var(--ink-soft); margin:0 0 30px; line-height:1.85;
}

.hero-points{
  display:flex; justify-content:center; gap:10px; margin-bottom:34px;
}
.point{
  flex:1; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:16px 6px; box-shadow:var(--shadow);
}
.point-num{
  display:block; font-size:26px; font-weight:800; color:var(--primary);
  line-height:1.2; margin-bottom:6px;
}
.point-txt{ display:block; font-size:12.5px; color:var(--muted); line-height:1.5; }

.hero-note{ font-size:14px; color:var(--muted); margin-top:16px; }

/* ---------- 卡片 ---------- */
.card{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:20px 18px; margin-bottom:16px;
  box-shadow:var(--shadow);
}
.card-muted{ background:#FDFBF7; }
.card-title-sm{ font-size:17px; font-weight:700; margin:0 0 12px; }
.card-sub{ font-size:14px; color:var(--muted); margin:-4px 0 12px; }

.diff-list{ margin:0; padding-left:20px; }
.diff-list li{ margin-bottom:10px; font-size:15.5px; color:var(--ink-soft); }
.diff-list b{ color:var(--ink); }

/* ---------- 按钮 ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-family:inherit; font-size:17px; font-weight:600;
  border:none; border-radius:var(--radius); cursor:pointer;
  padding:13px 22px; min-height:50px; width:100%;
  transition:transform .1s, background .15s;
  letter-spacing:.5px;
}
.btn:active{ transform:scale(.985); }

.btn-primary{ background:var(--primary); color:#fff; box-shadow:0 3px 12px rgba(168,58,44,.26); }
.btn-primary:active{ background:var(--primary-d); }

.btn-outline{ background:#fff; color:var(--primary); border:1.5px solid var(--primary); }

.btn-lg{ font-size:18px; padding:16px 22px; min-height:56px; }

.btn-text{
  background:none; color:var(--muted); font-size:14.5px;
  font-weight:500; min-height:auto; padding:12px; width:100%;
}
.btn-text:active{ color:var(--primary); }

.btn-restart{ margin-bottom:8px; }

/* ---------- 免责声明 ---------- */
.disclaimer{
  font-size:13px; color:var(--muted); line-height:1.8;
  padding:0 6px; text-align:center;
}
.disclaimer b{ color:var(--ink-soft); }

/* ---------- 答题页 ---------- */
.quiz-head{
  display:flex; align-items:center; gap:12px;
  padding:18px 0 10px; position:sticky; top:0;
  background:var(--bg); z-index:5;
}
.btn-back{
  background:none; border:none; font-size:30px; line-height:1;
  color:var(--muted); width:36px; height:36px; cursor:pointer;
  padding:0; flex:0 0 auto;
}
.btn-back:disabled{ opacity:.25; }

.progress-wrap{ flex:1; }
.progress-bar{
  height:7px; background:#EAE3D7; border-radius:4px; overflow:hidden;
}
.progress-fill{
  height:100%; width:0; background:var(--primary);
  border-radius:4px; transition:width .28s ease;
}
.progress-text{
  font-size:13px; color:var(--muted); margin-top:6px; text-align:right;
}

.quiz-body{ padding-top:22px; }
.q-hint{ font-size:14px; color:var(--muted); margin:0 0 10px; }
.q-hint b{ color:var(--ink-soft); }

.q-text{
  font-size:23px; font-weight:700; line-height:1.55;
  margin:0 0 30px; min-height:76px;
}

.options{ display:flex; flex-direction:column; gap:11px; }
.opt{
  display:flex; align-items:center; gap:13px;
  background:var(--card); border:1.5px solid var(--line);
  border-radius:var(--radius); padding:17px 18px;
  font-family:inherit; font-size:17.5px; color:var(--ink);
  cursor:pointer; text-align:left; min-height:60px;
  transition:border-color .15s, background .15s;
}
.opt-dot{
  width:21px; height:21px; border-radius:50%;
  border:2px solid #CFC5B6; flex:0 0 auto;
  transition:border-color .15s, background .15s;
}
.opt:active{ background:#FDFAF5; }
.opt.selected{
  border-color:var(--primary); background:var(--primary-l); font-weight:600;
}
.opt.selected .opt-dot{ border-color:var(--primary); background:var(--primary); }

/* ---------- 结果页 ---------- */
.result-hero{
  text-align:center; padding:40px 20px 34px; margin-bottom:16px;
  background:linear-gradient(160deg,#A83A2C 0%,#8C2E22 100%);
  border-radius:var(--radius); color:#fff;
  box-shadow:0 6px 20px rgba(168,58,44,.24);
}
.result-label{ font-size:14.5px; opacity:.85; letter-spacing:2px; margin-bottom:12px; }
.result-name{
  font-size:42px; font-weight:800; letter-spacing:3px;
  margin:0 0 14px; line-height:1.2;
}
.result-tag{
  font-size:15.5px; opacity:.94; margin:0 auto; max-width:330px; line-height:1.8;
}
.result-score{
  display:inline-block; margin-top:20px;
  font-size:13.5px; letter-spacing:.5px;
  background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.32);
  padding:7px 16px; border-radius:999px;
}

.tag-row{ display:flex; flex-wrap:wrap; gap:9px; }
.tag{
  font-size:14.5px; padding:7px 15px; border-radius:999px;
  background:var(--primary-l); color:var(--primary); border:1px solid #F1D9D4;
}

/* 体质分布条 */
.bars{ display:flex; flex-direction:column; gap:11px; }
.bar-row{ display:flex; align-items:center; gap:11px; }
.bar-name{ font-size:15px; width:66px; flex:0 0 auto; color:var(--ink-soft); }
.bar-track{ flex:1; height:11px; background:#F0EAE0; border-radius:6px; overflow:hidden; }
/* 注意：.bar-fill 是 <span>，必须 display:block，
   否则行内元素不认 width/height，进度条会完全不显示 */
.bar-fill{ display:block; height:100%; border-radius:6px; transition:width .5s ease; }
.bar-val{ font-size:13.5px; color:var(--muted); width:34px; text-align:right; flex:0 0 auto; }
.bar-row.is-main .bar-name{ font-weight:700; color:var(--primary); }
.bars-legend{ font-size:12.5px; color:var(--muted); margin:14px 0 0; }

/* 免费建议 */
.free-list{ margin:0; padding-left:0; list-style:none; }
.free-list li{
  position:relative; padding-left:26px; margin-bottom:13px;
  font-size:16px; color:var(--ink-soft); line-height:1.75;
}
.free-list li::before{
  content:""; position:absolute; left:6px; top:11px;
  width:7px; height:7px; border-radius:50%; background:var(--gold);
}

/* 付费区 */
.card-pay{ border:1.5px solid #EBD9A8; background:linear-gradient(180deg,#FFFDF6,#fff); }
.pay-desc{ font-size:15.5px; color:var(--ink-soft); margin:0 0 14px; }
.pay-features{ margin:0 0 20px; padding-left:0; list-style:none; }
.pay-features li{
  position:relative; padding-left:25px; margin-bottom:11px;
  font-size:15.5px; color:var(--ink-soft);
}
.pay-features li::before{
  content:"✓"; position:absolute; left:2px; top:0;
  color:var(--green); font-weight:800;
}
.pay-unlocked #r-paid-content{ font-size:16px; }

/* 分享区 —— 刻意做得显眼，转发是主要的获客途径 */
.card-share{
  border:1.5px solid #E6C97A;
  background:linear-gradient(180deg,#FFFDF4,#FFFFFF);
}
.card-share .card-title-sm{ font-size:18px; }
.card-share .share-desc{ font-size:16px; }
.btn-share{
  background:linear-gradient(180deg,#D9A93F,#BE8B22);
  color:#fff; font-size:19px; min-height:62px;
  box-shadow:0 4px 14px rgba(190,139,34,.32);
}
.btn-share:active{ background:#AB7C1B; }

/* 私域钩子 */
.card-contact{ text-align:center; }
.qr-slot{ margin:6px auto 12px; width:190px; }
.qr-slot img{ width:100%; display:block; border-radius:10px; }
.qr-placeholder{
  width:190px; height:190px; border:2px dashed #D8CBB4; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:14px; line-height:1.6; text-align:center;
  background:#FDFBF7;
}
.qr-note{ font-size:13.5px; color:var(--muted); margin:0; }
.share-desc{ font-size:15.5px; color:var(--ink-soft); margin:0 0 16px; }

/* ---------- 弹窗 ---------- */
.modal{
  position:fixed; inset:0; background:rgba(30,24,18,.55);
  display:flex; align-items:center; justify-content:center;
  padding:20px; z-index:100;
}
.modal-box{
  background:#fff; border-radius:18px; padding:26px 22px;
  width:100%; max-width:400px; box-shadow:0 12px 40px rgba(0,0,0,.25);
}
.modal-share-box{ max-width:440px; max-height:90vh; overflow-y:auto; }
.modal-share-box canvas{ width:100%; height:auto; border-radius:12px; display:block; margin-bottom:14px; }
.modal-title{ font-size:20px; font-weight:700; margin:0 0 8px; }
.modal-desc{ font-size:14.5px; color:var(--muted); margin:0 0 18px; }
.modal-actions{ display:flex; gap:10px; margin-top:6px; }
.modal-actions .btn{ flex:1; }

.code-input{
  width:100%; font-family:ui-monospace,Menlo,Consolas,monospace;
  font-size:20px; letter-spacing:2px; text-align:center; text-transform:uppercase;
  padding:15px 12px; border:1.5px solid var(--line); border-radius:var(--radius);
  outline:none; background:#FDFBF7; color:var(--ink);
}
.code-input:focus{ border-color:var(--primary); background:#fff; }
.code-err{ font-size:14px; color:#C0392B; min-height:22px; margin:9px 0 0; text-align:center; }

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:56px; transform:translate(-50%,20px);
  background:rgba(43,38,34,.94); color:#fff;
  font-size:15.5px; padding:13px 22px; border-radius:10px;
  opacity:0; pointer-events:none; transition:opacity .25s, transform .25s;
  z-index:200; max-width:85vw; text-align:center; line-height:1.5;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }

/* ---------- 付费内容排版（由 app.js 注入的结构） ---------- */
.plan-block{ margin-bottom:22px; }
.plan-block:last-child{ margin-bottom:0; }
.plan-block h4{
  font-size:16.5px; font-weight:700; margin:0 0 10px;
  padding-left:11px; border-left:4px solid var(--primary);
}
.plan-block ul{ margin:0; padding-left:20px; }
.plan-block li{ font-size:15.5px; color:var(--ink-soft); margin-bottom:8px; line-height:1.75; }
.plan-block p{ font-size:15.5px; color:var(--ink-soft); margin:0 0 9px; }
.plan-note{
  font-size:14px; color:var(--muted); background:#FDFBF7;
  border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-top:18px;
}
