/* ============================================================
   电商图片工作流 — 现代浅色专业风设计系统
   零依赖 · 系统字体 · 内联 SVG 图标
   ============================================================ */

:root {
  /* 表面与背景 */
  --bg: #f7f8fa;
  --bg-subtle: #f0f2f5;
  --panel: #ffffff;
  --panel-hover: #fafbfc;

  /* 文字 */
  --text: #1a1d26;
  --text-secondary: #5b6472;
  --text-muted: #9aa1ac;

  /* 主色 */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0fe;
  --primary-ring: rgba(79, 70, 229, 0.22);

  /* 边框与分隔 */
  --line: #e6e8ec;
  --line-strong: #d4d8df;

  /* 语义色 */
  --success: #16a34a;
  --success-soft: #e7f6ec;
  --warn: #d97706;
  --warn-soft: #fdf2e3;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --info: #2563eb;
  --info-soft: #e9f0fe;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(20, 26, 38, 0.06), 0 1px 3px rgba(20, 26, 38, 0.04);
  --shadow-md: 0 2px 6px rgba(20, 26, 38, 0.07), 0 6px 16px rgba(20, 26, 38, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 26, 38, 0.14), 0 4px 10px rgba(20, 26, 38, 0.08);

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* 过渡 */
  --t: 150ms ease;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--primary-ring); }

svg { display: block; flex: none; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; }

/* ---------- 按钮 ---------- */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--primary);
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t), box-shadow var(--t),
    transform var(--t), color var(--t);
}
button:hover, .button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible,
a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
}
button:disabled, .button.disabled, a.button.disabled {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

button.ghost, .ghost {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--text);
}
button.ghost:hover, .ghost:hover { background: var(--bg-subtle); border-color: var(--text-muted); }
button.ghost.danger {
  border-color: var(--danger-soft);
  color: var(--danger);
}
button.ghost.danger:hover {
  background: var(--danger-soft);
  border-color: #f4c4c0;
}

button.tiny {
  min-height: 28px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--text-secondary);
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--r-pill);
}
button.tiny:hover { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }

button.icon-btn {
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-radius: var(--r-sm);
}

/* ---------- 表单 ---------- */
label.field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
  transition: border-color var(--t), box-shadow var(--t);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.55; }

/* ---------- 布局：页面外壳 ---------- */
.page { width: min(1520px, 100%); margin: 0 auto; padding: 0 24px 64px; }

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 24px;
  background: rgba(247, 248, 250, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar .brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--primary), #7c74f0);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand-text h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.appbar .spacer { flex: 1; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-weight: 600;
  transition: background var(--t), color var(--t);
}
.backlink:hover { background: var(--bg-subtle); color: var(--text); }

.appbar-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.appbar-title .row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar-title h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title .sub { font-size: 12.5px; color: var(--text-secondary); }

/* ---------- 进度计数 ---------- */
.progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.progress-chip b { color: var(--text); }
.progress-track { width: 64px; height: 6px; border-radius: var(--r-pill); background: var(--bg-subtle); overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); border-radius: var(--r-pill); transition: width 300ms ease; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.gray { background: var(--bg-subtle); color: var(--text-secondary); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.indigo { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }

/* ============================================================
   首页
   ============================================================ */
.home-hero { margin-bottom: 24px; }
.home-hero h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.home-hero p { margin: 0; color: var(--text-secondary); font-size: 15px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head .count { color: var(--text-muted); font-weight: 600; font-size: 13px; }

.create-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.6fr) auto; gap: 16px; align-items: end; }
.create-form textarea { min-height: 44px; }

