/* thirdparty.css — 三方平台工作台（自包含，不依赖 app.css 运行时）
   设计语言对齐主站：同款变量/字体/毛玻璃面板 */

:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: rgba(15, 23, 42, 0.10);
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.06), transparent 24%),
    linear-gradient(180deg, #f8fafc, #f1f5f9 68%);
}

/* ── 布局 ── */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.body-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  padding: 0 22px 28px;
  flex: 1;
}

/* ── 顶栏 ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 22px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 12px; color: var(--muted); }

.platform-tabs {
  display: flex; gap: 6px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 4px;
}
.ptab {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 20px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: all 0.15s;
}
.ptab:hover { color: var(--text); }
.ptab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── 店铺状态胶囊 ── */
.shop-capsule {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-active { background: var(--good); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.dot-unknown { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.dot-expired { background: var(--bad); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.capsule-text { font-weight: 600; }
.capsule-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(37, 99, 235, 0.10); color: var(--accent);
  font-weight: 600;
}

/* ── 按钮 ── */
.btn {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  background: var(--panel); color: var(--text);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: 0;
}
.btn-ghost { background: transparent; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── 侧栏 ── */
.sidebar {
  padding: 18px 0;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  display: flex; flex-direction: column;
}
.menu-group-label {
  font-size: 11px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.08em; padding: 0 16px 10px;
  text-transform: uppercase;
}
.menu { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; cursor: pointer;
  padding: 11px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  text-align: left; transition: all 0.15s;
}
.menu-item:hover { background: rgba(37, 99, 235, 0.06); color: var(--text); }
.menu-item.active {
  background: rgba(37, 99, 235, 0.10);
  color: var(--accent); font-weight: 700;
}
.mi-ico { font-size: 16px; width: 20px; text-align: center; }

.sidebar-foot {
  margin-top: auto; padding: 14px 16px 0;
  border-top: 1px solid var(--line);
}
.foot-line { font-size: 11px; color: var(--muted); }
.foot-value { font-size: 13px; font-weight: 600; margin-top: 3px; }
.foot-value.ok { color: var(--good); }
.foot-value.bad { color: var(--bad); }

/* ── 主内容 ── */
.content { padding: 4px 0; }
.page { display: none; }
.page.active { display: block; animation: fadein 0.18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}
.panel-title { margin: 0 0 8px; font-size: 17px; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 0 0 14px; }
code {
  background: rgba(15, 23, 42, 0.06);
  padding: 1px 6px; border-radius: 5px; font-size: 12.5px;
}

.phase-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
  border-radius: 12px; padding: 14px 16px;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.phase-tag {
  flex: none;
  font-size: 12px; font-weight: 700;
  color: var(--accent); background: rgba(37, 99, 235, 0.12);
  border-radius: 999px; padding: 4px 12px;
}

/* 店铺识别横幅 */
.shop-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.banner-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.banner-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.banner-actions { flex: none; }

/* 四步流程 chips */
.steps-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.step-chip {
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.step-arrow { color: var(--muted); font-weight: 700; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92); color: #fff;
  font-size: 13.5px; padding: 11px 20px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 99;
  max-width: min(560px, 86vw); line-height: 1.55;
}

/* 响应式 */
@media (max-width: 900px) {
  .body-grid { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-right { margin-left: 0; }
}

/* ══ P1：发布模版 & 商品套图 ══ */
.tpl-grid { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.tpl-item { display: flex; align-items: baseline; gap: 12px; font-size: 13.5px; }
.tpl-k { flex: none; width: 150px; color: var(--muted); font-size: 12.5px; }
.tpl-colors { color: var(--text); line-height: 1.6; }
.action-row { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.schema-box {
  margin-top: 12px; max-height: 280px; overflow: auto;
  background: rgba(15, 23, 42, 0.04); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
}

.pub-steps { display: flex; gap: 8px; margin: 6px 0 16px; }
.pub-step {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted); font-weight: 500;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}
.pub-step .ps-num {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px;
  background: rgba(15, 23, 42, 0.08); color: var(--muted);
}
.pub-step.active { color: var(--accent); border-color: rgba(37, 99, 235, 0.4); background: rgba(37, 99, 235, 0.06); }
.pub-step.active .ps-num { background: var(--accent); color: #fff; }
.pub-step.done { color: var(--good); }
.pub-step.done .ps-num { background: var(--good); color: #fff; }

.pub-pane { display: none; }
.pub-pane.active { display: block; animation: fadein 0.18s ease; }

.file-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1.5px dashed rgba(37, 99, 235, 0.4); border-radius: 14px;
  background: rgba(37, 99, 235, 0.04);
  padding: 26px 18px; cursor: pointer; text-align: center;
  font-size: 13.5px; color: var(--muted); transition: all 0.15s;
}
.file-drop:hover { background: rgba(37, 99, 235, 0.08); }
.fd-icon { font-size: 26px; }

.thumb-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.thumb-list:empty { display: none; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .tn {
  position: absolute; left: 4px; top: 4px;
  background: rgba(15, 23, 42, 0.72); color: #fff; font-size: 10.5px;
  padding: 1px 7px; border-radius: 999px;
}
.thumb .rm {
  position: absolute; right: 4px; top: 4px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(239, 68, 68, 0.9); color: #fff; font-size: 11px; line-height: 1;
  display: grid; place-items: center;
}
.thumb-list.small .thumb { width: 64px; height: 64px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.fg-item { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.fg-item input {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 13.5px; font-family: inherit; color: var(--text);
  background: #fff; width: 100%;
}
.fg-item input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.color-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.color-checks label {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; cursor: pointer;
  background: #fff; color: var(--text); user-select: none;
}
.color-checks label:has(input:checked) { border-color: var(--accent); background: rgba(37, 99, 235, 0.07); color: var(--accent); font-weight: 600; }
.color-checks input { accent-color: var(--accent); margin: 0; }

.preview-summary {
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.9;
}
.preview-summary b { color: var(--accent); }

.progress-wrap { margin: 8px 0 12px; }
.progress-line { height: 10px; border-radius: 999px; background: rgba(15, 23, 42, 0.07); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; transition: width 0.3s;
}
.progress-text { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.pub-log {
  max-height: 240px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  padding: 10px 12px; font-size: 12px; line-height: 1.8;
  font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-all;
}
.pub-log .lg-ok { color: var(--good); }
.pub-log .lg-err { color: var(--bad); }

/* ══ S1：元素空间（共享 Temu 元素库 · 只读） ══ */
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.panel-head .panel-title { margin: 0; }
.panel-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.input {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; color: var(--text);
  background: #fff; outline: none; min-width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10); }

.elem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.elem-card {
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; overflow: hidden; cursor: pointer;
  transition: all 0.16s; display: flex; flex-direction: column;
}
.elem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(37, 99, 235, 0.35); }
.elem-thumb {
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, #f8fafc, #eef2f7);
  display: grid; place-items: center; overflow: hidden;
}
.elem-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.elem-thumb .noimg { color: var(--muted); font-size: 12px; }
.elem-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.elem-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elem-sub { font-size: 11.5px; color: var(--muted); }
.elem-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.06); color: var(--muted);
}
.tag-good { background: rgba(16, 185, 129, 0.12); color: #0f766e; }
.tag-warn { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.tag-info { background: rgba(37, 99, 235, 0.10); color: var(--accent); }
.tag-mute { background: rgba(15, 23, 42, 0.05); color: var(--muted); }

.elem-viewer {
  margin-top: 16px; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; background: rgba(248, 250, 252, 0.85);
}
.ev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ev-head b { font-size: 14.5px; }
.ev-head button { margin-left: auto; }
.ev-files {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; max-height: 460px; overflow: auto;
}
.ev-file {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 6px; text-align: center; font-size: 11px; color: var(--muted);
}
.ev-file img { width: 100%; height: 96px; object-fit: contain; display: block; margin-bottom: 4px; }

.trace-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trace-table th, .trace-table td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
}
.trace-table th { font-size: 12px; color: var(--muted); font-weight: 700; background: rgba(15, 23, 42, 0.03); }
.trace-table tbody tr { cursor: pointer; }
.trace-table tbody tr:hover { background: rgba(37, 99, 235, 0.05); }
.trace-table tbody tr.sel { background: rgba(37, 99, 235, 0.09); }
.trace-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.trace-detail h4 { margin: 0 0 8px; font-size: 13px; }
.trace-detail > div > div { max-height: 240px; overflow: auto; }
.trace-row { font-size: 12.5px; line-height: 1.75; color: var(--text); }
.trace-row .t { color: var(--muted); }
@media (max-width: 760px) { .trace-detail { grid-template-columns: 1fr; } .input { min-width: 0; } }

/* ══ 行式文件夹列表（元素 / 底板 / 模版，对齐 Temu 侧体验） ══ */
.elem-list { display: flex; flex-direction: column; gap: 10px; }
.elem-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 12px 14px;
  transition: all 0.15s;
}
.elem-row:hover { border-color: rgba(37, 99, 235, 0.35); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.elem-row.pickable { cursor: pointer; }
.elem-row.sel { border-color: var(--accent); background: rgba(37, 99, 235, 0.06); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15); }
.er-thumb {
  flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  display: grid; place-items: center;
}
.er-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.er-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.er-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.er-folder { font-size: 15px; }
.er-count { font-size: 12px; color: var(--muted); }
.er-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }
.er-shops { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.er-shops-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.shop-chip {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: rgba(245, 158, 11, 0.10); color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
  max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.er-actions { flex: none; display: flex; gap: 8px; }
.list-more { justify-content: center; }

/* 发布模版 */
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 12px 14px;
}
.tpl-form {
  border: 1px solid rgba(37, 99, 235, 0.30); border-radius: 12px;
  background: rgba(37, 99, 235, 0.04);
  padding: 14px 16px; margin-bottom: 14px;
}
select.input { appearance: auto; }

/* ══ 类目选择弹层 ══ */
.modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(15, 23, 42, 0.42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
/* ★ hidden 属性必须赢过 .modal 的 display:flex，否则弹窗常驻关不掉 */
.modal[hidden] { display: none !important; }
.modal-box {
  width: min(760px, 96vw); max-height: 84vh;
  background: var(--panel); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal-head b { font-size: 15px; }
.modal-head #catSource { font-size: 12px; }
.modal-head button { margin-left: auto; }
.modal-tools { padding: 10px 18px 0; }
.modal-tools .input { width: 100%; }
.cat-crumb {
  padding: 10px 18px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.crumb { color: var(--accent); cursor: pointer; }
.crumb:hover { text-decoration: underline; }
.crumb-sep { color: var(--muted); }
.cat-list { flex: 1; overflow: auto; padding: 4px 18px 12px; }
.cat-group {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.04em; padding: 12px 0 6px;
}
.cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
}
.cat-item:hover { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.18); }
.ci-name { font-size: 13.5px; font-weight: 600; }
.ci-path { font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-go { margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 600; flex: none; }
.cat-item.leaf .ci-go { background: rgba(37,99,235,0.10); padding: 2px 9px; border-radius: 999px; }
.modal-foot { padding: 10px 18px 14px; border-top: 1px solid var(--line); font-size: 12px; }

/* 类目选择触发器 */
.cat-pick { display: flex; gap: 8px; align-items: center; }
.cat-pick input { flex: 1; }

/* ══ 类目属性表单 ══ */
.attr-block {
  margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px;
}
.attr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.attr-head b { font-size: 13.5px; }
.attr-head .muted { font-size: 12px; }
.attr-head button { margin-left: auto; }
.attr-form { max-height: 460px; overflow: auto; }
.attr-group {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.04em; padding: 10px 0 4px;
}
.attr-group.req { color: var(--bad); }
.attr-group.dep { opacity: 0.55; }
.attr-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 12px; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed rgba(15,23,42,0.06);
}
.ar-label { font-size: 12.5px; color: var(--text); }
.req-star { color: var(--bad); margin-left: 3px; font-weight: 700; }
.ar-ctl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ar-ctl .input { width: 100%; min-width: 0; padding: 7px 10px; font-size: 12.5px; }
.ar-tip { grid-column: 2; font-size: 11.5px; line-height: 1.5; }
.attr-unit { font-size: 12px; color: var(--muted); flex: none; }
.chip-box { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; background: #fff;
}
.chip input { margin: 0; }
.chip:hover { border-color: rgba(37, 99, 235, 0.4); }
.chip:has(input:checked) { background: rgba(37, 99, 235, 0.10); border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) {
  .attr-row { grid-template-columns: 1fr; }
  .ar-tip { grid-column: 1; }
}

/* 系统设置 */
.fg-full { grid-column: 1 / -1; }
.fg-full textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; font-family: inherit;
  color: var(--text); background: #fff; outline: none; resize: vertical;
}
.fg-full textarea:focus { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10); }
.fg-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* ══ 商品套图推品 · Temu 同款四步布局 ══ */
.stepper {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 20px; margin: 12px 0 16px;
}
.step-item { display: flex; align-items: center; gap: 7px; cursor: default; }
.st-num {
  width: 24px; height: 24px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: #eef2f7; color: var(--muted);
}
.step-item.active .st-num { background: var(--accent); color: #fff; }
.step-item.done .st-num { background: rgba(16, 185, 129, 0.15); color: #059669; }
.st-txt { font-size: 13px; font-weight: 600; color: var(--muted); }
.step-item.active .st-txt { color: var(--accent); }
.step-item.done .st-txt { color: #059669; }
.st-line { width: 42px; height: 1px; background: var(--line); }

.pane-head { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 14px; }
.ph-title { font-size: 15px; margin-right: 10px; }
.ph-desc { font-size: 12.5px; }
.pane-head .btn { margin-left: auto; flex: none; }

/* 步骤1：底板卡片墙 */
.base-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .base-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.base-card {
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  overflow: hidden; cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column;
}
.base-card:hover { border-color: rgba(37, 99, 235, 0.35); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.base-card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.bc-media { display: flex; gap: 8px; padding: 10px; height: 210px; }
.bc-swatches { flex: none; width: 40px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.bc-swatch { flex: 1; border-radius: 6px; overflow: hidden; background: #f1f5f9; min-height: 0; }
.bc-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-main { flex: 1; min-width: 0; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid rgba(15,23,42,0.05); display: grid; place-items: center; }
.bc-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bc-ph { font-size: 11px; color: #94a3b8; }
.bc-body { padding: 8px 12px 12px; }
.bc-name { font-size: 13.5px; font-weight: 700; }
.bc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.bc-cost { font-size: 12px; color: #b45309; margin-top: 2px; }
.grid-more { justify-content: center; margin-top: 16px; }

/* 步骤2 */
.logo-pick-box {
  border: 1px dashed rgba(37, 99, 235, 0.35); border-radius: 14px;
  background: rgba(37, 99, 235, 0.03); padding: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.logo-pick-box #cpLogoInfo { width: 100%; font-size: 13px; }

/* 步骤3 */
.sel-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.sel-col { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 240px; }
.sel-col > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tplinfo { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 6px 16px; margin-bottom: 16px; }
.ti-title { font-size: 13.5px; font-weight: 700; padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.ti-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(15,23,42,0.06); font-size: 13px; }
.ti-row:last-child { border-bottom: none; }
.ti-label { color: var(--muted); flex: none; }
.ti-val { text-align: right; }
.ti-val .ok { color: #059669; font-weight: 700; }
.ti-val .warn { color: #b45309; }
.ti-btn { font-size: 12px; padding: 2px 10px; margin-left: 8px; }

.carousel-box { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 6px 16px 16px; }
.car-switches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; margin-bottom: 14px; }
.color-cell {
  position: relative; border: 2px solid var(--line); border-radius: 10px;
  background: #fff; padding: 6px; cursor: pointer; text-align: center;
}
.color-cell.on { border-color: var(--accent); background: rgba(37, 99, 235, 0.04); }
.cc-check { position: absolute; top: 4px; left: 4px; z-index: 2; display: flex; align-items: center; gap: 3px; margin: 0; }
.cc-order {
  width: 17px; height: 17px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.cc-img { height: 62px; border-radius: 7px; overflow: hidden; background: #f1f5f9; display: grid; place-items: center; }
.cc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-name { font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.slot-cell {
  border-radius: 10px; text-align: center; position: relative;
  border: 1.5px solid var(--line); background: #f8fafc;
  min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 8px;
}
.slot-cell.theme { background: rgba(168, 85, 247, 0.07); border-color: rgba(168, 85, 247, 0.45); }
.slot-cell.size { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.40); }
.slot-cell.size.miss { border-style: dashed; opacity: 0.75; }
.slot-cell.color, .slot-cell.detail { background: rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.35); }
.slot-cell.empty { border-style: dashed; opacity: 0.6; }
.slot-cell .slot-img { height: 0; overflow: hidden; }
.slot-cell .slot-img img { display: none; }
.slot-n {
  position: absolute; top: -9px; left: -7px; width: 19px; height: 19px; border-radius: 999px;
  background: #16a34a; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.slot-cell.size .slot-n { background: var(--accent); }
.slot-img { display: none; }
.slot-t { font-size: 12px; font-weight: 600; display: block; }

/* 步骤4 */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card {
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  text-align: center; padding: 14px 0 12px;
}
.stat-card b { display: block; font-size: 26px; color: var(--accent); }
.stat-card span { font-size: 12px; color: var(--muted); }
.prod-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.prod-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px 14px; margin-bottom: 12px; }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-idx { font-weight: 800; font-size: 14px; flex: none; width: 22px; text-align: center; }
.pc-title { flex: 1; min-width: 0; }
.pc-state { font-size: 12px; flex: none; }
.pc-meta { font-size: 12px; color: var(--muted); margin: 8px 0; line-height: 1.7; }
.pc-mi { margin-right: 6px; }
.pc-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.pc-color { width: 76px; text-align: center; }
.pc-img { height: 62px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8fafc; display: grid; place-items: center; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-color span { font-size: 11px; color: var(--muted); display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { justify-content: center; gap: 6px; }
.pager .pg-on { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* 底部导航条 */
.pub-footer {
  display: flex; gap: 10px; align-items: center;
  border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px;
}
.pub-log {
  margin-top: 12px; background: #0f172a; color: #e2e8f0; border-radius: 12px;
  padding: 12px 14px; font-size: 12px; line-height: 1.8; max-height: 220px; overflow: auto;
  font-family: Consolas, monospace;
}

/* 元素弹层筛选与选中 */
.modal-filters { display: flex; gap: 12px; margin-top: 10px; }
.mf-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.mf-item select { padding: 6px 10px; font-size: 12.5px; width: auto; }
.cat-item.em-row { display: block; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 10px 12px; }
.cat-item.em-row.sel { border-color: var(--accent); background: rgba(37, 99, 235, 0.05); }
.cat-item.em-row .er-title { font-size: 13.5px; }

/* 底板选区展示 */
.bc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.region-preview { position: relative; width: 100%; height: 100%; }
.region-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.region-rect {
  position: absolute; border: 2px dashed rgba(37, 99, 235, 0.85);
  background: rgba(37, 99, 235, 0.12); border-radius: 2px; pointer-events: none;
}

/* 底板分页条 */
.pg-btn { min-width: 34px; }
.pg-dots { color: var(--muted); padding: 0 2px; }
.pg-info { font-size: 12px; margin-left: 10px; }
.grid-more, .pager { flex-wrap: wrap; }

.bc-empty { font-size: 11.5px; color: #94a3b8; text-align: center; line-height: 1.7; }
.bc-empty span { font-size: 10.5px; opacity: 0.8; }

/* Logo 墙（步骤2，对齐 Temu） */
.logo-grid {
  margin-top: 14px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px; max-height: 560px; overflow: auto;
}
.logo-cell {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 6px 6px 4px; text-align: center;
}
.lc-img {
  height: 72px; border-radius: 7px; display: grid; place-items: center;
  background:
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%) 0 0/14px 14px,
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%) 7px 7px/14px 14px,
    #fff;
  border: 1px solid rgba(15,23,42,0.05);
}
.lc-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lc-img span { font-size: 10.5px; color: #94a3b8; }
.lc-name { font-size: 11px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-rm {
  position: absolute; top: -7px; right: -7px; z-index: 2;
  width: 19px; height: 19px; border-radius: 999px; border: none; cursor: pointer;
  background: #ef4444; color: #fff; font-size: 12px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.lc-rm:hover { background: #dc2626; }

/* 静默推品绿色按钮 */
.btn.push-green {
  background: #16a34a; border-color: #16a34a; color: #fff;
  padding: 10px 22px; font-size: 13.5px; font-weight: 700;
}
.btn.push-green:hover { background: #15803d; }

/* 步骤4 SKU 预览合成：logo 按选区叠加 */
/* 小图必须与选区坐标系一致：contain 完整显示（裁切会让百分比坐标错位） */
.pc-img { position: relative; background: #fff; }
.pc-img > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pc-logo-ov {
  position: absolute; object-fit: contain;
  transform: translate(-0%, -0%);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  pointer-events: none;
}

/* SKU 大图灯箱 */
.lb-stage { position: relative; background: #fff; border-radius: 12px; overflow: hidden; }
.lb-stage > img { display: block; width: 100%; max-height: 82vh; object-fit: contain; }
.lb-cap { text-align: center; font-size: 12.5px; color: var(--muted); padding: 8px 0 2px; }

/* 自动任务列表 */
.at-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.at-row { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 14px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.at-main { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.at-code { font-weight: 600; }
.at-sub { font-size: 12.5px; color: var(--muted, #6b7280); word-break: break-all; }
.chip { color: #fff; font-size: 11.5px; border-radius: 999px; padding: 1px 9px; flex: none; }
.at-retry { align-self: flex-start; margin-top: 2px; }

/* 批次任务卡 */
.at-card { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 12px 16px; background: #fff; }
.at-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; margin-bottom: 6px; }
.at-meta { display: flex; gap: 22px; font-size: 12.5px; color: var(--muted, #6b7280); margin-bottom: 8px; flex-wrap: wrap; }
.at-meta b { color: var(--text, #111); }
.at-items { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line, #e5e7eb); padding-top: 8px; }
.at-items .at-row { border: none; padding: 4px 6px; background: transparent; }
