:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e3e8ef;
  --line-soft: #eef1f5;
  --text: #1b2027;
  --text-dim: #6b7482;
  --text-mute: #9aa3b0;
  --primary: #2f6fed;
  --primary-soft: #eaf1fe;
  --danger: #c0392b;
  --warn: #b45309;
  --ok: #1a6b44;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 侧边栏 ---------------- */

.side {
  width: 216px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px 13px;
}
.logo {
  width: 32px; height: 32px;
  flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3d7bf5, #2559cf);
  color: #fff;
  border-radius: 9px;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(47, 111, 237, .28);
}
.brand-txt { min-width: 0; }
.brand h1 { font-size: 14.5px; margin: 0; letter-spacing: .2px; }
.brand .sub {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }

.nav-group {
  padding: 12px 8px 6px;
  font-size: 10.5px;
  color: #b0b8c4;
  letter-spacing: .6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: #48515f;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
  transition: background .14s, color .14s;
}
.nav-item svg {
  width: 15px; height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item span { flex: 1; min-width: 0; }
.nav-item:hover { background: #f5f7fa; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active svg { stroke-width: 1.7; }

/* ---------------- 两级目录 ---------------- */

.nav-branch { margin-bottom: 2px; }

.nav-branch-head {
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.nav-branch-head .chev {
  width: 7px;
  height: 7px;
  flex: none;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .16s ease;
  opacity: .55;
}
.nav-branch.collapsed .nav-branch-head .chev {
  transform: rotate(-45deg) translate(-1px, 1px);
}

.nav-kids {
  margin: 1px 0 4px 17px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-branch.collapsed .nav-kids { display: none; }

.nav-item.kid {
  padding: 6px 9px;
  font-size: 12.5px;
  color: #5b6470;
}
.nav-item.kid::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c3ccd9;
  flex: none;
}
.nav-item.kid.active::before { background: var(--primary); }
.nav-item.kid.active { color: var(--primary); font-weight: 600; }
.nav-branch.has-active > .nav-branch-head { color: var(--text); }

.badge {
  flex: none;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: #fdecea;
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}
.badge.soon { background: #eef1f5; color: #8a919e; font-weight: 600; }

.side-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-mute);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #cfd6e0; flex: none; }
.dot.on { background: #22a06b; box-shadow: 0 0 0 3px rgba(34, 160, 107, .15); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .14); }

/* ---------------- 当前登录的人 ---------------- */

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px 11px 16px;
  border-top: 1px solid var(--line-soft);
}
.side-user[hidden] { display: none; }
.side-user .avatar {
  width: 27px; height: 27px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.side-user .user-meta {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column;
  line-height: 1.35;
}
.side-user .user-meta b {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-user .user-meta i { font-size: 11px; color: var(--text-mute); font-style: normal; }
.side-user .logout {
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-dim);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.side-user .logout:hover { border-color: var(--danger); color: var(--danger); }

/* ---------------- 成员管理 / 采集令牌 ---------------- */

.member-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 11px 12px;
  margin-bottom: 12px;
  background: #f8fafd;
  border: 1px dashed var(--line);
  border-radius: 9px;
}
.member-form[hidden] { display: none; }
.member-form input,
.member-form select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.member-form input:focus,
.member-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .1);
}

.token-box {
  flex: 1;
  min-width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafd;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
  line-height: 1.6;
}

/* ---------------- 主区 ---------------- */

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.view { flex: 1; overflow: auto; padding: 18px 22px 26px; }

.loading { padding: 60px; text-align: center; color: var(--text-mute); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-head h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -.2px; }
.page-head .desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.page-head .desc b { color: var(--text); font-weight: 600; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* ---------------- 工具条 ---------------- */

.toolbar {
  position: sticky;
  top: -18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 14px 0 11px;
  margin-bottom: 4px;
  background: var(--bg);
}
.toolbar .spacer { flex: 1; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------------- SOP 流程 ---------------- */

.sop-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.sop-step {
  display: flex;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
}
.sop-step i {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.sop-step b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.sop-step span { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }

.tag.st-open { background: #fdecea; color: #a33125; }
.tag.st-working { background: #eaf1fe; color: #2455bb; }
.tag.st-watch { background: #fff5e6; color: #97600a; }
.tag.st-ok { background: #e8f6ee; color: #1a6b44; }
.tag.st-off { background: #f0f2f5; color: #6b7482; }

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #eef1f5;
  border-radius: 8px;
}
.tab {
  height: 26px;
  padding: 0 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.tab.on {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.field { display: flex; align-items: center; gap: 6px; }
/* .field 的 display:flex 会盖掉 hidden，必须显式关掉 */
.field[hidden] { display: none; }
.field > span { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

input[type="text"], input[type="search"], input:not([type]), select, textarea {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .12);
}

.check {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 31px;
  padding: 0 13px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(47, 111, 237, .18);
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s, transform .06s;
}
.btn:hover { background: #2a63d6; border-color: #2a63d6; color: #fff; box-shadow: 0 2px 7px rgba(47, 111, 237, .26); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(47, 111, 237, .18); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47, 111, 237, .22); }

.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn.ghost:hover { background: #f7f9fc; border-color: #c3cede; color: var(--text); box-shadow: 0 2px 6px rgba(16, 24, 40, .09); }

.btn.sm { height: 27px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }

/* 表格 / 列表里的行内操作：也做成按钮，不再是让人猜的纯文字链 */
.btn.link {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-dim);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.btn.link:hover { color: var(--primary); border-color: #b9cdf6; background: var(--primary-soft); box-shadow: none; }
.btn.link:active { background: #dbe8fd; transform: none; }

/* 危险操作（删除 / 重置）：红字红边，悬停才上色，避免误点 */
.btn.danger, .btn.link.danger { color: var(--danger); border-color: #f0c9c4; background: #fff; box-shadow: none; }
.btn.danger:hover, .btn.link.danger:hover { color: #a3301f; border-color: #e0a097; background: #fdf1ef; }

.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

/* 同一格里并排的操作按钮之间留出距离 */
td .btn + .btn { margin-left: 6px; }

/* ---------------- KPI ---------------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 11px;
  margin-bottom: 15px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px 12px;
}
.kpi .k { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.kpi .v {
  font-size: 23px;
  font-weight: 700;
  margin-top: 7px;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi .s { font-size: 11.5px; color: var(--text-mute); margin-top: 5px; }
.kpi.warn .v { color: var(--warn); }
.kpi.bad .v { color: var(--danger); }
.kpi.ok .v { color: var(--ok); }

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { margin: 0; font-size: 13.5px; }
.card-head .side-note { font-size: 11.5px; color: var(--text-mute); }
.card-body { padding: 13px 15px; }
.card-body.tight { padding: 8px 15px 12px; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 13px; }
.cols-2.wide-left { grid-template-columns: 1.35fr 1fr; }
@media (max-width: 1120px) { .cols-2, .cols-2.wide-left { grid-template-columns: 1fr; } }

/* ---------------- 条形 ---------------- */

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: block; }
.bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 5px;
}
.bar-top .name { color: #333c4a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top .val { color: var(--text-dim); font-variant-numeric: tabular-nums; flex: none; font-size: 12px; }
.bar-track { height: 7px; border-radius: 4px; background: #eef1f5; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width .3s ease; }
.bar-fill.c1 { background: #d97706; }
.bar-fill.c2 { background: #2f6fed; }
.bar-fill.c3 { background: #0f9d58; }
.bar-fill.c4 { background: #98a2b3; }

/* ---------------- 表格 ---------------- */

.table-scroll {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  max-height: calc(100vh - 246px);
}

table { width: 100%; border-collapse: separate; border-spacing: 0; }

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #46505f;
  white-space: nowrap;
}

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfcfe; }
tbody tr.selected { background: var(--primary-soft); }

.c-check { width: 34px; }
.c-img { width: 54px; }
.c-sku { width: 168px; }
.c-money { width: 92px; text-align: right; }
.c-input { width: 92px; }
.c-rate { width: 78px; text-align: right; }
.c-size { width: 122px; }

.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover, .th-sort.on { color: var(--primary); }
.th-sort.on { font-weight: 700; }

td.c-money, td.c-rate { text-align: right; font-variant-numeric: tabular-nums; }

.thumb {
  width: 40px; height: 40px;
  border-radius: 7px;
  object-fit: cover;
  background: #eef1f5;
  border: 1px solid var(--line);
  display: block;
}
.thumb.blank { display: grid; place-items: center; color: #b9c2d0; font-size: 10px; }

.name { font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
.name-sub { font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }
.sku-line { font-family: Consolas, monospace; font-size: 11.5px; color: #46505f; }
.spec-line { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.3; }

.money-input {
  width: 82px;
  height: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.money-input.empty { border-color: #eddcc0; background: #fffdf7; }
.money-input.empty::placeholder { color: #c9a86a; }
.note-input { width: 100%; height: 28px; font-size: 12.5px; min-width: 110px; }

.price { font-variant-numeric: tabular-nums; color: #333c4a; }
.price em { font-style: normal; color: var(--text-mute); font-size: 11px; }

.rate { font-weight: 600; font-variant-numeric: tabular-nums; }
.rate.good { color: var(--ok); }
.rate.warn { color: var(--warn); }
.rate.bad { color: var(--danger); }
.rate.na { color: #c3cad5; font-weight: 500; }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #eef0f4;
  color: #4a5261;
}
.tag.lc0 { background: #fff5e6; color: #97600a; }
.tag.lc1 { background: #eaf1fe; color: #2455bb; }
.tag.lc2 { background: #e8f6ee; color: #1a6b44; }
.tag.lc3 { background: #f0f2f5; color: #6b7482; }
.tag.cost-ok { background: #e8f6ee; color: #1a6b44; }
.tag.cost-miss { background: #fdecea; color: #a33125; }

.saving { opacity: .55; }
.saved-flash { animation: flash .6s ease; }
@keyframes flash {
  from { background: #dff0e5; }
  to { background: transparent; }
}

/* ---------------- 空状态 / 分页 ---------------- */

.empty { padding: 64px 20px; text-align: center; color: var(--text-dim); }
.empty-title { font-size: 15px; font-weight: 600; color: #46505f; margin-bottom: 6px; }
.empty-desc { font-size: 12.5px; line-height: 1.6; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px 0;
  font-size: 12.5px;
  color: var(--text-dim);
}
.pager-btns { display: flex; align-items: center; gap: 9px; }

/* ---------------- 成本维护 ---------------- */

.cost-list { display: flex; flex-direction: column; gap: 9px; }
.cost-item {
  display: grid;
  grid-template-columns: 44px 1fr 110px 120px 96px 140px;
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.cost-item.done { border-color: #cfe8db; background: #fbfefc; }
.cost-item.focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .1); }
.cost-item .nm { min-width: 0; }
.cost-item .nm .t {
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cost-item .nm .t:hover { color: var(--primary); }
.cost-item .nm .s { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.cost-item .lbl { font-size: 11px; color: var(--text-mute); margin-bottom: 3px; }
.cost-item .money-input { width: 100%; height: 32px; font-size: 14px; }
@media (max-width: 1000px) {
  .cost-item { grid-template-columns: 44px 1fr 110px; }
  .cost-item .col-hide { display: none; }
}

.progress-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* 导出成本表的字段口径提示 */
.export-note {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #e6ecf5;
  border-radius: 9px;
  background: #f7faff;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}
.export-note b { color: var(--text); font-weight: 600; }
.export-note a { color: var(--primary); text-decoration: none; }
.export-note a:hover { text-decoration: underline; }
.export-note .export-scope {
  margin-left: auto;
  padding-left: 8px;
  color: #2455bb;
  font-weight: 600;
  white-space: nowrap;
}
.progress-track { flex: 1; height: 6px; border-radius: 4px; background: #e8ecf2; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #2f6fed, #5b93ff); border-radius: 4px; }

/* ---------------- 规划页 ---------------- */

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 11px; }
.plan-step {
  border: 1px dashed #d6dee9;
  border-radius: 10px;
  padding: 13px 14px;
  background: #fbfcfe;
}
.plan-step .no {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: #eaf1fe;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.plan-step h4 { margin: 0 0 5px; font-size: 13px; }
.plan-step p { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.55; }

/* ---------------- 设置 ---------------- */

.form-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.form-row:last-child { border-bottom: none; }
.form-row > .label { width: 130px; flex: none; padding-top: 5px; }
.form-row > .label b { display: block; font-size: 13px; font-weight: 600; }
.form-row > .label span { font-size: 11.5px; color: var(--text-mute); }
.form-row > .ctrl { flex: 1; min-width: 0; }

.radio-line { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.radio-card:hover { border-color: #cdd7e5; }
.radio-card:has(input:checked) { border-color: #b9cdf8; background: #f6f9ff; }
.radio-card input { margin-top: 2px; }
.radio-card .t { font-size: 13px; font-weight: 600; }
.radio-card .d { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }

.calib {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fafbfd;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.calib b { color: var(--text); font-variant-numeric: tabular-nums; }

.kv { font-size: 12.5px; color: var(--text-dim); line-height: 1.9; }
.kv b { color: var(--text); }
.kv code {
  font-family: Consolas, monospace;
  font-size: 11.5px;
  background: #f1f4f8;
  padding: 1px 5px;
  border-radius: 4px;
  color: #46505f;
}

/* ---------------- 状态说明 ---------------- */

.legend { display: flex; flex-direction: column; }
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--line-soft);
}
.legend-row:last-child { border-bottom: none; }
.legend-row .tag { width: 96px; flex: none; text-align: center; }

/* 店铺管理：疑似同一家的两行提示 */
.dup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12.5px;
}
.dup-row:last-child { border-bottom: none; }
.dup-row b { font-size: 13px; }
.dup-actions { display: flex; gap: 6px; flex: none; }
.dup-row .kv { color: var(--text-dim); font-size: 12px; }
.legend-note { flex: 1; min-width: 0; color: var(--text-dim); line-height: 1.5; }
.legend-count { flex: none; color: var(--text-mute); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---------------- 详情抽屉 ---------------- */

.name.link { cursor: pointer; }
.name.link:hover { color: var(--primary); }

.mini-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: #fff5e6;
  color: #97600a;
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: 1px;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(16, 24, 40, 0);
  transition: background .18s ease;
}
.drawer-mask.on { background: rgba(16, 24, 40, .28); }

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 470px;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: -14px 0 44px rgba(16, 24, 40, .18);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .18s ease, transform .18s ease;
}
.drawer-mask.on .drawer { opacity: 1; transform: none; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-sub { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }
.drawer-x {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #8a919e;
  cursor: pointer;
  padding: 0 2px;
}
.drawer-x:hover { color: var(--text); }

.drawer-body { flex: 1; overflow: auto; padding: 4px 18px 18px; }
.drawer-section { padding: 12px 0 6px; border-bottom: 1px solid var(--line-soft); }
.drawer-section:last-child { border-bottom: none; }
.drawer-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .4px;
}
.kv-row { display: flex; gap: 12px; padding: 3px 0; font-size: 12.5px; line-height: 1.55; }
.kv-k { width: 108px; flex: none; color: var(--text-mute); }
.kv-v { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
.kv-v.wrap { white-space: pre-wrap; }
.kv-empty { color: #c3cad5; }
.kv-note { color: var(--text-mute); font-size: 11.5px; }

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 11px 18px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfe;
}

/* ---------------- 弹窗 / 提示 ---------------- */

.modal {
  position: fixed; inset: 0;
  background: rgba(20, 26, 36, .38);
  display: grid; place-items: center;
  z-index: 100;
}
/* display:grid 会压掉 hidden 属性的默认样式，必须显式关掉 */
.modal[hidden] { display: none; }
.modal-box {
  width: 392px;
  background: var(--panel);
  border-radius: 12px;
  padding: 20px 22px 16px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .22);
}
.modal-box h3 { margin: 0 0 4px; font-size: 15px; }
.modal-box .hint { color: var(--text-dim); font-size: 12px; margin: 0 0 14px; line-height: 1.5; }
.modal-box .field { margin-bottom: 11px; }
.modal-box .field > span { width: 96px; }
.modal-box .field input, .modal-box .field select { flex: 1; }
.scope-line { font-size: 12px; color: var(--text-dim); padding: 2px 0 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }

/* 宽弹窗 + 两列表单（限流记录那种字段多的） */
.modal-box.wide { width: 620px; max-width: calc(100vw - 48px); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.form-grid .field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0;
}
.form-grid .field > span {
  width: auto;
  font-size: 11.5px;
  color: var(--text-dim);
}
.form-grid .field input,
.form-grid .field select { width: 100%; }
.form-grid .field.span2 { grid-column: span 2; }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2733;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .28);
  z-index: 200;
}
.toast.error { background: var(--danger); }

/* ---------------- 权限页 ---------------- */

.perm-tabbar { margin: 2px 0 12px; }
.card-tools { display: flex; align-items: center; gap: 6px; }
.card-head .card-tools { margin-left: auto; }

.row-actions { display: flex; flex-wrap: wrap; gap: 2px 9px; }

.token-cell { display: flex; flex-direction: column; gap: 4px; }
.token-mini {
  display: inline-block;
  max-width: 170px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f9fc;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.token-ops { display: flex; gap: 9px; }

.owner-select { height: 28px; max-width: 152px; }

/* 平台退货包裹的退款状态下拉（0.7.12）：紧凑、选中态带底色由 JS 内联上色 */
/* 平台退货包裹的行内控件（0.7.15 重画）：基础表单样式不含 number 输入框，这里自绘全套 */
.pkg-status {
  height: 28px;
  font-size: 12.5px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pkg-status:hover { border-color: #c3cede; }
.pkg-status:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.pkg-status:disabled { background: #f4f6fa; color: #9aa4b2; cursor: wait; }

.pkg-amount {
  width: 108px;
  height: 28px;
  padding: 0 9px;
  text-align: right;
  font-size: 12.5px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
  transition: border-color .15s, box-shadow .15s, background .15s, color .15s;
}
.pkg-amount::-webkit-outer-spin-button,
.pkg-amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pkg-amount::placeholder { color: #b6bfcc; font-weight: 400; }
.pkg-amount:hover { border-color: #c3cede; }
.pkg-amount:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.pkg-amount:disabled { background: #f4f6fa; color: #9aa4b2; }
/* 填了金额：浅绿底绿字，扫一眼知道这单已经追回多少 */
.pkg-amount.filled { border-color: #b7e0c6; background: #f5fbf7; color: #1a7f4b; font-weight: 600; }
.pkg-amount.filled:hover { border-color: #8fd0a8; }

/* 0.9.2：实退输入框下面那行差价（少退红 / 多退绿 / 没填显示应退多少） */
.pkg-amount-wrap { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.pkg-diff {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-height: 13px;
}
.pkg-diff.short { color: var(--danger); font-weight: 600; }
.pkg-diff.over { color: var(--ok); font-weight: 600; }

/* 退货跟踪表（0.7.16）：14 列，列宽按内容走、禁止逐字换行，放不下的横向滚动 */
#rfPackages table { min-width: 1450px; }
#rfPackages th, #rfPackages td { white-space: nowrap; }
#rfPackages td.c-name { max-width: 260px; }
#rfPackages td.c-name .name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 店铺筛选胶囊条（0.7.14 全站统一，地址管理同款） ---------------- */

.chip-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}
.chip {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.chip-on,
.chip-on:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(47, 111, 237, .25);
}

/* 未分配的店在列表里淡黄底，一眼能看出还有哪些没人管 */
tr.row-unassigned td { background: #fffdf4; }
tr.row-unassigned:hover td { background: #fff9e6; }

.perm-panel .card { margin-bottom: 0; }

/* ---------------- 侧边栏：管理员专属入口 + 改密码 ---------------- */

/* .nav-item 自己带 display:flex，会盖掉 [hidden] 的默认样式，必须显式关掉 */
.nav-item[hidden], .nav-group[hidden] { display: none; }


/* ---------------- 细节打磨 ---------------- */

/* 卡片与表头做出层次，数据区更清爽 */
.card { box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 1px rgba(16, 24, 40, .03); }
.card-head { background: linear-gradient(180deg, #fcfdff, #f7f9fc); }
thead th { background: #f4f7fb; color: #3d4655; letter-spacing: .2px; }
tbody td { padding: 9px 10px; }
tbody tr:hover { background: #f8fbff; }

/* KPI 卡片：数字等宽对齐，悬停有反馈 */
.kpi { box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .15s, box-shadow .15s; }
.kpi:hover { border-color: #d3dded; box-shadow: 0 3px 10px rgba(16, 24, 40, .07); }
.kpi .v { font-variant-numeric: tabular-nums; }

/* 侧边栏当前项：加一条竖线，位置一眼可见 */
.nav-item.active { position: relative; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

/* 提示条里的按钮推到右边，不和说明文字挤在一起 */
.export-note .btn { margin-left: auto; }

/* ---------------------------- 限流收录（0.3.0） ---------------------------- */

/* 收录概况：每店一行的紧凑小表，别用大表样式把页面撑长 */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-mute);
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}
.mini-table tbody td { padding: 7px 12px; border-bottom: 1px solid var(--line-soft, #f1f4f8); }
.mini-table tbody tr:last-child td { border-bottom: none; }
.mini-table tbody tr:hover { background: #fafbfd; }
.mini-table td.num { font-variant-numeric: tabular-nums; }

/* 「怎么收录」引导弹窗 */
.guide-steps { display: grid; gap: 10px; margin-top: 4px; }
.guide-step { display: flex; gap: 10px; align-items: flex-start; }
.guide-step i {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eaf1fe;
  color: #2455bb;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.guide-step b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.guide-step span { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ---------------------------- SOP 手册 ---------------------------- */

/* 每日节奏：左侧时间轴，颜色只标「会不会误事」 */
.timeline { display: grid; gap: 2px; }
.tl-item {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.tl-item:last-child { border-bottom: none; }
.tl-time {
  flex: none;
  width: 48px;
  font-family: Consolas, monospace;
  font-size: 12px;
  color: var(--text-mute);
  padding-top: 1px;
}
.tl-body b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.tl-body span { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.tl-item.warn .tl-time { color: #97600a; font-weight: 600; }
.tl-item.warn .tl-body b { color: #7d4f08; }
.tl-item.main .tl-time { color: #2455bb; font-weight: 600; }

/* 每天必查：卡片网格 + 直达按钮 */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 11px;
}
.check-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdff;
}
.check-item b { font-size: 12.5px; }
.check-item span { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; flex: 1; }
.check-item .btn { align-self: flex-start; }

.card-actions { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-soft); }

/* 判定口径：只给需要警觉的行着色 */
td.rule-red { color: #a33125; font-weight: 500; }
td.rule-warn { color: #7d4f08; }

/* 踩过的坑 */
.pit-list { display: grid; gap: 9px; }
.pit-item {
  padding-left: 11px;
  border-left: 2px solid #e8c3bd;
}
.pit-item b { display: block; font-size: 12.5px; margin-bottom: 2px; color: #a33125; }
.pit-item span { font-size: 12px; color: var(--text-dim); line-height: 1.55; }

/* ---------------------- 限流表（13 列）与 SOP 处理表 ---------------------- */

/* 这张表列多，宁可横向滚动也不挤成一团 */
.limit-table { min-width: 1280px; }
.limit-table th { white-space: nowrap; }
.limit-table td { vertical-align: top; }
.limit-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 长期/短期两列是「日常价 ¥9.66 → ¥3.45；活动申报价同步至 ¥3.44」这种长句，给个窄列自己折行 */
.limit-table td.price-cell { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; min-width: 190px; }

/* 沟通文案格子 */
.copy-cell { min-width: 240px; vertical-align: top; }
.copy-text {
  font-size: 11.5px;
  line-height: 1.45;
  color: #2455bb;
  background: #f4f8ff;
  border: 1px solid #dbe7ff;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 合并单元格时这份文案覆盖几个 SKC / 几家店 */
.copy-meta { font-size: 10.5px; color: var(--text-dim); margin: -2px 0 6px; }
/* 合并格有整组行的高度，文案不用再截 3 行，全展示 */
.limit-table td[rowspan] .copy-text { -webkit-line-clamp: unset; display: block; }
.copy-cell .btn { height: 22px; font-size: 11px; padding: 0 8px; }

/* 文案卡（整组查看） */
.copy-list { display: grid; gap: 10px; }
.copy-item { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fcfdff; }
.copy-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.copy-item-head b { font-size: 12.5px; }
.copy-item-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #2455bb;
  background: #f4f8ff;
  border-radius: 6px;
  padding: 7px 9px;
  user-select: all;
}

/* 九章：章节号、待采集、说明块 */
.chapter-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 19px;
  padding: 0 6px;
  margin-right: 7px;
  border-radius: 5px;
  background: #eaf1fe;
  color: #2455bb;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}
.pending-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 15px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: #fafbfd;
}
.pending-block b { font-size: 12.5px; color: var(--text-dim); }
.pending-block span { font-size: 12px; color: var(--text-mute); line-height: 1.5; }

/* 13 列太密，几个关键列给最小宽，别让中文标题一个字一行地竖着排 */
.limit-table { min-width: 1560px; }
.limit-table td:nth-child(2) { min-width: 210px; }
.limit-table td:nth-child(1) { min-width: 96px; }
.limit-table td:nth-child(5) { min-width: 120px; }
.limit-table td:nth-child(13) { min-width: 250px; }

/* 数据清理：危险操作单独一块，视觉上隔开 */
.danger-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid #e8c3bd;
  border-radius: 9px;
  background: #fffafa;
}
.danger-zone b { display: block; font-size: 12.5px; color: #a33125; margin-bottom: 2px; }
.danger-zone span { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.danger-zone .btn { margin-left: auto; flex: none; }

/* ---------------- 流量分析（三期 · 运营） ---------------- */

/* 表内小条形：左条右数，宽度按百分数。红=要处理，绿=还行（和 A 股涨跌色无关，这里只表示风险） */
.tf-cell { display: flex; align-items: center; gap: 7px; min-width: 118px; }
.tf-track { flex: 1; height: 6px; border-radius: 4px; background: #eef1f5; overflow: hidden; min-width: 44px; }
.tf-fill { height: 100%; border-radius: 4px; transition: width .3s ease; }
.tf-fill.bad, .bar-fill.bad { background: #d92d20; }
.tf-fill.high, .bar-fill.high { background: #e8590c; }
.tf-fill.mid, .bar-fill.mid { background: #d97706; }
.tf-fill.low, .bar-fill.low { background: #0f9d58; }
.tf-fill.na, .bar-fill.na { background: #c3c9d2; }
.tf-val { font-size: 12px; font-variant-numeric: tabular-nums; color: #46505f; flex: none; min-width: 42px; text-align: right; }
.tf-val.bad { color: #b42318; font-weight: 600; }
.tf-val.high { color: #b54708; font-weight: 600; }
.tf-val.mid { color: #97600a; }
.tf-val.low { color: #1a6b44; }

/* 商品名最多两行，长标题不把表格撑爆 */
.tf-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.45;
  color: #333c4a;
}

/* 分档图 + 读表说明并排；窄屏自动落成一列 */
.tf-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 13px; margin-bottom: 13px; }
@media (max-width: 1080px) { .tf-grid { grid-template-columns: minmax(0, 1fr); } }

.tf-tips { display: flex; flex-direction: column; gap: 11px; }
.tf-tip { display: flex; gap: 9px; align-items: flex-start; }
.tf-tip b { font-size: 12.5px; color: #333c4a; display: block; margin-bottom: 2px; }
.tf-tip .name-sub { line-height: 1.55; }
.tf-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.tf-dot.bad { background: #d92d20; }
.tf-dot.high { background: #e8590c; }
.tf-dot.mid { background: #d97706; }
.tf-dot.low { background: #0f9d58; }

/* ---------------- 流量分析：全量在售链接 ---------------- */

/* 环比：销量涨了是好事（绿），掉了要处理（红）。这里不套 A 股红涨绿跌，套的是工作台的「红=风险」 */
.tf-delta { font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tf-delta.up { color: #1a6b44; }
.tf-delta.down { color: #b42318; }
.tf-delta.flat { color: #6b7482; font-weight: 400; }

/* 可售天数：≤7 天红、≤14 橙、≤30 黄、再往上是绿 */
.tf-days { font-size: 12px; font-variant-numeric: tabular-nums; }
.tf-days.bad { color: #b42318; font-weight: 600; }
.tf-days.high { color: #b54708; font-weight: 600; }
.tf-days.mid { color: #97600a; }
.tf-days.low { color: #1a6b44; }
.tf-days.na { color: #98a2b3; }

/* 「只看有销量」这种行内勾选：和 select 摆一起时基线对齐 */
.tf-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #46505f;
  padding: 0 6px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  cursor: pointer;
}
.tf-check input { margin: 0; }

/* mallId 这种长数字串：等宽才容易逐位比对，别被比例字体挤成一坨 */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- 0.8.0 利润中心二期 ---------- */
.good-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--danger); font-weight: 600; }
.btn-ghost {
  margin-left: 10px; padding: 2px 10px; font-size: 12px; line-height: 20px;
  border: 1px solid var(--line, #e4e8ef); border-radius: 999px;
  background: #fff; color: var(--text, #33405a); cursor: pointer;
}
.btn-ghost:hover { border-color: var(--ok); color: var(--ok); }
td.c-name { max-width: 300px; }
td.c-name .name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.35; font-weight: 500;
}
td.c-name .sub { color: #8a93a5; font-size: 11.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
  #pfFees + #pfMonthly, .grid-2 { grid-template-columns: 1fr !important; }
}

/* ---------- 0.9.0 采集清单 ---------- */
.cl-chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.cl-chart-head b { font-size: 13.5px; }
.cl-chart-sub { font-size: 11.5px; color: var(--text-mute, #8a93a5); }

/* 小时柱图 */
.cl-chart-cols {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px;
  align-items: end; height: 150px; padding: 0 4px;
}
.cl-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.cl-col.is-empty .cl-stack { background: transparent; }
.cl-stack { display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; width: 100%; }
.cl-seg { display: block; width: 100%; }
.cl-seg.cl-ok { background: var(--ok, #2f9e44); opacity: .82; }
.cl-seg.cl-err { background: var(--danger, #e03131); opacity: .9; }
.cl-col:hover .cl-stack { filter: brightness(.92); }
.cl-col-label { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--text-mute, #8a93a5); }
.cl-chart-cols { margin-bottom: 20px; }
.cl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.cl-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text, #33405a); }
.cl-legend-item i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* 覆盖矩阵 */
.cl-matrix th.cl-matrix-kind { white-space: nowrap; font-size: 11.5px; }
.cl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; }
.cl-store-cell b { display: block; }
.cl-sub { display: block; font-size: 11px; color: var(--text-mute, #8a93a5); }
.cl-sub.warn { color: var(--danger, #e03131); }
.cl-gap-num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.cl-gap-num.has { color: var(--danger, #e03131); }
.cl-cell { text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.cl-cell.is-ok { background: rgba(47, 158, 68, .14); color: var(--ok, #1a7f37); font-weight: 600; }
.cl-cell.is-stale { background: rgba(138, 147, 165, .10); color: var(--text-mute, #6b7280); }
.cl-cell.is-error { background: rgba(224, 49, 49, .13); color: var(--danger, #c92a2a); }
.cl-cell.is-never { color: #b9c0cc; }
.cl-matrix td.cl-store-cell { max-width: 180px; }

/* 缺口清单 */
.cl-gaps { display: flex; flex-direction: column; gap: 6px; }
.cl-gap-ok { color: var(--ok, #1a7f37); font-weight: 600; padding: 6px 2px; }
.cl-gap-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line, #e4e8ef); border-radius: 8px; background: #fff; font-size: 12.5px; }
.cl-gap-item b { min-width: 120px; }
.cl-gap-kind { color: var(--danger, #c92a2a); font-weight: 600; }
.cl-gap-why { margin-left: auto; color: var(--text-mute, #8a93a5); font-size: 11.5px; text-align: right; }

/* 明细流水 */
.cl-log td { font-size: 12px; }
.cl-log tr.is-fail td { background: rgba(224, 49, 49, .05); }
.cl-log td.mono { font-variant-numeric: tabular-nums; }
.cl-kind-tag { display: inline-block; padding: 1px 8px; border: 1px solid; border-radius: 999px; font-size: 11px; line-height: 16px; background: #fff; }
.cl-inst { color: var(--text-mute, #6b7280); font-size: 11.5px; max-width: 200px; }
.cl-res-ok { color: var(--ok, #1a7f37); }
.cl-res-err { color: var(--danger, #c92a2a); }
.warn-text { color: var(--danger, #c92a2a); }

/* ---------------- 上品流水线（0.10.0）：选品池 / 草稿 ---------------- */
.pk-tabs { display: flex; gap: 4px; margin-bottom: 11px; border-bottom: 1px solid var(--line); }
.pk-tab {
  border: none; background: none; padding: 8px 14px; font-size: 13px; font-family: inherit;
  color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.pk-tab:hover { color: var(--text); }
.pk-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.pk-form-card { margin-bottom: 13px; }
.pk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 10px; }
.pk-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; margin-bottom: 10px; }
.pk-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-label { font-size: 12px; color: var(--text-dim); }
.pk-hint { font-size: 11px; color: var(--text-mute); line-height: 1.35; }
.pk-input {
  width: 100%; box-sizing: border-box; padding: 6px 9px; font-size: 13px; font-family: inherit;
  color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px;
  outline: none; resize: vertical; line-height: 1.45;
}
.pk-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.pk-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pk-preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px;
  padding: 10px 12px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px;
}
.pk-big { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---- 0.10.2 上品中心「商品处理台」排列：筛选行 / 勾选条 / 漏斗行 ---- */
.pk-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
.sel-bar { margin-bottom: 12px; }
.sel-bar-inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 9px 14px; border-radius: 9px;
  background: #eef4ff; border: 1px solid #c9dcff;
}
.sel-count { font-weight: 600; font-size: 13px; color: var(--primary); margin-right: 4px; }
.funnel-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 10px 2px 0; font-size: 12.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ---- 0.10.2 B 上架模板：左列表 + 右编辑器 ---- */
.tpl-grid {
  display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start;
}
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item {
  text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; cursor: pointer; font: inherit; color: inherit;
}
.tpl-item:hover { border-color: var(--primary); }
.tpl-item.on { border-color: var(--primary); background: #eef4ff; }
.tpl-item .name { font-weight: 600; font-size: 13px; }
.tpl-item .side-note { margin-top: 2px; }
.tpl-editor { min-width: 0; }
.tpl-editor h4 { margin: 14px 0 8px; font-size: 13px; }
@media (max-width: 900px) { .tpl-grid { grid-template-columns: 1fr; } }

/* ---------- 核价队列（0.10.3 P0） ---------- */
.pq-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.pq-cat {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 6px 11px; cursor: pointer;
  font-size: 12.5px; color: var(--text);
}
.pq-cat:hover { border-color: var(--text-mute); }
.pq-cat.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pq-cat b { font-variant-numeric: tabular-nums; color: var(--text-dim); font-weight: 600; }
.pq-cat.active b { color: var(--accent); }
.pq-dot {
  font-style: normal; font-size: 10.5px; line-height: 1;
  background: var(--warn-soft, #fff5e6); color: var(--warn);
  border-radius: 999px; padding: 2px 5px; font-variant-numeric: tabular-nums;
}
.pq-cat-note { margin-top: 9px; font-size: 11.5px; color: var(--text-mute); }
.pq-search {
  flex: 1 1 220px; min-width: 180px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); font-size: 13px;
}
.pq-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pq-table thead th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 600;
  font-size: 11.5px; color: var(--text-dim); background: var(--panel);
  padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.pq-table thead th.num, .pq-table td.num { text-align: right; }
.pq-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pq-table tbody tr:hover { background: var(--hover, rgba(0,0,0,.02)); }
.pq-row-bad { background: rgba(200, 60, 40, .04); }
.pq-td-check { width: 30px; }
.pq-td-cat { max-width: 180px; }
.pq-td-cost { width: 96px; }
.pq-prod { display: flex; gap: 9px; align-items: flex-start; min-width: 260px; }
.pq-prod-text { min-width: 0; }
.pq-title {
  font-size: 12.5px; line-height: 1.45; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pq-sub { font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.pq-muted { color: var(--text-mute); }

/* 包装列：尺寸一行、重量一行，重货/泡货/多规格用小角标 */
.pq-td-dim { width: 118px; white-space: nowrap; }
.pq-dim-size { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pq-dim-w {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-mute); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pq-dim-tag {
  font-style: normal; font-size: 10px; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
  background: var(--hover, rgba(0,0,0,.05)); color: var(--text-dim);
}
.pq-dim-tag.hot { background: rgba(200, 60, 40, .1); color: var(--danger); }
.pq-cost-input {
  width: 82px; padding: 4px 7px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); font-variant-numeric: tabular-nums;
}
.pq-cost-input:focus { border-color: var(--accent); outline: none; }
.pq-neg { color: var(--danger); font-weight: 600; }
.pq-warn { color: var(--warn); font-weight: 600; }
.pq-pos { color: var(--ok); }
.tag.bad { background: var(--danger-soft, #fdecea); color: var(--danger); }
.tag.warn { background: var(--warn-soft, #fff5e6); color: var(--warn); }
.tag.ghost { background: transparent; color: var(--text-mute); border: 1px solid var(--line); }

/* ---------------- 商品详情弹窗（Temu 商品页版式，0.11.0） ---------------- */

.pv-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 24, 40, .34);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.pv-modal {
  width: min(960px, 96vw); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: 14px;
  box-shadow: 0 18px 60px rgba(16, 24, 40, .24);
  overflow: hidden;
}
.pv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.pv-head-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-head-t { font-size: 13px; font-weight: 600; }
.pv-head-id { font-size: 11.5px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.pv-head-sub { font-size: 11.5px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-x {
  border: none; background: none; font-size: 20px; line-height: 1;
  color: var(--text-mute); cursor: pointer; padding: 2px 7px; border-radius: 6px;
}
.pv-x:hover { background: var(--line-soft); color: var(--text); }
.pv-body {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px;
  padding: 16px; overflow-y: auto;
}
.pv-gallery { min-width: 0; }
.pv-main {
  width: 100%; aspect-ratio: 1 / 1;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pv-main img { width: 100%; height: 100%; object-fit: contain; }
.pv-main.broken::after { content: "图片加载失败"; font-size: 12px; color: var(--text-mute); }
.pv-empty { font-size: 12px; color: var(--text-mute); }
/* 缩略图换行（0.13.2）：原来单行横滚，10 张图后面几张要扒着滚才能看到；
   改成 flex-wrap 自动换行，编辑草稿左栏窄也能一眼看全。 */
.pv-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; padding-bottom: 2px; }
.pv-thumb {
  position: relative;
  width: 46px; height: 46px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  overflow: hidden; cursor: pointer;
}
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-thumb.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
/* AI 生成角标：右下角一个小蓝块，标出这张是平台（AI）出的图，不是原图 */
.pv-thumb-ai {
  position: absolute; right: 1px; bottom: 1px; z-index: 2;
  padding: 0 3px; border-radius: 3px;
  background: rgba(79, 110, 247, .94); color: #fff;
  font-size: 9px; line-height: 12px; font-weight: 600; letter-spacing: .3px;
}
.pv-thumb.is-ai { border-color: rgba(79, 110, 247, .5); }
.pv-main-tag {
  position: absolute; left: 8px; top: 8px; z-index: 3;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(79, 110, 247, .94); color: #fff;
  font-size: 10px; line-height: 16px; font-weight: 600;
}
.pv-thumb-note { font-size: 11px; color: var(--text-mute); margin-top: 6px; }
.pv-info { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pv-title { font-size: 14px; line-height: 1.55; font-weight: 500; }
.pv-cat { font-size: 11.5px; color: var(--text-mute); }
.pv-price { display: flex; align-items: baseline; gap: 8px; }
.pv-amount { font-size: 22px; font-weight: 700; color: var(--danger); font-variant-numeric: tabular-nums; }
.pv-price-note { font-size: 11.5px; color: var(--text-mute); }
.pv-sub { font-size: 11.5px; color: var(--text-dim); }
.pv-spec-name { font-size: 11.5px; color: var(--text-dim); margin-bottom: 5px; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-dim);
  cursor: pointer; font-family: inherit;
}
.pv-chip:hover { border-color: var(--text-mute); }
.pv-chip.active { border-color: var(--primary); color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.pv-dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
.pv-dim-box { background: var(--line-soft); border-radius: 8px; padding: 8px 9px; }
.pv-dim-box.warn { background: #fdecea; }
.pv-dim-k { font-size: 10.5px; color: var(--text-mute); }
.pv-dim-box.warn .pv-dim-k { color: var(--danger); }
.pv-dim-v { font-size: 12.5px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pv-dim-box.warn .pv-dim-v { color: var(--danger); }
.pv-props { border-top: 1px dashed var(--line); padding-top: 10px; }
.pv-props-t { font-size: 11.5px; color: var(--text-mute); margin-bottom: 6px; }
.pv-props-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-size: 12px; }
.pv-prop { display: flex; gap: 8px; min-width: 0; }
.pv-prop-k { color: var(--text-mute); flex: none; }
.pv-prop-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 11px 16px; border-top: 1px solid var(--line); background: var(--line-soft);
}
@media (max-width: 760px) {
  .pv-body { grid-template-columns: 1fr; }
  .pv-main { max-width: 260px; }
}

/* ---------------- 重发池（0.11.0） ---------------- */

.pq-row-click { cursor: pointer; }
.pq-sup { font-size: 12.5px; color: var(--text); }
.pq-td-mat { width: 132px; }
.pq-mat-main { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pq-mat-sub { font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.pq-mat.bad .pq-mat-main { color: var(--warn); }
.pq-mat.bad .pq-mat-sub { color: var(--danger); }
.pq-td-repost { width: 122px; }
.pq-repost-sel {
  width: 100%; font-size: 12px; font-family: inherit;
  padding: 4px 6px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-dim);
}
.pq-repost-sel.st-todo { border-color: #f0c9a0; background: #fff8f0; color: var(--warn); }
.pq-repost-sel.st-gen { border-color: #b9d3f7; background: #f2f8ff; color: var(--primary); }
.pq-repost-sel.st-written { border-color: #b9d3f7; background: #eef4ff; color: var(--primary); }
.pq-repost-sel.st-done { border-color: #b6ddc8; background: #f1fbf5; color: var(--ok); }
.pq-repost-sel.st-skip { color: var(--text-mute); background: var(--line-soft); }

/* ---------------- 草稿编辑：弹窗 + 左栏实时预览 ---------------- */

.draft-modal {
  width: min(1120px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: 14px;
  box-shadow: 0 18px 60px rgba(16, 24, 40, .24);
  overflow: hidden;
}
.draft-cols {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 360px minmax(0, 1fr);
}
.draft-preview {
  border-right: 1px solid var(--line);
  background: var(--line-soft);
  padding: 14px; overflow-y: auto;
}
.draft-preview-t { font-size: 11.5px; color: var(--text-mute); margin-bottom: 10px; }
.draft-preview .pv-body { grid-template-columns: 1fr; gap: 12px; padding: 0; overflow: visible; }
.draft-form { overflow-y: auto; }
@media (max-width: 900px) {
  .draft-cols { grid-template-columns: 1fr; }
  .draft-preview { border-right: none; border-bottom: 1px solid var(--line); }
}

/* SKU 明细（带缩略图，点一行切主图） */
.pv-skus { border-top: 1px dashed var(--line); padding-top: 10px; }
.pv-sku {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 5px 6px; margin-top: 4px;
  border: 1px solid transparent; border-radius: 8px;
  background: none; cursor: pointer; text-align: left; font-family: inherit;
}
.pv-sku:hover { background: var(--line-soft); }
.pv-sku.active { border-color: var(--primary); background: var(--primary-soft); }
.pv-sku-img {
  width: 40px; height: 40px; flex: none; border-radius: 6px;
  border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pv-sku-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-sku-noimg { font-size: 10px; color: var(--text-mute); }
.pv-sku-txt { min-width: 0; flex: 1; }
.pv-sku-name { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-sku-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* 草稿编辑里的 SKU 图预览 */
.draft-sku-img {
  width: 34px; height: 34px; flex: none; border-radius: 6px;
  border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.draft-sku-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.draft-sku-img span { font-size: 9px; color: var(--text-mute); }

/* 主图加载占位：kwcdn 直连偏慢，加载完前给提示 */
.pv-main { position: relative; }
.pv-main .pv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-mute); }
.pv-main.loaded .pv-loading { display: none; }
.pv-main img { position: relative; z-index: 1; }

/* ============ 0.11.1 商品处理台（上品草稿工作台，按竞品截图版式） ============ */

/* 每一行工具条：设置 / 筛选 / chips / 写入 */
.ws-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ws-row .pk-input { height: 32px; }
.ws-setup { background: #f8fafc; }
.ws-item { display: inline-flex; align-items: center; gap: 6px; }
.ws-k { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.ws-dim { color: var(--text-mute); font-size: 12px; }
.ws-gap { flex: 1; }
.dest { min-width: 300px; }

/* 状态 chips：胶囊 + 数字 */
.ws-chips { padding: 7px 12px; }
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .12s ease;
}
.ws-chip b {
  min-width: 22px;
  padding: 0 6px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #eef0f4;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ws-chip:hover { border-color: #c3cede; color: var(--text); }
.ws-chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ws-chip.on b { background: var(--primary); color: #fff; }
.ws-chip.warn.on { border-color: var(--warn); color: var(--warn); background: #fff5e6; }
.ws-chip.warn.on b { background: var(--warn); color: #fff; }
.ws-chip.ok.on { border-color: var(--ok); color: var(--ok); background: #e8f6ee; }
.ws-chip.ok.on b { background: var(--ok); color: #fff; }

/* AI 处理按钮：蓝色填充主操作 */
.btn.ai {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.ai:hover { background: #2a63d6; border-color: #2a63d6; color: #fff; }

/* 写入行：绿色主按钮（竞品里「写入本页」是绿底白字） */
.btn.write {
  background: #12b76a;
  border-color: #12b76a;
  color: #fff;
}
.btn.write:hover { background: #0e9f5b; border-color: #0e9f5b; color: #fff; box-shadow: 0 2px 7px rgba(18, 183, 106, .3); }

/* 开关（自动生成 / 自动上传） */
.tg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-dim);
}
.tg:hover { border-color: #c3cede; color: var(--text); }
.tg-label { white-space: nowrap; }
.tg-knob {
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: #d6dbe3;
  position: relative;
  transition: background .15s ease;
  flex: none;
}
.tg-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .25);
  transition: left .15s ease;
}
.tg-knob.on { background: var(--primary); }
.tg-knob.on::after { left: 17px; }

/* 计数 + 表格 */
.ws-count { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; color: var(--text-dim); font-size: 12.5px; }
.ws-table { width: 100%; border-collapse: collapse; }
.ws-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  white-space: nowrap;
}
.ws-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.ws-table tbody tr:hover { background: #fafbfc; }
.ws-table tbody tr.st-ready { background: #fbfdff; }
.ws-table tbody tr.st-ready:hover { background: #f5f9ff; }
.c-thumb { width: 72px; }
.ws-thumb { position: relative; width: 44px; height: 44px; }
.c-prog { min-width: 150px; }
.c-ops { white-space: nowrap; }
.c-ops .btn + .btn { margin-left: 6px; }
.btn.icon { padding: 0 7px; }

/* 「新」角标：图片左上角 */
.fresh-tag {
  position: absolute;
  top: -4px;
  left: -4px;
  background: #f5483b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 6px 6px 6px 0;
  z-index: 1;
}

/* 图片进度：标签行 + 圆角进度条（严格按竞品截图：数字蓝色粗体右对齐，完成绿满条/生成中灰空条） */
.prog { margin: 4px 0; }
.prog-t {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.prog-n {
  font-variant-numeric: tabular-nums;
  color: #2456c4;
  font-weight: 700;
  font-size: 12px;
}
.prog-bar {
  height: 6px;
  border-radius: 3px;
  background: #e8ebf0;
  overflow: hidden;
}
.prog-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #16a34a;
  transition: width .25s ease;
}
.prog-bar.full i { background: #16a34a; }

/* 问题提示：绿 ✓ / 橙 ⚠ / 灰「图片未生成」/ 蓝「生成中」 */
.issue { font-size: 12px; line-height: 1.7; white-space: nowrap; }
.issue.ok { color: var(--ok); }
.issue.warn { color: var(--warn); }
.issue.muted { color: var(--text-mute); }
.issue.info { color: var(--primary); }

/* 状态列文字色（竞品里是纯文字着色，不是胶囊） */
.ws-table .tag.st-warn { background: transparent; color: var(--primary); padding: 0; }
.ws-table .tag.st-idle { background: #f0f2f5; color: var(--text-dim); }

/* AI 出图任务进度条（0.12.0） */
.ws-job { background: #f7faff; border-color: #cfe0ff; gap: 10px; }
.ws-job-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #b9c6d8; flex: none;
}
.ws-job-dot.on { background: var(--primary); animation: ws-pulse 1.1s ease-in-out infinite; }
@keyframes ws-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}
.ws-job-bar { width: 160px; height: 7px; flex: none; }
.ws-job-log {
  color: var(--text-dim); font-size: 12px; max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* SKU 明细行：可删 / 只留第一条（0.12.1） */
.sku-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sku-head h4 { margin: 0; }
.sku-head-ops { display: flex; gap: 6px; flex: none; }
.sku-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.sku-row .sku-price { flex: none; width: 54px; text-align: right; }
.sku-del { flex: none; color: var(--text-mute); }
.sku-del:hover { color: var(--danger); border-color: #f0c9c4; }

/* 点图放大（0.12.2） */
.lb-mask {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(12, 15, 20, .82);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px;
  animation: lb-in .12s ease;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: auto; }
.lb-img {
  max-width: 92vw; max-height: 84vh; object-fit: contain;
  border-radius: 8px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
  transition: transform .08s linear; transform-origin: center center;
}
.lb-tip { color: rgba(255, 255, 255, .72); font-size: 12px; flex: none; }
/* 可点放的缩略图给个手感 */
.ws-thumb .thumb, .draft-sku-img, .pv-main img, .pv-thumb img { cursor: zoom-in; }

/* ---------- 货源候选（0.13.2）：商家写的 长/宽/高/重量 + 虚标标签 ---------- */
.src-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 10px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.src-row.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: #f7f9ff; }
.src-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.src-dims { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.src-k { font-size: 11px; color: var(--text-mute); }
.src-v {
  font-size: 12px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.src-note { color: var(--text-mute); }
.src-side {
  flex: none; width: 92px; display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px;
}
.src-side .side-note { font-size: 11px; }
