/* AI 电商主图系统 — 专业版界面 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #eef2f7;
  --bg-mesh: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.08), transparent),
             radial-gradient(ellipse 60% 40% at 100% 0%, rgba(14, 165, 233, 0.06), transparent);
  --panel: #ffffff;
  --sidebar: #fafbfc;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #0891b2;
  --accent-soft: #ecfeff;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --ok: #10b981;
  --ok-soft: #ecfdf5;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --radius-lg: 16px;
}

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

/* ── 顶栏 ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -0.5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.brand h1 { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.brand p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.main-nav {
  display: flex; gap: 4px; background: var(--border-light);
  padding: 4px; border-radius: 12px; flex-wrap: wrap;
}
.nav-btn {
  border: none; background: transparent; padding: 7px 14px;
  border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  position: relative;
}
.nav-ico { font-size: 14px; line-height: 1; opacity: 0.85; }
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.85); }
.nav-btn.active {
  background: var(--panel); color: var(--primary);
  box-shadow: var(--shadow-sm); font-weight: 600;
}
.nav-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff;
  margin-left: 2px; line-height: 1.4;
}
.nav-divider {
  width: 1px; height: 22px; background: var(--border);
  margin: 0 4px; flex-shrink: 0; align-self: center;
}

/* ── 视图布局 ── */
.view { display: none; flex: 1; overflow: hidden; min-height: 0; }
.view.active { display: flex; }
#view-settings { overflow: auto; display: none; }
#view-settings.active { display: block; }
#view-gallery {
  overflow-y: auto;
  display: none;
  padding: 20px 24px 48px;
  min-height: 0;
}
#view-gallery.active { display: block; }

