/* ============================================================
   vendor-dash.css — 品控厂商仪表盘专属组件（my.html / qc.html）
   作用：
   1) 厂商「经营概览」hero（品牌身份 + 4 统计瓦片）
   2) 管理卡标题右侧计数 pill（at-a-glance 层级）
   3) 收编 vendor.js 内旧浅色子组件为深色 token 类：
      .opt-cat-card / .opt-cat-h / .opt-tbl / .spec-confirm / .switch
   加载顺序：必须在 card.css 之后，确保统一覆盖生效。
   ============================================================ */
:root{
  --vd-stat-num: 22px;
}

/* ---------- 1) 经营概览 hero ---------- */
.vendor-hero{
  background: linear-gradient(135deg, rgba(139,124,246,.12), rgba(34,211,238,.05));
  border-color: rgba(139,124,246,.35) !important;
  padding: 18px 16px !important;
}
.vendor-hero-id{
  display: flex;
  align-items: center;
  gap: 14px;
}
.vendor-hero-ava{
  width: var(--logo-md); height: var(--logo-md);
  border-radius: 16px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: var(--glow);
  flex-shrink: 0;
  overflow: hidden;
}
.vendor-hero-ava img{ width: 100%; height: 100%; object-fit: contain; background:#fff; }
.vendor-hero-name{
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  letter-spacing: .3px;
}
.vendor-hero-sub{
  display: flex;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.vendor-stats{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.vstat{
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  transition: border-color .2s ease, transform .2s ease;
}
.vstat:hover{ border-color: var(--primary-light); transform: translateY(-2px); }
.vstat-num{
  font-size: var(--vd-stat-num);
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1.1;
}
.vstat-lbl{
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 5px;
}
@media (max-width: 380px){
  .vendor-stats{ grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 2) 卡片标题右侧计数 pill ---------- */
.material-title .pill{ margin-left: auto; }

/* ---------- 3a) 选配类目卡（深色化，覆盖旧浅色内联） ---------- */
.opt-cat-card{
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
  overflow: hidden !important;
}
.opt-cat-h{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(139,124,246,.10) !important;
  border-bottom: 1px solid var(--border) !important;
}
.opt-cat-ic{ font-size: 18px; }
.opt-cat-name{ font-weight: 700; font-size: 14px; color: var(--text); }
.opt-cat-cnt{ font-size: 11px; color: var(--text-secondary); margin-left: 6px; }
.opt-cat-sw{ margin-left: 8px; }
.opt-tbl{ width: 100%; border-collapse: collapse; }
.opt-tbl tr{ border-top: 1px solid rgba(255,255,255,.06); }
.opt-tbl tr:first-child{ border-top: none; }
.opt-tbl td{ padding: 6px 8px; color: var(--text-secondary); vertical-align: middle; }
.opt-tbl tr.opt-off{ opacity: .5; }
.opt-tbl input{
  background: #0F0F16 !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  color: var(--text) !important;
  font-family: inherit;
}

/* ---------- 3b) 井道确认框（深色化） ---------- */
.spec-confirm{
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface-2) !important;
  border-radius: 10px;
  border-left: 3px solid var(--primary) !important;
}
.spec-confirm .sc-t{
  font-size: 11px; font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 4px;
}
.spec-confirm .sc-line{ font-size: 11px; color: var(--text-secondary); line-height: 1.6; }
.spec-confirm .sc-note{ font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.spec-confirm .sc-ok{ font-size: 11px; color: var(--success); margin-top: 2px; }
.spec-confirm.is-approved{ border-left-color: var(--success) !important; }

/* ---------- 3c) 开关（从 vendor.js 注入移入，深色化） ---------- */
.switch{ position: relative; display: inline-block; width: 34px; height: 18px; }
.switch input{ opacity: 0; width: 0; height: 0; }
.switch span{
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,.18);
  border-radius: 18px; transition: .2s;
}
.switch span:before{
  content: ''; position: absolute; height: 14px; width: 14px;
  left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + span{ background: var(--success); }
.switch input:checked + span:before{ transform: translateX(16px); }
