/* ==================== Design Tokens / CSS Variables ==================== */
:root {
  --bg-page: #0E1116;
  --bg-card: #181C23;
  --bg-input: #1E232C;
  --bg-hover: #252B35;
  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #4ADE80;
  --accent-dark: #22C55E;
  --accent-light: #1B3A28;
  --border: #2A3138;
  --border-light: #222830;
  --green: #4ADE80;
  --green-bg: #1B3A28;
  --blue: #60A5FA;
  --blue-bg: #1A2438;
  --purple: #A78BFA;
  --purple-bg: #231F38;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.15);
  --shadow-float: 0 4px 16px rgba(74,222,128,.25);
  --transition: .18s ease;
  /* —— 2026-09-29 全站昼夜统一新增：把原先散落各处的硬编码色收敛成变量，浅色模式才能整体反转 —— */
  --on-accent: #0E1116;              /* 绿/亮底按钮上的文字色（浅色模式反转为白字） */
  --hairline: rgba(255,255,255,.06); /* 极细分隔线/描边（原 .05/.06/.08 三种半透白归一） */
  --hairline-strong: rgba(255,255,255,.15);
  --icon-dim: #4B5563;               /* 弱化图标/hover 描边 */
  --dash: #3A4452;                   /* 虚线上传框描边 */
  --grad-a: #2A3040;                 /* 装饰渐变两端 */
  --grad-b: #1E232C;
}

/* ==================== 白天模式（html.light）====================
 * 2026-09-29 Zero 定：**全站统一 + 默认夜晚**。
 *   · 无 .light 类 = 夜晚（默认），与 0帧AI 引擎站 /engine/ 同一判定逻辑；
 *   · 只有用户在任一站点手动切到白天并存下 localStorage.theme='light' 才加 html.light；
 *   · 主站与引擎站同源共用该 key，切换整站同步（见 app.js 的 ensureTheme* / postMessage 同步）。
 * 这里只覆盖变量 + 少量「硬编码白/深色」组件补丁，正文样式一律走 var()。 */
html.light {
  --bg-page: #f4f6f5;
  --bg-card: #ffffff;
  --bg-input: #eef1f0;
  --bg-hover: #e4e9e6;
  --text-primary: #16201b;
  --text-secondary: #56605b;
  --text-muted: #8a938e;
  --accent: #2F9E54;          /* 白底 3.3:1 起；文字另用 --accent-text 级深绿 */
  --accent-dark: #1f7f42;
  --accent-light: #dff0e5;
  --border: #dde3e0;
  --border-light: #e7ebe9;
  --green: #2F9E54;
  --green-bg: #e3f3e8;
  --blue: #2563eb;
  --blue-bg: #e5edfd;
  --purple: #7c3aed;
  --purple-bg: #efe9fd;
  --on-accent: #ffffff;       /* 浅色模式 accent 变深绿 → 按钮文字转白才够对比度 */
  --hairline: rgba(0,0,0,.08);
  --hairline-strong: rgba(0,0,0,.16);
  --icon-dim: #6b746f;
  --dash: #b9c2bd;
  --grad-a: #e8efea;
  --grad-b: #d9e3dc;
  --shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 8px 28px rgba(0,0,0,.06);
  --shadow-float: 0 4px 16px rgba(47,158,84,.25);
}
/* 表单控件（下拉/日期）跟随：深色模式下是 dark，浅色必须切回 light，否则原生面板仍全黑 */
html.light select { color-scheme: light; }
html.light input, html.light textarea { color-scheme: light; }
/* 左侧「琴键」细条：三小格在深色下是半透白，白底上会隐形 → 反转为半透黑 */
html.light .engine-rail .rail-grip > span { background: rgba(0,0,0,.42); }

/* ---- 顶栏昼夜切换按钮（ensureThemeToggle() JS 注入，2026-09-29 全站统一） ----
 * 图标显隐走 CSS：夜晚（无 .light）显示月亮，白天显示太阳 —— 与引擎站 #themeToggle 同规则，
 * 这样即便 JS 晚一点注入也不会出现「图标闪一下再变」。 */
.zi-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.zi-theme-toggle:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); }
.zi-theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.zi-theme-toggle .zi-ico-sun { display: none; }
.zi-theme-toggle .zi-ico-moon { display: block; }
html.light .zi-theme-toggle .zi-ico-sun { display: block; }
html.light .zi-theme-toggle .zi-ico-moon { display: none; }

/* ==================== Reset & Base ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
select { font-family: inherit; color-scheme: dark; }
select option { background: var(--bg-card); color: var(--text-primary); }
::selection { background: rgba(74,222,128,.3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--dash); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--icon-dim); }

/* ==================== Left Sidebar (icon strip) ==================== */
.left-sidebar {
  position: fixed;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ls-btn {
  width: 44px; height: 50px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  color: var(--text-secondary);
  font-size: 9px;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.ls-btn:hover {
  color: var(--accent);
  box-shadow: 0 3px 12px rgba(74,222,128,.15);
  transform: translateY(-1px);
  border-color: var(--accent);
}
.ls-btn svg { width: 19px; height: 19px; }
.ls-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* ==================== Main Wrapper ==================== */
.main-wrapper {
  margin-left: 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== Top Navigation Bar ==================== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  background: transparent;
  gap: 24px;
}
.nav-left { flex-shrink: 0; }
.brand-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .3px;
}
/* Center Nav Links */
.nav-center {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--transition);
  padding: 3px 0;
}
.nav-link:hover { color: var(--accent); }
/* Right User Info */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.points-badge {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
}
.points-badge b { color: var(--accent); font-weight: 600; }
.user-email {
  font-size: 11.5px;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: none;
  transition: transform var(--transition);
  box-shadow: 0 2px 8px rgba(74,222,128,.3);
}
.user-avatar:hover { transform: scale(1.08); }

/* ==================== Panel Visibility ==================== */
.main-panel { display: none; flex: 1; }
.main-panel.active { display: block; }

/* ==================== Hero Section ==================== */
.hero-section {
  text-align: center;
  padding: 44px 24px 24px;
}
.hero-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: .5px;
}
.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 12px;
  line-height: 1.65;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 5px 22px;
  border-radius: 22px;
  border: 1px solid var(--border);
}
/* Hero 徽章改为「AI 服装设计引擎」按钮（底色 #9f02d2），由 app.js 的 ensureHeroEngineBtn() 加类。
   悬停/点击浮出 0帧AI 服装功能下拉菜单（15 项），点某项新标签直达对应功能。 */
.hero-badge.engine-btn {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: #9f02d2;
  border: 1px solid #9f02d2;
  padding: 7px 26px;
  border-radius: 999px;
  letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(159, 2, 210, .35);
  cursor: pointer;
  user-select: none;
  transition: box-shadow .18s ease, background .18s ease, transform .18s ease;
}
.hero-badge.engine-btn:hover,
.hero-badge.engine-btn.is-open {
  background: #b007e8;
  border-color: #b007e8;
  box-shadow: 0 6px 18px rgba(159, 2, 210, .5);
}
.hero-badge.engine-btn:hover { transform: translateY(-1px); }
.hero-badge.engine-btn.is-open { transform: none; }
.hero-badge.engine-btn::after { content: ' ▾'; font-size: 11px; opacity: .9; }
.hero-badge.engine-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ==================== 左侧「琴键」导航侧栏（0帧AI 15 项）2026-09-28 ====================
 * Zero 定：把原来「Hero 按钮正下方两列下拉卡片」改成**屏幕最左的竖排玻璃琴键侧栏**（macOS vibrancy 质感）。
 * 形态：默认收起为一条 13px 细玻璃条（命中区 30px）→ 悬停向右滑出完整面板；Hero 按钮点击可「钉住」。
 * ⚠️ .engine-rail 整体 pointer-events:none，只让细条与展开面板吃事件 —— 否则会挡住页面左侧一整条区域。
 */
.engine-rail {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 30px;                 /* 收起态命中区（可见玻璃条只有 13px） */
  z-index: 1100;               /* 高于 .left-sidebar(60)，远低于引擎浮层(99990) */
  pointer-events: none;
}

