/* ============================================================
   OZON 一键上架工具 — UI 设计系统 v2
   对标主流跨境电商 ERP（店小秘 / 领星 / 马帮 / OZON Seller）
   - OZON 品牌蓝主色 · 变量化亮/暗双主题 · 下划线式导航
   ============================================================ */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f8fa;      /* 次级面板 / info-grid */
  --surface-3: #eef1f5;      /* 表头 / pipeline-bar */
  --border: #e5e7ec;
  --border-strong: #d3d8e0;
  --text: #1d2129;
  --text-2: #4e5562;
  --text-3: #8a94a6;

  --primary: #005bff;        /* OZON 品牌蓝 */
  --primary-hover: #004cd6;
  --primary-light: #e8f0ff;
  --primary-ring: rgba(0, 91, 255, .14);

  --ok: #16a34a;    --ok-bg: #e6f7ec;
  --warn: #d97706;  --warn-bg: #fdf1e0;
  --err: #dc2626;   --err-bg: #fdecec;
  --info: #2563eb;  --info-bg: #e8f0ff;
  --neutral-bg: #eef1f5; --neutral-text: #66707f;

  --green: var(--ok); --orange: var(--warn); --red: var(--err);

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-hover: 0 6px 18px rgba(16, 24, 40, .10);
  --shadow-modal: 0 18px 60px rgba(16, 24, 40, .22);
  --sidebar: 264px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101318;
    --surface: #171b22;
    --surface-2: #1d222b;
    --surface-3: #232936;
    --border: #2b323e;
    --border-strong: #3a4250;
    --text: #e7eaf0;
    --text-2: #b3bac7;
    --text-3: #7c8494;

    --primary: #4d8dff;
    --primary-hover: #6ba1ff;
    --primary-light: #1c2c47;
    --primary-ring: rgba(77, 141, 255, .25);

    --ok: #4ade80;    --ok-bg: #16301f;
    --warn: #fbbf24;  --warn-bg: #33270f;
    --err: #f87171;   --err-bg: #3a1d1d;
    --info: #6ba1ff;  --info-bg: #1c2c47;
    --neutral-bg: #232936; --neutral-text: #9aa3b2;

    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-hover: 0 8px 22px rgba(0, 0, 0, .45);
    --shadow-modal: 0 18px 60px rgba(0, 0, 0, .6);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局骨架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.workspace { flex: 1; min-width: 0; padding-bottom: 48px; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px;
  box-shadow: var(--shadow-hover); animation: toast-in .22s ease; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
}
.toast-info { border-left-color: var(--info); color: var(--text); }
.toast-success { border-left-color: var(--ok); color: var(--text); }
.toast-error { border-left-color: var(--err); color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- 侧边栏 ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.monogram {
  width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.brand-name { font-weight: 600; font-size: 15px; white-space: nowrap; }

.sidebar-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 10px; letter-spacing: .6px; cursor: pointer; user-select: none;
  display: flex; justify-content: space-between; align-items: center;
}
.section-title:hover { color: var(--primary); }
.config-group label { display: block; font-size: 12px; color: var(--text-2); margin: 8px 0 3px; }
.config-group input, .config-group select {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.config-group input:focus, .config-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.config-row { margin-top: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px !important; cursor: pointer; color: var(--text-2) !important; }
.test-result { font-size: 12px; margin-top: 8px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); text-align: center; }

.rule-group { display: flex; flex-direction: column; gap: 10px; }
.rule-row label { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; }
.rule-row label strong { color: var(--primary); font-weight: 600; }
.rule-row input[type=range] { width: 100%; height: 4px; -webkit-appearance: none; appearance: none; background: var(--surface-3); border-radius: 2px; outline: none; margin-top: 4px; }
.rule-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--primary); border-radius: 50%; cursor: pointer; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.sidebar-footer {
  margin-top: auto; padding: 12px 18px; font-size: 12px; color: var(--text-3);
  display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border);
}

/* ---------- 按钮 ---------- */
.btn {
  padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px;
  transition: .15s; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; border-color: var(--primary-hover); }
.btn:disabled, .btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 17px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.topbar h1 .hint { font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 全局搜索 */
.search-box { position: relative; min-width: 240px; flex: 1; max-width: 420px; }
.search-box input {
  width: 100%; padding: 7px 30px 7px 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface-2); color: var(--text); outline: none; transition: .15s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); background: var(--surface); }
.search-box::before {
  content: ''; position: absolute; left: 11px; top: 50%; width: 12px; height: 12px; transform: translateY(-50%);
  border: 1.8px solid var(--text-3); border-radius: 50%; pointer-events: none;
}
.search-box::after {
  content: ''; position: absolute; left: 22px; top: calc(50% + 6px); width: 7px; height: 1.8px;
  background: var(--text-3); transform: rotate(45deg); pointer-events: none;
}
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: none; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 14px; line-height: 1; border-radius: 4px;
}
.search-clear:hover { color: var(--text); background: var(--surface-3); }

