/* ============================================================
 * FlowForge Studio — 明艳糖果视觉系统
 * 珊瑚粉 → 日落橙 → 薰衣草紫 高饱和渐变
 * ============================================================ */

:root {
  /* 明亮底色 */
  --bg-0: #fdf6f0;
  --bg-1: #fff9f4;
  --bg-2: #fff3ea;

  /* 明艳主色 */
  --coral: #ff6b6b;
  --sunset: #ff9f43;
  --pink: #ff5ca8;
  --rose: #ff8fab;
  --violet: #b388ff;
  --indigo: #7c6bff;

  /* 明亮渐变 */
  --grad-hero: linear-gradient(120deg, #ff6b6b 0%, #ff8e53 30%, #ff5ca8 60%, #b388ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,107,107,.12), rgba(255,156,168,.1), rgba(179,136,255,.1));
  --grad-btn: linear-gradient(120deg, #ff5f6d, #ff8e53 55%, #ff5ca8);
  --grad-side: linear-gradient(180deg, #1a1030 0%, #241338 45%, #1c0f2e 100%);
  --grad-accent: linear-gradient(90deg, #ff6b6b, #ff9f43);

  /* 文字 */
  --ink-1: #2b2135;
  --ink-2: #6b5f7a;
  --ink-3: #9d92ad;
  --ink-light: #fff;
  --ink-light-2: rgba(255,255,255,.75);
  --ink-light-3: rgba(255,255,255,.45);

  /* 线条 */
  --line: rgba(43, 33, 53, 0.08);
  --line-2: rgba(43, 33, 53, 0.14);
  --line-light: rgba(255,255,255,.09);

  /* 状态 */
  --ok: #00c48c;
  --warn: #ff9f43;
  --err: #ff5c7a;

  /* 阴影 */
  --sh-sm: 0 4px 14px rgba(43, 33, 53, 0.06);
  --sh-md: 0 10px 32px rgba(43, 33, 53, 0.09);
  --sh-lg: 0 22px 60px rgba(43, 33, 53, 0.13);
  --sh-glow-pink: 0 10px 34px rgba(255, 92, 168, 0.35), 0 4px 14px rgba(255, 107, 107, 0.25);
  --sh-glow-btn: 0 12px 34px rgba(255, 95, 109, 0.4), 0 0 50px rgba(255, 92, 168, 0.2);

  --r-xl: 24px;
  --r-lg: 17px;
  --r-md: 13px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink-1);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 85% -5%, rgba(255, 107, 107, 0.14), transparent 62%),
    radial-gradient(800px 460px at 5% 105%, rgba(179, 136, 255, 0.1), transparent 60%),
    radial-gradient(600px 380px at 50% 45%, rgba(255, 159, 67, 0.06), transparent 65%),
    var(--bg-0);
  background-attachment: fixed;
}

/* 细微纹理增加质感 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.016'/%3E%3C/svg%3E");
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255, 92, 168, 0.25); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 107, 107, 0.3); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--coral), var(--pink)); background-clip: content-box; }

/* ============ 布局 ============ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 278px minmax(0, 1fr); min-height: 100vh; }

/* ============ 侧边栏 — 深色对比 ============ */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 28px 15px 18px;
  background: var(--grad-side);
  border-right: none;
}
/* 侧栏顶部光晕 */
.sidebar::before {
  content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 92, 168, 0.35), rgba(179, 136, 255, 0.15), transparent);
  filter: blur(20px); pointer-events: none;
}
.sidebar-top { position: relative; min-height: 0; flex: 1; display: flex; flex-direction: column; }