/* ---- 收起态：贴左的「琴键」细条 ----
 * 2026-09-28 Zero 定：琴键**底色改透明** —— 不再铺玻璃底、不加边框与投影，
 * 屏幕上只看得见三小格琴键本身，视觉更轻、更贴 macOS 极简。
 * 命中区仍是 30px 宽（见下面 .rail-grip），悬停灵敏度不变。 */
.engine-rail .rail-grip {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 220px;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  gap: 5px; padding-left: 5px;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity .2s ease;
}
.engine-rail .rail-grip::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 13px;
  border-radius: 0 12px 12px 0;
  background: transparent;   /* 琴键底色：透明（2026-09-28 Zero 定） */
  border: 0;
  box-shadow: none;
  transition: width .2s ease;
}
.engine-rail .rail-grip:hover::before { width: 15px; }  /* 悬停仍微微「探头」，纯位置暗示 */
.engine-rail .rail-grip > span {
  position: relative;
  width: 3px; height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .48);
  transition: background .18s ease, box-shadow .18s ease;
}
.engine-rail .rail-grip:hover > span {
  background: #d68bf5;
  box-shadow: 0 0 10px rgba(214, 139, 245, .55);
}

/* ---- 展开态：完整毛玻璃面板（macOS 抽屉曲线） ---- */
.engine-rail .rail-inner {
  position: absolute;
  left: 0; top: 50%;
  width: 250px;
  transform: translateY(-50%) translateX(-20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 0 20px 20px 0;
  /* 玻璃面板：半透明深底 + 顶部柔光；深色纯背景上也能有 macOS vibrancy 的层次 */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0) 78%, rgba(255, 255, 255, .04)),
    rgba(22, 26, 33, .58);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .12);
  border-left: 0;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .58), inset 0 1px 0 rgba(255, 255, 255, .12);
  padding: 12px 11px;
  max-height: 84vh;
  overflow-y: auto;
  transition: opacity .2s ease, transform .34s cubic-bezier(.32, .72, 0, 1);
}
.engine-rail.is-open .rail-grip { opacity: 0; pointer-events: none; }
.engine-rail.is-open .rail-inner {
  opacity: 1; pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* 面板头：0帧AI 标识 + 副标题 + 收起按钮 */
.engine-rail .rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.engine-rail .rail-brand {
  font-size: 12px; font-weight: 700; color: #fff;
  background: #9f02d2; border-radius: 6px;
  padding: 3px 8px; letter-spacing: .5px;
}
.engine-rail .rail-sub { flex: 1; font-size: 12px; color: var(--text-secondary); }
.engine-rail .rail-close {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.engine-rail .rail-close:hover { color: #fff; background: rgba(159, 2, 210, .55); border-color: rgba(214, 139, 245, .6); }

/* ---- 15 个琴键：等高等宽竖排，悬停泛紫并向右微推（像琴键被按下） ---- */
.engine-rail .engine-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.engine-rail .engine-menu-item {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 9px 0 11px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.engine-rail .engine-menu-item::before {
  /* 琴键左端那道亮条，悬停时点亮 */
  content: '';
  position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: rgba(255, 255, 255, .16);
  transition: background .16s ease;
}
.engine-rail .engine-menu-item:hover {
  background: rgba(159, 2, 210, .34);
  border-color: rgba(198, 109, 242, .55);
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(159, 2, 210, .35);
}
.engine-rail .engine-menu-item:hover::before { background: #d68bf5; }
/* 图标位：2026-09-28 起放的是**单色线性 SVG**（不再是 emoji）→ 尺寸/颜色由这里统一管 */
.engine-rail .engine-menu-item .emi-icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: var(--text-secondary);
  transition: color .16s ease;
}
.engine-rail .engine-menu-item .emi-icon svg { display: block; width: 15px; height: 15px; }
.engine-rail .engine-menu-item:hover .emi-icon { color: #e6afff; }
.engine-rail .engine-menu-item .emi-name { flex: 1; }
.engine-rail .engine-menu-item .emi-go { font-size: 11px; color: var(--text-muted); transition: color .16s ease; }
.engine-rail .engine-menu-item:hover .emi-go { color: #fff; }

.engine-rail .rail-foot {
  display: block;
  margin-top: 9px;
  padding: 8px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  font-size: 11.5px;
  color: var(--text-muted);
  text-decoration: none;
}
.engine-rail .rail-foot:hover { color: #d68bf5; }

/* 展开时把主站原有的「素材」图标条一起右推，避免被玻璃面板压住
 * （2026-09-28：「提示词」按钮已移进描述需求行，图标条只剩「素材」） */
.left-sidebar { transition: left .34s cubic-bezier(.32, .72, 0, 1); }
html.zi-rail-open .left-sidebar { left: 262px; }

@media (max-width: 900px) {
  .engine-rail .rail-inner { width: min(250px, 78vw); }
  html.zi-rail-open .left-sidebar { left: 10px; }   /* 窄屏不推：面板本来就盖住左侧 */
}

/* ==================== Mode Switcher ==================== */
.mode-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.ms-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 26px;
  border-radius: 26px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  position: relative;
  transition: all .25s;
  background: var(--bg-input);
  color: var(--text-muted);
}
.ms-btn.active {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  box-shadow: 0 3px 14px rgba(74,222,128,.3);
}
.ms-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-secondary); }
.ms-icon { font-size: 16px; }

/* ==================== Three Column Layout ==================== */
.three-col-layout {
  display: grid;
  grid-template-columns: 430px 430px 430px;
  gap: 24px;
  padding: 0 36px 24px;
  max-width: 1560px;
  margin: 0 auto;
  align-items: stretch;
  justify-content: center;
}

/* ---- Column Cards ---- */
.col-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.col-card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.col-card-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
/* 单图生成 - 参考图区域减少上下间距 */
.col-left .col-card-hint { margin-bottom: 6px; }

/* ═══ 列1：选择图片 ═══ */
.img-grid-23 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 1;
  align-content: start;
}
.ig-slot {
  aspect-ratio: 1;
  border: 1.5px dashed var(--dash);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-input);
  overflow: hidden;
  position: relative;
  transition: all .2s;
}
.ig-slot:hover { border-color: var(--accent); background: var(--bg-hover); }
.ig-slot.has-img.has-image-data { border-style: solid; border-color: var(--border); }
.ig-placeholder { display: flex; flex-direction: column; align-items: center; }
.ig-plus { font-size: 26px; color: var(--icon-dim); font-weight: 200; line-height: 1; }
.ig-placeholder em { font-size: 10.5px; font-style: normal; color: var(--text-muted); margin-top: 2px; }

/* 图片删除按钮 */
.ig-del-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239,68,68,.85);
  color: #fff;
  font-size: 11px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all .15s;
  line-height: 1;
  padding: 0;
}
.ig-del-btn:hover { background: #EF4444; transform: scale(1.1); }

.ig-slot img {
  width: 100%; height: 100%;
  object-fit: cover; position: absolute;
  top: 0; left: 0; border-radius: 11px;
}

/* 参考图通用操作按钮（预览/替换/删除） */
.ref-act-btn {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all .15s;
  line-height: 1;
  padding: 0;
  font-size: 11px;
  color: #fff;
  opacity: 0;
}
.ig-slot:hover .ref-act-btn,
.bc-slot:hover .ref-act-btn,
.vgref-slot:hover .ref-act-btn,
.omni-ref-slot:hover .ref-act-btn { opacity: 1; }

.ref-preview-btn { top: 5px; left: 5px; background: rgba(0,0,0,.55); }
.ref-preview-btn:hover { background: var(--accent); transform: scale(1.1); }
.ref-replace-btn { bottom: 5px; right: 5px; background: rgba(0,0,0,.55); }
.ref-replace-btn:hover { background: #3B82F6; transform: scale(1.1); }

/* 拖拽状态 */
.ig-slot.dragging, .bc-slot.dragging, .vgref-slot.dragging, .omni-ref-slot.dragging {
  opacity: .4;
  transform: scale(.95);
}
.ig-slot.drag-over, .bc-slot.drag-over, .vgref-slot.drag-over, .omni-ref-slot.drag-over {
  border-color: var(--accent) !important;
  border-style: dashed !important;
  background: var(--accent-light) !important;
  box-shadow: 0 0 0 2px rgba(74,222,128,.25);
}

/* Upload Status Bar */
.upload-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border-light);
}
.usb-count { font-size: 12.5px; color: var(--text-muted); flex: 1; }
.usb-more {
  font-size: 12.5px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.usb-more:hover { text-decoration: underline; }
.btn-clear-upload {
  padding: 4px 16px;
  background: #EF4444;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-clear-upload:hover { opacity: .85; }

/* ═══ 列2：AI 模型选择 ═══ */
.model-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
/* 2 列网格：模型数为奇数时，末尾那个只占左半格。
   若沿用 flex:1，单按钮会撑满整行，视觉上变成第二条长条，削弱长条的区分度 */
.model-row:not(.model-row-wide) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* 长条行：整行只放一个模型（如 Image 2.5 Sunburst），内容居中铺满 */
.model-row-wide .model-sel-btn {
  flex: 1 1 100%;
  justify-content: center;
}
.model-sel-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  cursor: pointer;
  transition: all .2s;
  position: relative;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
}
.model-sel-btn small { font-size: 10px; color: var(--text-muted); margin-left: 2px; }
.model-sel-btn:hover { border-color: var(--icon-dim); background: var(--bg-hover); }
.model-sel-btn.active {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(74,222,128,.25);
}

/* Unavailable badge for Gemini models */

/* Model info tooltip — glassmorphism popup */
.m-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--hairline);
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  cursor: help;
  color: var(--text-secondary);
  flex-shrink: 0;
  position: relative;
  transition: all .2s;
}
.m-info:hover {
  background: rgba(74,222,128,0.2);
  color: #4ADE80;
}
.m-info:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(14,17,22,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(74,222,128,0.35);
  color: #4ADE80;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.model-sel-btn.active .m-info {
  background: rgba(14,17,22,.25);
  color: var(--on-accent);
}
.model-sel-btn.active .m-info:hover {
  background: rgba(14,17,22,.35);
  color: var(--on-accent);
}
.model-sel-btn.active .m-info:hover::after {
  color: var(--text-primary);
  border-color: rgba(14,17,22,0.4);
  background: rgba(14,17,22,0.85);
}