/* ---------- 列表头：统计条 + 工具行（ERP 操作方式） ---------- */
.list-head { margin: 16px 24px 0; display: flex; flex-direction: column; gap: 10px; }
.stat-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; font-size: 13px; color: var(--text-2); transition: .15s;
}
.stat-chip strong { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-chip:hover { border-color: var(--border-strong); }
.stat-chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.stat-chip.active strong { color: var(--primary); }
.stat-chip.sc-warn.active, .stat-chip.sc-warn strong { color: var(--warn); }
.stat-chip.sc-warn.active { background: var(--warn-bg); border-color: var(--warn); }
.stat-chip.sc-info.active, .stat-chip.sc-info strong { color: var(--info); }
.stat-chip.sc-info.active { background: var(--info-bg); border-color: var(--info); }
.stat-chip.sc-ok.active, .stat-chip.sc-ok strong { color: var(--ok); }
.stat-chip.sc-ok.active { background: var(--ok-bg); border-color: var(--ok); }
.stat-chip.sc-err.active, .stat-chip.sc-err strong { color: var(--err); }
.stat-chip.sc-err.active { background: var(--err-bg); border-color: var(--err); }
.stat-profit { margin-left: auto; font-size: 13px; font-weight: 600; padding-right: 4px; }

.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 30px; }
.sort-select { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-left: auto; }
.sort-select select {
  padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 12px; background: var(--surface); color: var(--text); outline: none;
}
.view-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.view-seg button {
  padding: 5px 12px; border: none; background: var(--surface); color: var(--text-2);
  font-size: 12px; cursor: pointer; transition: .15s;
}
.view-seg button + button { border-left: 1px solid var(--border-strong); }
.view-seg button.active { background: var(--primary); color: #fff; }

/* ---------- 面板 ---------- */
.panel {
  margin: 16px 24px 0; background: var(--surface); border-radius: var(--radius);
  padding: 16px 20px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; resize: vertical; outline: none; font-family: inherit; background: var(--surface); color: var(--text); transition: .15s;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input-options { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.option { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.option input, .option select {
  padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 12px; width: 104px; background: var(--surface); color: var(--text); outline: none;
}
.option input:focus, .option select:focus { border-color: var(--primary); }

/* ---------- 表格 ---------- */
.table-panel { padding: 0; overflow: hidden; }
.table-panel .empty-state { padding: 48px 24px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--surface-3); padding: 9px 12px; text-align: left; font-weight: 500;
  color: var(--text-2); border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .col-check { width: 36px; }
.data-table .col-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-row { cursor: pointer; transition: background .12s; }
.table-row:hover { background: var(--surface-2); }

/* ---------- 商品卡片 ---------- */
.task-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); padding: 12px 24px 0; }
.task-card {
  background: var(--surface); border-radius: var(--radius); padding: 14px; cursor: pointer;
  border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.task-card:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.platform-tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--neutral-bg); color: var(--neutral-text); font-weight: 500; }
.status-tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.status-pending { background: var(--neutral-bg); color: var(--neutral-text); }
.status-scraping, .status-translating, .status-processing_images, .status-uploading, .status-uploading_images, .status-importing, .status-matching_category, .status-filling_attributes { background: var(--info-bg); color: var(--info); animation: pulse 1.5s infinite; }
.status-scraped, .status-translated, .status-images_done, .status-category_matched, .status-attributes_filled, .status-images_uploaded { background: var(--warn-bg); color: var(--warn); }
.status-reviewing { background: var(--warn-bg); color: var(--warn); }
.status-completed { background: var(--ok-bg); color: var(--ok); }
.status-failed { background: var(--err-bg); color: var(--err); }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .55 } }
.card-body { flex: 1; margin-bottom: 6px; }
.card-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12px; color: var(--text-3); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.suggestion-tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; margin-top: 6px; font-weight: 500; }
.sg-可上架 { background: var(--ok-bg); color: var(--ok); }
.sg-谨慎上架 { background: var(--warn-bg); color: var(--warn); }
.sg-不建议上架 { background: var(--err-bg); color: var(--err); }
.card-footer { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.card-error { font-size: 11px; color: var(--err); }
.card-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* 空状态 */
.empty-state { text-align: center; padding: 56px 24px; grid-column: 1 / -1; color: var(--text-3); }
.empty-state .empty-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px;
  background: var(--primary-light); position: relative;
}
.empty-state .empty-icon::before {
  content: ''; position: absolute; inset: 16px 14px 14px; border: 2px solid var(--primary); border-radius: 4px;
}
.empty-state .empty-icon::after {
  content: ''; position: absolute; left: 20px; right: 20px; top: 14px; height: 2px; background: var(--primary); border-radius: 1px;
}
.empty-state strong { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 4px; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 25, .45); display: flex;
  align-items: center; justify-content: center; z-index: 200; padding: 20px;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: 14px; padding: 24px; max-width: 700px; width: 90%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-modal); border: 1px solid var(--border);
  animation: modal-up .2s ease;
}
@keyframes modal-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-wide { max-width: 980px; }
.modal h2 { font-size: 17px; margin-bottom: 16px; font-weight: 600; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.review-footer { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }

/* 审核抽屉（右侧滑出，ERP 连续审核操作方式） */
.modal-overlay.modal-right { justify-content: flex-end; padding: 0; }
.modal.drawer {
  width: min(880px, 94vw); max-width: none; height: 100vh; max-height: 100vh;
  border-radius: 0; border: none; border-left: 1px solid var(--border);
  padding: 0 24px 24px; animation: drawer-in .22s ease;
  display: flex; flex-direction: column;
}
@keyframes drawer-in { from { transform: translateX(48px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 5;
}
.modal-head-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.modal-head-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drawer-close {
  width: 30px; height: 30px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-size: 17px; line-height: 1; cursor: pointer; transition: .15s;
}
.drawer-close:hover { border-color: var(--err); color: var(--err); }
.modal.drawer .review-tabs { margin-top: 12px; }
.modal.drawer .review-section { flex: 1; }

/* 审核页签（下划线式） */
.review-tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.review-tab {
  padding: 8px 14px; border: none; background: transparent; cursor: pointer; font-size: 13px;
  color: var(--text-2); white-space: nowrap; position: relative; transition: color .15s;
}
.review-tab:hover { color: var(--text); }
.review-tab.active { color: var(--primary); font-weight: 600; }
.review-tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--primary); border-radius: 1px; }
.review-section { min-height: 120px; }

/* ---------- 详情组件 ---------- */
.info-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-grid div { font-size: 13px; padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-sm); word-break: break-all; }
.info-grid label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.image-item { text-align: center; }
.image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.img-label { font-size: 11px; color: var(--text-3); margin-top: 3px; display: block; }

