:root{
  --primary:#0f766e;--primary-dark:#115e59;--accent:#f59e0b;--danger:#e11d48;
  --ink:#0f172a;--muted:#64748b;--line:#e2e8f0;--bg:#f5f7fa;--card:#fff;--radius:14px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{margin:0;height:100%;overflow-x:hidden;}
body{
  background:var(--bg);color:var(--ink);font-size:14px;line-height:1.45;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
.hidden{display:none !important;}
button,input,select,textarea{font-family:inherit;font-size:14px;}
button{cursor:pointer;}
#app{max-width:560px;margin:0 auto;min-height:100%;background:var(--bg);padding-bottom:70px;position:relative;}
.shop-header{
  position:sticky;top:0;z-index:20;background:linear-gradient(135deg,var(--primary),var(--primary-dark));color:#fff;
  padding:14px 16px;display:flex;align-items:center;justify-content:space-between;
}
body[data-template-style="vivid"] .hero { filter:saturate(1.15); }
body[data-template-style="compact"] .hero { padding:14px; }
.shop-title{display:flex;align-items:center;gap:10px;flex:1;min-width:0;}
.logo{
  width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:18px;
}
.shop-title b{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.shop-title small{opacity:.85;font-size:11px;}
.icon-btn{flex-shrink:0;position:relative;background:rgba(255,255,255,.15);border:none;color:#fff;font-size:20px;border-radius:11px;width:42px;height:42px;}
.badge{
  position:absolute;top:-4px;right:-4px;background:var(--accent);color:#fff;font-size:10px;
  min-width:17px;height:17px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px;
}
.page{padding:12px 14px 20px;overflow-x:hidden;}
.hero{
  background:linear-gradient(120deg,#0f766e,#0ea5e9);color:#fff;border-radius:16px;padding:18px 16px;margin-bottom:14px;
}
.hero h2{margin:0 0 6px;font-size:18px;}
.hero p{margin:0;opacity:.9;font-size:12px;}
.section-title{display:flex;align-items:center;justify-content:space-between;margin:16px 0 10px;font-weight:700;}
.section-title small{color:var(--muted);font-weight:400;font-size:12px;}
.cat-scroll{display:flex;gap:10px;overflow-x:auto;padding-bottom:6px;scrollbar-width:none;}
.cat-scroll::-webkit-scrollbar{display:none;}
.cat-chip{
  background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 14px;text-align:center;
  min-width:74px;font-size:12px;color:#334155;flex-shrink:0;
}
.cat-chip.active{border-color:var(--primary);color:var(--primary);font-weight:700;background:#ecfdf5;}
.goods-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.goods-card{background:#fff;border-radius:var(--radius);overflow:hidden;border:1px solid #eef2f7;}
.goods-thumb{
  height:110px;background:linear-gradient(135deg,#f0fdfa,#e0f2fe);display:flex;align-items:center;
  justify-content:center;color:#0f766e;font-weight:700;font-size:20px;position:relative;
}
.goods-thumb img{width:100%;height:100%;object-fit:cover;}
.goods-body{padding:9px 10px 11px;}
.goods-title{font-size:13px;font-weight:600;line-height:1.35;height:36px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.goods-price-row{display:flex;align-items:flex-end;justify-content:space-between;margin-top:6px;}
.price{color:var(--danger);font-weight:700;font-size:16px;}
.price small{font-size:11px;font-weight:400;color:var(--muted);text-decoration:line-through;margin-left:4px;}
.add-btn{width:28px;height:28px;border-radius:50%;border:none;background:var(--primary);color:#fff;font-size:18px;line-height:1;}
.tag{position:absolute;left:6px;top:6px;background:var(--accent);color:#fff;font-size:10px;padding:2px 6px;border-radius:6px;}

.list{display:flex;flex-direction:column;gap:10px;}
.list-card{background:#fff;border-radius:var(--radius);padding:12px;border:1px solid #eef2f7;}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.muted{color:var(--muted);}
.small{font-size:12px;}
.strong{font-weight:700;}
.divider{height:1px;background:var(--line);margin:10px 0;}

.btn{border:1px solid transparent;border-radius:10px;padding:9px 14px;background:#e2e8f0;color:#0f172a;font-weight:600;}
.btn:disabled{opacity:.5;}
.btn-primary{background:var(--primary);color:#fff;}
.btn-outline{background:#fff;border-color:var(--line);color:#334155;}
.btn-success{background:#16a34a;color:#fff;}
.btn-danger{background:var(--danger);color:#fff;}
.btn-block{width:100%;}
.btn-sm{padding:6px 10px;font-size:12px;border-radius:8px;}
.btn-xs{padding:4px 8px;font-size:11px;border-radius:6px;}

.tabbar{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:560px;height:calc(60px + var(--wk-safe-bottom, 0px));
  background:#fff;border-top:1px solid var(--line);display:flex;z-index:30;padding-bottom:var(--wk-safe-bottom, env(safe-area-inset-bottom, 0px));
}
.tabbar button{
  flex:1;border:none;background:none;color:#94a3b8;font-size:11px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;
}
.tabbar button span{font-size:19px;}
.tabbar button.active{color:var(--primary);font-weight:700;}

.sheet-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center;}
.sheet{
  background:#fff;width:100%;max-width:560px;border-radius:18px 18px 0 0;max-height:90vh;
  display:flex;flex-direction:column;animation:slideUp .18s ease-out;
}
.sheet-lg{max-height:94vh;}
@keyframes slideUp{from{transform:translateY(24px);opacity:.8;}to{transform:none;opacity:1;}}
.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line);}
.sheet-head h3{margin:0;font-size:16px;}
.sheet-head button{border:none;background:none;font-size:24px;color:#94a3b8;}
.sheet-body{padding:14px 16px;overflow-y:auto;}
.sheet-foot{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-top:1px solid var(--line);gap:12px;}
.sheet-foot b{color:var(--danger);font-size:20px;}

.form{display:flex;flex-direction:column;gap:10px;}
.form input,.form select,.form textarea{padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#f8fafc;outline:none;}
.form input:focus,.form select:focus{border-color:var(--primary);background:#fff;}
.check{display:flex;align-items:center;gap:8px;font-size:13px;color:#475569;}
.auth-tabs{display:flex;background:#f1f5f9;border-radius:10px;padding:4px;margin-bottom:14px;}
.auth-tabs button{flex:1;border:none;background:none;padding:8px;border-radius:8px;color:#64748b;font-weight:600;}
.auth-tabs button.active{background:#fff;color:var(--primary);box-shadow:0 1px 4px rgba(0,0,0,.06);}
.tip{color:var(--muted);font-size:12px;text-align:center;margin-top:12px;}

.member-card{
  background:linear-gradient(135deg,#0f766e,#0ea5e9);color:#fff;border-radius:18px;padding:18px;margin-bottom:14px;
}
.member-card .mc-top{display:flex;justify-content:space-between;align-items:center;}
.member-card .level{background:rgba(255,255,255,.2);padding:3px 10px;border-radius:99px;font-size:11px;}
.member-card h3{margin:6px 0 2px;font-size:20px;}
.member-card .mc-stats{display:flex;gap:18px;margin-top:14px;}
.member-card .mc-stats div{font-size:11px;opacity:.85;}
.member-card .mc-stats b{display:block;font-size:17px;opacity:1;}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
.quick-item{background:#fff;border:1px solid #eef2f7;border-radius:12px;padding:12px 6px;text-align:center;font-size:11px;color:#334155;}
.quick-item span{display:block;font-size:20px;margin-bottom:4px;}
.order-status{font-size:12px;color:var(--accent);font-weight:600;}
.order-item{display:flex;gap:10px;padding:8px 0;border-bottom:1px dashed #eef2f7;}
.order-item:last-child{border-bottom:none;}
.order-item .oi-name{flex:1;font-size:13px;}
.order-item .oi-qty{color:var(--muted);font-size:12px;}

.cart-line{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px dashed #eef2f7;}
.cart-line .cl-main{flex:1;min-width:0;}
.cart-line .cl-name{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.qty-box{display:flex;align-items:center;gap:6px;}
.qty-btn{width:28px;height:28px;border-radius:8px;border:1px solid var(--line);background:#fff;font-weight:700;}
.qty-num{min-width:24px;text-align:center;font-weight:600;}
.cart-line .cl-sub{width:64px;text-align:right;font-weight:600;}

.pay-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.pay-option{border:1px solid var(--line);border-radius:10px;padding:11px;text-align:center;background:#fff;font-weight:600;font-size:13px;}
.pay-option.active{border-color:var(--primary);background:#ecfdf5;color:var(--primary);}
.addr-card{border:1px solid var(--line);border-radius:12px;padding:11px;background:#fff;margin-bottom:8px;}
.addr-card.active{border-color:var(--primary);background:#ecfdf5;}
.coupon-card{
  display:flex;border:1px solid #fde68a;background:#fffbeb;border-radius:12px;overflow:hidden;margin-bottom:8px;
}
.coupon-card .cc-left{width:96px;background:linear-gradient(135deg,#f59e0b,#f97316);color:#fff;padding:10px;text-align:center;}
.coupon-card .cc-amount{font-size:20px;font-weight:700;}
.coupon-card .cc-body{flex:1;padding:10px 12px;}
.coupon-card.disabled{opacity:.55;filter:grayscale(.4);}

.toast{position:fixed;left:50%;top:70px;transform:translateX(-50%);background:#0f172a;color:#fff;padding:10px 16px;border-radius:99px;font-size:13px;z-index:80;box-shadow:0 10px 30px rgba(0,0,0,.25);}
.loading{position:fixed;inset:0;background:rgba(255,255,255,.5);z-index:90;display:flex;align-items:center;justify-content:center;}
.spinner{width:34px;height:34px;border:3px solid #cbd5e1;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}

@media (min-width:560px){
  .goods-grid{grid-template-columns:repeat(3,1fr);}
}

/* 全面屏安全区 */
.shop-header{padding-top:calc(14px + var(--wk-safe-top, 0px));padding-right:calc(16px + var(--wk-capsule-right, 0px));}
#app{padding-bottom:calc(70px + var(--wk-safe-bottom, 0px));}

.sheet{padding-bottom:calc(12px + var(--wk-safe-bottom, 0px));}