/* Size Section */
.size-section { margin: 16px 0 14px; }
.ss-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.ratio-btn {
  padding: 8px 0;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-input);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.ratio-btn:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.ratio-btn.active {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(74,222,128,.2);
}

/* Resolution & Count Row */
.res-count-row {
  display: flex;
  gap: 12px;
  margin: 14px 0;
}
.rc-field {
  flex: 1;
  display: flex; flex-direction: column; gap: 5px;
}
.rc-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.rc-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}
.rc-field select:focus { border-color: var(--accent); }

/* Prompt Area */
.prompt-area { margin: 14px 0; position: relative; }
.pa-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.pa-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ai-assist-chip {
  font-size: 11px;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 2px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  border: 1px solid #2A3850;
  transition: background .15s;
}
.ai-assist-chip:hover { background: #2A3850; }
/* 提示词备忘录入口（2026-09-28：从左侧图标条移到「描述需求」行，与「🌐 翻译」并排） */
.prompt-lib-chip { white-space: nowrap; }
.pa-expand-link {
  font-size: 11px;
  color: #f59e0b;
  cursor: pointer;
  margin-left: auto;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  transition: all .2s;
  white-space: nowrap;
}
.pa-expand-link:hover {
  background: rgba(245,158,11,0.22);
  border-color: rgba(245,158,11,0.5);
  text-decoration: none;
}
.prompt-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-primary);
  background: var(--bg-input);
  resize: vertical;
  min-height: 250px;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color .2s;
}
.prompt-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,222,128,.08);
}
.prompt-textarea::placeholder { color: var(--text-muted); }
/* 限制说明 */
.limit-info {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  max-height: 260px;
  overflow-y: auto;
}
/* 限制说明 —— 悬停浮层态：absolute 不占文档流，展开时下方内容不会被顶下去 */
.limit-info.is-pop {
  position: absolute;
  left: 8px;
  right: 8px;
  width: auto;
  margin-top: 0;
  max-height: min(300px, 52vh);
  z-index: 90;
  background: rgba(23, 18, 8, 0.97);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  animation: limitPopIn 0.14s ease-out;
}
@keyframes limitPopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.limit-title {
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 6px;
}
.limit-desc {
  font-size: 11.5px;
  color: #ef4444;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(239,68,68,0.08);
  border-radius: 6px;
  line-height: 1.6;
}
.limit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.limit-list li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 11.5px;
}
.limit-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #f59e0b;
  font-weight: 700;
}

/* ═══ 列3：编辑结果 ═══ */
.result-preview {
  flex: 1;
  min-height: 400px;
  border-radius: 14px;
  overflow: hidden;
  background: #1F252D;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  position: relative;
}
/* 撑满预览区并垂直居中，使内部进度条能按百分比正确伸缩 */
.rp-placeholder {
  color: var(--icon-dim);
  width: 100%;
  padding: 0 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
#s3ResultImg {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

/* 预览区左右箭头导航 */
.rp-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(24,28,35,.85);
  color: var(--text-secondary);
  font-size: 13px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all .2s;
  padding: 0;
  line-height: 1;
}
.rp-nav:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); box-shadow: 0 2px 8px rgba(74,222,128,.1); }
.rp-nav-prev { left: 10px; }
.rp-nav-next { right: 10px; }
.rp-nav-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  color: var(--text-primary);
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 12px;
  pointer-events: none;
  z-index: 5;
}

/* Action Buttons */
.action-row { display: flex; gap: 8px; margin-top: 10px; }
.act-btn {
  padding: 9px 8px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  flex: 1;
}
.act-btn:hover { background: var(--bg-hover); border-color: var(--icon-dim); }
.act-download {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
}
.act-download:hover { box-shadow: 0 2px 8px rgba(74,222,128,.3); }
.act-sm { font-size: 11.5px; flex: 1; }
/* 新内容数字提醒（导航条红点） */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
/* 列表内「NEW」标记 */
.new-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .3px;
  vertical-align: middle;
}
.hist-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #F59E0B;
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

/* 开始编辑按钮 */
.btn-start-edit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  transition: all .25s;
  box-shadow: 0 3px 12px rgba(74,222,128,.22);
}
.btn-start-edit:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(74,222,128,.35);
}
.btn-start-edit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* 底部提示文字 */
.result-tip {
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--accent-light);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--accent);
  text-align: center;
}

/* ==================== Stats Bar ==================== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 72px;
  padding: 44px 24px 24px;
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #4ADE80, #22C55E);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 14px; color: var(--text-muted); margin-top: 6px; }

/* ==================== Footer ==================== */
.page-footer {
  text-align: center;
  padding: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
/* 游客态顶部「登录 / 注册」入口（renderAuthNav 注入） */
.nav-right .guest-auth-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 2px;
}
.nav-right .guest-auth-btn:hover { text-decoration: underline; }
.nav-right .guest-auth-sep { color: var(--text-muted); font-size: 12px; margin: 0 2px; }
/* 登录框顶部提示条：「XX 需要先登录 / 注册」 */
.auth-notice {
  display: none;
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(74, 222, 128, .12);
  color: var(--accent);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

/* 页脚 ICP 备案号（JS 注入，排在版权行下方） */
.page-footer .icp-beian {
  margin-top: 6px;
  letter-spacing: .3px;
}
/* 备案号链接（2026-09-28 起可点击跳工信部备案系统）：平时与页脚同色，hover 走站点强调色 + 下划线 */
.page-footer .icp-beian a {
  color: inherit;
  text-decoration: none;
  transition: color .16s ease;
}
.page-footer .icp-beian a:hover,
.page-footer .icp-beian a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* ==================== FAB Up Button ==================== */
.fab-up {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 400;
  border: none;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.fab-up:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(74,222,128,.4); }

/* ==================== Modals ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
/* 临时素材弹窗 & 提示词备忘录弹窗：靠左显示，不居中 */
#tempMaterialModal,
#promptLibModal {
  justify-content: flex-start;
  padding-left: 24px;
}
/* 临时素材改为「非模态浮层」：遮罩不拦截鼠标、不压暗页面，
   这样背后的生图区依然可见可操作，素材卡片能直接拖到参考图槽位 */
