:root{
  --primary:#ff5b2e;
  --primary-deep:#ef3d17;
  --ink:#1c1c1e;
  --muted:#8b8f99;
  --line:#eceef2;
  --bg:#f4f5f7;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:#e8eaee;color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;overflow-x:hidden;
}
[hidden]{display:none!important}
button{font-family:inherit;cursor:pointer;border:0;background:none;color:inherit}
input,textarea{font-family:inherit}
h1,h2,h3,p{margin:0}

.app{
  position:relative;max-width:460px;min-height:100vh;margin:0 auto;background:var(--bg);
  box-shadow:0 0 50px rgba(16,24,40,.10);
  padding-bottom:calc(58px + env(safe-area-inset-bottom));
  overflow-x:hidden;
}
.page{display:none}
.page.active{display:block}

/* ---------------- 首页 ---------------- */
.hero{
  position:relative;overflow:hidden;padding:22px 16px 18px;
  background:linear-gradient(135deg,#ff8a45 0%,#ff5b2e 48%,#ef3312 100%);
  color:#fff;border-radius:0 0 24px 24px;
}
.hero::before,.hero::after{content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.13)}
.hero::before{width:190px;height:190px;right:-70px;top:-80px}
.hero::after{width:120px;height:120px;right:40px;bottom:-70px;background:rgba(255,255,255,.09)}
.hero-top{position:relative;display:flex;align-items:center;gap:11px;z-index:1}
.logo{
  width:44px;height:44px;flex:0 0 44px;border-radius:14px;background:rgba(255,255,255,.94);
  display:flex;align-items:center;justify-content:center;font-size:24px;
  box-shadow:0 6px 16px rgba(150,30,0,.18);
}
.hero-title{min-width:0}
.hero-title h1{font-size:19px;font-weight:700;letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-title p{font-size:11.5px;opacity:.88;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-btn{
  margin-left:auto;background:rgba(255,255,255,.22);color:#fff;font-size:12px;font-weight:600;
  padding:7px 13px;border-radius:999px;border:1px solid rgba(255,255,255,.35);
}
.search{
  position:relative;z-index:1;display:flex;align-items:center;gap:8px;margin-top:15px;
  height:42px;padding:0 13px;border-radius:13px;background:rgba(255,255,255,.96);
  box-shadow:0 6px 18px rgba(150,30,0,.14);
}
.search .s-ico{font-size:14px;opacity:.55}
.search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:14px;color:#222}
.search input::placeholder{color:#a9aeb8}

.notice{
  margin:10px 14px 0;padding:9px 12px;border-radius:11px;
  background:#fff7ea;color:#a15c00;font-size:12px;line-height:1.6;
  border:1px solid #ffe9c7;
}

.chips{
  position:sticky;top:0;z-index:6;display:flex;gap:8px;overflow-x:auto;
  padding:11px 14px;background:var(--bg);
  scrollbar-width:none;-ms-overflow-style:none;
}
.chips::-webkit-scrollbar{display:none}
.chip{
  flex:0 0 auto;padding:7px 14px;border-radius:999px;background:#fff;border:1px solid var(--line);
  font-size:13px;color:#5c6270;white-space:nowrap;transition:.18s;
}
.chip.active{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:600;box-shadow:0 5px 14px rgba(255,91,46,.30)}

.sec-head{display:flex;align-items:baseline;justify-content:space-between;padding:2px 16px 10px}
.sec-head h2{font-size:15.5px;font-weight:700}
.sec-head span{font-size:11.5px;color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:0 14px 16px}
.card{
  min-width:0;background:#fff;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;
  box-shadow:0 2px 10px rgba(17,24,39,.05);transition:transform .12s;
}
.card:active{transform:scale(.98)}
.thumb{position:relative;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;font-size:48px;line-height:1;user-select:none}
.tag{
  position:absolute;left:8px;top:8px;background:rgba(255,59,48,.94);color:#fff;
  font-size:10px;font-weight:700;padding:2px 7px;border-radius:7px;font-style:normal;
}
.tag.soldout{background:rgba(90,95,105,.85)}
.card-body{padding:9px 10px 11px;display:flex;flex-direction:column;flex:1}
.card-body h3{
  font-size:13.5px;font-weight:600;line-height:1.35;min-height:37px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.card-sub{font-size:11px;color:var(--muted);margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-foot{display:flex;align-items:flex-end;justify-content:space-between;margin-top:7px;gap:4px}
.price{color:#ff3b30;font-weight:800;font-size:15.5px;letter-spacing:-.2px;white-space:nowrap}
.price .old{font-size:10.5px;color:#b9bec7;font-weight:400;text-decoration:line-through;margin-left:4px;letter-spacing:0}
.add{
  width:27px;height:27px;border-radius:50%;background:linear-gradient(135deg,#ff8a45,#ff4a22);color:#fff;
  font-size:19px;line-height:1;display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 10px rgba(255,74,34,.35);flex:0 0 27px;
}
.add:disabled{background:#d8dbe0;box-shadow:none}

.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:54px 24px 70px;text-align:center}
.empty-ico{font-size:46px;opacity:.75;margin-bottom:10px}
.empty p{font-size:13.5px;color:#9aa0aa;margin-bottom:16px}

/* ---------------- 按钮 ---------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:13px 18px;border-radius:13px;
  background:linear-gradient(135deg,#ff8038,#ff4a22);color:#fff;
  font-size:15px;font-weight:700;letter-spacing:.3px;
  box-shadow:0 7px 18px rgba(255,74,34,.30);
  transition:transform .12s,opacity .2s;
}
.btn:active{transform:scale(.985)}
.btn.ghost{background:#fff;color:var(--primary);border:1.5px solid rgba(255,91,46,.45);box-shadow:none}
.btn.sm{padding:9px 18px;font-size:13px;border-radius:11px}
.btn.big{width:100%;padding:15px;font-size:16px;margin-top:6px}
.pay-scroll .btn.ghost{width:100%;margin-top:10px}
.btn:disabled{opacity:.45;box-shadow:none}

/* ---------------- 购物车 ---------------- */
.page-head{display:flex;align-items:center;justify-content:space-between;padding:18px 16px 10px}
.page-head h2{font-size:18px;font-weight:700}
.link-btn{font-size:13px;color:#8b8f99;padding:6px}
.cart-list{padding-bottom:86px}
.cart-row{display:flex;gap:11px;align-items:center;background:#fff;margin:0 14px 10px;border-radius:15px;padding:11px}
.thumb-sm{width:64px;height:64px;flex:0 0 64px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:31px;user-select:none}
.cr-main{flex:1;min-width:0}
.cr-main h3{font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cr-sub{font-size:11px;color:var(--muted);margin-top:3px}
.cr-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:7px}
.stepper{display:flex;align-items:center;border:1px solid #e6e8ec;border-radius:999px;overflow:hidden;background:#fff}
.stepper button{width:27px;height:25px;font-size:15px;color:#4a4f59;display:flex;align-items:center;justify-content:center}
.stepper span{min-width:26px;text-align:center;font-size:13px;font-weight:700;color:#222}
.del{padding:8px;font-size:13px;color:#c3c7cf;line-height:1}
.checkout-bar{
  position:fixed;left:50%;transform:translateX(-50%);bottom:calc(58px + env(safe-area-inset-bottom));
  width:100%;max-width:460px;z-index:19;display:none;align-items:center;gap:12px;
  background:#fff;padding:10px 16px;border-top:1px solid #eef0f3;box-shadow:0 -8px 22px rgba(17,24,39,.06);
}
.checkout-bar.show{display:flex}
.cb-sum{flex:1;font-size:11.5px;color:#8b8f99;line-height:1.3}
.cb-sum b{display:block;font-size:20px;font-weight:800;color:#ff3b30;letter-spacing:-.4px}

/* ---------------- 订单 ---------------- */
.lookup{background:#fff;border-radius:14px;padding:12px;margin:0 14px 14px}
.lookup-title{font-size:12.5px;font-weight:700;color:#5c6270;margin-bottom:8px}
.lookup-row{display:flex;flex-wrap:wrap;gap:8px}
.lookup-row input{flex:1 1 42%;min-width:0;border:1px solid #e6e8ec;background:#fafbfc;border-radius:9px;padding:9px 10px;font-size:13px;outline:none}
.lookup-row input:focus{border-color:var(--primary);background:#fff}
.lookup-row .btn{flex:1 1 100%}
.order-card{background:#fff;margin:0 14px 12px;border-radius:15px;padding:13px 14px;box-shadow:0 2px 10px rgba(17,24,39,.04)}
.oc-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:9px;border-bottom:1px dashed #eef0f3}
.oc-no{font-size:11px;color:#a0a5af}
.oc-st{font-size:11.5px;font-weight:700;padding:3px 9px;border-radius:999px}
.oc-st.warn{color:#c26a00;background:#fff4e0}
.oc-st.wait{color:#1a6fd4;background:#e9f2ff}
.oc-st.info{color:#1a6fd4;background:#e9f2ff}
.oc-st.ok{color:#0f8a45;background:#e6f8ee}
.oc-st.ship{color:#7a4bd0;background:#f1ebff}
.oc-st.done{color:#7d838d;background:#f1f2f4}
.oc-st.muted{color:#9aa0aa;background:#f4f5f7}
.oc-items{padding:9px 0 3px}
.oi{display:flex;align-items:center;gap:8px;padding:4px 0;font-size:12.5px}
.oi-e{font-size:18px;flex:0 0 24px;text-align:center}
.oi-n{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#3d424b}
.oi-q{color:#9aa0aa;font-size:11.5px}
.oi-p{color:#5c6270;font-size:12px;min-width:62px;text-align:right}
.oc-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;padding-top:10px;border-top:1px dashed #eef0f3}
.oc-sum{font-size:11.5px;color:#8b8f99}
.oc-sum b{color:#ff3b30;font-size:15px;font-weight:800;margin-left:2px}
.oc-time{font-size:10.5px;color:#b9bec7;margin-top:8px}
.mini{border-radius:999px;padding:6px 13px;font-size:12px;font-weight:700;background:linear-gradient(135deg,#ff8038,#ff4a22);color:#fff;white-space:nowrap}
.mini.ghost{background:#fff;color:#5c6270;border:1px solid #e2e5ea;font-weight:600}

/* ---------------- 弹层 ---------------- */
#mask{position:fixed;inset:0;background:rgba(12,14,20,.46);z-index:30;opacity:0;pointer-events:none;transition:opacity .26s}
#mask.show{opacity:1;pointer-events:auto}
.sheet{
  position:fixed;left:50%;bottom:0;width:100%;max-width:460px;z-index:40;
  background:#fff;border-radius:22px 22px 0 0;overflow:hidden;
  transform:translateX(-50%) translateY(103%);
  transition:transform .32s cubic-bezier(.22,.86,.3,1);
  max-height:90vh;display:flex;flex-direction:column;
  box-shadow:0 -12px 44px rgba(0,0,0,.16);will-change:transform;
}
.sheet.show{transform:translateX(-50%) translateY(0)}
.sheet-grip{width:38px;height:4px;border-radius:2px;background:#e5e7eb;margin:9px auto 0;flex:0 0 auto}
.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:10px 16px 6px;flex:0 0 auto}
.sheet-head h2{font-size:16.5px;font-weight:700}
.sheet-head .x{font-size:20px;color:#b9bec7;padding:4px 8px;line-height:1}
.sheet-scroll{overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 16px 18px;min-height:0;flex:1 1 auto}
.sheet-actions{display:flex;gap:10px;padding:11px 16px calc(11px + env(safe-area-inset-bottom));border-top:1px solid #f1f2f5;flex:0 0 auto;background:#fff}
.sheet-actions .btn{flex:1}

/* 商品详情 */
.detail-hero{height:186px;display:flex;align-items:center;justify-content:center;font-size:82px;line-height:1;user-select:none}
.d-close{position:absolute;top:12px;right:12px;width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.72);color:#5c6270;font-size:13px;z-index:3;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.detail-body h2{font-size:17.5px;font-weight:700;line-height:1.35}
.d-price{display:flex;align-items:baseline;gap:7px;margin-top:9px;flex-wrap:wrap}
.d-price .p{font-size:25px;font-weight:800;color:#ff3b30;letter-spacing:-.6px}
.d-price s{font-size:12.5px;color:#b9bec7}
.d-price em{font-size:10.5px;font-style:normal;font-weight:700;color:#ff5b2e;background:#fff1eb;padding:2px 7px;border-radius:6px}
.d-desc{font-size:13px;line-height:1.75;color:#5c6270;margin-top:12px;padding:11px 12px;background:#f8f9fb;border-radius:11px}
.meta-row{display:flex;gap:16px;font-size:11.5px;color:#9aa0aa;margin-top:12px}
.qty-row{display:flex;align-items:center;justify-content:space-between;margin-top:14px;padding-top:12px;border-top:1px solid #f2f3f6}
.qty-row>span{font-size:13px;color:#5c6270}

/* 结算 */
.co-lines{background:#f8f9fb;border-radius:12px;padding:11px 12px;margin:4px 0 10px}
.co-line{display:flex;align-items:center;gap:8px;font-size:12.5px;padding:4px 0}
.co-line .ce{font-size:18px;width:22px;text-align:center}
.co-line .cn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.co-line .cq{color:#9aa0aa;font-size:11.5px}
.co-line .co-price{font-weight:600;min-width:62px;text-align:right}
.co-sum{padding:2px 4px 6px}
.co-sum>div{display:flex;justify-content:space-between;font-size:12.5px;color:#8b8f99;padding:3px 0}
.co-sum b{color:#5c6270;font-weight:600}
.co-sum .co-grand{border-top:1px solid #f1f2f4;margin-top:5px;padding-top:8px;align-items:baseline}
.co-sum .co-grand span{font-size:13px;color:#3d424b;font-weight:600}
.co-sum .co-grand b{font-size:22px;color:#ff3b30;font-weight:800;letter-spacing:-.5px}
.form-title{font-size:12.5px;font-weight:700;color:#3d424b;margin:16px 0 9px;display:flex;align-items:center;gap:6px}
.form-title::before{content:"";width:3px;height:12px;border-radius:2px;background:var(--primary)}
.field{margin-bottom:12px}
.field label{display:block;font-size:12px;color:#6b7280;font-weight:600;margin-bottom:6px}
.field label i{color:#ff5b2e;font-style:normal}
.input,.textarea{width:100%;border:1px solid #e6e8ec;background:#fafbfc;border-radius:11px;padding:11px 12px;font-size:14px;color:#1c1c1e;outline:none;transition:.18s}
.input:focus,.textarea:focus{border-color:var(--primary);background:#fff;box-shadow:0 0 0 3px rgba(255,91,46,.10)}
.textarea{resize:none;min-height:62px;line-height:1.6}

/* 客服 */
.ct-text{font-size:14px;line-height:1.9;color:#3d424b;white-space:pre-line;padding:6px 0 14px;word-break:break-all}
.help-link{display:block;margin-top:14px;padding:12px;text-align:center;font-size:13.5px;font-weight:600;color:var(--primary);background:#fff7f3;border-radius:12px;text-decoration:none}

/* 订单详情 */
.od-top{display:flex;justify-content:center;padding:6px 0 2px}
.od-info{margin-top:12px;background:#f8f9fb;border-radius:12px;padding:4px 12px}
.od-info>div{display:flex;gap:12px;padding:9px 0;font-size:12.5px;border-bottom:1px solid #eef0f3}
.od-info>div:last-child{border-bottom:0}
.od-info span{flex:0 0 68px;color:#9aa0aa}
.od-info b{flex:1;text-align:right;font-weight:600;color:#3d424b;word-break:break-all}

/* ---------------- 支付页 ---------------- */
.pay-view{
  position:fixed;inset:0;z-index:60;background:var(--bg);
  max-width:460px;margin:0 auto;display:flex;flex-direction:column;
  transform:translateY(100%);transition:transform .3s cubic-bezier(.22,.86,.3,1);
  visibility:hidden;
}
.pay-view.show{transform:translateY(0);visibility:visible}
.pay-head{
  display:flex;align-items:center;gap:8px;padding:14px 16px;
  background:#fff;border-bottom:1px solid var(--line);font-size:15px;font-weight:700;
}
.pay-back{font-size:24px;line-height:1;color:#3d424b;padding:0 6px 2px 0}
.pay-scroll{flex:1;overflow-y:auto;padding:18px 16px calc(24px + env(safe-area-inset-bottom))}
.pay-amount{text-align:center;padding:8px 0 18px}
.pay-amount small{display:block;font-size:12px;color:#9aa0aa;margin-bottom:6px}
.pay-amount b{display:block;font-size:36px;font-weight:800;color:#ff3b30;letter-spacing:-1px}
.pay-state{display:inline-block;margin-top:10px;font-size:12px;font-weight:700;color:#c26a00;background:#fff4e0;padding:4px 12px;border-radius:999px}
.pay-state.ok{color:#0f8a45;background:#e6f8ee}
.pay-state.wait{color:#1a6fd4;background:#e9f2ff}
.pay-state.err{color:#8b8f99;background:#f1f2f4}
.qr-wrap{
  background:#fff;border-radius:18px;padding:16px;display:flex;align-items:center;justify-content:center;
  min-height:232px;box-shadow:0 2px 12px rgba(17,24,39,.05);
}
.qr-wrap img{width:200px;height:200px;object-fit:contain}
.qr-none{font-size:13px;color:#9aa0aa;text-align:center;line-height:1.9}
.pay-tip{font-size:12.5px;color:#6b7280;line-height:1.8;margin:14px 4px 0;white-space:pre-line}
.pay-info{margin:14px 0 6px;background:#fff;border-radius:14px;padding:4px 14px}
.pi{display:flex;justify-content:space-between;gap:10px;padding:10px 0;font-size:13px;border-bottom:1px solid #f4f5f7}
.pi:last-child{border-bottom:0}
.pi span{color:#8b8f99}
.pi b{font-weight:700;letter-spacing:.5px}
.pay-status-box{margin-top:14px;background:#fff;border-radius:14px;padding:14px;font-size:13px;line-height:1.8;color:#3d424b;border-left:4px solid #ffb020}
.pay-status-box.ok{border-left-color:#0f9d58}
.pay-status-box.info{border-left-color:#1a6fd4}
.pay-foot{font-size:11px;color:#b3b8c1;line-height:1.9;text-align:center;margin-top:18px}

/* toast */
#toast{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%) scale(.95);
  background:rgba(28,28,30,.90);color:#fff;font-size:13.5px;line-height:1.5;
  padding:11px 17px;border-radius:12px;max-width:72vw;text-align:center;
  z-index:75;opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;
  box-shadow:0 10px 30px rgba(0,0,0,.22);
}
#toast.show{opacity:1;transform:translate(-50%,-50%) scale(1)}

/* 底部导航 */
.tabbar{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:460px;height:calc(58px + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);z-index:20;
  display:flex;background:rgba(255,255,255,.97);
  border-top:1px solid #eef0f3;backdrop-filter:blur(14px);
}
.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:10.5px;color:#9aa0aa;position:relative;padding-top:2px}
.tab .ico{font-size:20px;line-height:1;filter:grayscale(.4);opacity:.75;transition:.18s}
.tab.active{color:var(--primary);font-weight:700}
.tab.active .ico{filter:none;opacity:1;transform:translateY(-1px)}
.tab .badge{
  position:absolute;top:5px;left:calc(50% + 7px);min-width:16px;height:16px;padding:0 4px;
  border-radius:8px;background:#ff3b30;color:#fff;font-size:10px;font-weight:700;
  line-height:16px;text-align:center;box-shadow:0 0 0 2px #fff;
}
