/* 江湖铺子 · 手机微店 V3.0.0（参考银豹微店风格：红白主题 + 底部四 Tab） */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --red: #e94335;
  --red-d: #cf382b;
  --ink: #2c3440;
  --sub: #8a97ab;
  --line: #f0f1f4;
  --bg: #f7f8fa;
  --tabbar-h: 56px;
  --cartbar-h: 58px;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.5;
  overflow: hidden;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
svg { display: block; }

#app { height: 100%; }

/* ---------- 页面框架 ---------- */
.page {
  position: absolute; inset: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  background: var(--bg); overflow-y: auto; display: none;
  -webkit-overflow-scrolling: touch;
}
.page.on { display: block; }
.ptitle {
  position: sticky; top: 0; z-index: 5; background: #fff;
  font-size: 16px; font-weight: 700; text-align: center;
  padding: 14px 48px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.ptitle-act {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--sub); padding: 6px 8px;
}
.pback {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  font-size: 26px; color: var(--ink); padding: 2px 12px; line-height: 1;
}

/* ---------- 首页头部 ---------- */
.hd {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  background: #fff; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.hd-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.hd-name { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
/* 顶栏中间“编辑”按钮 */
.hd-edit {
  flex: 1; max-width: 150px; height: 32px; margin: 0 auto; padding: 0 20px;
  border-radius: 16px; border: 1px solid #d9d3c3; background: #f6f3ea;
  color: #6b5d3f; font-size: 14px; font-weight: 700;
}
.hd-edit.on { background: #e94335; border-color: #e94335; color: #fff; }
.hd-acts { display: flex; gap: 4px; margin-left: auto; }
.hd-ic { width: 38px; height: 38px; padding: 8px; color: #4a5568; }
.hd-ic svg { width: 100%; height: 100%; }

/* ---------- 首页：左侧分类 + 右侧商品 ---------- */
.home-body { display: flex; align-items: flex-start; min-height: calc(100% - 59px); }
.catside {
  flex: 0 0 92px; background: #f2f3f5;
  position: sticky; top: 59px; align-self: flex-start;
  max-height: calc(100vh - 59px - var(--tabbar-h) - var(--cartbar-h));
  overflow-y: auto;
}
.cs-item {
  width: 100%; padding: 12px 6px 10px; text-align: center;
  font-size: 12.5px; color: #5a6b85; line-height: 1.3;
  border-left: 3px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  word-break: break-all;
}
.cs-item svg { width: 26px; height: 26px; color: #f2a0b5; }
.cs-item.on {
  background: #fff; color: var(--ink); font-weight: 700;
  border-left-color: var(--red);
}
.cs-item .n { font-size: 10.5px; color: #b3bcc9; }

.plist { flex: 1; min-width: 0; background: #fff; padding-bottom: calc(var(--cartbar-h) + 12px); }
.plist-full { padding: 0 0 16px; }
.prow {
  display: flex; gap: 10px; padding: 12px 12px 12px 10px;
  border-bottom: 1px solid var(--line); position: relative;
}
.prow .thumb {
  flex: 0 0 92px; width: 92px; height: 92px; border-radius: 8px;
  background: #f2f3f5 center/cover no-repeat; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #c3cad6; font-size: 30px; font-weight: 800;
}
.prow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prow .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prow .name {
  font-size: 14.5px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prow .spec { font-size: 12px; color: var(--sub); margin-top: 3px; }
.prow .sale { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.prow .price { color: var(--ink); font-size: 16px; font-weight: 800; }
.prow .price small { font-size: 12px; font-weight: 700; }
.prow .unit { color: #6b7686; font-size: 13px; }
.prow .add {
  position: absolute; right: 12px; bottom: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red); color: #fff; padding: 6px;
  box-shadow: 0 2px 6px rgba(233, 67, 53, .4);
}
.prow .add svg { width: 100%; height: 100%; }
.prow .add:active { transform: scale(.92); }
.prow .add.off { background: #d5dae2; box-shadow: none; }
.prow .soldout {
  position: absolute; right: 52px; bottom: 16px;
  font-size: 11px; color: #b3bcc9; background: #f2f3f5;
  border-radius: 999px; padding: 2px 8px;
}
.prow .qtytag {
  position: absolute; right: 48px; bottom: 12px;
  min-width: 22px; height: 22px; border-radius: 11px;
  background: #fff; border: 1px solid var(--red); color: var(--red);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; padding: 0 5px;
}

.home-status { padding: 30px 20px; text-align: center; color: var(--sub); font-size: 13px; }
.home-status .retry { color: var(--red); border: 1px solid var(--red); border-radius: 999px; padding: 6px 18px; display: inline-block; margin-top: 10px; }

/* ---------- 底部购物车栏 ---------- */
.cartbar {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
  height: var(--cartbar-h); border-radius: 999px;
  background: #fff; box-shadow: 0 4px 18px rgba(30, 45, 80, .18);
  display: none; align-items: center; padding: 0 6px 0 12px; z-index: 20;
}
.cartbar.on { display: flex; }
.cb-ic { position: relative; width: 42px; height: 42px; padding: 9px; color: #6b7686; }
.cb-ic svg { width: 100%; height: 100%; }
.cb-badge {
  position: absolute; top: -2px; right: -4px;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  font-style: normal; line-height: 18px; text-align: center; padding: 0 4px;
}
.cb-mid { flex: 1; padding: 0 10px; color: #b3bcc9; font-size: 14px; }
.cb-mid.full { color: var(--ink); font-weight: 800; font-size: 17px; }
.cb-mid.full small { font-size: 12px; }
.cb-checkout {
  height: 46px; border-radius: 999px; padding: 0 30px;
  background: #d5dae2; color: #fff; font-size: 15px; font-weight: 700;
}
.cb-checkout.go { background: var(--red); box-shadow: 0 3px 8px rgba(233, 67, 53, .35); }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
  display: flex;
}
.tb {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #8a97ab; font-size: 11px; position: relative;
}
.tb svg { width: 24px; height: 24px; }
.tb.on { color: var(--red); }
.tb-badge {
  position: absolute; top: 4px; left: calc(50% + 4px);
  min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  font-style: normal; line-height: 17px; text-align: center; padding: 0 4px;
}

/* ---------- 全部（分类总览） ---------- */
.catall { background: #fff; }
.ca-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left;
}
.ca-item svg { width: 26px; height: 26px; color: #f2a0b5; flex: 0 0 auto; }
.ca-item .t { flex: 1; font-size: 15px; font-weight: 600; }
.ca-item .n { color: var(--sub); font-size: 12.5px; }
.ca-item .arr { color: #c3cad6; font-size: 18px; }

/* ---------- 购物车页 ---------- */
.cartlist { background: #fff; }
.crow { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.crow .thumb {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 8px;
  background: #f2f3f5; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #c3cad6; font-size: 22px; font-weight: 800;
}
.crow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.crow .body { flex: 1; min-width: 0; }
.crow .name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .price { color: var(--red); font-weight: 800; margin-top: 4px; }
.crow .price small { font-size: 11px; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid #d5dae2; color: #6b7686; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.stepper button.plus { background: var(--red); border-color: var(--red); color: #fff; }
.stepper .q { min-width: 30px; text-align: center; font-weight: 700; }
.cart-empty { text-align: center; padding: 80px 20px; color: var(--sub); }
.ce-ic { width: 60px; height: 60px; margin: 0 auto 14px; color: #d5dae2; }
.ce-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.ce-s { margin-top: 6px; font-size: 13px; }
.ce-btn {
  margin-top: 18px; border: 1px solid var(--red); color: var(--red);
  border-radius: 999px; padding: 8px 34px; font-size: 14px; font-weight: 600;
}

/* ---------- 会员中心 ---------- */
.mcard {
  margin: 12px; border-radius: 12px; overflow: hidden; position: relative;
  aspect-ratio: 16/8.2; box-shadow: 0 4px 14px rgba(208, 48, 80, .25);
}
.mcard-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcard-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(190, 30, 45, .25), rgba(140, 15, 30, .55)); }
.mcard-inner { position: absolute; inset: 0; display: flex; align-items: center; padding: 16px; }
.mcard-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.85);
}
.mcard-text { margin-left: 12px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mcard-shop { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.mcard-user { font-size: 12.5px; margin-top: 4px; opacity: .95; }
.mcard-exp { position: absolute; right: 12px; bottom: 10px; color: rgba(255,255,255,.92); font-size: 11.5px; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

.mactivate { margin: 4px 12px 12px; background: #fff; border-radius: 12px; padding: 18px 16px; text-align: center; }
.ma-t { font-size: 14px; color: var(--ink); }
.ma-btn {
  margin-top: 12px; width: 100%; height: 44px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(233, 67, 53, .35);
}

.mstats { display: flex; background: #fff; margin: 4px 12px 12px; border-radius: 12px; padding: 14px 0; }
.mst { flex: 1; text-align: center; color: var(--ink); }
.mst svg { width: 24px; height: 24px; margin: 0 auto 4px; color: #4a5568; }
.mst-k { font-size: 12px; color: var(--sub); }
.mst-v { font-size: 17px; font-weight: 800; color: var(--red); }

.morders { display: flex; background: #fff; margin: 0 12px 12px; border-radius: 12px; padding: 14px 0; }
.mo { flex: 1; text-align: center; color: var(--ink); font-size: 12.5px; position: relative; }
.mo svg { width: 26px; height: 26px; margin: 0 auto 5px; color: #4a5568; }
.mo-badge {
  position: absolute; top: -4px; left: calc(50% + 2px);
  min-width: 16px; height: 16px; border-radius: 8px; background: var(--red);
  color: #fff; font-size: 10px; font-style: normal; font-weight: 700;
  line-height: 16px; text-align: center; padding: 0 4px;
}

.mlevel {
  display: flex; align-items: center; gap: 10px;
  background: #fff; margin: 0 12px 12px; border-radius: 12px; padding: 14px 16px;
  font-size: 14.5px;
}
.ml-ic { width: 24px; height: 24px; color: #f5b53f; }
.mlevel b { color: #b8860b; }

.mfuncs-title { margin: 4px 16px 8px; font-size: 14px; font-weight: 700; }
.mgrid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: #fff; margin: 0 12px 12px; border-radius: 12px; padding: 14px 6px;
}
.mf { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 2px; font-size: 12px; color: var(--ink); }
.mf-ic { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mf-ic svg { width: 23px; height: 23px; }

.mfoot { text-align: center; color: var(--sub); font-size: 12px; padding: 18px 0 26px; line-height: 1.9; }

/* ---------- 我的订单 ---------- */
.otabs { display: flex; justify-content: center; gap: 46px; background: #fff; padding: 4px 0 0; }
.ot { font-size: 15.5px; font-weight: 600; color: var(--sub); padding: 10px 4px; border-bottom: 2.5px solid transparent; }
.ot.on { color: var(--ink); border-bottom-color: var(--red); }
.osub { display: flex; background: #fff; border-bottom: 1px solid var(--line); padding: 0 6px; }
.os { flex: 1; text-align: center; font-size: 13.5px; color: var(--sub); padding: 11px 0; border-bottom: 2px solid transparent; }
.os.on { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

.olist { padding: 10px 12px 20px; }
.ocard { background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.ocard .oh { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sub); }
.ocard .oh .no { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .st { font-weight: 700; font-size: 13px; }
.ocard .st.pend { color: #e8a020; } .ocard .st.done { color: #2ea44f; }
.ocard .st.cancel { color: #b3bcc9; } .ocard .st.doing { color: #3584e4; }
.ocard .oi { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 7px 0 0; }
.ocard .oi .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .oi .qa { color: #6b7686; white-space: nowrap; }
.ocard .of {
  display: flex; align-items: center; margin-top: 8px; padding-top: 10px;
  border-top: 1px dashed var(--line); font-size: 13px; color: var(--sub);
}
.ocard .of .tt { flex: 1; }
.ocard .of .tt b { color: var(--red); font-size: 16px; }
.ocard .cancel-btn { border: 1px solid #d5dae2; border-radius: 999px; padding: 5px 16px; font-size: 12.5px; color: #6b7686; }

.oempty { text-align: center; padding: 70px 20px; }
.oempty .oe-ic {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 16px;
  background: #eef0f3; display: flex; align-items: center; justify-content: center;
}
.oempty .oe-ic svg { width: 36px; height: 36px; color: #c3cad6; }
.oe-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.oe-s { color: var(--sub); font-size: 13px; margin-top: 6px; }
.oe-btns { display: flex; justify-content: center; gap: 14px; margin-top: 20px; }
.oe-btn { border: 1px solid #c3cad6; color: #6b7686; border-radius: 6px; padding: 8px 22px; font-size: 13.5px; }
.oe-btn.red { border-color: var(--red); color: var(--red); }

/* ---------- 搜索页 ---------- */
.sbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px;
  background: #fff; padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.sbar .pback { position: static; transform: none; }
.sbar input {
  flex: 1; height: 38px; border: none; background: #f2f3f5; border-radius: 999px;
  padding: 0 16px; font-size: 14px; outline: none;
}

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 25, 35, .55);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.modal {
  width: 100%; max-width: 330px; background: #fff; border-radius: 14px;
  padding: 26px 22px 20px; text-align: center;
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mv-gift { width: 64px; margin: -52px auto 8px; }
.mv-gift svg { width: 100%; height: auto; filter: drop-shadow(0 3px 6px rgba(255, 111, 67, .4)); }
.mv-title { font-size: 17px; font-weight: 800; }
.mv-sub { color: #6b7686; font-size: 13.5px; margin: 8px 0 18px; }
.mv-warn { text-align: left; color: #e8a020; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.mv-row {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border-bottom: 1px solid var(--line); padding: 10px 2px; margin-bottom: 6px;
}
.mv-row label { font-size: 15px; font-weight: 600; flex: 0 0 auto; }
.mv-row input { flex: 1; border: none; outline: none; font-size: 15px; background: none; }
.mv-tip { text-align: left; font-size: 12px; color: var(--sub); margin: 4px 0 12px; }
.mv-btn {
  width: 100%; height: 46px; border-radius: 999px; margin-top: 10px;
  background: #d5dae2; color: #fff; font-size: 16px; font-weight: 700;
}
.mv-btn.go { background: var(--red); box-shadow: 0 3px 10px rgba(233, 67, 53, .35); }
.mv-agree {
  display: flex; align-items: flex-start; gap: 6px; text-align: left;
  font-size: 12px; color: #6b7686; margin-top: 16px; line-height: 1.6;
}
.mv-agree input { margin-top: 3px; accent-color: var(--red); }
.mv-agree a { color: var(--red); }
.mv-link { text-align: left; font-size: 12.5px; color: var(--red); margin-top: 8px; padding-left: 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%);
  background: rgba(30, 35, 45, .92); color: #fff; border-radius: 10px;
  padding: 10px 20px; font-size: 13.5px; z-index: 99;
  opacity: 0; transition: opacity .25s; pointer-events: none;
  max-width: 82%; text-align: center;
}
.toast.show { opacity: 1; }

/* ---------- 商家地址（地图页） ---------- */
.mapwrap {
  margin: 12px 12px 0; border-radius: 14px; overflow: hidden;
  background: #eef2e9; box-shadow: 0 2px 10px rgba(60, 40, 20, .08);
}
.mapwrap svg { display: block; width: 100%; height: auto; }
.map-cap {
  padding: 8px 12px; font-size: 11px; color: #8a8578;
  background: #f7f6f1; border-top: 1px solid #eee7da;
}
.pin-pulse { animation: pinPulse 1.8s ease-out infinite; }
@keyframes pinPulse {
  0%   { r: 6;  opacity: .55; }
  100% { r: 26; opacity: 0; }
}
.addr-card {
  margin: 12px; background: #fff; border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 2px 10px rgba(60, 40, 20, .08);
}
.ac-name { font-size: 16px; font-weight: 700; color: #333; margin-bottom: 6px; }
.ac-addr { font-size: 13px; color: #555; line-height: 1.7; }
.ac-sub  { font-size: 12px; color: #b4543f; }
.ac-btns { display: flex; gap: 8px; margin-top: 12px; }
.ac-btn {
  flex: 1; display: block; text-align: center; padding: 10px 0;
  border-radius: 10px; font-size: 13px; border: none;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ac-btn:active { opacity: .85; }
.ac-btn.ghost { background: #f3f1ec; color: #555; }
.ac-btn.amap  { background: #1677ff; color: #fff; }
.ac-btn.tmap  { background: #0abf6a; color: #fff; }

/* ---------- 编辑弹窗右上角“删除” ---------- */
.ed-modal { position: relative; }
.ed-del {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  padding: 5px 14px; border-radius: 999px;
  background: #fdecea; color: #e94335; font-size: 13px; font-weight: 700;
  border: 1px solid #f6c6c0;
}
.ed-del:active { opacity: .8; }

/* ---------- 编辑模式 ---------- */
.ebtns { display: flex; gap: 6px; }
.pedit, .pdel {
  border: none; border-radius: 8px; padding: 7px 10px; font-size: 12px;
  color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pedit { background: #1677ff; }
.pdel  { background: #e94335; }
.pedit:active, .pdel:active { opacity: .85; }
.ed-bc { font-size: 11px; color: #999; margin: 2px 0 10px; padding-left: 22px; text-align: left; }
