/* 星标 ERP · 业务布局与原有组件。公共设计令牌和组件规范见 workspace.css。 */

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(20, 118, 108, 0.07), rgba(246, 247, 243, 0) 380px),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page-glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(20, 118, 108, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
  opacity: 0.55;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fill-icon { fill: currentColor; stroke: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ============ Sidebar ============ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(249, 250, 246, 0.92);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.sidebar-brand { padding: 4px 4px 14px; border-bottom: 1px solid var(--line); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1a8d80, var(--teal) 55%, var(--teal-deep));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(20, 118, 108, 0.28);
}
.brand-text strong { display: block; font-size: 15px; letter-spacing: 0.06em; }
.brand-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.brand-mark.logo { padding: 0; background: none; box-shadow: none; overflow: hidden; }
.brand-mark.logo svg { display: block; width: 100%; height: 100%; }
.brand-text .brand-name { font-size: 18px; letter-spacing: 0.14em; }
.brand-text .brand-sub { font-size: 10px; letter-spacing: 0.02em; }

.nav { display: grid; gap: 4px; }
.nav-label { padding: 10px 6px 4px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: #eef2ec; color: var(--text); transform: translateX(2px); }
.nav-item.active {
  border-color: rgba(20, 118, 108, 0.18);
  background: var(--teal-soft);
  color: var(--teal);
}
.nav-tag {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.side-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(20, 118, 108, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--teal-soft), #f7faf6 70%);
}
.side-card-title { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.side-card-value { margin-top: 6px; color: var(--teal-deep); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.side-card-note { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.side-foot { display: flex; align-items: center; gap: 7px; padding: 0 4px; color: var(--faint); font-size: 11px; font-weight: 600; }
.dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ============ Layout ============ */
.main {
  position: relative;
  z-index: 1;
  margin-left: 236px;
  width: calc(100% - 236px);
  max-width: 1440px;
  padding: 18px 26px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.crumb { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.crumb strong { color: var(--text); font-size: 13px; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.clock {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.view { animation: fadeUp 320ms ease both; }

/* 企业授权状态页：沿用企业资料的字段布局。 */
#view-license .company-fields { margin: 0 20px; }
#view-license .company-field { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
#view-license .company-field dt { color: var(--muted); font-size: 12px; }
#view-license .company-field dd { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 480px) { #view-license .company-field { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Buttons ============ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.button svg { width: 15px; height: 15px; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: none; }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.button.primary {
  background: linear-gradient(140deg, #1a8d80, var(--teal) 65%, var(--teal-deep));
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 118, 108, 0.24);
}
.button.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: var(--teal); color: var(--teal); }
.button.ghost { background: #edf2ed; color: var(--text); }
.button.danger { background: var(--red); color: #fff; }
.button.sm { min-height: 32px; padding: 6px 11px; font-size: 12px; border-radius: 6px; }
.button.big { min-height: 42px; padding: 10px 24px; }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px; font-weight: 700;
}
.ghost-btn:hover { border-color: var(--teal); color: var(--teal); }
.ghost-btn svg { width: 14px; height: 14px; }
.ghost-btn.sm { min-height: 30px; padding: 5px 10px; }
.ghost-btn.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.ghost-btn.danger:hover { border-color: #8f2e2e; background: #8f2e2e; color: #fff; }
.ghost-btn.success {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.ghost-btn.success:hover { border-color: #246035; background: #246035; color: #fff; }

.mini-btn {
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.mini-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

/* ============ Hero ============ */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 28px;
  padding: 30px 30px 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(102, 126, 234, 0.16), transparent 52%),
    radial-gradient(120% 130% at 0% 100%, rgba(20, 118, 108, 0.2), transparent 55%),
    linear-gradient(135deg, #ffffff, #f4faf7 55%, #eef1fd);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -90px; top: -110px;
  width: 340px; height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(20, 118, 108, 0.16);
  box-shadow: inset 0 0 60px rgba(20, 118, 108, 0.08);
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.grad {
  background: linear-gradient(100deg, var(--teal) 10%, #3b8f8a 40%, var(--violet) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.hero-meta b { display: block; margin-bottom: 2px; color: var(--text); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }

.hero-side { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; align-items: flex-end; z-index: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(20, 118, 108, 0.2);
  border-radius: 999px;
  background: rgba(230, 243, 240, 0.75);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pill.violet { border-color: rgba(102, 126, 234, 0.26); background: var(--violet-soft); color: #4b5fd0; }

.range-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}
.range-tabs button {
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: all 140ms ease;
}
.range-tabs button.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }

.hero-badge {
  width: 100%;
  max-width: 240px;
  padding: 16px 18px;
  border: 1px solid rgba(20, 118, 108, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  text-align: right;
}
.hero-badge small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.hero-badge strong { display: block; margin-top: 6px; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal-deep); }
.delta { display: inline-flex; margin-top: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.delta.flat { background: #eef1ec; color: var(--muted); }

/* ============ KPI ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.kpi-card {
  position: relative;
  padding: 16px 18px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23, 33, 27, 0.09); }
.kpi-card::before {
  content: "";
  position: absolute; inset: 0 auto auto 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--teal), rgba(20, 118, 108, 0));
}
.kpi-card.violet::before { background: linear-gradient(90deg, var(--violet), rgba(102, 126, 234, 0)); }
.kpi-card.amber::before { background: linear-gradient(90deg, var(--amber), rgba(182, 109, 18, 0)); }
.kpi-card.blue::before { background: linear-gradient(90deg, var(--blue), rgba(63, 111, 155, 0)); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.kpi-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--teal-soft); color: var(--teal); }
.kpi-card.violet .kpi-icon { background: var(--violet-soft); color: #4b5fd0; }
.kpi-card.amber .kpi-icon { background: var(--amber-soft); color: var(--amber); }
.kpi-card.blue .kpi-icon { background: var(--blue-soft); color: var(--blue); }
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value { margin-top: 10px; font-size: 27px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--faint); font-size: 11px; }
.kpi-foot .delta { margin: 0; }

/* ============ Cards / grids ============ */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid-bid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }

.card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 18px;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.chip { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ============ Trend chart ============ */
.chart-wrap { position: relative; min-height: 218px; }
.chart-wrap svg { width: 100%; height: 218px; overflow: visible; }
.chart-grid-line { stroke: #e8ece6; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-axis-label { fill: var(--faint); font-size: 10px; font-weight: 600; }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaFill); stroke: none; }
.chart-dot { fill: #fff; stroke: var(--teal); stroke-width: 2; }
.chart-bar { fill: #e2efe9; }

/* ============ Store list ============ */
.store-list { display: grid; gap: 9px; }
.store-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  transition: border-color 150ms ease, background 150ms ease;
}
.store-item:hover { border-color: var(--line-strong); background: #fff; }
.store-item.off { opacity: 0.62; }
.store-main { min-width: 0; flex: 1; }
.store-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; }
.store-sub { margin-top: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.store-bar { position: relative; height: 4px; margin-top: 8px; border-radius: 999px; background: #e9eee7; overflow: hidden; }
.store-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #4ea79c); }

/* 顶部全局店铺维度 */
.store-scope {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.store-scope-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.store-scope-label svg { width: 14px; height: 14px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.store-scope .select { min-width: 186px; padding: 6px 8px; border: 0; background: transparent; }
.store-scope .select:focus { border: 0; box-shadow: none; }
.store-scope .select:disabled { color: var(--faint); }

/* 非品牌筛选 */
.filter-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(20, 118, 108, 0.22);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 11px; font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.filter-check input { margin: 0; accent-color: var(--teal); width: 14px; height: 14px; cursor: pointer; }
.filter-check.active {
  background: var(--teal);
  border-color: var(--teal-deep);
  color: #fff;
}
.filter-check.active input { accent-color: #fff; }
.filter-check em { padding: 1px 6px; border-radius: 999px; background: #fff; color: var(--teal); font-style: normal; font-size: 10px; font-weight: 800; }

/* ============ AI 流水线 ============ */
.pipeline { display: grid; gap: 10px; }
.pipeline-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pipeline-top strong { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pipeline-progress { height: 6px; margin: 4px 0 12px; border-radius: 999px; background: #e9eee7; overflow: hidden; }
.pipeline-progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--violet)); transition: width 320ms ease; }
.pipeline-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.pipeline-head { display: flex; align-items: center; gap: 10px; }
.pipeline-title { flex: 1; min-width: 0; }
.pipeline-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
.pipeline-title span { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
.pipeline-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 9px; }
.pipeline-step {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--faint);
  font-size: 10px; font-weight: 700;
  white-space: nowrap;
}
.pipeline-step.done { border-color: rgba(20, 118, 108, 0.25); background: var(--teal-soft); color: var(--teal-deep); }
.pipeline-step.active { border-color: rgba(102, 126, 234, 0.4); background: var(--violet-soft); color: #4b5fd0; }
.pipeline-note { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.pipeline-note b { color: var(--teal-deep); }

.required { color: var(--red); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; letter-spacing: 0.02em; }
.api-key { color: var(--muted); }
.store-rev { text-align: right; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.store-rev small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; font-weight: 600; }

.switch {
  position: relative;
  width: 44px; height: 24px;
  border: 0; border-radius: 999px;
  background: #cfd7ce;
  transition: background 160ms ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease;
}
.switch.on { background: var(--teal); }
.switch.on::after { transform: translateX(20px); }
.switch-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }

/* ============ Rank / timeline ============ */
.rank-list { display: grid; gap: 8px; }
.rank-item { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 7px; transition: background 140ms ease; }
.rank-item:hover { background: var(--surface-soft); }
.rank-no { width: 18px; color: var(--faint); font-size: 12px; font-weight: 800; text-align: center; }
.rank-no.top { color: var(--teal); }
.thumb {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(140deg, #e6f3f0, #eef0fe);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-meta { min-width: 0; flex: 1; }
.rank-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.rank-sub { margin-top: 3px; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.rank-value { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.timeline { display: grid; gap: 2px; max-height: 366px; overflow: auto; padding-right: 2px; }
.timeline.compact { max-height: 520px; }
.tl-item { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 7px 0; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 22px; bottom: -6px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.tl-dot.violet { background: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.tl-dot.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.tl-dot.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.tl-body { min-width: 0; }
.tl-title { font-size: 12px; font-weight: 700; line-height: 1.45; }
.tl-sub { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.tl-time { margin-top: 3px; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }

/* ============ Section head / stepper ============ */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.section-head h2 { margin: 0; font-size: 24px; line-height: 1.4; font-weight: 700; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.stepper { display: flex; align-items: center; gap: 8px; }
.step { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 12px; font-weight: 800; }
.step i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #eaeee8; color: var(--faint); font-size: 11px; font-style: normal; }
.step.active { color: var(--teal-deep); }
.step.active i { background: var(--teal); color: #fff; }
.step-line { width: 26px; height: 1px; background: var(--line-strong); }

/* ============ Search ============ */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.search-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search-input-wrap svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); }
.search-input-wrap input {
  width: 100%;
  padding: 11px 12px 11px 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.search-input-wrap input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(20, 118, 108, 0.1); }
.search-input-wrap input::placeholder { color: var(--faint); }

.select {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  outline: none;
}
.select:focus { border-color: var(--teal); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 2px 14px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.tick { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; }
.tick::before { content: "✓"; color: var(--teal); font-weight: 800; }
.muted { color: var(--muted); font-size: 12px; }

/* ============ Product grid ============ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 13px; }
.product-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(23, 33, 27, 0.12); border-color: rgba(20, 118, 108, 0.35); }
.p-cover { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(145deg, #f1f5ef, #e8edf7); overflow: hidden; }
.p-cover img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.p-cover .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: rgba(20, 118, 108, 0.4); letter-spacing: 0.08em; }
.p-cover-link { display: block; position: relative; width: 100%; height: 100%; cursor: pointer; }
.p-cover-jump {
  position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(8, 13, 23, 0.78); color: #8df5e8;
  font-size: 11px; font-weight: 800; opacity: 0; transition: opacity 0.15s ease;
}
.p-cover-link:hover .p-cover-jump { opacity: 1; }
.takealot-jump {
  align-self: flex-start; color: var(--teal);
  font-size: 10px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.takealot-jump:hover { text-decoration: underline; }
.source-compare-meta .takealot-jump { display: inline-flex; margin-top: 6px; }
.p-brand { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); color: var(--teal-deep); font-size: 10px; font-weight: 800; }
.p-rating { position: absolute; right: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(17, 24, 20, 0.82); color: #fff; font-size: 10px; font-weight: 800; }
.p-body { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px 12px; flex: 1; }
.p-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; font-size: 12px; font-weight: 700; line-height: 1.42; }
.p-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.p-price { color: var(--teal-deep); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.p-price small { margin-right: 2px; color: var(--faint); font-size: 10px; font-weight: 700; }
.p-cat { color: var(--faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 2px; }
.p-actions .button { width: 100%; min-height: 32px; padding: 6px 8px; font-size: 11px; }
.load-more-wrap { display: flex; justify-content: center; padding: 18px 0 4px; }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid #eef1ec; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 130ms ease; }
.data-table tbody tr:hover { background: #fafcf9; }
.data-table .num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cell-product { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.cell-product .thumb { width: 34px; height: 34px; font-size: 11px; }
.cell-title { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cell-sub { margin-top: 2px; color: var(--faint); font-size: 10px; }
.col-check { width: 34px; }
.col-check input { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.table-empty { padding: 26px 10px; color: var(--faint); font-size: 12px; text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #eef1ec; color: var(--muted); }
.badge.violet { background: var(--violet-soft); color: #4b5fd0; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn { padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--teal); font-size: 11px; font-weight: 800; }
.link-btn:hover { background: var(--teal-soft); }
.link-btn.red { color: var(--red); }
.link-btn.red:hover { background: var(--red-soft); }

.status-select { padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 11px; font-weight: 700; }

/* ============ Bidding ============ */
.rule-strip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.rule { padding: 13px 16px; border-right: 1px solid var(--line); }
.rule:last-child { border-right: 0; }
.rule b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal-deep); }
.rule span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }

/* ============ 自动跟价（参考 price_monitor 页面） ============ */
.seg-tabs {
  display: inline-flex;
  gap: 2px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #ecefe9;
}
.seg-tabs button {
  padding: 8px 22px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}
.seg-tabs button:hover:not(.active) { color: var(--text); }
.seg-tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
#bidTabLogs, #sourcingTabPick { margin-top: 16px; }

.bid-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.bid-kpi {
  padding: 15px 17px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bid-kpi-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; }
.bid-kpi-value { margin-top: 8px; color: var(--teal-deep); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bid-kpi-note { margin-top: 4px; color: var(--faint); font-size: 10px; }

.bid-switch-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 16px; padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bid-switch-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bid-switch-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.bid-switch-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bid-switch-copy { min-width: 0; }
.bid-switch-head { display: flex; align-items: center; gap: 8px; }
.bid-switch-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.bid-switch-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.bid-switch-card .switch-line { flex: none; }

.bid-config-card { margin-top: 14px; }
.bid-config-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bid-config-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.bid-config-control { display: flex; align-items: center; gap: 6px; }
.bid-config-control input {
  width: 92px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--surface-soft);
  font-size: 13px; font-weight: 700; outline: none;
}
.bid-config-control input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(20, 118, 108, 0.1); }
.bid-config-control .unit { color: var(--muted); font-size: 12px; font-weight: 700; }

.bid-rule-box {
  margin-top: 12px; padding: 11px 14px;
  border: 1px solid rgba(63, 111, 155, 0.2);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
  background: var(--blue-soft);
  color: #2c526f;
  font-size: 12px;
  line-height: 1.65;
}
.bid-rule-box b { color: var(--blue); }

.bid-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 2px 14px; }
.bid-toolbar-left, .bid-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bid-search { width: 220px; }
.bid-search input { width: 100%; }
.bid-filter-group {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.bid-filter-label { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.bid-filter-divider { width: 1px; height: 18px; background: var(--line); margin: 0 2px; flex: none; }
.bid-filter-select {
  min-width: 74px;
  padding: 8px 10px;
  border-color: var(--line);
  border-radius: 6px;
  font-size: 11px;
}

.bid-table td { white-space: nowrap; }
.bid-table .cell-title { max-width: 260px; white-space: normal; }
.cell-sub.red { color: var(--red); }

.floor-edit { display: flex; align-items: center; gap: 4px; }
.floor-edit input {
  width: 86px; padding: 5px 8px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface-soft);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none;
}
.floor-edit input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(20, 118, 108, 0.1); }

/* ============ 调价历史 ============ */
.bid-history-card { margin-top: 16px; padding-bottom: 14px; }
.bid-history-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.bid-history-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bid-log-search { width: 280px; }
.bid-log-search input { width: 100%; }
.bid-filter-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: #ecefe9; }
.bid-filter-tabs button {
  padding: 6px 14px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.bid-filter-tabs button:hover:not(.active) { color: var(--text); }
.bid-filter-tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.bid-log-size { min-height: 32px; padding: 6px 8px; font-size: 12px; }
.bid-history-total { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.bid-history-total b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }

.bid-history-table { min-width: 780px; }
.bid-history-table th { padding: 11px 10px; }
.bid-history-table td { padding: 12px 10px; }
.bid-log-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.bid-log-product { min-width: 230px; }
.bid-log-product .thumb { width: 38px; height: 38px; border-radius: 8px; flex: none; }
.bid-log-product-main { min-width: 0; }
.bid-log-product .cell-title { max-width: 250px; }

.price-change { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-arrow { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 50%; }
.price-arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.price-arrow.down { background: var(--green-soft); color: var(--green); }
.price-arrow.up { background: var(--red-soft); color: var(--red); }
.price-arrow.flat { background: #eef1ec; color: var(--faint); }
.price-old { color: var(--faint); font-size: 11px; text-decoration: line-through; }
.price-new { font-size: 14px; font-weight: 800; }
.price-new.down { color: var(--green); }
.price-new.up { color: var(--red); }
.price-delta { padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.price-delta.down { background: var(--green-soft); color: var(--green); }
.price-delta.up { background: var(--red-soft); color: var(--red); }
.price-delta.flat { background: #eef1ec; color: var(--muted); }

.bid-reason { max-width: 310px; color: var(--text); font-size: 12px; line-height: 1.5; white-space: normal; }
.bid-reason-sub { margin-top: 3px; color: var(--faint); font-size: 10px; }

.bid-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 2px; padding-top: 14px;
  border-top: 1px solid #eef1ec;
}
.bid-pagination-range { color: var(--muted); font-size: 11px; font-weight: 700; }
.bid-page-controls { display: flex; align-items: center; gap: 10px; }
.bid-page-controls span { color: var(--muted); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ============ Forms / modal ============ */
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.form-row > .field { min-width: 0; }
.field { display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea { resize: vertical; min-height: 62px; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(20, 118, 108, 0.1); }
.field-hint { color: var(--faint); font-size: 10px; }

.modal-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 20, 0.16);
  z-index: 100;
}
.modal {
  width: min(720px, 100%);
  max-height: 86vh;
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(17, 24, 20, 0.28);
  animation: modalIn 200ms ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.modal-close {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}
.modal-close:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.modal-body { padding: 16px 18px 20px; overflow: auto; }

.confirm-dialog { display: flex; align-items: flex-start; gap: 13px; }
.confirm-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(178, 58, 58, 0.18);
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 18px; font-weight: 800;
}
.confirm-copy { min-width: 0; }
.confirm-copy p { margin: 2px 0 0; color: var(--text); font-size: 13.5px; font-weight: 700; line-height: 1.5; }
.confirm-copy span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.source-list { display: grid; gap: 9px; }
.source-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); align-items: center; }
.source-item:hover { border-color: var(--line-strong); background: #fff; }
.source-item .thumb { width: 72px; height: 72px; }
a.source-thumb { cursor: zoom-in; }
.source-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

.source-compare { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px; border: 1px solid rgba(20, 118, 108, 0.18); border-radius: 8px; background: var(--teal-soft); }
.source-compare img { width: 84px; height: 84px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line-strong); background: #fff; cursor: zoom-in; }
.source-compare-meta { min-width: 0; }
.source-compare-meta b { color: var(--teal-deep); font-size: 12px; }
.source-compare-meta p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.source-compare-meta span { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; }
.source-title { font-size: 12px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--faint); font-size: 10px; }
.source-price { color: var(--red); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-price small { color: var(--faint); font-size: 10px; }
.source-actions { display: flex; gap: 6px; margin-top: 6px; }
.source-detail { margin-top: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 7px; background: #fafcf9; font-size: 11px; line-height: 1.6; color: var(--muted); }

.calc-box { padding: 13px 14px; border: 1px solid rgba(20, 118, 108, 0.18); border-radius: 7px; background: linear-gradient(150deg, var(--teal-soft), #f8faf7 75%); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.calc-row span { color: var(--muted); }
.calc-row b { font-weight: 800; font-variant-numeric: tabular-nums; }
.calc-result { display: flex; align-items: baseline; justify-content: space-between; margin-top: 11px; padding-top: 11px; border-top: 1px dashed rgba(20, 118, 108, 0.28); }
.calc-result span { color: var(--teal-deep); font-size: 12px; font-weight: 800; }
.calc-result strong { font-size: 24px; font-weight: 800; color: var(--teal-deep); font-variant-numeric: tabular-nums; }
.calc-result strong.neg { color: var(--red); }
.calc-tip { margin-top: 8px; color: var(--faint); font-size: 10px; }

.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }

/* ============ Toast ============ */
.toast-stack {
  position: fixed;
  top: 78px;
  left: calc(50% + 118px); /* 避开左侧 236px 导航，居中于内容区 */
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 9px;
  width: min(420px, calc(100vw - 280px));
  z-index: 220;
  pointer-events: none;
}
@media (max-width: 820px) {
  .toast-stack { top: 14px; left: 50%; width: min(420px, calc(100vw - 28px)); }
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 240px; max-width: 380px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(23, 33, 27, 0.16);
  font-size: 12px;
  font-weight: 600;
  animation: toastIn 220ms ease both;
}
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast b { display: block; margin-bottom: 2px; font-size: 10px; letter-spacing: 0.08em; color: var(--muted); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(20, 118, 108, 0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
  .grid-bid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rule:nth-child(3) { border-right: 0; }
}
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { align-items: flex-start; }
  .hero-badge { max-width: 100%; text-align: left; }
  .bid-kpi-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .sidebar-brand { border: 0; padding: 0; }
  .brand-text { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav-label, .side-card, .side-foot { display: none; }
  .nav-item { min-height: 34px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .nav-tag { display: none; }
  .main { margin-left: 0; width: 100%; padding: 14px 16px 36px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .kpi-grid { grid-template-columns: 1fr; }
  .rule-strip { grid-template-columns: 1fr 1fr; }
  .rule:nth-child(2n) { border-right: 0; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .searchbar { flex-wrap: wrap; }
  .search-input-wrap { flex-basis: 100%; }
  .searchbar .select, .searchbar .button { flex: 1; }
}

/* ============ 采购中心 · 采购信息 ============ */
.date-range-control { position: relative; display: flex; align-items: center; }

.date-range-toggle {
  min-height: 36px;
  min-width: 218px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.date-range-toggle:hover { border-color: var(--teal); }

.date-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 292px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(32, 42, 35, 0.16);
}

.date-picker-header,
.date-picker-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-picker-header strong { color: var(--text); font-size: 14px; font-weight: 800; }

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.icon-button:hover { border-color: var(--teal); color: var(--teal); }

.date-picker-weekdays,
.date-picker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }

.date-picker-weekdays {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.date-picker-days button,
.date-picker-empty { min-width: 0; height: 32px; }

.date-picker-days button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.date-picker-days button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.date-picker-days button.is-in-range { background: var(--blue-soft); color: #244c72; }
.date-picker-days button.is-start,
.date-picker-days button.is-end { border-color: rgba(20, 118, 108, 0.4); background: var(--teal); color: #fff; }

.date-picker-actions { margin-top: 12px; flex-wrap: wrap; justify-content: flex-end; }

.purchase-toolbar { margin: 16px 2px 14px; }
.purchase-toolbar-left,
.purchase-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.purchase-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 16px; }
.summary-card {
  min-width: 190px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.summary-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.summary-card strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }

.batch-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.purchase-search { flex: 0 0 250px; }
.purchase-search input { padding-top: 8px; padding-bottom: 8px; }
.export-images-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
.export-images-toggle input { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.purchase-title { max-width: 340px; white-space: normal; line-height: 1.4; }
.purchase-table td .thumb { width: 40px; height: 40px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pagination-actions { display: flex; align-items: center; gap: 8px; }

/* ============ 登录 / 注册 ============ */
.user-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.user-meta { display: grid; line-height: 1.25; }
.user-meta strong { font-size: 12px; font-weight: 800; }
.user-meta small { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(246, 247, 243, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.auth-locked { overflow: hidden; }

.auth-card {
  width: min(400px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 26px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(20, 118, 108, 0.06), rgba(255, 255, 255, 0) 180px),
    var(--surface);
  box-shadow: var(--shadow);
}
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-head > div { display: grid; gap: 2px; }
.auth-head strong { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.auth-head small { color: var(--muted); font-size: 12px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #eff2ed;
}
.auth-tabs button {
  padding: 8px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.auth-tabs button.active { background: #fff; color: var(--teal-deep); box-shadow: var(--shadow-sm); }

.auth-field { display: grid; gap: 6px; margin-bottom: 14px; }
.auth-field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.auth-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.auth-field input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(20, 118, 108, 0.1); }
.auth-field input::placeholder { color: var(--faint); }

.auth-error {
  margin-bottom: 12px;
  padding: 8px 11px;
  border: 1px solid rgba(178, 58, 58, 0.3);
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.auth-submit { width: 100%; min-height: 42px; }

.auth-note { margin: 16px 0 0; color: var(--faint); font-size: 11px; line-height: 1.6; }

@media (max-width: 720px) {
  .user-meta { display: none; }
}

/* ============================================================
   WHITE THEME — 白色系 / 清爽专业 / 克制的科技感
   全站白色底 + 浅蓝灰分隔 + 科技蓝主色，AI 区域保留蓝紫渐变强调
   ============================================================ */

/* ---------- 顶栏：白色悬浮 ---------- */
.main { max-width:1560px; padding:20px 24px 40px; }
.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.crumb { color: var(--faint); letter-spacing: 0.06em; }
.crumb i { color: var(--line-strong); font-style: normal; }
.crumb strong { color: var(--text); }
.clock { background: var(--surface); color: var(--muted); }
.store-scope { background: var(--surface); }
.user-box { border-left-color: var(--line); }
.user-meta strong { color: var(--text); }
.user-meta small { color: var(--faint); }

/* ---------- 顶栏全局搜索 ---------- */
.top-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(430px, 34vw);
  min-width: 130px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.top-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.1); }
.top-search svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.top-search input {
  flex: 1; min-width: 0; padding: 0;
  border: 0; background: transparent;
  color: var(--text); font-size: 12px; outline: none;
}
.top-search input::placeholder { color: var(--faint); }
.top-search kbd {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--faint);
  font: 600 10px/1.4 ui-monospace, SFMono-Regular, monospace;
}
.topbar .crumb { flex-shrink: 0; white-space: nowrap; }

/* ---------- 首页驾驶舱 ---------- */
.dash-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.8fr);
  gap: 24px;
  padding: 28px 30px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(760px 340px at 92% -26%, rgba(53, 109, 243, 0.12), transparent 62%),
    radial-gradient(620px 280px at 58% 124%, rgba(117, 87, 232, 0.08), transparent 62%),
    linear-gradient(120deg, #ffffff, #f7faff 58%, #f8f5ff);
  box-shadow: var(--shadow);
}
.dash-head::before {
  content: "";
  position: absolute;
  right: -150px; top: -250px;
  width: 540px; height: 540px;
  border-radius: 50%;
  border: 1px solid rgba(53, 109, 243, 0.13);
  background: radial-gradient(circle at 42% 42%, rgba(53, 109, 243, 0.09), rgba(255, 255, 255, 0.6) 64%);
  box-shadow: inset 0 0 70px rgba(53, 109, 243, 0.06);
  opacity: 0.7;
  pointer-events: none;
}
.dash-head::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(53, 109, 243, 0.18) 1px, transparent 1.4px);
  background-size: 120px 120px;
  opacity: 0.16;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.dash-hello { position: relative; z-index: 1; }
.dash-hello h1 {
  margin: 14px 0 6px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dash-hello h1 .wave { display: inline-block; font-style: normal; margin-left: 2px; transform-origin: 70% 70%; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  68% { transform: rotate(16deg); }
  76% { transform: rotate(-8deg); }
  84% { transform: rotate(12deg); }
}
.dash-hello p { margin: 0; color: var(--muted); font-size: 13px; }
.dash-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; }
.dash-stat { display: flex; flex-direction: column; gap: 3px; }
.dash-stat b { color: var(--text); font-size: 21px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-stat small { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.dash-stat:not(:last-child) { padding-right: 26px; border-right: 1px solid var(--line); }
.dash-side { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 16px; }
.dash-side .range-tabs { background: var(--surface-soft); border-color: var(--line); }

/* AI 助力运营卡 */
.boost-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 290px;
  padding: 16px 18px;
  border: 1px solid rgba(117, 87, 232, 0.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(53, 109, 243, 0.1), rgba(117, 87, 232, 0.16));
  color: var(--text);
  text-align: left;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(76, 84, 180, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.boost-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-130%);
  animation: aiSweep 6s ease-in-out infinite;
  pointer-events: none;
}
.boost-card:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(76, 84, 180, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.boost-copy { display: flex; flex-direction: column; gap: 4px; }
.boost-copy small { color: var(--violet); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.boost-copy strong { font-size: 16px; font-weight: 800; }
.boost-copy .delta { margin-top: 2px; align-self: flex-start; background: rgba(255, 255, 255, 0.72); color: var(--text); }
.boost-copy .delta.up { background: var(--green-soft); color: var(--green); }
.boost-copy .delta.down { background: var(--red-soft); color: var(--red); }
.boost-orb {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #dbeafe, #60a5fa 40%, #7c3aed 78%, #312e81);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.32), inset 0 0 14px rgba(255, 255, 255, 0.3);
}

/* ---------- KPI ---------- */
.kpi-grid { gap: 16px; margin-top: 16px; }
.kpi-card { padding: 18px 20px 16px; border-radius: 16px; }
.kpi-card::before { height: 2px; opacity: 0.85; }
.kpi-label { font-size: 12px; letter-spacing: 0.03em; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-value { margin-top: 14px; font-size: 29px; }
.kpi-foot { margin-top: 8px; gap: 8px; min-height: 22px; }
.kpi-foot-text { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.kpi-spark { display: inline-flex; margin-left: auto; width: 64px; height: 22px; flex: none; color: var(--teal); opacity: 0.85; }
.kpi-spark.blue { color: var(--blue); }
.kpi-spark.violet { color: var(--violet); }
.kpi-spark.amber { color: var(--amber); }
.kpi-spark svg { width: 100%; height: 100%; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: currentColor; opacity: 0.12; stroke: none; }

/* ---------- AI 主视觉 Banner（白底蓝紫轻光） ---------- */
.ai-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.7fr);
  gap: 24px;
  margin-top: 16px;
  padding: 26px 30px;
  border: 1px solid rgba(117, 87, 232, 0.2);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(620px 300px at 82% 8%, rgba(117, 87, 232, 0.13), transparent 62%),
    radial-gradient(520px 280px at 12% 110%, rgba(53, 109, 243, 0.11), transparent 60%),
    linear-gradient(118deg, #ffffff, #f8f5ff 60%, #f4f7ff);
  box-shadow: 0 18px 44px rgba(76, 84, 180, 0.1);
}
.ai-banner::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(117, 87, 232, 0.35) 1px, transparent 1.5px);
  background-size: 30px 30px;
  opacity: 0.22;
  animation: particleDrift 22s linear infinite;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent);
}
.ai-banner-copy { position: relative; z-index: 1; }
.ai-banner-copy h2 {
  margin: 14px 0 8px;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
}
.ai-banner-copy p { margin: 0; max-width: 560px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ai-tags span {
  padding: 5px 11px;
  border: 1px solid rgba(117, 87, 232, 0.22);
  border-radius: 999px;
  background: rgba(117, 87, 232, 0.07);
  color: #5b46c4;
  font-size: 11px;
  font-weight: 700;
}
.ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.ai-note { color: var(--muted); font-size: 11px; font-weight: 600; }
.ai-banner-visual { position: relative; z-index: 1; display: grid; place-items: center; min-height: 190px; }
.ai-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #e0eaff, #60a5fa 36%, #7c3aed 76%, #312e81);
  box-shadow: 0 0 46px rgba(99, 102, 241, 0.35), inset 0 0 26px rgba(255, 255, 255, 0.28);
  animation: orbFloat 6s ease-in-out infinite;
}
.ai-orb i { font-style: normal; color: #fff; font-size: 32px; font-weight: 800; letter-spacing: 0.04em; text-shadow: 0 0 18px rgba(255, 255, 255, 0.6); }
.ai-ring { position: absolute; width: 190px; height: 190px; border: 1px solid rgba(53, 109, 243, 0.16); border-radius: 50%; transform: rotate(-14deg); }
.ai-ring.r2 { width: 236px; height: 236px; border-color: rgba(117, 87, 232, 0.12); transform: rotate(12deg); animation: ringPulse 6s ease-in-out infinite; }
.ai-chip {
  position: absolute;
  padding: 5px 10px;
  border: 1px solid rgba(117, 87, 232, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.ai-chip.c1 { top: 14px; right: 16%; }
.ai-chip.c2 { bottom: 20px; right: 4%; }
.ai-chip.c3 { bottom: 44px; left: 6%; }
@keyframes orbFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ringPulse {
  0%, 100% { opacity: 0.55; transform: rotate(12deg) scale(1); }
  50% { opacity: 0.9; transform: rotate(12deg) scale(1.05); }
}

/* ---------- 首页布局 / 快捷入口 ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card { border-radius: 16px; padding: 18px 20px 20px; }
.card-head h3 { font-size: 16px; }
.card-head p { font-size: 11px; }
.chart-wrap, .chart-wrap svg { min-height: 236px; height: 236px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.quick-tile:hover { transform: translateY(-1px); border-color: rgba(53, 109, 243, 0.3); background: #fff; }
.quick-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 15px;
  font-weight: 800;
}
.quick-tile.violet .quick-icon { background: var(--violet-soft); color: #5b46c4; }
.quick-tile.teal .quick-icon { background: var(--blue-soft); color: var(--blue); }
.quick-tile.amber .quick-icon { background: var(--amber-soft); color: var(--amber); }
.quick-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick-copy strong { font-size: 13px; font-weight: 800; }
.quick-copy small { color: var(--muted); font-size: 11px; }

/* ---------- 图表 / 列表配色（白底） ---------- */
.chart-grid-line { stroke: var(--line); }
.chart-line { stroke: var(--teal); stroke-width: 2.2; filter: none; }
.chart-dot { fill: #fff; stroke: var(--violet); }
.chart-bar { fill: rgba(117, 87, 232, 0.12); }
.chart-axis-label { fill: var(--faint); }
.store-bar { background: var(--line); }
.store-bar > i { background: linear-gradient(90deg, var(--teal), var(--violet)); }
.rank-no.top { background: linear-gradient(135deg, #fbbf24, #f97316); color: #1a1205; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }

/* ---------- AI 流水线 ---------- */
#searchBtn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--teal), #6d5cf0 58%, var(--violet));
  color: #fff;
  box-shadow: 0 10px 26px rgba(76, 84, 200, 0.24), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
#searchBtn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-130%);
  animation: aiSweep 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes aiSweep {
  0%, 60% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}
.pipeline {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(53, 109, 243, 0.14);
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(53, 109, 243, 0.05), transparent 62%),
    var(--surface);
}
.pipeline::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(53, 109, 243, 0.2) 1px, transparent 1.4px);
  background-size: 24px 24px;
  opacity: 0.28;
  animation: particleDrift 18s linear infinite;
  pointer-events: none;
}
.pipeline > * { position: relative; z-index: 1; }
@keyframes particleDrift {
  from { background-position: 0 0; }
  to { background-position: 24px 48px; }
}
.pipeline-item { border-color: var(--line); background: var(--surface-soft); }
.pipeline-step.done { border-color: rgba(53, 109, 243, 0.26); background: rgba(53, 109, 243, 0.08); color: var(--teal-deep); }
.pipeline-step.active {
  border-color: rgba(117, 87, 232, 0.3);
  background: linear-gradient(135deg, rgba(53, 109, 243, 0.1), rgba(117, 87, 232, 0.1));
  color: #5b46c4;
  box-shadow: 0 0 18px rgba(117, 87, 232, 0.1);
}

/* ---------- 浅色细节收口 ---------- */
.button.ghost { background: var(--surface-soft); }
.delta.flat, .badge.gray, .price-arrow.flat, .price-delta.flat { background: #eef1f7; color: var(--muted); }
.seg-tabs, .bid-filter-tabs { background: var(--surface-soft); }
.bid-pagination { border-top-color: var(--line); }
.product-card:hover { border-color: rgba(53, 109, 243, 0.35); box-shadow: 0 16px 34px rgba(26, 43, 74, 0.12); }
.p-cover .cover-fallback { color: rgba(53, 109, 243, 0.4); }
.modal { box-shadow: 0 26px 80px rgba(17, 26, 43, 0.18); }
.bid-config-control input:focus,
.floor-edit input:focus { box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.1); }
.data-table td { border-bottom-color: var(--line); }
.data-table tbody tr:hover,
.data-table tr:hover td { background: var(--surface-soft); }
.step i { background: #edf1f8; color: var(--faint); }
.step.active i { background: var(--teal); color: #fff; }
.p-cover { background: linear-gradient(145deg, #f3f6fb, #eef2f9); }
.p-cover-jump { background: var(--teal); color: #fff; }
.thumb { background: linear-gradient(140deg, var(--teal-soft), var(--violet-soft)); color: var(--teal-deep); }
.pipeline-progress { background: var(--line); }
.switch { background: #cfd9e8; }
.filter-check { border-color: rgba(53, 109, 243, 0.22); }
.modal-overlay { background: rgba(17, 26, 43, 0.18); }
.auth-gate { background: rgba(244, 247, 252, 0.85); }
.auth-card {
  background:
    linear-gradient(180deg, rgba(53, 109, 243, 0.05), rgba(255, 255, 255, 0) 180px),
    var(--surface);
}
.auth-tabs { background: var(--surface-soft); }
.auth-field input:focus { box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.1); }
.source-compare { border-color: rgba(53, 109, 243, 0.18); }
.calc-box { border-color: rgba(53, 109, 243, 0.18); background: linear-gradient(150deg, var(--teal-soft), #fff 75%); }
.calc-result { border-top-color: rgba(53, 109, 243, 0.22); }
.source-detail { background: var(--surface-soft); }
.search-input-wrap input:focus,
.field input:focus,
.field select:focus { box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.1); }

/* ---------- 选品中心附加 ---------- */
#sourcingTabs { flex-wrap: wrap; }
#profitRules, #sourcingTabReviews { padding: 22px; }
#profitRules .form-grid { margin-top: 18px; }
#sourcingTabReviews .pipeline-item { margin-top: 12px; }
#view-sourcing details.card { margin-bottom: 16px; padding: 14px; }
#view-sourcing details summary { cursor: pointer; }
#reviewDraftDescription {
  width: 100%; min-height: 160px;
  background: var(--surface); color: var(--text);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#view-sourcing .head-actions { flex-wrap: wrap; }
#view-sourcing .stepper { flex-wrap: wrap; }
#centerRules h3 { margin: 24px 0 16px; }
#centerRules textarea {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  width: 100%;
}
#centerRules .field { margin-bottom: 14px; }
#centerRules > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#categoryFeeRows { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.fee-group + .fee-group { border-top: 1px solid var(--line-strong); }
.fee-group summary { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; background: var(--surface-soft); }
.fee-group summary::after { content: '›'; font-size: 20px; margin-left: 4px; }
.fee-group[open] summary::after { transform: rotate(90deg); }
.fee-group summary > input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: transparent; color: var(--text); font: inherit; }
.fee-group summary > input[readonly] { border-color: transparent; font-weight: 700; }
#centerRules .fee-amount { display: flex; align-items: center; gap: 10px; width: 180px; margin: 0; }
.fee-remove { color: var(--red); }
.fee-children { padding: 16px; border-top: 1px solid var(--line); }
.fee-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- 定价工作台 ---------- */
#profitRules { padding: 0; background: transparent; border: 0; box-shadow: none; }
.pricing-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 28px 0 22px; }
.pricing-eyebrow { display: block; font-size: 10px; letter-spacing: .12em; font-weight: 700; color: var(--teal); margin-bottom: 9px; }
.pricing-heading h3 { font-size: 23px; margin: 0 0 8px; letter-spacing: -.03em; }
.pricing-heading p, .pricing-section-title p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.7; }
.pricing-status { font-size: 11px; border: 1px solid var(--line-strong); border-radius: 20px; padding: 7px 12px; color: var(--muted); white-space: nowrap; }
.pricing-status.dirty { color: var(--teal); border-color: var(--teal); }
.pricing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 20px; align-items: start; }
.pricing-main, .pricing-aside { display: grid; gap: 18px; min-width: 0; }
.pricing-aside { position: sticky; top: 100px; }
.pricing-section { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 22px; }
.pricing-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.pricing-section-title > span { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.pricing-section h4 { font-size: 15px; font-weight: 700; margin: 0 0 5px; }
.pricing-section-title > .button { margin-left: auto; font-size: 11px; padding: 8px 10px; white-space: nowrap; }
.pricing-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.pricing-field { display: grid; gap: 8px; font-size: 13px; color: var(--text); min-width: 0; }
.pricing-field small { font-size: 11px; line-height: 1.6; color: var(--faint); font-weight: 400; }
.pricing-field em { font-style: normal; color: var(--faint); font-size: 10px; margin-left: 5px; }
.pricing-input { display: flex; align-items: center; background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.pricing-input:focus-within { border-color: var(--teal); }
.pricing-input input { width: 100%; min-width: 0; padding: 11px 12px; color: var(--text); background: transparent; border: 0; font: inherit; outline: 0; font-variant-numeric: tabular-nums; }
.pricing-input > span { flex-shrink: 0; padding-right: 12px; color: var(--faint); font-size: 10px; }
.pricing-summary > p, .pricing-summary details { font-size: 12px; line-height: 1.9; color: var(--muted); }
.pricing-summary summary { color: var(--text); font-size: 11px; }
.pricing-note { border-top: 1px solid var(--line-strong); margin-top: 20px; padding-top: 15px; font-size: 11px; color: var(--faint); line-height: 1.8; }
.pricing-table-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); padding: 0 42px 12px 12px; }
#centerRules #categoryFeeRows { border: 0; margin: 0; }
#centerRules .fee-group { border: 1px solid var(--line-strong); border-radius: 8px; margin-bottom: 9px; overflow: hidden; }
#centerRules .fee-group:last-child { margin-bottom: 0; }
#centerRules .fee-group summary { padding: 10px 12px; gap: 10px; }
#centerRules .fee-group summary > input { font-size: 12px; padding: 7px 0; }
#centerRules .fee-amount { width: 120px; font-size: 11px; }
#centerRules .fee-amount input { padding: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
#centerRules .fee-children { padding: 15px; }
#centerRules .fee-tags .chip { font-size: 10px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 5px; }
#centerRules .fee-children .field { font-size: 11px; margin: 0; color: var(--muted); }
.pricing-savebar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-top: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.pricing-savebar > span { color: var(--muted); font-size: 11px; }
.pricing-savebar > div { display: flex; gap: 10px; flex-shrink: 0; }
.pricing-input input[type="number"] { border: 0; box-shadow: none; background: transparent; border-radius: 0; }
/* ---------- 利润计算 ---------- */
.profit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 0 18px; }
.profit-head-main { display: flex; align-items: flex-start; gap: 13px; }
.profit-head-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--teal-soft); color: var(--teal); }
.profit-head-icon svg { width: 20px; height: 20px; }
.profit-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.profit-head p { margin: 0; color: var(--muted); font-size: 12px; }
.profit-head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.profit-head-actions .button { border-radius: 999px; }
.profit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.profit-main, .profit-side { display: grid; gap: 14px; min-width: 0; }
.profit-side { position: sticky; top: 100px; }
.profit-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.profit-card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 13px; font-weight: 700; }
.profit-card h4 svg { width: 16px; height: 16px; color: var(--teal); }
.profit-fields { display: grid; gap: 14px; }
.profit-fields.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.profit-fields.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.profit-fields.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profit-fields.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profit-field { display: grid; gap: 6px; min-width: 0; font-size: 11px; color: var(--muted); }
.profit-field > span .req { margin-left: 2px; color: var(--red); font-weight: 700; }
.profit-field-wide { grid-column: 1 / -1; }
.profit-output-field { grid-column: span 2; }
.profit-output-field > span { color: var(--teal); font-weight: 600; }
.profit-output-field .profit-input.profit-output { background: var(--teal-soft); border: 1px solid var(--teal); }
.profit-output-field .profit-input.profit-output b { color: var(--teal); font-size: 15px; }
.profit-input { display: flex; align-items: center; background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.profit-input:focus-within { border-color: var(--teal); background: #fff; }
.profit-input:has(> input[required]:placeholder-shown) { border-color: var(--red); background: var(--red-soft); }
.profit-input:has(> input[required]:placeholder-shown):focus-within { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(178, 58, 58, 0.12); }
.profit-input:has(> input[required]:placeholder-shown) input::placeholder { color: var(--red); opacity: .7; }
.profit-input i { padding-left: 10px; color: var(--faint); font-size: 11px; font-style: normal; }
.profit-input input { width: 100%; min-width: 0; padding: 9px 10px; border: 0; background: transparent; color: var(--text); font-size: 13px; font-weight: 600; text-align: right; outline: 0; font-variant-numeric: tabular-nums; }
.profit-input input, .profit-input input:focus { border-radius: 0; box-shadow: none; }
.profit-input.profit-output { background: var(--surface); border-style: dashed; }
.profit-input.profit-output b { flex: 1; padding: 9px 10px; color: var(--text); font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.profit-radio { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; padding: 9px 2px; }
.profit-radio label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--muted); white-space: nowrap; }
.profit-radio input { width: 15px; height: 15px; margin: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); cursor: pointer; appearance: none; -webkit-appearance: none; flex-shrink: 0; transition: border-color .15s ease; }
.profit-radio input:checked { border-color: var(--teal); background: radial-gradient(circle, var(--teal) 0 3.4px, transparent 3.6px); }
.profit-radio input:checked + span { color: var(--text); font-weight: 600; }
.profit-radio input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.profit-radio-wrap { flex-wrap: wrap; align-content: center; gap: 8px 20px; min-height: 37px; padding: 6px 2px; }
.profit-radio-wrap label { gap: 6px; font-size: 12px; }
.profit-radio-wrap em { margin-left: 2px; color: var(--faint); font-style: normal; font-weight: 400; font-variant-numeric: tabular-nums; }
.profit-radio-wrap input:checked + span em { color: var(--teal); }
.profit-input span { padding-right: 10px; color: var(--faint); font-size: 10px; }
.profit-formula { display: grid; gap: 7px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.profit-formula p { margin: 0; }
.profit-formula b { margin-right: 4px; color: var(--text); font-weight: 700; }
.profit-formulas > summary { cursor: pointer; color: var(--text); font-size: 13px; font-weight: 700; }
.profit-formulas[open] > summary { margin-bottom: 16px; }
.profit-formulas > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 2px; }
.profit-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profit-metric { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 14px 16px; }
.profit-metric > span { display: block; font-size: 11px; color: var(--faint); }
.profit-metric strong { display: block; margin-top: 8px; font-size: 21px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.profit-metric.good { border-color: #cfe3d3; background: var(--green-soft); }
.profit-metric.good strong { color: var(--green); }
.profit-metric.bad { border-color: #f0cfcb; background: var(--red-soft); }
.profit-metric.bad strong { color: var(--red); }
.profit-detail { padding-bottom: 12px; }
.profit-lines { list-style: none; margin: 0; padding: 0; }
.profit-lines li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12px; color: var(--muted); }
.profit-lines b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.profit-lines li.highlight span, .profit-lines b.highlight { color: var(--teal); }
.profit-lines b.highlight { font-weight: 700; }
.profit-lines li.sep { padding: 0; margin: 7px 0; border-top: 1px solid var(--line); }
.profit-lines b.good { color: var(--green); }
.profit-lines b.bad { color: var(--red); }
.profit-fx { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 12px; color: var(--muted); }
.profit-fx b { color: var(--text); font-weight: 700; }
.profit-source { margin: -4px 2px 0; color: var(--faint); font-size: 11px; line-height: 1.7; }
.profit-tabs { display: flex; width: 100%; margin: 0 0 18px; }
.profit-tabs button { flex: 1; }
#profitConfigPane { padding: 0 20px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.profit-config-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.profit-config-head strong { font-size: 13px; }
.profit-config-head > span:not(.pricing-status) { color: var(--faint); font-size: 11px; }
.profit-config-head .pricing-status { margin-left: auto; }
.fee-count { color: var(--faint); font-size: 10px; white-space: nowrap; }
#view-sourcing.pricing-active > .section-head { display: none; }

/* ---------- 搜索结果档案 ---------- */
.sourcing-archive .card-head { align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sourcing-archive .card-head p { margin-top: 7px; line-height: 1.6; }
.sourcing-archive .table-wrap { margin: 0; }
.sourcing-archive .data-table { min-width: 620px; }
.sourcing-archive .data-table th { padding: 13px 16px; white-space: nowrap; }
.sourcing-archive .data-table td { padding: 16px; }
.sourcing-archive .data-table td:first-child { font-weight: 600; overflow-wrap: anywhere; }
.sourcing-archive .data-table td:last-child { white-space: nowrap; }
.archive-actions { display: flex; justify-content: flex-end; gap: 8px; }
.archive-actions-heading { text-align: right; }
.archive-product { display: flex; align-items: center; gap: 12px; }
.archive-product .thumb { width: 48px; height: 48px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.archive-product small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-bottom: 5px; }
.archive-product strong { font-size: 12px; }
.sourcing-archive .table-empty { padding: 64px 20px; text-align: center; color: var(--muted); line-height: 1.8; }

/* ---------- 搜索历史 / 货源匹配库：信息层级优化 ---------- */
.sourcing-archive .card-head { align-items: flex-start; }
.sourcing-archive .toolbar { margin: 16px 0 10px; }
.sourcing-archive .toolbar input {
  width: min(420px, 100%);
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font: inherit; font-size: 12px;
  color: var(--text);
  outline: 0;
}
.sourcing-archive .toolbar input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.1);
}

.sourcing-archive .history-table { min-width: 680px; table-layout: fixed; }
.sourcing-archive .history-table th { padding: 11px 16px; }
.sourcing-archive .history-table th:nth-child(1) { width: auto; }
.sourcing-archive .history-table th:nth-child(2) { width: 90px; }
.sourcing-archive .history-table th:nth-child(3) { width: 100px; }
.sourcing-archive .history-table th:nth-child(4) { width: 132px; }
.sourcing-archive .history-table th:nth-child(5) { width: 178px; }
.sourcing-archive .history-table td { padding: 12px 16px; }
.sourcing-archive .history-table tbody tr:last-child td { border-bottom: 0; }
.history-keyword { display: flex; align-items: center; gap: 10px; min-width: 0; }
.history-key-icon {
  display: grid; place-items: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
}
.history-key-icon svg { width: 13px; height: 13px; }
.history-keyword strong {
  font-size: 13px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-count { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-count small { margin-left: 3px; color: var(--faint); font-size: 10px; font-weight: 600; }
.sourcing-archive .history-table .badge { display: inline-flex; align-items: center; gap: 6px; }
.sourcing-archive .history-table .badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.65;
}
.history-time { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.history-time span { font-size: 11px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.history-time small { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.history-actions-heading { text-align: right; }
.history-actions { display: flex; justify-content: flex-end; gap: 6px; }
.history-actions .mini-btn.accent { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 16px 0 0; }
.library-search {
  display: flex; align-items: center; gap: 9px;
  width: min(460px, 100%);
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
}
.library-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.1); }
.library-search svg { width: 14px; height: 14px; flex: none; color: var(--faint); }
.library-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; outline: 0; font: inherit; font-size: 12px; color: var(--text); }
.library-summary { color: var(--faint); font-size: 11px; font-weight: 600; white-space: nowrap; }
.library-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.library-row:hover { border-color: rgba(53, 109, 243, 0.28); background: #fff; box-shadow: var(--shadow-sm); }
.library-info { min-width: 0; }
.library-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sku-chip {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 700 10px/1.6 ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.02em;
}
.price-chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.source-chip { color: var(--faint); font-size: 10px; font-weight: 600; }
.mock-chip { background: #fff4e0; border-color: #f2ddb6; color: var(--amber); }
.library-title {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px; font-weight: 700; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.library-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; color: var(--faint); font-size: 10px; }
.library-hint { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); }
.library-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.library-actions .mini-btn { white-space: nowrap; }
.library-actions .mini-btn.accent { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.library-list .table-empty { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 40px 16px; background: var(--surface); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .dash-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid-3 > .card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .top-search { display: none; }
  .dash-head { grid-template-columns: 1fr; padding: 24px; }
  .dash-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .boost-card { max-width: 320px; }
  .dash-grid { grid-template-columns: 1fr; }
  .ai-banner { grid-template-columns: 1fr; }
  .ai-banner-visual { min-height: 170px; }
  .pricing-layout { grid-template-columns: minmax(0, 1fr); }
  .pricing-aside { position: static; grid-template-columns: 1fr 1fr; }
  .profit-grid { grid-template-columns: minmax(0, 1fr); }
  .profit-side { position: static; }
}
@media (max-width: 820px) {
  .topbar { position: static; }
}
@media (max-width: 760px) {
  .library-row { grid-template-columns: minmax(0, 1fr); align-items: flex-start; }
  .library-actions { justify-content: flex-start; }
  .library-toolbar { align-items: stretch; }
  .library-search { width: 100%; }
}
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .dash-grid-3 > .card:last-child { grid-column: auto; }
  .dash-stats { gap: 18px; }
  .dash-stat:not(:last-child) { padding-right: 18px; }
  .dash-side { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 700px) {
  #centerRules > .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .pricing-fields, .pricing-aside { grid-template-columns: 1fr; }
  .profit-fields.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .profit-fields.cols-5, .profit-fields.cols-4, .profit-fields.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profit-head { flex-wrap: wrap; }
  .pricing-heading { align-items: flex-start; }
  .pricing-section { padding: 16px; }
  .pricing-savebar { flex-wrap: wrap; bottom: 8px; }
  .pricing-savebar > div { width: 100%; }
  .pricing-savebar button { flex: 1; }
  .pricing-section-title { flex-wrap: wrap; }
  .fee-count { display: none; }
}
@media (max-width: 640px) {
  .sourcing-archive .card-head { gap: 16px; }
  .sourcing-archive .card-head .button { flex-shrink: 0; }
}
@media (max-width: 600px) {
  .fee-group summary { flex-wrap: wrap; }
  #centerRules .fee-amount { width: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  #searchBtn::after,
  .boost-card::after,
  .ai-banner::before,
  .ai-orb,
  .ai-ring.r2,
  .dash-hello .wave,
  .pipeline::before { animation: none; }
}

/* ============================================================
   AI 选品工作台 — 流程导航 / 候选列表 / 商品详情三栏
   ============================================================ */
#view-sourcing .sourcing-head { align-items: flex-end; }
@media (max-width: 820px) {
  #view-sourcing .sourcing-head { align-items: flex-start; }
}
.workbench { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.wb-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wb-search .search-input-wrap { flex: 1; min-width: 240px; }
.wb-search-hint { flex: 1 0 100%; min-height: 16px; padding-left: 4px; font-size: 11px; color: var(--faint); }
.wb-keywords { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: -2px; padding: 2px; }
.wb-keywords[hidden] { display: none; }
.wb-keywords-label {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.wb-keywords-label svg { width: 13px; height: 13px; stroke-width: 1.8; opacity: .7; }
.wb-keywords-divider { flex: none; width: 1px; height: 12px; margin: 0 1px; background: var(--line); }
.wb-keyword {
  display: inline-block; max-width: 200px;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font-size: 11.5px; font-weight: 600; line-height: 1.25; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease, box-shadow .16s ease;
}
.wb-keyword:hover {
  border-color: rgba(20, 118, 108, .45); color: var(--teal-deep);
  background: var(--teal-soft); transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(20, 118, 108, .12);
}
.wb-keyword.active {
  border-color: var(--teal); background: var(--teal); color: #fff;
  box-shadow: 0 4px 12px rgba(20, 118, 108, .25);
}
.wb-keyword.active:hover { border-color: var(--teal-deep); background: var(--teal-deep); color: #fff; }
.wb-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 14px;
  align-items: start;
}
.wb-brand-inline { white-space: nowrap; font-size: 10px; }

.wb-main {
  min-width: 0;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.wb-list-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.wb-list-head > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wb-list-head strong { font-size: 14px; }
.wb-list-head span { font-size: 11px; color: var(--muted); }
.wb-list-actions { display: flex; gap: 6px; flex: none; }
.wb-list-actions .mini-btn { font-size: 11px; }
.product-list { display: flex; flex-direction: column; }
.p-row {
  display: grid; grid-template-columns: 18px 52px minmax(0, 1fr) 84px;
  align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s ease;
}
.p-row:hover { background: var(--surface-soft); }
.p-row.active {
  background: linear-gradient(90deg, rgba(53, 109, 243, .07), transparent 70%);
  box-shadow: inset 3px 0 0 var(--teal);
}
.p-row .thumb { width: 52px; height: 52px; border-radius: 9px; }
.p-row-check { display: flex; align-items: center; justify-content: center; }
.p-row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.p-row-title { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-sourcing .wb-product-link:hover,
#view-sourcing .wb-product-link:focus-visible { color: var(--teal); text-decoration: underline; }
.p-row-meta { font-size: 10.5px; color: var(--muted); }
.p-row-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.wb-chip {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--surface-soft);
  font-size: 9.5px; color: var(--muted); white-space: nowrap;
}
.wb-chip.cache { border-color: rgba(117, 87, 232, .22); background: var(--violet-soft); color: #5b46c4; }
.wb-chip.src { border-color: rgba(53, 109, 243, .2); background: var(--blue-soft); color: var(--blue); }
.wb-chip.verify, .wb-chip.good { border-color: rgba(46, 122, 67, .2); background: var(--green-soft); color: var(--green); }
.wb-chip.warn { border-color: rgba(182, 109, 18, .2); background: var(--amber-soft); color: var(--amber); }
.wb-chip.queued { border-color: rgba(20, 118, 108, .24); background: var(--teal-soft); color: var(--teal-deep); }
.wb-chip.muted { color: var(--faint); }
.p-row-right { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.p-row-price { font-size: 13px; font-weight: 800; }
.p-row-price small { margin-right: 2px; font-size: 9px; color: var(--faint); }
.p-row-flow { font-size: 10px; color: var(--faint); }

.wb-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.wb-empty b { display: block; margin-bottom: 6px; color: var(--text); }
.wb-empty p { margin: 0; font-size: 12px; }
.bulk-bar {
  position: sticky; bottom: 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 12px; padding: 10px 12px;
  border: 1px solid rgba(53, 109, 243, .24); border-radius: 11px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 28px rgba(24, 48, 88, .12);
  backdrop-filter: blur(12px);
}
.bulk-bar > span { font-size: 12px; font-weight: 700; }
.bulk-bar-actions { display: flex; gap: 8px; }

.wb-detail {
  position: sticky; top: 82px;
  max-height: calc(100vh - 100px); overflow: auto;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.wb-detail-empty { padding: 56px 22px; text-align: center; color: var(--muted); }
.wb-detail-icon { display: block; margin-bottom: 10px; font-size: 26px; color: var(--line-strong); }
.wb-detail-empty b { display: block; color: var(--text); }
.wb-detail-empty p { margin: 6px 0 0; font-size: 12px; }
.wb-detail-scroll { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.wb-detail-head { display: flex; gap: 12px; }
.wb-detail-head .thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; }
.wb-detail-title h3 { margin: 0 0 5px; font-size: 13px; line-height: 1.45; }
.wb-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 10px; color: var(--muted); }
.wb-detail-price {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-soft);
}
.wb-detail-price b { font-size: 17px; }
.wb-detail-price span { font-size: 10px; color: var(--muted); }
.wb-detail-price .takealot-jump { margin-left: auto; font-size: 10px; }
.wb-flow { display: flex; gap: 4px; flex-wrap: wrap; }
.wb-node {
  padding: 4px 7px; border-radius: 6px;
  border: 1px dashed var(--line-strong);
  font-size: 9.5px; color: var(--faint);
}
.wb-node.done { border-style: solid; border-color: rgba(20, 118, 108, .3); background: var(--teal-soft); color: var(--teal-deep); font-weight: 700; }
.wb-section { display: flex; flex-direction: column; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.wb-section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wb-section-head h4 { margin: 0; font-size: 12px; }
.wb-section-head > span { font-size: 10px; color: var(--faint); }
.wb-source-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; padding-right: 2px; }
.wb-offer { display: flex; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.wb-offer.chosen { border-color: rgba(53, 109, 243, .4); background: linear-gradient(135deg, rgba(53, 109, 243, .06), rgba(117, 87, 232, .05)); }
.wb-offer .thumb { width: 42px; height: 42px; flex: none; border-radius: 7px; }
.wb-offer-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.wb-offer-title { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-offer-meta { display: flex; flex-wrap: wrap; gap: 3px 7px; font-size: 9.5px; color: var(--muted); }
.wb-offer-meta span:first-child { color: var(--teal-deep); font-weight: 800; }
.wb-offer-actions, .wb-inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wb-cache-hit, .wb-source-empty { padding: 10px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface-soft); }
.wb-cache-hit { border-style: solid; border-color: rgba(117, 87, 232, .2); background: linear-gradient(135deg, rgba(117, 87, 232, .08), rgba(53, 109, 243, .05)); }
.wb-cache-hit b { display: block; margin: 4px 0 2px; font-size: 12px; }
.wb-cache-hit p, .wb-source-empty p { margin: 0 0 8px; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.wb-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wb-form .field { margin: 0; }
.wb-form .field span { font-size: 10px; }
.wb-form input, .wb-form select { width: 100%; padding: 7px 8px; font-size: 11px; }
.wb-calc { border: 1px solid rgba(53, 109, 243, .16); border-radius: 10px; overflow: hidden; background: linear-gradient(150deg, var(--teal-soft), #fff 78%); }
.wb-calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.wb-calc-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; background: #fff; }
.wb-calc-grid span { font-size: 9.5px; color: var(--muted); }
.wb-calc-grid b { font-size: 13px; }
.wb-calc-grid b.good { color: var(--green); }
.wb-calc-grid b.warn { color: var(--amber); }
.wb-calc-grid b.neg { color: var(--red); }
.wb-calc-foot { display: flex; flex-direction: column; gap: 5px; padding: 10px 11px; border-top: 1px solid rgba(53, 109, 243, .16); font-size: 10px; color: var(--muted); }
.wb-calc.empty { padding: 22px; text-align: center; font-size: 11px; color: var(--faint); background: var(--surface-soft); border-style: dashed; }
.wb-detail-actions { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.wb-detail-actions .button { width: 100%; }
.wb-action-hint { font-size: 10px; color: var(--faint); text-align: center; }
.wb-error { font-size: 10.5px; color: var(--red); }
.pipeline-intro { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.pipeline-intro-flow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; font-size: 10px; color: var(--muted); }
.pipeline-intro-flow span { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.pipeline-intro-flow i { align-self: center; font-style: normal; color: var(--faint); }
.pipeline-intro p { margin: 0; font-size: 10.5px; color: var(--muted); }
.wb-fail-list { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.8; }
#sourcingTabQueue { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
#sourcingTabQueue .sourcing-archive { margin: 0; }
.button.sm { padding: 7px 12px; font-size: 11px; }
@media (max-width: 1280px) {
  .wb-body { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1080px) {
  .wb-body { grid-template-columns: 1fr; }
  .wb-detail { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .p-row { grid-template-columns: 18px 46px minmax(0, 1fr); }
  .p-row-right { display: none; }
  .wb-list-actions .wb-brand-inline { display: none; }
}


#centerRules .fee-child-add { display: flex; align-items: flex-end; gap: 8px; }
#centerRules .fee-child-add .field { flex: 1; }
#centerRules .fee-tags .chip { display: inline-flex; align-items: center; gap: 6px; }
#centerRules .fee-child-remove { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; }

/* 右侧工作台：1688 货源 / 关联推荐 */
.wb-detail-tabs {
  display: flex; gap: 4px; margin-top: 10px; padding: 3px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft);
}
.wb-detail-tabs button {
  flex: 1; padding: 7px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.wb-detail-tabs button:hover { color: var(--text); }
.wb-detail-tabs button.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}
.wb-related-section { margin-top: 10px; }
.wb-related-list { display: flex; flex-direction: column; gap: 6px; }
.wb-related-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft);
}
.wb-related-item .thumb { flex: none; width: 40px; height: 40px; border-radius: 7px; }
.wb-related-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wb-related-title {
  font-size: 11px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-related-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.wb-related-note { margin-top: 8px; color: var(--faint); font-size: 10px; line-height: 1.5; }

/* 上架队列：Takealot 商品 ↔ 1688 货源关联 */
#reviewList { display: flex; flex-direction: column; gap: 8px; }
.queue-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface);
}
#reviewList .queue-group {
  min-width: 0; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface);
}
#reviewList .queue-group-head {
  padding: 10px 14px; border-radius: 10px 10px 0 0;
  background: var(--surface-soft);
}
#reviewList .queue-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
#reviewList .queue-thumb { flex: none; width: 36px; height: 36px; border-radius: 7px; }
#reviewList .queue-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#reviewList .queue-title { color: var(--text); font-size: 13px; font-weight: 700; }
#reviewList .queue-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#reviewList small { color: var(--muted); font-size: 11px; }
#reviewList .queue-sources { list-style: none; margin: 0; padding: 0; }
#reviewList .queue-source {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 122px max-content;
  align-items: center; gap: 12px; padding: 9px 14px;
  border-top: 1px solid var(--line); font-size: 12px;
}
#reviewList .queue-source a { color: var(--teal); font-weight: 700; overflow-wrap: anywhere; }
#reviewList a:hover { text-decoration: underline; }
#reviewList .queue-source .mini-btn { white-space: nowrap; }
@media (max-width: 900px) {
  #reviewList .queue-source { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  #reviewList .queue-prices { text-align: right; }
}

/* ============ 店铺管理 · 内联表单 + 列表 ============ */
#view-stores #storeLimitHint.is-limit-reached { color: var(--red); font-weight: 600; }
.store-form-card .card-head { margin-bottom: 16px; }
.store-form-card + .card { margin-top: 18px; }
.store-form .form-actions { margin-top: 4px; }
.store-form-actions { justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.store-form-tail { display: flex; gap: 9px; }

.store-table th { padding: 11px 12px; }
.store-table td { padding: 13px 12px; }
.store-table { min-width: 580px; }
.store-table .cell-title { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-table .row-actions { flex-wrap: nowrap; white-space: nowrap; }
.store-row-actions { justify-content: flex-start; align-items: center; gap: 8px; }
.store-row-actions .switch { width: 38px; height: 20px; }
.store-row-actions .switch::after { width: 14px; height: 14px; }
.store-row-actions .switch.on::after { transform: translateX(18px); }

/* ============ 自定义下拉选择 ============ */
.cs-wrap { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.cs-wrap > select.cs-native {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0; padding: 0;
  opacity: 0;
  pointer-events: none;
}
.cs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  text-align: left;
  cursor: pointer;
}
.cs-trigger > .cs-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chevron {
  flex: none;
  width: 14px; height: 14px;
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.18s ease;
}
.cs-trigger.open .cs-chevron { transform: rotate(180deg); }
.cs-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.12); }
.cs-trigger:disabled { cursor: not-allowed; color: var(--faint); }

.field .cs-wrap { display: block; width: 100%; }
.field .cs-trigger {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
}
.wb-form .cs-trigger { padding: 7px 8px; font-size: 11px; }
.status-select.cs-trigger { gap: 4px; }
.status-select .cs-chevron { width: 12px; height: 12px; }

.cs-menu {
  position: fixed;
  z-index: 330;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(17, 26, 43, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: csMenuIn 140ms ease both;
}
@keyframes csMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.cs-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.cs-option:hover, .cs-option.focused { background: var(--surface-soft); }
.cs-option.selected {
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 800;
}
.cs-option:disabled { opacity: 0.45; cursor: not-allowed; }
.cs-option-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cs-check { flex: none; width: 14px; height: 14px; color: var(--teal); }

@media (prefers-reduced-motion: reduce) {
  .cs-menu, .cs-chevron { animation: none; transition: none; }
}

/* ============ 自定义日期范围选择（统一站点时间选择器） ============ */
.dr-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  outline: none;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.dr-trigger:hover { border-color: var(--teal); }
.dr-trigger.open, .dr-trigger:focus-visible { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(53, 109, 243, .12); }
.dr-trigger:disabled { opacity: .5; cursor: not-allowed; }
.dr-trigger .dr-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
}
.dr-trigger.has-value .dr-value { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.dr-trigger .dr-icon { flex: none; width: 15px; height: 15px; color: var(--faint); }
.dr-trigger.open .dr-icon { color: var(--teal); }

.dr-pop {
  position: fixed;
  z-index: 340;
  width: 336px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(17, 26, 43, .2);
  animation: csMenuIn 140ms ease both;
}
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dr-head strong { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
.dr-nav {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.dr-nav:hover { border-color: var(--teal); color: var(--teal); }
.dr-nav svg { width: 14px; height: 14px; }

.dr-week, .dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dr-week span { padding: 4px 0 6px; text-align: center; color: var(--faint); font-size: 11px; font-weight: 700; }
.dr-day {
  display: grid;
  place-items: center;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.dr-day.empty { cursor: default; }
.dr-day:hover:not(.empty) { background: var(--surface-soft); }
.dr-day.today { color: var(--teal); }
.dr-day.in-range { background: var(--teal-soft); color: var(--teal-deep); }
.dr-day.start, .dr-day.end {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(53, 109, 243, .26);
}
.dr-day.start:hover, .dr-day.end:hover { background: var(--teal-deep); }

.dr-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dr-shortcut {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.dr-shortcut:hover { border-color: var(--teal); color: var(--teal); }
.dr-done {
  margin-left: auto;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(53, 109, 243, .26);
}
.dr-done:hover { background: var(--teal-deep); }

/* ---------- 经营总览 · 销售额看板 ---------- */
.sales-board-card { margin-top: 16px; }
.sales-board-card .card-head { align-items: center; margin-bottom: 10px; }
.sales-status {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}
.sales-status-warn { color: var(--red); font-weight: 700; cursor: help; }
.sales-table th:first-child { width: 38%; }
.sales-table .sales-range-label { font-weight: 700; }
.sales-table .sales-range-value { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.sales-table .sales-chevron { width: 28px; text-align: right; color: var(--faint); }
.sales-table tbody tr:nth-child(even) { background: var(--surface-soft); }

/* ============ 订单管理 ============ */
.orders-toolbar { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; }
.orders-search { max-width: 560px; }
.orders-toolbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.orders-selected { padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 800; }
.orders-selected[hidden], .orders-empty[hidden], #ordersTableWrap[hidden] { display: none; }

.chip.busy { animation: ordersPulse 1.1s ease-in-out infinite; }
@keyframes ordersPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.urgency-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 0 2px 12px; color: var(--muted); font-size: 11px; font-weight: 700;
}
.urgency-label { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.urgency-dot { display: inline-flex; align-items: center; gap: 6px; }
.urgency-dot i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.urgency-dot.urgent i { background: #f0a23a; box-shadow: 0 0 0 3px rgba(240, 162, 58, .16); }
.urgency-dot.late i { background: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .16); }
.urgency-note { margin-left: auto; color: var(--faint); font-weight: 600; }

.orders-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 12px; margin: 0 2px 14px; }
.ofield { display: grid; gap: 6px; min-width: 0; }
.ofield > span { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.ofield input {
  width: 100%; padding: 9px 10px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; outline: none;
}
.ofield input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(53, 109, 243, .1); }
.ofield .cs-wrap, .ofield .cs-trigger { width: 100%; }
.ofield-range { grid-column: span 2; }

.orders-card { overflow: hidden; }

.pager-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pager-select { min-width: 58px; }
.pager-select.cs-trigger { padding: 5px 8px; font-size: 11px; }

.orders-table { min-width: 1000px; }
.orders-table th.col-check, .orders-table td.col-check { width: 38px; padding-right: 0; }
.orders-table .col-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.orders-table th.col-num, .orders-table td.col-num { text-align: right; }
.orders-table .col-num { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.orders-table .col-date { white-space: nowrap; }
.orders-table .col-mono { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.orders-table .col-action { width: 56px; text-align: right; }
.orders-table tbody tr.is-selected td { background: var(--teal-soft); }
.orders-table tbody tr.is-selected:hover td { background: #e5efff; }

.order-date { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-date.urgent::before, .order-date.late::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.order-date.urgent::before { background: #f0a23a; }
.order-date.late::before { background: #e5484d; }
.cell-stack { display: grid; gap: 2px; min-width: 0; }
.cell-sub { color: var(--faint); font-size: 10.5px; font-weight: 600; }
.cell-product-main { display: grid; gap: 2px; min-width: 0; }
.order-product {
  color: var(--text); font-weight: 700; text-decoration: none; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 360px;
}
.order-product:hover { color: var(--teal); }
.order-shipment { color: var(--text); font-weight: 700; }
.region-tag {
  display: inline-flex; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-soft); color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .03em;
}
.order-open {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.order-open svg { width: 15px; height: 15px; }
.order-open:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.orders-empty { display: grid; place-items: center; gap: 6px; padding: 58px 20px 64px; text-align: center; }
.orders-empty svg { width: 26px; height: 26px; color: var(--faint); margin-bottom: 4px; }
.orders-empty strong { color: var(--text); font-size: 14px; }
.orders-empty p { margin: 0; color: var(--faint); font-size: 12px; }
.orders-empty .button { margin-top: 8px; }

.seg-tabs button .tab-count {
  margin-left: 7px; padding: 1px 6px; border-radius: 999px;
  background: rgba(53, 109, 243, .12); color: var(--teal);
  font-size: 10px; font-weight: 800;
}
.seg-tabs button:not(.active) .tab-count { background: #e7ecf5; color: var(--faint); }

.order-detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.order-stat { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.order-stat > span { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.order-stat > strong { color: var(--text); font-size: 12.5px; font-weight: 700; }
.order-detail-table .cell-product { min-width: 220px; }
.orders-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 46px 10px; color: var(--muted); font-size: 12px; }
.orders-loading.error { color: var(--red); }

@media (max-width: 820px) {
  .orders-toolbar { flex-wrap: wrap; }
  .orders-search { max-width: none; width: 100%; }
  .orders-toolbar-actions { margin-left: 0; width: 100%; justify-content: space-between; }
  .urgency-note { margin-left: 0; width: 100%; }
  .pagination { flex-wrap: wrap; }
  .pagination-actions { flex-wrap: wrap; }
  .orders-table { min-width: 860px; }
}
@media (max-width: 420px) {
  .ofield-range { grid-column: span 1; }
}

/* ============ 商品管理列表 ============ */
.product-pager { border-top: 0; padding: 12px 0 0; }
#view-products > .section-head {
  align-items: center;
  margin-bottom: 16px;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 86% 0%, rgba(53, 109, 243, .17), transparent 64%),
    linear-gradient(140deg, var(--surface), var(--surface-soft));
  box-shadow: 0 12px 26px rgba(27, 55, 104, .07);
}
#view-products > .section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}
#view-products #productSummary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#view-products #productSummary .summary-card {
  min-width: 0;
  padding: 13px clamp(10px, 2vw, 18px);
  border-inline-start: 3px solid var(--teal);
  background: linear-gradient(125deg, var(--surface), var(--surface-soft));
}
#view-products #productSummary .summary-card:nth-child(2) { border-inline-start-color: var(--green); }
#view-products #productSummary .summary-card:nth-child(3) { border-inline-start-color: var(--faint); }
#view-products #productSummary .summary-card strong {
  color: var(--text);
  font-size: clamp(18px, 2.5vw, 27px);
  overflow-wrap: anywhere;
}
#view-products .product-table thead th { background: #edf3fd; }
#view-products .product-table td.num { font-variant-numeric: tabular-nums; font-weight: 800; }
#view-products .product-table tbody tr:focus-within { background: #f1f6ff; }
@media (max-width: 820px) {
  #view-products > .section-head { align-items: flex-start; gap: 12px; }
}
@media (max-width: 520px) {
  #view-products #productSummary { gap: 6px; }
  #view-products #productSummary .summary-card span { overflow-wrap: anywhere; }
}
#view-products .product-filters {
  display: grid;
  grid-template-columns: minmax(0, 390px) repeat(2, minmax(145px, 180px));
  justify-content: start;
  align-items: end;
}
#view-products .product-filters > .field { min-width: 0; }
#view-products .product-table { min-width: 930px; }
#view-products .product-table .cell-product { min-width: 252px; }
#view-products .product-table .cell-title { max-width: clamp(190px, 22vw, 340px); }
#view-products .product-package-spec,
#view-products .product-table .cell-ids,
#view-products .product-synced,
#view-products .product-action { white-space: nowrap; }
#view-products .product-package-spec,
#view-products .product-synced { color: var(--muted); }
#view-products .product-table .cell-ids {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
#view-products .product-action { text-align: right; }
@media (max-width: 520px) {
  #view-products .product-filters { grid-template-columns: minmax(0, 1fr); }
}

/* 企业与货源管理：沿用全站 card / data-table / modal 组件 */
.enterprise-person { display:flex; align-items:center; gap:12px; }
.enterprise-avatar { display:grid; place-items:center; width:36px; height:36px; flex-shrink:0; border-radius:10px; background:var(--teal-soft); color:var(--teal); font-size:14px; font-weight:700; }
.enterprise-tags { display:flex; flex-wrap:wrap; gap:6px; max-width:360px; }
.chip.enterprise-accent { color:var(--teal); background:var(--teal-soft); border-color:transparent; }
.enterprise-toolbar { display:flex; align-items:center; gap:12px; padding:4px 0 18px; }
.enterprise-search { flex:1; max-width:440px; }
.enterprise-pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 0 2px; border-top:1px solid var(--line); }
.enterprise-product-title { max-width:400px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#view-bindings .enterprise-binding-table { min-width:680px; table-layout:fixed; }
#view-bindings .enterprise-binding-table th:first-child { width:40%; }
#view-bindings .enterprise-binding-table th:last-child { width:92px; text-align:right; }
#view-bindings .row-actions { white-space:nowrap; }
#view-bindings .binding-source-group > summary { cursor:pointer; }
#view-bindings .binding-source-group > summary .thumb { display:inline-grid; vertical-align:middle; margin-right:8px; }
#view-bindings .queue-thumb { flex:none; }
#view-bindings .binding-source-count { margin-right:8px; font-weight:600; }
#view-bindings .binding-sources { margin-top:8px; border-top:1px solid var(--line); }
#view-bindings .binding-sources .binding-source { padding:7px 0; }
#view-bindings .binding-sources .binding-source + .binding-source { border-top:1px solid var(--line); }
#view-bindings .binding-source { display:grid; grid-template-columns:auto minmax(0,1fr) max-content 36px; align-items:center; gap:8px; }
#view-bindings .binding-source-text { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.enterprise-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.enterprise-binding-summary { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.enterprise-shop-list { display:grid; gap:10px; max-height:380px; overflow:auto; }
.enterprise-shop-option { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.enterprise-shop-option:has(input:checked) { border-color:var(--teal); background:var(--teal-soft); }
.enterprise-shop-option input { accent-color:var(--teal); width:16px; height:16px; }
.enterprise-shop-option strong { display:block; font-size:13px; }
.enterprise-shop-option small { display:block; color:var(--muted); margin-top:4px; }
@media(max-width:700px) { .enterprise-toolbar,.enterprise-pagination { flex-wrap:wrap; } .enterprise-search { max-width:none; min-width:180px; } .enterprise-product-title { max-width:230px; } }

/* ERP 业务模块导航 */
.erp-nav { flex:1; min-height:0; overflow-y:auto; align-content:start; gap:8px; scrollbar-width:thin; padding:2px 0 10px; }
.nav-module { border-bottom:1px solid var(--line); padding-bottom:8px; }
.nav-module:last-child { border-bottom:0; }
.nav-module > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 10px 8px; color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.06em; list-style:none; cursor:pointer; user-select:none; border-radius:8px; }
.nav-module > summary::-webkit-details-marker { display:none; }
.nav-module > summary:hover { color:var(--text); }
.nav-module.is-current > summary { color:var(--teal); font-weight:600; }
.nav-module > summary:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
.nav-module-chevron { width:12px; height:12px; transition:transform .18s; }
.nav-module[open] > summary .nav-module-chevron { transform:rotate(90deg); }
.nav-module-items { display:grid; gap:3px; padding:3px 0; }
.nav-module .nav-item { min-height:38px; padding:9px 12px; }
.nav-module .nav-item[hidden] { display:none; }
.sidebar-brand,.side-card,.side-foot { flex-shrink:0; }
@media(max-width:820px) {
  .erp-nav { flex:none; overflow:visible; display:flex; align-items:center; gap:10px; padding:0; }
  .nav-module { flex-shrink:0; border:0; border-right:1px solid var(--line); padding:0 10px 0 0; }
  .nav-module > summary { display:none; }
  .nav-module > .nav-module-items { display:flex; gap:4px; padding:0; }
  .nav-module::details-content { content-visibility:visible; }
  .nav-module .nav-item { min-height:34px; padding:6px 10px; }
  #pageModule,#pageModule + i { display:none; }
}


/* 桌面菜单：优先保证阅读字号，空间通过分组与紧凑辅助信息调节。 */
@media (min-width:821px) {
  .sidebar { width:232px; gap:12px; padding:16px 12px 12px; background:#f6f8fb; }
  .main { margin-left:232px; width:calc(100% - 232px); }
  .sidebar-brand { padding:2px 8px 14px; }
  .sidebar .brand { gap:12px; }
  .sidebar .brand-mark { width:36px; height:36px; font-size:15px; border-radius:10px; }
  .sidebar .brand-text strong { font-size:16px; letter-spacing:.04em; }
  .sidebar .brand-text small { font-size:11px; letter-spacing:.02em; }
  .erp-nav { gap:6px; padding:0 2px; }
  .nav-module { border:0; padding:0; }
  .nav-module > summary { padding:6px 10px; font-size:12px; line-height:18px; font-weight:500; letter-spacing:.02em; color:var(--muted); }
  .nav-module-chevron { width:14px; height:14px; opacity:.4; transition:transform .18s, opacity .18s; }
  .nav-module > summary:hover .nav-module-chevron { opacity:1; }
  .nav-module-items { gap:2px; padding:2px 0; }
  .nav-module .nav-item { min-height:38px; padding:7px 12px; font-size:15px; line-height:22px; font-weight:500; gap:11px; border-radius:9px; white-space:nowrap; }
  .nav-module .nav-item svg { width:18px; height:18px; flex:none; }
  .nav-module .nav-item:hover { transform:none; }
  .nav-module .nav-item.active { font-weight:600; background:linear-gradient(135deg,#e8f0ff,#dbeafe); color:#1d4ed8; box-shadow:none; }
  .nav-module .nav-item:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
  .sidebar .nav-tag { font-size:10px; padding:1px 6px; }
  .sidebar .side-card { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0; padding:10px 12px; border-radius:9px; box-shadow:none; background:var(--surface-soft); }
  .sidebar .side-card-title { font-size:12px; letter-spacing:0; }
  .sidebar .side-card-value { margin:0; font-size:14px; line-height:20px; }
  .sidebar .side-card-note { display:none; }
  .sidebar .side-foot { font-size:11px; line-height:16px; padding:0 10px; }
}
@media (min-width:821px) and (max-height:780px) {
  .sidebar { gap:8px; padding-top:10px; padding-bottom:8px; }
  .sidebar-brand { padding-bottom:10px; }
  .erp-nav { gap:3px; }
  .nav-module > summary { padding-top:3px; padding-bottom:3px; }
  .nav-module-items { gap:1px; padding:1px 0; }
  .nav-module .nav-item { min-height:36px; padding-top:6px; padding-bottom:6px; }
  .sidebar .side-card { padding:7px 12px; }
  .sidebar .side-foot { display:none; }
}
@media(max-width:820px) {
  .main { padding:16px 16px 32px; }
  .nav-module .nav-item { font-size:14px; line-height:22px; min-height:40px; padding:8px 12px; }
}

/* 成员列表复用店铺管理的表格、角色徽标和同行操作布局。 */
#view-enterprise .member-toolbar { justify-content:flex-start; margin:18px 0; }
#view-enterprise .member-toolbar .search-input-wrap { max-width:340px; }
#view-enterprise .member-table { min-width:800px; table-layout:fixed; }
#view-enterprise .member-name-col { width:17%; }
#view-enterprise .member-phone-col { width:17%; }
#view-enterprise .member-role-col { width:12%; }
#view-enterprise .member-actions-col { width:210px; }
#view-enterprise .member-table td { padding-top:15px; padding-bottom:15px; }
#view-enterprise .member-table .cell-title { max-width:100%; }
#view-enterprise .member-table .row-actions { white-space:nowrap; }
#view-enterprise .member-table tr[hidden] { display:none; }
#view-enterprise .member-list-foot { margin:0; padding-top:16px; border-top:1px solid var(--line); }
@media(max-width:700px) {
  #view-enterprise .member-toolbar { flex-wrap:wrap; }
  #view-enterprise .member-toolbar .search-input-wrap { max-width:none; min-width:180px; }
}

/* 热销榜：金额保留完整宽度，长商品信息只在中间列省略。 */
#view-dashboard .ops-bottom-grid > .card { min-width:0; }
#view-dashboard #top_products { min-width:0; grid-template-columns:minmax(0,1fr); }
#view-dashboard #top_products .ops-rank-row { min-width:0; width:100%; max-width:100%; grid-template-columns:16px 30px minmax(0,1fr) max-content; }
#view-dashboard #top_products .ops-rank-meta { flex:1 1 0%; min-width:0; overflow:hidden; }
#view-dashboard #top_products .ops-rank-title,
#view-dashboard #top_products .ops-rank-sub { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#view-dashboard #top_products .ops-rank-value { justify-self:end; font-variant-numeric:tabular-nums; }

/* 选品右栏：货源选择直接入队，与站内表单风格一致。 */
#wbDetail .wb-source-queue { display:inline-flex; align-items:center; gap:7px; color:var(--teal); font-size:11px; font-weight:700; cursor:pointer; }
#wbDetail .wb-source-queue input { width:15px; height:15px; margin:0; accent-color:var(--teal); }
#wbDetail .wb-source-queue:has(input:disabled) { cursor:default; color:var(--muted); }
#wbDetail .wb-offer-actions { flex-wrap:wrap; gap:10px; }
#wbDetail .wb-offer-main { min-width:0; }
#wbDetail .wb-source-bulk {
  display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap;
  padding:8px 10px; border:1px solid var(--line); border-radius:9px;
  background:var(--surface-soft); font-size:11px; color:var(--muted);
}
#wbDetail .wb-source-bulk > span { font-weight:700; }
#wbDetail .wb-source-bulk-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }


/* 企业资料：复用本站卡片与表单视觉，资料行保持统一对齐。 */
#view-company .company-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:20px; align-items:start; }
#view-company .company-overview { padding:24px; }
#view-company .company-mark { display:grid; place-items:center; width:48px; height:48px; margin-bottom:18px; background:var(--teal-soft); color:var(--teal); border-radius:12px; }
#view-company .company-mark svg { width:25px; height:25px; }
#view-company .company-overview h3 { margin:0 0 20px; font-size:18px; line-height:1.5; overflow-wrap:anywhere; }
#view-company .company-role { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; border-top:1px solid var(--line); }
#view-company .company-note { margin:0 0 20px; color:var(--muted); font-size:12px; line-height:1.8; }
#view-company .company-members { display:flex; justify-content:space-between; width:100%; text-decoration:none; }
#view-company .company-details { min-width:0; padding:24px; }
#view-company .company-details .card-head { align-items:center; gap:16px; margin-bottom:20px; }
#view-company .company-details .card-head .button { flex-shrink:0; white-space:nowrap; }
#view-company .company-fields { margin:0; border-top:1px solid var(--line); }
#view-company .company-field { display:grid; grid-template-columns:120px minmax(0,1fr); gap:24px; align-items:baseline; padding:20px 4px; border-bottom:1px solid var(--line); }
#view-company .company-field dt { color:var(--muted); font-size:12px; }
#view-company .company-field dd { margin:0; color:var(--text); font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
#view-company .company-field .company-unset { color:var(--faint); }
#view-company .company-details-foot { display:flex; align-items:flex-start; gap:8px; margin-top:18px; color:var(--faint); font-size:11px; line-height:1.7; }
#view-company .company-details-foot svg { flex:none; width:15px; height:15px; margin-top:2px; }
@media(max-width:1100px) { #view-company .company-layout { grid-template-columns:240px minmax(0,1fr); gap:16px; } #view-company .company-field { grid-template-columns:88px minmax(0,1fr); gap:16px; } }
@media(max-width:900px) { #view-company .company-layout { grid-template-columns:minmax(0,1fr); } }
@media(max-width:480px) { #view-company .company-details,#view-company .company-overview { padding:18px; } #view-company .company-field { grid-template-columns:minmax(0,1fr); gap:6px; padding:16px 0; } }

/* 选品详情顶部保留平台信息，长标题与售价在侧栏内自然换行。 */
#wbDetail .wb-detail-title { min-width:0; flex:1; }
#wbDetail .wb-detail-title h3 { overflow-wrap:anywhere; }
#wbDetail .wb-detail-meta { flex-wrap:wrap; overflow-wrap:anywhere; }
#wbDetail .wb-detail-price { flex-wrap:wrap; }

/* 账户设置沿用全站表单和分段标签，仅补充弹窗内布局。 */
#accountSettings .seg-tabs { display: flex; margin: 0 0 18px; }
#accountSettings .seg-tabs button { flex: 1; }
#accountSettings .account-note { margin: 0 0 14px; font-size: 12px; line-height: 1.65; }
#accountSettings input[readonly] { color: var(--muted); }

/* 上架流程：沿用管理页卡片、分段筛选和表格，仅限定局部布局。 */
#sourcingTabQueue .listing-toolbar { flex-wrap: wrap; gap: 12px; margin: 18px 0; }
#sourcingTabQueue .listing-stages { display: flex; flex-wrap: wrap; margin: 0; gap: 4px; }
#sourcingTabQueue .listing-stages button { white-space: nowrap; }
#sourcingTabQueue .listing-stages button span { margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
#sourcingTabQueue .listing-total { white-space: nowrap; font-size: 12px; }
#sourcingTabQueue .listing-select-all { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
#sourcingTabQueue .listing-select-all input { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
#sourcingTabQueue .listing-table { min-width: 940px; }
#sourcingTabQueue .listing-table .cell-title { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sourcingTabQueue .listing-table td { vertical-align: middle; }
#sourcingTabQueue .listing-table .row-actions { flex-wrap: nowrap; white-space: nowrap; }
#sourcingTabQueue .listing-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
@media (max-width: 700px) {
  #sourcingTabQueue .listing-stages { width: 100%; }
  #sourcingTabQueue .card-head { flex-wrap: wrap; }
}

/* 上架流程与关联采购货源 */
#sourcingTabQueue .queue-group { margin-bottom: 16px; }
#sourcingTabQueue .queue-group-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; padding: 16px; }
#sourcingTabQueue .queue-head-main { min-width: 0; }
#sourcingTabQueue .queue-listing-action { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
#sourcingTabQueue .queue-listing-action .queue-meta { max-width: 220px; }
#sourcingTabQueue .queue-role { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
#sourcingTabQueue .queue-group-head .queue-thumb { width: 48px; height: 48px; }
#sourcingTabQueue .queue-group-head .queue-title { font-size: 14px; }
#sourcingTabQueue .queue-source-heading { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
#sourcingTabQueue .queue-sources { margin-left: 24px; border-left: 2px solid var(--line); }
#sourcingTabQueue .queue-source { padding: 14px 16px; grid-template-columns: minmax(0,1fr) 150px; }
.listing-dialog .listing-step { color: var(--teal); font-weight: 600; }
.listing-dialog > .toolbar { flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 1000px) {
  #sourcingTabQueue .queue-group-head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  #sourcingTabQueue .queue-sources { margin-left: 10px; }
  #sourcingTabQueue .queue-source { grid-template-columns: minmax(0,1fr); }
  #sourcingTabQueue .queue-prices { text-align: left; }
}

/* 成本核算 · 卡片内行内展开 */
#sourcingTabQueue .cost-card .queue-group-head { align-items: flex-start; }
#sourcingTabQueue .cost-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
#sourcingTabQueue .cost-result { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
#sourcingTabQueue .cost-result b { color: var(--teal); font-size: 13px; }
.listing-source-search .listing-search-reference { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.listing-source-search [role="status"]:empty { display: none; }
.listing-source-search .listing-search-reference strong { color: var(--text); margin-left: 5px; }
.listing-source-search .listing-search-table-wrap { margin: 0; border: 1px solid var(--line); border-radius: 9px; }
.listing-source-search .listing-search-table { min-width: 850px; }
.listing-source-search .listing-search-table td { vertical-align: middle; }
.listing-source-search .listing-search-table .cell-product { min-width: 210px; }
.listing-source-search .listing-search-table .cell-product-main { min-width: 0; }
.listing-source-search .listing-search-table .queue-thumb { flex: 0 0 40px; width: 40px; height: 40px; }
.listing-source-search .listing-search-title { display: block; max-width: 230px; color: var(--teal); }
.listing-source-search .listing-search-profit { display: inline-block; padding: 3px 6px; border-radius: 5px; color: var(--green); background: var(--green-soft); font-weight: 700; white-space: nowrap; }
.listing-source-search .listing-search-profit.is-loss { color: var(--red); background: var(--red-soft); }
.listing-source-search .listing-search-table tr.is-selected { background: var(--teal-soft); }
.listing-source-search .cost-candidate-actions { position: sticky; bottom: -20px; z-index: 1; margin: 12px 0 -20px; padding: 12px 0 20px; background: var(--surface); flex-wrap: wrap; }
.listing-source-search .cost-candidate-actions .row-actions { flex-wrap: wrap; }
#sourcingTabQueue .listing-cost-table .listing-product-source-actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
#sourcingTabQueue .listing-product-source-actions .link-btn { padding: 0; font-size: 12px; }
@media (max-width: 900px) {
  #sourcingTabQueue .cost-badges { justify-content: flex-start; }
}

/* Listing confirmation modal */
#sourcingTabQueue .queue-variants { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
#sourcingTabQueue .queue-variant { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--muted); font-size: 12px; }
#sourcingTabQueue .queue-variants .queue-thumb { flex: 0 0 32px; width: 32px; height: 32px; }
.listing-confirm .table-wrap { overflow-x: auto; margin: 0; }
.listing-confirm-table { min-width: 860px; }
.listing-confirm-table .cell-title { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-confirm-table .cell-product { min-width: 220px; }
.listing-confirm-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.listing-confirm-table .col-check { width: 44px; }
.listing-confirm-table .col-check input { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.listing-confirm-table .col-num { width: 104px; }
.listing-confirm-table .col-result { width: 120px; text-align: right; white-space: nowrap; }
.listing-confirm-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; margin-bottom: 14px;
  border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: 8px; background: var(--teal-soft);
  color: var(--text); font-size: 12.5px; line-height: 1.6;
}
.listing-confirm-note .note-mark {
  flex: 0 0 auto; width: 18px; height: 18px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: 12px; font-weight: 800; font-style: italic;
}
.listing-confirm-errors { margin: -4px 0 14px; color: var(--red); font-size: 12px; }
.listing-confirm-errors p { margin: 4px 0 0; }
.listing-confirm .num-input {
  width: 92px; padding: 7px 9px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right;
  outline: none; transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.listing-confirm .num-input:hover { border-color: var(--muted); }
.listing-confirm .num-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 118, 108, 0.12); }
.listing-confirm .num-input:disabled { background: var(--surface-soft); color: var(--faint); cursor: not-allowed; }
.listing-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.listing-confirm .result-error { color: var(--red); font-size: 11px; font-weight: 600; white-space: normal; }

#sourcingTabQueue .queue-linked-sources { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }
#sourcingTabQueue .queue-linked-sources a { max-width: min(290px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-dialog .listing-cost-detail { display: grid; gap: 12px; margin: 0 0 12px; }
.listing-dialog .listing-cost-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0 0; }
.listing-dialog .listing-cost-values dt { color: var(--muted); font-size: 12px; }
.listing-dialog .listing-cost-values dd { margin: 4px 0 0; font-weight: 600; }

#sourcingTabQueue .queue-cost-sources { display: grid; gap: 8px; }
#sourcingTabQueue .queue-cost-source-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 14px; }
.listing-dialog .listing-cost-edit { margin-block: 12px; }
.listing-dialog .listing-detail-disclosure.listing-cost-edit { padding: 0; overflow: hidden; }
.listing-dialog .listing-cost-edit > summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--surface-soft); font-size: 14px; list-style: none; }
.listing-dialog .listing-cost-edit > summary::-webkit-details-marker { display: none; }
.listing-dialog .listing-cost-edit > summary::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.listing-dialog .listing-cost-edit[open] > summary { border-bottom: 1px solid var(--line); }
.listing-dialog .listing-cost-edit[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
.listing-dialog .listing-parameter-sections { padding: 0 16px; }
.listing-dialog .listing-parameter-section { padding: 16px 0; }
.listing-dialog .listing-parameter-section + .listing-parameter-section { border-top: 1px solid var(--line); }
.listing-dialog .listing-parameter-head { margin: 0 0 12px; }
.listing-dialog .listing-parameter-head h4 { margin: 0; font-size: 13px; font-weight: 700; }
.listing-dialog .listing-parameter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.listing-dialog .listing-parameter-platform { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.listing-dialog .listing-parameter-wide { grid-column: span 2; }
.listing-dialog .listing-parameter-field { min-width: 0; margin: 0; gap: 6px; }
.listing-dialog .listing-parameter-label { color: var(--muted); font-size: 12px; line-height: 1.5; }
.listing-dialog .listing-parameter-field input,
.listing-dialog .listing-parameter-field select { min-width: 0; font-size: 13px; }
.listing-dialog .listing-parameter-field.is-readonly input,
.listing-dialog .listing-parameter-field.is-readonly select:not(.cs-native),
.listing-dialog .listing-parameter-field.is-readonly .cs-trigger { padding: 0; height: 24px; border: 0; border-radius: 0; background: transparent; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.listing-dialog .listing-parameter-field.is-readonly .cs-chevron { display: none; }
.listing-dialog .listing-parameter-field.is-readonly select:not(.cs-native) { appearance: none; }
.listing-dialog .listing-parameter-field.is-readonly input::placeholder { color: var(--faint); -webkit-text-fill-color: var(--faint); }
.listing-dialog .listing-parameter-field.is-readonly input[type="number"] { appearance: textfield; }
.listing-dialog .listing-parameter-field.is-readonly input::-webkit-inner-spin-button,
.listing-dialog .listing-parameter-field.is-readonly input::-webkit-outer-spin-button { appearance: none; margin: 0; }

.listing-dialog .listing-result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.listing-dialog .listing-result-head h4,
.listing-dialog .profit-card h4 { margin: 0 0 8px; font-size: 14px; }
.listing-dialog .listing-result-head h4 { margin: 0; }
.listing-dialog .profit-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.listing-dialog .profit-metrics .profit-metric { min-width: 0; padding: 12px 16px; border: 0; border-radius: 0; background: transparent; }
.listing-dialog .profit-metrics .profit-metric + .profit-metric { border-left: 1px solid var(--line); }
.listing-dialog .profit-metrics .profit-metric strong { margin-top: 4px; font-size: 19px; }
.listing-dialog .listing-detail-summary { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.listing-dialog .listing-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.listing-dialog .listing-pricing-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.listing-dialog .listing-price-metric { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.listing-dialog .listing-price-metric span, .listing-dialog .listing-price-metric small { display: block; color: var(--muted); font-size: 12px; }
.listing-dialog .listing-price-metric strong { display: block; margin-top: 5px; color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.listing-dialog .listing-price-metric.market { background: var(--blue-soft); }
.listing-dialog .listing-price-metric.market strong { color: var(--blue); }
.listing-dialog .listing-price-metric.break-even { background: var(--green-soft); }
.listing-dialog .listing-price-metric.break-even strong { color: var(--green); }
.listing-dialog .listing-price-metric small { margin-top: 4px; }
.listing-dialog .listing-detail-summary .profit-card { padding: 14px 16px; border-color: var(--line); border-radius: 10px; }
.listing-dialog .listing-detail-summary .queue-product { display: flex; align-items: flex-start; gap: 10px; }
.listing-dialog .listing-detail-summary .queue-thumb { flex: 0 0 44px; width: 44px; height: 44px; }
.listing-dialog .listing-detail-summary p { margin: 6px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.listing-dialog .listing-summary-content { min-width: 0; }
.listing-dialog .listing-summary-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.45; font-weight: 700; overflow-wrap: anywhere; }
.listing-dialog a.listing-summary-title { color: var(--teal); }
.listing-dialog .listing-cost-empty { padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.listing-dialog .listing-operating-settings { padding: 16px; border-color: var(--line); border-radius: 10px; background: var(--surface-soft); }
.listing-dialog .listing-operating-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.listing-dialog .listing-operating-head h4 { margin: 0; font-size: 14px; }
.listing-dialog .listing-protection-reference { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.listing-dialog .listing-protection-reference strong { color: var(--text); font-variant-numeric: tabular-nums; }
.listing-dialog .listing-operating-settings p,
.listing-dialog .listing-action-row p { margin: 5px 0 0; font-size: 13px; }
.listing-dialog .listing-operating-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 150px)) minmax(0, 1fr) auto; align-items: end; gap: 12px 16px; margin-top: 12px; }
.listing-dialog .listing-operating-controls .field input { font-weight: 700; background: var(--surface); }
.listing-dialog .listing-operating-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 36px; }
.listing-dialog .listing-operating-options label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.listing-dialog .listing-operating-options input { margin: 0; accent-color: var(--teal); }
.listing-dialog .listing-protection-profit:not([hidden]) {
 display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
 margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
 color: var(--muted); font-size: 13px;
}
.listing-dialog .listing-protection-profit output { color: var(--green); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.listing-dialog .listing-protection-profit.is-loss output { color: var(--red); }
.listing-dialog .listing-edit-footer { justify-content: flex-end; margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
.listing-dialog .listing-action-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.listing-dialog .listing-online-price { align-items: end; }
.listing-dialog .listing-online-price .field { width: min(100%, 180px); }
.listing-dialog .listing-detail-note { margin: 12px 0; }
@media (max-width: 740px) {
 .listing-dialog .listing-operating-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
 .listing-dialog .listing-operating-options { grid-column: 1 / -1; }
 .listing-dialog .listing-operating-controls .button { justify-self: start; }
}
@media (max-width: 600px) {
 .listing-dialog .listing-parameter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .listing-dialog .listing-pricing-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .listing-dialog .listing-detail-summary, .listing-dialog .listing-breakdown { grid-template-columns: minmax(0, 1fr); }
 .listing-dialog .profit-metrics { gap: 6px; }
 .listing-dialog .profit-metrics .profit-metric { padding: 9px; }
 .listing-dialog .profit-metrics .profit-metric strong { font-size: 15px; overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
 .listing-dialog .listing-parameter-grid { grid-template-columns: minmax(0, 1fr); }
 .listing-dialog .listing-parameter-wide { grid-column: auto; }
}

#sourcingTabQueue .listing-cost-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
#sourcingTabQueue .listing-cost-table { min-width: 1080px; table-layout: fixed; }
#sourcingTabQueue .listing-cost-product > td { padding: 16px 14px; vertical-align: top; }
#sourcingTabQueue .listing-cost-product .cell-product { align-items: flex-start; min-width: 0; }
#sourcingTabQueue .listing-cost-product .cell-product-main { flex: 1; min-width: 0; }
#sourcingTabQueue .listing-cost-product .cell-title { font-size: 13px; line-height: 1.5; }
#sourcingTabQueue .listing-cost-product .queue-thumb { width: 40px; height: 40px; }
#sourcingTabQueue .listing-cost-table .row-actions { flex-wrap: nowrap; white-space: nowrap; }
#sourcingTabQueue .listing-cost-child > td { padding: 0 14px 14px; background: var(--surface-soft); }
#sourcingTabQueue .listing-source-detail { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
#sourcingTabQueue .listing-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; font-size: 12px; border-bottom: 1px solid var(--line); }
#sourcingTabQueue .listing-source-heading strong .muted { margin-left: 6px; font-weight: 400; }
#sourcingTabQueue .listing-source-table th, #sourcingTabQueue .listing-source-table td { padding: 9px 12px; font-size: 12px; }
#sourcingTabQueue .listing-source-table .listing-source-link { display: flex; max-width: 100%; }
#sourcingTabQueue .listing-source-table .row-actions { justify-content: flex-start; gap: 8px; }

#sourcingTabQueue .listing-source-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 14px; padding: 8px 12px 0; font-size: 12px; }
#sourcingTabQueue .listing-source-summary span { color: var(--muted); }
#sourcingTabQueue .listing-source-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
#sourcingTabQueue .listing-source-summary a { max-width: min(320px, 100%); }
#sourcingTabQueue .listing-source-disclosure summary { cursor: pointer; padding: 6px 12px 8px; font-size: 12px; color: var(--teal); }
#sourcingTabQueue .listing-source-disclosure[open] summary { border-bottom: 1px solid var(--line); }
.listing-dialog .listing-detail-disclosure { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.listing-dialog .listing-detail-disclosure summary { cursor: pointer; font-weight: 600; }
.listing-dialog .listing-detail-disclosure .listing-breakdown { margin-top: 10px; }

#sourcingTabQueue .listing-source-summary { align-items: center; }
#sourcingTabQueue .listing-source-link { display: flex; min-width: 0; align-items: center; gap: 8px; }
#sourcingTabQueue .listing-source-link .queue-truncate { min-width: 0; }
#sourcingTabQueue .listing-source-link .queue-thumb { width: 32px; height: 32px; }
#sourcingTabQueue .listing-source-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 5px 10px; border-radius: 7px; background: var(--green-soft); }
#sourcingTabQueue .listing-source-metrics b { color: var(--green); }
#sourcingTabQueue .listing-source-metrics.is-loss { background: var(--red-soft); }
#sourcingTabQueue .listing-source-metrics.is-loss b { color: var(--red); }

#sourcingTabQueue .listing-cost-child[hidden] { display: none; }
#sourcingTabQueue .listing-package-spec { margin-top: 4px; font-size: 12px; line-height: 1.65; font-variant-numeric: tabular-nums; }
#sourcingTabQueue .listing-package-spec .link-btn { padding: 0; margin-left: 4px; font-size: 12px; }
#sourcingTabQueue .listing-source-toggle { padding: 0; font-size: 12px; }
#sourcingTabQueue .listing-source-toggle::before { content: '▸ '; }
#sourcingTabQueue .listing-source-toggle[aria-expanded="true"]::before { content: '▾ '; }
#sourcingTabQueue .listing-cost-price-value { display: block; margin-top: 3px; font-size: 17px; line-height: 1.5; white-space: nowrap; font-variant-numeric: tabular-nums; }
#sourcingTabQueue .listing-cost-price-value.market { color: var(--blue); }
#sourcingTabQueue .listing-cost-secondary { margin-top: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#sourcingTabQueue .listing-cost-secondary b { margin-left: 4px; color: var(--text); font-weight: 600; white-space: nowrap; }
#sourcingTabQueue .listing-cost-ratios { display: grid; gap: 4px; margin: 8px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }
#sourcingTabQueue .listing-cost-ratios > div { display: flex; align-items: baseline; gap: 12px; }
#sourcingTabQueue .listing-cost-ratios dt { min-width: 3em; color: var(--muted); }
#sourcingTabQueue .listing-cost-ratios dd { margin: 0; font-weight: 600; }
#sourcingTabQueue .listing-cost-actions { justify-content: flex-start; gap: 10px; margin-top: 12px; }
#sourcingTabQueue .listing-cost-status .cell-sub { margin-top: 5px; overflow-wrap: anywhere; }
#sourcingTabQueue .listing-cost-actions .link-btn { padding: 0; font-size: 12px; }
:is(#sourcingTabQueue, .listing-dialog) .listing-return-value.is-profit { color: var(--green); }
:is(#sourcingTabQueue, .listing-dialog) .listing-return-value.is-loss { color: var(--red); }
:is(#sourcingTabQueue, .listing-dialog) .listing-source-table { table-layout: fixed; }
:is(#sourcingTabQueue, .listing-dialog) .listing-source-table .num { text-align: right; }
:is(#sourcingTabQueue, .listing-dialog) .listing-source-current { display: inline-flex; align-items: center; justify-content: center; min-width: 70px; color: var(--teal); font-size: 12px; font-weight: 600; white-space: nowrap; }
:is(#sourcingTabQueue, .listing-dialog) .listing-source-table tr.is-current td { background: var(--teal-soft); }
:is(#sourcingTabQueue, .listing-dialog) .listing-source-table .queue-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-dialog .listing-source-link { display: flex; align-items: center; gap: 8px; min-width: 0; }
.listing-dialog .listing-source-link .queue-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-dialog .listing-source-picker { min-width: 0; margin-block: 12px; }
.listing-dialog .listing-source-picker h4 { margin: 0; font-size: 14px; }
.listing-dialog .listing-source-detail { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.listing-dialog .listing-source-table { min-width: 820px; }
.listing-dialog .listing-source-table th,
.listing-dialog .listing-source-table td { padding: 8px 12px; font-size: 12px; vertical-align: middle; }
.listing-dialog .listing-source-table .listing-source-link { max-width: 280px; }
.listing-dialog .listing-source-table .queue-thumb { flex: 0 0 32px; width: 32px; height: 32px; }
.listing-dialog .listing-source-table .row-actions { flex-wrap: nowrap; white-space: nowrap; }
#sourcingTabQueue .listing-cost-product .cell-title {
 display: -webkit-box;
 -webkit-box-orient: vertical;
 -webkit-line-clamp: 2;
 white-space: normal;
 overflow: hidden;
 overflow-wrap: anywhere;
}

/* 订单管理样板页：查询、导出、明细各自成区，滚动限制在表格内。 */
#view-sales-orders > .section-head { min-height: 38px; }
#view-sales-orders > .section-head .head-actions { gap: 12px; }
#view-sales-orders #salesOrderExport { white-space: nowrap; }
#view-sales-orders .sales-order-filter-card { padding: 14px 18px; margin-bottom: 16px; }
#view-sales-orders .orders-toolbar { margin: 0 0 14px; gap: 16px; }
#view-sales-orders .orders-toolbar-actions { flex: none; gap: 8px; }
#view-sales-orders .sales-order-search {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-width: 620px;
}
#view-sales-orders .sales-order-search .orders-search { width: 100%; min-width: 0; }
#view-sales-orders .sales-order-filters {
  display: grid;
  grid-template-columns: minmax(230px, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
#view-sales-orders .sales-order-filters > .field { min-width: 0; }
#view-sales-orders .sales-order-filters .dr-trigger { width: 100%; }
#view-sales-orders .orders-card { padding: 0; min-width: 0; }
#view-sales-orders .orders-card > .card-head { align-items: center; padding: 14px 18px; margin: 0; }
#view-sales-orders #salesOrderTable { overflow: auto; max-height: calc(100vh - 350px); margin: 0; overscroll-behavior: contain; }
#view-sales-orders .sales-order-table { min-width: 1080px; }
#view-sales-orders .data-table th,
#view-sales-orders .data-table td { white-space: nowrap; padding: 11px 14px; }
#view-sales-orders .data-table th { position: sticky; top: 0; z-index: 1; border-top: 1px solid var(--line); font-size: 11px; }
#view-sales-orders .data-table td { font-size: 12px; }
#view-sales-orders .data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
#view-sales-orders .sales-order-title { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#view-sales-orders .sales-order-errors { padding: 12px 18px; color: var(--red); background: var(--red-soft); overflow-wrap: anywhere; }
#view-sales-orders .sales-order-status-error { color: var(--red); background: var(--red-soft); border-color: transparent; }
#view-sales-orders .pagination { padding: 12px 18px; }
@media (max-width: 980px) {
  #view-sales-orders .sales-order-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-sales-orders .orders-toolbar { flex-wrap: wrap; }
  #view-sales-orders .sales-order-search { flex-basis: 100%; max-width: none; }
}
@media (max-width: 600px) {
  #view-sales-orders > .section-head { gap: 12px; }
  #view-sales-orders > .section-head .head-actions { width: 100%; justify-content: space-between; }
  #view-sales-orders .sales-order-filter-card { padding: 14px; }
  #view-sales-orders .sales-order-filters { grid-template-columns: minmax(0, 1fr); }
  #view-sales-orders .orders-toolbar-actions { margin-left: 0; width: 100%; }
  #view-sales-orders .orders-toolbar-actions .button { flex: 1; }
  #view-sales-orders #salesOrderTable { max-height: 60vh; }
  #view-sales-orders .pagination { flex-wrap: wrap; gap: 10px; }
}
