:root {
  --ink: #151a17;
  --ink-soft: #353b37;
  --muted: #6c736e;
  --muted-light: #949a96;
  --line: #e1e5e2;
  --line-strong: #cbd1cd;
  --surface: #ffffff;
  --surface-soft: #f8f7f9;
  --page: #f3f2f5;
  --accent: #b12f59;
  --accent-hover: #912348;
  --accent-soft: #f8e8ee;
  --warm: #6254a2;
  --danger: #a23b35;
  --danger-soft: #faece9;
  --shadow: 0 1px 2px rgba(21, 26, 23, 0.04), 0 12px 32px rgba(21, 26, 23, 0.05);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--page); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
}

body.auth-locked { overflow: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 242, 245, 0.94);
}
.auth-gate.hidden { display: none; }
.auth-card {
  width: min(390px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-brand-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.auth-brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.auth-card h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.25; }
.auth-copy { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-field {
  width: 100%;
  min-height: 42px;
  margin-bottom: 16px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}
.auth-field:focus { outline: 2px solid rgba(177, 47, 89, 0.2); border-color: var(--accent); }
.auth-remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 18px; color: var(--ink-soft); font-size: 12px; }
.auth-remember input { accent-color: var(--accent); }
.auth-submit { width: 100%; justify-content: center; }
.auth-logout {
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
}
.auth-logout:hover { border-color: var(--accent); color: var(--accent); }
.auth-card .notice { margin: 0 0 14px; }

button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3.5vw, 52px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 720; line-height: 1.2; letter-spacing: 0; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.tool-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}
.tool-tab {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.tool-tab svg, .source-note svg, .ad-image-placeholder svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-tab:hover { color: var(--ink); }
.tool-tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(31, 25, 29, 0.08); }

.service-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.state-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--muted-light); }
.service-state.ready .state-dot { background: #4a78b8; box-shadow: 0 0 0 3px #e8eef7; }
.service-state.error .state-dot { background: var(--danger); }

.workspace {
  width: 100%;
  max-width: 1560px;
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  margin: 0 auto;
}

.control-panel {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  padding: 34px 28px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.section-heading, .results-toolbar, .column-heading, .result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-heading { margin-bottom: 18px; }
.step-label { display: block; margin-bottom: 6px; color: var(--warm); font-size: 10px; font-weight: 760; text-transform: uppercase; }
h2 { margin: 0; font-size: 17px; font-weight: 720; line-height: 1.3; letter-spacing: 0; }
.url-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.field-label { display: block; margin: 0 0 8px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.url-field { height: 43px; padding: 0 12px; background: var(--surface-soft); font-size: 12px; }
textarea { display: block; padding: 12px 13px; line-height: 1.55; resize: vertical; }
#urlInput { min-height: 170px; background: var(--surface-soft); font-size: 12px; line-height: 1.65; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(177, 47, 89, 0.1);
}

.primary-button {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 720;
  box-shadow: 0 4px 14px rgba(177, 47, 89, 0.16);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.primary-button:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: 0.58; cursor: wait; transform: none; }

.source-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
}
.source-note svg { width: 12px; height: 12px; }

.primary-button svg, .copy-button svg, .icon-text-button svg, .icon-button svg, .empty-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-text-button { text-decoration: none; }
.icon-text-button.disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.results-panel { min-width: 0; padding: 32px clamp(28px, 3vw, 48px) 64px; }
.results-toolbar { min-height: 44px; margin-bottom: 20px; }
.results-toolbar h2 span { color: var(--muted); font-size: 11px; font-weight: 500; }

.icon-text-button, .copy-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 650;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.icon-text-button { min-height: 34px; padding: 0 11px; font-size: 11px; }
.icon-text-button:disabled { opacity: 0.38; cursor: not-allowed; }
.icon-text-button:not(:disabled):hover, .copy-button:hover, .icon-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-state {
  min-height: min(680px, calc(100vh - 180px));
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--warm);
  font-size: 9px;
  font-weight: 800;
}
.empty-kicker span { width: 28px; height: 1px; background: currentColor; }
.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid #eccdd8;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 12px 30px rgba(65, 37, 51, 0.08);
}
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 {
  max-width: 460px;
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 720;
  line-height: 1.35;
  letter-spacing: 0;
}
.empty-state h3 span { display: block; color: var(--accent); }
.empty-state p { max-width: 360px; margin: 0; font-size: 12px; line-height: 1.7; }
.loading-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 14px; font-weight: 680; letter-spacing: 0; }
.loading-state p { max-width: 320px; margin: 0; font-size: 12px; line-height: 1.6; }

.loading-state { min-height: 340px; display: flex; align-items: center; justify-content: center; gap: 15px; color: var(--muted); }
.loader {
  width: 26px;
  height: 26px;
  border: 2px solid #d9e5df;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #eac7ba;
  border-radius: 5px;
  background: #fff6f2;
  color: #7d3d2b;
  font-size: 11px;
  line-height: 1.5;
}

.results-list { display: grid; gap: 16px; }
.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.result-card-header { min-height: 60px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.site-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.site-index {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}
.site-identity > div { min-width: 0; }
.site-host { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 720; }
.site-url {
  display: block;
  max-width: min(54vw, 720px);
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-url:hover { color: var(--accent); text-decoration: underline; }
.result-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 760;
}
.result-card.has-error .result-badge { background: var(--danger-soft); color: var(--danger); }

.error-message {
  margin: 15px 16px;
  padding: 11px 12px;
  border-left: 2px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
}
.comparison { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
.copy-column { min-width: 0; padding: 22px; }
.original-column { border-right: 1px solid var(--line); background: #fafbfa; }
.column-label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.copy-block { margin-top: 18px; }
.copy-block span, .editable-field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 720; }
.copy-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.copy-block p.missing { color: var(--muted-light); font-style: italic; }
.column-heading { min-height: 28px; margin-bottom: 12px; }
.icon-button { width: 29px; height: 29px; padding: 0; }
.icon-button svg { width: 14px; height: 14px; }
.editable-field { display: block; position: relative; margin-top: 13px; }
.editable-field textarea {
  min-height: 64px;
  padding: 12px 13px;
  overflow-y: hidden;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.68;
}
.editable-field textarea:hover { border-color: var(--line-strong); }
.copy-button { width: 100%; min-height: 35px; margin-top: 14px; background: var(--surface); font-size: 10px; }
.copy-button svg { width: 13px; height: 13px; }

.ad-result { display: grid; gap: 18px; }
.ad-source-summary {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ad-image-frame {
  position: relative;
  width: 168px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.ad-image-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }
.ad-image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted-light); background: var(--surface-soft); }
.ad-image-placeholder svg { width: 25px; height: 25px; }
.ad-source-copy { min-width: 0; align-self: center; }
.ad-source-copy h3 { margin: 8px 0 4px; font-size: 16px; line-height: 1.4; letter-spacing: 0; }
.ad-source-copy > a {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-source-copy > a:hover { color: var(--accent); text-decoration: underline; }
.ad-source-copy > p {
  max-height: 66px;
  margin: 10px 0 0;
  overflow: auto;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.image-analysis-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 11px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}
.image-analysis-badge.analyzed { border-color: #d8d2eb; background: #f0edf8; color: var(--warm); }

.ad-variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.ad-variant-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(31, 25, 29, 0.04);
}
.ad-variant-header { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ad-variant-index { display: block; margin-bottom: 4px; color: var(--warm); font-size: 9px; font-weight: 800; }
.ad-style-name { margin: 0; font-size: 13px; font-weight: 720; line-height: 1.35; letter-spacing: 0; }
.ad-variant-card .editable-field { margin-top: 16px; }
.ad-variant-card .editable-field textarea, .ad-variant-card .editable-field input {
  padding: 11px 12px;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.62;
}
.ad-variant-card .ad-headline { min-height: 72px; overflow-y: hidden; }
.ad-variant-card .ad-primary-text { min-height: 168px; overflow-y: hidden; }
.ad-variant-card .ad-primary-field { flex: 1; }
.ad-variant-card .ad-cta { height: 39px; }

.prompt-workspace { grid-template-columns: 390px minmax(0, 1fr); }
.prompt-control-panel { overflow-y: auto; }
.prompt-goal-section { margin-top: 24px; }
#promptGoal { min-height: 178px; background: var(--surface-soft); font-size: 12px; }
.prompt-source-preview {
  position: relative;
  height: 180px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}
.prompt-source-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.prompt-source-preview .icon-button { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; }
.prompt-results-panel { min-height: calc(100vh - 64px); }
.prompt-result { width: 100%; }
#promptResultText {
  min-height: min(680px, calc(100vh - 180px));
  padding: 20px 22px;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
}

.image-workspace, .main-image-workspace { grid-template-columns: 390px minmax(0, 1fr); }
.image-control-panel, .main-image-control-panel { overflow-y: auto; }
.image-mode-section { margin-bottom: 24px; }
.image-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}
.image-mode-switch button {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}
.image-mode-switch button.selected {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(21, 26, 23, 0.06);
}
.image-mode-switch button:disabled { opacity: 0.55; cursor: wait; }
.image-prompt-section { margin-top: 24px; }
#imagePrompt { min-height: 124px; background: var(--surface-soft); font-size: 12px; }
.main-image-reference-url-section, .main-image-prompt-section { margin-top: 24px; }
#mainImagePrompt { min-height: 108px; background: var(--surface-soft); font-size: 12px; }
.image-dropzone {
  width: 100%;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.image-dropzone:hover, .image-dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.image-dropzone:disabled { opacity: 0.58; cursor: wait; }
.image-dropzone.compact { min-height: 72px; flex-direction: row; }
.image-dropzone svg, .image-canvas-placeholder svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.image-dropzone strong { font-size: 12px; font-weight: 700; }
.image-dropzone span { color: var(--muted); font-size: 9px; }
.image-dropzone.compact span { display: none; }
.batch-folder-button.compact { min-height: 72px; flex-direction: row; }
.image-reference-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.reference-list { display: grid; gap: 7px; margin-top: 10px; }
.batch-file-list { max-height: 252px; overflow-y: auto; }
.reference-item {
  min-width: 0;
  height: 56px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 5px 7px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}
.reference-item img {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: cover;
  border-radius: 3px;
  background: var(--surface-soft);
}
.reference-item > div { min-width: 0; }
.reference-item strong, .reference-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-item strong { color: var(--ink-soft); font-size: 10px; font-weight: 680; }
.reference-item span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.reference-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.reference-remove:hover { background: var(--danger-soft); color: var(--danger); }
.image-options {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.65fr) minmax(0, 0.75fr);
  gap: 13px 10px;
  margin-top: 22px;
}
.image-option-field { min-width: 0; }
.image-option-field .field-label { margin-bottom: 7px; }
.image-option-field select, .image-option-field input { height: 39px; padding: 0 10px; background: var(--surface-soft); font-size: 11px; }
.main-image-options { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr) minmax(0, 0.7fr) minmax(0, 0.8fr); }
#imageControlNotice { margin: 16px 0 0; }
#mainImageControlNotice { margin: 16px 0 0; }
.image-results-panel { min-height: calc(100vh - 64px); }
.image-empty-state, .image-loading-state {
  min-height: min(680px, calc(100vh - 180px));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}