#tempMaterialModal {
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
  align-items: flex-start;
  padding-top: 24px;
}
#tempMaterialModal .temp-material-panel {
  pointer-events: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
/* 素材说明文案 */
.temp-material-tip {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 6px 0 10px;
  line-height: 1.5;
}
.temp-material-tip::before {
  content: '🕒 ';
}
/* Auth gate: blocks all interaction until logged in */
.modal-overlay.auth-gate {
  z-index: 9999;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  border: 1px solid var(--border);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.recent-updates-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Update Log */
.update-log-box { max-width: 560px; }
.update-list { margin: 16px 0; }
.update-item {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-input);
}
.update-tag { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; margin-right: 8px; }
.update-tag.new { background: var(--green-bg); color: var(--green); }
.update-time { font-size: 11px; color: var(--text-muted); }
.update-item h3 { font-size: 14px; margin: 6px 0; color: var(--text-primary); }
.update-item p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.announcement-item {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-input);
}
.announcement-item h3 { font-size: 15px; margin: 0 0 8px; color: var(--text-primary); }
.announcement-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 0 0 8px; }
.announcement-time { font-size: 11px; color: var(--text-muted); }
.modal-footer { text-align: center; margin-top: 16px; }
.btn-primary {
  padding: 10px 24px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
}
.btn-primary:hover { background: var(--accent-dark); }

/* Buy Box */
.buy-box { max-width: 820px; }
.package-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0;
}
.package-card {
  text-align: center;
  padding: 20px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
}
.package-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.package-card.selected { border-color: var(--accent); background: var(--accent-light); }
.package-card.popular {
  border-color: rgba(79, 70, 229, 0.5);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(79, 70, 229, 0.02));
}
.package-card.premium {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02));
}
.package-badge {
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: inline-block;
  font-weight: 600;
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.popular-badge { background: #4f46e5; color: #fff; }
.value-badge { background: #F59E0B; color: #fff; }
.pkg-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.package-price { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.pkg-desc { font-size: 12px; color: var(--text-secondary); margin-top: 6px; min-height: 32px; }
.pkg-divider { height: 1px; background: var(--border); margin: 12px 0; }
.pkg-features { flex: 1; text-align: left; }
.pkg-feat { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; padding-left: 18px; position: relative; }
.pkg-feat::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-size: 12px; }
.pkg-feat strong { color: var(--text-primary); font-weight: 600; }
.pay-notice {
  font-size: 12px;
  color: #F59E0B;
  background: #2A2418;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex; align-items: flex-start; gap: 6px;
  margin: 12px 0;
}
.notice-icon { font-size: 14px; }
.btn-pay {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--on-accent);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
}
.btn-pay:hover { opacity: .9; }
.custom-points { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* AI Assist Modal */
.ai-assist-box { max-width: 480px; }
.ai-assist-body { display: flex; flex-direction: column; gap: 12px; }
.ai-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  resize: vertical;
}
/* AI 助手 · 图片上传（2026-09-18）——DOM 由 app.js 注入，样式集中在这里 */
.ai-attach { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ai-attach-btn {
  padding: 6px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.ai-attach-btn:hover { border-color: var(--accent); color: var(--accent); }
.ai-attach-hint { font-size: 11.5px; color: var(--text-secondary); }
.ai-attach-preview {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
}
.ai-attach-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-attach-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
}

.ai-model-select { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.ai-model-select select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
}
.ai-result {
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.ai-assist-actions { display: flex; gap: 8px; }
.btn-secondary {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--bg-hover); }

/* Prompt Lib Modal */
.prompt-lib-box {
  max-width: 640px;
  width: 640px;
  min-width: 420px;
  min-height: 460px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  resize: both;          /* 支持拖拽右下角拉大拉小 */
}
/* 放大模式：占满视口大部分区域 */
.prompt-lib-box.large {
  width: 92vw;
  max-width: 1200px;
  height: 88vh;
}
.prompt-lib-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 16px;
}
.prompt-lib-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prompt-size-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 15px;
  transition: var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
}
.prompt-size-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.prompt-memo-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.prompt-memo-input {
  flex: 1;
  min-height: 72px;
  max-height: 140px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  background: var(--bg-input);
  color: var(--text-primary);
  resize: vertical;
}
.prompt-memo-input:focus {
  outline: none;
  border-color: var(--accent);
}
.prompt-memo-input-wrap .prompt-memo-new {
  align-self: stretch;
  min-width: 64px;
}
.prompt-memo-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.prompt-search {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
}
.prompt-memo-new {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.prompt-memo-new:hover { opacity: .85; }
.prompt-memo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}
/* 放大模式下网格更高更宽 */
.prompt-lib-box.large .prompt-memo-grid {
  max-height: none;
  grid-template-columns: repeat(3, 1fr);
}
.prompt-memo-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.prompt-memo-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.prompt-memo-card.cat-portrait { border-left-color: #8b5cf6; }
.prompt-memo-card.cat-landscape { border-left-color: #10b981; }
.prompt-memo-card.cat-style { border-left-color: #f59e0b; }
.prompt-memo-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompt-memo-preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.prompt-memo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.prompt-memo-cat {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--border);
  font-size: 10px;
}
.prompt-memo-actions {
  display: flex;
  gap: 4px;
}
.prompt-memo-act {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: var(--transition);
}
.prompt-memo-act:hover { background: var(--border); color: var(--text-primary); }
.prompt-memo-act.del:hover { color: #ef4444; }
.no-prompts { text-align: center; color: var(--text-muted); padding: 40px; font-size: 13px; grid-column: 1 / -1; }
.prompt-lib-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
}
.prompt-count { color: var(--text-muted); }

/* ==================== Temp Material ==================== */
.temp-material-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 420px;
  min-width: 380px;
  min-height: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  border: 1px solid var(--border);
  resize: both;          /* 支持拖拽右下角拉大拉小 */
}
/* 放大模式：占满视口大部分区域 */
.temp-material-panel.large {
  width: 86vw;
  max-width: 1200px;
  height: 88vh;
}
.temp-material-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.help-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 11px;
  cursor: help;
  margin-left: 4px;
}
.temp-material-section { margin-bottom: 12px; flex: 1; display: flex; flex-direction: column; }
.temp-material-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.temp-material-label span { color: var(--text-muted); font-size: 12px; }
.temp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 1; align-content: start; }
.temp-add-btn {
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
}
.temp-add-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 拖拽排序：拖拽中半透明 + 目标位高亮 */
.temp-add-btn.dragging { opacity: .4; }
.temp-add-btn.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.05);
  z-index: 2;
}
/* 外部图片文件拖入：整个网格高亮 */
.temp-grid.file-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
}
.temp-grid.file-over .temp-add-btn {
  border-style: dashed;
  border-color: var(--accent);
}
.temp-material-actions { margin: 12px 0; }
.temp-material-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.temp-material-footer { text-align: right; }

/* ==================== Image Preview ==================== */
.image-preview-box {
  max-width: 85vw;
  max-height: 80vh;
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}
.image-preview-box img {
  max-width: 85vw;
  max-height: 70vh;
  display: block;
}
.preview-close {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,.5);
  color: #fff;
}
.preview-actions { padding: 12px; display: flex; justify-content: center; }

/* ==================== Batch Panel (Redesigned) ==================== */

