:root {
  --primary: #c0392b;
  --primary-dark: #a93226;
  --primary-soft: #fdecea;
  --accent: #e74c3c;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8494a8;
  --border: #e6eaf2;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
  --topbar-h: 56px;
  --tabbar-h: 50px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
/* 统一 hidden 语义：类选择器里的 display 不得覆盖 hidden 属性（曾致空的 .detect-chip 一直显示） */
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #e8766b);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.brand-text { font-weight: 700; font-size: 15px; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text em { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 400; }
@media (max-width: 380px) { .brand-text em { display: none; } }

/* ---------------- 登录页（对齐小程序入口） ---------------- */
.login-hero { text-align: center; padding: 26px 0 18px; }
.login-hero .brand-mark { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; margin: 0 auto 12px; background: linear-gradient(135deg, var(--primary), #e8766b); }
.login-hero .lh-name { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.login-hero .lh-sub { margin-top: 5px; font-size: 13px; color: var(--muted); }

.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a {
  position: relative; padding: 7px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; white-space: nowrap;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.badge {
  display: none; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
  background: var(--accent); color: #fff; border-radius: 8px;
  font-size: 10px; font-style: normal; line-height: 16px; text-align: center; vertical-align: 1px;
}
.badge.show { display: inline-block; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.pill.used { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.pill.unused { background: #e8f7ef; color: #1a8a4f; border: 1px solid #b9e6cd; }

.userbox { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.user-chip b { color: var(--text); }
.lv {
  padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
}
.lv.vip { background: #fff7ed; color: var(--accent); }
.lv.big { background: #f5f3ff; color: #7c3aed; }

/* ---------------- 布局 ---------------- */
.app { max-width: 1180px; margin: 0 auto; padding: 14px 14px 24px; }

/* ---------------- 首页 · 轮播 / 搜索 / 区块（对齐小程序样式） ---------------- */
.mp-banner { position: relative; margin: 0 0 6px; border-radius: 14px; overflow: hidden; background: #eee; aspect-ratio: 75 / 30; }
.mp-banner-track { display: flex; height: 100%; transition: transform .4s ease; }
.mp-banner-slide { flex: 0 0 100%; height: 100%; }
.mp-banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-banner-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.mp-banner-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, .65); cursor: pointer; pointer-events: auto; transition: .2s; }
.mp-banner-dot.on { width: 18px; border-radius: 4px; background: #c0392b; }

.mp-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--primary); border-radius: 16px; padding: 0 18px; height: 58px; margin: 12px 0 16px; position: relative; box-shadow: 0 6px 18px rgba(192, 57, 43, .15); }
.mp-search-ico { font-size: 22px; opacity: 1; color: var(--primary); flex-shrink: 0; }
.mp-search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 17px; color: var(--text); }
.mp-search-input::placeholder { color: #b08a86; }
.mp-search-clear { flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 50%; background: #e0a39d; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }

/* 找货页：UA 自动识别机型提示条（合并自 phonequery） */
.detect-chip { display: flex; align-items: center; gap: 8px; margin: 10px 2px 4px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, #fff4f2, #ffe9e4); border: 1px solid #f3c9c0; font-size: 14px; color: #8a4a40; }
.detect-chip .dc-ico { font-size: 16px; }
.detect-chip .dc-txt { flex: 1; min-width: 0; }
.detect-chip .dc-txt b { color: #c0392b; }
.detect-chip .dc-x { flex-shrink: 0; width: 22px; height: 22px; border: 0; border-radius: 50%; background: #e0a39d; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.detect-chip .dc-x:hover { background: #d08a82; }

.tag.mp-tag { background: #fdecea; color: #c0392b; }

.page-title { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 12px; }
.page-title h2 { font-size: 18px; }
.page-title span { font-size: 12px; color: var(--muted); }

/* 客服台专用顶栏（独立入口，不暴露后台其它功能） */
.csbar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, #b5302a, #c0392b);
  color: #fff; padding: 14px 18px; border-radius: 12px; margin-bottom: 14px;
}
.csbar-t { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.csbar-x { color: #ffe; font-size: 13px; text-decoration: underline; cursor: pointer; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
}
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.gate-tip { font-size: 12.5px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.gate-tip.on { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.gate-tip.off { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.gate-tip b { font-weight: 700; }
.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 1px; font-size: 14px; }
.card-h h3 { font-size: 15px; }
.card-h .spacer { margin-left: auto; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- 表单控件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 1px solid var(--border);
  background: #fff; color: var(--text); border-radius: 9px; cursor: pointer;
  font-size: 14px; white-space: nowrap; transition: .15s;
}
.btn:hover { border-color: #cbd5e1; background: #fafbfc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(.95); }
.btn.danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f1f5f9; }

.input, .select, textarea.input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff; outline: none;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; min-height: 62px; }
/* 适配机型联想下拉 */
.model-ac { position: relative; margin-bottom: 6px; }
.model-ac-list {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow-y: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 4px;
}
.model-ac-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.model-ac-item:hover { background: #f1f5f9; }
.model-ac-item--added { opacity: .55; }
.model-ac-name { font-weight: 600; color: var(--text); font-size: 13px; }
.model-ac-brand { font-size: 12px; color: var(--muted); margin-left: 2px; }
.model-ac-tick { margin-left: auto; font-size: 12px; color: var(--primary); }
.model-ac-nores { padding: 10px; font-size: 12px; color: var(--muted); text-align: center; }

.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.field { margin-bottom: 12px; }
.field > label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; }
.field-half { display: inline-block; width: calc(50% - 5px); vertical-align: top; }
.field-half + .field-half { margin-left: 10px; }
.site-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(192,57,43,.10), rgba(234,118,107,.10)); border: 1px solid rgba(192,57,43,.18);
  color: #9f2d23; font-size: 13.5px; line-height: 1.4; }
.site-notice .sn-ico { flex: 0 0 auto; }
.site-notice .sn-txt { font-weight: 500; }

/* ---------------- 找货助手 ---------------- */
.searchbar { position: relative; margin-bottom: 12px; }
.searchbar .input { height: 48px; padding-left: 46px; font-size: 16px; border-radius: 14px; }
.searchbar .icon { position: absolute; left: 15px; top: 14px; font-size: 18px; opacity: .5; }
.searchbar .clear {
  position: absolute; right: 10px; top: 10px; width: 30px; height: 30px;
  border: 0; background: #eef1f6; color: var(--muted); border-radius: 50%; cursor: pointer; font-size: 17px;
}
@media (min-width: 861px) {
  .searchbar .input { height: 46px; padding-left: 42px; font-size: 15px; border-radius: 12px; }
  .searchbar .icon { left: 14px; top: 13px; font-size: 16px; }
  .searchbar .clear { right: 8px; top: 9px; width: 28px; height: 28px; font-size: 15px; }
}
.suggest {
  position: absolute; left: 0; right: 0; top: 50px; z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.suggest li { padding: 9px 14px; cursor: pointer; font-size: 14px; }
.suggest li:hover, .suggest li.on { background: var(--primary-soft); color: var(--primary); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 36px; padding: 8px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  font-size: 14px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
.chip:hover { border-color: #c7d2fe; color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.chip.on .badge { background: #fff; color: var(--accent); }
.chip.on.warn { background: var(--warn); border-color: var(--warn); }
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; margin-bottom: 12px; }
.filter-row .filter-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.filter-row .filter-group label { white-space: nowrap; flex-shrink: 0; }
.filter-row .select { width: auto; min-width: 120px; height: 40px; font-size: 14px; }
@media (max-width: 480px) {
  .filter-row { flex-wrap: wrap; }
  .filter-row .filter-group { flex: 1 1 auto !important; }
}
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--primary); }
@media (min-width: 861px) {
  .chip { min-height: auto; padding: 6px 12px; font-size: 13px; }
  .filter-row .select { min-width: 110px; height: 34px; font-size: 13px; }
  .switch { font-size: 13px; gap: 6px; }
  .switch input { width: 16px; height: 16px; }
}

.result-head { display: flex; align-items: center; gap: 10px; margin: 12px 2px 8px; font-size: 13px; color: var(--muted); }
.result-head .count b { color: var(--text); }

/* 找货页商品列表：一行一款 */
#fList { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.pcard {
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--shadow); transition: .15s;
}
.pcard:hover { box-shadow: 0 4px 16px rgba(192, 57, 43, .12); border-color: #f3c9c4; }
.pcard.out { opacity: .6; }
.pcard-main { flex: 1; min-width: 0; }
.pcard-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; line-height: 1.4; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.pcard-price { flex: 0 0 auto; text-align: right; min-width: 84px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pcard-price .p { color: var(--accent); font-size: 18px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.pcard-price .p small { font-size: 11px; font-weight: 500; }
.pcard-price .st { font-size: 12px; flex-shrink: 0; }
.st.out { color: var(--muted); }
.st.low { color: var(--warn); }
.st.ok { color: var(--success); }
.pcard-act { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.pcard-act .btn, .pcard-act .stepper { flex: 0 0 auto; justify-content: center; min-width: 76px; }
@media (max-width: 560px) {
  .pcard { flex-wrap: wrap; padding: 9px 11px; gap: 8px 10px; }
  .pcard-main { flex: 1 1 100%; }
  .pcard-price { flex: 1 1 auto; text-align: left; align-items: flex-start; flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
  .pcard-act { margin-left: auto; }
  .pcard-act .btn, .pcard-act .stepper { min-width: 68px; }
}

/* ---------------- 找货页：左分类竖栏 + 右配件列表 ---------------- */
.mp-body { display: grid; grid-template-columns: clamp(78px, 22vw, 118px) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.mp-rail-col { min-width: 0; }
.mp-list-col { min-width: 0; }

.cat-rail {
  position: sticky; top: calc(var(--topbar-h) + 10px);
  display: flex; flex-direction: column; gap: 3px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; box-shadow: var(--shadow);
  max-height: calc(100vh - var(--topbar-h) - 26px);
  overflow-y: auto; scrollbar-width: none;
}
.cat-rail::-webkit-scrollbar { display: none; }

.rail-i {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%; padding: 7px 3px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; color: var(--text-2);
  text-align: center; transition: background .15s, color .15s, box-shadow .15s;
}
.rail-i:hover { background: #f6f8fc; }
.rail-badge {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: #fff;
  background: var(--c, #64748b);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .16);
}
.rail-tx { font-size: 11px; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 选中态：蓝底高亮 */
.rail-i.on { background: #2563eb; color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .28); }
.rail-i.on .rail-tx { color: #fff; font-weight: 700; }
.rail-i.on .rail-badge { background: rgba(255, 255, 255, .24); box-shadow: none; }

@media (max-width: 480px) {
  .mp-body { gap: 8px; }
  .cat-rail { padding: 4px; border-radius: 12px; gap: 2px; }
  .rail-i { padding: 6px 2px; gap: 3px; }
  .rail-badge { width: 27px; height: 27px; border-radius: 8px; font-size: 13px; }
  .rail-tx { font-size: 10.5px; }
}

.tag { padding: 1px 6px; border-radius: 4px; font-size: 11px; background: #f1f5f9; color: var(--text-2); }
/* 供应商标签配色由 supplierStyle() 动态生成内联 style，不再依赖 q0–q3 class */
.tag.sku { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f8fafc; color: var(--muted); }

/* 品牌筛选条 */
.mp-brands { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mp-brands::-webkit-scrollbar { display: none; }
.mp-brands .br { flex: 0 0 auto; min-height: 34px; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.mp-brands .br:hover { border-color: var(--primary); color: var(--primary); }
.mp-brands .br.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 排序栏 */
.mp-sorts { display: flex; gap: 8px; margin: 0 0 12px; }
.mp-sorts .srt { flex: 1; min-height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text-2); font-size: 14px; cursor: pointer; }
.mp-sorts .srt:hover { border-color: var(--primary); color: var(--primary); }
.mp-sorts .srt.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 热销位 */
.mp-hot { background: linear-gradient(135deg, #fff5f3, #fff); border: 1px solid #f6d6d1; border-radius: 14px; padding: 12px 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.mp-hot-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-hot-t { font-weight: 700; font-size: 15px; color: var(--primary); }
.mp-hot-s { font-size: 13px; color: var(--muted); cursor: pointer; }
.mp-hot-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.hot-i { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; cursor: pointer; transition: .15s; }
.hot-i:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(192, 57, 43, .12); }
.hot-n { font-size: 12.5px; font-weight: 600; line-height: 1.35; max-height: 34px; overflow: hidden; }
.hot-p { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.hot-s { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 联想下拉增强 */
.suggest li.sg { display: flex; align-items: center; gap: 8px; }
.suggest li.sg .sg-c { margin-left: auto; font-size: 11px; color: var(--muted); background: #f1f5f9; border-radius: 4px; padding: 1px 6px; }
.suggest li.sg.hist { color: var(--text-2); }
.suggest li.sg.hist .sg-del { margin-left: auto; color: #cbd5e1; font-size: 12px; padding: 0 4px; }
.suggest li.sg.hist .sg-del:hover { color: #e11d48; }

/* 销量标签 */
.tag.mp-tag.hot { background: #fff1ed; color: #e5372b; font-weight: 600; }

/* 详情页「相关商品」横向滚动 */
.rel-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rel-row::-webkit-scrollbar { display: none; }
.rel-i { flex: 0 0 auto; width: 150px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; cursor: pointer; transition: .15s; }
.rel-i:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(192, 57, 43, .12); }
.rel-n { font-size: 12.5px; font-weight: 600; line-height: 1.35; max-height: 34px; overflow: hidden; }
.rel-p { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.rel-s { font-size: 11px; color: var(--muted); margin-top: 2px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stepper button { width: 30px; height: 30px; border: 0; background: #fff; cursor: pointer; font-size: 16px; color: var(--primary); }
.stepper button:hover { background: var(--primary-soft); }
.stepper span { min-width: 34px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }

/* 悬浮购物车条 */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 40;
  display: none; align-items: center; gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #0f172a; color: #fff; box-shadow: 0 -4px 20px rgba(15, 23, 42, .18);
}
.cartbar.show { display: flex; }
.cartbar .info { flex: 1; font-size: 13px; }
.cartbar .info b { color: #fbbf24; font-size: 17px; }
@media (min-width: 861px) { .cartbar { bottom: 0; max-width: 1180px; margin: 0 auto; border-radius: 12px 12px 0 0; } }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; background: #fafbfd; position: sticky; top: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tbody tr:hover { background: #fafbfe; }
table.tbl tr.disabled td { opacity: .45; }
table.tbl .col-cbx { width: 34px; text-align: center; }
table.tbl .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------------- 机型库管理 ---------------- */
.ml-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ml-toolbar .grow { flex: 1; }
.ml-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; max-height: 96px; overflow-y: auto; }
.ml-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--text-2); cursor: pointer; background: #fff; user-select: none; }
.ml-chip b { color: var(--muted); font-weight: 600; }
.ml-chip:hover { border-color: var(--primary); }
.ml-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ml-chip.on b { color: rgba(255, 255, 255, .85); }
.ml-paging { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.ml-paging .ml-pg-info { font-size: 12px; color: var(--muted); }

/* ---------------- 统计卡片 ---------------- */
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat .v { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.hl .v { color: var(--primary); }
.stat.profit .v { color: var(--success); }
.stat.warn .v { color: var(--warn); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar {
  width: 100%; max-width: 46px; background: linear-gradient(180deg, #e8766b, var(--primary));
  border-radius: 6px 6px 0 0; min-height: 3px; position: relative;
}
.bar-col .bar span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-2); white-space: nowrap;
}
.bar-col .lb { font-size: 11px; color: var(--muted); }
.bar-col .ct { font-size: 10px; color: var(--muted); }

.rank { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rank:last-child { border-bottom: 0; }
.rank .i { width: 20px; height: 20px; border-radius: 5px; background: #f1f5f9; color: var(--text-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.rank .i.top { background: var(--accent); color: #fff; }
.rank .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rank .q { color: var(--muted); font-size: 12px; flex-shrink: 0; }

/* ---------------- 订单 ---------------- */
.order {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden;
}
.order-h {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 12px; background: #fff; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted);
}
.order-h .no { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
.order-b { padding: 10px 12px; }
.oi { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.oi .nm { flex: 1; min-width: 0; }
.oi .nm div:first-child { font-size: 13px; }
.oi .nm div:last-child { font-size: 11px; color: var(--muted); }
.oi .q { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.oi .m { min-width: 68px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--accent); font-weight: 600; }
.order-f { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px dashed var(--border); }
.order-f .amt { margin-left: auto; font-size: 13px; }
.order-f .amt b { color: var(--accent); font-size: 16px; }

.stt { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.stt.pending { background: var(--warn-soft); color: var(--warn); }
.stt.confirmed { background: #eff6ff; color: var(--primary); }
.stt.shipped { background: #f5f3ff; color: #7c3aed; }
.stt.completed { background: var(--success-soft); color: var(--success); }
.stt.cancelled { background: #f1f5f9; color: var(--muted); }
.stt.unpaid { background: #fff7ed; color: #c2410c; }
.stt.review { background: #f5f3ff; color: #7c3aed; }
.stt.refunded { background: #fee2e2; color: #991b1b; }
/* 退货退款订单卡：淡红边框 + 淡红表头，长列表里一眼可辨 */
.order.refunded { border-color: #fecaca; }
.order.refunded .order-h { background: #fef7f7; }

/* 结算页：收货信息 / 支付方式 */
.sec-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.pay-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.pay-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.pay-opt.dis { opacity: .6; cursor: not-allowed; background: #f8fafc; }
.pay-opt input { margin-top: 3px; accent-color: var(--primary); }
.po-ic { font-size: 20px; line-height: 1.2; }
.po-tx { display: flex; flex-direction: column; }
.po-tx b { font-size: 14px; }
.po-tx i { font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.mt8 { margin-top: 8px; }
.order-sub { padding: 4px 12px 0; }
.auto-flow { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--primary); background: #eff6ff; padding: 2px 8px; border-radius: 5px; }
.auto-flow.done { color: var(--success); background: var(--success-soft); }

/* ---------------- 弹窗 ---------------- */
.modal-root:empty { display: none; }
.mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 861px) { .mask { align-items: center; } }
.modal {
  background: #fff; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
  border-radius: 14px 14px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: up .18s ease-out;
}
/* 宽弹窗：字段多 / 含 8 列规格行的表单（编辑配件、批量改价、导入）使用 */
.modal.modal-wide { max-width: 900px; }
@media (min-width: 861px) { .modal { border-radius: 14px; } }
@keyframes up { from { transform: translateY(20px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-h { display: flex; align-items: center; margin-bottom: 14px; }
.modal-h h3 { font-size: 16px; }
.modal-h .x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-f { display: flex; gap: 10px; margin-top: 16px; }
.modal-f .btn { flex: 1; }

/* ---------------- 品类管理（两级分类树） ---------------- */
.cat-tree { display: flex; flex-direction: column; gap: 10px; }
.cat-group { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.cat-group > .cat-row { background: rgba(192,57,43,.04); border-bottom: 1px solid var(--border); }
.cat-sub { padding-left: 30px; background: transparent; }
.cat-sub + .cat-sub { border-top: 1px dashed var(--border); }
.cat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.cat-name { font-size: 14px; color: var(--text); }
.cat-tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; line-height: 1.6; flex: 0 0 auto; }
.cat-tag.lvl1 { background: rgba(37,99,235,.12); color: var(--primary); }
.cat-tag.lvl2 { background: rgba(16,185,129,.12); color: #0f9d6b; }
.cat-count { font-size: 12px; color: var(--muted); }
.cat-row .row-actions { margin-left: auto; }

/* ---------------- 其它 ---------------- */
.empty { text-align: center; padding: 46px 16px; color: var(--muted); }
.empty .em { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }
.toast {
  position: fixed; left: 50%; top: 72px; transform: translate(-50%, -12px); z-index: 200;
  background: rgba(15, 23, 42, .92); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.hr { height: 1px; background: var(--border); margin: 12px 0; }
.kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.kv b { font-variant-numeric: tabular-nums; }

.sec-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; color: var(--text); }
.sec-title::before { content: ''; display: inline-block; width: 4px; height: 14px; background: var(--accent); border-radius: 2px; margin-right: 7px; vertical-align: -2px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* ---------------- 拍照批量入库 ---------------- */
.modal.inbound-modal {
  max-width: min(1200px, 98vw);
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.modal.inbound-modal .modal-h {
  flex-shrink: 0;
  padding: 16px 18px 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.modal.inbound-modal .modal-b {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
}
.inbound { display: flex; flex-direction: column; gap: 12px; }
.inbound .step { margin-bottom: 0; }
.inbound .step-h { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.inbound .drop {
  border: 2px dashed var(--border); border-radius: 12px;
  min-height: 170px; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .15s; background: var(--bg-2);
}
.inbound .drop:hover, .inbound .drop.drag { border-color: var(--primary); background: rgba(37,99,235,.06); }
.inbound .drop-in { pointer-events: none; color: var(--muted); font-size: 14px; line-height: 1.8; }
.inbound .thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.inbound .thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.inbound .thumb img { width: 100%; height: 100%; object-fit: cover; }
.inbound .thumb-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(15,23,42,.72); color: #fff; font-size: 14px; line-height: 20px; cursor: pointer; }
.inbound .row-actions { align-items: center; }
.inbound .table-wrap {
  border: 1px solid var(--border); border-radius: 10px; margin: 0; padding: 0; overflow: auto;
  max-height: min(420px, 38vh);
}
.inbound table.tbl { font-size: 13px; width: 100%; table-layout: fixed; min-width: 0; }
.inbound table.tbl th, .inbound table.tbl td { padding: 8px 4px; white-space: normal; vertical-align: middle; overflow-wrap: break-word; }
.inbound table.tbl th.ib-check, .inbound table.tbl td:first-child,
.inbound table.tbl th.ib-qty, .inbound table.tbl td.ib-qty,
.inbound table.tbl th.ib-price, .inbound table.tbl td.ib-price,
.inbound table.tbl th.ib-del, .inbound table.tbl td.ib-del { white-space: nowrap; }
.inbound .tbl input.input, .inbound .tbl select.select {
  padding: 4px 5px; font-size: 12px; height: 32px; border-radius: 6px; width: 100%;
}
.inbound .tbl .ib-check { width: 34px; text-align: center; }
.inbound .tbl .ib-name { width: auto; min-width: 120px; }
.inbound .tbl .ib-brand { width: 64px; }
.inbound .tbl .ib-cat { width: 82px; }
.inbound .tbl .ib-qua { width: 84px; }
.inbound .tbl .ib-model { width: 108px; }
.inbound .tbl .ib-qty { width: 50px; text-align: center; }
.inbound .tbl .ib-price { width: 70px; text-align: right; }
.inbound .tbl .num { text-align: center; }
.inbound .tbl td.num .input { text-align: right; }
.inbound .tbl .ib-del { width: 34px; padding: 0; text-align: center; }
.inbound .name-cell { min-width: 120px; vertical-align: top; }
.inbound .name-cell .ib-name { width: 100%; }
@media (max-width: 860px) {
  .inbound table.tbl { table-layout: auto; min-width: 720px; }
  .inbound table.tbl th, .inbound table.tbl td { white-space: nowrap; }
}
.inbound .name-rec {
  display: inline-block; margin-top: 5px; max-width: 100%;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; cursor: pointer;
  transition: .15s;
}
.inbound .name-rec:hover { background: #dbeafe; }
.inbound .name-rec.hide { display: none; }
.inbound .name-cell.is-dup .ib-name { border-color: #ffc857; background: #fffdf5; }
.inbound tr.is-dup > td { background: #fff7e6; }
.inbound tr.is-badname > td { background: #fff1f0; }
.inbound .name-cell.is-badname .input { border-color: #ff7a7a; background: #fff7f7; }
.inbound .dup-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; padding: 5px 8px; background: #fff7e6; border: 1px solid #ffe0a3; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.inbound .dup-warn .dup-flag { color: #b76e00; font-weight: 600; white-space: nowrap; }
.inbound .dup-warn .dup-flag.bad { color: #cf1322; }
.inbound tr.is-badname .dup-warn { background: #fff1f0; border-color: #ffccc7; }
.inbound .dup-opt { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; color: #5b6b7e; white-space: nowrap; }
.inbound .dup-opt input { width: 14px; height: 14px; accent-color: var(--primary); margin: 0; }
@media (max-width: 860px) {
  .modal.inbound-modal { max-width: 100vw; max-height: 96vh; border-radius: 14px 14px 0 0; }
  .modal.inbound-modal .modal-h { padding: 14px 14px 10px; }
  .modal.inbound-modal .modal-b { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .inbound .drop { min-height: 140px; padding: 18px; }
  .inbound .drop-in { font-size: 13px; }
  .inbound .thumb { width: 68px; height: 68px; }
}

.bottombar { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.bottombar .amt { flex: 1; font-size: 13px; }
.bottombar .amt b { color: var(--accent); font-size: 20px; }

/* 购物车底部栏：金额与结算按钮单行排列 */
.cart-bbar .amt { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.cart-bbar .amt .c-price { color: var(--accent); font-size: 20px; font-weight: 700; }
.cart-bbar .btn { min-width: 100px; }

/* ---------------- 购物车（对齐小程序） ---------------- */
.cart-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; font-size: 13px; color: var(--muted); }
.cart-top b { color: var(--text); font-weight: 700; }
.cart-top .cart-clear { color: var(--danger); cursor: pointer; }
.cart-top .cart-clear:hover { text-decoration: underline; }
.cart-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.cart-row:last-child { border-bottom: 0; }
.ci { flex: 1; min-width: 0; }
.ci-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.ci-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 7px 0; }
.ci-stock { font-size: 11px; color: var(--muted); }
.ci-stock.out { color: var(--danger); }
.ci-price { color: var(--accent); font-size: 16px; font-weight: 700; }
.ci-ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; flex-shrink: 0; }
.ci-del { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.ci-del:hover { color: var(--danger); }

/* ---------------- 确认订单页小计 ---------------- */
.co-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.co-total b { color: var(--accent); font-size: 19px; }

/* ---------------- 商品详情页（对齐小程序） ---------------- */
.pdp-topbar { margin: -4px 0 8px; }
.pdp-topbar .back { color: var(--primary); font-size: 14px; text-decoration: none; }
.pdp-hero { background: linear-gradient(135deg, #c0392b, #e74c3c); color: #fff; border-radius: 16px; padding: 20px 18px 18px; }
.pdp-name { font-size: 19px; font-weight: 800; line-height: 1.35; }
.pdp-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 8px; }
.pdp-tags .tag, .pdp-tags .mp-tag { background: rgba(255, 255, 255, .18); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.pdp-sku { font-size: 12px; opacity: .85; }
.pdp-block { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px; }
.pdp-k { font-size: 14px; color: var(--muted); }
.pdp-price { color: var(--accent); font-size: 24px; font-weight: 800; }
.pdp-v { font-size: 15px; font-weight: 600; color: var(--text); }
.pdp-v.ok { color: var(--success); }
.pdp-v.out { color: var(--danger); }
.pdp-section { padding: 14px; }
.pdp-stitle { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.pdp-row { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.pdp-row:last-child { border-bottom: 0; }
.pdp-row .pk { color: var(--muted); flex: 0 0 72px; }
.pdp-row .pv { color: var(--text); flex: 1; min-width: 0; }
.pdp-desc { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.pdp-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .05); }
.pdp-foot .stepper { margin-right: auto; }
.pdp-foot .btn { flex: 1; }
.stepper .step { width: 34px; height: 34px; border: 0; background: #f3f4f6; font-size: 18px; cursor: pointer; }
.stepper .step:first-child { border-radius: 8px 0 0 8px; }
.stepper .step:last-child { border-radius: 0 8px 8px 0; }

@media (max-width: 860px) {
  .nav { display: none; }
  .app { padding: 12px 12px 20px; }
  .grid-2 { grid-template-columns: 1fr; }
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: #fff; border-top: 1px solid var(--border);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--muted); position: relative;
}
.tabbar a span { font-size: 18px; line-height: 1; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar .badge {
  position: absolute; top: 4px; left: 50%; margin-left: 6px; display: none;
  background: var(--accent); color: #fff; border-radius: 8px; font-size: 10px;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 4px;
}
.tabbar .badge.show { display: block; }
@media (min-width: 861px) { .tabbar { display: none; } body { padding-bottom: 0; } }

/* ---------------- 我的（对齐小程序 mine） ---------------- */
.mine-profile {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #c0392b, #a93226);
  color: #fff; border-radius: 14px; padding: 20px 18px; margin-bottom: 14px;
}
.mine-profile .avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center;
  font-size: 28px; border: 2px solid rgba(255, 255, 255, .5);
}
.mine-profile .who { min-width: 0; }
.mine-profile .name { font-size: 18px; font-weight: 700; }
.mine-profile .phone { font-size: 13px; opacity: .9; margin-top: 2px; }
.mine-profile .lv {
  display: inline-block; margin-top: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .35);
}
.mine-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.mine-card .o-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; cursor: pointer; }
.mine-card .o-title { font-weight: 700; font-size: 15px; }
.mine-card .o-all { font-size: 13px; color: var(--muted); }
.ostat { display: flex; }
.ostat .os { flex: 1; text-align: center; cursor: pointer; }
.ostat .os .num { font-size: 20px; font-weight: 800; color: var(--primary); }
.ostat .os .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mine-card.menu .mi {
  display: flex; align-items: center; gap: 12px; padding: 13px 4px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.mine-card.menu .mi:last-child { border-bottom: none; }
.mine-card.menu .mi-ico { font-size: 18px; width: 24px; text-align: center; }
.mine-card.menu .mi-t { flex: 1; font-size: 14px; }
.mine-card.menu .mi-v { font-size: 13px; color: var(--primary); }
.mine-card.menu .mi-v.on { color: var(--success); }
.mine-card.menu .mi-ar { color: var(--muted); font-size: 16px; }
.mine-logout {
  width: 100%; padding: 13px; border: none; border-radius: 12px; margin: 4px 0 16px;
  background: #fff; color: var(--danger); font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.mine-logout:active { transform: translateY(1px); }
.mine-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 4px; }

/* 代客下单页 · 新订单语音提醒高亮 */
@keyframes omFlash { 0% { box-shadow: 0 0 0 2px #fb923c; } 50% { box-shadow: 0 0 0 4px #fdba74; } 100% { box-shadow: 0 0 0 0 transparent; } }
.order.om-new { border: 1px solid #fdba74 !important; background: #fff7ed; animation: omFlash 1.2s ease 2; }

/* ---------------- 手机端全局高度/间距压缩 ---------------- */
@media (max-width: 480px) {
  :root { --topbar-h: 48px; --tabbar-h: 46px; }
  body { font-size: 13.5px; }
  .app { padding: 10px 10px 16px; }
  .topbar { padding: 0 10px; }
  .brand-mark { width: 26px; height: 26px; font-size: 13px; }
  .brand-text { font-size: 14px; }

  .mp-banner { aspect-ratio: 75 / 24; border-radius: 12px; }
  .mp-search { height: 48px; border-radius: 12px; padding: 0 14px; margin: 8px 0 12px; border-width: 1.5px; box-shadow: 0 3px 10px rgba(192, 57, 43, .12); }
  .mp-search-ico { font-size: 18px; }
  .mp-search-input { font-size: 15px; }

  .card { padding: 12px; border-radius: 10px; }
  .card + .card { margin-top: 10px; }
  .sec-title { font-size: 12.5px; margin-bottom: 8px; }

  .btn { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
  .btn.sm { height: 28px; padding: 0 8px; font-size: 12px; }
  .input, .select, textarea.input { height: 34px; padding: 0 10px; font-size: 14px; border-radius: 8px; }
  textarea.input { min-height: 52px; padding: 7px 10px; }
  .field { margin-bottom: 10px; }
  .field > label { font-size: 12.5px; margin-bottom: 4px; }

  .pcard { padding: 8px 10px; border-radius: 12px; }
  .pcard-name { font-size: 13.5px; margin-bottom: 3px; }
  .pcard-price .p { font-size: 15px; }

  .cart-row { padding: 10px 0; }
  .ci-name { font-size: 13.5px; }
  .ci-tags { margin: 5px 0; gap: 4px; }
  .ci-price { font-size: 15px; }
  .cart-top { padding: 0 0 8px; font-size: 12px; }
  .cart-bbar { gap: 8px; }
  .cart-bbar .amt { gap: 6px; font-size: 12px; }
  .cart-bbar .amt .c-price { font-size: 16px; }
  .cart-bbar .btn { min-width: 84px; }

  .pay-opt { padding: 8px 10px; margin-bottom: 6px; }
  .po-ic { font-size: 18px; }
  .po-tx b { font-size: 13px; }
  .co-total { margin-top: 10px; padding-top: 10px; }

  .pdp-topbar { margin: -2px 0 6px; }
  .pdp-hero { padding: 16px 14px 14px; border-radius: 14px; }
  .pdp-name { font-size: 17px; }
  .pdp-tags { margin: 10px 0 6px; gap: 5px; }
  .pdp-price { font-size: 22px; }
  .pdp-block { padding: 12px; }
  .pdp-section { padding: 12px; }
  .pdp-stitle { font-size: 14px; margin-bottom: 8px; }
  .pdp-foot { padding: 10px 12px; }

  .mine-profile { padding: 16px 14px; margin-bottom: 12px; }
  .mine-profile .avatar { width: 46px; height: 46px; font-size: 24px; }
  .mine-profile .name { font-size: 16px; }
  .mine-card { padding: 12px; margin-bottom: 10px; }
  .mine-card.menu .mi { padding: 11px 4px; }
  .ostat .os .num { font-size: 18px; }
  .mine-logout { padding: 11px; font-size: 14px; }

  .order-h { padding: 9px 10px; }
  .order-b { padding: 8px 10px; }
  .order-f { padding: 8px 10px; }
  .oi { padding: 4px 0; }
  .oi .m { font-size: 12px; }

  .tabbar a { font-size: 10px; gap: 1px; }
  .tabbar a span { font-size: 17px; }
  .tabbar .badge { top: 2px; min-width: 14px; height: 14px; line-height: 14px; font-size: 9px; }

  .login-hero { padding: 18px 0 12px; }
  .login-hero .brand-mark { width: 46px; height: 46px; font-size: 22px; border-radius: 12px; }
  .login-hero .lh-name { font-size: 17px; }
  .login-hero .lh-sub { font-size: 12px; }
}

/* 多 SKU 规格 */
.pdp-stock { font-size: 13px; margin-top: 4px; }
.spec-row { display: flex; flex-wrap: wrap; gap: 10px; }
.spec-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 13px; min-width: 90px;
}
.spec-chip b { font-weight: 600; color: var(--text); }
.spec-chip span { font-size: 12px; color: var(--muted); }
.spec-chip.on { border-color: var(--primary); background: #fdf2f2; }
.spec-chip.out { opacity: .6; background: #f8fafc; }
.spec-list { display: flex; flex-direction: column; gap: 8px; }
/* 规格行共 8 列（规格名/SKU/成本/会员价/零售价/库存/预警/删）。
   规格名列用 minmax(120px,1fr) 兜底 —— 之前写 1fr 时，
   固定列总宽 618px 超出弹窗内容宽 588px，1fr 被压到 0，
   表现为「颜色不显示、点不到」。 */
.spec-line {
  display: grid; grid-template-columns: minmax(120px, 1fr) 120px 74px 74px 74px 64px 64px 32px;
  gap: 8px; align-items: center;
}
.spec-line input { width: 100%; min-width: 0; }
.spec-line .btn.sm { padding: 4px 8px; }
/* 窄屏时整行横向滚动，绝不压缩字段（宁可滚动也不能看不见/点不到） */
.spec-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.spec-scroll .spec-line { min-width: 660px; }
/* 规格行表头：与 grid 列一一对应 */
.spec-head {
  display: grid; grid-template-columns: minmax(120px, 1fr) 120px 74px 74px 74px 64px 64px 32px;
  gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted); margin-bottom: 6px; white-space: nowrap;
}
.spec-head > span { text-align: center; }
.spec-head > span:first-child { text-align: left; }
.copyable { cursor: pointer; }
.copyable:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 640px) {
  .spec-line, .spec-head { grid-template-columns: minmax(110px, 1fr) 96px 64px 64px 64px 58px 58px 30px; }
  .spec-scroll .spec-line, .spec-scroll .spec-head { min-width: 620px; }
}