.profit-box { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.profit-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.profit-row + .profit-row { border-top: 1px solid var(--border); }

.card-field { margin-bottom: 12px; }
.card-field label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 4px; font-weight: 500; }
.desc-box { font-size: 13px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); line-height: 1.65; max-height: 200px; overflow-y: auto; }
.bullet-list { margin: 4px 0 0 16px; font-size: 13px; }
.bullet-list li { margin-bottom: 3px; }
.attr-grid { display: grid; gap: 5px; }
.attr-item { display: flex; gap: 8px; padding: 5px 10px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 12px; }
.attr-item span:first-child { font-weight: 500; color: var(--text-2); min-width: 100px; }

.plan-grid { display: grid; gap: 8px; }
.plan-item { display: flex; gap: 12px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.plan-index {
  width: 52px; height: 52px; background: var(--primary); color: #fff; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.plan-body { flex: 1; }
.plan-purpose { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.plan-detail { font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.plan-ru { font-size: 12px; color: var(--primary); }

.score-panel { text-align: center; }
.score-ring {
  width: 84px; height: 84px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; margin: 0 auto 10px;
  border: 4px solid var(--primary-ring);
}
.score-decision { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.sd-publish { color: var(--ok); }
.sd-review { color: var(--warn); }
.sd-reject { color: var(--err); }
.score-details { text-align: left; }
.score-item { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.score-item span:first-child { width: 52px; color: var(--text-2); }
.score-item span:last-child { width: 40px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.sb-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.preview-code {
  background: #1d222b; color: #b9c2d0; padding: 14px; border-radius: var(--radius-sm); font-size: 12px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 400px; overflow-y: auto;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

.draft-list { display: flex; flex-direction: column; gap: 6px; }
.draft-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s; }
.draft-item:hover { border-color: var(--border-strong); }
.draft-info { display: flex; flex-direction: column; font-size: 13px; }
.draft-info span { font-size: 12px; color: var(--text-3); }
.draft-actions { display: flex; gap: 5px; }

/* 流程 */
.pipeline-bar { display: flex; gap: 0; margin-bottom: 16px; background: var(--surface-3); border-radius: var(--radius-sm); padding: 8px 12px; overflow-x: auto; }
.pl-step { display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; padding: 3px 8px; border-radius: 5px; }
.pl-step + .pl-step::before { content: '›'; color: var(--text-3); margin-right: 4px; font-size: 14px; }
.pl-completed, .pl-done { background: var(--ok-bg); }
.pl-failed { background: var(--err-bg); }
.pl-uploading, .pl-matching_category, .pl-filling_attributes, .pl-importing, .pl-upload_images, .pl-scraping, .pl-translating, .pl-processing_images, .pl-uploading_images { background: var(--info-bg); }
.pl-warning { background: var(--warn-bg); }
.pl-icon { font-size: 12px; }
.pl-label { font-size: 11px; color: var(--text-2); }
.pipeline-log { display: flex; flex-direction: column; gap: 5px; max-height: 400px; overflow-y: auto; }
.plog-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; font-size: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.plog-time { font-size: 11px; color: var(--text-3); font-family: 'Cascadia Code', Consolas, monospace; white-space: nowrap; min-width: 62px; }
.plog-icon { font-size: 13px; }
.plog-body { display: flex; flex-direction: column; }
.plog-body strong { font-size: 12px; }
.plog-body span { font-size: 11px; color: var(--text-2); word-break: break-all; }

/* 错误 */
.error-box { background: var(--err-bg); border: 1px solid var(--err); border-radius: var(--radius); padding: 12px 14px; }
.error-header { font-size: 13px; font-weight: 600; color: var(--err); margin-bottom: 6px; }
.error-detail {
  font-size: 11px; color: var(--err); background: var(--surface); padding: 8px; border-radius: var(--radius-sm);
  overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 150px; overflow-y: auto;
  font-family: 'Cascadia Code', Consolas, monospace;
}

/* 处理中进度条 */
.card-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 22px; background: var(--info-bg); display: flex; align-items: center; justify-content: center; }
.progress-label { font-size: 10px; color: var(--info); font-weight: 500; z-index: 1; }
.progress-bar { position: absolute; top: 0; left: 0; height: 100%; background: var(--primary-ring); animation: progress 2s ease-in-out infinite; width: 40%; }
@keyframes progress { 0% { margin-left: -40% } 100% { margin-left: 100% } }

/* 风险 */
.risk-box { border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.risk-header { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.risk-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.risk-item:last-child { border-bottom: none; }
.risk-badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; text-transform: uppercase; }
.rb-critical, .rb-blocked { background: var(--err-bg); color: var(--err); }
.rb-high { background: var(--warn-bg); color: var(--warn); }
.rb-medium { background: var(--warn-bg); color: var(--warn); }
.rb-warning { background: var(--info-bg); color: var(--info); }
.risk-body { display: flex; flex-direction: column; }
.risk-body strong { font-size: 12px; }
.risk-body span { font-size: 11px; color: var(--text-2); }

/* 属性预检 */
.review-loading { text-align: center; padding: 44px 20px; color: var(--text-3); }
.preflight-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.preflight-title { font-size: 15px; font-weight: 600; }
.preflight-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.preflight-summary > div {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; display: flex; flex-direction: column; text-align: center;
}
.preflight-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.preflight-summary span { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.attr-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.review-attr-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.review-attr-table th { text-align: left; padding: 9px 10px; background: var(--surface-3); color: var(--text-2); font-size: 12px; border-bottom: 1px solid var(--border-strong); }
.review-attr-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.review-attr-table tr:last-child td { border-bottom: none; }
.row-missing { background: var(--warn-bg); }
.attr-input {
  width: 100%; min-width: 220px; padding: 7px 9px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--text);
}
.attr-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ai-hint { color: var(--primary); font-size: 11px; margin-top: 4px; }
.preflight-notice { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.notice-blocked { background: var(--err-bg); color: var(--err); border: 1px solid var(--err); }
.notice-pass { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }

/* 队列悬浮状态 */
.queue-status {
  position: fixed; right: 18px; bottom: 18px; z-index: 160; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px;
  box-shadow: var(--shadow-hover); font-size: 12px; display: flex; gap: 4px; align-items: center;
}
.queue-status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--info);
  animation: pulse 1.5s infinite; margin-right: 6px; flex-shrink: 0;
}

/* ---------- 通用工具 ---------- */
.text-green { color: var(--ok) !important; }
.text-yellow { color: var(--warn) !important; }
.text-red { color: var(--err) !important; }
.hint { font-size: 12px; color: var(--text-3); }
.badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 600; display: inline-block; letter-spacing: .3px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--err-bg); color: var(--err); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-text); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .modal.drawer { width: 100vw; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .panel { margin: 12px 16px 0; }
  .list-head { margin: 12px 16px 0; }
  .task-grid { grid-template-columns: 1fr; padding: 12px 16px 0; }
  .topbar { padding: 12px 16px; flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .stat-profit { margin-left: 0; width: 100%; }
  .sort-select { margin-left: 0; }
  .info-grid { grid-template-columns: 1fr; }
  .preflight-summary { grid-template-columns: 1fr; }
  .modal { width: 100%; max-height: 94vh; padding: 16px; }
  .modal.drawer { padding: 0 16px 16px; }
  .queue-status { left: 12px; right: 12px; bottom: 12px; justify-content: center; }
}