/* --- 统一设置区域 --- */
.bus-section {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 22px 28px;
  margin: 20px auto 0;
  max-width: 1290px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
}
.bus-header {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.bus-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 18px;
}
.bus-controls {
  display: flex; align-items: flex-end; gap: 18px;
  flex-wrap: wrap;
}
.bus-field {
  display: flex; flex-direction: column; gap: 5px;
  min-width: 120px;
}
.bus-field label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.bus-field select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  min-width: 140px;
}
.bus-field select:focus { border-color: var(--accent); }
.btn-bus-apply {
  padding: 10px 22px;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 2px 10px rgba(74,222,128,.2);
}
.btn-bus-apply:hover { opacity: .92; transform: translateY(-1px); }
.bus-cost-row {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.bus-cost-item {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- 批量操作栏（已并入统一设置框内） --- */
.bus-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.bus-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}


.bar-stat { font-size: 14px; color: var(--text-muted); }
.bar-stat strong { color: var(--accent); font-weight: 700; }
.bar-sep { color: var(--icon-dim); font-size: 14px; }
.bus-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.bar-btn {
  padding: 9px 18px;
  font-size: 12.5px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.35;
}
.bar-btn:hover { border-color: var(--icon-dim); color: var(--text-primary); background: var(--bg-hover); }
.bar-btn.bar-danger { color: #EF4444; border-color: #3A2025; background: #2A1518; }
.bar-btn.bar-danger:hover { background: #3A2025; border-color: #4A2530; }
.bar-btn.bar-primary {
  color: var(--on-accent); border-color: transparent;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(74,222,128,.2);
}
.bar-btn.bar-primary:hover { opacity: .88; }
.bar-btn.bar-dark {
  color: #fff; border-color: transparent;
  background: var(--icon-dim);
}

/* --- 任务卡片网格 --- */
.bc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 20px 0 0;
  max-width: 1290px;
  margin: 0 auto;
}

/* 单个任务卡片 */
.bc-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
  border: 1px solid var(--hairline);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.bc-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.4); }

/* 卡片头部 */
.bc-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bc-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.bc-head-right { display: flex; align-items: center; gap: 7px; }
.bc-badge {
  font-size: 11.5px; padding: 3px 10px; border-radius: 11px;
  background: var(--purple-bg); color: var(--purple); font-weight: 600;
}
.bc-detail-link {
  font-size: 12.5px; color: var(--text-muted); cursor: pointer;
  background: none; border: none; padding: 0;
  font-family: inherit; text-decoration: none;
}
.bc-detail-link:hover { color: var(--accent); text-decoration: underline; }
.bc-close-btn {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--icon-dim); font-size: 13px;
  background: transparent; border: none; cursor: pointer;
  transition: all .15s;
}
.bc-close-btn:hover { background: #2A1518; color: #EF4444; }

/* 图片+预览区（卡片上半部分） */
.bc-top {
  display: flex; gap: 14px; margin-bottom: 14px;
}
.bc-img-col {
  flex: 1;
  min-width: 0;
}
.bc-img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
}
.bc-slot {
  aspect-ratio: 1;
  border: 1.5px dashed var(--dash);
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: .18s ease; background: var(--bg-input);
  overflow: hidden; position: relative;
  min-height: 56px;
}
.bc-slot:hover { border-color: var(--accent); background: var(--accent-light); }
.bc-slot .bc-plus { font-size: 18px; color: var(--icon-dim); line-height: 1; font-weight: 300; }
.bc-slot .bc-slabel { font-size: 10.5px; color: var(--icon-dim); margin-top: 1px; white-space: nowrap; transform: scale(.88); }
.bc-slot.filled { border-style: solid; border-color: var(--border); padding: 0; }
.bc-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; top:0; left:0; border-radius: 7px; }

.bc-upload-hint {
  font-size: 12px;
  color: var(--accent);
  text-align: left;
  margin-top: 6px;
  font-weight: 500;
}

/* 右侧预览区 */
.bc-prev-col {
  width: 100px; flex-shrink: 0;
}
.bc-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-input);
  overflow: hidden; position: relative;
}
.bc-preview img { width: 100%; height: 100%; object-fit: contain; }
.bc-prev-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bc-prev-icon { color: var(--icon-dim); }
.bc-prev-text { font-size: 11px; color: var(--icon-dim); text-align: center; line-height: 1.3; }

/* 批量错误显示 */
.bc-prev-error { gap: 8px; padding: 12px; }
.bc-error-icon { font-size: 28px; }
.bc-error-text { font-size: 12px; color: #EF4444; text-align: center; line-height: 1.4; max-width: 160px; word-break: break-word; }

/* 批量结果放大提示图标 */
.bc-zoom-hint {
  position: absolute;
  top: 5px; right: 5px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all .2s;
  border: 1px solid var(--hairline-strong);
}
.bc-zoom-hint:hover { background: rgba(74,222,128,.85); transform: scale(1.1); }

/* 提示词区 */
.bc-prompt-area { margin-bottom: 10px; }
.bc-prompt-ta {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  resize: vertical;
  min-height: 60px;
  line-height: 1.58;
  transition: border-color .2s;
}
.bc-prompt-ta:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,222,128,.06);
}
.bc-prompt-ta::placeholder { color: var(--text-muted); }
.bc-prompt-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
  gap: 10px;
}
.bc-assist-group { display: flex; align-items: center; gap: 6px; }
.bc-assist-group .ai-assist-chip { font-size: 11px; padding: 2px 8px; }
.bc-prompt-footer a { font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: none; }
.bc-prompt-footer a:hover { text-decoration: underline; }
.bc-char-count { font-size: 12px; color: var(--text-muted); }

/* 底部工具栏 */
.bc-toolbar {
  display: flex; align-items: center; gap: 7px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.bc-tool-select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  min-width: 58px;
}
.bc-tool-select:focus { border-color: var(--accent); }
.bc-cost-tag {
  font-size: 12px; padding: 4px 10px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 6px; font-weight: 700;
  white-space: nowrap;
}
.bc-tbtn {
  padding: 6px 12px; font-size: 12.5px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--bg-input); color: var(--text-muted); cursor: pointer;
  transition: all .15s; font-family: inherit;
  display: flex; align-items: center; gap: 4px;
}
.bc-tbtn:hover { border-color: var(--icon-dim); color: var(--text-secondary); }
.bc-tbtn-gen {
  padding: 8px 20px; font-size: 12.5px;
  background: var(--dash); color: #fff; border-color: transparent; font-weight: 500;
  min-width: 90px; justify-content: center;
}
.bc-tbtn-gen.ready {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  box-shadow: 0 2px 6px rgba(74,222,128,.15);
}
.bc-tbtn-gen.ready:hover { opacity: .88; }
.bc-tbtn-gen:disabled { opacity: .45; cursor: not-allowed; }
.bc-tbtn-icon {
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
  border-radius: 7px;
}
.bc-tbtn-icon:hover { color: var(--text-secondary); border-color: var(--icon-dim); background: var(--bg-hover); }
.bc-tbtn-icon.danger:hover { color: #EF4444; background: #2A1518; border-color: #3A2025; }

/* 新增任务行 */
.bc-add-row { text-align: center; padding: 28px 0 40px; }
.btn-bc-add {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 42px;
  border: 2px dashed var(--dash);
  border-radius: 24px;
  background: transparent;
  color: var(--text-muted); font-size: 14.5px;
  cursor: pointer; transition: all .2s; font-family: inherit; font-weight: 500;
}
.btn-bc-add small { font-size: 12.5px; font-weight: normal; color: var(--text-muted); }
.btn-bc-add:hover { border-color: var(--accent); color: var(--accent); }

/* ==================== Video Panel (Screenshot-Matched) ==================== */
.video-layout {
  display: grid;
  grid-template-columns: 416px 322px 378px 378px;
  gap: 18px;
  padding: 20px 32px 36px;
  align-items: stretch;
  justify-content: center;
}

/* ─── 通用列卡片样式 ─── */
.vcol {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.vcol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.vcol-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.vcol-icon { font-size: 17px; }
.vcol-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══ 列1：视频生成 ═══ */
.vcol-generate { }

/* 散射任务 badge 按钮 */
.vcol-badge-btn {
  padding: 4px 13px;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border: none;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: .3px;
  box-shadow: 0 2px 8px rgba(74,222,128,.2);
}
.vcol-badge-btn:hover { opacity: .9; }

/* 模型切换 tabs */
.vg-model-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 4px;
}
.vgmt {
  flex: 1;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-align: center;
}
.vgmt.active {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  box-shadow: 0 2px 8px rgba(74,222,128,.25);
}
.vg-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* 子模式按钮（参数模式 / 视频编辑）*/
.vg-sub-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.vgst {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all .15s;
  text-align: center;
}
.vgst.active {
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border-color: transparent;
}
.vgst:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* 提示词区 */
.vg-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
  margin-bottom: 6px;
}
.vg-link {
  font-size: 11.5px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.vg-link:hover { text-decoration: underline; }
.vg-prompt-ta {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  resize: vertical;
  min-height: 80px;
  line-height: 1.65;
  transition: border-color .2s;
  margin-bottom: 4px;
}
.vg-prompt-ta:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,222,128,.06);
}
.vg-prompt-ta::placeholder { color: var(--text-muted); }