.image-canvas-placeholder {
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-light);
}
.image-canvas-placeholder svg { width: 28px; height: 28px; }
.image-empty-state h3, .image-loading-state h3 { margin: 0; color: var(--ink-soft); font-size: 13px; letter-spacing: 0; }
.image-loading-state { grid-template-columns: auto auto; text-align: left; }
.image-loading-state p { margin: 5px 0 0; font-size: 10px; }
.image-result { width: 100%; }
.generated-image-frame {
  width: 100%;
  min-height: 420px;
  max-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef0ee;
}
.generated-image-frame img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 222px);
  display: block;
  object-fit: contain;
}
.image-result-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.results-toolbar h2 .image-result-heading { color: var(--ink); font-size: 17px; font-weight: 720; }
.batch-image-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.batch-result-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.batch-result-visual {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef0ee;
}
.batch-result-visual img { width: 100%; height: 100%; display: block; object-fit: contain; }
.batch-result-error { padding: 22px; color: var(--danger); font-size: 11px; line-height: 1.55; text-align: center; }
.batch-result-copy { padding: 12px; }
.batch-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.batch-result-heading strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-result-status { flex: 0 0 auto; color: var(--warm); font-size: 9px; font-weight: 760; }
.batch-result-card.failed .batch-result-status { color: var(--danger); }
.batch-result-meta { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.batch-result-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

.font-workspace { grid-template-columns: 390px minmax(0, 1fr); }
.font-control-panel { overflow-y: auto; }
.font-mode-section { margin-bottom: 24px; }
#fontStripText { min-height: 86px; background: var(--surface-soft); font-size: 12px; line-height: 1.55; }
.compact-heading { align-items: baseline; }
.compact-heading .field-label { margin-bottom: 0; }
.font-catalog-section { display: grid; gap: 8px; }
.font-catalog-section input, .font-catalog-section select {
  width: 100%;
  height: 39px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11px;
}
.font-catalog-select-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 39px;
  gap: 8px;
}
.font-catalog-select-row select { min-width: 0; }
.font-catalog-copy {
  width: 39px;
  height: 39px;
}
.font-catalog-copy:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.font-catalog-note {
  padding: 9px 10px;
  border-left: 2px solid var(--warm);
  background: #f4f1f7;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.font-strip-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 14px;
}
.font-strip-options .image-option-field { min-width: 0; }
.font-strip-options input, .font-strip-options select {
  width: 100%;
  height: 39px;
  padding: 0 10px;
  background: var(--surface-soft);
  font-size: 11px;
}
.font-strip-color-row {
  display: grid;
  grid-template-columns: 78px 78px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}
.font-color-field { min-width: 0; }
.font-color-field input[type="color"] {
  width: 100%;
  height: 39px;
  display: block;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}
.font-color-field input[type="color"]:disabled { opacity: 0.4; }
.font-transparent-toggle {
  height: 39px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}