.sidebar {
  width: 380px; min-width: 380px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 16px 12px;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.sidebar-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.sidebar-actions .primary.accent {
  background: linear-gradient(135deg, var(--accent) 0%, #0e7490 100%);
  box-shadow: 0 2px 10px rgba(8, 145, 178, 0.35);
}
.sidebar-actions .primary.accent:hover { background: linear-gradient(135deg, #0e7490, #155e75); }

.content {
  flex: 1; overflow-y: auto; padding: 28px 32px;
  min-width: 0;
}

/* ── 侧边栏步骤 ── */
.step-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step-section.step-done { border-color: #a7f3d0; background: var(--ok-soft); }
.step-section.step-active { border-color: #93c5fd; box-shadow: 0 0 0 3px var(--primary-soft); }
.step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--border-light); color: var(--muted);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s;
}
.step-section.step-active .step-num { background: var(--primary); color: #fff; }
.step-section.step-done .step-num { background: var(--ok); color: #fff; }
.step-title { font-size: 15px; font-weight: 600; color: var(--text); }
.step-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.step-body { display: flex; flex-direction: column; gap: 10px; }

/* ── 顶部流程条（主内容区） ── */
.workflow-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 24px;
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.wf-step {
  flex: 1; display: flex; align-items: center; gap: 12px;
  position: relative; opacity: 0.45; transition: opacity 0.2s;
}
.wf-step.active, .wf-step.done { opacity: 1; }
.wf-step:not(:last-child)::after {
  content: ""; flex: 1; height: 2px; background: var(--border);
  margin: 0 12px; min-width: 20px;
}
.wf-step.done:not(:last-child)::after { background: var(--ok); }
.wf-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--border-light); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.wf-step.active .wf-icon { background: var(--primary-soft); color: var(--primary); border: 2px solid var(--primary); }
.wf-step.done .wf-icon { background: var(--ok-soft); color: var(--ok); }
.wf-text strong { display: block; font-size: 14px; color: var(--text); }
.wf-text span { font-size: 12px; color: var(--muted); }

/* ── 引导空状态 ── */
.empty-hint {
  text-align: center; padding: 48px 24px;
  background: var(--panel); border: 1px dashed var(--border);
  border-radius: var(--radius-lg); margin-top: 20px;
}
.empty-hint.hero { margin-top: 0; padding: 48px 36px; border-style: solid; border-color: var(--border); }
.empty-hint .hero-icon {
  font-size: 52px; margin-bottom: 12px; line-height: 1;
}
.feature-pills {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-bottom: 16px;
}
.feature-pills .pill {
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid #bfdbfe;
}
.feature-pills .pill-hot {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c; border-color: #fdba74;
}
.empty-hint h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-hint > p { color: var(--text-secondary); font-size: 15px; line-height: 1.8; max-width: 520px; margin: 0 auto; }
.guide-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 32px; text-align: left;
}
.guide-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.guide-card .g-num {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.guide-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.guide-card p { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── 选图区 ── */
.select-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.check-label {
  display: flex; align-items: center; gap: 10px; font-size: 14px;
  cursor: pointer; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); transition: border-color 0.15s;
}
.check-label:hover { border-color: #93c5fd; }
.check-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.check-label small { color: var(--muted); margin-left: auto; font-size: 12px; }

.field-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-top: 4px; }

.style-opts { display: flex; flex-direction: column; gap: 8px; }
.style-opts .radio {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px; border: 2px solid var(--border);
  border-radius: 10px; cursor: pointer; margin: 0; transition: all 0.15s;
}
.style-opts .radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.style-opts .radio input { accent-color: var(--primary); }
.style-opts .radio .style-name { font-weight: 600; font-size: 14px; }
.style-opts .radio small { width: 100%; color: var(--muted); font-size: 12px; margin-left: 26px; }
.style-opts-compact .radio {
  padding: 10px 12px;
}
.style-opts-compact .radio small {
  margin-left: 0;
  width: auto;
  flex: 1 1 100%;
  margin-top: -2px;
}
.label-note { font-weight: 400; color: var(--muted); font-size: 11px; }

/* ── 素材建图：出图策略（与二创优化风格区分） ── */
.studio-strategy-section {
  margin: 8px 0 12px; padding: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #cbd5e1; border-radius: var(--radius);
}
.studio-strategy-section > label,
.studio-strategy-section > .strategy-section-title {
  font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 8px;
}
.strategy-notice {
  font-size: 12px; line-height: 1.65; color: var(--text-secondary);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 10px 12px; border-radius: 0 8px 8px 0; margin-bottom: 12px;
}
.strategy-notice strong { color: var(--text); }
.strategy-notice.compact {
  padding: 8px 10px; margin-bottom: 10px; font-size: 11px; line-height: 1.5;
}
.studio-strategy-opts { display: flex; flex-direction: column; gap: 10px; }
.strategy-card.compact { padding: 0; }
.strategy-card.compact .strategy-card-body { padding: 10px 12px; }
.strategy-card.compact .strategy-desc { font-size: 12px; margin: 4px 0 0; }
.strategy-card {
  display: block; position: relative; margin: 0; cursor: pointer;
  border: 2px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: all 0.15s;
}
.strategy-card input[type="radio"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer; z-index: 2;
}
.strategy-card-body {
  display: block; padding: 12px 14px; background: var(--panel);
  pointer-events: none; position: relative; z-index: 1;
}
.strategy-card:has(input:checked) {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.strategy-card:has(input:checked) .strategy-card-body {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #fff 70%);
}
.strategy-card-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.strategy-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  background: var(--border-light); color: var(--text-secondary);
}
.strategy-badge.hot {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c;
}
.strategy-badge.camp {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}
.strategy-preview {
  display: block;
  width: 100%;
  max-width: 220px;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  object-fit: cover;
}
.strategy-name { font-size: 14px; font-weight: 700; color: var(--text); }
.strategy-desc {
  font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin: 0 0 8px;
}
.strategy-scope {
  margin: 0; padding-left: 16px; font-size: 11px; color: var(--muted); line-height: 1.5;
}
.strategy-hint {
  font-size: 11px; color: var(--muted); margin: 10px 0 0; line-height: 1.55;
  padding-top: 10px; border-top: 1px dashed var(--border);
}

.adv { margin: 4px 0 8px; }
.adv summary {
  font-size: 13px; color: var(--primary); cursor: pointer;
  padding: 6px 0; font-weight: 500;
}

/* ── 任务列表 ── */
.task-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-weight: 600; font-size: 13px; color: var(--text-secondary);
}
.task-list { list-style: none; overflow-y: auto; flex: 1; min-height: 80px; }
.task-list li {
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); margin-bottom: 8px;
  background: var(--panel); transition: all 0.15s;
}
.task-list li:hover { border-color: #93c5fd; background: var(--primary-soft); }
.task-list li.active { border-color: var(--primary); background: var(--primary-soft); }
.task-list li .t-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.task-list li .t-ico { font-size: 14px; flex-shrink: 0; }
.task-list li .t-meta {
  font-size: 11px; color: var(--muted);
  display: flex; justify-content: space-between; margin-top: 6px;
}
.task-list li .t-status-ok { color: var(--ok); font-weight: 600; }
.task-list li .t-status-run { color: var(--warn); font-weight: 600; }
.task-list li .t-status-warn { color: #e67e22; font-weight: 600; }
.gp-interrupted { color: #e67e22; font-weight: 600; }

/* ── 内容区标题 ── */
.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.detail-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.detail-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-section.step-nav .step-header { cursor: pointer; }
.step-section.step-nav .step-header:hover { opacity: 0.85; }
.status-badge {
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--border-light); color: var(--muted);
}
.status-badge.collecting, .status-badge.generating, .status-badge.uploading,
.status-badge.analyzing {
  background: var(--warn-soft); color: #b45309;
  animation: statusPulse 2s ease infinite;
}
.status-badge.collected, .status-badge.generated, .status-badge.done,
.status-badge.planned {
  background: var(--ok-soft); color: #047857;
}
.status-badge.error { background: var(--danger-soft); color: var(--danger); }
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ── 图片分区 ── */
.img-section {
  margin-bottom: 28px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.img-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.img-section h3 { font-size: 16px; font-weight: 600; margin: 0; }
.img-section h3 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.section-toolbar { display: flex; gap: 6px; }
.section-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.section-hint.compact { margin-bottom: 10px; line-height: 1.55; }

/* ── Tab ── */
.steps {
  display: flex; gap: 4px; background: var(--border-light);
  padding: 4px; border-radius: 10px; margin-bottom: 20px; width: fit-content;
}
.step-tab {
  border: none; background: transparent; padding: 8px 18px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-radius: 8px; transition: all 0.15s;
}
.step-tab.active { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── 图片网格 ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.card {
  position: relative; border: 2px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.card img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; background: var(--border-light); }
.card .cap {
  font-size: 11px; padding: 6px 8px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--border-light);
}
.card .check {
  position: absolute; top: 8px; left: 8px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(255,255,255,0.92);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; font-weight: 700;
}
.card.selected .check { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── 结果区 ── */
.result-row, .opt-row {
  display: flex; align-items: flex-start; gap: 20px; padding: 20px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.result-src, .opt-src { text-align: center; min-width: 120px; }
.result-src img, .opt-src img {
  width: 120px; height: 120px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); display: block;
}
.result-src small, .opt-src small { font-size: 11px; color: var(--muted); display: block; margin-top: 6px; }
.result-idx, .opt-idx {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}
.result-arrow, .opt-arrow { font-size: 24px; color: var(--muted); padding-top: 44px; }
.result-outs, .opt-outs { display: flex; gap: 16px; flex-wrap: wrap; }
.result-out, .opt-out { text-align: center; }
.result-out img, .opt-out img {
  max-width: 180px; max-height: 220px; border-radius: 10px;
  border: 1px solid var(--border); display: block; background: var(--border-light);
}
.result-out figcaption, .opt-out figcaption {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px;
}
.result-out .dl, .opt-out .dl, .color-result-row .dl, .detail-result-row .dl {
  color: var(--primary); text-decoration: none; font-weight: 600; font-size: 13px;
}
.result-out .dl:hover, .opt-out .dl:hover { text-decoration: underline; }
.result-plan { font-size: 12px; color: var(--accent); margin-top: 6px; text-align: left; max-width: 140px; }

/* ── 进度条 ── */
.gen-progress-bar {
  padding: 18px 20px; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-soft), #f0f9ff);
  border: 1px solid #bfdbfe; border-radius: var(--radius);
}
.gen-progress-bar .gp-head { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 10px; }
.gen-progress-bar .gp-bar {
  height: 10px; background: rgba(255,255,255,0.8);
  border-radius: 5px; overflow: hidden; margin: 10px 0;
  border: 1px solid #bfdbfe;
}
.gen-progress-bar .gp-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 5px; transition: width 0.4s ease;
}
.gen-progress-bar .gp-hint { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.gen-progress-bar .gp-stats {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px;
}
.gen-progress-bar .gp-stat {
  font-size: 12px; background: rgba(255,255,255,0.7);
  padding: 4px 10px; border-radius: 6px; color: var(--text-secondary);
}
.gen-progress-bar .gp-fill.indeterminate {
  width: 35% !important;
  animation: gp-indeterminate 1.4s ease-in-out infinite;
}
@keyframes gp-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.collect-running-panel {
  padding: 24px;
  margin-bottom: 16px;
}
.collect-sidebar-progress {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
}
.live-log {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}

.download-bar {
  margin-bottom: 20px; padding: 16px 20px;
  background: linear-gradient(135deg, var(--ok-soft) 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.dl-bar-text { flex: 1; min-width: 200px; }
.dl-bar-text strong { display: block; font-size: 15px; color: #047857; margin-bottom: 4px; }
.download-bar .tip { margin: 0; font-size: 12px; }
.download-bar .primary {
  background: var(--ok); font-size: 15px; font-weight: 700;
  padding: 12px 28px; width: auto; min-width: 160px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.download-bar .primary:hover { background: #059669; }
.dl-bar-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end;
}
.dl-bar-actions .small {
  background: #fff; border: 1px solid #6ee7b7; color: #047857;
  padding: 10px 16px; font-weight: 600;
}
.dl-bar-actions .small:hover { background: #ecfdf5; }
.dl-bar-actions .small:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── 颜色/详情结果 ── */
.color-result-row, .detail-result-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px;
}
.color-result-row img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; }
.color-result-row .cname { font-size: 14px; font-weight: 600; }
.color-result-row.pending, .detail-result-row.pending { opacity: 0.8; }
.color-result-row.failed, .detail-result-row.failed { border-color: #fca5a5; background: var(--danger-soft); }
.color-result-row .pending-ph, .detail-result-row .pending-ph {
  width: 100px; height: 100px; border-radius: 8px;
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); background: var(--border-light);
}
.detail-result-row img { max-width: 200px; max-height: 200px; object-fit: contain; border-radius: 8px; }
.detail-result-row.skipped { border-color: #6ee7b7; background: var(--ok-soft); }

/* ── 视觉识别 ── */
.vision-block {
  margin-top: 8px; padding: 10px 12px; background: var(--primary-soft);
  border: 1px solid #bfdbfe; border-radius: 8px; font-size: 11px; text-align: left;
}
.vision-block.compact { max-width: 200px; }
.vision-title { font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.vision-row { display: flex; gap: 6px; margin-bottom: 2px; line-height: 1.4; }
.vision-row .vk { color: var(--muted); flex-shrink: 0; min-width: 52px; }
.vision-list { display: flex; flex-direction: column; gap: 12px; }
.vision-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.vision-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-weight: 600;
}
.vision-thumb {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
}

/* ── 表单与按钮 ── */
.tip { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.6; }
.help-box {
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
  background: var(--border-light); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px;
}
label { font-size: 13px; display: block; margin-bottom: 6px; color: var(--text-secondary); }
textarea, input, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  margin-bottom: 10px; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 72px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row input[type=number] { width: 88px; }
.row label { margin-bottom: 0; }

button { font-family: inherit; }
.primary {
  background: var(--primary); color: #fff; border: none;
  padding: 12px 20px; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; width: 100%;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.primary:hover { background: var(--primary-d); }
.primary:active { transform: scale(0.98); }
.primary:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; }
.ghost {
  background: var(--panel); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 12px; color: var(--text-secondary); transition: all 0.15s;
}
.ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.mini { padding: 4px 10px; font-size: 12px; }

/* ── 设置页 ── */
.settings-wrap { max-width: 860px; margin: 28px auto; padding: 0 28px 80px; }
.settings-wrap > h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.settings-intro { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.settings-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--border-light); padding: 4px; border-radius: 10px; width: fit-content;
}
.settings-tab {
  border: none; background: transparent; padding: 8px 20px;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
}
.settings-tab.active { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; background: var(--panel);
  box-shadow: var(--shadow-sm);
}
legend { padding: 0 10px; font-weight: 600; color: var(--primary); font-size: 14px; }
.settings-actions {
  display: flex; align-items: center; gap: 12px;
  position: sticky; bottom: 0; background: var(--bg);
  padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px;
}
#save-hint { font-size: 13px; color: var(--ok); font-weight: 600; }

.logs {
  background: #1e293b; color: #e2e8f0; padding: 16px;
  border-radius: var(--radius); font-size: 12px; line-height: 1.7;
  max-height: 420px; overflow-y: auto; white-space: pre-wrap;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.hidden { display: none !important; }

/* ── 本地上传 ── */
.upload-drop {
  border: 2px dashed #cbd5e1; border-radius: var(--radius);
  padding: 24px 16px; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  transition: all 0.2s;
}
.upload-drop:hover, .upload-drop.dragging, .upload-drop.dragover {
  border-color: var(--primary); background: var(--primary-soft);
  transform: translateY(-1px);
}
.drop-icon {
  width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 28px; line-height: 48px;
}
.upload-drop p { font-size: 14px; font-weight: 500; color: var(--text); }
.upload-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 280px; overflow-y: auto; }
.upload-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel);
}
.upload-thumb {
  flex-shrink: 0; width: 52px; height: 52px;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-meta { flex: 1; min-width: 0; }
.upload-name {
  display: block; font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px;
}
.category-pills { display: flex; gap: 6px; }
.cat-pill {
  font-size: 12px; padding: 4px 10px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--border-light);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); }
.cat-pill.active {
  background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary); font-weight: 600;
}
.cat-pill[data-cat="detail"].active {
  background: #ede9fe; border-color: #7c3aed; color: #6d28d9;
}
.upload-rm {
  flex-shrink: 0; width: 24px; height: 24px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 18px; line-height: 24px; cursor: pointer; border-radius: 6px;
}
.upload-rm:hover { background: var(--danger-soft); color: var(--danger); }
.upload-cat-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.cat-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 8px; margin-bottom: 6px;
}
.cat-badge.main { background: var(--primary-soft); color: var(--primary); }
.cat-badge.detail { background: #ede9fe; color: #6d28d9; }
.collect-box label:first-child { font-weight: 600; font-size: 14px; color: var(--text); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--text); color: #fff;
  padding: 12px 24px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: all 0.25s;
  pointer-events: none; z-index: 9999;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 供应商卡片 ── */
.provider-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; background: var(--border-light);
}
.provider-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.provider-name { font-weight: 700; font-size: 15px; min-width: 80px; }
.provider-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.provider-fields label {
  font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.provider-actions { display: flex; gap: 8px; margin-top: 10px; }
.switch-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
button.small {
  font-size: 12px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer;
  color: var(--text);
}
button.small:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
button.small.primary,
.primary.small {
  background: var(--primary);
  color: #fff;
  border: none;
  width: auto;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.22);
}
button.small.primary:hover,
.primary.small:hover {
  background: var(--primary-d);
  color: #fff;
}
button.small.primary:disabled,
.primary.small:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}
button.danger { color: var(--danger); border-color: #fca5a5; }
button.danger:hover { background: var(--danger-soft); }

/* ── 结果分区标题 ── */
.result-section-title {
  font-size: 16px; font-weight: 600; margin: 24px 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border-light);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.result-section-title .badge-count {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); padding: 2px 10px; border-radius: 10px;
}
.result-section-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.result-section-actions .btn-studio-redo-main,
.result-section-actions .btn-partner-studio-redo-main {
  font-weight: 600;
}

/* ── 剪贴板粘贴 ── */
.upload-drop.paste-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.upload-drop.paste-flash {
  animation: pasteFlash 0.65s ease;
}
@keyframes pasteFlash {
  0%, 100% { background: var(--panel); }
  40% { background: var(--primary-soft); }
}
.help-box kbd, .drop-inner kbd {
  display: inline-block; padding: 1px 5px; font-size: 11px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 4px; background: var(--panel);
  box-shadow: 0 1px 0 var(--border);
}

/* ── 素材建图 CTR ── */
.ctr-tip { border-left: 3px solid var(--primary); background: var(--primary-soft); }
.upload-drop.compact { padding: 12px; min-height: 64px; }
.upload-drop.compact .drop-inner { padding: 8px; }
.module-checklist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.module-checklist .module-item { align-items: flex-start; }
.module-checklist .module-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.ctr-plan-view { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ctr-plan-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
}
.ctr-plan-card.highlight {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #f0f9ff 100%);
  border-color: #93c5fd;
}
.ctr-plan-card.wide { grid-column: 1 / -1; }
.ctr-plan-card h4 { font-size: 13px; color: var(--primary); margin: 0 0 8px; font-weight: 700; }
.ctr-plan-card h4:not(:first-child) { margin-top: 14px; }
.plan-cat { font-size: 16px; font-weight: 700; color: var(--text); }
.plan-strategy { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.plan-strategy strong { color: var(--primary); }
.plan-metrics {
  display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.plan-metrics .metric {
  font-size: 12px; color: var(--text-secondary);
  background: rgba(255,255,255,0.7); padding: 6px 12px; border-radius: 8px;
}
.plan-metrics .metric b { color: var(--primary); font-size: 16px; margin-right: 4px; }
.ctr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ctr-tag {
  font-size: 12px; padding: 4px 10px; border-radius: 8px;
  background: var(--ok-soft); color: #047857; font-weight: 600;
}
.ctr-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.ctr-list li { margin-bottom: 4px; }
.detail-module-list { display: flex; flex-direction: column; gap: 20px; }
.detail-module-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--panel);
}
.detail-module-card .dm-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--border-light); border-bottom: 1px solid var(--border);
}
.detail-module-card .dm-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.detail-module-card img { width: 100%; display: block; }

/* ── 缩略图网格（素材建图） ── */
.thumb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px; max-height: 200px; overflow-y: auto;
}
.thumb-item {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--panel);
  aspect-ratio: 1;
}
.thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-item .thumb-broken {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #b91c1c; background: #fef2f2; text-align: center; padding: 4px;
}
.thumb-item .thumb-name {
  display: none;
}
.thumb-item .thumb-rm {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border: none; border-radius: 50%; background: rgba(15,23,42,0.65);
  color: #fff; font-size: 14px; line-height: 20px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.thumb-item:hover .thumb-rm { opacity: 1; }
.thumb-item .thumb-rm:hover { background: var(--danger); }
.thumb-item.thumb-main-active {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45);
}
.thumb-item.thumb-primary-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
}
.thumb-item .thumb-sel-bar {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  display: flex; gap: 3px; justify-content: center;
}
.thumb-item .thumb-main-sel,
.thumb-item .thumb-primary {
  border: none; border-radius: 999px; padding: 1px 7px;
  font-size: 10px; line-height: 16px; cursor: pointer;
  background: rgba(15, 23, 42, 0.72); color: #fff;
  white-space: nowrap;
}
.thumb-item .thumb-main-sel.active {
  background: #0ea5e9; color: #fff; font-weight: 700;
}
.thumb-item .thumb-primary.active {
  background: var(--accent); color: #fff; font-weight: 700;
}
.thumb-item .thumb-primary:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.studio-product-desc {
  width: 100%; margin: 6px 0 4px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; line-height: 1.5; resize: vertical;
  min-height: 96px; max-height: 280px;
  background: var(--panel); color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  -webkit-user-select: text; user-select: text;
}
.studio-product-desc:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(14, 165, 233, 0.2));
}