/* 参考图网格 3×2 */
.vg-ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.vgref-slot {
  aspect-ratio: 1;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  background: var(--bg-input);
  transition: all .18s;
  overflow: hidden;
  position: relative;
  min-height: 56px;
}
.vgref-slot:hover { border-color: var(--accent); background: var(--accent-light); }
.vgref-slot span { font-size: 18px; color: var(--icon-dim); line-height: 1; font-weight: 300; }
.vgref-slot em { font-size: 10.5px; font-style: normal; color: var(--text-muted); transform: scale(.88); }
.vgref-slot.filled { border-style: solid; border-color: var(--border); padding: 0; }
.vgref-slot img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }

.vg-ref-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* Omni 操作按钮行 */
.vg-actions-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.vg-act-btn {
  font-size: 11.5px;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.vg-act-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.vg-act-btn.vg-act-primary {
  background: rgba(74,222,128,0.1);
  border-color: rgba(74,222,128,0.3);
  color: var(--accent);
}
.vg-act-btn.vg-act-primary:hover {
  background: rgba(74,222,128,0.18);
}

/* Omni 源视频上传 */
.vg-source-upload {
  border: 1.5px dashed var(--dash);
  border-radius: 12px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all .2s;
  padding: 28px 20px;
  text-align: center;
}
.vg-source-upload:hover { border-color: var(--accent); background: var(--bg-hover); }
.vgsu-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.vgsu-plus {
  font-size: 28px; color: var(--icon-dim); font-weight: 200; line-height: 1;
}
.vgsu-label {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.vgsu-desc {
  font-size: 12px; color: var(--text-muted);
}
.vgsu-meta {
  font-size: 11px; color: var(--icon-dim);
  margin-top: 4px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}

/* Omni 参考图网格（2列） */
.omni-ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.omni-ref-slot {
  aspect-ratio: 1;
  border: 1.5px dashed var(--dash);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-input);
  transition: all .2s;
  gap: 4px;
  overflow: hidden;
  position: relative;
}
.omni-ref-slot:hover { border-color: var(--accent); background: var(--bg-hover); }
.omni-ref-slot span {
  font-size: 24px; color: var(--icon-dim); font-weight: 200; line-height: 1;
}
.omni-ref-slot em {
  font-size: 11.5px; color: var(--text-muted); font-style: normal;
}
.omni-ref-slot small {
  font-size: 10.5px; color: var(--icon-dim);
}
.omni-ref-slot.filled { border-style: solid; border-color: var(--border); padding: 0; }
.omni-ref-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; border-radius: 11px; }

/* 参数区提示文本 */
.vp-hint-text {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* XAI 源视频 URL 输入 */
.vg-url-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  margin-top: 8px;
  outline: none;
  transition: border-color .2s;
}
.vg-url-input::placeholder { color: var(--text-muted); }
.vg-url-input:focus { border-color: var(--accent); }

/* ═══ 列2：生成参数 ═══ */
.vcol-params { }
.vp-model-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* 模式信息框 */
.vp-mode-info {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}

/* 时长控制 */
.vp-section { margin-bottom: 14px; }
.vp-slabel {
  font-size: 13.5px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.vp-dur-box {
  background: var(--bg-input);
  border-radius: 10px;
  padding: 12px 14px;
}
.vp-dur-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.vp-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--dash);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.vp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  box-shadow: 0 2px 6px rgba(74,222,128,.35);
  cursor: pointer;
  border: 2px solid var(--bg-card);
}

/* 参数详情区 */
.vp-specs {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 14px;
}
.vp-spec-row b { color: var(--text-primary); font-weight: 600; }

/* 生成按钮 */
.btn-gen-video {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(74,222,128,.22);
}
.btn-gen-video:hover {
  box-shadow: 0 4px 14px rgba(74,222,128,.35);
  transform: translateY(-1px);
}
.btn-gen-video:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ═══ 列3：生成结果 ═══ */
.vcol-result { }
.vr-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.vr-preview {
  flex: 1;
  min-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: #0A0D12;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 10px;
}
.vr-placeholder { text-align: center; }
.vr-placeholder p {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: .3px;
}
.vr-placeholder svg { opacity: .5; }
.vr-preview video,
.vr-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.btn-dl-video {
  width: 100%;
  padding: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .15s;
}
.btn-dl-video:hover { background: var(--bg-hover); }