.logo { display: flex; align-items: center; gap: 13px; padding: 2px 12px 28px; }
.logo-mark {
  position: relative; width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 14px; color: #fff;
  background: var(--grad-btn);
  font-size: 13px; font-weight: 900; letter-spacing: -0.04em;
  box-shadow: var(--sh-glow-pink), inset 0 1px rgba(255,255,255,.4);
}
.logo-mark::after {
  content: ''; position: absolute; inset: -2px; border-radius: 15px;
  background: var(--grad-btn); opacity: 0.55; filter: blur(14px); z-index: -1;
}
.logo-title {
  font-size: 16px; font-weight: 850; letter-spacing: 0.01em; color: #fff;
  background: linear-gradient(115deg, #fff 20%, #ffd9e8 60%, var(--rose));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-sub { margin-top: 2px; color: var(--ink-light-3); font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; }

.workflow-search { display: block; padding: 0 7px 8px; }
.workflow-search input {
  width: 100%; min-height: 38px; padding: 9px 12px; color: #fff;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 11px;
  outline: none; font-size: 10.5px;
}
.workflow-search input::placeholder { color: rgba(255,255,255,.4); }
.workflow-search input:focus { border-color: rgba(255,92,168,.55); box-shadow: 0 0 0 3px rgba(255,92,168,.12); }
.sidebar-task {
  width: calc(100% - 14px); margin: 2px 7px 8px; padding: 11px 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  color: #fff; text-align: left; cursor: pointer;
  background: linear-gradient(120deg, rgba(255,107,107,.26), rgba(255,92,168,.18));
  border: 1px solid rgba(255,142,181,.4); border-radius: 11px;
  box-shadow: 0 8px 24px rgba(255,92,168,.16); transition: .18s ease;
}
.sidebar-task:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.5); }
.sidebar-task-status { color: #ffb6d1; font-size: 8.5px; font-weight: 800; }
.sidebar-task strong { width: 100%; font-size: 11.5px; line-height: 1.35; overflow-wrap: anywhere; }
.sidebar-task small { color: rgba(255,255,255,.55); font-size: 9px; }
.sidebar-task.submitting .sidebar-task-status, .sidebar-task.queued .sidebar-task-status, .sidebar-task.running .sidebar-task-status { animation: pulse 1.1s ease-in-out infinite; }
.sidebar-task.success { background: rgba(0,196,140,.16); border-color: rgba(66,219,167,.35); }
.sidebar-task.success .sidebar-task-status { color: #69e5b9; }
.sidebar-task.error { background: rgba(255,92,122,.15); border-color: rgba(255,92,122,.4); }
.sidebar-task.error .sidebar-task-status { color: #ff91a7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sidebar-nav { min-height: 0; flex: 1; overflow-y: auto; padding: 0 4px 10px; margin-right: -4px; }
.nav-group { margin: 13px 0 17px; }
.nav-group-label {
  padding: 0 13px 8px; color: rgba(255,255,255,.32); font-size: 9px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}

.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 52px; margin: 3px 0; padding: 9px 11px;
  border: 1px solid transparent; border-radius: 14px;
  color: rgba(255,255,255,.6); cursor: pointer;
  transition: all 0.2s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.nav-item:hover {
  color: #fff; background: rgba(255,255,255,.06); transform: translateX(3px);
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(255, 107, 107, 0.28), rgba(255, 92, 168, 0.18), rgba(179, 136, 255, 0.12));
  border-color: rgba(255, 92, 168, 0.35);
  box-shadow: 0 8px 26px rgba(255, 92, 168, 0.2), inset 0 1px rgba(255,255,255,.1);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -5px; top: 50%; transform: translateY(-50%);
  width: 3.5px; height: 28px; border-radius: 3px;
  background: var(--grad-btn);
  box-shadow: 0 0 14px rgba(255, 92, 168, 0.9);
}
.nav-item .icon {
  width: 33px; height: 33px; flex: 0 0 33px; display: grid; place-items: center;
  border-radius: 11px; color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07);
  font-size: 12px; font-weight: 800; transition: all 0.2s;
}
.nav-item.active .icon {
  color: #fff; background: var(--grad-btn); border-color: transparent;
  box-shadow: 0 5px 16px rgba(255, 92, 168, 0.5), inset 0 1px rgba(255,255,255,.35);
}
.nav-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.nav-copy b { font-size: 12px; font-weight: 660; line-height: 1.42; overflow-wrap: anywhere; }
.nav-copy small { margin-top: 2px; color: rgba(255,255,255,.35); font-size: 9.5px; line-height: 1.35; overflow-wrap: anywhere; }
.nav-item.active .nav-copy small { color: #ffc2db; }
.nav-item.unavailable { opacity: .58; }
.nav-item.unavailable .icon { filter: grayscale(1); }
.nav-item.unavailable .nav-copy small { color: var(--err); }
.workflow-error { color: var(--err) !important; font-weight: 650; }

.sidebar-bottom { padding: 16px 5px 0; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-link { display: grid; grid-template-columns: 36px 1fr; align-items: center; padding: 10px; border-radius: 13px; transition: 0.2s; }
.sidebar-link:hover { background: rgba(255,255,255,.06); }
.sidebar-icon {
  grid-row: 1 / 3; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); font-size: 14px;
}
.sidebar-link > span:not(.sidebar-icon) { color: rgba(255,255,255,.85); font-size: 12px; font-weight: 680; }
.sidebar-link small { color: rgba(255,255,255,.38); font-size: 9.5px; }

/* ============ 主区域 ============ */
.main { min-width: 0; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  max-width: 1580px; margin: 0 auto; padding: 42px 40px 28px;
}
.eyebrow {
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
  color: var(--coral); font-size: 9.5px; font-weight: 850; letter-spacing: 0.22em; text-transform: uppercase;
}
.eyebrow span {
  width: 24px; height: 2.5px; border-radius: 3px;
  background: var(--grad-btn); box-shadow: 0 0 10px rgba(255, 92, 168, 0.5);
}
.topbar h1 {
  margin: 0; font-size: clamp(32px, 3.4vw, 46px); font-weight: 850;
  line-height: 1.1; letter-spacing: -0.03em;
  background: linear-gradient(115deg, #2b2135 15%, #6b4d8f 55%, #b06b9a 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar-sub { margin-top: 9px; color: var(--ink-2); font-size: 13px; letter-spacing: 0.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.active-task-chip {
  min-height: 40px; padding: 0 15px; color: #fff; background: var(--grad-btn);
  border: 0; border-radius: 999px; box-shadow: var(--sh-glow-pink); cursor: pointer;
  font-size: 10.5px; font-weight: 750; transition: .18s ease;
}
.active-task-chip:hover { transform: translateY(-1px); }
.active-task-chip.success { background: linear-gradient(120deg, #00c48c, #42dba7); box-shadow: 0 8px 24px rgba(0,196,140,.28); }
.active-task-chip.error { background: linear-gradient(120deg, #ff5c7a, #ff8a72); }

.connection-state {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 16px;
  color: var(--ink-2); background: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px; font-size: 11px; font-weight: 640;
  backdrop-filter: blur(14px); box-shadow: var(--sh-md);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #b8aec8; box-shadow: 0 0 0 4px rgba(184,174,200,.2); }
.dot.green { background: var(--ok); box-shadow: 0 0 0 4px rgba(0,196,140,.18), 0 0 12px rgba(0,196,140,.4); }
.mobile-workflow-picker { display: none; color: var(--ink-2); font-size: 10px; }

/* ============ 双栏内容 ============ */
.content {
  display: grid; grid-template-columns: minmax(430px, 0.9fr) minmax(520px, 1.1fr);
  align-items: start; gap: 24px;
  max-width: 1580px; margin: 0 auto; padding: 0 40px 36px;
}

/* 白色玻璃卡片 */
.panel {
  position: relative; min-width: 0; padding: 30px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  backdrop-filter: blur(20px);
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
.panel-left { animation-delay: 0.06s; }
.panel-right { position: sticky; top: 22px; animation-delay: 0.14s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* 卡片顶部彩虹发丝线 */
.panel::before {
  content: ''; position: absolute; top: 0; left: 6%; right: 6%; height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, var(--coral), var(--sunset), var(--pink), var(--violet), transparent);
  opacity: 0.8; pointer-events: none;
}

.panel-head { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.panel-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--ink-3); font-size: 10px; font-weight: 720; letter-spacing: 0.08em; }
.tag {
  display: inline-flex; align-items: center; height: 25px; padding: 0 11px;
  border-radius: 8px; font-size: 9px; font-weight: 850; letter-spacing: 0.12em;
}
.tag-blue {
  color: #fff; background: var(--grad-btn);
  box-shadow: 0 4px 14px rgba(255, 92, 168, 0.3), inset 0 1px rgba(255,255,255,.3);
}
.panel-title { margin: 0; font-size: 25px; font-weight: 800; line-height: 1.25; letter-spacing: -0.025em; }
.panel-desc { max-width: 580px; margin: 7px 0 0; color: var(--ink-2); font-size: 12.5px; }
.panel-head-right { display: flex; align-items: center; justify-content: space-between; }
.panel-head-right h3 { margin: 3px 0 0; font-size: 19px; letter-spacing: -0.015em; font-weight: 750; }
.panel-head-right h3 small { margin-left: 6px; color: var(--ink-3); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }
.preview-kicker { color: var(--pink); font-size: 8.5px; font-weight: 850; letter-spacing: 0.2em; }

/* ============ 表单 ============ */
.param-form { display: flex; flex-direction: column; gap: 24px; }
.form-section { display: flex; flex-direction: column; gap: 13px; }
.form-section-title { display: flex; align-items: center; gap: 10px; color: var(--ink-1); font-size: 12px; font-weight: 780; letter-spacing: 0.02em; }
.form-section-title::before {
  content: ''; width: 4px; height: 15px; border-radius: 4px;
  background: var(--grad-btn); box-shadow: 0 0 10px rgba(255, 92, 168, 0.4);
}
#promptFields, #uploadFields { display: grid; gap: 13px; }

.field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.field-label { color: var(--ink-2); font-size: 11px; font-weight: 660; letter-spacing: 0.02em; }
.field-hint { color: var(--ink-3); font-size: 10px; }
.field-row { min-width: 0; display: flex; align-items: center; gap: 8px; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 11px 14px;
  color: var(--ink-1); background: rgba(255,255,255,.65);
  border: 1.5px solid rgba(43,33,53,.09); border-radius: var(--r-md);
  font-size: 12.5px; transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(43,33,53,.03);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 107, 107, 0.35); background: #fff; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--coral);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(255, 107, 107, 0.14), 0 4px 18px rgba(255, 92, 168, 0.12);
}
input::placeholder, textarea::placeholder { color: #c0b5ce; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239d92ad' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.field-row input[type="number"] { max-width: none; }

.seed-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.btn-mini, .btn-secondary {
  min-height: 44px; padding: 0 16px; color: var(--ink-2);
  background: #fff; border: 1.5px solid rgba(43,33,53,.1); border-radius: var(--r-md);
  cursor: pointer; font-size: 11px; font-weight: 700; transition: all 0.2s;
  box-shadow: var(--sh-sm);
}
.btn-mini:hover, .btn-secondary:hover {
  color: #fff; border-color: transparent;
  background: var(--grad-btn);
  box-shadow: var(--sh-glow-pink);
  transform: translateY(-1px);
}

/* 上传卡片 */
.upload-card {
  position: relative; min-height: 90px; padding: 16px 17px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.04), rgba(179, 136, 255, 0.04));
  border: 1.5px dashed rgba(255, 107, 107, 0.35); border-radius: var(--r-lg);
  transition: all 0.22s ease;
}
.upload-card:hover {
  border-color: var(--coral);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(255, 92, 168, 0.06));
  box-shadow: 0 8px 28px rgba(255, 92, 168, 0.12);
}
.upload-card-head { margin-bottom: 9px; color: var(--ink-1); font-size: 11px; font-weight: 740; }
.upload-source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.upload-source-row .input-pick-btn, .input-pick-btn { min-height: 34px; padding: 0 10px; color: var(--pink); background: rgba(255,92,168,.08); border: 1px solid rgba(255,92,168,.22); border-radius: 8px; cursor: pointer; font-size: 9.5px; font-weight: 750; white-space: nowrap; }
.input-pick-btn:hover { color: #fff; background: var(--grad-btn); border-color: transparent; }
.upload-source-name { overflow: hidden; margin-top: 7px; color: var(--ink-3); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.upload-card.has-file .upload-source-name { color: var(--ok); font-weight: 650; }
.upload-card input[type="file"] { width: 100%; color: var(--ink-3); font-size: 10px; }
.upload-card input[type="file"]::file-selector-button {
  margin-right: 11px; padding: 8px 14px; color: #fff;
  background: var(--grad-btn); border: 0;
  border-radius: var(--r-sm); cursor: pointer; font-weight: 700; font-size: 10.5px;
  box-shadow: 0 3px 10px rgba(255, 92, 168, 0.3); transition: 0.18s;
}
.upload-card input[type="file"]::file-selector-button:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255, 92, 168, 0.45); }
.upload-preview { display: none; margin-top: 12px; }
.upload-preview.active { display: block; }
.upload-preview img, .upload-preview video, .upload-preview audio { display: block; max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--line-2); box-shadow: var(--sh-md); }
.upload-preview img, .upload-preview video { width: min(100%, 420px); height: auto; max-height: 260px; object-fit: contain; background: rgba(43,33,53,.05); }
.upload-preview audio { width: 100%; max-height: 54px; }

.workflow-notice { margin: -7px 0 22px; padding: 13px 15px; color: var(--ink-2); background: linear-gradient(135deg, rgba(255,107,107,.08), rgba(255,159,67,.07), rgba(179,136,255,.07)); border: 1px solid rgba(255,92,168,.18); border-radius: 12px; font-size: 11px; line-height: 1.65; }
.reference-guide { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; color: var(--ink-2); background: linear-gradient(135deg, rgba(255,107,107,.07), rgba(179,136,255,.07)); border: 1px solid rgba(255,92,168,.16); border-radius: 11px; font-size: 10px; }
.reference-guide b { flex: 0 0 auto; color: var(--coral); }

/* MiniMax H3 动态参考素材 */
.dynamic-upload-group { padding: 14px; background: linear-gradient(135deg, rgba(255,107,107,.04), rgba(179,136,255,.05)); border: 1.5px solid rgba(255,107,107,.18); border-radius: var(--r-lg); }
.dynamic-upload-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.dynamic-upload-head > div { display: flex; flex-direction: column; }
.dynamic-upload-head b { font-size: 11.5px; }
.dynamic-upload-head small { color: var(--ink-3); font-size: 9.5px; }
.dynamic-upload-list { display: grid; gap: 9px; }
.dynamic-upload-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 9px; min-height: 52px; padding: 8px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 11px; }
.reference-tag { padding: 7px 9px; color: #fff; background: var(--grad-btn); border: 0; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 750; box-shadow: 0 3px 10px rgba(255,92,168,.22); }
.reference-tag.static { cursor: default; background: linear-gradient(120deg, var(--violet), var(--indigo)); }
.dynamic-file { position: relative; display: flex; align-items: center; min-width: 0; cursor: pointer; }
.dynamic-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dynamic-file span { overflow: hidden; color: var(--ink-2); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.dynamic-upload-item.has-file .dynamic-file span { color: var(--ok); font-weight: 650; }
.dynamic-preview { grid-column: 1 / -1; }
.dynamic-preview:empty { display: none; }
.dynamic-preview img, .dynamic-preview video { display: block; width: min(100%, 300px); height: auto; max-height: 190px; aspect-ratio: 16 / 9; object-fit: contain; background: rgba(43,33,53,.05); border-radius: 9px; }
.dynamic-remove { width: 28px; height: 28px; color: var(--ink-3); background: rgba(43,33,53,.05); border: 0; border-radius: 8px; cursor: pointer; font-size: 17px; }
.dynamic-remove:hover { color: #fff; background: var(--err); }
.dynamic-add:disabled { opacity: .45; cursor: not-allowed; }

/* 高级参数折叠 */
details > summary {
  display: flex; align-items: center; justify-content: space-between; list-style: none;
  padding: 15px 17px; color: var(--ink-1);
  background: rgba(255,255,255,.6); border: 1.5px solid rgba(43,33,53,.08); border-radius: var(--r-md);
  cursor: pointer; font-size: 12px; font-weight: 740; transition: all 0.2s;
  box-shadow: var(--sh-sm);
}
details > summary::-webkit-details-marker { display: none; }
details > summary:hover { border-color: rgba(255,107,107,.3); background: #fff; }
details > summary::after {
  content: '+'; display: grid; place-items: center; width: 23px; height: 23px;
  color: #fff; background: var(--grad-btn);
  border-radius: 8px; font-size: 16px; font-weight: 400;
  box-shadow: 0 3px 10px rgba(255, 92, 168, 0.3);
}
details[open] > summary::after { content: '−'; }
details > summary small { margin-left: auto; margin-right: 13px; color: var(--ink-3); font-size: 9px; font-weight: 500; }
details > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; padding-top: 18px; }

.aspect-summary { padding: 13px 15px; color: var(--ink-2); background: rgba(255,255,255,.6); border: 1.5px solid rgba(43,33,53,.08); border-radius: var(--r-md); font-size: 11px; }

/* 主操作按钮 — 明艳渐变 + 发光 */
.form-actions {
  position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end;
  padding-top: 6px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.95) 40%);
}
.btn-primary {
  position: relative; overflow: hidden;
  min-height: 50px; padding: 0 34px; color: #fff;
  background: var(--grad-btn); border: 0; border-radius: 14px;
  cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: 0.08em;
  box-shadow: var(--sh-glow-btn), inset 0 1px rgba(255,255,255,.35);
  transition: all 0.22s ease;
}
.btn-primary::after {
  content: ''; position: absolute; top: 0; left: -80%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg); transition: left 0.55s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(255, 95, 109, 0.5), 0 0 60px rgba(255, 92, 168, 0.3), inset 0 1px rgba(255,255,255,.35); }
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ============ 状态标签 ============ */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em;
  border: 1.5px solid transparent; backdrop-filter: blur(8px);
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-pill.idle { color: var(--ink-3); background: rgba(43,33,53,.05); border-color: rgba(43,33,53,.08); }
.status-pill.running { color: #e8851a; background: rgba(255, 159, 67, 0.14); border-color: rgba(255, 159, 67, 0.35); }
.status-pill.running::before { animation: pulse 1.1s ease-in-out infinite; }
.status-pill.success { color: var(--ok); background: rgba(0, 196, 140, 0.12); border-color: rgba(0, 196, 140, 0.3); }
.status-pill.error { color: var(--err); background: rgba(255, 92, 122, 0.12); border-color: rgba(255, 92, 122, 0.3); }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* ============ 预览画布 — 明艳渐变 ============ */
.preview-stage {
  position: relative; min-height: 520px; display: grid; place-items: center; overflow: visible;
  background:
    radial-gradient(600px 340px at 50% 38%, rgba(255, 255, 255, 0.35), transparent 70%),
    radial-gradient(500px 300px at 50% 75%, rgba(255, 92, 168, 0.12), transparent 70%),
    linear-gradient(rgba(43,33,53,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,33,53,.03) 1px, transparent 1px),
    linear-gradient(145deg, #ffe8dd 0%, #ffd8e8 30%, #e8d8ff 65%, #d8e4ff 100%);
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
  border: 1.5px solid rgba(255, 92, 168, 0.22); border-radius: var(--r-lg);
  box-shadow: inset 0 0 90px rgba(255, 255, 255, 0.3), 0 14px 40px rgba(255, 92, 168, 0.12);
}
/* 四角取景框 */
.preview-stage::before, .preview-stage::after,
.preview-stage .corner-b::before, .preview-stage .corner-b::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  border-color: rgba(255, 92, 168, 0.55); border-style: solid; pointer-events: none;
}
.preview-stage::before { top: 15px; left: 15px; border-width: 2px 0 0 2px; border-top-left-radius: 5px; }
.preview-stage::after { top: 15px; right: 15px; border-width: 2px 2px 0 0; border-top-right-radius: 5px; }
.preview-stage .corner-b::before { bottom: 15px; left: 15px; border-width: 0 0 2px 2px; border-bottom-left-radius: 5px; }
.preview-stage .corner-b::after { bottom: 15px; right: 15px; border-width: 0 2px 2px 0; border-bottom-right-radius: 5px; }

.preview-empty { z-index: 1; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px; text-align: center; }
.preview-glyph {
  position: relative; width: 86px; height: 86px; margin-bottom: 8px;
  border-radius: 27px;
  background: var(--grad-btn);
  box-shadow: 0 18px 50px rgba(255, 92, 168, 0.4), inset 0 2px rgba(255,255,255,.35);
}
.preview-glyph::before {
  content: ''; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-left: 24px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent;
  filter: drop-shadow(0 2px 10px rgba(255,255,255,.5));
}
.preview-glyph::after {
  content: ''; position: absolute; inset: -16px; border-radius: 34px;
  border: 2px solid rgba(255, 92, 168, 0.3);
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.07); opacity: 0.4; } }
.preview-empty-title { color: var(--ink-1); font-size: 16px; font-weight: 780; letter-spacing: 0.01em; }
.preview-empty-sub { color: var(--ink-2); font-size: 11.5px; }

.preview-media { position: relative; z-index: 1; width: 100%; min-height: 520px; grid-template-rows: auto auto; gap: 12px; padding: 18px; }
.result-viewer { min-width: 0; display: grid; grid-template-rows: auto auto; overflow: visible; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.5); border-radius: var(--r-md); }
.result-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; color: var(--ink-1); background: rgba(255,255,255,.72); border-bottom: 1px solid rgba(43,33,53,.06); }
.result-viewer-head strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.result-viewer-head span { flex: 0 0 auto; color: var(--ink-3); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.result-viewer-body { min-height: 320px; max-height: 70vh; display: grid; place-items: center; overflow: hidden; padding: 12px; }
.result-viewer-body.audio-result { min-height: 150px; max-height: none; padding: 28px 36px; background: linear-gradient(135deg, rgba(255, 239, 239, .9), rgba(235, 230, 255, .9)); }
.result-primary-media { display: block; width: auto; height: auto; max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: var(--r-sm); box-shadow: var(--sh-lg); }
.result-viewer-body audio.result-primary-media { width: min(100%, 680px); height: 54px; box-shadow: none; accent-color: #ff6675; }
.result-thumbs { min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 9px; overflow-x: auto; padding: 2px 2px 5px; scroll-snap-type: x proximity; }
.result-thumb { min-width: 0; padding: 4px; display: grid; grid-template-rows: 70px auto; gap: 5px; color: var(--ink-2); cursor: pointer; scroll-snap-align: start; background: rgba(255,255,255,.62); border: 1.5px solid rgba(43,33,53,.08); border-radius: 8px; transition: .18s ease; }
.result-thumb:hover { border-color: rgba(255,92,168,.35); transform: translateY(-1px); }
.result-thumb.active { color: var(--pink); border-color: var(--pink); box-shadow: 0 5px 16px rgba(255,92,168,.18); }
.result-thumb-media { width: 100%; height: 70px; object-fit: cover; overflow: hidden; border-radius: 5px; background: rgba(43,33,53,.06); }
audio.result-thumb-media { object-fit: none; }
.result-thumb span { overflow: hidden; padding: 0 2px 2px; font-size: 8.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.preview-info { margin: 13px 2px 0; color: var(--ink-3); font-size: 10px; word-break: break-all; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.result-download { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* 真实任务状态：不展示估算百分比 */
.task-status-panel { align-items: center; gap: 12px; margin-top: 13px; padding: 14px 16px; background: rgba(255,255,255,.72); border: 1.5px solid rgba(43,33,53,.07); border-radius: var(--r-md); box-shadow: var(--sh-sm); }
.task-status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 5px rgba(255,159,67,.12); }
.task-status-content { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.task-status-content strong { color: var(--ink-1); font-size: 11.5px; }
.task-status-content small { color: var(--ink-3); font-size: 10px; }
.task-status-panel.submitting .task-status-dot, .task-status-panel.queued .task-status-dot, .task-status-panel.running .task-status-dot { animation: pulse 1.1s ease-in-out infinite; }
.task-status-panel.queued .task-status-dot { background: var(--sunset); }
.task-status-panel.running .task-status-dot { background: var(--pink); box-shadow: 0 0 0 5px rgba(255,92,168,.12); }
.task-status-panel.success .task-status-dot { background: var(--ok); box-shadow: 0 0 0 5px rgba(0,196,140,.12); animation: none; }
.task-status-panel.error .task-status-dot { background: var(--err); box-shadow: 0 0 0 5px rgba(255,92,122,.12); animation: none; }

/* 参数回显 */
.param-readout {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  overflow: hidden; margin-top: 15px;
  background: rgba(43,33,53,.07); border: 1.5px solid rgba(43,33,53,.07); border-radius: var(--r-md);
}
.param-readout:empty { display: none; }
.param-readout .kv { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 13px; background: rgba(255,255,255,.75); }
.param-readout .kv b { color: var(--ink-3); font-size: 8.5px; font-weight: 720; letter-spacing: 0.1em; text-transform: uppercase; }
.param-readout .kv span { overflow: hidden; color: var(--ink-1); font-size: 11px; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }

.muted-small { color: var(--ink-3); font-size: 10px; }
.input-picker-modal { width: min(720px, 94vw); }
.input-picker-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.input-picker-toolbar input { min-width: 0; min-height: 42px; padding: 0 12px; color: var(--ink-1); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 9px; outline: none; }
.input-picker-list { min-height: 120px; max-height: min(58vh, 520px); display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; overflow-y: auto; padding: 2px; }
.input-picker-item { min-width: 0; display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: 9px; padding: 7px; color: var(--ink-2); text-align: left; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.input-picker-item:hover { color: var(--pink); border-color: rgba(255,92,168,.45); background: #fff; }
.input-picker-thumb { width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; color: var(--violet); background: rgba(179,136,255,.12); border-radius: 7px; font-size: 8px; font-weight: 800; }
.input-picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.input-picker-name { min-width: 0; overflow: hidden; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.input-picker-error { color: var(--err); font-size: 10px; }
.footer-tip { margin: 14px 2px 0; }

/* ============ 历史作品 ============ */
.history { max-width: 1580px; margin: 0 auto; padding: 0 40px 56px; }
.history-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.history-head h2 { margin: 0; font-size: 18px; font-weight: 780; letter-spacing: -0.015em; }
.history-head small { color: var(--ink-3); font-size: 10px; }
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; }
.history-card {
  position: relative; overflow: hidden; background: rgba(255,255,255,.85); border: 1.5px solid rgba(255,255,255,.95);
  border-radius: var(--r-lg); cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: all 0.24s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.history-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 92, 168, 0.35);
  box-shadow: var(--sh-lg), 0 0 30px rgba(255, 92, 168, 0.14);
}
.history-thumb { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--ink-3); background: linear-gradient(145deg, #ffe8dd, #e8d8ff); font-size: 11px; }
.history-thumb img, .history-thumb video { width: 100%; height: 100%; object-fit: cover; }
.history-meta { display: flex; flex-direction: column; gap: 5px; padding: 12px 13px; }
.history-meta b { font-size: 11.5px; font-weight: 700; }
.history-meta span { color: var(--ink-3); font-size: 9px; }
.history-status { align-self: flex-start; padding: 3px 8px; border-radius: 6px; font-size: 8.5px; font-weight: 750; }
.history-status.queued { color: var(--ink-3); background: rgba(43,33,53,.07); }
.history-status.running { color: #e8851a; background: rgba(255, 159, 67, 0.16); }
.history-status.success { color: var(--ok); background: rgba(0, 196, 140, 0.14); }
.history-status.error { color: var(--err); background: rgba(255, 92, 122, 0.14); }
.history-delete { position: absolute; z-index: 2; top: 9px; right: 9px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-3); background: rgba(255,255,255,.88); border: 1px solid rgba(43,33,53,.1); border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.history-delete:hover { color: #fff; background: var(--err); border-color: transparent; }
.history-delete:disabled { opacity: .35; cursor: not-allowed; }
.history-detail { display: flex; flex-direction: column; gap: 14px; }
.history-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.history-detail-head > div:first-child { display: flex; align-items: center; gap: 9px; }
.history-detail-head small { color: var(--ink-3); font-size: 10px; }
.history-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.history-error { padding: 10px 12px; color: var(--err); background: rgba(255,92,122,.08); border-radius: 8px; font-size: 11px; }
.history-retention-note { margin: 0; color: var(--ink-3); font-size: 10px; line-height: 1.5; }
.history-output-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 9px; }
.history-output { min-width: 0; display: grid; grid-template-rows: auto 220px auto; gap: 7px; padding: 9px; background: rgba(43,33,53,.03); border: 1px solid var(--line); border-radius: 8px; }
.history-output strong { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.history-output img, .history-output video { width: 100%; height: 220px; object-fit: contain; border-radius: 6px; background: rgba(43,33,53,.05); }
.history-output audio { align-self: center; width: 100%; }
.history-output.history-audio-output { grid-template-rows: auto auto auto; align-content: center; min-height: 116px; }
.history-output.history-audio-output audio { height: 46px; border-radius: 10px; accent-color: #ff6675; }
.history-output small { overflow: hidden; color: var(--ink-3); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
#historyModal.single-media > .modal { width: min(94vw, 1000px); }
#historyModal.single-media .history-output-grid { display: flex; justify-content: center; }
#historyModal.single-media .history-output { width: fit-content; max-width: 100%; grid-template-rows: auto auto auto; }
#historyModal.single-media .history-output img, #historyModal.single-media .history-output video { width: auto; height: auto; max-width: min(88vw, 920px); max-height: 68vh; object-fit: contain; }
#historyModal.single-media .history-output small { max-width: min(88vw, 920px); }
#historyModal.single-media .history-retention-note { max-width: 100%; }
.media-zoomable { cursor: zoom-in; }
.media-zoomable:hover { filter: brightness(1.03); }
.btn-danger { display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; color: var(--err); background: rgba(255,92,122,.08); border: 1px solid rgba(255,92,122,.25); border-radius: 9px; cursor: pointer; font-size: 10.5px; font-weight: 700; }
.btn-danger:hover { color: #fff; background: var(--err); }
.media-lightbox { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 34px; background: rgba(24,15,36,.88); backdrop-filter: blur(10px); }
.media-lightbox-close { position: absolute; top: 16px; right: 18px; z-index: 1; width: 38px; height: 38px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 10px; cursor: pointer; font-size: 23px; line-height: 1; }
.media-lightbox-close:hover { background: var(--grad-btn); }
.media-lightbox-content { min-width: 0; min-height: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox-media { display: block; width: auto; height: auto; max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.media-lightbox-caption { max-width: 90vw; padding-top: 10px; color: rgba(255,255,255,.8); font-size: 11px; text-align: center; }

/* ============ 弹窗 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 20px;
  background: rgba(43, 25, 53, 0.5); backdrop-filter: blur(12px);
  animation: fadeIn 0.22s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(780px, 94vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.97);
  border: 1.5px solid rgba(255, 92, 168, 0.2); border-radius: 22px;
  box-shadow: 0 40px 120px rgba(43, 25, 53, 0.35), 0 0 80px rgba(255, 92, 168, 0.15);
  animation: popIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(12px); } }
.modal-lg { width: min(1000px, 94vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 780; }
.modal-close {
  width: 34px; height: 34px; color: var(--ink-2); background: rgba(43,33,53,.05);
  border: 0; border-radius: 10px; cursor: pointer; font-size: 19px; transition: 0.18s;
}
.modal-close:hover { color: #fff; background: var(--grad-btn); }
.modal-body { overflow-y: auto; padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }

/* 比例选择 */
.aspect-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.aspect-row label { color: var(--ink-2); font-size: 10.5px; font-weight: 740; letter-spacing: 0.05em; }
.aspect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.aspect-cell, .mp-cell {
  padding: 12px 10px; color: var(--ink-2);
  background: rgba(43,33,53,.03); border: 1.5px solid rgba(43,33,53,.08); border-radius: var(--r-md);
  text-align: center; cursor: pointer; font-size: 11px; transition: all 0.19s ease;
}
.aspect-cell:hover, .mp-cell:hover { border-color: rgba(255, 107, 107, 0.4); color: var(--ink-1); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.aspect-cell.active, .mp-cell.active {
  color: #fff; background: var(--grad-btn);
  border-color: transparent; font-weight: 750;
  box-shadow: var(--sh-glow-pink);
}
.aspect-cell .ratio-name { font-weight: 720; }
.aspect-cell .ratio-desc { display: block; margin-top: 3px; color: var(--ink-3); font-size: 8.5px; font-weight: 450; }
.aspect-cell.active .ratio-desc { color: rgba(255,255,255,.8); }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 9px; }
.preview-dim {
  padding: 15px; color: #fff; text-align: center;
  background: var(--grad-btn);
  border-radius: var(--r-md);
  font: 12.5px ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700;
  box-shadow: var(--sh-glow-pink);
}

/* Toast */
.toast {
  position: fixed; z-index: 100; bottom: 28px; left: 50%; transform: translateX(-50%);
  padding: 12px 22px; color: #fff;
  background: var(--grad-btn);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(255, 92, 168, 0.4), 0 4px 14px rgba(255, 107, 107, 0.3);
  font-size: 11.5px; font-weight: 700;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 18px) scale(0.94); } }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .app { grid-template-columns: 244px minmax(0, 1fr); }
  .content { grid-template-columns: 1fr; }
  .panel-right { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 26px 20px 20px; }
  .content { padding: 0 20px 30px; }
  .history { padding: 0 20px 40px; }
  .mobile-workflow-picker { display: flex; flex-direction: column; }
  .mobile-workflow-picker select { min-width: 210px; margin-top: 4px; }
}
@media (max-width: 620px) {
  .topbar { align-items: stretch; flex-direction: column; gap: 18px; }
  .topbar-right { align-items: stretch; flex-direction: column; }
  .topbar h1 { font-size: 30px; }
  .mobile-workflow-picker select { min-width: 0; }
  .content { padding-inline: 12px; }
  .panel { padding: 22px 18px; border-radius: 18px; }
  details > div { grid-template-columns: 1fr; }
  .preview-stage, .preview-media { min-height: 380px; }
  .preview-media { padding: 10px; }
  .result-viewer-body { min-height: 240px; height: auto; max-height: none; padding: 8px; }
  .result-primary-media { max-width: 100%; max-height: 62vh; }
  .result-thumbs { grid-auto-columns: 96px; }
  .result-thumb { grid-template-rows: 60px auto; }
  .result-thumb-media { height: 60px; }
  .history-detail-head { align-items: flex-start; flex-direction: column; }
  .history-detail-actions { width: 100%; }
  .dynamic-upload-item { grid-template-columns: auto minmax(0,1fr) auto; }
  .dynamic-upload-item .input-pick-btn { grid-column: 2; justify-self: start; }
  .dynamic-upload-item .dynamic-remove { grid-column: 3; grid-row: 1 / span 2; }
  .input-picker-list { grid-template-columns: 1fr; }
  .input-picker-toolbar { grid-template-columns: 1fr; }
  .history-detail-actions button { flex: 1; }
  .history-output-grid { grid-template-columns: 1fr; }
  .media-lightbox { padding: 22px 10px; }
  .media-lightbox-content { width: 96vw; height: 78vh; }
  .aspect-grid { grid-template-columns: repeat(2, 1fr); }
  .param-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history { padding-inline: 12px; }
}