/* ── 素材统计条 ── */
.studio-stats {
  display: flex; gap: 8px; margin: 12px 0; padding: 10px;
  background: var(--accent-soft); border: 1px solid #a5f3fc;
  border-radius: 10px;
}
.studio-stats .stat-item {
  flex: 1; text-align: center;
}
.studio-stats .stat-val {
  display: block; font-size: 18px; font-weight: 800; color: var(--accent);
  line-height: 1.2;
}
.studio-stats .stat-lbl { font-size: 11px; color: var(--text-secondary); }

.studio-extra-uploads {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.studio-extra-uploads .upload-drop.half { flex: 1; min-height: 72px; }
.studio-extra-thumbs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.studio-stats { flex-wrap: wrap; }

.studio-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 4px;
}
.studio-meta-grid input,
.studio-meta-grid select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
}

/* ── 重复采集提示 ── */
.duplicate-hint {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
}
.duplicate-hint .dup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ── 款式库 ── */
.gallery-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.gallery-sidebar h2 { margin: 0 0 8px; font-size: 18px; }
.gallery-sidebar input { width: 100%; margin: 10px 0; }
.gallery-main.panel { min-height: 400px; }
.gallery-detail.panel {
  grid-column: 1 / -1;
}
.gallery-layout.detail-open {
  grid-template-columns: 1fr;
}
.gallery-layout.detail-open .gallery-sidebar,
.gallery-layout.detail-open .gallery-main {
  display: none;
}
.style-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.style-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-align: left;
  padding: 0;
}
.style-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.style-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: var(--border-light);
}
.style-card-body { padding: 10px 12px 12px; }
.style-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.style-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}
.style-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
}
.gallery-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.gallery-detail-head h3 { margin: 0; font-size: 18px; }
.gallery-detail-body .gallery-section { margin-bottom: 20px; }
.gallery-detail-body .gallery-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--primary);
}
.gallery-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.gallery-img-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.gallery-img-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.gallery-img-item img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.gallery-img-item.portrait img { aspect-ratio: 3/4; }
.gallery-img-cap {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.gallery-img-item.promoable {
  position: relative;
}
.gallery-img-item .promo-gen-btn {
  margin: 0 8px 8px;
  width: calc(100% - 16px);
}
.gallery-detail-body {
  padding-bottom: 32px;
}

.promo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.promo-modal.hidden { display: none; }
.promo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.promo-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 8px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 22px 28px;
  margin: 8px auto 16px;
  flex-shrink: 0;
}
.promo-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.promo-modal-head h3 { margin: 0; font-size: 18px; }
.promo-modal-preview {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  margin: 14px 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}
.promo-modal-preview img {
  width: 120px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.promo-preview-title { font-size: 14px; font-weight: 600; }
.promo-size-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.promo-size-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.promo-size-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.promo-size-card input {
  margin-right: 8px;
  vertical-align: top;
}
.promo-size-body {
  display: inline-block;
  vertical-align: top;
  width: calc(100% - 28px);
}
.promo-size-body strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.promo-size-body span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}
.promo-size-body small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.promo-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--panel) 78%, rgba(255, 255, 255, 0));
  margin: 0 -22px -28px;
  padding: 12px 22px 20px;
}

