:root{
  --primary:#B91C1C; --primary-dark:#991B1B; --gold:#D97706; --ink:#292524;
  --sub:#78716C; --line:#F0E4D8; --bg:#FDF6F0; --card:#FFFFFF;
  --safe:#166534; --warn:#D97706; --danger:#DC2626;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  background:#EDE4DB;color:var(--ink);
  margin:0;display:flex;justify-content:center;
}

/* 手机壳 */
.phone{width:100%;max-width:480px;height:100vh;height:100dvh;background:var(--bg);position:relative;overflow:hidden;display:flex;flex-direction:column}
.screen{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative}

/* 顶部条 */
.topbar{height:46px;background:linear-gradient(135deg,#991B1B,#B91C1C);color:#fff;display:flex;align-items:center;padding:0 12px;font-size:16px;font-weight:600;flex-shrink:0;z-index:30}
.topbar .back{font-size:22px;margin-right:6px;cursor:pointer;width:28px;display:flex;align-items:center}
.topbar .title{flex:1;text-align:center;letter-spacing:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .sp{width:28px}

/* 常驻安全提示 */
.safebar{background:#166534;color:#D3F4DF;font-size:11.5px;padding:calc(6px + env(safe-area-inset-top,0px)) 12px 6px;text-align:center;flex-shrink:0;line-height:1.4;display:flex;align-items:center;justify-content:center;gap:5px}
.safebar svg{width:14px;height:14px;color:#D3F4DF;flex:0 0 auto}

/* 滚动区 */
.scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px}
.scroll::-webkit-scrollbar{width:0}
.loading{padding:40px;text-align:center;color:var(--sub);font-size:13px}

/* 页面 */
.page{display:none;flex-direction:column;min-height:0;position:relative}
.page.active{display:flex;flex:1;min-height:0}
.notice{background:#FEF3C7;color:#92400E;font-size:11.5px;padding:8px 14px;flex-shrink:0;line-height:1.5}

/* hero */
.hero{background:linear-gradient(135deg,#991B1B,#B91C1C 60%,#DC2626);color:#fff;border-radius:16px;padding:26px 18px;margin-bottom:14px;min-height:150px;display:flex;flex-direction:column;justify-content:center;overflow:hidden;position:relative}
.hero.has-image{background-size:cover;background-position:center}
.hero.has-image::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(80,10,10,.82),rgba(185,28,28,.62))}
.hero.has-image>*{position:relative;z-index:1}
.hero h1{font-size:23px;letter-spacing:1px;line-height:1.25}
.hero p{opacity:.96;font-size:14px;margin-top:10px}
.hero .badges{margin-top:18px}
.hero .badges span{display:inline-block;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.4);border-radius:999px;padding:3px 11px;font-size:11.5px;margin:4px 6px 0 0}
.hero-meta{margin-top:14px;display:flex;flex-direction:column;gap:8px}
.hero-meta .hm-row{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.4;color:#fff}
.hero-meta .hm-ic{width:15px;height:15px;color:#fff;flex:0 0 auto}
.hero-meta b{font-weight:600}
.hero-meta a{color:#fff;text-decoration:underline}

/* 卡片网格 */
.grid4{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}
.entry{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 12px;text-align:center;cursor:pointer;transition:.15s}
.entry:active{transform:scale(.97)}
.entry .ic{width:48px;height:48px;margin:0 auto 8px}
.entry .t{font-size:13.5px;margin-top:2px;font-weight:600;color:var(--ink)}
.entry .d{font-size:11px;color:var(--sub);margin-top:3px}

.panel{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:12px}
.panel h3{font-size:15px;color:var(--primary-dark);margin-bottom:8px}
#p-safety .panel h3,#p-license .panel h3,.panel.safe h3{color:var(--safe)}
.row{display:flex;gap:10px}
.row>*{flex:1}
.btn{border:none;border-radius:12px;padding:12px;font-size:14px;font-weight:600;cursor:pointer;text-align:center;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn.primary{background:var(--primary);color:#fff}
.btn.gold{background:var(--gold);color:#fff}
.btn.ghost{background:#F7EFE6;color:var(--primary-dark)}
.btn:active{opacity:.85}

/* 门店 */
.map{height:150px;background:repeating-linear-gradient(45deg,#eef1f4,#eef1f4 12px,#e6eaef 12px,#e6eaef 24px);border-radius:12px;display:flex;align-items:center;justify-content:center;color:#9aa3ad;font-size:13px;margin-bottom:12px;overflow:hidden}
.map img{width:100%;height:100%;object-fit:cover}
.info{font-size:13.5px;color:var(--sub);line-height:1.7}
.info b{color:var(--ink)}

/* 品类 */
.tabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:12px;padding-bottom:4px}
.tabs .tab{flex:0 0 auto;padding:7px 14px;background:#fff;border:1px solid var(--line);border-radius:999px;font-size:12.5px;color:var(--sub);cursor:pointer;white-space:nowrap}
.tabs .tab.on{background:var(--primary);color:#fff;border-color:var(--primary)}
.cat{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:10px}
.cat .name{font-size:15px;font-weight:700;color:var(--ink)}
.cat .desc{font-size:12.5px;color:var(--sub);margin:5px 0}
.cat .tag{display:inline-block;background:#FEF3C7;color:#92400E;font-size:11px;padding:2px 8px;border-radius:6px;margin-top:4px}

/* 商品卡片 */
.prod{background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;cursor:pointer}
.prod:active{transform:scale(.98)}
.prod .img{height:108px;background:repeating-linear-gradient(135deg,#F7EEE3,#F7EEE3 10px,#EFE2D3 10px,#EFE2D3 20px);display:flex;align-items:center;justify-content:center;color:#A89A88;font-size:12px;overflow:hidden}
.prod .img img{width:100%;height:100%;object-fit:cover}
.prod .pn{font-size:13.5px;font-weight:600;padding:8px 9px 2px;color:var(--ink);line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:36px}
.prod .pc{font-size:11px;color:var(--sub);padding:0 9px}
.prod .pmeta{display:flex;align-items:center;gap:6px;padding:4px 9px 10px;flex-wrap:wrap}
.price{color:var(--danger);font-weight:700;font-size:14px}
.price.free{color:var(--sub);font-weight:600;font-size:12px}
.pill{font-size:10px;padding:2px 7px;border-radius:999px;background:#F1F5F9;color:#475569}
.pill.on{background:#DCFCE7;color:#14532D}
.pill.out{background:#FEE2E2;color:#B91C1C}
.pill.low{background:#FEF3C7;color:#92400E}
.pill.hot{background:#FEE2E2;color:#B91C1C}

/* 分类左侧竖列 + 右侧商品布局 */
.catlayout{flex:1;display:flex;overflow:hidden}
.catside{width:94px;background:#F8EFE6;overflow-y:auto;flex-shrink:0;border-right:1px solid var(--line)}
.catside::-webkit-scrollbar{width:0}
.catside .ci{padding:15px 6px;text-align:center;font-size:12.5px;color:var(--sub);cursor:pointer;border-left:3px solid transparent;line-height:1.3}
.catside .ci.on{background:#fff;color:var(--primary-dark);font-weight:700;border-left-color:var(--primary)}
.catmain{flex:1;overflow-y:auto;padding:12px;min-width:0}
.catmain::-webkit-scrollbar{width:0}
.catmain .grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.catmain .empty{padding:40px 10px;text-align:center;color:var(--sub);font-size:12.5px}

/* 详情 */
.detail-img{height:200px;border-radius:12px;overflow:hidden;background:repeating-linear-gradient(135deg,#F7EEE3,#F7EEE3 10px,#EFE2D3 10px,#EFE2D3 20px);display:flex;align-items:center;justify-content:center;color:#A89A88;font-size:12px;margin-bottom:12px}
.detail-img img{width:100%;height:100%;object-fit:cover}
.detail-title{font-size:18px;font-weight:700;line-height:1.35}
.detail-sub{font-size:12.5px;color:var(--sub);margin-top:4px}
.detail-tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.cat-tag{font-size:11px;padding:3px 9px;border-radius:999px;background:#FEE2E2;color:var(--primary);font-weight:600}
.spec-table{width:100%;border-collapse:collapse;font-size:13px}
.spec-table td{padding:8px 4px;border-bottom:1px dashed var(--line);color:var(--sub)}
.spec-table td:first-child{color:var(--ink);font-weight:600;width:34%}
.spec-table tr:last-child td{border-bottom:none}
.thumb-row{display:flex;gap:8px;margin-top:10px;overflow-x:auto}
.thumb-row img{width:64px;height:64px;border-radius:8px;object-fit:cover;border:1px solid var(--line);flex:0 0 auto;cursor:pointer}
.thumb-row img.on{border-color:var(--primary);box-shadow:0 0 0 2px rgba(185,28,28,.18)}

/* 商品视频：点击主图内嵌播放 */
.pv-media{position:relative;overflow:hidden;transition:height .18s ease}
.pv-media:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.pv-media .pv-badge{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:54px;height:54px;border-radius:50%;background:rgba(17,17,17,.5);
  display:flex;align-items:center;justify-content:center;backdrop-filter:blur(2px);
  box-shadow:0 6px 18px rgba(0,0,0,.28);pointer-events:none}
.pv-media .pv-play-ic{width:24px;height:24px;fill:#fff;margin-left:3px}
.pv-media .pv-hint{position:absolute;left:10px;bottom:10px;background:rgba(17,17,17,.55);color:#fff;
  font-size:11px;padding:3px 10px;border-radius:999px;pointer-events:none}
.pv-media.pv-active{cursor:default;height:auto;aspect-ratio:16/9;background:#111}
.pv-video{display:block;width:100%;height:100%;background:#000;object-fit:contain}
.pv-close{position:absolute;right:8px;top:8px;width:30px;height:30px;border:none;border-radius:50%;
  background:rgba(17,17,17,.55);color:#fff;font-size:19px;line-height:1;display:flex;
  align-items:center;justify-content:center;cursor:pointer;z-index:3}
.pv-close:hover{background:rgba(17,17,17,.75)}
.pv-state{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;gap:9px;
  align-items:center;justify-content:center;color:#fff;background:rgba(17,17,17,.5);
  text-align:center;padding:14px;backdrop-filter:blur(1px)}
.pv-msg{font-size:12.5px;line-height:1.6}
.pv-spin{width:26px;height:26px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;
  border-radius:50%;animation:pvspin .8s linear infinite}
@keyframes pvspin{to{transform:rotate(360deg)}}
.pv-err{width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;
  font-size:17px;font-weight:700;display:flex;align-items:center;justify-content:center}
.pv-btns{display:flex;gap:8px;margin-top:2px}
.pv-btn{border:none;border-radius:999px;padding:6px 14px;font-size:12px;cursor:pointer;
  background:var(--primary);color:#fff}
.pv-btn.ghost{background:rgba(255,255,255,.18);color:#fff}
.pv-tap{display:flex;flex-direction:column;align-items:center;gap:6px;border:none;background:none;
  color:#fff;font-size:12.5px;cursor:pointer}
.pv-tap .pv-play-ic{width:26px;height:26px;fill:#fff}

/* 科普 */
.topic{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.topic .c{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px;text-align:center;cursor:pointer}
.topic .c.on{border-color:var(--primary);background:#FFF5F5}
.topic .c .ic{width:44px;height:44px;margin:0 auto 6px}
.topic .c .t{font-size:13px;font-weight:600}
.article{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:8px;cursor:pointer}
.article .ti{font-size:13.5px;font-weight:600}
.article .ab{font-size:11.5px;color:var(--sub);margin-top:3px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.video{height:160px;background:linear-gradient(135deg,#2b2b2b,#454545);border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;position:relative;margin-bottom:12px}
.video .play{width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center}
.video .corner{position:absolute;top:8px;left:8px;background:#B91C1C;color:#fff;font-size:10px;padding:2px 8px;border-radius:6px}
/* 已配置的安全示范视频：封面铺满，播放时隐藏播放按钮 */
.video.has-src{cursor:pointer;overflow:hidden}
.video.has-src video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
.video.has-src.playing{cursor:default}
.video.has-src.playing .play{display:none}

/* 表单 */
.field{margin-bottom:12px}
.field label{display:block;font-size:13px;color:var(--ink);margin-bottom:5px;font-weight:600}
.field input,.field textarea,.field select{width:100%;border:1px solid var(--line);border-radius:10px;padding:11px;font-size:14px;background:#fff;outline:none;font-family:inherit}
.field input:focus,.field textarea:focus{border-color:var(--primary)}
.hint{font-size:11px;color:var(--sub);margin-top:4px}
.warn{background:#FEF3C7;border:1px solid #FDE68A;color:#92400E;font-size:12px;padding:9px 11px;border-radius:10px;margin-bottom:12px;display:flex;align-items:flex-start;gap:6px}
.warn svg{width:15px;height:15px;color:#D97706;flex:0 0 auto;margin-top:1px}
.warn.danger{background:#FEE2E2;border-color:#FECACA;color:#B91C1C}
.warn.danger svg{color:#DC2626}
.warn.safe{background:#DCFCE7;border-color:#BBF7D0;color:#14532D}
.warn.safe svg{color:#166534}
.ok-note{background:#eaf5ea;border:1px solid #bfe3bf;color:#2e7d32;font-size:12px;padding:9px 11px;border-radius:10px;line-height:1.6}

/* 资质 */
.lic{border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--card);margin-bottom:12px}
.lic .ph{height:120px;background:repeating-linear-gradient(135deg,#F7EEE3,#F7EEE3 10px,#EFE2D3 10px,#EFE2D3 20px);border-radius:10px;display:flex;align-items:center;justify-content:center;color:#A89A88;font-size:12px;margin-bottom:10px;overflow:hidden}
.lic .ph img{width:100%;height:100%;object-fit:contain}
.lic .meta{font-size:12.5px;color:var(--sub);line-height:1.8}
.lic .meta b{color:var(--ink)}

/* 我的 */
.mine-item{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:10px;display:flex;align-items:center;cursor:pointer}
.mine-item .ic{width:38px;height:38px;margin-right:12px}
.mine-item .t{font-size:14px;font-weight:600;flex:1}
.mine-item .ar{color:#c9c4bd;display:flex;align-items:center;flex:0 0 auto}
.mine-item .ar svg{width:15px;height:15px;color:#c9c4bd}

/* 文档 */
.doc-body{padding:4px 2px;font-size:13.5px;color:#444;line-height:1.8}
.doc-body h2{font-size:15px;color:var(--primary-dark);margin:18px 0 6px}
.doc-body p{margin:6px 0}
.doc-body ul{margin:6px 0 6px 20px}

/* tabbar */
.tabbar{background:#fff;border-top:1px solid var(--line);display:flex;flex-shrink:0;min-height:58px;padding-bottom:env(safe-area-inset-bottom,0px)}
.tabbar .tb{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;color:#9aa0a6;font-size:10.5px;gap:3px}
.tabbar .tb .ic{width:34px;height:34px;border-radius:11px;--tint:#f0f1f3;--hue:#9aa0a6}
.tabbar .tb.on{color:var(--primary)}
.tabbar .tb.on .ic{--tint:#FEE2E2;--hue:var(--primary)}

/* toast */
.toast{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(31,35,41,.92);color:#fff;padding:14px 20px;border-radius:12px;font-size:13.5px;z-index:99;display:none;text-align:center;max-width:80%}

/* modal */
.mask{position:absolute;inset:0;background:rgba(0,0,0,.45);z-index:80;display:none;align-items:flex-end}
.mask.show{display:flex}
.sheet{background:#fff;width:100%;border-radius:18px 18px 0 0;padding:18px;max-height:80%;overflow-y:auto}
.sheet h3{font-size:16px;color:var(--primary-dark);margin-bottom:12px}

/* 图标 chip */
.ic{display:inline-flex;align-items:center;justify-content:center;border-radius:14px;
  background:var(--tint,#FEE2E2);color:var(--hue,#B91C1C);line-height:0;flex:0 0 auto}
.ic .svgic{width:60%;height:60%;display:block}
.i-home{--hue:#e0585b;--tint:#fbe9ea}
.i-fireworks{--hue:#e0932f;--tint:#fbf0dd}
.i-shield{--hue:#166534;--tint:#DCFCE7}
.i-user{--hue:#a179d6;--tint:#f1eafb}
.i-pin{--hue:#e0585b;--tint:#fbe9ea}
.i-cert{--hue:#166534;--tint:#DCFCE7}
.i-pen{--hue:#3faf74;--tint:#e7f5ee}
.i-phone{--hue:#4f9bd6;--tint:#e7f1fb}
.i-compass{--hue:#e0932f;--tint:#fbf0dd}
.i-play{--hue:#e0585b;--tint:#fbe9ea}
.i-warn{--hue:#D97706;--tint:#FEF3C7}
.i-ban{--hue:#DC2626;--tint:#FEE2E2}
.i-box{--hue:#c98a3c;--tint:#f7ecdb}
.i-baby{--hue:#df6f9b;--tint:#fbe6f0}
.i-doc{--hue:#4f9bd6;--tint:#e7f1fb}
.i-lock{--hue:#3faf74;--tint:#e7f5ee}
.i-megaphone{--hue:#e0932f;--tint:#fbf0dd}
.il-ic{display:inline-block;vertical-align:-3px;width:16px;height:16px;color:#fff;flex:0 0 auto}
/* 兜底：按钮 / hero 元信息内的图标统一尺寸，避免 SVG 撑破布局 */
.btn .svgic{width:16px;height:16px;flex:0 0 auto;display:block}
.hero-meta svg,.hm-ic{width:15px;height:15px}
.inline-warn{display:inline-block;vertical-align:-2px;width:14px;height:14px;color:#D97706;flex:0 0 auto}
.play-ic{width:20px;height:20px;color:#fff;display:block}
.search-ic{width:18px;height:18px;color:#9aa0a6;display:block;flex:0 0 auto}
.back-ic{width:22px;height:22px;color:#fff;display:block}

/* 搜索框 */
.searchbox{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);
  border-radius:10px;padding:11px 12px;margin:0 0 8px;flex-shrink:0}
.searchbox input{border:none;outline:none;flex:1;font-size:14px;background:transparent;font-family:inherit;color:var(--ink)}

/* 客服条 */
.chat-bar{position:absolute;left:0;right:0;bottom:calc(58px + env(safe-area-inset-bottom,0px));height:46px;background:linear-gradient(135deg,#991B1B,#B91C1C);color:#fff;display:none;align-items:center;gap:8px;padding:0 14px;z-index:70;cursor:pointer;box-shadow:0 -3px 12px rgba(0,0,0,.14)}
.chat-bar.show{display:flex}
.chat-bar .svgic{width:20px;height:20px;flex:0 0 auto}
.chat-bar .cb-txt{flex:1;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-bar .cb-go{font-size:12.5px;background:rgba(255,255,255,.2);padding:5px 11px;border-radius:999px;flex:0 0 auto}
#p-catalog .scroll{padding-bottom:0}
#p-detail .scroll{padding-bottom:56px}
.chat-mask{position:absolute;inset:0;background:rgba(0,0,0,.4);z-index:85;display:none}
.chat-panel{position:absolute;left:0;right:0;bottom:0;height:74%;background:#fff;z-index:86;display:none;flex-direction:column;border-radius:18px 18px 0 0;box-shadow:0 -8px 30px rgba(0,0,0,.2);overflow:hidden}
.chat-panel.show,.chat-mask.show{display:flex}
.chat-head{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--line);flex-shrink:0;background:#fff}
.chat-head .ttl{font-size:16px;font-weight:700;color:var(--primary-dark);flex:1}
.chat-head .status{display:flex;align-items:center;gap:5px;font-size:12px;color:#2e7d32}
.chat-head .status .dot{width:8px;height:8px;border-radius:50%;background:#3faf74;display:inline-block}
.chat-head .close{cursor:pointer;color:#9aa0a6;display:flex;padding:2px}
.chat-head .close .svgic{width:20px;height:20px}
.chat-ctx{background:#FEF3C7;color:#92400E;font-size:11.5px;padding:8px 16px;display:none;align-items:center;gap:6px;flex-shrink:0;border-bottom:1px solid var(--line)}
.chat-ctx .svgic{width:14px;height:14px;color:#D97706;flex:0 0 auto}
.chat-msgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:#FDF6F0}
.chat-msgs::-webkit-scrollbar{width:0}
.msg{max-width:78%;padding:9px 12px;border-radius:14px;font-size:13.5px;line-height:1.5;word-break:break-word;white-space:pre-wrap}
.msg.cs{background:#fff;border:1px solid var(--line);color:#292524;align-self:flex-start;border-bottom-left-radius:4px}
.msg.me{background:var(--primary);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.msg.sys{align-self:center;background:#eef4fb;color:#3a6ea5;font-size:11.5px;padding:6px 10px;border-radius:10px;max-width:90%;text-align:center}
.chat-input{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--line);flex-shrink:0;background:#fff}
.chat-input input{flex:1;border:1px solid var(--line);border-radius:20px;padding:10px 14px;font-size:14px;outline:none;font-family:inherit;background:#faf8f6}
.chat-input .send{width:42px;height:42px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto}
.chat-input .send .svgic{width:20px;height:20px}
.chat-input .send.off{background:#d6cfc8;cursor:not-allowed}
.msg.date{align-self:center;color:var(--sub);font-size:11px;padding:2px 0;background:transparent}
.msg.cs-avatar,.msg.me-avatar{align-self:flex-start}
.chat-status{align-self:center;font-size:11px;color:var(--sub);padding:2px 0}
.chat-head .status.off{color:#b45309}
.chat-head .status.off .dot{background:#f59e0b}

/* 客服条未读角标 */
.badge{position:absolute;top:7px;left:26px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;
  background:#FCD34D;color:#7C2D12;font-size:10px;font-weight:700;line-height:16px;text-align:center;box-shadow:0 0 0 2px rgba(153,27,27,.9)}

/* ---------------- 微信身份授权 ---------------- */

.auth-mask{position:absolute;inset:0;z-index:95;background:rgba(28,25,23,.55);
  display:none;align-items:flex-end;justify-content:center;backdrop-filter:blur(2px)}
.auth-mask.show{display:flex}
.auth-card{width:100%;background:#fff;border-radius:20px 20px 0 0;padding:26px 20px calc(20px + env(safe-area-inset-bottom,0px));
  text-align:center;animation:authUp .28s ease;box-shadow:0 -10px 40px rgba(0,0,0,.22)}
@keyframes authUp{from{transform:translateY(26px);opacity:.4}to{transform:translateY(0);opacity:1}}
.auth-logo{width:56px;height:56px;margin:0 auto 12px;border-radius:50%;background:linear-gradient(135deg,#991B1B,#B91C1C);
  display:flex;align-items:center;justify-content:center;box-shadow:0 6px 16px rgba(153,27,27,.28)}
.auth-logo .svgic{width:28px;height:28px;color:#fff}
.auth-card h3{font-size:17px;color:var(--ink);margin-bottom:8px}
.auth-desc{font-size:13px;color:var(--sub);line-height:1.75;margin-bottom:16px}
.auth-gain{display:flex;flex-direction:column;gap:8px;margin-bottom:18px;text-align:left}
.auth-gain div{display:flex;align-items:center;gap:10px;background:#FDF6F0;border:1px solid var(--line);
  border-radius:10px;padding:9px 12px;font-size:12.5px;color:#4b4039}
.auth-gain b{flex:0 0 auto;width:18px;height:18px;border-radius:50%;background:var(--primary);color:#fff;
  font-size:11px;line-height:18px;text-align:center;font-weight:700}
.btn.wx{width:100%;background:#07C160;color:#fff;box-shadow:0 6px 16px rgba(7,193,96,.28)}
.btn.wx:hover{background:#06ad56}
.btn.wx .wechat-ic{width:18px;height:18px;color:#fff}
.auth-hint{margin-top:14px;font-size:11px;color:#a49a92;line-height:1.6}
.auth-mode{margin-top:6px;font-size:10.5px;color:#c2410c}

/* ---------------- 我的：登录身份卡 ---------------- */

.user-card{display:flex;align-items:center;gap:12px;padding:14px;border-radius:14px;margin-bottom:12px;
  background:linear-gradient(135deg,#991B1B,#B91C1C);color:#fff;box-shadow:0 6px 18px rgba(153,27,27,.2)}
.user-card .avatar{width:46px;height:46px;border-radius:50%;object-fit:cover;flex:0 0 auto;background:rgba(255,255,255,.18)}
.user-card .info{min-width:0;flex:1;text-align:left}
.user-card .nick{font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-card .meta{font-size:11.5px;color:#FDE8E6;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-card .act{flex:0 0 auto;font-size:11.5px;background:rgba(255,255,255,.2);padding:6px 10px;border-radius:999px;cursor:pointer}
.user-card.guest{background:linear-gradient(135deg,#78716C,#57534E)}
.user-phone{display:flex;gap:8px;margin-top:10px}
.user-phone input{flex:1;border:1px solid var(--line);border-radius:10px;padding:9px 12px;font-size:13px;outline:none;font-family:inherit}
.user-phone button{flex:0 0 auto;font-size:12px;padding:9px 14px;border:none;border-radius:10px;background:var(--primary);color:#fff;cursor:pointer;font-family:inherit}

/* 实时同步状态角标 */
.live-dot{position:absolute;right:12px;top:calc(46px + 30px + env(safe-area-inset-top,0px));z-index:40;
  display:flex;align-items:center;gap:5px;background:rgba(22,101,52,.92);color:#D3F4DF;
  font-size:10.5px;padding:4px 9px;border-radius:999px;opacity:0;transition:opacity .25s;pointer-events:none}
.live-dot.show{opacity:1}
.live-dot i{width:6px;height:6px;border-radius:50%;background:#4ade80;animation:liveblink 1.2s infinite}
@keyframes liveblink{0%,100%{opacity:.35}50%{opacity:1}}

/* ===== 确认页：购买须知内链 ===== */
.doc-link{color:var(--primary);text-decoration:underline;font-weight:600}

/* ===== 客服窗口：公众号关注引导 ===== */
.follow-tip{display:none;align-items:center;gap:10px;background:#FFFBEB;border:1px solid #F59E0B;
  border-radius:10px;padding:10px 12px;margin:10px 10px 0}
.follow-tip .ft-qr{width:52px;height:52px;border-radius:8px;object-fit:cover;flex-shrink:0;background:#fff}
.follow-tip .ft-text{flex:1;min-width:0;line-height:1.5}
.follow-tip .ft-text b{display:block;font-size:12.5px;color:#92400E}
.follow-tip .ft-text span{font-size:11px;color:#A16207}
.follow-tip .ft-btn{flex-shrink:0;border:1px solid #F59E0B;background:#fff;color:#92400E;
  font-size:11px;border-radius:8px;padding:6px 9px;cursor:pointer}
.follow-tip .ft-qr{cursor:zoom-in}

/* 公众号二维码大图弹窗 */
.ft-qr-mask{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:999;
  display:flex;align-items:center;justify-content:center;cursor:zoom-out;animation:fadeIn .15s}
.ft-qr-mask .ft-qr-box{background:#fff;border-radius:14px;padding:16px 16px 12px;text-align:center;max-width:82vw;cursor:default}
.ft-qr-mask img{width:min(64vw,320px);height:auto;border-radius:8px;display:block;background:#fff}
.ft-qr-mask p{margin-top:10px;font-size:13px;color:#374151;font-weight:600}

/* ===== 提货方式卡片：立即提货 / 预约提货 ===== */
.dtype-row{display:flex;gap:10px}
.dtype{flex:1;min-width:0;border:1.5px solid var(--line);border-radius:12px;padding:13px 10px;
  text-align:center;cursor:pointer;background:#fff;transition:all .15s}
.dtype b{display:block;font-size:14px;color:var(--ink)}
.dtype span{display:block;font-size:11.5px;color:var(--sub);margin-top:5px;line-height:1.5}
.dtype.on{border-color:var(--primary);background:#FDF2F2;box-shadow:0 2px 10px rgba(185,28,28,.14)}
.dtype.on b{color:var(--primary)}
#orderScroll select{width:100%;border:1px solid var(--line);border-radius:10px;padding:11px 12px;
  font-size:14px;background:#fff;color:var(--ink);font-family:inherit;outline:none}

/* ===== 购物车 / 到店自提单 ===== */
.field select{width:100%;border:1px solid var(--line);border-radius:10px;padding:9px 12px;font-size:13px;
  outline:none;font-family:inherit;background:#fff;color:var(--ink)}
.cart-row{display:flex;gap:10px;padding:10px 0;border-bottom:1px dashed var(--line);align-items:flex-start}
.cart-row:last-child{border-bottom:none}
.cart-img{width:54px;height:54px;flex:0 0 54px;border-radius:10px;background:var(--bg);overflow:hidden;
  display:flex;align-items:center;justify-content:center}
.cart-img img{width:100%;height:100%;object-fit:cover}
.cart-main{flex:1;min-width:0}
.cart-name{font-size:13.5px;font-weight:600;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cart-sub{font-size:11.5px;color:var(--sub);margin-top:3px;line-height:1.5}
.cart-del{flex:0 0 auto;font-size:11.5px;color:var(--danger);cursor:pointer;padding:4px 2px}
.cart-qty{display:flex;align-items:center;gap:10px;margin-top:8px;flex-wrap:wrap}
.cart-qty .qbtn{width:28px;height:28px;line-height:26px;text-align:center;border:1px solid var(--line);
  border-radius:8px;font-size:16px;cursor:pointer;background:#fff;user-select:none}
.cart-qty .qnum{min-width:22px;text-align:center;font-size:14px;font-weight:600}
.cart-empty{text-align:center;padding:36px 10px;color:var(--sub);font-size:13px;line-height:1.9}
.cart-bar{display:flex;align-items:center;gap:10px;margin-top:12px;background:#fff;border:1px solid var(--line);
  border-radius:12px;padding:12px}
.cart-bar .sum{flex:1;font-size:12px;color:var(--sub);line-height:1.6}
.cart-bar .sum b{color:var(--primary);font-size:17px}
.cart-bar .btn{flex:0 0 auto;width:auto;padding:10px 18px}
.code-box{margin:12px 0 4px;padding:14px 12px;background:var(--bg);border:1px dashed var(--primary);border-radius:12px;text-align:center}
.code-box .code{font-size:26px;font-weight:800;letter-spacing:6px;color:var(--primary);
  font-family:ui-monospace,Menlo,Consolas,monospace}
.code-box .tip{font-size:11.5px;color:var(--sub);margin-top:8px;line-height:1.7}
.badge{display:inline-block;min-width:17px;padding:1px 6px;border-radius:999px;background:var(--primary);
  color:#fff;font-size:10.5px;text-align:center;margin-left:6px;vertical-align:1px}
.pick-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.pick-row .opt{border:1px solid var(--line);border-radius:10px;padding:8px 14px;font-size:12.5px;background:#fff}
.pick-row .opt.on{border-color:var(--primary);color:var(--primary);background:#FFF5F5;font-weight:600}
.od-meta{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;color:var(--sub);line-height:1.9}
.od-meta b{color:var(--ink);font-weight:600}
.od-goods{display:flex;justify-content:space-between;gap:10px;font-size:13px;padding:7px 0;
  border-bottom:1px dashed var(--line)}
.od-goods:last-child{border-bottom:none}
.od-goods .n{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.od-goods .q{flex:0 0 auto;color:var(--sub)}

/* ===== 我的订单（新版） ===== */
.ointro h3{color:var(--primary)}
.ointro .info{margin-top:4px}
.ocard-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.ocard-line{font-size:13px;line-height:1.85;color:var(--ink)}
.ocard-k{color:var(--primary-dark);font-weight:700}
/* 订单卡片状态标签（已完成 / 已取消等）加大加粗，便于快速辨认终态 */
.ocard .pill{flex:0 0 auto;font-size:13px;font-weight:700;line-height:1.4;padding:5px 12px}
.ocode{display:inline-flex;align-items:center;gap:8px;margin-top:8px;background:#FDECEC;
  border:1px solid #F3C9C9;border-radius:10px;padding:7px 12px}
.ocode-t{font-size:12.5px;color:var(--primary-dark);font-weight:700}
.ocode b{font-size:17px;letter-spacing:3px;color:var(--primary);font-family:ui-monospace,Menlo,Consolas,monospace}
.ocard-link{margin-top:10px;color:var(--primary);font-size:13px;font-weight:600}

/* 订单明细金额 */
.og-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px;line-height:1.9}
.og-amt{color:var(--sub);font-size:12.5px;white-space:nowrap;font-variant-numeric:tabular-nums}
.og-total{margin-top:8px;padding-top:8px;border-top:1px dashed var(--line);font-size:13.5px;color:var(--ink)}
.og-total b{color:var(--primary);font-size:16px;font-variant-numeric:tabular-nums}
.back-all-p{padding:10px 12px}
.back-all{color:var(--primary);font-weight:700;font-size:14px;cursor:pointer}
.onote{background:#DCFCE7;border-radius:12px;padding:14px 12px;text-align:center;margin-bottom:12px}
.onote b{display:block;font-size:15px;color:#14532D}
.onote span{font-size:12px;color:#3E7A50;display:block;margin-top:4px}
.code-dashed{border:2px dashed var(--primary);border-radius:14px;background:#fff;text-align:center;
  padding:18px 12px;margin-bottom:12px}
.code-dashed .cd-t{font-size:12.5px;color:var(--sub)}
.code-dashed .cd-code{font-size:30px;font-weight:800;letter-spacing:8px;color:var(--primary);
  font-family:ui-monospace,Menlo,Consolas,monospace;margin-top:6px;text-indent:8px}

/* 履约进度步骤条 */
.ostep .s{position:relative;padding:0 0 18px 26px}
.ostep .s::before{content:'';position:absolute;left:6px;top:18px;bottom:0;width:2px;background:var(--line)}
.ostep .s.last::before{display:none}
.ostep .dot{position:absolute;left:0;top:4px;width:14px;height:14px;border-radius:50%;
  background:#fff;border:2px solid var(--line)}
.ostep .s.on .dot{background:#166534;border-color:#BBF7D0}
.ostep .dot.now{background:var(--gold);border-color:#FDE68A}
.ostep .dot.bad{background:var(--danger);border-color:#FECACA}
.ostep .tx b{font-size:13.5px}
.ostep .s:not(.on) .tx b{color:var(--sub)}
.ostep .tx p{font-size:12px;color:var(--sub);line-height:1.7;margin-top:3px}

/* 品类卡片内直接选数量并加入购物车 */
.padd{display:flex;align-items:center;gap:6px;padding:8px;border-top:1px solid var(--line);justify-content:flex-end}
.padd .qbtn{display:none;width:26px;height:26px;line-height:24px;text-align:center;border:1px solid var(--line);
  border-radius:7px;font-size:15px;background:#fff;flex:0 0 auto;user-select:none}
.padd.open .qbtn{display:block}
.padd .qnum{display:none;min-width:20px;text-align:center;font-size:13px;font-weight:600;flex:0 0 auto}
.padd.open .qnum{display:block}
.padd-btn{flex:0 0 auto;margin-left:auto;border:none;border-radius:8px;width:36px;height:26px;padding:0;
  background:var(--primary);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.padd-btn svg{width:17px;height:17px;color:#fff}
.padd-out{flex:0 0 auto;margin-left:auto;font-size:11.5px;color:var(--sub)}

/* 右下角常驻购物车 */
.cart-fab{position:absolute;right:14px;bottom:14px;z-index:80;width:48px;height:48px;border-radius:50%;
  background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 18px rgba(153,27,27,.35);cursor:pointer}
/* 客服条显示时，购物车抬到客服条上方，避免互相遮挡 */
.cart-fab.lifted{bottom:calc(98px + env(safe-area-inset-bottom,0px))}
.cart-fab svg{width:22px;height:22px;color:#fff}
.fab-badge{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;
  background:var(--gold);color:#fff;font-size:11px;font-weight:700;display:none;align-items:center;
  justify-content:center;border:2px solid #fff}
