/* ============ 微信风格 UI 基础样式 ============ */
:root {
  --wx-green: #07c160;
  --wx-green-dark: #06ad56;
  --wx-green-light: #e8f8ef;
  --wx-red: #fa5151;
  --pdd-red: #e02e24;
  --wx-orange: #fa9d3b;
  --wx-blue: #576b95;
  --bg: #ededed;
  --card: #ffffff;
  --text: #191919;
  --text-2: #888888;
  --text-3: #b2b2b2;
  --line: #e9e9e9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .04);
  --nav-h: 48px;
  --tab-h: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--wx-blue); text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, select, button { font-family: inherit; font-size: 15px; color: var(--text); }
button { cursor: pointer; border: none; background: none; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  /* 兜底：至少 8px 顶部间距，避免刘海/状态栏遮挡（兼容不支持 env 的安卓 WebView） */
  min-height: calc(var(--nav-h) + 8px);
  min-height: calc(var(--nav-h) + max(env(safe-area-inset-top), 8px));
  background: #ededed;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding: 8px 12px 0;
  padding: max(env(safe-area-inset-top), 8px) 12px 0;
}
.nav-title { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.nav-left, .nav-right {
  position: absolute; top: 8px; height: var(--nav-h);
  top: max(env(safe-area-inset-top), 8px); height: var(--nav-h);
  display: flex; align-items: center; gap: 14px; font-size: 14px; color: #333;
}
.nav-left { left: 12px; } .nav-right { right: 12px; }
.nav-back {
  display: inline-flex; align-items: center;
  font-size: 15px; color: #576b95;
  padding: 9px 12px 9px 4px; margin-left: -4px;
  white-space: nowrap;
}
.nav-arrow {
  font-size: 22px; font-weight: 600; line-height: 1;
  margin-right: 2px; transform: translateY(-1px);
}

/* ---------------- 容器 ---------------- */
.page { max-width: 1180px; margin: 0 auto; padding: 12px 12px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }
.page-narrow { max-width: 720px; }
.section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.section-title { padding: 12px 14px 6px; font-size: 13px; color: var(--text-2); }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px; }
.section-head .section-title { padding: 0; }
/* 识别框「清空」按钮：非绿色，低调，便于客人操作 */
.link-btn { border: none; background: none; font-size: 13px; color: var(--text-3); padding: 2px 6px; cursor: pointer; }
.link-btn:active { color: var(--wx-red); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }

/* 收藏心形按钮 */
.fav-btn { background: none; border: none; padding: 4px; cursor: pointer; line-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.fav-btn svg { pointer-events: none; }
.fav-icon { width: 22px; height: 22px; color: #bbb; transition: transform .12s, color .12s; }
.fav-icon.fav-on { color: #fa5151; }
.fav-btn:active .fav-icon { transform: scale(.88); }
.fav-sm .fav-icon { width: 18px; height: 18px; }
.citem .fav-btn { align-self: center; margin-right: 2px; }

/* 收藏页 */
.fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px 14px calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); }
.fav-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.fav-card .thumb { width: 100%; aspect-ratio: 1 / 1; background: #f5f5f5; position: relative; }
.fav-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.fav-card .thumb .fav-btn { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.85); border-radius: 50%; padding: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.fav-card .body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.fav-card .t { font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fav-card .price { color: var(--wx-red); font-weight: 700; font-size: 16px; margin-top: auto; }
.fav-card .price small { font-size: 11px; font-weight: 400; color: var(--text-3); }
.fav-card .acts { display: flex; gap: 6px; margin-top: 8px; }
.fav-card .acts .btn { flex: 1; font-size: 12px; padding: 7px 0; border-radius: 8px; text-align: center; }
.fav-card .acts .btn-ghost { color: #555; border: 1px solid #e3e3e3; background: #fff; }
.fav-empty { padding: 50px 20px; text-align: center; color: var(--text-2); }
@media (min-width: 760px) { .fav-grid { grid-template-columns: repeat(4, 1fr); } }
.spacer { flex: 1; }

/* ---------------- 搜索 & 分类 ---------------- */
.searchbar { background: #ededed; padding: 8px 12px; position: sticky; top: calc(var(--nav-h) + 8px); top: calc(var(--nav-h) + max(env(safe-area-inset-top), 8px)); z-index: 50; }
.searchbar form { display: flex; gap: 8px; }
.search-input {
  flex: 1; height: 36px; border-radius: 8px; border: none; background: #fff;
  padding: 0 12px 0 32px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}

/* 查订单页：底部订单号查询栏 */
.order-query-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line);
}
.order-query-row { display: flex; gap: 8px; }
.order-query-input {
  flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 14px; outline: none; background: #fafafa;
}
.order-query-input:focus { border-color: var(--wx-green); background: #fff; }
.order-query-btn {
  width: 64px; border: none; border-radius: 8px; background: var(--wx-green);
  color: #fff; font-size: 14px; cursor: pointer;
}
.back-link {
  display: inline-block; margin: 4px 2px 12px; font-size: 13px; color: var(--wx-green);
}
.btn-search { height: 36px; padding: 0 16px; border-radius: 8px; background: var(--wx-green); color: #fff; font-size: 14px; }

/* 我的订单卡片 */
.order-card {
  background: #fff; border-radius: 12px; margin: 0 14px 12px; padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.order-card.invalid { opacity: .85; }
.oc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.oc-no { font-size: 13px; color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.oc-actions { display: flex; align-items: center; gap: 10px; }
.oc-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #f0f0f0; color: #666; }
.oc-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.oc-status.s-pending { background: #fff3cd; color: #b35900; }
.oc-status.s-contacted { background: #e6f7ff; color: #0066cc; }
.oc-status.s-paid { background: #e6fff0; color: #00994d; }
.oc-status.s-shipped { background: #f0e6ff; color: #722ed1; }
.oc-status.s-completed { background: #e6f7ff; color: #0066cc; }
.oc-status.s-cancelled { background: #f5f5f5; color: #999; }
.oc-del { font-size: 12px; color: #999; text-decoration: none; }
.oc-del:active { color: var(--wx-red); }
.oc-body { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.oc-thumbs { display: flex; align-items: center; gap: 6px; flex: 1; }
.oc-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #f5f5f5; }
.oc-more {
  width: 56px; height: 56px; border-radius: 6px; background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #999;
}
.oc-meta { text-align: right; }
.oc-count { font-size: 13px; color: var(--text-2); }
.oc-amount { font-size: 18px; font-weight: 700; color: var(--wx-red); margin-top: 4px; }
.oc-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.oc-date { font-size: 12px; color: #999; }
.oc-foot .arrow { font-size: 13px; color: #999; }

.cat-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 16px; background: #fff;
  font-size: 13px; color: #444; border: 1px solid transparent; white-space: nowrap;
}
.chip.active { background: var(--wx-green); color: #fff; }
.chip .n { opacity: .7; font-size: 11px; margin-left: 3px; }

/* ---------------- 产品卡片 ---------------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.pcard { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pcard:active { opacity: .85; }
.pcard .thumb { position: relative; aspect-ratio: 1 / 1; background: #f5f5f5; overflow: hidden; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard .title { font-size: 14px; line-height: 1.4; max-height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .price { color: var(--wx-red); font-weight: 700; font-size: 17px; }
.pcard .price small { font-size: 11px; font-weight: 400; }
.pcard .meta { font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pcard .meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-badge { flex: 0 0 auto; display: inline-block; font-size: 11px; line-height: 1; padding: 3px 7px; background: #f2f2f2; color: #666; border-radius: 9px; }

/* 价格美化：¥ 与 .00 小号 */
.p-sym { font-size: .62em; font-weight: 400; margin-right: 1px; }
.p-dec { font-size: .62em; font-weight: 400; }

.badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, .45); }
.badge.stock-out { background: rgba(0, 0, 0, .55); }
.badge.hot { background: var(--wx-red); }
.badge.off { background: #888; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; background: var(--wx-green-light); color: var(--wx-green-dark); }
.tag.gray { background: #f2f2f2; color: #888; }
.tag.orange { background: #fff3e6; color: #d97b17; }
.tag.red { background: #ffecec; color: var(--wx-red); }
.tag.blue { background: #eaf1ff; color: #3b6ecc; }

/* ---------------- 列表行 ---------------- */
.cell { display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: #fff; position: relative; }
.cell + .cell::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--line); }
.cell .label { color: var(--text); min-width: 72px; }
.cell .value { flex: 1; text-align: right; color: var(--text-2); }
.cell .arrow::after { content: '›'; color: var(--text-3); font-size: 18px; margin-left: 6px; }

/* ---------------- 我的页面 ---------------- */
.me-header {
  margin: 12px 14px 0;
  padding: 24px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--wx-green) 0%, #10ae7a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 6px 18px rgba(7,193,96,.22);
}
.me-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.me-avatar svg { width: 32px; height: 32px; stroke: #fff; fill: none; }
.me-info { flex: 1; min-width: 0; }
.me-shop { font-size: 20px; font-weight: 700; line-height: 1.3; }
.me-slogan { font-size: 12px; opacity: .9; margin-top: 4px; }

.me-stats {
  margin: 16px 14px 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  padding: 26px 0;
}
.me-stat {
  flex: 1; text-align: center; text-decoration: none; color: inherit;
  position: relative;
}
.me-stat + .me-stat::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 34px; background: var(--line);
}
.me-stat b { display: block; font-size: 26px; color: var(--wx-green); line-height: 1.1; }
.me-stat span { display: block; font-size: 13px; color: var(--text-2); margin-top: 8px; }

.me-menu-section { margin-top: 14px; }
.me-menu-item { align-items: center; }
.me-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 4px; flex: 0 0 auto;
}
.me-icon svg { width: 18px; height: 18px; }
.me-icon-order { background: #e8f7ee; color: var(--wx-green); }
.me-icon-cart { background: #fff3e8; color: #fa9d3b; }
.me-icon-fav { background: #ffecec; color: var(--wx-red); }
.me-icon-home { background: #f2f3f5; color: var(--text-2); }

/* ---------------- 表单 ---------------- */
.field { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: #fff; position: relative; }
.field + .field::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--line); }
.field > label { width: 84px; flex: 0 0 84px; padding-top: 6px; font-size: 15px; }
.field .ctrl { flex: 1; }
.field input, .field textarea, .field select {
  width: 100%; border: none; outline: none; background: transparent;
  padding: 6px 0; resize: vertical;
}
.field textarea { min-height: 64px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.req::after { content: '*'; color: var(--wx-red); margin-left: 2px; }

/* 省 / 市 / 区 三级联动 */
.pca { display: flex; gap: 8px; margin-bottom: 8px; }
.pca select { flex: 1 1 0; min-width: 0; background: #f7f7f7; border-radius: 8px; padding: 9px 6px; font-size: 14px; color: var(--text); text-align: center; }
.pca select:focus { outline: none; box-shadow: 0 0 0 1px var(--wx-green); }
/* 一键识别框 */
#recog { min-height: 70px; background: #f7f7f7; border-radius: 8px; padding: 9px 10px; }
.recog-wrap { padding: 0 14px 14px; display: flex; flex-direction: column; }
.recog-wrap #recog { width: 100%; display: block; }

/* 收货地址：触发条 */
.pca-box { display: flex; flex-direction: column; gap: 8px; }
.pca-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f7f7f7; border-radius: 8px; padding: 11px 12px; cursor: pointer;
}
.pca-trigger .pca-ph { color: var(--text-3); }

/* 省/市/区 级联面板（顺丰式） */
.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  background: #fff; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom);
  animation: sheetUp .22s ease;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sheet-title { font-size: 15px; font-weight: 600; }
.sheet-btn { background: none; border: none; font-size: 15px; color: #888; padding: 4px 6px; }
.sheet-btn.primary { color: var(--wx-green); font-weight: 600; }
.sheet-cols { display: flex; height: 240px; }
.sheet-col { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0; }
.sheet-item { padding: 11px 8px; text-align: center; font-size: 14px; color: var(--text); }
.sheet-item.on { color: var(--wx-green); font-weight: 700; background: #f0fbf4; }
.sheet-empty { padding: 20px 8px; text-align: center; font-size: 13px; color: var(--text-3); }

/* 提交提示：下滑引导（清爽居中，绿色小箭头） */
.submit-note {
  margin: 0;
  padding: 14px 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
  background: #fafafa;
  border-top: 1px dashed var(--line);
}
.submit-note .sn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--wx-green);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.input-box { background: #f7f7f7; border-radius: 8px; padding: 8px 10px; }
.input-box input, .input-box select, .input-box textarea { background: transparent; border: none; outline: none; width: 100%; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 8px; font-size: 15px;
  background: #f2f2f2; color: #333; transition: opacity .15s;
}
.btn:active { opacity: .8; }
.btn-primary { background: var(--wx-green); color: #fff; }
.btn-danger { background: #fff0f0; color: var(--wx-red); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: #444; }
.btn-block { width: 100%; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- 底部操作条 ---------------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: #fff; border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
}
.actionbar .total { flex: 1; font-size: 13px; color: var(--text-2); }
.actionbar .total b { color: var(--wx-red); font-size: 19px; }

/* 商品详情底部操作条的收藏按钮（白色，与首页/进货单按钮统一） */
.fav-action { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px; border-radius: 8px; background: #fff; color: #333; border: 1px solid var(--line); font-size: 14px; cursor: pointer; flex: 0 0 auto; }
.fav-action .fav-icon { width: 18px; height: 18px; }
.fav-action.on { background: #fff0f0; color: var(--wx-red); border-color: #ffd4d4; }
.fav-action:active { opacity: .8; }

/* ---------------- 底部 Tab ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
  min-height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  background: #f7f7f7; border-top: 1px solid #dcdcdc; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { display: flex; flex: 1; min-height: var(--tab-h); }
.tabbar-inner a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: #7a7a7a; position: relative; }
.tabbar-inner a.active { color: var(--wx-green); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar .dot { position: absolute; top: 6px; left: 50%; margin-left: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--wx-red); color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; }
.tabbar-icp { text-align: center; padding: 2px 0 4px; font-size: 10px; color: #999; line-height: 1.2; }
.tabbar-icp a { color: #999; text-decoration: none; }

/* ---------------- 轮播 ---------------- */
.swiper { position: relative; background: #fff; }
.swiper-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.swiper-track::-webkit-scrollbar { display: none; }
.swiper-track > div { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1 / 1; background: #f5f5f5; }
/* 主图统一裁进正方形框内：不同比例图片整体缩放显示（contain），不再被裁切 */
.swiper-track img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.swiper-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.swiper-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.swiper-dots i.on { background: #fff; width: 14px; border-radius: 3px; }
@media (min-width: 760px) { .swiper-track > div { aspect-ratio: 4 / 3; } }

/* ---------------- 数量选择 ---------------- */
.stepper { display: inline-flex; align-items: center; border-radius: 6px; overflow: hidden; background: #f4f4f4; }
.stepper button { width: 30px; height: 30px; font-size: 17px; color: #555; }
.stepper input { width: 54px; height: 30px; text-align: center; border: none; background: #fff; outline: none; font-size: 14px; }

/* ---------------- 购物车行 ---------------- */
.citem { display: flex; gap: 10px; padding: 12px 14px; background: #fff; position: relative; }
.citem + .citem::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--line); }
.citem img { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; background: #f5f5f5; flex: 0 0 74px; }
.citem .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.citem .t { font-size: 14px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------------- 分类页（微信绿主色） ---------------- */
.cate-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; background: #fff; }
.cate-layout { flex: 1; display: flex; overflow: hidden; background: #fff; }
.cate-side { width: 92px; flex: 0 0 92px; background: #f5f5f5; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cate-side .citem-cat { position: relative; padding: 16px 6px; text-align: center; font-size: 13px; color: #555; line-height: 1.3; transition: color .15s, background .15s; }
.cate-side .citem-cat:active { background: #ececec; }
.cate-side .citem-cat.active { background: #fff; color: var(--wx-green); font-weight: 600; }
.cate-side .citem-cat.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: var(--wx-green); border-radius: 0 2px 2px 0; }
.cate-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 10px calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); }
/* 分类页商品列表：左图右文（微信绿主色，标题与价格搭配） */
.plist { display: flex; flex-direction: column; gap: 10px; }
.pitem { display: flex; gap: 12px; padding: 10px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.pitem:active { opacity: .85; }
.pitem .thumb { width: 84px; height: 84px; flex: 0 0 84px; border-radius: 10px; overflow: hidden; background: #f5f5f5; }
.pitem .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pitem .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pitem .title { font-size: 15px; line-height: 1.45; font-weight: 600; color: #1f1f1f; max-height: 2.9em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pitem .price { color: var(--wx-red); font-weight: 700; font-size: 20px; line-height: 1.2; margin-top: auto; padding-top: 8px; }
.pitem .price small { font-size: 12px; font-weight: 400; color: var(--text-3); }

/* ---------------- 状态与空态 ---------------- */
.empty { padding: 60px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 64px; height: 64px; opacity: .35; margin: 0 auto 12px; }
.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 16px 0 8px; flex-wrap: wrap; }
.pager button, .pager span { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; background: #fff; color: #444; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.pager button.active { background: var(--wx-green); color: #fff; }
.pager button[disabled] { opacity: .45; }

/* ---------------- Toast / 对话框 ---------------- */
.toast {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .78); color: #fff; padding: 12px 18px; border-radius: 8px;
  font-size: 14px; z-index: 999; max-width: 76%; text-align: center; animation: fade .2s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; }
.dialog { width: 100%; max-width: 320px; background: #fff; border-radius: 12px; overflow: hidden; }
.dialog .dt { padding: 22px 20px 8px; text-align: center; font-size: 17px; font-weight: 600; }
.dialog .dc { padding: 0 20px 20px; text-align: center; color: var(--text-2); font-size: 14px; }
.dialog .dc input, .dialog .dc textarea, .dialog .dc select { width: 100%; background: #f7f7f7; border: none; border-radius: 8px; padding: 9px 10px; outline: none; text-align: left; }
.dialog .db { display: flex; border-top: 1px solid var(--line); }
.dialog .db button { flex: 1; height: 48px; font-size: 16px; color: #555; }
.dialog .db button + button { border-left: 1px solid var(--line); color: var(--wx-green); }

/* 联系客服弹窗：图片自带全部文字，弹窗透明、无边框，让图片完全占满 */
.contact-mask { align-items: center; padding: 18px; }
.contact-dialog { width: min(88vw, 400px); background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
.contact-dialog .dt, .contact-dialog .db, .contact-tip, .contact-wx { display: none; }
.contact-dialog .dc { padding: 0; background: transparent; }
.contact-qr { width: 100%; height: auto; max-height: 76vh; object-fit: contain; display: block; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.contact-close { position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%); min-width: 92px; height: 36px; line-height: 36px; padding: 0 18px; border: none; border-radius: 18px; background: rgba(0,0,0,.55); color: #fff; font-size: 15px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* 我的页面 - 联系客服列表项 */
.me-list { margin: 14px; background: #fff; border-radius: 12px; overflow: hidden; }
.me-item { display: flex; align-items: center; padding: 14px; text-decoration: none; color: var(--text-1); border-bottom: 1px solid var(--line); }
.me-item:last-child { border-bottom: none; }
.me-item:active { background: #f7f7f7; }
.me-item-ico { font-size: 18px; margin-right: 12px; }
.me-item-text { flex: 1; font-size: 15px; }
.me-item-arrow { color: #bbb; font-size: 18px; }

/* 查订单页 - 顶部栏：返回 + 客服左右分居一行，与下方卡片边距对齐 */
.order-topbar { display: flex; align-items: center; justify-content: space-between; margin: 12px 14px; }
.ord-back { display: inline-flex; align-items: center; padding: 4px 0; color: var(--wx-blue); font-size: 15px; font-weight: 500; text-decoration: none; line-height: 32px; }
.ord-back .chevron { margin-right: 4px; }
/* 查订单页 - 联系客服条（白框） */
.order-contact { display: flex; align-items: center; justify-content: space-between; margin: 12px 14px; padding: 14px 16px; background: #fff; border-radius: 10px; }
.order-contact.only-contact { justify-content: flex-end; margin: 0; padding: 12px 16px; }
.order-contact a { text-decoration: none; }
.order-contact .contact-link { color: var(--wx-green); font-size: 14px; }
.order-contact .small.muted { font-size: 13px; }

/* 进货单 - 联系客服入口（整句绿色，弱化不突兀） */
.cart-contact-soft { text-align: center; font-size: 13px; color: var(--wx-green); padding: 10px 14px 4px; cursor: pointer; line-height: 1.5; }
.cart-contact-soft:active { opacity: .6; }
.cart-contact-soft .cc-tip { color: var(--wx-green); }


/* ---------------- 后台布局 ---------------- */
.admin-body { background: #f2f3f5; }
.admin-shell { display: flex; min-height: 100vh; }
.side {
  width: 200px; flex: 0 0 200px; background: #2e3238; color: #c9ced6;
  padding: 16px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.side .brand { padding: 6px 18px 18px; color: #fff; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.side .brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--wx-green); display: inline-block; }
.side a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; color: #c9ced6; font-size: 14px; }
.side a.active, .side a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side a.active { box-shadow: inset 3px 0 0 var(--wx-green); }
.side .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 10px 18px; }
.side-bottom { margin-top: auto; padding-top: 10px; }
.side-bottom .sep { margin-bottom: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid #e8e8e8; display: flex; align-items: center; padding: 0 16px; gap: 12px; position: sticky; top: 0; z-index: 40; }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.content { padding: 16px; flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.panel { background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.panel-hd { padding: 10px 16px 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-hd h2 { font-size: 15px; margin: 0; font-weight: 600; }
.panel-bd { padding: 8px 16px 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select {
  height: 34px; border: 1px solid #e3e3e3; border-radius: 6px; padding: 0 10px; outline: none; background: #fff; font-size: 14px;
}
.filters input:focus, .filters select:focus { border-color: var(--wx-green); }

/* 批量操作栏 */
.batch-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: #f6fbf8; border-bottom: 1px solid #dcefe4;
}
.batch-info { font-size: 13px; color: #555; }
.batch-info b { color: var(--wx-green); font-size: 15px; margin: 0 2px; }
.batch-select {
  height: 30px; border: 1px solid #cfe6d8; border-radius: 6px; padding: 0 10px;
  outline: none; background: #fff; font-size: 13px; color: #333;
}
table.tbl td.ck-col, table.tbl th.ck-col { text-align: center; }
table.tbl input[type="checkbox"], .batch-bar input[type="checkbox"] { accent-color: var(--wx-green); width: 16px; height: 16px; cursor: pointer; }

/* 引导提示：未填销售规格时高亮「＋ 添加规格」按钮 */
@keyframes flashRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(7, 193, 96, .55); }
  50% { box-shadow: 0 0 0 6px rgba(7, 193, 96, .08); }
}
#addVSpec.flash { animation: flashRing .6s ease-in-out 2; border-color: var(--wx-green) !important; color: var(--wx-green) !important; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px; padding: 10px 12px; background: #fafafa; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:hover td { background: #fcfcfc; }
table.tbl img.tp { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: #f3f3f3; }
.table-wrap { overflow-x: auto; }

.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.s-pending i { background: #fa9d3b } .s-pending { color: #d97b17 }
.s-contacted i { background: #10aeff } .s-contacted { color: #1a86c4 }
.s-paid i { background: #6467f0 } .s-paid { color: #5457d8 }
.s-shipped i { background: #07c160 } .s-shipped { color: var(--wx-green-dark) }
.s-completed i { background: #9a9a9a } .s-completed { color: #777 }
.s-cancelled i { background: #fa5151 } .s-cancelled { color: var(--wx-red) }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px 0; }
.timeline li::before { content: ''; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--wx-green); box-shadow: 0 0 0 2px #fff; }
.timeline li.old::before { background: #cfcfcf; }

.imgs-edit { display: flex; flex-wrap: wrap; gap: 10px; }
.imgs-edit .box { width: 92px; height: 92px; border-radius: 8px; overflow: hidden; position: relative; background: #f5f5f5; border: 1px solid var(--line); }
.imgs-edit .box img { width: 100%; height: 100%; object-fit: cover; }
.imgs-edit .box button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; line-height: 20px; }
.imgs-edit .add { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; color: #999; font-size: 12px; border: 1px dashed #ccc; background: #fafafa; }

/* 拖动排序模式：仅在点击「拖动排序」后生效，防误触 */
.imgs-edit.sorting .box.sortable,
#vspecs.sorting .vchip.sortable { cursor: grab; }
.imgs-edit.sorting .box.sortable:active,
#vspecs.sorting .vchip.sortable:active { cursor: grabbing; }
.imgs-edit .box.sortable { outline: 2px dashed var(--wx-green); outline-offset: 2px; }
#vspecs .vchip.sortable { box-shadow: 0 0 0 2px var(--wx-green) inset; }
.imgs-edit .box.dragging,
#vspecs .vchip.dragging { opacity: .4; }

.kv-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.kv-row input { flex: 1; height: 34px; border: 1px solid #e3e3e3; border-radius: 6px; padding: 0 10px; outline: none; }
.kv-row input:focus { border-color: var(--wx-green); }
.kv-row .del { width: 30px; height: 30px; border-radius: 6px; color: #999; background: #f5f5f5; flex: 0 0 30px; }

/* 移动端后台 */
@media (max-width: 860px) {
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; transform: translateX(-100%);
    transition: transform .22s; height: 100vh;
  }
  .side.open { transform: translateX(0); box-shadow: 0 0 30px rgba(0, 0, 0, .3); }
  .side-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 190; }
  .menu-btn { display: inline-flex !important; }
  .content { padding: 12px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table.tbl { min-width: 720px; }
  .panel-hd { align-items: flex-start; }
  .filters input, .filters select { flex: 1 1 130px; min-width: 0; }
}
.menu-btn { display: none; width: 32px; height: 32px; border-radius: 6px; background: #f2f2f2; align-items: center; justify-content: center; }

/* 桌面端客户端优化 */
@media (min-width: 760px) {
  .tabbar { display: none; }
  .page { padding-bottom: 40px; }
  .nav-right .desktop-links { display: flex; gap: 16px; }
  .detail-flex { display: flex; gap: 20px; align-items: flex-start; }
  .detail-flex > .swiper-wrap { flex: 0 0 420px; border-radius: var(--radius); overflow: hidden; }
  .detail-flex > .detail-side { flex: 1; min-width: 0; }
}
.desktop-only { display: none; }
@media (min-width: 760px) { .desktop-only { display: inline-flex; } .mobile-only { display: none !important; } }