.gallery-pagination {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gallery-page-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.gallery-page-size select {
  margin: 0 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.gallery-page-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.gallery-page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.gallery-page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
}

.module-chk .mod-render {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gallery-page-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.gallery-page-size select {
  margin: 0 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.gallery-page-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.gallery-page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.gallery-page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
}

.module-chk .mod-render {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 140, 160, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ── CTR 转化漏斗 ── */
.ctr-funnel {
  display: flex; flex-direction: column; gap: 0;
  margin-top: 12px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.funnel-step {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--panel); border-bottom: 1px solid var(--border-light);
}
.funnel-step:last-child { border-bottom: none; }
.funnel-step:nth-child(odd) { background: #fafbfc; }
.funnel-num {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.funnel-body strong { display: block; font-size: 13px; }
.funnel-body small { font-size: 11px; color: var(--muted); }

/* ── 结果卡片网格 ── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.card-grid .card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card-grid .card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--primary);
}
.card-grid .card img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block;
  background: var(--border-light);
}
.card-grid .card-label {
  display: block; padding: 8px 10px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); background: var(--border-light);
  text-align: center;
}
.card-grid .card-pending {
  border: 1px dashed var(--border); border-radius: 12px; overflow: hidden;
  background: var(--border-light);
}
.card-grid .card-pending .asset-placeholder {
  width: 100%; aspect-ratio: 3/4; display: flex; align-items: center;
  justify-content: center; font-size: 13px; color: var(--text-muted);
  background: #f0f2f5;
}
.card-grid .card-pending.card-failed .asset-placeholder { color: #c0392b; }

/* ── 核心三页统一 UI（商品优化 / 本地上传 / 素材建图） ── */
.core-view .sidebar-core {
  width: 360px; min-width: 360px;
  padding: 12px 14px 10px;
  gap: 0;
  overflow: hidden; /* 表单与历史分区各自滚动，避免历史被挤没 */
}
.core-view .core-panel {
  padding: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.core-view .core-panel .core-section + .core-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.core-view .core-section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.core-view .core-step {
  width: 24px; height: 24px; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.core-view .core-step.optional {
  background: var(--border-light); color: var(--muted); font-weight: 700;
}
.core-view .core-tip {
  font-size: 11px; color: var(--muted); line-height: 1.5;
  margin: 0 0 10px;
}
.core-view .check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 10px 0 4px;
}
.core-view .output-channel-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}
.core-view .core-tip kbd,
.core-view .core-field-label { font-size: 12px; }
.core-view .core-field-label {
  display: block; margin: 10px 0 6px; font-weight: 600; color: var(--text-secondary);
}
.core-view .core-section-compact { margin-top: 12px !important; padding-top: 12px !important; }
.core-view .core-adv { margin-top: 8px; }
.core-view .core-adv summary { font-size: 12px; }

.core-view .core-collapse {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border-light);
  overflow: hidden;
}
.core-view .core-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  user-select: none;
}
.core-view .core-collapse > summary::-webkit-details-marker { display: none; }
.core-view .core-collapse > summary::after {
  content: "▸"; font-size: 11px; color: var(--muted); transition: transform 0.15s;
}
.core-view .core-collapse[open] > summary {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  color: var(--primary);
}
.core-view .core-collapse[open] > summary::after { transform: rotate(90deg); }
.core-view .core-collapse-hint {
  font-size: 11px; font-weight: 500; color: var(--muted);
}
.core-view .core-collapse-body {
  padding: 10px;
  max-height: 52vh;
  overflow-y: auto;
}
.core-view .core-collapse-body .studio-strategy-section {
  margin: 0 0 10px; padding: 10px;
  background: var(--panel);
}
.core-view .core-collapse-body .studio-strategy-section:last-child { margin-bottom: 0; }

/* 侧栏历史：固定占高，始终能看到多条记录并顺畅滚动 */
.core-view .sidebar-history {
  flex: 0 0 clamp(240px, 38vh, 460px);
  min-height: 240px;
  max-height: 48vh;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  padding: 0 2px 4px;
  background: linear-gradient(180deg, transparent, rgba(248, 250, 252, 0.9) 12px);
  border-top: 1px solid var(--border);
}
.core-view .sidebar-history .task-list-header {
  margin: 0;
  padding: 10px 2px 8px;
  border-top: none;
  flex-shrink: 0;
}
.core-view .sidebar-history .task-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scrollbar-gutter: stable;
}
.core-view .sidebar-history .task-list li {
  padding: 10px 12px;
  margin-bottom: 6px;
}
.core-view .sidebar-history .task-list li .t-meta {
  margin-top: 4px;
}

.core-view .content-core {
  padding: 24px 28px;
}
.core-view .content-core:has(#empty-hint:not(.hidden)) .workflow-bar,
.core-view .content-core:has(#local-empty-hint:not(.hidden)) .workflow-bar,
.core-view .content-core:has(#studio-empty:not(.hidden)) .workflow-bar {
  display: none;
}
.core-view .core-empty {
  max-width: 560px; margin: 40px auto 0;
  padding: 40px 32px;
}
.core-view .core-empty .hero-icon { font-size: 44px; margin-bottom: 10px; }
.core-view .core-empty h3 { font-size: 18px; margin-bottom: 8px; }
.core-view .core-empty > p {
  font-size: 14px; line-height: 1.7; max-width: 420px;
}
.core-view .core-empty .feature-pills { margin-top: 16px; justify-content: center; }

.core-view .step-section { margin-bottom: 12px; }
.core-view .step-section .core-tip { margin-bottom: 0; }
.core-view .step-body .help-box { display: none; }

.core-view .upload-drop { padding: 18px 14px; }
.core-view .upload-drop.compact { padding: 10px; min-height: 56px; }
.core-view .upload-list { max-height: 220px; margin: 10px 0; }
.core-view .thumb-grid { max-height: 160px; }

.core-view kbd {
  display: inline-block; padding: 1px 5px; font-size: 10px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 4px; background: var(--panel);
}

/* ── 双平台预览 Tab ── */
.platform-channel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px;
  background: var(--border-light); border: 1px solid var(--border);
  border-radius: 10px;
}
.platform-channel-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.platform-channel-tabs {
  display: inline-flex; gap: 4px; background: var(--panel);
  padding: 3px; border-radius: 9px; border: 1px solid var(--border);
}
.platform-channel-tab {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); transition: all 0.15s;
}
.platform-channel-tab:hover { color: var(--text); background: rgba(255,255,255,0.7); }
.platform-channel-tab.active {
  background: var(--primary-soft); color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── 滚动条 ── */
.sidebar::-webkit-scrollbar, .content::-webkit-scrollbar, .thumb-grid::-webkit-scrollbar {
  width: 6px; height: 6px;
}
.sidebar::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb, .thumb-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 3px;
}

@media (max-width: 900px) {
  .view.active { flex-direction: column; }
  .topbar { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; }
  .main-nav { width: 100%; justify-content: center; }
  .nav-btn { padding: 6px 10px; font-size: 12px; }
  .nav-badge { display: none; }
  .nav-divider { display: none; }
  .sidebar { width: 100%; min-width: 0; max-height: 45vh; border-right: none; border-bottom: 1px solid var(--border); }
  .core-view .sidebar-core { width: 100%; min-width: 0; max-height: 55vh; overflow: hidden; }
  .core-view .core-collapse-body { max-height: 40vh; }
  .core-view .sidebar-history {
    flex: 0 0 clamp(160px, 28vh, 260px);
    min-height: 160px;
    max-height: 32vh;
  }
  .content { padding: 16px; }
  .guide-steps { grid-template-columns: 1fr; }
  .workflow-bar { flex-direction: column; align-items: stretch; }
  .wf-step:not(:last-child)::after { display: none; }
  .ctr-plan-view { grid-template-columns: 1fr; }
  .promo-layout { grid-template-columns: 1fr; }
}

/* ── 款式开发 ── */
#view-style-dev {
  overflow-y: auto;
  display: none;
  padding: 16px 20px 48px;
  min-height: 0;
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
#view-style-dev.active { display: block; }

.styledev-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
.styledev-sidebar h2 { margin: 0 0 8px; font-size: 18px; }
.styledev-job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 70vh;
  overflow: auto;
}
.styledev-job-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--panel);
  text-align: left;
  width: 100%;
}
.styledev-job-item:hover,
.styledev-job-item.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.06);
}
.styledev-job-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.styledev-job-item .job-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.styledev-job-item .job-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.styledev-main.panel {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}
.styledev-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.styledev-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  flex-shrink: 0;
}
.styledev-detail-head h3 { flex: 1 1 100%; margin: 0 0 4px; font-size: 20px; }
.styledev-detail-head .tip { margin: 0; flex: 1 1 100%; }
#styledev-detail-status { flex: 1 1 100%; }
#btn-styledev-download-zip { margin-left: auto; }

