/* =====================================================================
 * 忌口雷达 · 样式
 * ===================================================================== */
:root{
  --green:#0FA968;
  --green-d:#0A8A55;
  --green-l:#E9F9F1;
  --ink:#0E1621;
  --ink-2:#48536B;
  --ink-3:#8A94A6;
  --line:#E7EDF3;
  --bg:#F4F7F5;
  --card:#FFFFFF;
  --red:#E5484D;
  --red-l:#FFF1F1;
  --amber:#E08A00;
  --amber-l:#FFF7E6;
  --r:18px;
  --shadow:0 1px 2px rgba(14,22,33,.04), 0 8px 24px -12px rgba(14,22,33,.14);
  --shadow-lg:0 2px 6px rgba(14,22,33,.05), 0 24px 60px -24px rgba(14,22,33,.22);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Segoe UI","Microsoft YaHei",sans-serif;
  color:var(--ink);
  background:
    radial-gradient(900px 520px at 50% -160px, #DDF3E8 0%, rgba(221,243,232,0) 70%),
    var(--bg);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
button{font-family:inherit;border:0;background:none;cursor:pointer;color:inherit;}
button:focus{outline:none;}
button:focus-visible{outline:2px solid var(--green);outline-offset:3px;}
input{font-family:inherit;}
b,strong{font-weight:700;}

.app{max-width:720px;margin:0 auto;padding:0 20px 56px;}

/* ================= 顶栏 ================= */
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:20px 0 8px;
}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit;}
.brand-mark{
  width:36px;height:36px;border-radius:11px;flex:0 0 36px;
  background:linear-gradient(150deg,#17C37B,#0A8A55);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 16px -6px rgba(15,169,104,.8);
}
.brand-mark svg{width:20px;height:20px;fill:none;stroke:#fff;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;}
.brand-txt b{display:block;font-size:15.5px;letter-spacing:.2px;}
.brand-txt i{display:block;font-style:normal;font-size:9.5px;color:var(--ink-3);letter-spacing:.6px;text-transform:uppercase;margin-top:1px;}
.top-ghost{
  font-size:12px;font-weight:600;color:var(--ink-2);
  background:#fff;border:1px solid var(--line);
  padding:7px 12px;border-radius:10px;
  box-shadow:0 1px 2px rgba(14,22,33,.04);
  transition:.16s;
}
.top-ghost:hover{border-color:#CFE9DC;color:var(--green);}
.top-ghost.sm{font-size:11.5px;padding:6px 10px;}

/* ================= 视图切换 ================= */
.view{display:none;}
.view.is-active{display:block;animation:fadeUp .32s cubic-bezier(.25,.9,.3,1);}
@keyframes fadeUp{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}

/* ================= Hero ================= */
.hero{padding:26px 0 20px;}
.hero h1{
  font-size:36px;line-height:1.2;letter-spacing:-1px;
  margin:0 0 12px;font-weight:800;
}
.hero-sub{
  font-size:14px;line-height:1.75;color:var(--ink-2);margin:0;
}
.hero-sub b{color:var(--green);}

/* ================= 搜索 ================= */
.search{display:flex;gap:9px;margin-bottom:12px;}
.search-field{
  flex:1;display:flex;align-items:center;gap:9px;
  background:#fff;border:1.5px solid var(--line);border-radius:14px;
  padding:0 15px;height:52px;
  transition:border-color .18s, box-shadow .18s;
  box-shadow:var(--shadow);
}
.search-field:focus-within{border-color:#8FDCBA;box-shadow:0 0 0 4px rgba(15,169,104,.1);}
.search-ic{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:var(--ink-3);stroke-width:2;stroke-linecap:round;}
.search-field input{
  flex:1;border:0;outline:0;background:none;font-size:14px;color:var(--ink);min-width:0;
}
.search-field input::placeholder{color:#AEB7C6;font-size:13.5px;}
.search-go{
  flex:0 0 auto;padding:0 22px;height:52px;border-radius:14px;
  background:var(--green);color:#fff;font-size:14px;font-weight:700;
  box-shadow:0 8px 20px -8px rgba(15,169,104,.9);
  transition:transform .12s, background .18s;
}
.search-go:hover{background:var(--green-d);}
.search-go:active{transform:scale(.975);}

.samples{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:26px;}
.samples-label{font-size:11.5px;color:var(--ink-3);font-weight:600;}
.sample{
  font-size:12px;color:var(--ink-2);background:#fff;border:1px solid var(--line);
  padding:6px 11px;border-radius:20px;transition:.16s;
}
.sample:hover{color:var(--green);border-color:#BFE7D4;background:#F7FDFA;}

/* ================= 卡片 ================= */
.card{
  background:var(--card);border-radius:var(--r);
  padding:18px;box-shadow:var(--shadow);
  border:1px solid rgba(231,237,243,.9);
  margin-bottom:16px;
}
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:14px;}
.card-head h2,.card-head h3{margin:0;font-size:15px;font-weight:750;letter-spacing:.1px;}
.card-hint{font-size:11px;color:var(--ink-3);}

/* ================= 忌口选择 ================= */
.allergen-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
.alg{
  display:flex;flex-direction:column;align-items:center;gap:5px;
  padding:12px 4px;border-radius:13px;
  background:#F8FAF9;border:1.5px solid transparent;
  transition:.16s;font-size:12px;color:var(--ink-2);font-weight:600;
}
.alg .alg-ic{font-size:19px;line-height:1;opacity:.38;transition:opacity .16s, transform .16s;}
.alg:hover{background:#F1F8F4;}
.alg.on{
  background:var(--green-l);border-color:#9EE0C0;color:var(--green-d);
}
.alg.on .alg-ic{opacity:1;transform:scale(1.06);}
.allergen-actions{display:flex;justify-content:flex-end;margin-top:10px;}
.link-btn{
  font-size:12px;color:var(--ink-3);font-weight:600;padding:4px 2px;
  transition:.16s;
}
.link-btn:hover{color:var(--green);}

/* ================= 为什么免费 ================= */
.why-free{
  background:linear-gradient(160deg,#0E2A20,#0B1F18);
  border-radius:var(--r);padding:22px;color:#E8F5EE;
  margin-bottom:24px;
}
.wf-head{margin-bottom:10px;}
.wf-badge{
  display:inline-block;font-size:9.5px;font-weight:800;letter-spacing:1px;
  color:#7EE0B0;background:rgba(126,224,176,.12);
  padding:3px 8px;border-radius:6px;margin-bottom:9px;
}
.why-free h3{margin:0;font-size:17px;font-weight:800;letter-spacing:-.2px;color:#fff;}
.why-free p{margin:0 0 16px;font-size:13px;line-height:1.8;color:#A9C4B8;}
.why-free p b{color:#8FE9BE;}
.wf-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;}
.wf-item{
  background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.08);
  border-radius:11px;padding:11px 12px;
}
.wf-item b{display:block;font-size:15px;color:#fff;margin-bottom:3px;font-weight:800;}
.wf-item span{font-size:10.5px;color:#8FA99E;line-height:1.6;display:block;}

.foot{
  font-size:10.5px;line-height:1.8;color:var(--ink-3);
  text-align:center;padding:8px 6px 0;
}
.foot b{color:var(--ink-2);}

/* ================= 结果页 ================= */
.result-nav{
  display:flex;align-items:center;gap:10px;
  padding:18px 0 16px;
}
.result-nav > span{font-size:14px;font-weight:700;flex:1;}
.back-btn{
  width:34px;height:34px;border-radius:11px;background:#fff;
  border:1px solid var(--line);display:flex;align-items:center;justify-content:center;
  box-shadow:0 1px 2px rgba(14,22,33,.04);
}
.back-btn svg{width:18px;height:18px;fill:none;stroke:var(--ink-2);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

.verdict{
  border-radius:20px;padding:26px 22px;margin-bottom:16px;
  position:relative;overflow:hidden;
}
.verdict::after{
  content:"";position:absolute;right:-40px;top:-40px;width:160px;height:160px;
  border-radius:50%;background:currentColor;opacity:.05;
}
.verdict-badge{
  width:44px;height:44px;border-radius:14px;display:flex;align-items:center;justify-content:center;
  font-size:22px;font-weight:800;color:#fff;margin-bottom:14px;
}
.verdict h2{margin:0 0 8px;font-size:26px;font-weight:800;letter-spacing:-.5px;}
.verdict p{margin:0;font-size:13.5px;line-height:1.7;}
.verdict-meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:14px;}
.vm-pill{
  font-size:10.5px;font-weight:700;padding:4px 9px;border-radius:7px;
  background:rgba(255,255,255,.6);
}
.verdict.v-danger{background:var(--red-l);color:#8E1F22;}
.verdict.v-danger .verdict-badge{background:var(--red);}
.verdict.v-danger p{color:#9A4A4C;}
.verdict.v-caution{background:var(--amber-l);color:#8A5400;}
.verdict.v-caution .verdict-badge{background:#E89A00;}
.verdict.v-caution p{color:#8A6A27;}
.verdict.v-safe{background:var(--green-l);color:#0A6B43;}
.verdict.v-safe .verdict-badge{background:var(--green);}
.verdict.v-safe p{color:#3D7A60;}

/* 配料列表 */
.ing-list{list-style:none;margin:0;padding:0;}
.ing-item{
  display:flex;align-items:center;gap:10px;
  padding:10px 0;border-bottom:1px solid var(--line);font-size:13.5px;
}
.ing-item:last-child{border-bottom:0;}
.ing-dot{
  width:7px;height:7px;border-radius:50%;background:#CFD8E3;flex:0 0 7px;
}
.ing-item.bad .ing-dot{background:var(--red);box-shadow:0 0 0 3px rgba(229,72,77,.14);}
.ing-name{flex:1;color:var(--ink);}
.ing-item.bad .ing-name{font-weight:650;color:#B32A2F;}
.ing-tag{
  font-size:9.5px;font-weight:700;padding:2.5px 7px;border-radius:5px;
  background:var(--red-l);color:#C0281F;white-space:nowrap;
}
.ing-item.ok .ing-tag{background:#F2F5F8;color:#93A0B0;}

/* ================= 付费墙 ================= */
.paywall{
  background:linear-gradient(155deg,#0E2A20,#0A1D17);
  border-radius:20px;padding:24px 22px;color:#fff;
  margin:18px 0;
  box-shadow:var(--shadow-lg);
}
.pw-tag{
  display:inline-block;font-size:9.5px;font-weight:800;letter-spacing:1px;
  color:#7EE0B0;background:rgba(126,224,176,.14);
  padding:3px 8px;border-radius:6px;margin-bottom:10px;
}
.paywall h3{margin:0 0 8px;font-size:19px;font-weight:800;letter-spacing:-.3px;color:#fff;}
.paywall p{margin:0 0 16px;font-size:13px;line-height:1.75;color:#A9C4B8;}
.paywall p b{color:#8FE9BE;}
.pw-list{list-style:none;margin:0 0 20px;padding:0;}
.pw-list li{
  display:flex;gap:9px;font-size:12.5px;color:#C6DCD1;
  padding:7px 0;line-height:1.6;
}
.pw-list i{
  font-style:normal;color:#7EE0B0;font-weight:800;flex:0 0 auto;font-size:12px;
}
/* 套餐选择 */
.plan-row{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:11px;}
.plan{
  position:relative;text-align:left;padding:11px 12px;border-radius:11px;
  background:rgba(255,255,255,.055);border:1.5px solid rgba(255,255,255,.1);
  transition:.16s;
}
.plan:hover{background:rgba(255,255,255,.09);}
.plan b{display:block;font-size:12px;color:#C6DCD1;font-weight:700;margin-bottom:3px;}
.plan span{display:block;font-size:16px;color:#fff;font-weight:800;letter-spacing:-.3px;}
.plan em{
  position:absolute;top:9px;right:10px;font-style:normal;
  font-size:9px;font-weight:800;color:#0B2B20;
  background:#7EE0B0;padding:2px 5px;border-radius:4px;
}
.plan.is-on{
  background:rgba(23,195,123,.16);
  border-color:rgba(126,224,176,.55);
}
.plan.is-on b{color:#8FE9BE;}

.pay-cta{
  width:100%;height:56px;border-radius:14px;
  background:linear-gradient(120deg,#17C37B,#0FA968);
  color:#fff;display:flex;align-items:center;justify-content:center;gap:10px;
  font-size:14px;font-weight:750;
  box-shadow:0 14px 30px -12px rgba(23,195,123,.9);
  transition:transform .12s, filter .18s;
}
.pay-cta:hover{filter:brightness(1.05);}
.pay-cta:active{transform:scale(.985);}
.cta-price{font-size:16px;font-weight:800;}
.cta-txt{opacity:.95;}
.cta-arrow{opacity:.75;}
.pw-foot{text-align:center;font-size:10.5px;color:#7A9488;margin-top:11px;}

/* ================= 报告 ================= */
.report{
  background:#fff;border-radius:20px;padding:22px;
  box-shadow:var(--shadow);border:1px solid var(--line);
  margin-bottom:16px;
  display:none;
}
.report.show{display:block;animation:fadeUp .4s cubic-bezier(.25,.9,.3,1);}
.report-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:16px;}
.rp-badge{
  display:inline-block;font-size:9.5px;font-weight:800;letter-spacing:.8px;
  color:var(--green-d);background:var(--green-l);
  padding:3px 8px;border-radius:6px;margin-bottom:7px;
}
.report-head h3{margin:0;font-size:17px;font-weight:800;letter-spacing:-.2px;}

.alt-list{list-style:none;margin:0 0 16px;padding:0;}
.alt{
  display:flex;align-items:center;gap:12px;
  padding:13px;border-radius:13px;background:#F8FAF9;
  margin-bottom:8px;border:1px solid #EDF3EF;
  transition:.16s;
}
.alt:hover{border-color:#CFE9DC;background:#F5FBF7;}
.alt-rank{
  width:24px;height:24px;flex:0 0 24px;border-radius:8px;
  background:#fff;border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:800;color:var(--ink-3);
}
.alt:first-child .alt-rank{background:var(--green);border-color:var(--green);color:#fff;}
.alt-body{flex:1;min-width:0;}
.alt-name{font-size:13.5px;font-weight:700;margin-bottom:3px;}
.alt-why{font-size:10.5px;color:var(--ink-3);line-height:1.6;}
.alt-price{text-align:right;flex:0 0 auto;}
.alt-price b{font-size:15px;font-weight:800;}
.alt-price small{display:block;font-size:10px;color:var(--ink-3);margin-top:2px;}

.cheap-tip{
  background:var(--green-l);border-radius:12px;padding:13px 14px;
  font-size:12.5px;line-height:1.7;color:#0A6B43;margin-bottom:16px;
}
.cheap-tip b{color:#075C39;}

.script-card{
  border:1px dashed #C9E6D8;border-radius:13px;padding:14px;margin-bottom:14px;
  background:#FCFEFD;
}
.sc-label{font-size:10px;font-weight:800;letter-spacing:.6px;color:var(--green-d);margin-bottom:8px;}
.script-card p{margin:0 0 10px;font-size:13px;line-height:1.8;color:var(--ink);}
.report-foot{font-size:10.5px;color:var(--ink-3);line-height:1.7;}

/* ================= 支付面板 ================= */
.pay-sheet{
  position:fixed;inset:0;z-index:200;
  display:flex;align-items:flex-end;justify-content:center;
  pointer-events:none;
  visibility:hidden;
  transition:visibility 0s linear .34s;
}
.sheet-mask{
  position:absolute;inset:0;background:rgba(10,20,16,.45);
  opacity:0;transition:opacity .26s;backdrop-filter:blur(2px);
}
.sheet-body{
  position:relative;width:100%;max-width:460px;
  background:#fff;border-radius:22px 22px 0 0;
  padding:20px 22px calc(22px + env(safe-area-inset-bottom));
  transform:translateY(100%);
  transition:transform .34s cubic-bezier(.25,.9,.3,1);
  box-shadow:0 -10px 40px rgba(10,20,16,.18);
}
.pay-sheet.show{pointer-events:auto;visibility:visible;transition-delay:0s;}
.pay-sheet.show .sheet-mask{opacity:1;}
.pay-sheet.show .sheet-body{transform:translateY(0);}
@media (min-width:640px){
  .pay-sheet{align-items:center;}
  .sheet-body{border-radius:22px;transform:translateY(24px);opacity:0;transition:.3s;}
  .pay-sheet.show .sheet-body{transform:none;opacity:1;}
}
.sheet-head{display:flex;align-items:center;gap:11px;margin-bottom:20px;}
.alp-logo{
  width:38px;height:38px;border-radius:11px;flex:0 0 38px;
  background:#1677FF;color:#fff;font-size:18px;font-weight:800;
  display:flex;align-items:center;justify-content:center;
}
.sheet-head-txt b{display:block;font-size:14px;}
.sheet-head-txt small{display:block;font-size:10.5px;color:var(--ink-3);margin-top:2px;}
.sheet-close{
  margin-left:auto;width:30px;height:30px;border-radius:50%;
  background:#F2F5F8;color:var(--ink-3);font-size:13px;
  display:flex;align-items:center;justify-content:center;
}
.sheet-line{
  display:flex;justify-content:space-between;align-items:baseline;
  padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
}
.sheet-line span{font-size:13.5px;color:var(--ink-2);}
.sheet-line b{font-size:22px;font-weight:800;letter-spacing:-.5px;}
.sheet-note{
  font-size:11.5px;color:var(--ink-3);padding:12px 0 16px;text-align:center;
}
.sheet-note.error{color:var(--red);}
.pay-btn{
  width:100%;height:52px;border-radius:13px;
  background:#1677FF;color:#fff;font-size:15px;font-weight:700;
  transition:filter .18s, transform .12s;
}
.pay-btn:hover{filter:brightness(1.06);}
.pay-btn:active{transform:scale(.985);}
.pay-btn:disabled{opacity:.62;cursor:default;}
.sheet-foot{
  font-size:10px;color:var(--ink-3);text-align:center;margin-top:14px;line-height:1.6;
}
.mock-tag{
  display:inline-block;font-size:9px;font-weight:800;letter-spacing:.4px;
  color:#8A5400;background:#FFF3D6;border:1px solid #FFE0A3;
  padding:2px 6px;border-radius:4px;margin-right:4px;
}
.lock-ic{width:11px;height:11px;vertical-align:-1px;margin-right:3px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

/* ================= Toast ================= */
.toast{
  position:fixed;left:50%;bottom:40px;transform:translate(-50%,12px);
  background:rgba(14,22,33,.94);color:#fff;
  font-size:12.5px;padding:10px 18px;border-radius:11px;
  opacity:0;pointer-events:none;transition:.24s;z-index:300;
  max-width:82vw;text-align:center;line-height:1.5;
}
.toast.show{opacity:1;transform:translate(-50%,0);}

/* ================= 响应式 ================= */
@media (max-width:600px){
  .app{padding:0 16px 40px;}
  .hero{padding:18px 0 16px;}
  .hero h1{font-size:29px;}
  .hero-sub{font-size:13px;}
  .search{gap:8px;}
  .search-field{height:48px;padding:0 13px;}
  .search-go{height:48px;padding:0 17px;font-size:13.5px;}
  .allergen-grid{grid-template-columns:repeat(4,1fr);gap:6px;}
  .alg{padding:10px 2px;font-size:11px;}
  .alg .alg-ic{font-size:17px;}
  .wf-grid{grid-template-columns:1fr;}
  .plan{padding:10px 11px;}
  .plan span{font-size:15px;}
  .plan em{top:8px;right:8px;font-size:8.5px;}
  .verdict{padding:22px 18px;}
  .verdict h2{font-size:23px;}
  .card{padding:16px;}
  .report{padding:18px;}
}

/* 打印只留报告 */
@media print{
  body{background:#fff;}
  .topbar,.search,.samples,.allergen-card,.why-free,.result-nav,.paywall,.foot,.pay-sheet,.toast{display:none !important;}
  .report{display:block !important;box-shadow:none;border:0;padding:0;}
  .app{max-width:none;padding:0;}
}
