/* ============================================================
   米优 · 商品选择器（客户认图不认号，系统记货号）
   独立浮层组件样式：全部写死浅色，不依赖宿主任何 CSS 变量，
   三档皮肤（含 smart 深色）下都成立。
   所有类名带 mpp- 前缀，绝不影响宿主页面既有样式。
   ------------------------------------------------------------
   视觉体系（与主界面统一）：
   墨石强调 #2F3A46 · 文字 #1C1C1A/#6E6E68/#9C9C94 · 浅灰 #F4F4F1
   字号 12/13/15/18（货号/徽章类微标 11）· 动效 150ms ease-out
   ============================================================ */

body.mpp-lock { overflow: hidden !important; }

/* ---- 全屏遮罩 ---- */
.mpp-mask {
  position: fixed;
  inset: 0;
  z-index: 320; /* 高于宿主进门浮层(200) */
  background: rgba(20, 20, 18, .6); /* 不支持毛玻璃时的兜底：加深一档 */
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 20px;
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .mpp-mask {
    background: rgba(20, 20, 18, .45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}
@media (max-width: 720px) {
  .mpp-mask { padding: 10px; }
}

/* ---- 主面板：写死浅色底 ---- */
.mpp-panel {
  position: relative;
  width: 100%;
  max-width: 1180px;
  background: #ffffff;
  color: #1C1C1A;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ---- 顶部：标题 + 大搜索 + 关闭 ---- */
.mpp-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 14px;
  border-bottom: 0;
  background: #ffffff;
  flex-wrap: wrap;
}
.mpp-title {
  font-size: 18px;
  font-weight: 600;
  color: #1C1C1A;
  white-space: nowrap;
  letter-spacing: .2px;
}
.mpp-title small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #9C9C94;
  margin-top: 3px;
  letter-spacing: 0;
}
.mpp-search {
  flex: 1 1 300px;
  min-width: 220px;
}
.mpp-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 16px 0 40px;
  font-size: 15px;
  outline: none;
  background-color: #F4F4F1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%239C9C94' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.6 10.6L14 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  color: #1C1C1A;
  box-sizing: border-box;
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.mpp-search input:focus {
  border-color: #2F3A46;
  background-color: #ffffff;
  box-shadow: none;
}
.mpp-search input::placeholder { color: #9C9C94; }
.mpp-close {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6E6E68;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.mpp-close:hover { background: #F4F4F1; color: #1C1C1A; }

/* ---- 分区标签行 + 新建货号入口 ---- */
.mpp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 24px 14px;
  border-bottom: 1px solid #F0F0EC;
  background: #ffffff;
  flex-wrap: wrap;
}
.mpp-tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mpp-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6E6E68;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.mpp-tabs button:hover { color: #1C1C1A; }
.mpp-tabs button.on {
  background: #2F3A46;
  border: 0;
  color: #ffffff;
  font-weight: 600;
}
.mpp-new { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mpp-new-market {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #2F3A46;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease-out;
}
.mpp-new-market:hover { background: #3B4855; filter: none; }
.mpp-new-link {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #F4F4F1;
  color: #1C1C1A;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease-out;
}
.mpp-new-link:hover { background: #ECECE8; filter: none; }
.mpp-new-manual {
  font-size: 12px;
  color: #6E6E68;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color .15s ease-out;
}
.mpp-new-manual:hover { color: #1C1C1A; }

/* ---- 主体滚动区 ---- */
.mpp-body {
  flex: 1;
  overflow-y: auto;
  background: #F7F7F5;
  padding: 20px 24px 24px;
}
.mpp-body::-webkit-scrollbar { width: 8px; }
.mpp-body::-webkit-scrollbar-thumb { background: #D9D9D2; border-radius: 4px; }
.mpp-body::-webkit-scrollbar-track { background: transparent; }

/* .mpp-pending-note 已随「缺料提示行撤出前台」删除(BOSS 0811:前台不跟用户讲补采) */

/* ---- 商品卡片网格 ---- */
.mpp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
.mpp-card {
  position: relative;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.mpp-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .09);
  border-color: transparent;
}
.mpp-card.mpp-cur {
  border-color: transparent;
  box-shadow: 0 0 0 1.5px #2F3A46, 0 1px 2px rgba(0, 0, 0, .04);
}
.mpp-card.mpp-cur:hover {
  box-shadow: 0 0 0 1.5px #2F3A46, 0 6px 16px rgba(0, 0, 0, .09);
}
.mpp-curtag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 8px;
  height: 8px;
  background: #2F3A46;
  color: transparent;
  font-size: 0;
  line-height: 0;
  font-weight: 400;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 0 0 2px #ffffff;
}
.mpp-thumb {
  width: calc(100% - 12px);
  margin: 6px 6px 0;
  aspect-ratio: 1 / 1;
  background-color: #F4F4F1;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  position: relative;
}
.mpp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mpp-thumb.mpp-thumb-ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23C9C9C1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='1.8'/%3E%3Cpath d='M21 15l-4.5-4.5L7 20'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  opacity: 1;
  font-size: 0;
}
.mpp-card-meta { padding: 10px 12px 12px; }
.mpp-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #1C1C1A;
  line-height: 1.4;
  max-height: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}
.mpp-card-code {
  font-size: 11px;
  color: #9C9C94;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 进度徽章（诚实推，不瞎标已完成）：小圆点 + 灰字 ---- */
.mpp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 0;
  padding: 0;
  white-space: nowrap;
  color: #6E6E68;
  background: transparent;
}
.mpp-badge::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9C9C94;
}
.mpp-badge-gray   { background: transparent; color: #6E6E68; }
.mpp-badge-gray::before   { background: #9C9C94; }
.mpp-badge-blue   { background: transparent; color: #6E6E68; }
.mpp-badge-blue::before   { background: #4A6FA5; }
.mpp-badge-orange { background: transparent; color: #6E6E68; }
.mpp-badge-orange::before { background: #B7791F; }
.mpp-badge-green  { background: transparent; color: #6E6E68; }
.mpp-badge-green::before  { background: #3C7A5A; }

/* ---- 「再看60件」---- */
.mpp-more-row { text-align: center; padding: 18px 0 4px; }
.mpp-more-row button {
  min-height: 40px;
  padding: 0 26px;
  border: 0;
  border-radius: 10px;
  background: #F4F4F1;
  color: #1C1C1A;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease-out;
}
.mpp-more-row button:hover { background: #ECECE8; border-color: transparent; }

/* ---- 空态 / 加载态 / 失败态 ---- */
.mpp-state {
  text-align: center;
  color: #6E6E68;
  font-size: 13px;
  line-height: 1.9;
  padding: 64px 20px;
}
.mpp-state .mpp-state-icon {
  /* JS 会塞 emoji 文本进来：藏掉文字，换成线性 SVG 图标 */
  font-size: 0;
  line-height: 0;
  color: transparent;
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23C9C9C1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8l2-4h12l2 4'/%3E%3Cpath d='M4 8h16v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1z'/%3E%3Cpath d='M4 12h5a3 3 0 0 0 6 0h5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.mpp-state button {
  margin-top: 14px;
  min-height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: #F4F4F1;
  color: #1C1C1A;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease-out;
}
.mpp-state button:hover { background: #ECECE8; }

/* ---- 采集库选品视图 ---- */
.mpp-market-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mpp-market-head button {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #6E6E68;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: background .15s ease-out, color .15s ease-out;
}
.mpp-market-head button:hover { background: #F4F4F1; color: #1C1C1A; }
.mpp-market-head input {
  flex: 1 1 240px;
  min-width: 180px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-size: 13px;
  outline: none;
  background-color: #F4F4F1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%239C9C94' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.6 10.6L14 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  color: #1C1C1A;
  box-sizing: border-box;
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.mpp-market-head input:focus {
  border-color: #2F3A46;
  background-color: #ffffff;
  box-shadow: none;
}
.mpp-market-head input::placeholder { color: #9C9C94; }
.mpp-market-count { font-size: 12px; color: #9C9C94; white-space: nowrap; }
.mpp-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
.mpp-mcard {
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.mpp-mcard:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .09);
  border-color: transparent;
}
.mpp-mcard-meta { padding: 10px 12px 12px; }
.mpp-mcard-name {
  font-size: 13px;
  font-weight: 500;
  color: #1C1C1A;
  line-height: 1.4;
  max-height: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}
.mpp-mcard-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-top: 5px;
  font-size: 11px;
}
.mpp-mcard-cat { color: #9C9C94; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpp-mcard-price { color: #1C1C1A; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mpp-market-tip {
  margin-bottom: 14px;
  border: 0;
  background: #EFEFEA;
  color: #6E6E68;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.6;
}

/* ---- 小对话框（确认开工 / 贴链接 / 手动起号）---- */
.mpp-dialog-mask {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(20, 20, 18, .4);
  display: grid;
  place-items: center;
  padding: 20px;
}
.mpp-dialog {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  color: #1C1C1A;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .16);
  padding: 24px 24px 20px;
  max-height: calc(100% - 20px);
  overflow-y: auto;
}
.mpp-dialog h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: #1C1C1A; }
.mpp-dialog .mpp-dlg-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: #6E6E68;
  line-height: 1.7;
}
.mpp-dlg-goods {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  background: #F7F7F5;
  padding: 10px;
  margin-bottom: 12px;
}
.mpp-dlg-goods .mpp-thumb {
  width: 84px;
  height: 84px;
  aspect-ratio: auto;
  flex: none;
  margin: 0;
  border-radius: 10px;
}
.mpp-dlg-goods-name {
  font-size: 13px;
  font-weight: 500;
  color: #1C1C1A;
  line-height: 1.5;
  max-height: 4.5em;
  overflow: hidden;
  word-break: break-all;
}
.mpp-dlg-code {
  text-align: center;
  background: #F4F4F1;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.mpp-dlg-code b {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #2F3A46;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.mpp-dlg-code span { font-size: 12px; color: #9C9C94; }
/* 详情做不做：手动/自动二选一（BOSS-715-002） */
.mpp-detail-mode {
  background: #F4F4F1;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.mpp-detail-mode .mpp-dm-title {
  font-size: 12px;
  color: #6E6E68;
  margin-bottom: 8px;
}
.mpp-detail-mode .mpp-dm-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 13px;
  color: #2F3A46;
  cursor: pointer;
}
.mpp-detail-mode .mpp-dm-opt b { font-weight: 600; }
.mpp-detail-mode .mpp-dm-opt input[type="radio"] {
  width: 16px;
  min-height: 0;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  flex: 0 0 auto;
  cursor: pointer;
}
.mpp-dlg-hint {
  font-size: 12px;
  color: #6E6E68;
  background: #F4F4F1;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.mpp-dialog input {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
  background: #F4F4F1;
  color: #1C1C1A;
  box-sizing: border-box;
  margin-bottom: 10px;
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.mpp-dialog input:focus {
  border-color: #2F3A46;
  background: #ffffff;
  box-shadow: none;
}
.mpp-dialog input::placeholder { color: #9C9C94; }
.mpp-dlg-primary {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: #2F3A46;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease-out;
}
.mpp-dlg-primary:hover { background: #3B4855; }
.mpp-dlg-primary:active { transform: translateY(1px); }
.mpp-dlg-ghost {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: #F4F4F1;
  color: #6E6E68;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.mpp-dlg-ghost:hover { background: #ECECE8; color: #1C1C1A; }
.mpp-dlg-err {
  font-size: 12px;
  color: #A03A32;
  background: #F9F0EE;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* smart 深色档下浮层依旧成立：面板颜色全部写死浅色，无需变量。
   这里只把遮罩加深一档，让浮层在深色壳上更聚焦。 */
body[data-tier="smart"] .mpp-mask { background: rgba(10, 10, 8, .72); }
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  body[data-tier="smart"] .mpp-mask { background: rgba(10, 10, 8, .58); }
}