.styledev-schemes-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.styledev-scheme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
  overflow-x: auto;
}
.styledev-create-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.styledev-scheme-count-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.styledev-scheme-count-label select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.styledev-scheme-tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.styledev-scheme-tab:hover {
  border-color: var(--accent);
}
.styledev-scheme-tab.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  font-weight: 600;
}
.styledev-scheme-tab.finalized.active {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}
.styledev-scheme-panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.styledev-scheme-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.styledev-scheme-panel.finalized {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59,130,246,0.15);
}
.styledev-scheme-panel.hidden { display: none; }

.styledev-inner-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.02);
  position: sticky;
  top: 0;
  z-index: 2;
}
.styledev-inner-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.styledev-inner-tab:hover { color: var(--text); }
.styledev-inner-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.styledev-inner-panels { padding: 16px; }
.styledev-inner-panel.hidden { display: none; }

.styledev-preview-layout {
  display: grid;
  grid-template-columns: auto 1fr minmax(200px, 280px);
  gap: 16px;
  align-items: start;
}
.styledev-parent-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.styledev-parent-thumb span {
  font-size: 11px;
  color: var(--muted);
}
.styledev-parent-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.styledev-hero-wrap {
  min-height: 200px;
}
.styledev-hero-preview {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.styledev-hero-preview img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: rgba(0,0,0,0.03);
  display: block;
}
.styledev-preview-side h4 { margin: 0 0 8px; font-size: 17px; }
.styledev-scheme-check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 13px;
  cursor: pointer;
}
.styledev-scheme-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.styledev-scheme-actions-row .small { flex: 1 1 auto; min-width: 80px; }