/* ═══ 列4：历史任务 ═══ */
.vcol-history { min-height: 360px; }
.vh-count {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 3px 10px;
  border-radius: 12px;
}
.vh-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* 空状态 */
.vh-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 24px;
  text-align: center;
}
.vh-empty p {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.vh-empty-sub {
  font-size: 11.5px !important;
  color: var(--text-muted) !important;
  margin: 0 !important;
  opacity: .7;
}

/* 历史记录列表（有数据时显示） */
.video-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 520px;
  padding-right: 4px;
}
.vh-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all .18s;
  position: relative;
}
.vh-item:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(74,222,128,.06); }
.vh-item.active { border-color: var(--accent); background: var(--accent-light); }
.vh-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.vh-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.vh-video-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); color: #fff; font-size: 18px; border-radius: 8px; }
.vh-body { flex: 1; min-width: 0; }
.vh-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vh-meta { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; }
.vh-date { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.vh-status {
  font-size: 10.5px;
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  margin-top: 4px;
  font-weight: 500;
}
.vh-status.done { background: var(--green-bg); color: var(--green); }
.vh-status.fail { background: #2A1518; color: #EF4444; }
.vh-status.processing { background: var(--blue-bg); color: var(--blue); }
.vh-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--hairline);
  color: var(--text-muted);
  font-size: 10.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all .15s;
}
.vh-item:hover .vh-delete { opacity: 1; }
.vh-delete:hover { background: #2A1518; color: #EF4444; }

/* ==================== Generating Overlay ==================== */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: #fff;
  z-index: 2000;
  animation: fadeInDown .3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.toast.success { background: #22C55E; }
.toast.error { background: #EF4444; }
.toast.info { background: #60A5FA; }
@keyframes fadeInDown { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ==================== Responsive ==================== */
@media (max-width: 1480px) {
  .three-col-layout { grid-template-columns: 1fr 1fr; }
  .col-right { grid-column: 1 / -1; }
  .bc-grid { grid-template-columns: repeat(2, 1fr); }
  .video-layout { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .left-sidebar { display: none; }
  .main-wrapper { margin-left: 0; }
  .three-col-layout { grid-template-columns: 1fr; }
  .col-right { grid-column: auto; }
  .bc-grid { grid-template-columns: 1fr; }
  .video-layout { grid-template-columns: 1fr; }
  .mode-switcher { flex-wrap: wrap; }
  .top-nav { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .nav-center { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; gap: 16px; }
  .nav-right { order: 2; }
}

/* ════════════════════════════════════════════ */
/* 用户中心弹窗                                */
/* ════════════════════════════════════════════ */
.uc-box {
  width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

.uc-body {
  padding: 8px 0;
}

/* 头像 */
.uc-avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.uc-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border: 2px solid #374151;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.uc-avatar:hover {
  border-color: #4ADE80;
}
.uc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uc-avatar-txt {
  font-size: 28px;
  font-weight: 700;
  color: #4ADE80;
}
.uc-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  opacity: 0;
  transition: opacity .2s;
  border-radius: 50%;
}
.uc-avatar:hover .uc-avatar-overlay {
  opacity: 1;
}

/* 信息分区 */
.uc-section {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #151A21;
  border-radius: 12px;
  border: 1px solid #1E2630;
}
.uc-sec-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

/* 表单字段 */
.uc-field {
  margin-bottom: 12px;
}
.uc-field:last-child {
  margin-bottom: 0;
}
.uc-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.uc-field input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #2A3340;
  background: var(--on-accent);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .2s;
  box-sizing: border-box;
}
.uc-field input:focus {
  outline: none;
  border-color: #4ADE80;
  box-shadow: 0 0 0 3px rgba(74,222,128,0.08);
}
.uc-field input.uc-readonly {
  background: #1A1F28;
  color: var(--text-secondary);
  cursor: not-allowed;
}
.uc-field-row {
  display: flex;
  gap: 8px;
}
.uc-field-row input {
  flex: 1;
}

/* 保存按钮 */
.uc-save-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
  font-family: inherit;
}
.uc-save-btn:hover { opacity: .85; }

/* 密码修改按钮 */
.uc-pwd-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg,#6366F1,#8B5CF6);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  font-family: inherit;
  margin-top: 4px;
}
.uc-pwd-btn:hover { opacity: .85; }

/* 积分余额显示 */
.uc-points-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.uc-points-icon {
  font-size: 22px;
}
.uc-points-val {
  font-size: 32px;
  font-weight: 700;
  color: #4ADE80;
}
.uc-points-label {
  font-size: 14px;
  color: var(--text-secondary);
}


/* ════════════════════════════════════════════ */
/* 积分明细弹窗                                */
/* ════════════════════════════════════════════ */
.pd-box {
  width: 520px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pd-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.pd-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 24px;
  background: #151A21;
  border-bottom: 1px solid #1E2630;
}
.pd-sum-item {
  text-align: center;
}
.pd-sum-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pd-sum-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.pd-sum-item:first-child .pd-sum-val {
  color: #4ADE80;
}
.pd-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 8px;
  padding: 12px 24px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid #1E2630;
}
.pd-list {
  padding: 8px 24px;
}
.pd-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.pd-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #1A2030;
  font-size: 13px;
  color: #CBD5E1;
  align-items: center;
}
.pd-item-time {
  color: var(--text-muted);
  font-size: 12px;
}
.pd-item-type {
  font-weight: 600;
}
.pd-item-type.recharge { color: #4ADE80; }
.pd-item-type.spend { color: #EF4444; }
.pd-item-amount.positive { color: #4ADE80; font-weight: 600; }
.pd-item-amount.negative { color: #EF4444; font-weight: 600; }
.pd-item-note {
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ════════════════════════════════════════════ */
/* 下载/分享弹出菜单                            */
/* ════════════════════════════════════════════ */
.dl-menu {
  background: var(--bg-card);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 180px;
  overflow: hidden;
  animation: fadeInDown .15s ease;
  backdrop-filter: blur(12px);
}
.dl-item {
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dl-item:last-child { border-bottom: none; }
.dl-item:hover { background: rgba(74,222,128,0.1); color: #4ADE80; }

/* ════════════════════════════════════════════ */
/* 图片生成历史面板                              */
/* ════════════════════════════════════════════ */
.image-history-panel {
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  background: #151A21;
}

.ihp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.ihp-header:hover { background: rgba(255,255,255,0.03); }
.ihp-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.ihp-count {
  font-size: 11px;
  color: var(--text-muted);
  background: #1E2630;
  padding: 2px 10px;
  border-radius: 10px;
}
.ihp-toggle {
  color: var(--text-muted);
  font-size: 11px;
  transition: transform .2s;
}

.ihp-warning {
  padding: 8px 16px;
  font-size: 11.5px;
  color: #F59E0B;
  background: rgba(245,158,11,0.06);
  border-top: 1px solid rgba(245,158,11,0.1);
  border-bottom: 1px solid rgba(245,158,11,0.1);
  line-height: 1.5;
}

.ihp-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}
.ihp-list::-webkit-scrollbar { width: 4px; }
.ihp-list::-webkit-scrollbar-thumb { background: #2A3340; border-radius: 2px; }

.ih-empty {
  text-align: center;
  padding: 28px 0;
  font-size: 12px;
  color: var(--icon-dim);
}

.ih-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  margin-bottom: 2px;
}
.ih-item:hover {
  background: rgba(74,222,128,0.06);
}
.ih-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--on-accent);
  border: 1px solid rgba(255,255,255,0.06);
}
.ih-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ih-body {
  flex: 1;
  min-width: 0;
}
.ih-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ih-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
}
.ih-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all .15s;
}
.ih-item:hover .ih-delete { opacity: 1; }
.ih-delete:hover { background: #2A1518; color: #EF4444; }

/* ════════════════════════════════════════════ */
/* 分享海报预览弹窗                              */
/* ════════════════════════════════════════════ */
.poster-preview-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}
.poster-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.poster-preview-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.poster-img-wrap {
  text-align: center;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.poster-img-wrap img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
}
.poster-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.poster-actions .btn-primary {
  padding: 10px 28px;
  background: linear-gradient(135deg,#4ADE80,#22C55E);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.poster-actions .btn-primary:hover { opacity: .85; }
.poster-actions .btn-secondary {
  padding: 10px 28px;
  background: #1E2630;
  border: 1px solid #2A3340;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.poster-actions .btn-secondary:hover { background: #2A3340; }

/* ==================== 开发中弹窗 ==================== */
.coming-soon-box {
  text-align: center;
  padding: 48px 40px 36px;
  max-width: 420px;
  width: 90%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cs-icon { font-size: 56px; margin-bottom: 16px; }
.cs-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.cs-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}
.cs-btn {
  padding: 10px 40px;
  font-size: 14px;
  font-family: inherit;
}

/* ==================== 用户中心 - 开发中占位 ==================== */
.uc-coming-soon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.uc-coming-soon-icon { font-size: 28px; }
.uc-coming-soon-text {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==================== XAI 画面比例选择器 ==================== */
.xai-ratio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color .15s;
  user-select: none;
}
.xai-ratio-header:hover { border-color: var(--accent); }
.xai-ratio-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .15s;
}

.xai-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding: 4px 2px;
}

.xai-ratio-btn {
  padding: 7px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-family: inherit;
}
.xai-ratio-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.xai-ratio-btn.active {
  background: linear-gradient(135deg, #4ADE80, #22C55E);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
}

/* ==================== 生成进度条（编辑结果区） ==================== */
/* 网关生图为阻塞式响应，过程中无真实中间进度；
   进度条 = 多张的真实分段 + 单张内基于历史耗时的渐进估算（封顶 99%，出图才 100%） */
.gen-progress {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 4px;
}
.gp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.gp-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .2px;
}
.gp-pct {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.gp-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}
.gp-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34D399, #4ADE80 55%, #22D3EE);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
/* 流动高光：明确表达"任务仍在跑" */
.gp-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: translateX(-100%);
  animation: gpShine 1.5s ease-in-out infinite;
}
@keyframes gpShine { to { transform: translateX(100%); } }

.gp-meta {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
}
.gp-meta b {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 完成 / 失败态：停止流动动画 */
.gen-progress.is-done .gp-bar::after,
.gen-progress.is-error .gp-bar::after { display: none; }
.gen-progress.is-done .gp-title { color: #22C55E; }
.gen-progress.is-error .gp-title { color: #F87171; }
.gen-progress.is-error .gp-bar {
  background: linear-gradient(90deg, #F87171, #EF4444);
}

/* ==================== 批量任务卡片内嵌细进度条 ==================== */
/* 与「编辑结果」区同一套估算逻辑：多张按张数分段，单张内按历史耗时渐进 */
.bc-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 0;
}
.bc-prog-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bc-prog-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60A5FA, #22D3EE);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
/* 流动高光：表达任务仍在跑 */
.bc-prog-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%);
  animation: bcShine 1.5s ease-in-out infinite;
}
@keyframes bcShine { to { transform: translateX(100%); } }

.bc-prog-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* 完成 / 失败态：停掉流动动画 */
.bc-prog.is-done  .bc-prog-bar::after,
.bc-prog.is-error .bc-prog-bar::after { display: none; }
.bc-prog.is-done  .bc-prog-bar { background: linear-gradient(90deg, #34D399, #22C55E); }
.bc-prog.is-done  .bc-prog-pct { color: #4ADE80; }
.bc-prog.is-error .bc-prog-bar { background: linear-gradient(90deg, #F87171, #EF4444); }
.bc-prog.is-error .bc-prog-pct { color: #F87171; }

/* ==================== 一字进度条（生成中，贴在预览区顶部） ==================== */
/* 旧做法把进度块塞进预览区占位块，会与结果图/历史图抢位置（表现为"编辑结果框重叠"）。
   改为一条 3px 细横条：absolute 定位不占布局流，完全不干扰用户当前在看的内容。 */
.thin-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  pointer-events: none;   /* 细条本身不挡住图片点击（结果图仍可点开放大） */
}
.thin-progress .tp-track {
  height: 3px;
  background: rgba(255, 255, 255, .10);
  overflow: hidden;
}
.thin-progress .tp-bar {
  position: relative;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #34D399, #4ADE80 55%, #22D3EE);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
/* 流动高光：明确表达"任务仍在跑" */
.thin-progress .tp-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: translateX(-100%);
  animation: gpShine 1.5s ease-in-out infinite;
}
.thin-progress .tp-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100% - 20px);
  margin: 8px 10px 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 20, 28, .88);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: auto;    /* 文字与按钮可点 */
}
.thin-progress .tp-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thin-progress .tp-text b {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.thin-progress .tp-act {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.thin-progress .tp-act:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
/* 完成 / 失败态 */
.thin-progress.is-done  .tp-bar::after,
.thin-progress.is-error .tp-bar::after { display: none; }
.thin-progress.is-done .tp-bar { background: linear-gradient(90deg, #34D399, #22C55E); }
.thin-progress.is-done .tp-info { cursor: pointer; border-color: rgba(74, 222, 128, .35); }
.thin-progress.is-error .tp-bar { background: linear-gradient(90deg, #F87171, #EF4444); }
.thin-progress.is-error .tp-info { border-color: rgba(248, 113, 113, .35); }


/* ==================== 引擎浮层：在本站内使用 0帧AI（替代外站跳转） 2026-09-28 ==================== */
.zi-engine-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: none;
  background: rgba(6, 8, 12, .72);
}
.zi-engine-overlay.is-open { display: block; }
html.zi-engine-lock, html.zi-engine-lock body { overflow: hidden; }

.zi-engine-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}
.zi-engine-bar {
  flex: 0 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.zi-engine-brand {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #9f02d2;
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: .5px;
}
.zi-engine-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.zi-engine-spacer { flex: 1 1 auto; }
.zi-engine-opennew {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  transition: var(--transition);
}
.zi-engine-opennew:hover { color: var(--text-primary); background: var(--bg-hover); }
.zi-engine-close {
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition);
}
.zi-engine-close:hover { background: var(--bg-hover); border-color: #9f02d2; color: #fff; }
.zi-engine-close:focus-visible { outline: 2px solid #9f02d2; outline-offset: 2px; }

.zi-engine-body { position: relative; flex: 1 1 auto; min-height: 0; }
.zi-engine-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--on-accent); }
.zi-engine-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-page);
}
.zi-engine-spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: #9f02d2;
  border-radius: 50%;
  animation: ziEngineSpin .8s linear infinite;
}
@keyframes ziEngineSpin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .zi-engine-opennew { display: none; }
  .zi-engine-title { font-size: 13px; }
}

/* =====================================================================
 * 白天模式（html.light）补丁 + 切换防闪烁 —— v20260929-3
 * 1) 上一轮（v20260929-2）只把「已变量化」的颜色跟随主题，散落在各组件里的
 *    硬编码深底 / 半透白没跟上 —— 最明显的是单图生成的「编辑结果」预览框
 *    （#1F252D）与生成历史面板（#151A21）、琴键玻璃面板（半透黑）。
 *    这里集中反转；**全部写成 html.light 覆盖，夜晚样式一字未动**，删掉整段即可回滚。
 * 2) 切换瞬间禁用全站过渡：几十处 `transition: all` 的元素渐变不同步，
 *    中途会出现「背景已浅、文字还是浅色」的错帧（用户感知就是闪一下）。
 *    app.js 的 ziThemeApply() 会临时挂 .zi-theme-switching（80ms 后移除）。
 * ===================================================================== */
html { background: var(--bg-page); }   /* 兜底：任何露底区域都跟主题，切到白天不闪白 */

html.zi-theme-switching *,
html.zi-theme-switching *::before,
html.zi-theme-switching *::after { transition: none !important; animation: none !important; }

html.light { color-scheme: light; }

/* ---- 左侧琴键玻璃面板 ---- */
html.light .engine-rail .rail-inner {
  background:
    linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.28) 34%, rgba(255,255,255,.28) 78%, rgba(255,255,255,.55)),
    rgba(255,255,255,.74);
  border-color: rgba(0,0,0,.10);
  box-shadow: 0 22px 60px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.9);
}
html.light .engine-rail .rail-head { border-bottom-color: rgba(0,0,0,.08); }
html.light .engine-rail .rail-foot { border-top-color: rgba(0,0,0,.08); }
html.light .engine-rail .rail-close { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.12); }
html.light .engine-rail .engine-menu-item { background: rgba(0,0,0,.035); border-color: rgba(0,0,0,.08); }
html.light .engine-rail .engine-menu-item::before { background: rgba(0,0,0,.14); }

/* ---- 单图生成：编辑结果区（Zero 反馈：白天模式下没跟随） ---- */
html.light .result-preview { background: var(--bg-input); }
html.light .rp-nav { background: rgba(255,255,255,.9); }
html.light .rp-nav-counter { background: rgba(255,255,255,.88); }
html.light .image-history-panel { background: var(--bg-input); border-color: var(--border); }
html.light .ihp-header:hover { background: var(--bg-hover); }
html.light .ihp-count { background: var(--border-light); }
html.light .ihp-list::-webkit-scrollbar-thumb { background: var(--border); }
html.light .ih-thumb { border-color: var(--border); }
html.light .ih-delete { background: rgba(0,0,0,.05); }
html.light .ih-delete:hover { background: rgba(239,68,68,.12); color: #dc2626; }
html.light .vgsu-meta { background: rgba(0,0,0,.04); }
html.light .vr-preview { background: var(--bg-input); }
html.light .pay-notice { background: #fff6e5; }
html.light .ai-assist-chip { border-color: var(--border); }
html.light .ai-assist-chip:hover { background: var(--bg-hover); }

/* ---- 弹窗：用户中心 / 积分明细 / 下载 / 海报 / 视频与批量 ---- */
html.light .uc-section { background: var(--bg-input); border-color: var(--border); }
html.light .uc-avatar { border-color: var(--border); }
html.light .uc-field input { border-color: var(--border); }
html.light .uc-field input.uc-readonly { background: var(--bg-hover); }
html.light .pd-summary { background: var(--bg-input); border-bottom-color: var(--border); }
html.light .pd-list-header { border-bottom-color: var(--border); }
html.light .pd-item { border-bottom-color: var(--border-light); }
html.light .dl-item { border-bottom-color: var(--hairline); }
html.light .poster-img-wrap { border-color: var(--border); }
html.light .poster-actions .btn-secondary { background: var(--bg-input); border-color: var(--border); }
html.light .poster-actions .btn-secondary:hover { background: var(--bg-hover); }
html.light .vh-status.fail { background: rgba(239,68,68,.12); color: #dc2626; }
html.light .vh-delete:hover { background: rgba(239,68,68,.12); color: #dc2626; }
html.light .bar-btn.bar-danger { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.35); color: #dc2626; }
html.light .bar-btn.bar-danger:hover { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.50); }
html.light .bc-close-btn:hover { background: rgba(239,68,68,.12); color: #dc2626; }
html.light .bc-tbtn-icon.danger:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #dc2626; }

/* ---- 进度条：半透白轨道 → 白天改半透黑 ---- */
html.light .thin-progress .tp-track { background: rgba(0,0,0,.10); }
html.light .thin-progress .tp-info { border-color: rgba(0,0,0,.10); }
html.light .thin-progress .tp-act { border-color: rgba(0,0,0,.14); background: rgba(0,0,0,.04); }
html.light .thin-progress .tp-act:hover { background: rgba(0,0,0,.10); }
