* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6ea;
  --text: #1f2329;
  --muted: #8a919c;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo { font-size: 20px; font-weight: 700; white-space: nowrap; }
.search-box {
  flex: 1;
  display: flex;
  gap: 8px;
}
.search-box input {
  flex: 1;
  max-width: 560px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.top-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.stat { color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { border-color: #c3c9d1; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; }

/* ---------- 布局 ---------- */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  align-items: flex-start;
}
.sidebar {
  width: 264px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}
.content {
  flex: 1;
  min-width: 0;
  padding-bottom: 76px;
}

/* ---------- 筛选 ---------- */
.fgroup { margin-bottom: 14px; }
.fgroup label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.fgroup select,
.fgroup input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  outline: none;
}
.fgroup select:focus, .fgroup input:focus { border-color: var(--primary); }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.price-row select { grid-column: 1 / -1; }
.price-row span { align-self: center; text-align: center; color: var(--muted); }
.factions { display: flex; gap: 8px; }
.factions .btn { flex: 1; }

/* ---------- 可搜索下拉组件 ---------- */
.ss-wrap { position: relative; }
.ss-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.ss-btn:hover { border-color: var(--primary); }
.ss-btn .ss-val {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ss-btn .ss-caret { color: var(--muted); font-size: 11px; margin-left: 6px; }
.ss-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.ss-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  outline: none;
}
.ss-list { max-height: 240px; overflow-y: auto; padding: 4px; }
.ss-opt {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ss-opt:hover { background: rgba(37, 99, 235, .08); }
.ss-opt.sel { background: rgba(37, 99, 235, .14); color: var(--primary); font-weight: 600; }
.ss-empty { padding: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 用户管理 ---------- */
.users-modal { width: 860px; max-width: 95vw; }
.user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.user-form input[type="text"],
.user-form input[type="password"],
.user-form select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.user-form .chk { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text); }
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th, .user-table td {
  border: 1px solid var(--border);
  padding: 7px 9px;
  text-align: center;
}
.user-table th { background: #f7f8fa; font-weight: 600; }
.user-table .sp-note { color: var(--muted); }
.role-admin { color: var(--primary); font-weight: 600; }
.user-ops { white-space: nowrap; }
.btn.mini { padding: 4px 10px; font-size: 12px; }
.btn.danger { color: #dc2626; border-color: #dc2626; }
.btn.danger:hover { background: #fef2f2; }

/* ---------- 导入面板 ---------- */
.import-panel { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.import-panel.flash {
  animation: panelFlash 1.2s ease;
}
@keyframes panelFlash {
  0% { background: rgba(37, 99, 235, .12); }
  100% { background: transparent; }
}
.import-panel h3 { font-size: 15px; margin-bottom: 8px; }
.import-panel .tip { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.6; }
.import-panel input[type="file"] { margin-bottom: 10px; font-size: 12px; width: 100%; }
.import-mode { margin-bottom: 10px; }
.import-mode .mode-item {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
}
.import-mode .mode-item span { font-size: 11px; color: var(--muted); }
.import-mode input { margin-right: 6px; }
.import-panel .btn { width: 100%; }
#import-result { margin-top: 10px; font-size: 13px; line-height: 1.7; word-break: break-all; }
#import-result .ok { color: #15803d; }
#import-result .err { color: #b91c1c; }

/* ---------- 结果 ---------- */
.result-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  position: sticky;
  top: 76px;
  z-index: 15;
  background: var(--bg);
  padding: 8px 0;
}
.result-bar select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.sort-label { margin-left: 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.card .card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .name { font-size: 15px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .badge {
  font-size: 11px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.card .meta { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.card .meta b { color: var(--text); font-weight: 500; }
.card .price-row2 { margin-top: 8px; display: flex; align-items: center; gap: 14px; }
.card .price-item { display: flex; flex-direction: column; gap: 2px; }
.card .price { font-size: 16px; font-weight: 700; color: #dc2626; }
.card .price.jd-price { color: #2563eb; }
.card .price.jd-price.jd-na { color: #c3c8cf; font-weight: 400; }
.card .price small, .card .price-item small { font-size: 12px; color: var(--muted); font-weight: 400; }
.jd-self, .card .meta b.jd-self { color: #dc2626; font-weight: 700; }
.card-actions { margin-top: 8px; display: flex; gap: 10px; }
.min-badge {
  font-size: 10px;
  color: #fff;
  background: #dc2626;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
}
.sp-count {
  font-size: 11px;
  color: #b45309;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}
.quote-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.quote-chips .chip {
  font-size: 11px;
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 1px 7px;
  border-radius: 10px;
  cursor: pointer;
}
.quote-chips .chip:hover { background: #e0f2fe; }
.quote-chips .chip.more { background: #f1f5f9; color: #475569; border-color: var(--border); }
.card .tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.card .tags span {
  font-size: 11px;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 7px;
  border-radius: 10px;
}
.card .similar-btn {
  margin-top: 8px;
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.card-actions .similar-btn, .card-actions .chart-btn {
  margin-top: 0;
  font-size: 12px;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  padding: 3px 10px;
}
.card-actions .chart-btn { color: #16a34a; background: #f0fdf4; border-color: #bbf7d0; }

/* ---------- 图片 ---------- */
.thumb {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sec-title-red {
  color: #dc2626;
  font-weight: 800;
}
.thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  cursor: zoom-in;
  transition: transform .15s;
}
.thumb img:hover { transform: scale(1.08); }
.img-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(37, 99, 235, 0.85);
  border-radius: 12px;
  cursor: zoom-in;
}
.img-count.more { background: rgba(100, 116, 139, 0.85); }
.jdlink-inline {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 2px 0;
}
.jdlink-inline a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.jdlink-inline a:hover { text-decoration: underline; }
.jdlink-inline-btn {
  font-size: 11px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: all .15s;
}
.jdlink-inline-btn:hover { color: var(--primary); border-color: var(--primary); background: rgba(37, 99, 235, 0.06); }
.jdlink-inline-ok { font-size: 11px; color: #16a34a; }
.thumb.jdlink-only .jdlink-inline { margin-left: 0; }
.img-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.img-list img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  cursor: zoom-in;
}
.img-list img:hover { border-color: var(--primary); }
.detail-img-section h4 {
  margin: 0;
  font-size: 14px;
}
.img-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.img-sec-head .btn { margin-left: auto; }
.img-sec-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 产品照片（包装图/实拍图/大货图） ---------- */
.photo-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.photo-section h4 { margin: 0; font-size: 14px; }
.photo-cat { margin-bottom: 12px; }
.photo-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.photo-item { position: relative; }
.photo-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  cursor: zoom-in;
  display: block;
}
.photo-item img:hover { border-color: var(--primary); }
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: none;
}
.photo-item:hover .photo-del { display: block; }

/* ---------- 供应商报价 ---------- */
.supplier-section { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.supplier-section h4 { margin-bottom: 8px; font-size: 14px; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-table th, .sp-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}
.sp-table th { background: #f8fafc; font-weight: 600; }
.sp-table td.sp-min { color: #dc2626; font-weight: 700; }
.sp-table td.sp-note { color: var(--muted); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-table tr:hover td { background: #f8fafc; }
.sp-table-wrap { overflow-x: auto; }

/* ---------- 价格走势 ---------- */
.chart-section { margin-bottom: 14px; }
.chart-toggle { font-size: 13px; padding: 6px 14px; }
.chart-wrap { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fff; }
.legend-item { font-size: 13px; color: var(--text); margin-right: 16px; white-space: nowrap; }
.legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.legend-item b { font-size: 13px; margin-left: 2px; }
.chart-canvas { margin-top: 8px; overflow-x: auto; }
.chart-svg { width: 100%; min-width: 480px; height: auto; display: block; }
.chart-empty { padding: 14px; color: var(--muted); font-size: 13px; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.lb-close:hover { background: rgba(255, 255, 255, .15); }
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .12);
  border: none;
  color: #fff;
  font-size: 34px;
  width: 52px;
  height: 64px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(0, 0, 0, .5);
  padding: 4px 12px;
  border-radius: 12px;
}

/* ---------- 分页 ---------- */
.pager {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 92vw;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, .14);
  z-index: 90;
}
.content { padding-bottom: 76px; }
.pager button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: 12px;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
}
.modal-head .close { font-size: 14px; padding: 4px 10px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-item { display: flex; border-bottom: 1px dashed var(--border); padding: 7px 0; font-size: 13px; }
.detail-item .k { width: 130px; flex-shrink: 0; color: var(--muted); }
.detail-item .v { flex: 1; word-break: break-all; }
.detail-item a { color: var(--primary); }

.similar-section { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.similar-section h4 { margin-bottom: 8px; font-size: 14px; }
.similar-list { display: flex; flex-direction: column; gap: 6px; }

.edit-modal { max-width: 880px; }
.edit-group h4 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.edit-item { display: flex; align-items: center; gap: 8px; }
.edit-item span { flex: 0 0 130px; font-size: 13px; color: #666; text-align: right; }
.edit-item input, .edit-item select, .edit-item textarea {
  flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; background: var(--card);
}
.edit-item textarea { resize: vertical; }
.edit-more { margin-top: 14px; }
.edit-more summary { cursor: pointer; color: var(--primary); font-size: 13px; }

.user-edit-modal { max-width: 480px; }
.ue-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.ue-row > span { flex: 0 0 130px; color: var(--muted); text-align: right; }
.ue-row input[type="number"], .ue-row input[type="password"], .ue-row select {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--card);
}
.ue-row .chk { display: flex; align-items: center; gap: 6px; }
.ue-row b { font-size: 14px; }

.report-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.report-section h4 { margin-bottom: 8px; font-size: 14px; }
.report-upload { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.report-files { display: flex; flex-direction: column; gap: 6px; }
.report-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.report-item .r-icon { font-size: 15px; }
.report-item .r-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-item .r-meta { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.report-item .r-ops { display: flex; gap: 6px; }

.report-import { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.report-import h4 { margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.report-import .tip { font-size: 12px; color: var(--muted); line-height: 1.6; }
.report-import input[type="file"] { margin: 8px 0; }
.report-import #report-import-result { margin-top: 8px; font-size: 12px; }
.report-import .ok { color: #16a34a; }
.report-import .err { color: #dc2626; }
.similar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.similar-item:hover { border-color: var(--primary); }
.similar-item .s-name { flex: 1; margin-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.similar-item .s-price { color: #dc2626; font-weight: 600; white-space: nowrap; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; max-height: none; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ---------------- 勾选导出 / 库存 / 用户 ---------------- */
.card { position: relative; }
.sel-box {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.sel-box:hover { border-color: var(--primary); }
.sel-box input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }
.card .card-head { padding-right: 30px; }
.stock-tag {
  font-size: 11px;
  color: #166534;
  background: #dcfce7;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}
.status-badge {
  display: inline-block;
  font-size: 12px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.status-badge.danger {
  color: #dc2626;
  background: #fee2e2;
  font-weight: 700;
  border: 1px solid #fca5a5;
}
.user-box { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }
.user-box #cur-user { font-size: 13px; color: var(--muted); }
.field-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 14px;
  max-height: 46vh;
  overflow: auto;
  padding: 4px;
}
.field-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.field-item:hover { background: #f1f5f9; }
.field-item input { accent-color: var(--primary); }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.export-modal { max-width: 860px; width: 90%; }
@media (max-width: 900px) { .field-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- 购物车 ---------------- */
.cart-btn { position: relative; }
.cart-badge {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  background: #fff;
  color: var(--primary);
  border-radius: 9px;
  margin-left: 6px;
  padding: 0 5px;
  font-weight: 700;
  font-size: 12px;
  line-height: 17px;
}
.cart-modal { max-width: 720px; }
.cart-list { max-height: 46vh; overflow-y: auto; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
}
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}
.cart-item-sub {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.cart-item p { margin: 0; }
.cart-item-prices { display: flex; gap: 12px; font-size: 13px; white-space: nowrap; }
.cart-item-prices .cart-p { color: #555; }
.cart-item-prices .cart-p.jd { color: #2563eb; }
.cart-rm { padding: 2px 10px; font-size: 12px; }
.cart-empty, .cart-loading { text-align: center; color: var(--muted); padding: 28px 0; }
.btn.added { background: #e8f5e9; color: #2e7d32; border-color: #84c98b; }

/* 供应商表移到图片下方后的小标题 */
.sp-sub { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 8px; }
.supplier-section { margin: 6px 0 14px; }

/* ================= 移动端响应式 ================= */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .search-box { order: 3; flex-basis: 100%; }
  .top-actions { gap: 8px; flex-wrap: wrap; }
  .stat { display: none; }
  .layout { padding: 10px 12px; }
  .modal { width: 96%; margin: 2% auto; max-height: 92vh; }
  .edit-modal { width: 96%; }
  .cards { grid-template-columns: 1fr; }
  .detail-img-section .img-sec-head { flex-wrap: wrap; }
  .sp-table-wrap { max-width: 100%; }
  .user-table-wrap { overflow-x: auto; }
}
@media (max-width: 600px) {
  .btn { padding: 8px 12px; font-size: 13px; }
  .logo { font-size: 17px; }
  .search-box input { font-size: 16px; padding: 9px 12px; }
  .card .thumb img { width: 60px; height: 60px; }
  .detail-item .k { width: 100px; }
  .detail-item { flex-direction: column; gap: 2px; }
  .detail-item .k { width: auto; }
  .edit-grid, .detail-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 12px 14px; }
  .pager button { padding: 7px 10px; font-size: 12px; }
  .cart-btn .cart-badge { font-size: 11px; }
  .similar-item { font-size: 13px; }
}