.styledev-logs-drawer {
  margin-top: 12px;
  max-height: 180px;
  flex-shrink: 0;
  overflow: auto;
  border-radius: 8px;
}
.styledev-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  flex: 1 1 100%;
}
.styledev-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.styledev-scheme-check {
  padding-top: 6px;
}
.styledev-scheme-check input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.styledev-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.styledev-compare-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.styledev-compare-item img {
  width: 100%;
  max-width: 150px;
  border-radius: 8px;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  object-fit: cover;
  background: #f3f4f6;
}
.styledev-preview-placeholder {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.styledev-scheme-head {
  display: grid;
  grid-template-columns: auto minmax(180px, 320px) 1fr auto;
  gap: 14px;
  padding: 16px;
  align-items: start;
  border-bottom: 1px solid var(--border);
}
.styledev-scheme-head > img {
  width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f4f6;
}
.styledev-scheme-head h4 { margin: 0 0 6px; font-size: 17px; }
.styledev-scheme-tagline { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.styledev-scheme-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}
.styledev-scheme-actions .small { width: 100%; text-align: center; }
.styledev-asset-cap a.small {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.styledev-asset-cap a.small:hover {
  background: var(--primary);
  color: #fff;
}
.styledev-full-optimize {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.styledev-full-optimize .tip {
  flex: 1 1 100%;
  margin: 0;
}
.styledev-colors-section {
  padding: 0;
  background: transparent;
}
.styledev-colors-head h5 { margin: 0 0 6px; font-size: 14px; }
.styledev-colors-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.styledev-color-count-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.styledev-color-count {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.styledev-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.styledev-color-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.styledev-color-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.styledev-color-cap {
  padding: 8px 10px;
  font-size: 12px;
}
.styledev-color-cap strong { display: block; margin-bottom: 4px; }
.styledev-color-item.styledev-color-base {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.styledev-color-cap .badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 4px;
}
.styledev-color-item.failed { opacity: 0.75; }

.styledev-brief {
  max-height: 480px;
  overflow: auto;
  padding: 0;
  font-size: 13px;
  line-height: 1.65;
}
.styledev-brief section { margin-bottom: 16px; }
.styledev-brief h5 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}
.styledev-brief ul { margin: 0; padding-left: 18px; }
.styledev-brief table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.styledev-brief th,
.styledev-brief td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
.styledev-brief th { background: rgba(0,0,0,0.03); }
.styledev-logs { margin-top: 16px; max-height: 200px; }

.styledev-production {
  max-height: 480px;
  overflow: auto;
  padding: 0;
  border-top: none;
  background: transparent;
}
.styledev-production-section { padding-top: 16px; }
.styledev-production-section h5 { margin: 0 0 6px; font-size: 14px; }
.styledev-asset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}
.styledev-asset-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.styledev-asset-item img {
  width: 100%;
  max-height: 520px;
  aspect-ratio: auto;
  object-fit: contain;
  background: #fff;
  display: block;
}
.styledev-asset-item.print-png img {
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 14px 14px;
}
.asset-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  vertical-align: middle;
}
.styledev-size-table {
  font-size: 12px;
  line-height: 1.6;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}
.styledev-asset-item.failed { opacity: 0.7; }
.styledev-asset-item .asset-placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
}
.styledev-asset-cap {
  padding: 8px 10px;
  font-size: 12px;
}
.styledev-asset-cap strong { display: block; margin-bottom: 4px; }
.styledev-asset-cap p { margin: 0 0 4px; color: var(--text-secondary); line-height: 1.4; }