.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sku-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.sku-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sku-card .sku-link { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.sku-card .name { font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sku-card .name .go { color: var(--text-muted); transition: transform var(--t), color var(--t); }
.sku-card .sku-link:hover .name .go { color: var(--primary); transform: translateX(3px); }
.sku-card .notes { color: var(--text-secondary); font-size: 13px; line-height: 1.5; min-height: 20px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sku-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.sku-card .meta time { color: var(--text-muted); font-size: 12px; }
.sku-card .sku-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- 空状态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty .ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-muted); }
.empty p { margin: 0; font-size: 14px; }

/* ============================================================
   详情页：侧栏 + 内容区
   ============================================================ */
.workspace { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px; align-items: start; }

.sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 104px);
  overflow: auto;
}
.sidebar .side-label { padding: 4px 10px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.side-progress { display: flex; align-items: center; gap: 9px; padding: 4px 10px 12px; }
.side-progress .progress-track { flex: 1; width: auto; }
.side-progress span { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.sidebar hr { width: 100%; height: 1px; border: 0; background: var(--line); margin: 6px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active .nav-idx { background: var(--primary); color: #fff; }
.nav-idx {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nav-item .nav-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-state { flex: none; display: grid; place-items: center; width: 18px; height: 18px; }
.nav-state.done { color: var(--success); }
.nav-state.has { color: var(--primary); }
.nav-state.locked { color: var(--text-muted); }
.nav-state .pip { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- 内容区 ---------- */
.content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head .titles h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.section-head .titles p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }
.section-head .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.inline-field input[type="number"] { width: 62px; min-height: 38px; padding: 0 8px; font-weight: 600; text-align: center; }

/* 自定义比例下拉 */
.aspect-picker { position: relative; display: inline-flex; }
.aspect-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t);
}
.aspect-trigger:hover { background: var(--bg-subtle); }
.aspect-trigger.open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.aspect-trigger svg:last-child { color: var(--text-muted); transition: transform var(--t); }
.aspect-trigger.open svg:last-child { transform: rotate(90deg); }
.aspect-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 196px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: toast-in 140ms ease;
}
.aspect-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: auto;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.aspect-option:hover { background: var(--bg-subtle); }
.aspect-option.active { background: var(--primary-soft); color: var(--primary); }
.aspect-option .ao-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.aspect-option .ao-text b { font-size: 13px; }
.aspect-option .ao-text i { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.aspect-option.active .ao-text i { color: var(--primary); }
.aspect-option .ao-check { color: var(--primary); display: inline-flex; }
.aspect-overlay { position: fixed; inset: 0; z-index: 55; background: transparent; }
.ag { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; color: var(--text-secondary); }
.aspect-trigger .ag, .aspect-option.active .ag { color: inherit; }
.ag i { display: block; box-sizing: border-box; border: 1.6px solid currentColor; border-radius: 2px; }

/* ---------- 上传 ---------- */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), color var(--t);
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.dropzone .dz-ic { color: var(--text-muted); transition: color var(--t); }
.dropzone:hover .dz-ic, .dropzone.dragover .dz-ic { color: var(--primary); }
.dropzone .dz-title { font-weight: 700; font-size: 14px; color: var(--text); }
.dropzone .dz-hint { font-size: 12.5px; color: var(--text-muted); }
.dropzone .dz-files { font-size: 12.5px; color: var(--primary); font-weight: 600; }
.dropzone input[type="file"] { display: none; }
.dz-actions { margin-top: 12px; display: flex; gap: 8px; }

.assets-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.assets-strip figure { margin: 0; width: 112px; }
.assets-strip img {
  width: 112px; height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--bg-subtle);
}
.assets-strip figcaption { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.zoomable { cursor: zoom-in; transition: filter var(--t); }
.zoomable:hover { filter: brightness(0.94); }

.analysis-card { margin-top: 16px; }
details.analysis { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-subtle); overflow: hidden; }
details.analysis > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; }
details.analysis > summary::-webkit-details-marker { display: none; }
details.analysis > summary .chev { transition: transform var(--t); color: var(--text-muted); }
details.analysis[open] > summary .chev { transform: rotate(90deg); }
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f1320;
  color: #d7dbe6;
  padding: 16px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}
details.analysis pre { border-top: 1px solid var(--line); border-radius: 0; }

/* ---------- 节点 / 候选 ---------- */
.node-toolbar { display: flex; flex-direction: column; gap: 12px; }
.retry-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.retry-row label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }

.locked-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r-md);
  color: var(--warn);
}
.locked-banner .lb-text { flex: 1; }
.locked-banner .lb-text strong { display: block; color: var(--text); font-size: 14px; }
.locked-banner .lb-text span { font-size: 13px; color: var(--text-secondary); }

.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.candidate {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t);
}
.candidate:hover { box-shadow: var(--shadow-md); }
.candidate.is-selected { border-color: var(--success); box-shadow: 0 0 0 2px var(--success-soft), var(--shadow-md); }
.candidate > img { display: block; width: 100%; height: auto; background: var(--bg-subtle); }
.candidate .check {
  position: absolute;
  top: 10px; right: 10px;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.candidate figcaption { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.cand-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-muted); }
.cand-actions { display: flex; gap: 8px; }
.cand-actions button { flex: 1; min-height: 34px; font-size: 13px; padding: 0 10px; }
.reject-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reject-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--warn); }
.prompt-box { max-height: 220px; border-radius: var(--r-sm); }

/* ---------- 骨架屏 ---------- */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.skel {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--panel);
}
.skel .ph { aspect-ratio: 1; background: linear-gradient(100deg, var(--bg-subtle) 30%, #e9ebef 50%, var(--bg-subtle) 70%); background-size: 200% 100%; animation: shimmer 1.3s ease infinite; }
.skel .ph.line { aspect-ratio: auto; height: 12px; margin: 12px; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.busy-inline { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--primary-soft); background: var(--primary-soft); border-radius: var(--r-md); color: var(--primary); font-weight: 600; font-size: 13.5px; }

/* ---------- Spinner ---------- */
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Toast 反馈
   ============================================================ */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.toast .t-ic { flex: none; margin-top: 1px; }
.toast.error { border-color: #f4c4c0; }
.toast.error .t-ic { color: var(--danger); }
.toast.info .t-ic { color: var(--info); }
.toast.success .t-ic { color: var(--success); }
.toast .t-body { flex: 1; font-size: 13.5px; color: var(--text); word-break: break-word; }
.toast .t-body .t-title { font-weight: 700; margin-bottom: 2px; }
.toast .t-close { flex: none; cursor: pointer; color: var(--text-muted); background: none; border: none; min-height: auto; width: auto; padding: 2px; }
.toast .t-close:hover { color: var(--text); background: none; }

/* ============================================================
   图片预览模态
   ============================================================ */
.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 18, 28, 0.78);
  backdrop-filter: blur(4px);
  padding: 28px;
  animation: fade 160ms ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  border-radius: var(--r-lg);
  background: #11141d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}
.preview-head .ghost { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.08); color: #fff; }
.preview-head .ghost:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); }
.preview-image { display: block; width: 100%; height: 100%; max-height: calc(100vh - 110px); object-fit: contain; background: #0a0c12; }

.hidden { display: none !important; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sidebar .side-label, .side-progress, .sidebar hr { display: none; }
  .nav-item { width: auto; }
  .nav-item .nav-name { max-width: 96px; }
}
@media (max-width: 720px) {
  .page { padding: 0 14px 48px; }
  .create-form { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .appbar { gap: 10px; }
  .brand-text p { display: none; }
  .section-head { flex-direction: column; }
}