.font-transparent-toggle input { accent-color: var(--accent); }
.font-alignment-section { margin-bottom: 18px; }
.font-alignment-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}
.font-alignment-switch button {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}
.font-alignment-switch button.selected {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(21, 26, 23, 0.06);
}
.font-source-preview {
  position: relative;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 12px 42px 12px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.font-source-preview img { max-width: 100%; max-height: 150px; display: block; object-fit: contain; }
.font-source-preview .icon-button { position: absolute; top: 8px; right: 8px; }
.font-results-panel { min-height: calc(100vh - 64px); }
.font-empty-state, .font-loading-state { min-height: calc(100vh - 178px); }
.results-toolbar h2 .font-result-heading { color: var(--ink); font-size: 17px; font-weight: 720; }
.font-result { width: 100%; }
.font-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 120px;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
}
.font-summary > div { min-width: 0; padding: 16px 18px; }
.font-summary > div + div { border-left: 1px solid var(--line); }
.font-summary strong { display: block; margin-top: 7px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.font-candidates { display: grid; gap: 9px; }
.font-candidate {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(21, 26, 23, 0.03);
}
.font-candidate.best { border-color: rgba(177, 47, 89, 0.42); }
.font-rank {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.font-candidate.best .font-rank { color: var(--accent); font-weight: 750; }
.font-candidate-copy { min-width: 0; padding: 15px 17px 17px; }
.font-candidate-copy > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.font-candidate-copy strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.font-candidate-copy > div span { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.font-candidate-copy > .font-location {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 9px;
}
.font-candidate-copy > .font-location span { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
.font-candidate-copy > .font-folder-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.font-folder-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 680;
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.font-folder-action svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.font-folder-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.font-candidate-copy img {
  width: 100%;
  max-height: 112px;
  display: block;
  object-fit: contain;
  object-position: left center;
  border: 1px solid #eceeef;
  background: #fff;
}
.font-strip-empty, .font-strip-loading { min-height: calc(100vh - 178px); }
.font-strip-result { width: 100%; }
.font-strip-canvas {
  min-height: 420px;
  max-height: calc(100vh - 250px);
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #eef0f2;
}
.font-strip-canvas img {
  max-width: 100%;
  max-height: calc(100vh - 310px);
  display: block;
  object-fit: contain;
  background: transparent;
}
.font-strip-result-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}
.font-strip-result-bar > div { min-width: 0; }
.font-strip-result-bar strong { display: block; overflow-wrap: anywhere; font-size: 11px; }
.font-strip-result-bar span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.font-strip-result-bar .icon-text-button[aria-disabled="true"] { opacity: 0.38; pointer-events: none; }

.psd-workspace { display: block; }
.psd-control-panel {
  position: static;
  top: auto;
  height: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "fields fields"
    "templates templates"
    "production production"
    "backgrounds fonts"
    "fontpicker fontpicker"
    "photos photos"
    "prompt prompt"
    "notice notice"
    "generate generate";
  gap: 30px 32px;
  padding: 36px clamp(32px, 4vw, 64px) 42px;
  overflow: visible;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}
.psd-control-panel > .psd-template-section { grid-area: templates; }
.psd-control-panel > .psd-production-template-section { grid-area: production; }
.psd-control-panel > .psd-fields { grid-area: fields; }
.psd-control-panel > .psd-prompt-section { grid-area: prompt; }
.psd-control-panel > .psd-background-section { grid-area: backgrounds; }
.psd-control-panel > .psd-font-color-section { grid-area: fonts; }
.psd-control-panel > .psd-font-picker-section { grid-area: fontpicker; }
.psd-control-panel > #psdPhotoSection { grid-area: photos; }
.psd-control-panel > #psdControlNotice { grid-area: notice; margin: 0; }
.psd-control-panel > .psd-generation-actions { grid-area: generate; }
.psd-control-panel.sleepwear-template {
  grid-template-areas:
    "fields fields"
    "templates templates"
    "production production"
    "backgrounds backgrounds"
    "fontpicker fontpicker"
    "photos photos"
    "prompt prompt"
    "notice notice"
    "generate generate";
}
.psd-workspace h2 { font-size: 21px; }
.psd-workspace .step-label { margin-bottom: 7px; font-size: 12px; }
.psd-workspace .field-label { margin-bottom: 10px; font-size: 13px; }
.psd-control-panel .section-heading { margin-bottom: 21px; }
.psd-production-template-section { margin: 0; }
.psd-production-dropzone { min-height: 90px; flex-direction: row; padding: 16px 22px; }
.psd-workspace .image-dropzone svg { width: 28px; height: 28px; }
.psd-production-dropzone strong { font-size: 13px; }
.psd-production-dropzone span { font-size: 10px; }
.psd-production-file {
  min-width: 0;
  display: grid;
  grid-template-columns: 41px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}
.psd-production-file > svg { width: 29px; height: 29px; fill: none; stroke: var(--accent); stroke-width: 1.7; }
.psd-production-file > div { min-width: 0; }
.psd-production-file strong, .psd-production-file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psd-production-file strong { font-size: 12px; }
.psd-production-file span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.psd-production-file .icon-button { width: 34px; height: 34px; font-size: 21px; }
.psd-production-file-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.psd-production-list-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}
.psd-production-list-item > div { min-width: 0; }
.psd-production-list-item strong, .psd-production-list-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psd-production-list-item strong { font-size: 11px; }
.psd-production-list-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.psd-production-list-item .icon-button { width: 30px; height: 30px; flex: 0 0 auto; font-size: 18px; }
.optional-label {
  flex: 0 0 auto;
  color: var(--warm);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}
.psd-control-panel select, .psd-control-panel input {
  height: 50px;
  padding: 0 14px;
  background: var(--surface-soft);
  font-size: 13px;
}
.psd-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.psd-template-card {
  min-width: 0;
  min-height: 140px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.psd-template-card:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.psd-template-card[aria-pressed="true"] { border-color: rgba(177, 47, 89, 0.48); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(177, 47, 89, 0.06); }
.psd-template-card:disabled { opacity: 0.42; cursor: not-allowed; }
.psd-template-card img { width: 120px; height: 120px; display: block; object-fit: contain; border-radius: 4px; background: #eef0ee; }
.psd-template-card > div { min-width: 0; }
.psd-template-card strong, .psd-template-card span { display: block; }
.psd-template-card strong { color: var(--ink); font-size: 13px; font-weight: 740; line-height: 1.4; overflow-wrap: anywhere; }
.psd-template-card span { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.psd-template-card[aria-pressed="true"] strong { color: var(--accent); }
.psd-apparel-options { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.psd-apparel-options .field-label { display: block; }
.psd-apparel-options p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.psd-apparel-segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.psd-apparel-segments button {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.psd-apparel-segments button:hover { border-color: var(--line-strong); background: var(--surface); }
.psd-apparel-segments button[aria-pressed="true"] { border-color: rgba(0, 113, 227, 0.52); background: var(--accent-soft); color: #0065cc; }
.psd-apparel-segments button:disabled { opacity: 0.48; cursor: not-allowed; }
.psd-image-input-grid.single-input { grid-template-columns: minmax(0, 1fr); }
.psd-fields { display: grid; align-self: start; gap: 11px; margin-top: 0; }
.psd-fields .field-label { margin: 7px 0 0; }
.psd-field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.psd-field-label-row span { color: var(--muted); font-size: 11px; line-height: 1.45; text-align: right; }
.psd-background-section { align-self: start; margin-top: 0; }
.psd-font-color-section { align-self: start; margin-top: 0; }
.psd-prompt-section { align-self: start; margin-top: 0; }
#psdPrompt { min-height: 116px; padding: 15px 16px; background: var(--surface-soft); font-size: 13px; resize: vertical; }
.psd-prompt-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.psd-background-heading-actions { display: flex; align-items: center; gap: 10px; }
.psd-background-heading-actions span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.psd-background-heading-actions button { min-height: 30px; padding: 0 4px; border: 0; background: transparent; color: var(--accent); font-size: 11px; font-weight: 700; }
.psd-background-heading-actions button:hover { color: var(--accent-hover); }
.psd-heading-with-help { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.psd-heading-with-help span { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.psd-background-grid {
  max-height: 430px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-right: 5px;
  overflow-y: auto;
}
.psd-control-panel.sleepwear-template .psd-background-grid {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.psd-font-color-grid {
  max-height: 430px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-right: 5px;
  overflow-y: auto;
}
.psd-font-picker-section { align-self: start; margin-top: 0; }
#psdFontPickerSearch { width: 100%; margin-bottom: 11px; }
.psd-font-picker-list {
  max-height: 300px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-right: 5px;
  overflow-y: auto;
}
.psd-font-picker-option {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.35;
}
.psd-font-picker-option:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.psd-font-picker-option:has(input:checked) { border-color: rgba(177, 47, 89, 0.48); background: var(--accent-soft); color: var(--accent); }
.psd-font-picker-option input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--accent); }
.psd-font-picker-option span { min-width: 0; overflow-wrap: anywhere; }
.psd-font-picker-empty { grid-column: 1 / -1; margin: 0; padding: 16px; color: var(--muted); font-size: 11px; text-align: center; }
.psd-background-option {
  min-width: 0;
  display: grid;
  min-height: 58px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  text-align: left;
}
.psd-background-option:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.psd-background-option[aria-pressed="true"] { border-color: rgba(177, 47, 89, 0.48); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(177, 47, 89, 0.08); }
.psd-background-option img { width: 42px; height: 42px; display: block; object-fit: cover; border: 1px solid rgba(31, 25, 29, 0.08); border-radius: 4px; }
.psd-background-option span { min-width: 0; font-size: 11px; font-weight: 680; line-height: 1.3; overflow-wrap: anywhere; }
.psd-background-option[aria-pressed="true"] span { color: var(--accent); }
.compact-heading { margin-bottom: 15px; }
.psd-image-input-grid { display: grid; grid-template-columns: minmax(260px, 0.65fr) minmax(520px, 1.35fr); gap: 20px; }
.psd-image-input { min-width: 0; }
.psd-image-input > .field-label { margin-bottom: 9px; }
.psd-dropzone { min-height: 122px; padding: 15px 10px; }
.psd-dropzone strong { max-width: 100%; overflow: hidden; font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.psd-dropzone span { font-size: 10px; }
.psd-dropzone.compact { min-height: 66px; padding: 10px; }
.psd-material-picker { position: relative; }
.psd-material-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(31, 25, 29, 0.14);
}
.psd-material-picker-menu > button {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.psd-material-picker-menu > button:hover { border-color: var(--line); background: var(--surface-soft); }
.psd-material-picker-menu > button:disabled { opacity: 0.42; cursor: not-allowed; }
.psd-material-picker-menu svg { width: 27px; height: 27px; fill: none; stroke: var(--accent); stroke-width: 1.7; }
.psd-material-picker-menu span, .psd-material-picker-menu strong, .psd-material-picker-menu small { display: block; min-width: 0; }
.psd-material-picker-menu strong { font-size: 12px; line-height: 1.35; }
.psd-material-picker-menu small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.psd-material-list { max-height: 230px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 11px; overflow-y: auto; }
.psd-material-item {
  min-width: 0;
  height: 66px;
  display: grid;
  grid-template-columns: 51px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}
.psd-material-item img { width: 51px; height: 51px; display: block; object-fit: cover; border-radius: 4px; }
.psd-material-item > div { min-width: 0; }
.psd-material-item strong, .psd-material-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psd-material-item strong { font-size: 11px; }
.psd-material-item span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.psd-photo-preview {
  position: relative;
  height: 116px;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}
.psd-photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.psd-photo-preview .icon-button { position: absolute; top: 9px; right: 9px; width: 34px; height: 34px; font-size: 21px; }
.psd-generation-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.psd-generation-actions > #generatePsdButton, .psd-generation-actions > #confirmPsdButton { height: 53px; margin-top: 0; font-size: 14px; }
.psd-generation-actions > #generatePsdButton svg, .psd-generation-actions > #confirmPsdButton svg { width: 21px; height: 21px; }
.psd-generation-actions.preview-ready { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
.psd-generation-actions.preview-ready > #generatePsdButton {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}
.psd-results-panel { min-height: 620px; }
.psd-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.psd-toolbar-actions .icon-text-button { min-height: 41px; padding: 0 14px; font-size: 13px; }
.psd-toolbar-actions .icon-text-button svg { width: 20px; height: 20px; }
.psd-toolbar-actions .icon-text-button[aria-disabled="true"] { opacity: 0.38; pointer-events: none; }
.psd-placeholder { aspect-ratio: 0.76; }
.psd-result { display: grid; grid-template-columns: minmax(280px, 0.72fr) minmax(280px, 0.28fr); gap: 18px; align-items: start; }
.psd-batch-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.psd-batch-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.psd-batch-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.psd-batch-card-header strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.psd-batch-card-header span { flex: 0 0 auto; color: #2f6a54; font-size: 10px; font-weight: 700; }
.psd-batch-card.failed .psd-batch-card-header span { color: var(--danger); }
.psd-batch-card img { width: 100%; aspect-ratio: 4 / 5; display: block; object-fit: contain; background: #eef0f3; }
.psd-batch-card-copy { padding: 11px 13px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.psd-batch-card .icon-text-button { margin-top: 10px; }
.psd-preview-frame {
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef0ee;
}
.psd-preview-frame img { width: 100%; max-height: calc(100vh - 190px); display: block; object-fit: contain; }
.psd-validation { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--line); }
.psd-validation-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; background: var(--surface); }
.psd-validation-row span { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.psd-validation-row strong { flex: 0 0 auto; color: #2f6a54; font-size: 11px; font-weight: 760; }

@media (max-width: 1180px) {
  .psd-control-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "fields fields"
      "templates templates"
      "production production"
      "backgrounds fonts"
      "fontpicker fontpicker"
      "photos photos"
      "prompt prompt"
      "notice notice"
      "generate generate";
  }
  .psd-template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .psd-background-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psd-control-panel.sleepwear-template .psd-background-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .psd-font-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.monitor-workspace {
  width: 100%;
  max-width: 1560px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
}
.monitor-content { padding: 34px clamp(28px, 4vw, 56px) 64px; }
.monitor-heading, .monitor-heading-actions, .monitor-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.monitor-heading { min-height: 44px; margin-bottom: 22px; }
.monitor-heading-actions { justify-content: flex-end; }
.monitor-schedule { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.monitor-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #e7b9b4;
  border-radius: 5px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
}
.monitor-latest {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(160px, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.monitor-latest-state, .monitor-summary-metric {
  min-height: 92px;
  display: flex;
  align-items: center;
  padding: 20px 22px;
}
.monitor-latest-state { gap: 12px; }
.monitor-summary-metric { flex-direction: column; align-items: flex-start; justify-content: center; border-left: 1px solid var(--line); }
.monitor-status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--muted-light); }
.monitor-latest.success .monitor-status-dot { background: #36765d; box-shadow: 0 0 0 4px #e7f1ec; }
.monitor-latest.failure .monitor-status-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.monitor-summary-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 650; }
.monitor-latest strong { display: block; font-size: 15px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.monitor-history-heading { margin: 30px 0 12px; }
.monitor-history-heading h3 { margin: 0; font-size: 13px; font-weight: 720; }
.monitor-history-heading span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.monitor-table-header, .monitor-record {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) 72px 70px repeat(5, minmax(64px, .6fr)) minmax(220px, 1.7fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
}
.monitor-table-header { padding: 0 14px 8px; color: var(--muted); font-size: 9px; font-weight: 720; }
.monitor-records { display: grid; gap: 8px; }
.monitor-record {
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.monitor-cell { min-width: 0; overflow-wrap: anywhere; }
.monitor-cell.issue { color: var(--muted); line-height: 1.45; }
.monitor-cell.payment-results { overflow-wrap: normal; }
.monitor-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  color: #2f6a54;
  font-weight: 720;
}
.monitor-status::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }
.monitor-status.failure { color: var(--danger); }
.monitor-empty { padding: 64px 20px; color: var(--muted); text-align: center; font-size: 11px; }
.payment-channel-results { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.payment-channel-success { display: inline-flex; align-items: center; gap: 5px; color: #2f6a54; font-weight: 720; }
.payment-channel-success::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 9px 13px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel {
    position: static;
    height: auto;
    padding: 28px clamp(24px, 5vw, 48px);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #urlInput { min-height: 140px; }
  .results-panel { padding-top: 28px; }
  .empty-state { min-height: 320px; }
  .image-control-panel, .main-image-control-panel, .prompt-control-panel { overflow: visible; }
  .image-results-panel { min-height: 520px; }
  .image-empty-state, .image-loading-state { min-height: 380px; }
  .psd-control-panel { overflow: visible; }
  .psd-result { grid-template-columns: 1fr; }
  .psd-preview-frame { min-height: 420px; }
  .monitor-table-header { display: none; }
  .monitor-record { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 20px; align-items: start; padding: 16px; }
  .monitor-cell::before { display: block; margin-bottom: 5px; content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; }
  .monitor-cell.issue, .monitor-cell.payment-results { grid-column: 1 / -1; }
}

@media (max-width: 840px) {
  .ad-variants { grid-template-columns: 1fr; }
  .ad-variant-card .ad-primary-text { min-height: 110px; }
}

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 9px 12px; padding-top: 10px; padding-bottom: 10px; }
  .tool-tabs { order: 3; width: 100%; }
  .tool-tab { flex: 1; }
  .comparison { grid-template-columns: 1fr; }
  .psd-control-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "fields"
      "templates"
      "production"
      "backgrounds"
      "fonts"
      "fontpicker"
      "photos"
      "prompt"
      "notice"
      "generate";
  }
  .psd-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psd-font-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psd-image-input-grid, .psd-material-list { grid-template-columns: 1fr; }
  .original-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .monitor-latest { grid-template-columns: 1fr; }
  .monitor-latest-state, .monitor-summary-metric { min-height: 74px; }
  .monitor-summary-metric { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 620px) {
  .topbar { min-height: 60px; padding: 0 16px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand p { display: none; }
  .service-state { max-width: 46vw; }
  .service-state span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace { min-height: calc(100vh - 60px); }
  .control-panel, .results-panel { padding-left: 16px; padding-right: 16px; }
  .control-panel { padding-top: 24px; padding-bottom: 24px; }
  .results-panel { padding-top: 24px; padding-bottom: 40px; }
  .empty-state { min-height: 300px; padding: 44px 12px; }
  .empty-kicker { margin-bottom: 18px; }
  .empty-icon { width: 56px; height: 56px; margin-bottom: 17px; }
  .empty-state h3 { font-size: 22px; }
  .site-url { max-width: 54vw; }
  .result-card-header { padding: 11px 12px; }
  .copy-column { padding: 18px 16px; }
  .ad-source-summary { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .ad-image-frame { width: 96px; }
  .ad-source-copy h3 { font-size: 14px; }
  .ad-source-copy > p { max-height: 52px; }
  .icon-text-button { width: 34px; padding: 0; font-size: 0; }
  .icon-text-button svg { width: 16px; height: 16px; }
  .image-results-panel .icon-text-button { width: auto; padding: 0 10px; font-size: 10px; }
  .generated-image-frame { min-height: 280px; max-height: 70vh; }
  .generated-image-frame img { max-height: 70vh; }
  .monitor-workspace { min-height: calc(100vh - 60px); }
  .monitor-content { padding: 24px 16px 40px; }
  .monitor-heading { align-items: flex-start; }
  .monitor-heading-actions { align-items: flex-end; flex-direction: column-reverse; gap: 7px; }
}

@media (max-width: 420px) {
  .tool-tab { gap: 4px; padding: 0 6px; font-size: 10px; }
  .tool-tab svg { width: 13px; height: 13px; }
  .image-options { grid-template-columns: 1fr 1fr; }
  .image-size-field { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Apple-inspired desktop shell. These overrides deliberately retain the existing
   component selectors so no production workflow state changes with the redesign. */
:root {
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #6e6e73;
  --muted-light: #98989d;
  --line: rgba(60, 60, 67, 0.18);
  --line-strong: rgba(60, 60, 67, 0.3);
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --page: #f5f5f7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: #e8f2ff;
  --warm: #6254a2;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

body { min-width: 0; background: var(--page); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 12px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(250, 250, 252, 0.9);
}
.app-page { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  padding: 0 clamp(28px, 3vw, 52px);
  border-bottom: 1px solid rgba(60, 60, 67, 0.11);
  background: rgba(245, 245, 247, 0.84);
  backdrop-filter: saturate(180%) blur(18px);
}
.topbar-context { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.topbar-context b { color: var(--ink); font-weight: 620; }
.topbar-context b::before { margin-right: 8px; color: #aeaeb2; content: "/"; font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.brand { gap: 10px; padding: 3px 10px 23px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; border-color: rgba(60, 60, 67, 0.16); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1); }
.brand h1 { font-size: 16px; font-weight: 680; }
.brand p { font-size: 11px; }
.sidebar-group-label {
  display: block;
  margin: 12px 10px 7px;
  color: #86868b;
  font-size: 11px;
  font-weight: 650;
}
.tool-tabs { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.tool-tab {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border-radius: 7px;
  color: #424245;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.tool-tab svg { width: 17px; height: 17px; stroke-width: 1.75; }
.tool-tab:hover { background: rgba(60, 60, 67, 0.06); color: var(--ink); }
.tool-tab.active { background: #e8f2ff; color: #0065cc; box-shadow: none; font-weight: 620; }
.tool-tabs .sidebar-group-label { margin-top: 17px; }
.service-state { margin-top: auto; padding: 15px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.state-dot { width: 7px; height: 7px; }
.service-state.ready .state-dot { background: #34c759; box-shadow: none; }

.workspace { width: 100%; max-width: none; min-height: calc(100vh - 56px); grid-template-columns: 372px minmax(0, 1fr); margin: 0; }
.control-panel { top: 56px; height: calc(100vh - 56px); padding: 30px 26px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.72); }
.results-panel { padding: 30px clamp(30px, 3.2vw, 54px) 58px; background: var(--page); }
.section-heading { margin-bottom: 16px; }
.step-label { margin-bottom: 6px; color: var(--warm); font-size: 10px; font-weight: 720; }
h2 { font-size: 18px; font-weight: 650; }
.field-label { color: var(--ink-soft); font-size: 12px; font-weight: 560; }
input, textarea, select { border-color: var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.86); }
.url-field, .image-option-field select, .image-option-field input, .font-catalog-section input, .font-catalog-section select, .font-strip-options input, .font-strip-options select { background: rgba(255, 255, 255, 0.88); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.13); }
.primary-button { height: 42px; border: 0; border-radius: 8px; background: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.13); font-size: 13px; }
.primary-button:hover { border: 0; background: var(--accent-hover); }
.icon-text-button, .copy-button, .icon-button { border-color: var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.9); font-weight: 560; }
.icon-text-button:not(:disabled):hover, .copy-button:hover, .icon-button:hover { border-color: rgba(0, 113, 227, 0.5); background: var(--accent-soft); color: var(--accent); }
.results-toolbar { min-height: 46px; margin-bottom: 19px; }
.empty-state, .image-empty-state { border: 1px dashed rgba(60, 60, 67, 0.25); border-radius: 10px; background: rgba(255, 255, 255, 0.46); }
.empty-kicker { color: var(--warm); }
.empty-icon { border-radius: 10px; border-color: #d8e9ff; background: var(--accent-soft); color: var(--accent); box-shadow: none; }

.prompt-workspace, .image-workspace, .main-image-workspace, .font-workspace, .vector-workspace { grid-template-columns: 390px minmax(0, 1fr); }
.image-dropzone { border-color: rgba(60, 60, 67, 0.32); border-radius: 8px; background: rgba(255, 255, 255, 0.58); }
.image-dropzone:hover, .image-dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.image-mode-switch, .font-alignment-switch { border-color: var(--line); border-radius: 8px; background: #ededf0; }
.image-mode-switch button, .font-alignment-switch button { border-radius: 6px; font-size: 12px; }
.image-mode-switch button.selected, .font-alignment-switch button.selected { border-color: rgba(60, 60, 67, 0.2); background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.reference-item, .batch-result-card, .font-candidate, .result-card, .monitor-record { border-color: var(--line); border-radius: 8px; box-shadow: none; }
.generated-image-frame, .psd-preview-frame, .font-strip-canvas { border-color: var(--line); border-radius: 9px; background: #eef0f3; }

.psd-workspace { min-height: calc(100vh - 56px); background: var(--page); }
.psd-control-panel {
  top: auto;
  height: auto;
  padding: 31px clamp(32px, 4vw, 64px) 38px;
  background: rgba(255, 255, 255, 0.74);
  border-bottom: 1px solid var(--line);
}
.psd-workspace h2 { font-size: 20px; }
.psd-template-card, .psd-background-option, .psd-font-picker-option, .psd-material-item, .psd-production-file { border-color: var(--line); border-radius: 8px; box-shadow: none; }
.psd-template-card { background: rgba(255, 255, 255, 0.85); }
.psd-template-card:hover, .psd-background-option:hover, .psd-font-picker-option:hover { border-color: rgba(60, 60, 67, 0.32); background: #fff; }
.psd-template-card[aria-pressed="true"], .psd-background-option[aria-pressed="true"], .psd-font-picker-option:has(input:checked) { border-color: rgba(0, 113, 227, 0.52); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.07); }
.psd-template-card[aria-pressed="true"] strong, .psd-background-option[aria-pressed="true"] span, .psd-font-picker-option:has(input:checked) { color: #0065cc; }
.psd-background-heading-actions button { color: #0065cc; }
.psd-generation-actions > #generatePsdButton, .psd-generation-actions > #confirmPsdButton { border: 0; border-radius: 8px; }
.psd-results-panel { padding-top: 31px; background: var(--page); }
.psd-validation { border-color: var(--line); border-radius: 8px; background: var(--line); }

.monitor-workspace { max-width: none; min-height: calc(100vh - 56px); margin: 0; background: var(--page); }
.monitor-content { max-width: 1600px; padding: 31px clamp(30px, 3.4vw, 58px) 64px; }
.monitor-latest { border-color: var(--line); border-radius: 10px; box-shadow: none; overflow: hidden; }
.monitor-record { background: rgba(255, 255, 255, 0.82); }
.monitor-notice { border-color: #f0cbc7; border-radius: 8px; }
.toast { border-radius: 8px; background: rgba(29, 29, 31, 0.88); backdrop-filter: blur(14px); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 228px minmax(0, 1fr); }
  .app-sidebar { padding-left: 10px; padding-right: 10px; }
  .workspace, .prompt-workspace, .image-workspace, .main-image-workspace, .font-workspace, .vector-workspace { grid-template-columns: 340px minmax(0, 1fr); }
  .psd-image-input-grid { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); }
  .monitor-table-header { display: none; }
  .monitor-record { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 20px; align-items: start; padding: 16px; }
  .monitor-cell::before { display: block; margin-bottom: 5px; content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; }
  .monitor-cell.issue, .monitor-cell.payment-results { grid-column: 1 / -1; }
}

/* 独立的对话生图工作区 */
.conversation-image-workspace { grid-template-columns: 390px minmax(0, 1fr); }
.conversation-image-controls { overflow-y: auto; }
.conversation-image-controls .control-section { margin-bottom: 23px; }
.conversation-image-controls textarea { min-height: 150px; }
.conversation-optional { color: var(--muted); font-weight: 400; }
.conversation-upload { width: 100%; min-height: 54px; padding: 12px; font-size: 12px; }
.conversation-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.conversation-attachments:empty { display: none; }
.conversation-attachment { width: 62px; height: 62px; position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.conversation-attachment img { width: 100%; height: 100%; object-fit: cover; }
.conversation-attachment button { position: absolute; top: 2px; right: 2px; width: 21px; height: 21px; padding: 0; border: 0; border-radius: 4px; background: rgba(20, 20, 20, 0.75); color: white; line-height: 1; }
.conversation-options { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); margin-bottom: 20px; }
.conversation-image-controls > .primary-button { width: 100%; justify-content: center; }
.conversation-image-results { min-width: 0; }
.conversation-turn-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.conversation-timeline { max-width: 880px; display: grid; gap: 30px; }
.conversation-turn { min-width: 0; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.conversation-turn-header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.conversation-turn-header span:first-child { color: var(--ink); font-weight: 650; }
.conversation-user-text { max-width: 760px; margin: 14px 0 18px; line-height: 1.6; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation-result-image { display: block; max-width: 100%; max-height: min(70vh, 680px); width: auto; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #e7e8e9; object-fit: contain; }
.conversation-turn-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.conversation-turn-actions .icon-text-button { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.conversation-turn-actions button:disabled { opacity: 0.55; cursor: default; }
.conversation-pending { display: flex; align-items: center; gap: 15px; padding: 24px 0; color: var(--muted); font-size: 13px; }
@media (max-width: 1180px) {
  .conversation-image-workspace { grid-template-columns: 340px minmax(0, 1fr); }
}

/* 文档翻译 */
.translate-workspace { grid-template-columns: 340px minmax(0, 1fr); }
.translate-dropzone { width: 100%; margin-top: 12px; }
.translate-doc-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.translate-doc-info svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.translate-doc-info-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.translate-doc-info-text strong { font-size: 11px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.translate-doc-info-text span { color: var(--muted); font-size: 10px; }
.translate-doc-info .icon-button { flex: none; }
.results-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.translate-result { display: block; }
.translate-result-field { margin-top: 0; }
.translate-result-field textarea { width: 100%; min-height: 320px; padding: 12px 14px; font-size: 16px; line-height: 1.7; resize: vertical; }
.translate-result-field > span { color: var(--muted); font-size: 10px; }
@media (max-width: 1024px) {
  .translate-workspace { grid-template-columns: 340px minmax(0, 1fr); }
}
.translate-language-switch { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.translate-language-switch button { height: 44px; font-size: 16px; white-space: nowrap; }
.translate-glossary-toggle { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; font-size: 11px; color: var(--ink-soft); cursor: pointer; }
.translate-glossary-toggle input { margin-top: 2px; accent-color: var(--accent); }
/* 结构规范开关：提示词生成面板与视频第 2 步共用（外置 prompt-style-guide.json） */
.style-guide-toggle { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.style-guide-toggle input { margin-top: 2px; accent-color: var(--accent); }
.style-guide-toggle span span { margin-left: 6px; opacity: 0.75; }
.style-guide-toggle span span:empty { margin-left: 0; }
.notice-retry-button {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.notice-retry-button:hover { opacity: 0.85; }

/* 单位转换 */
.unit-category-switch { grid-template-columns: repeat(3, 1fr); }
.unit-category-switch button { height: 32px; }
#unitValueInput { height: 43px; padding: 0 12px; background: var(--surface-soft); font-size: 15px; font-weight: 600; }
.unit-result {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.unit-result-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.unit-result-main #unitResultValue { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; color: var(--accent); word-break: break-all; }
.unit-result-main #unitResultUnit { font-size: 14px; color: var(--muted); }
.unit-result-formula { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.unit-all-heading { margin: 22px 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.3px; }
.unit-all-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.unit-all-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.unit-all-row b { font-size: 14px; font-weight: 650; word-break: break-all; }
.unit-all-row span { color: var(--muted); font-size: 11px; text-align: right; flex: none; }
.unit-all-row.selected { border-color: var(--accent); background: var(--accent-soft); }
.unit-switch { grid-template-columns: repeat(3, 1fr); margin-bottom: 6px; }
.unit-switch button { height: 30px; font-size: 10.5px; white-space: nowrap; padding: 0 4px; }

/* 视频工作流：独立无限画布 */
.video-workspace { position: relative; height: calc(100vh - 56px); min-height: 620px; display: flex; flex-direction: column; overflow: hidden; background: #edf0f3; }
.video-toolbar { min-height: 72px; padding: 13px 24px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid #dfe3e8; background: #fff; }
.video-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.video-heading .step-label { margin: 0; white-space: nowrap; }
.video-heading h2 { font-size: 18px; white-space: nowrap; }
.video-model-tag { padding: 5px 8px; border: 1px solid #d7dce3; border-radius: 5px; color: #525c68; background: #f4f6f8; font-size: 11px; white-space: nowrap; }
.video-toolbar-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.video-tool-button { min-height: 31px; padding: 0 10px; border: 1px solid #dce1e7; border-radius: 6px; background: #fff; color: #2b3745; font-size: 12px; font-weight: 600; }
.video-tool-button:hover { border-color: #0071e3; color: #0065cc; }
.video-tool-button:disabled { opacity: 0.5; cursor: not-allowed; }
.video-tool-primary { margin-left: 9px; border-color: #0071e3; background: #0071e3; color: #fff; }
.video-tool-primary:hover { background: #0063c7; color: #fff; }
.video-stage-menu { position: absolute; z-index: 40; width: 230px; max-height: min(520px, calc(100vh - 160px)); padding: 6px; overflow-y: auto; border: 1px solid #d7dfe8; border-radius: 7px; background: #fff; box-shadow: 0 12px 28px rgba(37, 54, 73, 0.16); }
.video-stage-menu button { width: 100%; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; color: #344250; font-size: 12px; text-align: left; }
.video-stage-menu button:hover:not(:disabled), .video-stage-menu button:focus-visible { background: #e8f2ff; color: #0065cc; }
.video-stage-menu button:disabled { color: #a0a8b1; cursor: not-allowed; }
.video-stage-menu #videoAddCustom { color: #0065cc; font-weight: 700; }
.video-stage-menu #videoAddExample { margin-top: 5px; border-top: 1px solid #e6e9ed; border-radius: 0; color: #6254a2; font-weight: 650; }
.video-menu-label { display: block; padding: 10px 10px 4px; color: #7d8792; font-size: 10px; font-weight: 700; }
.video-zoom-label { width: 45px; text-align: center; color: #5d6873; font-size: 11px; font-variant-numeric: tabular-nums; }
.video-board { position: relative; flex: 1; min-height: 0; overflow: clip; cursor: grab; touch-action: none; background-color: #f0f2f5; background-image: radial-gradient(#cdd3dc 0.85px, transparent 0.85px); background-size: 20px 20px; }
.video-empty { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.video-empty h3 { margin: 8px 0 20px; color: #293746; font-size: 20px; font-weight: 650; }
.video-empty > div { display: flex; gap: 9px; pointer-events: auto; }
.video-empty button { min-height: 38px; padding: 0 15px; border: 1px solid #cbd7e5; border-radius: 6px; background: #fff; color: #0065cc; font-size: 12px; font-weight: 650; }
.video-empty button:first-child { border-color: #0071e3; background: #0071e3; color: #fff; }
.video-empty button:hover { box-shadow: 0 2px 9px rgba(37, 54, 73, 0.12); }
.video-board.panning { cursor: grabbing; }
.video-world { position: absolute; left: 0; top: 0; width: 5000px; height: 900px; transform-origin: 0 0; }
.video-wires { position: absolute; left: 0; top: 0; width: 5000px; height: 900px; overflow: visible; pointer-events: none; }
.video-wires path { fill: none; stroke: #adb9c8; stroke-width: 2; }
.video-wires circle { fill: #fff; stroke: #8e9aab; stroke-width: 2; }
.video-insert-layer { position: absolute; inset: 0; pointer-events: none; }
.video-insert-button { position: absolute; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; transform: translate(-50%, -50%); border: 1px solid #9db8d7; border-radius: 50%; background: #fff; color: #0065cc; box-shadow: 0 2px 6px rgba(30, 65, 100, 0.14); font-size: 18px; line-height: 1; pointer-events: auto; }
.video-insert-button:hover { background: #e8f2ff; border-color: #0071e3; }
.video-node { position: absolute; width: 330px; overflow: hidden; border: 1px solid #d8dfe7; border-radius: 8px; background: #fff; box-shadow: 0 5px 18px rgba(37, 54, 73, 0.09); cursor: default; }
.video-node[data-video-node]:not(.video-node-custom):not(.video-preset-active) { display: none; }
.video-preset-delete { width: 27px; height: 27px; flex: none; border: 0; border-radius: 5px; background: transparent; color: #7c8794; font-size: 18px; }
.video-preset-delete:hover { background: #faece9; color: #a23b35; }
.video-node-custom { border-color: #bbb4d6; }
.video-node-custom .video-node-index { background: #ede9f9; color: #6254a2; }
.video-node-custom input[type="text"] { height: 36px; width: 100%; margin: 0 0 11px; padding: 0 10px; border: 1px solid #dce1e7; border-radius: 6px; background: #f9fafb; color: #283441; font-size: 12px; }
.video-node-custom .video-custom-preview { max-height: 180px; display: block; width: 100%; margin: 10px 0 0; border-radius: 5px; object-fit: contain; background: #e8ebef; }
.video-node-custom .video-custom-preview.hidden { display: none; }
.video-node-custom .video-custom-remove-media { display: none; margin-top: 8px; padding: 2px 0; border: 0; background: none; color: #a23b35; font-size: 11px; }
.video-node-custom .video-custom-remove-media.visible { display: block; }
.video-node-custom .video-custom-delete { width: 27px; height: 27px; flex: none; border: 0; border-radius: 5px; background: transparent; color: #7c8794; font-size: 18px; }
.video-node-custom .video-custom-delete:hover { background: #faece9; color: #a23b35; }
.video-node-wide { width: 370px; }
.video-node-header { min-height: 64px; display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-bottom: 1px solid #ebedf0; cursor: grab; user-select: none; }
.video-node-header:active { cursor: grabbing; }
.video-node-index { width: 31px; height: 31px; display: grid; place-items: center; flex: none; border-radius: 6px; background: #e8f2ff; color: #0065cc; font-size: 11px; font-weight: 750; }
.video-node-header div { flex: 1; min-width: 0; }
.video-node-header small { display: block; margin-bottom: 2px; color: #687482; font-size: 10px; }
.video-node-header h3 { margin: 0; color: #202a35; font-size: 15px; line-height: 1.3; font-weight: 650; }
.video-node-header h3 { overflow-wrap: anywhere; }
.video-node-grip { color: #a5afba; font-size: 20px; line-height: 1; }
.video-node-body { padding: 15px; }
.video-node-body label:not(.video-upload), .video-timeline-shot > span { display: block; margin: 0 0 7px; color: #384552; font-size: 11px; font-weight: 650; }
.video-node-body textarea, .video-node-body select { width: 100%; margin: 0 0 12px; padding: 9px 10px; border: 1px solid #dce1e7; border-radius: 6px; background: #f9fafb; color: #283441; font-size: 12px; line-height: 1.5; resize: vertical; }
.video-node-body input[type="text"], .video-node-body input[type="url"] { width: 100%; height: 36px; margin: 0 0 12px; padding: 0 10px; border: 1px solid #dce1e7; border-radius: 6px; background: #f9fafb; color: #283441; font-size: 12px; }
.video-brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.video-brief-grid select { height: 36px; padding: 0 5px; font-size: 11px; }
.video-node-body textarea { min-height: 65px; }
.video-node-body select { height: 37px; }
.video-node-body input[type="range"] { width: 100%; accent-color: #0071e3; }
.video-node-body output { float: right; color: #0065cc; }
.video-node-foot, .video-subtle { margin: 4px 0 0; color: #737e8b; font-size: 10px; line-height: 1.5; }
.video-product-preview { height: 188px; overflow: hidden; border-radius: 6px; background: #e8ebef; }
.video-product-preview img { width: 100%; height: 100%; object-fit: contain; }
.video-upload, .video-inline-action, .video-node-actions button { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 11px 0 0; padding: 6px 9px; border: 1px solid #bfd4ed; border-radius: 6px; background: #f3f8ff; color: #0065cc; font-size: 11px; font-weight: 650; cursor: pointer; text-align: center; }
.video-upload span { color: #667d97; font-weight: 400; }
.video-upload:hover, .video-inline-action:hover, .video-node-actions button:hover { border-color: #0071e3; background: #e8f2ff; }
.video-inline-action:disabled { opacity: 0.58; cursor: wait; }
.video-analysis-result { margin-top: 12px; padding: 10px; border: 1px solid #dce4ee; border-radius: 6px; background: #f7f9fc; }
.video-analysis-result strong { display: block; margin: 0 0 4px; color: #344250; font-size: 10px; }
.video-analysis-result p { margin: 0 0 10px; color: #566474; font-size: 10px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.video-analysis-result p:last-child { margin-bottom: 0; }
.video-portrait { position: relative; width: 150px; aspect-ratio: 9 / 16; margin: 0 auto; overflow: hidden; border: 1px solid #dce1e7; border-radius: 6px; background: #d5d7dd; }
.video-portrait img { width: 100%; height: 100%; object-fit: cover; }
.video-frame-badge { position: absolute; left: 7px; bottom: 7px; padding: 3px 6px; border-radius: 3px; background: rgba(21, 27, 34, 0.72); color: #fff; font-size: 10px; }
.video-motion-preview { width: 135px; }
.video-motion-caption { position: absolute; left: 7px; right: 7px; bottom: 18px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; color: #fff; font-size: 13px; line-height: 1.4; font-weight: 700; text-align: center; text-shadow: 0 1px 5px #111; overflow-wrap: anywhere; }
.video-motion-preview.playing img { animation: video-motion 4s ease-in-out both; }
@keyframes video-motion { from { transform: scale(1.02) translateX(0); } to { transform: scale(var(--video-motion-scale, 1.18)) translateX(var(--video-motion-x, 0%)); } }
.video-node-actions { display: flex; gap: 7px; }
.video-node-actions button, .video-node-actions .video-upload { flex: 1; min-width: 0; margin-top: 10px; font-size: 10px; }
.video-timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.video-timeline-shot { min-width: 0; padding: 8px; border: 1px solid #e0e4e9; border-radius: 6px; background: #f7f9fb; }
.video-timeline-shot > span { min-height: 29px; font-size: 10px; }
.video-timeline-shot label { margin-top: 9px !important; }
.video-timeline-bar { height: 20px; display: flex; gap: 3px; margin-top: 13px; }
.video-timeline-bar span { display: block; border-radius: 3px; background: #96b9eb; }
.video-timeline-bar span + span { background: #8c83ae; }
.video-output-frame { position: relative; width: 142px; aspect-ratio: 9 / 16; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; margin: auto; padding: 0 7px 27px; overflow: hidden; border-radius: 6px; background: #46515b; color: #fff; text-align: center; isolation: isolate; }
.video-output-frame::after { position: absolute; z-index: -1; inset: 45% 0 0; content: ""; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.video-output-frame img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-output-frame.rendered > :not(video) { display: none; }
.video-output-frame video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #111; }
.video-preview-dialog { width: min(370px, calc(100vw - 40px)); max-height: calc(100vh - 50px); padding: 0; overflow: hidden; border: 1px solid #c9d2dd; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(20, 32, 45, 0.25); }
.video-preview-dialog::backdrop { background: rgba(18, 27, 37, 0.72); }
.video-preview-heading { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px 0 14px; color: #263545; font-size: 13px; }
.video-preview-heading button { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #5b6774; font-size: 22px; }
.video-preview-heading button:hover { background: #edf1f5; }
.video-preview-dialog video { width: 100%; max-height: calc(100vh - 100px); display: block; aspect-ratio: 9 / 16; background: #111; }
.video-output-frame strong { font-size: 16px; }
.video-output-frame span, .video-output-frame small { font-size: 10px; }
.video-review { display: grid; gap: 5px; margin: 12px 0 0; padding: 10px 0 0; border: 0; border-top: 1px solid #e1e5ea; }
.video-review legend { padding: 0 5px 0 0; color: #394755; font-size: 11px; font-weight: 700; }
.video-review label { display: flex !important; align-items: center; gap: 7px; margin: 0 !important; color: #596675 !important; font-size: 10px !important; font-weight: 500 !important; }
.video-review input { width: 14px; height: 14px; flex: none; margin: 0; accent-color: #0071e3; }
.video-export-button { width: 100%; min-height: 37px; margin-top: 14px; border: 0; border-radius: 6px; background: #0071e3; color: #fff; font-size: 12px; font-weight: 650; }
.video-export-button:hover { background: #0063c7; }
.video-export-button:disabled { opacity: 0.55; cursor: wait; }
.video-stage-nav { min-height: 51px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 15px; overflow-x: auto; border-top: 1px solid #dfe3e8; background: #fff; }
.video-stage-nav button { flex: none; min-height: 29px; padding: 0 10px; border: 0; border-radius: 5px; color: #52606e; background: transparent; font-size: 11px; }
.video-stage-nav button[data-video-jump^="custom-"] { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-stage-nav button:hover, .video-stage-nav button.active { background: #e8f2ff; color: #0065cc; }
@media (max-width: 1200px) { .video-heading .step-label { display: none; } .video-toolbar { padding: 10px 15px; } .video-stage-nav { justify-content: flex-start; } }

/* ===== 广告视频四步工作流（vf-*） ===== */
:root {
  --warm-soft: #eeecf7;
  --ok: #2e7d4f;
  --ok-soft: #e8f3ec;
}
.video-workspace { background: var(--page); }
.vf-toolbar {
  display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  padding: 16px 24px 0; background: var(--surface); border-bottom: 1px solid var(--line);
}
.vf-steps { display: flex; gap: 4px; }
.vf-step {
  border: none; background: none; cursor: pointer; font: inherit; color: var(--muted);
  padding: 10px 16px 12px; border-bottom: 2px solid transparent;
  display: flex; gap: 8px; align-items: center; font-size: 14px;
}
.vf-n {
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface-soft);
  border: 1px solid var(--line-strong); font-size: 12px;
  display: grid; place-items: center; color: var(--muted); flex: none;
}
.vf-step:hover { color: var(--ink-soft); }
.vf-step.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.vf-step.is-active .vf-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.vf-step.is-done .vf-n { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

.vf-scroll {
  flex: 1; overflow-y: auto; padding: 20px 24px 60px;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.vf-panel {
  width: 100%; max-width: 1180px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.vf-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.vf-head h3 { margin: 0; font-size: 15px; }
.vf-num {
  width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none;
}
.vf-num-warm { background: var(--warm-soft); color: var(--warm); }
.vf-hint { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.vf-body { padding: 18px 20px 20px; }

.vf-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 5px; }
.vf-label:first-child { margin-top: 0; }
.vf-req { color: var(--accent); }
.vf-body input[type="text"], .vf-body input[type="url"], .vf-body input[type="number"],
.vf-body textarea, .vf-body select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 9px 12px; font: inherit; color: var(--ink); background: var(--surface);
}
.vf-body input:focus, .vf-body textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.vf-body textarea { resize: vertical; }
.vf-subtle { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.vf-status { min-height: 16px; }
.vf-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vf-row input { flex: 1; min-width: 200px; }
.vf-grid2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 16px; }
@media (max-width: 900px) { .vf-grid2 { grid-template-columns: 1fr; } }

.vf-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.vf-btn:hover { border-color: var(--muted); }
.vf-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.vf-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.vf-btn:disabled { opacity: .45; cursor: not-allowed; }
.vf-btn-sm { padding: 5px 12px; font-size: 12.5px; font-weight: 500; }

/* 图片池（人工上传的商品图片） */
.vf-strip { display: flex; gap: 10px; flex-wrap: wrap; min-height: 96px; align-items: flex-start; margin-top: 8px; }
.vf-thumb {
  position: relative; width: 72px; height: 96px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--surface-soft) center/cover no-repeat;
  display: grid; place-items: center; color: var(--muted-light); font-size: 10.5px;
  text-align: center; cursor: pointer; padding: 4px; overflow: hidden; box-sizing: border-box;
}
.vf-thumb:hover { border-color: var(--muted); }
.vf-thumb.is-sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.vf-thumb.is-sel::after {
  content: '✓ 已选'; position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--accent); color: #fff; font-size: 9.5px; padding: 2px 0; font-weight: 600;
}
/* 选中序号角标：标明这张图排第几（对应默认分配到第几个镜头） */
.vf-thumb-order {
  position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  display: none; place-items: center; line-height: 1; z-index: 2;
}
.vf-thumb-order.show { display: grid; }

/* 每镜产品图绑定 */
.vf-shot-img {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.vf-shot-thumb {
  width: 34px; height: 44px; flex: none; border-radius: 6px; border: 1.5px solid var(--line-strong);
  background: var(--surface-soft) center/cover no-repeat; cursor: pointer;
  display: grid; place-items: center; color: var(--muted-light); font-size: 9.5px; padding: 0; overflow: hidden;
}
.vf-shot-thumb:hover:not(:disabled) { border-color: var(--accent); }
.vf-shot-thumb.has-img { border-color: var(--accent); }
.vf-shot-thumb:disabled { opacity: .5; cursor: not-allowed; }
.vf-shot-imgname {
  font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1; min-width: 0;
}

/* 挑图弹层 */
.vf-imgpicker {
  margin-top: 12px; border: 1px solid var(--accent); border-radius: 11px;
  background: var(--accent-soft); padding: 10px 12px;
}
.vf-imgpicker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--accent); margin-bottom: 8px;
}
.vf-thumb-auto {
  width: 72px; height: 96px; border-style: dashed;
  display: grid; place-items: center; font-size: 12px; color: var(--muted);
}

.vf-badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.vf-badge-req { background: var(--accent-soft); color: var(--accent); }
.vf-badge-ok { background: var(--ok-soft); color: var(--ok); }
.vf-badge-warm { background: var(--warm-soft); color: var(--warm); }
.vf-badge-mono { background: var(--surface-soft); color: var(--muted); border: 1px solid var(--line); }
.vf-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.vf-analysis {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-soft); padding: 12px 14px;
}
.vf-analysis-inline { margin-top: 0; }
.vf-analysis h4 { font-size: 12.5px; color: var(--warm); margin: 0 0 3px; }
.vf-analysis p { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; white-space: pre-wrap; }
.vf-analysis p:last-child { margin-bottom: 0; }

/* 分镜卡片 */
.vf-shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .vf-shots { grid-template-columns: 1fr; } }
.vf-shot { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface); }
.vf-shot header {
  padding: 8px 12px; background: var(--surface-soft); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px;
}
.vf-tag { font-size: 11px; color: var(--warm); font-weight: 600; }
.vf-dur { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12.5px; color: var(--muted); }
.vf-dur input {
  width: 52px !important; text-align: center; padding: 3px 4px !important;
  border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 12.5px;
}
.vf-shot textarea {
  border: none !important; border-radius: 0 !important; min-height: 96px;
  padding: 10px 12px !important; font-size: 12.5px;
}
.vf-shot textarea:focus { outline: none !important; }
.vf-shot footer { border-top: 1px solid var(--line); padding: 7px 12px; display: flex; gap: 8px; align-items: center; }
.vf-cap-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vf-shot footer input { border: 1px solid var(--line) !important; border-radius: 6px !important; padding: 4px 8px !important; font-size: 12px !important; }
.vf-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.vf-cta-input { width: 180px !important; flex: none !important; min-width: 0 !important; padding: 5px 10px !important; font-size: 12.5px !important; }

/* 生成舱 */
.vf-gen { display: grid; grid-template-columns: 1fr 250px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .vf-gen { grid-template-columns: 1fr; } }
.vf-toggle { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px; cursor: pointer; }
.vf-toggle input { margin-top: 3px; accent-color: var(--accent); }
.vf-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.vf-chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 6px 15px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.vf-chip:hover { border-color: var(--muted); }
.vf-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.vf-split {
  margin-top: 10px; background: var(--warm-soft); color: var(--warm); border-radius: 9px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600;
}
.vf-progress { margin-top: 16px; }
.vf-prog-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.vf-prog-name { width: 110px; flex: none; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-prog-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.vf-prog-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.vf-prog-st { width: 64px; flex: none; text-align: right; color: var(--muted); }
.vf-prog-row.is-ok .vf-prog-st { color: var(--ok); }
.vf-prog-row.is-ok .vf-prog-bar i { background: var(--ok); }
.vf-prog-row.is-failed .vf-prog-st { color: var(--danger); }
.vf-reroll { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.vf-reroll-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.vf-reroll-title { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.vf-reroll-tip { font-size: 11.5px; color: var(--muted); }
.vf-reroll-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.vf-reroll-item + .vf-reroll-item { border-top: 1px solid var(--line); }
.vf-reroll-name { font-size: 12.5px; color: var(--ink-soft); min-width: 40px; flex: none; }
.vf-reroll-st { font-size: 11.5px; color: var(--muted); margin-right: auto; }
.vf-reroll-st.is-ok { color: var(--ok); }
.vf-reroll-st.is-failed { color: var(--danger); }
.vf-reroll-run, .vf-reroll-edit { flex: none; }
.vf-reroll-prompt { width: 100%; margin: 2px 0 0; font-size: 12px; line-height: 1.55; }
.vf-reroll-err { color: var(--danger); font-size: 11.5px; margin: 0; }
.vf-done { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vf-notice {
  margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px;
  font-size: 12px; color: var(--muted);
}

/* 9:16 手机预览 */
.vf-phone-wrap { position: sticky; top: 0; }
.vf-phone {
  width: 100%; aspect-ratio: 9/16; border-radius: 18px; border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #2a2f2c, #454b47); position: relative; overflow: hidden;
  display: grid; place-items: center; background-size: cover; background-position: center;
}
.vf-phone img, .vf-phone video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.vf-phone video { object-fit: contain; background: #000; }
.vf-phone-label { color: rgba(255,255,255,.85); font-size: 12px; text-align: center; padding: 0 18px; }
.vf-phone-badge {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.5); color: #fff;
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px; z-index: 2;
}
.vf-phone-cta {
  position: absolute; bottom: 14px; left: 14px; right: 14px; background: rgba(255,255,255,.92);
  border-radius: 8px; text-align: center; padding: 7px 0; font-size: 12.5px; font-weight: 700;
  color: var(--ink); z-index: 2;
}
@media (max-width: 1200px) {
  .vf-toolbar { padding: 12px 15px 0; gap: 14px; }
  .vf-scroll { padding: 15px 15px 50px; }
  .vf-hint { display: none; }
}

/* ==========================================================================
   贾老师工作台 · 鸿蒙（HarmonyOS / ArkUI）主题层   ——  追加层，2026-09-30
   只重述颜色令牌与表面样式，不改动任何工作流用到的类名、状态或布局语义。
   深色模式：html[data-theme="dark"] 为手动切换；没有显式设置时跟随
   prefers-color-scheme。所有表面都走变量，因此深色只需要重定义令牌。
   ========================================================================== */
:root {
  /* 文字层级（ArkUI 三段式） */
  --text-1: rgba(0, 0, 0, 0.90);
  --text-2: rgba(0, 0, 0, 0.62);
  --text-3: rgba(0, 0, 0, 0.40);

  /* 强调色：鸿蒙蓝 */
  --accent: #0a59f7;
  --accent-hover: #0842c0;
  --accent-soft: #e8f0ff;
  --accent-ink: #0a59f7;
  --accent-ring: rgba(10, 89, 247, 0.18);
  --accent-glow: rgba(10, 89, 247, 0.22);

  /* 底与面 */
  --page: #f1f3f5;
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --card-bg: #ffffff;
  --panel-bg: rgba(255, 255, 255, 0.80);
  --bar-bg: rgba(241, 243, 245, 0.82);
  --input-bg: #f1f3f5;
  --input-bg-focus: #ffffff;
  --chip-bg: #f1f3f5;
  --chip-hover: #e6e9ec;
  --press-bg: rgba(0, 0, 0, 0.05);
  --segment-bg: #f1f3f5;
  --segment-active: #ffffff;
  --canvas-bg: #edf0f2;
  --empty-bg: rgba(255, 255, 255, 0.55);
  --scrim-bg: rgba(241, 243, 245, 0.90);
  --toast-bg: rgba(20, 22, 26, 0.88);
  --toast-fg: #ffffff;
  --dot-grid: rgba(0, 0, 0, 0.13);
  --scroll-thumb: rgba(0, 0, 0, 0.16);

  /* 线与影 */
  --ink: #1a1c1f;
  --ink-soft: rgba(0, 0, 0, 0.72);
  --muted: rgba(0, 0, 0, 0.52);
  --muted-light: rgba(0, 0, 0, 0.36);
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.14);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 22px rgba(0, 0, 0, 0.045);
  --shadow-float: 0 16px 44px rgba(0, 0, 0, 0.12);
  --shadow-thumb: 0 1px 4px rgba(0, 0, 0, 0.10);

  /* 语义色 */
  --warm: #6254a2;
  --warm-soft: #eeecf7;
  --ok: #2e7d4f;
  --ok-soft: #e8f3ec;
  --danger: #d34a45;
  --danger-soft: #fbeceb;
  --warn-bg: #fff6f2;
  --warn-line: rgba(211, 74, 69, 0.28);
  --warn-fg: #8a4535;

  color-scheme: light;
  font-family: "HarmonyOS Sans SC", "HarmonyOS Sans", "HONOR Sans CN", "PingFang SC",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-1);
  background: var(--page);
}

/* ---------- 深色令牌：手动选择深色 ---------- */
:root[data-theme="dark"] {
  --text-1: rgba(255, 255, 255, 0.92);
  --text-2: rgba(255, 255, 255, 0.62);
  --text-3: rgba(255, 255, 255, 0.40);

  --accent: #4d8dff;
  --accent-hover: #6ba0ff;
  --accent-soft: #18233a;
  --accent-ink: #9dc0ff;
  --accent-ring: rgba(77, 141, 255, 0.34);
  --accent-glow: rgba(77, 141, 255, 0.26);

  --page: #000000;
  --surface: #1a1a1c;
  --surface-soft: #212123;
  --card-bg: #1a1a1c;
  --panel-bg: rgba(28, 28, 30, 0.76);
  --bar-bg: rgba(12, 12, 14, 0.78);
  --input-bg: #26262a;
  --input-bg-focus: #2f2f33;
  --chip-bg: #26262a;
  --chip-hover: #333338;
  --press-bg: rgba(255, 255, 255, 0.09);
  --segment-bg: #26262a;
  --segment-active: #48484c;
  --canvas-bg: #17181a;
  --empty-bg: rgba(26, 26, 28, 0.72);
  --scrim-bg: rgba(0, 0, 0, 0.86);
  --toast-bg: rgba(64, 64, 68, 0.94);
  --toast-fg: #ffffff;
  --dot-grid: rgba(255, 255, 255, 0.16);
  --scroll-thumb: rgba(255, 255, 255, 0.20);

  --ink: rgba(255, 255, 255, 0.92);
  --ink-soft: rgba(255, 255, 255, 0.76);
  --muted: rgba(255, 255, 255, 0.56);
  --muted-light: rgba(255, 255, 255, 0.36);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 18px 48px rgba(0, 0, 0, 0.7);
  --shadow-thumb: 0 1px 4px rgba(0, 0, 0, 0.55);

  --warm: #a99df2;
  --warm-soft: #272441;
  --ok: #5ec48a;
  --ok-soft: #17291f;
  --danger: #ff6f6a;
  --danger-soft: #2f1a1a;
  --warn-bg: #2b1c18;
  --warn-line: rgba(255, 111, 106, 0.34);
  --warn-fg: #ffb4ad;

  color-scheme: dark;
}

/* ---------- 深色令牌：跟随系统（未被手动固定为浅色时） ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text-1: rgba(255, 255, 255, 0.92);
    --text-2: rgba(255, 255, 255, 0.62);
    --text-3: rgba(255, 255, 255, 0.40);

    --accent: #4d8dff;
    --accent-hover: #6ba0ff;
    --accent-soft: #18233a;
    --accent-ink: #9dc0ff;
    --accent-ring: rgba(77, 141, 255, 0.34);
    --accent-glow: rgba(77, 141, 255, 0.26);

    --page: #000000;
    --surface: #1a1a1c;
    --surface-soft: #212123;
    --card-bg: #1a1a1c;
    --panel-bg: rgba(28, 28, 30, 0.76);
    --bar-bg: rgba(12, 12, 14, 0.78);
    --input-bg: #26262a;
    --input-bg-focus: #2f2f33;
    --chip-bg: #26262a;
    --chip-hover: #333338;
    --press-bg: rgba(255, 255, 255, 0.09);
    --segment-bg: #26262a;
    --segment-active: #48484c;
    --canvas-bg: #17181a;
    --empty-bg: rgba(26, 26, 28, 0.72);
    --scrim-bg: rgba(0, 0, 0, 0.86);
    --toast-bg: rgba(64, 64, 68, 0.94);
    --toast-fg: #ffffff;
    --dot-grid: rgba(255, 255, 255, 0.16);
    --scroll-thumb: rgba(255, 255, 255, 0.20);

    --ink: rgba(255, 255, 255, 0.92);
    --ink-soft: rgba(255, 255, 255, 0.76);
    --muted: rgba(255, 255, 255, 0.56);
    --muted-light: rgba(255, 255, 255, 0.36);
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.20);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.55);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-float: 0 18px 48px rgba(0, 0, 0, 0.7);
    --shadow-thumb: 0 1px 4px rgba(0, 0, 0, 0.55);

    --warm: #a99df2;
    --warm-soft: #272441;
    --ok: #5ec48a;
    --ok-soft: #17291f;
    --danger: #ff6f6a;
    --danger-soft: #2f1a1a;
    --warn-bg: #2b1c18;
    --warn-line: rgba(255, 111, 106, 0.34);
    --warn-fg: #ffb4ad;

    color-scheme: dark;
  }
}

html { background: var(--page); -webkit-tap-highlight-color: transparent; }
body { color: var(--text-1); background: var(--page); }
h1, h2, h3, h4, strong { color: var(--text-1); }
::selection { background: var(--accent-soft); color: var(--text-1); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; background: var(--scroll-thumb); background-clip: content-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-light); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 外壳：侧栏 / 顶栏（鸿蒙毛玻璃） ---------- */
.app-shell { grid-template-columns: 244px minmax(0, 1fr); }
.app-sidebar, .topbar, .control-panel, .psd-control-panel {
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
}
.app-sidebar {
  padding: 14px 12px 16px;
  border-right: 1px solid var(--line);
  background: var(--bar-bg);
}
.topbar {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--bar-bg);
}
.topbar-context, .topbar-actions { color: var(--text-3); }
.topbar-context b { color: var(--text-1); font-weight: 600; }
.topbar-context b::before { color: var(--text-3); }

.brand { gap: 10px; padding: 6px 10px 22px; }
/* 负形 logo 需要透出页面底色，所以这里必须透明 */
.brand-mark, .auth-brand-mark {
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
}
.brand-mark img, .auth-brand-mark img { object-fit: contain; }
.brand h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; color: var(--text-1); }
.brand p { color: var(--text-3); font-size: 11px; }
.sidebar-group-label { color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; }
.service-state { border-top: 1px solid var(--line); color: var(--text-3); }
.service-state.ready .state-dot { background: var(--ok); }

.tool-tabs { background: transparent; border: 0; padding: 0; }
.tool-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.tool-tab svg { stroke-width: 1.8; }
.tool-tab:hover { background: var(--press-bg); color: var(--text-1); }
.tool-tab:active { transform: scale(0.98); }
.tool-tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: none; }

/* ---------- 标题与小标签 ---------- */
.step-label { color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; }
.empty-kicker { color: var(--text-3); letter-spacing: 1.6px; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.field-label { color: var(--text-2); font-weight: 600; }
.psd-workspace h2, .video-heading h2 { font-weight: 700; }

/* ---------- 输入：灰底填充、无描边 ---------- */
input, textarea, select, .auth-field {
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-1);
  background: var(--input-bg);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
input::placeholder, textarea::placeholder, .auth-field::placeholder { color: var(--text-3); }
.url-field, .image-option-field select, .image-option-field input, .font-catalog-section input,
.font-catalog-section select, .font-strip-options input, .font-strip-options select,
.vf-body input[type="text"], .vf-body input[type="url"], .vf-body input[type="number"],
.vf-body textarea, .vf-body select { background: var(--input-bg); }
#unitValueInput { background: var(--input-bg); }
input:focus, textarea:focus, select:focus, .auth-field:focus,
.vf-body input:focus, .vf-body textarea:focus {
  border-color: var(--accent);
  color: var(--text-1);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 4px var(--accent-ring);
  outline: none;
}
/* 原生控件不要被上面的填充样式带偏 */
input[type="checkbox"], input[type="radio"], input[type="range"], input[type="file"] {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); }

/* ---------- 按钮：胶囊 + 按压缩放 ---------- */
.primary-button, .auth-submit, .vf-btn, .icon-text-button, .copy-button, .icon-button,
.auth-logout, .notice-retry-button, .video-tool-button, .video-export-button {
  border-radius: 999px;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}
.primary-button, .auth-submit {
  height: 44px;
  padding: 0 22px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 18px var(--accent-glow);
}
.primary-button:hover, .auth-submit:hover { border: 0; background: var(--accent-hover); }
.primary-button:active, .auth-submit:active { transform: scale(0.975); box-shadow: 0 2px 8px var(--accent-glow); }
.primary-button:disabled { opacity: 0.45; box-shadow: none; }
.icon-text-button, .copy-button, .icon-button, .auth-logout, .vf-btn {
  border: 1px solid transparent;
  background: var(--chip-bg);
  color: var(--text-1);
  font-weight: 550;
  box-shadow: none;
}
.icon-button { width: 32px; height: 32px; padding: 0; }
.copy-button { background: var(--chip-bg); }
.icon-text-button:not(:disabled):hover, .copy-button:hover, .icon-button:hover,
.auth-logout:hover, .vf-btn:hover {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-text-button:not(:disabled):active, .copy-button:active, .icon-button:active, .vf-btn:active { transform: scale(0.96); }
.icon-text-button:disabled { opacity: 0.4; }
.vf-btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.vf-btn-primary:hover { background: var(--accent-hover); border-color: transparent; color: #fff; }

/* ---------- 卡片与面板 ---------- */
.control-panel, .psd-control-panel {
  border-color: var(--line);
  background: var(--panel-bg);
}
.results-panel, .psd-results-panel, .monitor-workspace, .psd-workspace, .video-workspace { background: var(--page); }
.reference-item, .batch-result-card, .font-candidate, .result-card, .monitor-record,
.psd-template-card, .psd-background-option, .psd-font-picker-option, .psd-material-item,
.psd-production-file, .unit-result, .unit-all-row, .translate-doc-info, .vf-panel, .vf-shot,
.vf-analysis, .monitor-latest {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
}
.result-card-header, .vf-head, .vf-shot header, .vf-shot footer, .video-node-header { border-color: var(--line); }
.psd-template-card { background: var(--card-bg); }
.psd-template-card:hover, .psd-background-option:hover, .psd-font-picker-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}
.psd-template-card[aria-pressed="true"], .psd-background-option[aria-pressed="true"],
.psd-font-picker-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.psd-template-card[aria-pressed="true"] strong, .psd-background-option[aria-pressed="true"] span,
.psd-font-picker-option:has(input:checked), .psd-background-heading-actions button,
.psd-apparel-segments button[aria-pressed="true"] { color: var(--accent-ink); }
.psd-material-picker-menu svg, .psd-production-file > svg { stroke: var(--accent); }
.monitor-record { background: var(--card-bg); }
.translate-doc-info { background: var(--card-bg); }
.unit-all-row.selected { border-color: var(--accent); background: var(--accent-soft); }
.original-column { border-right: 1px solid var(--line); background: var(--surface-soft); }

/* ---------- 空状态 / 拖拽区 / 画布 ---------- */
.empty-state, .image-empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: var(--empty-bg);
}
.empty-state h3 { color: var(--text-1); font-weight: 700; }
.empty-state h3 span, .empty-state p { color: var(--text-3); }
.empty-state h3 span { color: var(--accent); }
.empty-icon { border: 0; border-radius: 20px; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.image-dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--empty-bg);
  color: var(--text-2);
}
.image-dropzone:hover, .image-dropzone.dragging { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.generated-image-frame, .psd-preview-frame, .font-strip-canvas { border-color: var(--line); border-radius: 16px; background: var(--canvas-bg); }
.font-source-preview { border-color: var(--line); border-radius: 16px; background: var(--card-bg); }
.font-candidate-copy img { border: 1px solid var(--line); background: var(--card-bg); }
.font-summary { background: var(--card-bg); }
.font-catalog-note { border-left: 2px solid var(--warm); background: var(--warm-soft); color: var(--text-2); }
.image-analysis-badge.analyzed { border-color: var(--warm); background: var(--warm-soft); color: var(--warm); }

/* ---------- 分段选择器 ---------- */
.image-mode-switch, .font-alignment-switch {
  border: 0;
  border-radius: 999px;
  background: var(--segment-bg);
  padding: 4px;
}
.image-mode-switch button, .font-alignment-switch button {
  border: 0;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 550;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.image-mode-switch button:hover:not(.selected) { background: var(--press-bg); color: var(--text-1); }
.image-mode-switch button:active, .font-alignment-switch button:active { transform: scale(0.97); }
.image-mode-switch button.selected, .font-alignment-switch button.selected {
  border: 0;
  background: var(--segment-active);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-thumb);
}
.translate-language-switch button, .unit-category-switch button, .unit-switch button { border: 0; }
.translate-language-switch button.selected, .unit-category-switch button.selected, .unit-switch button.selected {
  background: var(--segment-active);
  color: var(--accent);
  box-shadow: var(--shadow-thumb);
}

/* 目标语言选择改为方形（2026-10-09），仅作用于文档翻译页，不影响共用组件 */
.translate-language-switch, .translate-language-switch button { border-radius: 8px; }

/* ---------- 提示 / 浮层 ---------- */
.notice {
  border: 1px solid var(--warn-line);
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.notice-retry-button { border: 0; background: var(--accent); color: #fff; }
.notice-retry-button:hover { background: var(--accent-hover); opacity: 1; }
.monitor-notice { border-color: var(--warn-line); border-radius: 12px; }
.toast { border-radius: 16px; background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow-float); }
.vf-badge-req, .vf-num { background: var(--accent-soft); color: var(--accent); }
.vf-badge-ok { background: var(--ok-soft); color: var(--ok); }
.vf-badge-warm, .vf-num-warm, .vf-split { background: var(--warm-soft); color: var(--warm); }
.vf-badge-mono { background: var(--surface-soft); color: var(--text-2); border: 1px solid var(--line); }
.vf-step.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.vf-shot textarea, .vf-shot textarea:focus { background: var(--card-bg); color: var(--text-1); }
.vf-imgpicker { border-color: var(--accent); background: var(--accent-soft); }
.vf-thumb { background-color: var(--surface-soft); }
.vf-prog-bar { background: var(--surface-soft); }
.vf-progress, .vf-notice { color: var(--text-2); }

/* ---------- 登录门 ---------- */
.auth-gate { background: var(--scrim-bg); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
.auth-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card-bg);
  box-shadow: var(--shadow-float);
}
.auth-brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.auth-card h1 { font-weight: 700; }
.auth-copy { color: var(--text-2); }
.auth-remember { color: var(--text-2); }

/* ---------- 深色模式下容易漏掉的硬编码 ---------- */
.video-stage-menu, .video-preview-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow-float);
}
.video-stage-menu button { color: var(--text-1); }
.video-stage-menu button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); }
.video-stage-menu #videoAddCustom { color: var(--accent-ink); }
.video-toolbar, .video-stage-nav { border-color: var(--line); background: var(--card-bg); }
.video-toolbar-actions { color: var(--text-2); }
.video-model-tag { border-color: var(--line); color: var(--text-2); background: var(--surface-soft); }
.video-tool-button { border: 0; background: var(--chip-bg); color: var(--text-1); font-weight: 550; }
.video-tool-button:hover { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.video-tool-primary { background: var(--accent); color: #fff; }
.video-tool-primary:hover { background: var(--accent-hover); color: #fff; }
.video-board { background-color: var(--page); background-image: radial-gradient(var(--dot-grid) 0.9px, transparent 0.9px); }
.video-empty h3 { color: var(--text-1); }
.video-empty button { border: 0; background: var(--chip-bg); color: var(--accent-ink); }
.video-empty button:first-child { background: var(--accent); color: #fff; }
.video-empty button:hover { box-shadow: var(--shadow-thumb); }
.video-node { border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); box-shadow: var(--shadow-card); }
.video-node-custom { border-color: var(--warm); }
.video-node-custom .video-node-index { background: var(--warm-soft); color: var(--warm); }
.video-node-index { background: var(--accent-soft); color: var(--accent); }
.video-node-header small { color: var(--text-3); }
.video-node-header h3 { color: var(--text-1); }
.video-node-grip { color: var(--text-3); }
.video-node-body label:not(.video-upload), .video-timeline-shot > span { color: var(--text-2); }
.video-node-body textarea, .video-node-body select, .video-node-body input[type="text"],
.video-node-body input[type="url"], .video-node-custom input[type="text"] {
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text-1);
}
.video-node-body textarea:focus, .video-node-body select:focus, .video-node-body input:focus {
  border-color: var(--accent);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 4px var(--accent-ring);
  outline: none;
}
.video-node-body output { color: var(--accent-ink); }
.video-node-foot, .video-subtle { color: var(--text-3); }
.video-wires path { stroke: var(--line-strong); }
.video-wires circle { fill: var(--card-bg); stroke: var(--line-strong); }
.video-insert-button { border: 0; background: var(--accent); color: #fff; box-shadow: var(--shadow-thumb); }
.video-insert-button:hover { background: var(--accent-hover); }
.video-product-preview { border-radius: 12px; background: var(--canvas-bg); }
.video-upload, .video-inline-action, .video-node-actions button {
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.video-upload:hover, .video-inline-action:hover, .video-node-actions button:hover { background: var(--chip-hover); color: var(--accent); }
.video-upload span { color: var(--text-2); }
.video-analysis-result { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.video-analysis-result strong { color: var(--text-1); }
.video-analysis-result p { color: var(--text-2); }
.video-portrait { border: 1px solid var(--line); border-radius: 12px; background: var(--canvas-bg); }
.video-timeline-shot { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.video-review { border-top: 1px solid var(--line); }
.video-review legend { color: var(--text-1); }
.video-review label { color: var(--text-2) !important; }
.video-preview-heading { color: var(--text-1); }
.video-preview-heading button { color: var(--text-2); }
.video-preview-heading button:hover { background: var(--press-bg); }
.video-stage-nav button { color: var(--text-2); }
.video-stage-nav button:hover, .video-stage-nav button.active { background: var(--accent-soft); color: var(--accent); }
.video-preset-delete, .video-node-custom .video-custom-delete { color: var(--text-3); }
.video-preset-delete:hover, .video-node-custom .video-custom-delete:hover { background: var(--danger-soft); color: var(--danger); }
.video-custom-preview { background: var(--canvas-bg); }
.conversation-turn { border-bottom: 1px solid var(--line); }
.conversation-turn-header { color: var(--text-2); }
.conversation-turn-header span:first-child { color: var(--text-1); }
.conversation-attachment { border: 1px solid var(--line); border-radius: 12px; }
.conversation-result-image { border: 1px solid var(--line); border-radius: 12px; background: var(--canvas-bg); }
.conversation-user-text { color: var(--text-1); }

/* 主题切换按钮 */
.theme-toggle {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-2);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
}

/* ==========================================================================
   贾老师工作台 · 鸿蒙主题层补丁（深色模式补漏）  ——  追加层，2026-09-30
   补齐原样式里写死的浅色底、绿色成功字与加载环，让深色模式不留白块。
   ========================================================================== */

/* 图片承载框：深色下不能用浅灰底，统一走画布令牌 */
.batch-result-visual,
.psd-template-card img,
.psd-batch-card img {
  background: var(--canvas-bg);
}

/* 成功色：原样式写死了深绿 #2f6a54 / #36765d，深色下几乎看不见 */
.psd-batch-card-header span,
.psd-validation-row strong,
.monitor-status,
.payment-channel-success {
  color: var(--ok);
}
.monitor-latest.success .monitor-status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

/* 加载环、删除文字 */
.loader {
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
}
.video-node-custom .video-custom-remove-media { color: var(--danger); }
.video-stage-menu #videoAddExample { color: var(--warm); }

/* 手机模拟图里的 CTA 白底条是内容的一部分，两种主题都保持深字白底 */
.vf-phone-cta { color: #1a1c1f; }
.vf-phone-label { color: rgba(255, 255, 255, 0.92); }

/* ========================================================================
   选择模型（2026-10-08 · 第 4 步）
   卡片数据来自 /api/health 的 videoModels（wan_video._model_card 现算），
   所以这里只负责排版，不含任何"哪个模型多快多贵"的硬编码。
   ======================================================================== */
.vf-models { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.vf-model {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-soft);
}
.vf-model.is-active { border-color: var(--accent); background: var(--accent-soft); }
.vf-model header { display: flex; align-items: center; gap: 10px; }
.vf-model h4 { margin: 0; font-size: 15px; }
.vf-model-tag {
  margin-left: auto; padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.vf-model-tag:empty { display: none; }
.vf-model-note { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.vf-model-specs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 2px 0 0; font-size: 12.5px; }
.vf-model-specs dt { color: var(--muted); white-space: nowrap; }
.vf-model-specs dd { margin: 0; color: var(--text-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vf-model .vf-btn { margin-top: auto; }

/* ========================================================================
   资源管理（2026-10-08 · 需求②③）
   三档：图片 / 视频 / 压缩包。只读清单 + 逐个确认删除（刻意无批量）。
   版式照 monitor-workspace 走：页面级滚动，不做内部滚动容器。
   ======================================================================== */
.assets-workspace { max-width: none; min-height: calc(100vh - 56px); margin: 0; background: var(--page); }
.assets-content { max-width: 1600px; padding: 31px clamp(30px, 3.4vw, 58px) 64px; }
.assets-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.assets-heading h2 { margin: 4px 0 0; font-size: 22px; }
.assets-heading-actions { display: flex; align-items: center; gap: 10px; }
.assets-total { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.assets-notice {
  margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--card-bg); color: var(--text-2); font-size: 12.5px;
}
.assets-tip { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.assets-tip b { color: var(--text-2); }

.assets-group { margin-bottom: 32px; }
.assets-group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.assets-group-head h3 { margin: 0; font-size: 14px; }
.assets-group-head span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.assets-group-empty { margin: 14px 0 0; color: var(--text-3); font-size: 12.5px; }

.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(198px, 1fr)); gap: 14px; margin-top: 14px; }
.asset-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card-bg); box-shadow: var(--shadow-card);
}
/* 生成中的文件：只降透明度、不隐藏 —— 用户要知道"它还在跑"，而不是奇怪文件去哪了 */
.asset-card.is-locked { opacity: 0.6; }
.asset-thumb { position: relative; display: grid; place-items: center; height: 136px; background: var(--canvas-bg); overflow: hidden; }
.asset-thumb img, .asset-thumb video { width: 100%; height: 100%; object-fit: contain; }
.asset-thumb em { font-style: normal; color: var(--text-3); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; }
.asset-meta { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px 0; }
.asset-name { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.asset-sub { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.asset-actions { display: flex; gap: 8px; margin-top: auto; padding: 11px 12px 12px; }
.asset-action {
  flex: 1; min-height: 29px; display: flex; align-items: center; justify-content: center;
  padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--surface); color: var(--text-2); text-decoration: none;
  font: inherit; font-size: 12px; cursor: pointer;
}
.asset-action:hover { border-color: var(--accent); color: var(--accent); }
.asset-action[disabled] { opacity: 0.5; cursor: not-allowed; }
.asset-action[disabled]:hover { border-color: var(--line-strong); color: var(--text-2); }
.asset-delete:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.asset-compare-toggle.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.asset-compare { margin-top: 14px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card-bg); }
.asset-compare-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.asset-compare-title { margin-right: auto; font-size: 13px; font-weight: 600; }
.asset-compare-stage { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.asset-compare-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.asset-compare-cell video { width: 100%; max-height: 460px; border-radius: 10px; background: #000; }
.asset-compare-cap { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.assets-empty { padding: 56px 0; text-align: center; color: var(--text-3); font-size: 13px; }
