:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f5;
  --line: #e4e7ec;
  --line-soft: #edeff3;
  --text: #16181d;
  --text-2: #626b78;
  --text-3: #98a0ad;
  --brand: #e8345f;
  --brand-dark: #d72753;
  --brand-soft: #fdeef2;
  --cyan: #0d9292;
  --cyan-soft: #e5f6f5;
  --blue: #2563eb;
  --blue-soft: #eaf0ff;
  --amber: #b56d08;
  --amber-soft: #fff3df;
  --green: #0f7a58;
  --green-soft: #e4f4ed;
  --red: #b42318;
  --red-soft: #fee9e7;
  --r: 14px;
  --r-sm: 10px;
  --sh: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.05);
  --sh-lg: 0 2px 4px rgba(16,24,40,.04), 0 18px 46px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #ff7a9c);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: .04em;
  box-shadow: 0 8px 18px rgba(232,52,95,.22);
}
.brand-copy strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand-copy span { display: block; font-size: 11px; color: var(--text-3); margin-top: -2px; }

.nav-label { padding: 0 10px 8px; font-size: 10px; letter-spacing: .12em; color: var(--text-3); font-weight: 800; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.tab {
  border: 0; background: transparent; color: var(--text-2);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; text-align: left;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-glyph {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3);
  font-size: 10px; font-weight: 800;
}
.tab.active .nav-glyph { background: #fff; color: var(--brand); }

.side-note {
  margin: auto 4px 14px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(145deg, #fff, #fff8fa);
}
.side-note-title { font-size: 11px; font-weight: 800; color: var(--brand); margin-bottom: 4px; }
.side-note p { margin: 0; font-size: 11px; color: var(--text-2); line-height: 1.55; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 11px; color: var(--text-3); }
.live-dot, .pill-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.live-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.main-shell { margin-left: 232px; min-height: 100vh; }
.topbar {
  height: 76px; padding: 0 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 11px; color: var(--text-3); }
.topbar h1 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 5px 11px; font-size: 11px; color: var(--text-2);
}
.pill-dot.cyan { background: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.pill-dot.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.version { font-size: 11px; color: var(--text-3); }

.content { padding: 28px 34px 60px; max-width: 1280px; margin: 0 auto; }
.panel { display: none; animation: fade .18s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #fff5f8 52%, #eefafa 100%);
  box-shadow: var(--sh-lg);
  padding: 30px 32px; margin-bottom: 28px;
  display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; align-items: center;
}
.hero-card::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  right: -90px; top: -110px; background: rgba(13,146,146,.08);
}
.eyebrow {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .14em;
  color: var(--brand); background: var(--brand-soft); padding: 5px 11px; border-radius: 99px;
}
.hero-main h2 { font-size: 26px; margin: 14px 0 8px; line-height: 1.28; letter-spacing: -.025em; }
.hero-main p { color: var(--text-2); margin: 0 0 18px; max-width: 640px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.flow-strip {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center; gap: 6px;
  background: rgba(255,255,255,.78); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.flow-step {
  text-align: center; padding: 10px 4px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line-soft);
}
.flow-step b { display: block; font-size: 10px; color: var(--text-3); }
.flow-step span { font-size: 11px; font-weight: 700; color: var(--text-2); }
.flow-step.done { background: var(--green-soft); border-color: #c9e8da; }
.flow-step.done span { color: var(--green); }
.flow-arrow { color: var(--text-3); font-size: 12px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.section-head h3 { font-size: 18px; margin: 0 0 3px; letter-spacing: -.015em; }
.sub { margin: 0; color: var(--text-2); font-size: 12.5px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 99px;
  border: 1px solid #c9e8da; background: var(--green-soft); color: var(--green);
  padding: 5px 11px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.warn { background: var(--amber-soft); color: var(--amber); border-color: #ffe0ab; }
.status-chip.ok { background: var(--green-soft); color: var(--green); }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 17px 18px; box-shadow: var(--sh); position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--brand), var(--cyan)); opacity: .75;
}
.kpi .n { font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.kpi .l { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.kpi .s { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.inner { grid-template-columns: 1fr 1fr; gap: 10px; }
.create-grid { grid-template-columns: .88fr 1.12fr; align-items: start; }
@media (max-width: 980px) {
  .grid.two, .grid.inner, .create-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; box-shadow: var(--sh); margin-bottom: 16px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card h3 { font-size: 15px; margin: 0; }
.mini-label { font-size: 10.5px; color: var(--text-3); letter-spacing: .04em; }
.link-btn { border: 0; background: transparent; color: var(--brand); font-size: 11.5px; font-weight: 700; padding: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 15px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; box-shadow: var(--sh); transition: .15s ease;
}
.btn:hover { border-color: #cfd4dc; transform: translateY(-1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(232,52,95,.2); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: rgba(255,255,255,.7); }
.btn.wide { width: 100%; margin-top: 8px; padding: 11px 16px; }
.btn.small { padding: 6px 10px; font-size: 11.5px; box-shadow: none; }

.badge {
  display: inline-flex; align-items: center; border-radius: 99px;
  padding: 3px 9px; font-size: 10.5px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  white-space: nowrap;
}
.badge.ok { background: var(--green-soft); color: var(--green); border-color: #c3e8d8; }
.badge.warn { background: var(--amber-soft); color: var(--amber); border-color: #ffe0ab; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: #ffcdc7; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: #c9d9ff; }

label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
label > select,
label > input:not([type="checkbox"]):not([type="radio"]) {
  display: block; width: 100%; margin-top: 5px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text);
  font-size: 12.5px; outline: none;
}
label > select:focus,
label > input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.checkline { display: flex; align-items: center; gap: 8px; }
.checkline input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; padding: 0; border: 0; background: none;
}
.hint { font-size: 11px; color: var(--text-3); margin: 8px 0 0; }
.empty { color: var(--text-3); font-size: 12.5px; padding: 18px 0; }

.product-preview { margin: -2px 0 14px; }
.product-preview-card {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  background: linear-gradient(135deg, var(--surface-2), #fff);
}
.product-preview-card img {
  width: 70px; height: 90px; object-fit: cover; border-radius: 9px;
  background: #111; flex: none;
}
.product-preview-card .no-image {
  width: 70px; height: 90px; border-radius: 9px; background: #fff;
  border: 1px dashed var(--line); display: grid; place-items: center;
  font-size: 10px; color: var(--text-3); flex: none;
}
.product-preview-card strong { font-size: 13px; }
.product-preview-card p { font-size: 11.5px; color: var(--text-2); margin: 4px 0 7px; }

.timeline { display: flex; flex-direction: column; gap: 9px; }
.event { border-left: 2px solid var(--line); padding: 1px 0 1px 12px; }
.event .meta { font-size: 10.5px; color: var(--text-3); }
.event .msg { font-size: 12px; color: var(--text-2); }
.event.ERROR { border-left-color: var(--red); }
.event.WARN { border-left-color: var(--amber); }
.event.INFO { border-left-color: var(--cyan); }
.timeline.small { margin-top: 12px; max-height: 210px; overflow: auto; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px;
  background: var(--surface-2);
}
.row .title { font-size: 12.5px; font-weight: 700; }
.row .meta { font-size: 10.5px; color: var(--text-3); }

.stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px; }
.stage {
  border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px;
  font-size: 10.5px; color: var(--text-3); background: var(--surface-2);
}
.stage.done { color: var(--green); background: var(--green-soft); border-color: #c3e8d8; }
.stage.current { color: var(--brand); background: var(--brand-soft); border-color: #ffd2dd; }
.progress { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--cyan)); transition: width .3s ease; }
.preview { margin-top: 14px; }
.preview video { width: 100%; max-height: 360px; border-radius: 11px; background: #111; }

.drafts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 980px) { .drafts { grid-template-columns: 1fr; } }
.draft-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 17px; box-shadow: var(--sh);
}
.draft-card .head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.draft-card h3 { font-size: 14px; margin: 0 0 4px; }
.draft-card .meta { font-size: 10.5px; color: var(--text-3); }
.draft-card video { width: 100%; border-radius: 10px; margin: 12px 0; background: #111; }
.draft-card .caption { font-size: 11.5px; color: var(--text-2); word-break: break-word; }

.adapters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 1180px) { .adapters { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .adapters { grid-template-columns: repeat(2, 1fr); } }
.adapter {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 14px; box-shadow: var(--sh); position: relative; overflow: hidden;
}
.adapter::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--cyan));
}
.adapter .kind { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.adapter .name { font-size: 12.5px; font-weight: 700; margin: 5px 0 8px; }
.adapter .note { font-size: 10.5px; color: var(--text-3); margin-top: 6px; }
.mock-card { margin-top: 4px; }

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 16px; }
  .side-nav { flex-direction: row; overflow: auto; }
  .tab { white-space: nowrap; }
  .side-note, .side-foot { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { position: static; height: auto; padding: 18px 20px; }
  .content { padding: 22px 20px 50px; }
  .hero-card { grid-template-columns: 1fr; padding: 24px; }
  .flow-strip { grid-template-columns: repeat(4, 1fr); }
  .flow-arrow { display: none; }
}

.role-tag { margin-left: 6px; color: var(--text-3); font-size: 11px; }

label > textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.55; resize: vertical;
}
label > textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.map-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.map-table th { text-align: left; color: var(--text-3); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.map-table td { padding: 6px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.map-table select { width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11.5px; }
.map-conf { display: inline-block; padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.map-conf.high { background: #e8f7ef; color: #1a8a4a; }
.map-conf.mid { background: #fff4e0; color: #b47400; }
.map-conf.low { background: #fdeef2; color: var(--brand); }
.map-sample { color: var(--text-3); font-size: 10.5px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-missing { margin: 10px 0; font-size: 11.5px; color: #b47400; }
.import-missing:empty { display: none; }
.import-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.import-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.import-item .meta { flex: 1; min-width: 0; }
.import-item .meta strong { display: block; font-size: 12.5px; }
.import-item .meta span { font-size: 10.5px; color: var(--text-3); }

/* ==================== 工作台单页布局 ==================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 28px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 11px; }
.topbar .brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.topbar .brand-text strong { display: block; font-size: 15px; line-height: 1.25; }
.topbar .brand-text span { display: block; font-size: 11.5px; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.topbar-right .btn b {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 4px;
  border-radius: 99px; background: var(--brand-soft); color: var(--brand);
  font-size: 11px; line-height: 17px; text-align: center;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding-left: 10px; margin-left: 3px; border-left: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2);
}

.workbench {
  max-width: 940px; margin: 0 auto; padding: 24px 20px 72px;
  display: flex; flex-direction: column; gap: 16px;
}
/* 底部留白：保证最后一个锚点也能滚到顶栏下方对齐 */
.workbench::after {
  content: ""; display: block; height: 55vh; flex: none;
}

.step-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh); padding: 20px 22px;
}
.step-head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.step-no {
  flex: none; width: 26px; height: 26px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.step-title { flex: 1; min-width: 0; }
.step-title h2 { margin: 0; font-size: 15.5px; font-weight: 600; }
.step-title p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.step-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* 选品 */
.csv-box textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6; resize: vertical; background: var(--surface-2);
  color: var(--text);
}
.csv-box textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.csv-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px; margin-top: 14px;
}
.product-card {
  display: flex; gap: 10px; align-items: center; padding: 9px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; background: var(--surface); transition: .15s;
}
.product-card:hover { border-color: var(--brand); }
.product-card.on { border-color: var(--brand); background: var(--brand-soft); }
.product-card input[type="checkbox"] {
  flex: none; width: 16px; height: 16px; margin: 0; padding: 0;
  border: 0; background: none; accent-color: var(--brand);
}
.product-card img, .product-card .no-img {
  flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--surface-3);
}
.product-card .no-img {
  display: grid; place-items: center; font-size: 10px; color: var(--text-3);
}
.pc-body { flex: 1; min-width: 0; }
.pc-body strong {
  display: block; font-size: 12.5px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-body span { display: block; font-size: 10.5px; color: var(--text-3); }

/* 角色 */
.role-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.role-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-sm);
  overflow: hidden; cursor: pointer; background: var(--surface); transition: .15s;
}
.role-card:hover { border-color: var(--brand); }
.role-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.role-card img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.rc-body { padding: 6px 8px 8px; }
.rc-body strong {
  display: block; font-size: 11.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-body span { display: block; font-size: 10px; color: var(--text-3); }
.rc-del {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; opacity: 0;
}
.role-card:hover .rc-del { opacity: 1; }
.rotate-line { margin-top: 12px; }

/* 开始 */
.run-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.login-state {
  flex: 1; min-width: 200px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2);
}
.login-state .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-3);
}
.login-state.ok .dot { background: var(--green); }
.login-state.warn .dot { background: var(--amber); }
.login-state.warn { color: var(--amber); }
.btn.big { padding: 11px 26px; font-size: 14px; }

/* 进度 */
.progress-card .progress-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.progress-card .progress-head strong { font-size: 14px; }
.progress-card .progress-head span { font-size: 12px; color: var(--text-3); }
.bar {
  height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: var(--brand); transition: width .35s ease;
}
.progress-split {
  display: flex; gap: 20px; margin-top: 10px;
  font-size: 12px; color: var(--text-2);
}
.progress-split b { color: var(--text); }

/* 结果 */
.result-list { display: flex; flex-direction: column; gap: 7px; }
.result-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
  align-items: center; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12.5px;
}
.result-item.ok { border-color: #b7e3cd; background: var(--green-soft); }
.result-item.bad { border-color: #f5c2bd; background: var(--red-soft); }
.ri-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-role { font-size: 11px; color: var(--text-3); }
.ri-status { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.ri-err { grid-column: 1 / -1; font-size: 11px; color: var(--red); }

.empty {
  padding: 26px 12px; text-align: center;
  font-size: 12.5px; color: var(--text-3);
  border: 1px dashed var(--line); border-radius: var(--r-sm);
}

/* 抽屉 */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-mask { position: absolute; inset: 0; background: rgba(16,24,40,.32); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(460px, 92vw); background: var(--surface);
  box-shadow: var(--sh-lg); display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.drawer-body h4 {
  margin: 18px 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
}
.drawer-body h4:first-child { margin-top: 0; }
.drawer-item {
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.drawer-item strong { display: block; font-size: 12.5px; }
.drawer-item span { display: block; font-size: 11px; color: var(--text-2); }
.drawer-item em { display: block; font-size: 10.5px; color: var(--text-3); font-style: normal; }
.adapter-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.adapter-row strong { display: block; font-size: 12.5px; }
.adapter-row span { display: block; font-size: 11px; color: var(--text-3); }
.adapter-row em {
  flex: none; font-style: normal; font-size: 11px;
  padding: 2px 8px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(16,24,40,.4); }
.modal-card {
  position: relative; width: min(460px, 92vw); max-height: 88vh;
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--sh-lg); display: flex; flex-direction: column;
}
.modal-head, .modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.modal-foot { border-bottom: 0; border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-body .field { display: block; margin-bottom: 13px; }
.modal-body .field span {
  display: block; margin-bottom: 5px; font-size: 11.5px; color: var(--text-2);
}
.modal-body input[type="text"], .modal-body textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 12.5px; font-family: inherit; color: var(--text);
}
.modal-body textarea { resize: vertical; }
.role-preview { margin-bottom: 12px; }
.role-preview img {
  width: 96px; height: 128px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .workbench { padding: 16px 12px 60px; }
  .step-card { padding: 16px; }
  .product-grid { grid-template-columns: 1fr; }
  .run-row { flex-direction: column; align-items: stretch; }
  .btn.big { width: 100%; }
}

/* hidden 属性必须压过 display:grid/flex（否则隐藏的遮罩会拦截点击） */
[hidden] { display: none !important; }

/* 步骤说明列表 */
.step-notes {
  margin: 10px 0 0; padding-left: 18px;
  font-size: 11.5px; color: var(--text-3); line-height: 1.8;
}
.step-notes li { margin: 0; }

/* 草稿相似度提示 */
.sim-summary {
  padding: 9px 12px; margin-bottom: 12px;
  border-radius: var(--r-sm); font-size: 12px;
  background: var(--green-soft); color: var(--green);
}
.sim-summary.warn { background: var(--amber-soft); color: var(--amber); }
.sim-summary b { font-weight: 600; }

.drawer-item.warn { border-color: #f0d9a8; background: #fffdf6; }
.sim-warn {
  margin-top: 6px; padding: 5px 8px;
  border-radius: 6px; background: var(--amber-soft);
  color: var(--amber); font-size: 11px; line-height: 1.5;
}

.drawer-tip {
  margin-top: 18px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 11.5px; color: var(--text-2);
}
.drawer-tip strong {
  display: block; margin-bottom: 6px;
  font-size: 12px; color: var(--text);
}
.drawer-tip ul { margin: 0; padding-left: 16px; line-height: 1.75; }
.drawer-tip b { color: var(--text); font-weight: 600; }

/* 选品区帮助文案 */
.csv-help {
  margin: 8px 0 0; padding: 8px 11px;
  border-left: 2px solid var(--line);
  font-size: 11.5px; color: var(--text-3); line-height: 1.7;
}

/* RPA 面板 */
.rpa-status {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-3); margin-bottom: 14px;
}
.rpa-status strong { font-size: 13px; }
.rpa-status span { font-size: 11.5px; color: var(--text-2); }
.rpa-status.logged_in { background: var(--green-soft); color: var(--green); }
.rpa-status.waiting_scan { background: var(--amber-soft); color: var(--amber); }
.rpa-status.failed { background: var(--red-soft); color: var(--red); }

.rpa-qr {
  display: flex; justify-content: center;
  padding: 14px; margin-bottom: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
}
.rpa-qr img { width: 220px; height: 220px; object-fit: contain; image-rendering: crisp; }

.rpa-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rpa-actions .btn { flex: 1; min-width: 140px; }

.rpa-result { margin-bottom: 14px; }
.rpa-ok {
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--green-soft); color: var(--green);
  font-size: 12.5px; margin-bottom: 8px;
}
.rpa-err {
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--red-soft); color: var(--red);
  font-size: 12px; line-height: 1.6;
}
.rpa-detail { font-size: 11.5px; color: var(--text-2); line-height: 1.7; }
.rpa-hint { margin-top: 8px; font-size: 11.5px; color: var(--text-3); }

.login-state .btn { margin-left: 4px; }

.rpa-mode {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 12px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-2);
}
.rpa-mode b { color: var(--text); font-weight: 600; }

/* 视频库存条 */
.pool-card { padding: 13px 20px; }
.pool-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2);
}
.pool-stats { flex: 1; min-width: 180px; }
.pool-stats b { color: var(--text); font-weight: 600; }
.pool-card .hint { margin: 7px 0 0; }

/* 顶部锚点导航 */
.anchors {
  display: flex; align-items: center; gap: 2px;
  flex: 1; justify-content: center; min-width: 0;
}
.anchor {
  padding: 7px 13px; border-radius: 8px;
  font-size: 12.5px; color: var(--text-2); text-decoration: none;
  white-space: nowrap; transition: .15s;
}
.anchor:hover { background: var(--surface-3); color: var(--text); }
.anchor.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 草稿箱列表（页面内） */
.draft-list { display: flex; flex-direction: column; gap: 8px; }
.draft-item {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
  align-items: start; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
.draft-item.warn { border-color: #f0d9a8; background: #fffdf6; }
.draft-item .di-main { min-width: 0; }
.draft-item .di-main strong {
  display: block; font-size: 12.5px; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.draft-item .di-main span {
  display: block; font-size: 11.5px; color: var(--text-2); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.draft-item em {
  font-style: normal; font-size: 10.5px; color: var(--text-3);
  white-space: nowrap;
}
.draft-item .sim-warn { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .anchors {
    order: 3; width: 100%; flex-basis: 100%;
    justify-content: flex-start; overflow-x: auto;
    padding-top: 6px;
  }
  .topbar { flex-wrap: wrap; }
}

.sim-summary.hidden { display: none; }

/* 流程式说明（有序列表） */
.step-notes.flow { list-style: none; counter-reset: step; padding-left: 0; }
.step-notes.flow li {
  position: relative; padding-left: 26px; margin-bottom: 4px;
}
.step-notes.flow li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2);
  font-size: 10px; line-height: 17px; text-align: center;
}
.login-state.mock .dot { background: var(--text-3); }
.login-state.mock { color: var(--text-2); }

/* 历史时间线 */
.history-summary {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 10px 13px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 12px; color: var(--text-2);
}
.history-summary b { color: var(--text); font-weight: 600; }

.history-list { display: flex; flex-direction: column; gap: 16px; }
.history-day {
  border-left: 2px solid var(--line); padding-left: 14px;
}
.hd-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 9px;
}
.hd-head strong { font-size: 13px; }
.hd-head span { font-size: 11px; color: var(--text-3); }

.hist-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px;
  align-items: start; padding: 9px 0 9px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.hist-item:last-child { border-bottom: 0; }
.hi-badge {
  flex: none; padding: 2px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.hi-badge.select { background: var(--blue-soft); color: var(--blue); }
.hi-badge.generate { background: var(--brand-soft); color: var(--brand); }
.hi-badge.draft { background: var(--green-soft); color: var(--green); }

.hi-body { min-width: 0; }
.hi-body strong {
  display: block; font-size: 12.5px; line-height: 1.4; margin-bottom: 2px;
}
.hi-body > span {
  display: block; font-size: 11px; color: var(--text-2); line-height: 1.6;
}
.hi-err { color: var(--red) !important; }
.hi-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px;
}
.hi-tags em {
  font-style: normal; font-size: 10.5px; padding: 1px 7px;
  border-radius: 5px; background: var(--surface-3); color: var(--text-2);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hi-tags em.ok { background: var(--green-soft); color: var(--green); }
.hi-tags em.bad { background: var(--red-soft); color: var(--red); }
.hi-tags em.more { background: transparent; color: var(--text-3); }
.hist-item time {
  font-size: 10.5px; color: var(--text-3); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