@media (max-width: 960px) {
  .styledev-layout { grid-template-columns: 1fr; }
  .styledev-preview-layout { grid-template-columns: 1fr; }
  .styledev-parent-thumb { flex-direction: row; }
  .styledev-scheme-head { grid-template-columns: 1fr; }
  .styledev-scheme-head > img,
  .styledev-compare-item img { width: 100%; max-width: 240px; }
  .styledev-compare { grid-template-columns: 1fr 1fr; }
}

/* ── 推广图库 ── */
#view-promo {
  overflow-y: auto;
  display: none;
  padding: 16px 20px 48px;
  min-height: 0;
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
#view-promo.active { display: block; }

.promo-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
.promo-sidebar h2 { margin: 0 0 8px; font-size: 18px; }
.promo-sidebar input { width: 100%; margin: 10px 0; }
.promo-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.promo-platform-tab {
  flex: 1;
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
}
.promo-platform-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.promo-spec-box {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 120, 140, 0.06);
  border: 1px solid var(--border-light);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.promo-spec-box h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text);
}
.promo-spec-box p { margin: 0 0 6px; }
.promo-spec-box p:last-child { margin-bottom: 0; }
.promo-main.panel { min-height: 420px; }
.promo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.promo-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}
.promo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #111;
  display: block;
}
.promo-card.portrait img { aspect-ratio: 3/4; }
.promo-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.promo-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.promo-card-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.promo-card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 120, 140, 0.12);
  color: var(--accent);
  width: fit-content;
}
.promo-card-badge.taobao { background: rgba(255, 106, 0, 0.12); color: #c45a00; }
.promo-card-badge.douyin { background: rgba(20, 20, 20, 0.08); color: #333; }
.promo-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.promo-card-actions .small { flex: 1; text-align: center; }
