/* 净味家同城 H5 商城样式（移动端优先） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --red: #ff4d4f; --red-dark: #e64340; --green: #26d07c;
  --bg: #f5f5f5; --text: #333; --muted: #999; --line: #eee;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100%; padding-bottom: 58px; position: relative; }
a { color: inherit; text-decoration: none; }
img { display: block; }
button { font-family: inherit; border: none; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; display: flex; align-items: center;
  height: 44px; padding: 0 12px; gap: 8px; border-bottom: 1px solid var(--line); }
.topbar .back { font-size: 20px; line-height: 1; padding: 4px 6px 4px 0; }
.topbar .title { flex: 1; font-size: 16px; font-weight: 600; text-align: center; }
.topbar .right { width: 24px; }

/* 搜索框 */
.searchbar { display: flex; gap: 8px; padding: 8px 12px; background: #fff; }
.searchbar input { flex: 1; border: none; background: var(--bg); border-radius: 16px; padding: 8px 14px; }
.searchbar button { background: var(--red); color: #fff; border-radius: 16px; padding: 0 16px; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30; }
.tabbar a { flex: 1; text-align: center; padding: 7px 0 6px; color: var(--muted); font-size: 11px; position: relative; }
.tabbar a .ic { display: block; font-size: 19px; margin-bottom: 1px; font-style: normal; }
.tabbar a.active { color: var(--red); }
.tabbar .badge-n { position: absolute; top: 2px; right: calc(50% - 22px); background: var(--red); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; padding: 0 4px; }

/* 首页分类横滑 */
.catscroll { display: flex; gap: 14px; padding: 10px 12px; background: #fff; overflow-x: auto; white-space: nowrap; }
.catscroll a { font-size: 13px; color: var(--text); padding: 5px 12px; background: var(--bg); border-radius: 14px; flex-shrink: 0; }
.catscroll a.on { background: var(--red); color: #fff; }

/* 商品网格 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
.gcard { background: #fff; border-radius: 10px; overflow: hidden; position: relative; }
.gcard img.cover { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f0f0; }
.gcard .info { padding: 8px 10px 10px; }
.gcard .t { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.gcard .st { color: var(--muted); font-size: 11px; margin-top: 3px; }
.gcard .prow { display: flex; align-items: baseline; gap: 5px; margin-top: 5px; }
.gcard .p { color: var(--red); font-size: 17px; font-weight: 700; }
.gcard .p small { font-size: 11px; font-weight: 400; }
.gcard .p2 { color: var(--muted); font-size: 11px; text-decoration: line-through; }
.gcard .tagv { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 9px; }

/* 详情页 */
.swiper { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #fff; }
.swiper img { width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: center; flex-shrink: 0; }
.buybox { background: #fff; padding: 12px; margin-bottom: 8px; }
.pricebar { display: flex; align-items: baseline; gap: 8px; }
.pricebar .p { color: var(--red); font-size: 24px; font-weight: 700; }
.pricebar .p small { font-size: 13px; }
.pricebar .m { color: var(--muted); font-size: 13px; text-decoration: line-through; }
.gtitle { font-size: 17px; font-weight: 600; line-height: 1.4; margin-top: 6px; }
.gsub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 10px; }
.rowlink { background: #fff; padding: 13px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.rowlink .k { color: var(--muted); width: 42px; flex-shrink: 0; }
.rowlink .v { flex: 1; font-size: 13px; line-height: 1.5; }
.rowlink .arr { color: #ccc; }
.attrline .v b { color: var(--text); }
.detailbox { background: #fff; padding: 12px; margin-bottom: 8px; }
.detailbox h4 { font-size: 15px; margin-bottom: 10px; }
.detailbox .rt img { max-width: 100%; height: auto; }
.detailbox .rt p { margin: 6px 0; line-height: 1.7; }

/* 详情底部操作条 */
.buybar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30; padding: 8px 10px; gap: 8px; }
.buybar .icon { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 10px; width: 44px; }
.buybar .icon .ic { font-size: 18px; font-style: normal; }
.buybar .btn { flex: 1; height: 40px; border-radius: 20px; font-size: 15px; font-weight: 600; }
.buybar .b1 { background: #ff9800; color: #fff; }
.buybar .b2 { background: var(--red); color: #fff; }
body.hasbuybar #app { padding-bottom: 66px; }

/* 通用列表行 */
.cardlist { padding: 8px; }
.citem { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.citem .between { display: flex; justify-content: space-between; align-items: center; }
.citem .name { font-weight: 600; }

/* 购物车行 */
.crow { display: flex; align-items: center; background: #fff; padding: 10px; margin-bottom: 6px; border-radius: 10px; gap: 10px; }
.crow .chk { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #ccc; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.crow .chk.on { background: var(--red); border-color: var(--red); }
.crow img { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; background: #f0f0f0; flex-shrink: 0; }
.crow .mid { flex: 1; min-width: 0; }
.crow .t { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crow .sku { color: var(--muted); font-size: 11px; margin-top: 3px; background: var(--bg); display: inline-block; padding: 1px 6px; border-radius: 4px; }
.crow .prow { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.crow .p { color: var(--red); font-weight: 700; }
.stepper { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.stepper button { width: 26px; height: 24px; background: #fafafa; font-size: 15px; }
.stepper span { width: 32px; text-align: center; font-size: 13px; }
.delbtn { color: var(--muted); font-size: 12px; padding: 2px 6px; }

/* 结算/订单 */
.sumline { background: #fff; padding: 12px; margin-bottom: 8px; }
.sumline .k { color: var(--muted); }
.sumline .r { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.paybar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; z-index: 30; padding: 10px 14px; }
.paybar .amount { flex: 1; }
.paybar .amount .p { color: var(--red); font-size: 20px; font-weight: 700; }
.paybar .amount .p small { font-size: 12px; }
.paybar button.go { background: var(--red); color: #fff; height: 40px; padding: 0 30px; border-radius: 20px; font-size: 15px; font-weight: 600; }

/* 订单状态色 */
.os0 { color: #ff9800; } .os1 { color: #409eff; } .os2 { color: #409eff; }
.os3 { color: var(--green); } .os4 { color: var(--muted); } .os5 { color: var(--red); }

/* 核销码 */
.vcode-box { text-align: center; padding: 18px 12px; }
.vcode-box .code { font-size: 34px; letter-spacing: 6px; font-weight: 800; color: var(--red); font-family: monospace; }
.vcode-box .qr { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; }
.vcode-box .st { display: inline-block; padding: 2px 12px; border-radius: 10px; font-size: 12px; }
.vcode-box .st.ok { background: #e8f7ef; color: var(--green); }
.vcode-box .st.no { background: #fff1f0; color: var(--red); }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; display: none; }
.mask.show { display: block; }
.sheet { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-radius: 14px 14px 0 0; z-index: 41; padding: 16px; display: none; max-height: 75vh; overflow-y: auto; }
.sheet.show { display: block; }
.sheet .close { position: absolute; right: 14px; top: 12px; font-size: 20px; color: var(--muted); }
.specvals { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.specvals .sv { padding: 6px 16px; background: var(--bg); border-radius: 16px; font-size: 13px; border: 1.5px solid transparent; }
.specvals .sv.on { background: #fff1f0; border-color: var(--red); color: var(--red); }
.sheet .confirm { width: 100%; height: 42px; background: var(--red); color: #fff; border-radius: 21px; font-size: 15px; font-weight: 600; margin-top: 10px; }

/* 表单 */
.formcard { background: #fff; padding: 12px; margin-bottom: 8px; }
.formcard label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 5px; }
.formcard input, .formcard textarea { width: 100%; border: 1px solid #e5e5e5; border-radius: 8px; padding: 10px; }
.formcard input:focus, .formcard textarea:focus { border-color: var(--red); }
.imglist { display: flex; flex-wrap: wrap; gap: 8px; }
.imgitem { position: relative; width: 72px; height: 72px; }
.imgitem img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.imgitem i {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  background: #e04b4b; color: #fff; border-radius: 50%; font-style: normal;
  font-size: 14px; line-height: 20px; text-align: center;
}
.imgadd {
  width: 72px; height: 72px; border: 1px dashed #ccc; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #bbb; cursor: pointer; overflow: hidden;
}
.bigbtn { width: 100%; height: 44px; background: var(--red); color: #fff; border-radius: 22px; font-size: 16px; font-weight: 600; margin-top: 16px; }

/* 评价星级 */
.starpick { display: flex; gap: 6px; font-size: 30px; color: #ddd; }
.starpick span.on { color: #ffb400; }

/* 空态 */
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty .ic { font-size: 40px; display: block; margin-bottom: 10px; font-style: normal; }
.orange { color: #e6a23c; }
.rcard { margin: 10px 12px; padding: 14px 16px; cursor: pointer; }

/* 登录 */
.loginbox { max-width: 360px; margin: 40px auto 0; padding: 0 20px; }
.loginbox h2 { text-align: center; margin-bottom: 24px; color: var(--red); }
.loginbox input { width: 100%; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px; margin-bottom: 12px; }

/* 公告条 */
.noticebar { display: flex; align-items: center; gap: 6px; background: #fff; margin: 8px 12px 0;
  padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--red); }
.noticebar .ic { flex-shrink: 0; font-style: normal; }
.noticebar .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

/* 搜索：热搜条 + 历史下拉 */
.searchwrap { position: relative; }
.hotbox { display: none; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff;
  margin: 8px 12px 0; padding: 10px 12px; border-radius: 10px; }
.hotbox .hlabel { font-size: 13px; color: var(--red); font-weight: 600; }
.hotbox a { font-size: 13px; color: var(--text); background: var(--bg); border-radius: 12px; padding: 4px 10px; }
.spanel { display: none; position: absolute; left: 12px; right: 12px; top: 100%; margin-top: 4px;
  background: #fff; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 10px 12px; z-index: 50; }
.spanel .phead { display: flex; justify-content: space-between; font-size: 12px;
  color: var(--muted); margin-bottom: 8px; }
.spanel .phead a { color: var(--muted); }
.spanel .ptags { display: flex; flex-wrap: wrap; gap: 8px; }
.spanel .ptags a { font-size: 13px; color: var(--text); background: var(--bg); border-radius: 12px; padding: 4px 10px; }

/* 广告轮播 */
.banners { position: relative; background: #fff; border-radius: 10px; margin: 8px 12px 0; overflow: hidden; }
.banners .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.banners .track::-webkit-scrollbar { display: none; }
.banners .track a { flex-shrink: 0; width: 100%; scroll-snap-align: center; }
.banners .track img { width: 100%; aspect-ratio: 5/2; object-fit: cover; display: block; background: #f0f0f0; }
.banners .dots { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.banners .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.6); }
.banners .dots i.on { background: #fff; }

/* 搜索结果条与推荐 */
.resultbar { display: none; background: #fff; margin: 8px 12px 0; padding: 8px 12px;
  border-radius: 10px; font-size: 13px; color: var(--muted); }
.rectitle { font-size: 15px; font-weight: 600; margin: 12px 12px 0; }

/* 余额 */
.balcard { background: linear-gradient(135deg, #e93b3d, #ff7a45); color: #fff;
  margin: 12px; border-radius: 12px; padding: 18px 16px; }
.balnum { font-size: 32px; font-weight: 700; margin: 6px 0 12px; }
.btnre { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: 16px; padding: 6px 16px; font-size: 13px; }
.cardbox { background: #fff; margin: 0 12px; border-radius: 10px; overflow: hidden; }

/* 收货地址 */
.addrcard { background: #fff; margin: 8px 12px 0; border-radius: 10px; padding: 12px; }
.addrcard.pickable { cursor: pointer; border: 1.5px solid transparent; }
.addrcard.pickable:active { border-color: var(--red); }
.addrcard .arow { font-size: 15px; }
.addrcard .defbadge { display: inline-block; background: #fff1f0; color: var(--red);
  font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.addrcard .adetail { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.addrcard .aops { display: flex; gap: 16px; justify-content: flex-end; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid #f2f2f2; }
.addrcard .aops a { font-size: 12px; color: var(--muted); }

/* 优惠券中心 */
.ctabs { display: flex; background: #fff; margin-bottom: 8px; }
.ctabs a { flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; }
.ctabs a.on { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.ccard { display: flex; align-items: center; background: #fff; margin: 0 12px 8px; border-radius: 10px;
  padding: 12px; gap: 12px; }
.ccard .cleft { width: 92px; text-align: center; color: var(--red); flex-shrink: 0;
  border-right: 1px dashed #eee; padding-right: 10px; }
.ccard .cval { font-size: 26px; font-weight: 700; line-height: 1.1; }
.ccard .cval small { font-size: 13px; }
.ccard .cth { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ccard .cright { flex: 1; min-width: 0; }
.ccard .cname { font-size: 14px; font-weight: 600; }
.ccard .cdate { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ccard .cbtn { flex-shrink: 0; background: var(--red); color: #fff; border-radius: 15px;
  padding: 7px 14px; font-size: 13px; }
.ccard .cbtn.done { background: #eee; color: #999; }
.ccard.used { opacity: .55; }
.ccard.used .cleft { color: var(--muted); }
.ccard .cstate { flex-shrink: 0; font-size: 12px; color: var(--muted); }

/* toast */
#toast { position: fixed; top: 45%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.75);
  color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 99; display: none; max-width: 80%; text-align: center; }

/* 分类圆形图标网格（首页/分类页共用） */
.catgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px 4px; background: #fff; border-radius: 10px; margin: 8px 12px; padding: 16px 8px; }
.catitem { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.caticle { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #f7ecdc, #eedcbe); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #9a6f3c; }
.caticle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catname { font-size: 12px; color: #555; max-width: 68px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; }
.catitem.on .caticle { box-shadow: 0 0 0 3px var(--red); }
.catitem.on .catname { color: var(--red); font-weight: 700; }
/* 二级分类筛选行（点击一级分类后展开） */
.subrow { display: flex; flex-wrap: wrap; gap: 10px; background: #fff; border-radius: 10px; margin: 0 12px 8px; padding: 12px 14px; }
.subchip { font-size: 13px; color: #555; background: var(--bg); border-radius: 16px; padding: 6px 16px; }
.subchip.on { color: #fff; background: var(--red); font-weight: 600; }

/* 首页区块标题 */
.h5sect { display: flex; align-items: center; font-size: 16px; font-weight: 700; padding: 14px 14px 10px; }
.h5sect .bar { width: 4px; height: 16px; background: var(--red); border-radius: 2px; margin-right: 8px; }
.h5sect .more { margin-left: auto; font-size: 12px; color: #999; font-weight: 400; }

/* 我的页面 */
.mehd { background: linear-gradient(135deg, var(--red), #ff7a45); color: #fff; padding: 26px 16px 40px; }
.mehd .nick { font-size: 18px; font-weight: 700; }
.mehd .mob { font-size: 12px; opacity: .85; margin-top: 4px; }
.memenu { background: #fff; border-radius: 12px; margin: -22px 10px 10px; overflow: hidden; }
.memenu a { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--bg); }
.memenu a:last-child { border-bottom: none; }
.memenu .ic { color: var(--red); font-size: 17px; font-style: normal; }
.memenu .arr { margin-left: auto; color: #ccc; }

.mt8 { margin-top: 8px; } .mb8 { margin-bottom: 8px; } .p12 { padding: 12px; }
.red { color: var(--red); } .muted { color: var(--muted); } .small { font-size: 12px; }
.bold { font-weight: 700; } .tc { text-align: center; } .flex { display: flex; }
