/* ===== 调整型文胸 生图工具 —— Glass 玻璃拟态 + Inter 字体 ===== */
@import url("https://fonts.font.im/css?family=Inter:400,500,600,700");

/* Vue 挂载完成前隐藏整个 #app，避免原始 {{ }} 模板和「安装扩展」弹窗闪现零点几秒 */
[v-cloak] { display: none !important; }

/* 全局细滚动条：默认 15px 灰白条在深色 UI 上太突兀（页面级 + 历史区 .history-grid 等 overflow 容器都受影响）。
   改 8px + 半透明白 thumb（深色背景上很淡、不抢眼）、track 透明、hover 时才稍明显；Firefox 用 scrollbar-width。 */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); }

:root {
  /* Glass: 深底 + 渐变光斑由 body 提供，其他容器都是半透明白 */
  --bg-base: #0e0e10;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --stage: rgba(0, 0, 0, 0.28);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --fg: #ececec;
  --muted: #8a8a92;
  --accent: #f76b1c;
  --accent-soft: rgba(247,107,28,0.15);
  --accent-ring: rgba(247,107,28,0.35);
  --bg-chip: #3b82f6; --bg-chip-soft: rgba(59,130,246,.16); --bg-chip-ring: rgba(59,130,246,.5);
  --pose-chip: #22c55e; --pose-chip-soft: rgba(34,197,94,.16); --pose-chip-ring: rgba(34,197,94,.5);
  --on-bg: #000000;
  --on-fg: #f76b1c;
  --danger: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--fg);
  min-height: 100vh;
  /* 灰暗调 + 可见银河：暗罩调到银河清晰可见、整体仍偏灰暗，文字面板照常 */
  /* 图片 URL 带版本号 ?v= ：换图必须改这个号，否则浏览器缓存旧图不更新（踩过坑） */
  background:
    linear-gradient(180deg, rgba(22,22,26,0.80) 0%, rgba(18,18,23,0.90) 100%),
    url('hero-bg.jpg?v=galaxy1') center / cover no-repeat,
    #1b1b1f;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* ===== 旋转地球背景（全局铺满·除左侧栏·慢转·screen 抠黑融进银河底）=====
   层级：body 银河底(canvas) < .earth-bg(z-index:-1) < #app 内容。
   视频四角纯黑，mix-blend-mode:screen 把黑融掉只留发光地球。转速由 index.html 末尾脚本设(每圈7分钟)。
   铺满：.earth-bg 盖住侧栏(80px)以外整个视口；video 放大到 disc 直径>盒对角线 → 地表铺满无黑角(地球弧边在可视区外)。 */
.earth-bg {
  position: fixed; top: 0; right: 0; bottom: 0; left: 80px; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.earth-bg video {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: max(138vw, 138vh); height: max(138vw, 138vh);   /* 方形·边长=较大视口维138%·disc(85%)铺满盒 */
  object-fit: cover; mix-blend-mode: screen;
  /* 保持地球明亮，只稍压一点点；可读性靠文字提亮+描边(见下方文字增强)，不靠压暗背景 */
  opacity: .5; filter: brightness(.8) saturate(1.0) contrast(1.02);
}
.earth-bg::after {  /* 轻暗罩：只压一点点，不盖掉地球 */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,9,14,.34) 0%, rgba(8,9,14,.18) 45%, rgba(8,9,14,.32) 100%);
}
/* 地球亮底上的文字增强：提亮 + 暗描边 halo，让字在明亮地表上也清楚（不压暗背景）。
   body 前缀提高优先级，盖过后面 .jm-* 原规则；.mod-tab.on / .jm-hint.warn 因更高优先级不受影响保留本色 */
body .jm-title { text-shadow: 0 2px 4px rgba(0,0,0,.7), 0 0 18px rgba(0,0,0,.45); }
body .jm-sub, body .jm-hint { color: #dcdce2; opacity: 1; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.55); }
body .gal-sub { color: #dcdce2; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.55); }
body .mod-tab { text-shadow: 0 1px 3px rgba(0,0,0,.75); }
body .mod-tab:not(.on) { color: #d4d4db; }
body .jm-input::placeholder { color: rgba(228,228,235,.82); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
/* 上传框「+ 参考图 选填」也提亮（同样在亮地表上）*/
body .jm-up-add .jm-plus, body .jm-up-add .lbl { color: #d2d2d9; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
body .jm-up-add .jm-opt { color: #c4c4cc; opacity: 1; text-shadow: 0 1px 2px rgba(0,0,0,.8); }

/* ===== 顶部:品牌 + tab ===== */
/* 左侧栏布局：内容区给侧栏让位（折叠时跟随收窄） */
.app { max-width: none; margin: 0; padding: 20px 28px 48px 92px; transition: padding-left .24s ease; }  /* 窄轨80+12缝（V2 方案A，2026-06-12 整体放大一档） */
.app.side-folded { padding-left: 98px; }
.workspace-fission.fission-batch-expanded { margin-left: 354px; width: calc(100% - 354px); transition: margin-left .24s ease, width .24s ease; }
@media (max-width:1180px){ .workspace-fission.fission-batch-expanded { margin-left: 0; width: 100%; } }

/* ===== 左侧栏（S1 小云雀同构，2026-06-12 整体布局定稿） ===== */
.app-side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 256px; z-index: 60;
  display: flex; flex-direction: column;
  background: rgba(18, 18, 21, .85); backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  padding: 16px 12px 12px;
  transition: width .25s ease; overflow: hidden; min-width: 0;
}
.app-side.fold { width: 68px; }
.as-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; }
.as-brand .brand-logo { flex: 0 0 auto; }
.as-bmeta { min-width: 0; }
.as-bname { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.as-bver { font-size: 10.5px; color: var(--muted); }
.as-fold { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.as-fold:hover { background: var(--panel-strong); color: var(--fg); }
.as-nav { display: flex; flex-direction: column; gap: 3px; }
.as-nv {
  display: flex; align-items: center; gap: 10px; border: none; cursor: pointer; text-align: left;
  background: none; color: var(--fg); font-size: 13.5px; font-weight: 600;
  padding: 10px 12px; border-radius: 11px; white-space: nowrap; overflow: hidden;
}
.as-nv .as-i { flex: 0 0 18px; text-align: center; }
.as-nv:hover { background: var(--panel-strong); }
.as-nv.on { background: var(--panel-strong); }
.as-sec { display: flex; align-items: center; justify-content: space-between; margin: 18px 12px 8px; white-space: nowrap; }
.as-sec b { font-size: 12px; color: var(--muted); font-weight: 600; }
.as-sec a { font-size: 11.5px; color: var(--muted); cursor: pointer; }
.as-sec a:hover { color: var(--accent); }
.as-spacer { flex: 1; }  /* 历史列表移到主区 tab 后，用空档把底部用户区压到底 */
.as-hdate { font-size: 10.5px; color: var(--muted); opacity: .8; letter-spacing: 1px; margin: 8px 12px 3px; white-space: nowrap; }
.as-hdate:first-child { margin-top: 0; }
.as-hrow { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.as-hrow:hover { background: var(--panel-strong); }
.as-hthumb { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: rgba(255,255,255,.06); }
.as-hmeta { min-width: 0; }
.as-ht { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.as-hcnt { margin-left: 6px; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--panel-strong); border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }  /* 一组N张 角标 */
.as-hs { font-size: 11px; color: var(--muted); }
.as-foot { margin-top: 8px; padding: 8px 12px; font-size: 11.5px; color: #7fce8c; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 6px; }
.as-foot i { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: #2ea043; box-shadow: 0 0 8px #2ea043; }
/* 折叠态：只剩图标列 */
.app-side.fold .as-bmeta, .app-side.fold .as-nv .as-lbl, .app-side.fold .as-sec,
.app-side.fold .as-hmeta, .app-side.fold .as-hdate, .app-side.fold .as-foot .as-lbl { display: none; }
.app-side.fold .as-brand { padding-left: 0; padding-right: 0; justify-content: center; flex-wrap: wrap; gap: 6px; }
.app-side.fold .as-fold { margin: 0; }
.app-side.fold .as-nv { justify-content: center; padding: 10px 0; }
.app-side.fold .as-hrow { justify-content: center; padding: 6px 0; }
.app-side.fold .as-foot { justify-content: center; padding: 8px 0; }

/* 右上动作区（登录系统落地后由点数胶囊+头像菜单接管） */
.top-acts { position: fixed; top: 14px; right: 18px; z-index: 55; display: flex; gap: 8px; }
.ta-btn {
  border: 1px solid var(--border-strong); background: rgba(18,18,21,.7); backdrop-filter: blur(8px);
  color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.ta-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.ta-btn.on { background: var(--accent); color: #1a1300; border-color: var(--accent); }

/* 窄屏：侧栏让路 */
/* 左侧栏固定常显（2026-06-13 用户要求"钉死不允许隐藏"）：
   原 @media(max-width:960px) 整块（隐藏轨 + 无轨留白补偿）已删——
   缩放/分屏到窄宽度也不再消失，轨始终占 92px 留白由 .app 基础规则保证。 */

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding-bottom: 16px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { flex: 0 0 auto; display: block; }
.brand h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.015em; }
.brand p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* 扩展状态条 */
.ext-bar { display: flex; align-items: center; gap: 10px; padding: 8px 24px; font-size: 13px; border-bottom: 1px solid var(--border); }
.ext-bar .ext-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ext-bar .ext-msg { color: var(--fg); }
.ext-bar.connected { background: rgba(46,160,67,.08); }
.ext-bar.connected .ext-dot { background: #2ea043; box-shadow: 0 0 6px #2ea043; }
.ext-bar.connected .ext-msg { color: #7fce8c; }
.ext-bar.missing, .ext-bar.stale { background: rgba(247,107,28,.10); }
.ext-bar.missing .ext-dot, .ext-bar.stale .ext-dot { background: #f76b1c; box-shadow: 0 0 6px #f76b1c; }
.ext-bar.missing .ext-msg, .ext-bar.stale .ext-msg { color: #f9a76b; }
.ext-bar .ext-btn { margin-left: auto; background: #f76b1c; color: #1a1300; font-weight: 600; font-size: 12px; border: none; border-radius: 6px; padding: 5px 14px; cursor: pointer; font-family: inherit; }
.ext-bar .ext-btn:hover { filter: brightness(1.06); }
/* 点「传图器」时强调顶部「有新版」横幅：背景闪 + 「一键更新」按钮弹几下，引导去点更新 */
.ext-bar.pulse { animation: ext-bar-pulse .55s ease-in-out 3; }
@keyframes ext-bar-pulse { 0%, 100% { background: rgba(247,107,28,.10); } 50% { background: rgba(247,107,28,.34); } }
.ext-bar.pulse .ext-btn { animation: ext-btn-pulse .55s ease-in-out 3; }
@keyframes ext-btn-pulse { 0%, 100% { transform: scale(1); box-shadow: none; } 50% { transform: scale(1.14); box-shadow: 0 0 14px rgba(247,107,28,.85); } }
/* 扩展正常连接：左下角常驻小绿点+小字备注（右下角被裂变历史悬浮按钮占用） */
.ext-dot-corner { position: fixed; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #7fce8c; opacity: .75; z-index: 50; cursor: default; }
.ext-dot-corner i { width: 9px; height: 9px; border-radius: 50%; background: #2ea043; box-shadow: 0 0 8px #2ea043; }

/* 安装/更新面板 */
.ext-mask { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.ext-panel { background: rgba(18, 18, 22, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border-strong); border-radius: 14px; padding: 26px; max-width: 440px; width: 90%; color: var(--fg); box-shadow: 0 24px 64px rgba(0,0,0,.5); }  /* 实底+磨砂：--panel 4%半透在图墙上糊成一片（同 fz-rtoolbar 的教训） */
.ext-panel h3 { margin: 0 0 6px; font-size: 17px; }
.ext-panel-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.ext-dl { display: inline-block; background: #f76b1c; color: #1a1300; font-weight: 700; text-decoration: none; padding: 10px 18px; border-radius: 8px; font-size: 14px; }
.ext-dl:hover { filter: brightness(1.06); }
.ext-steps { margin: 18px 0; padding-left: 20px; font-size: 13px; line-height: 1.9; }
.ext-steps code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.ext-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 18px; }
.ext-close { background: transparent; border: 1px solid var(--border); color: var(--fg); padding: 7px 18px; border-radius: 7px; cursor: pointer; font-family: inherit; font-size: 13px; }
.ext-close:hover { background: rgba(255,255,255,.06); }
.ext-firsttime { margin-top: 18px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ext-copy { background: rgba(247,107,28,.18); color: #f76b1c; border: 1px solid rgba(247,107,28,.4); border-radius: 4px; font-size: 11px; padding: 1px 8px; cursor: pointer; font-family: inherit; vertical-align: middle; }
.ext-copy:hover { background: rgba(247,107,28,.3); }
.ext-update-note { background: rgba(46,160,67,.08); border: 1px solid rgba(46,160,67,.25); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: #b7e0bf; line-height: 1.6; margin: 4px 0 14px; }
.ext-update-note code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }
.ext-btn-ghost { background: transparent; color: #f76b1c; border: 1px solid rgba(247,107,28,.5); border-radius: 6px; font-size: 12px; padding: 4px 12px; cursor: pointer; font-family: inherit; }
.ext-btn-ghost:hover:not(:disabled) { background: rgba(247,107,28,.12); }
.ext-btn-ghost:disabled { opacity: .5; cursor: default; }
.ext-reload-block { display: block; width: 100%; padding: 10px; margin: 0 0 14px; font-size: 13px; font-weight: 600; }
/* 安装面板重设计 v137：3步+少文字+拖文件夹示意图 */
.ext-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.ext-head h3 { margin: 0; }
.ext-quick { margin-left: auto; font-size: 12px; color: var(--muted); }
.ext-dl-big { display: flex; width: 100%; box-sizing: border-box; justify-content: center; align-items: center; gap: 8px; padding: 13px; font-size: 15px; border-radius: 10px; }
.ext-steps2 { margin: 18px 0 4px; display: flex; flex-direction: column; gap: 15px; }
.ext-step { display: flex; gap: 12px; align-items: flex-start; }
.ext-step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(247,107,28,.15); color: #f76b1c; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ext-step-body { flex: 1; min-width: 0; }
.ext-step-t { font-size: 14px; font-weight: 600; }
.ext-step-d { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.ext-illust { margin-top: 8px; background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 8px; padding: 11px; display: flex; align-items: center; gap: 9px; }
.ext-il-folder { flex: none; text-align: center; line-height: 1; }
.ext-il-folder span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ext-il-arrow { flex: none; color: #f76b1c; font-size: 16px; }
.ext-il-chrome { flex: 1; min-width: 0; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.ext-il-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ext-il-top > span:first-child { font-size: 11px; color: var(--muted); }
.ext-il-dev { font-size: 11px; color: #f76b1c; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ext-toggle { width: 24px; height: 13px; background: #f76b1c; border-radius: 7px; position: relative; display: inline-block; }
.ext-toggle::after { content: ''; width: 9px; height: 9px; background: #fff; border-radius: 50%; position: absolute; right: 2px; top: 2px; }
.ext-il-drop { margin-top: 6px; border: 1px dashed #f76b1c; border-radius: 4px; padding: 5px; text-align: center; font-size: 11px; color: #f76b1c; }
.ext-step-cmd { margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.ext-step-cmd code { font-size: 12px; background: rgba(255,255,255,.08); border-radius: 5px; padding: 2px 7px; }
.ext-more { margin: 14px 0; border-top: 1px solid var(--border); padding-top: 12px; }
.ext-more summary { font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; }
.ext-more summary::-webkit-details-marker { display: none; }
.ext-more summary::before { content: '▸ '; }
.ext-more[open] summary::before { content: '▾ '; }
.ext-more .ext-update-note { color: var(--muted); }

.tabs { display: flex; gap: 4px; }
.tab {
  font-size: 13px; padding: 8px 18px; border-radius: var(--radius);
  background: transparent; color: var(--muted); border: 1px solid transparent;
  cursor: pointer; transition: all .18s ease;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  line-height: 1.4;
}
.tab:hover { color: var(--fg); background: var(--panel); }
.tab.active {
  background: var(--accent); color: var(--on-bg); font-weight: 600;
  box-shadow: 0 4px 14px rgba(247,107,28,0.25);
}

/* ===== 生成 tab:左右分栏 ===== */
/* 左栏自然高度（settings 内容固定），右栏靠 align-items:stretch 自动跟齐 */
.workspace { display: flex; gap: 20px; }
.panel {
  width: 380px; flex-shrink: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    rgba(22, 22, 26, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.stage {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;  /* history-grid 用 flex:1 吃满剩余 */
  background:
    linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005)),
    rgba(14, 14, 18, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;  /* 内部 .history-grid 负责滚动 */
}

/* ===== 参数组 ===== */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: block; font-weight: 500; }
.field-hint { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

/* select：自定义 chevron + glass */
select {
  width: 100%; font-size: 13px; padding: 9px 36px 9px 12px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all .15s ease;
  cursor: pointer;
}
select:hover { border-color: var(--border-strong); }
select:focus {
  outline: none;
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* segmented control（iOS 风格分段控件，适合 2-3 个互斥选项） */
.segmented {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: all .15s ease;
  white-space: nowrap;
}
.seg-btn:hover:not(.on) { color: var(--fg); background: rgba(255,255,255,0.04); }
.seg-btn.on {
  background: var(--accent);
  color: var(--on-bg);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.3) inset;
}
/* 风格选择器：显示品牌短名 → 等宽分段；风格多到一行放不下时换行（每行等分） */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap .seg-btn { flex: 1; min-width: 0; }

/* chip / 卡片选项 */
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices-row { flex-wrap: nowrap; }
.choice-aspect { flex: 1; text-align: center; padding: 8px 6px; line-height: 1.4; }
.choice {
  font-size: 12px; padding: 7px 12px; border-radius: var(--radius);
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); cursor: pointer;
  text-align: left; font-family: inherit;
  transition: all .15s ease;
}
.choice:hover { background: var(--card-hover); border-color: var(--border-strong); }
.choice.on {
  background: rgba(247,107,28,0.22);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.choice-block { display: block; position: relative; }
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }

/* 链接裂变：源主图网格（之前漏写，导致源图原始大小铺开撑乱页面） */
.fission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.fission-card {
  background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 5px; cursor: pointer; transition: border-color .15s, background .15s;
}
.fission-card:hover { background: var(--card-hover); border-color: var(--border-strong); }
.fission-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.fission-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; display: block; }
/* 图片下方的比例标签行 */
.fission-card-label {
  font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; line-height: 1.3;
}
/* 换背景 / 换姿势 两个 checkbox 并排 */
.fission-card-toggles {
  display: flex; justify-content: center; gap: 8px; margin-top: 4px; flex-wrap: wrap;
}
.fission-card-toggles label {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.fission-card-toggles label input { accent-color: var(--accent); }

/* ===== 链接裂变重设计：选图视图 ===== */
.workspace-fission { flex-direction: column; }
.workspace-fission > .panel { width: 100%; max-width: none; }

/* 链接裂变 · 贴链接输入栏（一体搜索栏：input + 读取按钮拼成一个控件） */
.ia-bar { display: flex; align-items: stretch; height: 46px; border: 1px solid var(--border-strong); border-radius: 11px; overflow: hidden; background: var(--stage); transition: border-color .15s, box-shadow .15s; }
.ia-bar:focus-within { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.ia-icon { display: flex; align-items: center; padding: 0 6px 0 14px; color: var(--muted); font-size: 15px; }
.ia-input { flex: 1; border: 0; background: transparent; color: var(--fg); font-size: 14px; padding: 0 12px; outline: none; min-width: 0; }
.ia-btn { border: 0; background: var(--accent); color: #000; font-weight: 700; font-size: 13px; padding: 0 20px; cursor: pointer; white-space: nowrap; transition: opacity .15s; }
.ia-btn:disabled { opacity: .6; cursor: default; }
.ia-sub { font-size: 11px; color: var(--muted); margin: 8px 2px 0; }
.ia-sub.prog { color: var(--accent); }
/* ===== 读图后输入条收缩成右侧小胶囊（点击展开）=====
   宽度动画用 max-width 过渡（width:auto 不可过渡）；margin-left:auto 让条始终右锚，收/展都贴右滑 */
.ia-bar { max-width: 100%; margin-left: auto; transition: max-width .38s cubic-bezier(.4,0,.2,1), height .38s ease, border-radius .38s ease, margin .38s cubic-bezier(.4,0,.2,1), padding .38s ease, background .38s ease, transform .3s ease, border-color .15s, box-shadow .15s; }
.ia-bar.ia-collapsed { max-width: 112px; height: 34px; margin-bottom: 10px; align-items: center; justify-content: center; cursor: pointer; border-radius: 999px; }
.ia-bar.ia-collapsed:hover { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.ia-bar.ia-collapsed .ia-icon { padding: 0 6px 0 0; }
/* 收缩时输入框/按钮只隐藏不删（展开原样还原），残余宽度交给容器 overflow:hidden 裁掉 */
.ia-bar.ia-collapsed .ia-input, .ia-bar.ia-collapsed .ia-btn { opacity: 0; flex: 0 0 0; width: 0; min-width: 0; padding: 0; border: 0; pointer-events: none; }
.ia-input, .ia-btn { transition: opacity .2s ease; }
.ia-mini-label { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ===== 链接裂变 · 空状态入口「光晕玻璃」（设计稿 B 移植）=====
   空态（!fissionBarCollapsed → .fz-hero-on）：居中 hero + 香槟金氛围光 + 毛玻璃胶囊；
   收缩态：hero 淡出塌高、aurora 熄灭、输入条沿用既有 max-width 动画滑去右上成小胶囊。
   香槟金只在 hero 区生效（变量收在 .fz-panel），nav 的 #f76b1c 不动。 */
.fz-panel { position: relative; min-height: 0; --fz-gold-hi: #ffcaa0; --fz-gold: #f4a86a; --fz-gold-deep: #e0681a;
  transition: padding .45s cubic-bezier(.22,.6,.2,1), min-height .45s cubic-bezier(.22,.6,.2,1); }
.fz-panel.fz-hero-on { padding-top: clamp(70px, 15vh, 150px); padding-bottom: 64px; min-height: clamp(440px, 60vh, 660px); }
/* hero 内容压在氛围光之上（aurora 是 absolute 首子元素，positioned 兄弟按 DOM 序绘制） */
.fz-panel > div:not(.fz-aurora-wrap) { position: relative; }
/* 收缩态恢复旧 panel-title（标题行）：淡入接位，避免 hero 大标题消失时生硬弹出 */
.fz-panel:not(.fz-hero-on) .fz-title-row { animation: fzFadeIn .4s ease .15s both; }

/* 氛围光：满铺面板、自带圆角裁切，pointer-events 穿透；静息 .09，聚焦呼吸增强 */
.fz-panel .fz-aurora-wrap { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius-lg); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.fz-panel.fz-hero-on .fz-aurora-wrap { opacity: 1; visibility: visible; animation: fzFadeIn .9s ease .25s both; }
.fz-aurora { position: absolute; display: block; border-radius: 50%; filter: blur(70px); opacity: .09; transition: opacity 1.1s cubic-bezier(.22,.6,.2,1); will-change: opacity; }
.fz-aurora.a1 { width: 920px; height: 520px; left: 50%; top: -30px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--fz-gold) 0%, rgba(247,107,28,.5) 38%, transparent 72%); }
.fz-aurora.a2 { width: 560px; height: 380px; left: 30%; top: 26%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, #e0681a 0%, transparent 68%); opacity: .054; }
/* 聚焦输入条 → 整片氛围光吸气式增强 */
.fz-hero-on:has(.ia-bar:focus-within) .fz-aurora.a1 { opacity: .14; }
.fz-hero-on:has(.ia-bar:focus-within) .fz-aurora.a2 { opacity: .084; }
/* 地平线：胶囊下方 1px 金色微光，强化纵深 */
.fz-aurora-wrap::after { content: ''; position: absolute; left: 50%; top: 68%; width: 720px; max-width: 80%; height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(247,107,28,.22), transparent); }

/* hero 标题区：空态居中显示，收缩态淡出 + 塌高（max-height 过渡）让输入条顺滑上移 */
.fz-hero-head { text-align: center; max-height: 220px; opacity: 1; overflow: hidden;
  transition: max-height .45s cubic-bezier(.4,0,.2,1), opacity .3s ease; }
.fz-panel:not(.fz-hero-on) .fz-hero-head { max-height: 0; opacity: 0; }
.fz-hero-on .fz-hero-head { animation: fzHeroIn .55s cubic-bezier(.22,.6,.2,1) .15s both; }
.fz-hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 3px; color: var(--fz-gold-hi); opacity: .65; margin-bottom: 16px; }
.fz-hero-kicker::before, .fz-hero-kicker::after { content: ''; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(247,107,28,.5)); }
.fz-hero-kicker::after { transform: scaleX(-1); }
.fz-hero-title { font-size: 44px; font-weight: 700; letter-spacing: 6px; text-indent: 6px; margin: 0;
  background: linear-gradient(180deg, #fff3ea 30%, #f4a86a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fz-hero-sub { margin: 14px 0 0; font-size: 15px; color: rgba(242,240,234,.56); letter-spacing: 1px; }

/* hero 态毛玻璃胶囊输入条：宽度上限 760、居中（margin-right 用 calc 凑居中→收缩时可过渡回 0 贴右滑） */
.fz-hero-on .ia-bar:not(.ia-collapsed) {
  max-width: min(760px, 100%); margin-right: max(0px, calc((100% - 760px) / 2)); margin-top: 40px;
  height: 62px; align-items: center; padding: 0 8px 0 18px; border-radius: 999px;
  border-color: rgba(255,255,255,.10); background: rgba(255,255,255,.045);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.4), 0 28px 64px -18px rgba(0,0,0,.65);
  animation: fzFadeIn .45s ease .1s both;
  transition: max-width .38s cubic-bezier(.4,0,.2,1), height .38s ease, border-radius .38s ease, margin .38s cubic-bezier(.4,0,.2,1), padding .38s ease, background .38s ease, transform .35s cubic-bezier(.22,.6,.2,1), border-color .35s ease, box-shadow .35s ease;
}
.fz-hero-on .ia-bar:hover:not(:focus-within) { border-color: rgba(255,255,255,.16); }
/* 聚焦微交互：描边染金、整条上浮 1px、投影渗一圈极淡金晕（光晕呼吸走上面 :has 规则） */
.fz-hero-on .ia-bar:focus-within {
  border-color: rgba(247,107,28,.45); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 1px 2px rgba(0,0,0,.4), 0 28px 64px -18px rgba(0,0,0,.65),
    0 0 0 1px rgba(247,107,28,.12), 0 12px 48px -8px rgba(247,107,28,.14);
}
.fz-hero-on .ia-icon { font-size: 16px; opacity: .85; transition: opacity .3s, transform .3s; }
.fz-hero-on .ia-bar:focus-within .ia-icon { opacity: 1; transform: rotate(-8deg); }
.fz-hero-on .ia-input, .fz-hero-on .ia-input:focus { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.fz-hero-on .ia-input { text-align: center; font-size: 15px; letter-spacing: .3px; caret-color: var(--fz-gold); padding: 0 12px; height: 100%; }
.fz-hero-on .ia-bar:focus-within .ia-input::placeholder { color: rgba(242,240,234,.22); }
/* 读取主图按钮：胶囊内实金小胶囊（香槟渐变） */
.fz-hero-on .ia-btn { height: 46px; padding: 0 28px; border-radius: 999px; font-size: 14px; letter-spacing: 1px; color: #2b1400;
  background: linear-gradient(180deg, var(--fz-gold-hi) 0%, var(--fz-gold) 55%, var(--fz-gold-deep) 130%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 18px -6px rgba(247,107,28,.45);
  transition: filter .2s, box-shadow .2s, transform .2s, opacity .2s ease; }
.fz-hero-on .ia-btn:hover:not(:disabled) { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 8px 24px -6px rgba(247,107,28,.6); }
.fz-hero-on .ia-btn:active { transform: translateY(1px); filter: brightness(.96); }
/* hero 提示行：居中、放大一档；进度色收向香槟 */
.fz-hero-on .ia-sub { text-align: center; margin-top: 20px; font-size: 13px; letter-spacing: .6px; color: rgba(242,240,234,.34); animation: fzFadeIn .5s ease .25s both; }
.fz-hero-on .ia-sub.prog { color: var(--fz-gold); }
@keyframes fzFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fzHeroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .fz-hero-title { font-size: 34px; letter-spacing: 4px; }
  .fz-hero-on .ia-bar:not(.ia-collapsed) { height: 56px; }
  .fz-panel.fz-hero-on { padding-top: 56px; min-height: 460px; }
}

/* 选图阶段标题行：标题左、紧凑工具条右（h2 保留默认 margin 维持原垂直节奏；窄屏 wrap 到下一行右对齐） */
/* 链接裂变 · 顶部阶段 stepper（workspace 内、panel 之前；暗底金色） */
.fz-stepper { display: flex; align-items: center; gap: 18px; padding: 13px 22px; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; flex: none; }
.fz-step-back { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600;
  background: transparent; border: 0; cursor: pointer; font-family: inherit; padding: 6px 8px; border-radius: 8px; transition: all .15s; }
.fz-step-back:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.fz-step-back.disabled { opacity: .3; cursor: default; pointer-events: none; }
.fz-step-title { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.fz-steps { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fz-step { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; border: 0;
  background: transparent; font-family: inherit; cursor: default; }
.fz-step .dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex: none; transition: all .2s; }
.fz-step .lbl { font-size: 14px; font-weight: 600; white-space: nowrap; transition: color .2s; }
.fz-step.done { cursor: pointer; }
.fz-step.done .dot { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring); }
.fz-step.done .lbl { color: var(--fg); }
.fz-step.done:hover { background: rgba(255,255,255,.05); }
.fz-step.done:hover .dot { background: var(--accent); color: #000; }
.fz-step.cur .dot { background: var(--accent); color: #000; box-shadow: 0 0 16px rgba(247,107,28,.45); }
.fz-step.cur .lbl { color: var(--fg); }
.fz-step.future .dot { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--border); }
.fz-step.future .lbl { color: var(--muted); }
.fz-sep { width: 34px; height: 1px; border-top: 1px dashed var(--border-strong); flex: none; }
.fz-sep.passed { border-top-color: var(--accent-ring); }
@media (max-width: 720px) { .fz-step .lbl { display: none; } .fz-stepper { gap: 10px; padding: 11px 14px; } .fz-sep { width: 18px; } }

.fz-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.fz-title-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.fz-menu-trigger{height:34px;display:inline-flex;align-items:center;gap:7px;padding:0 12px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--fg);font:inherit;font-size:13px;cursor:pointer}
.fz-menu-trigger:hover,.fz-menu-trigger.open{background:var(--panel-strong);border-color:var(--border-strong)}
.fz-action-menu{position:absolute;z-index:60;min-width:190px;padding:5px;border:1px solid var(--border-strong);border-radius:8px;background:#18181d;box-shadow:0 14px 34px rgba(0,0,0,.48)}
.fz-action-menu-top{top:calc(100% + 6px);left:0}.fz-action-menu-bottom{right:0;bottom:calc(100% + 6px)}
.fz-action-menu button{display:block;width:100%;padding:8px 10px;border:0;border-radius:6px;background:transparent;color:var(--fg);font:inherit;font-size:12.5px;text-align:left;cursor:pointer}
.fz-action-menu button:hover:not(:disabled){background:rgba(255,255,255,.08)}.fz-action-menu button:disabled{opacity:.4;cursor:default}
.fz-mini-btn { background: var(--panel); color: var(--fg); border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; padding: 6px 14px; cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background .15s, border-color .15s; }
.fz-mini-btn:hover { background: var(--panel-strong); border-color: var(--border-strong); }
.fz-gen-btn { background: var(--accent); color: var(--on-bg); border: none; border-radius: 9px;
  font-size: 13px; font-weight: 600; padding: 8px 18px; cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: filter .15s; }
.fz-gen-btn:hover:not(:disabled) { filter: brightness(1.06); }
.fz-gen-btn:disabled { background: rgba(255,255,255,.12); color: var(--muted); cursor: not-allowed; }
.fz-aspect-group { margin-bottom: 22px; scroll-margin-top: 64px; }  /* 锚点/聚焦时为吸顶工具栏留空 */
.fz-ag-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.fz-ag-head .ar { font-size: 15px; font-weight: 700; }
.fz-ag-head .cnt { font-size: 12px; color: var(--muted); }
.fz-ag-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); align-items: start; }
.fz-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; transition: border-color .15s, box-shadow .15s; }
.fz-card.sel { border-color: var(--border-strong); box-shadow: 0 0 0 1px rgba(255,255,255,.06); }
.fz-thumb { position: relative; border-radius: 8px; overflow: hidden; }
.fz-thumb img { width: 100%; height: auto; display: block; }  /* 按图片真实比例显示，不拉伸不裁切 */
.fz-aspect-pill { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 600; color: #d8d8de; background: rgba(0,0,0,.5); padding: 2px 7px; border-radius: 999px; }
.fz-idx-pill { position: absolute; top: 8px; right: 8px; font-size: 10px; color: #a8a8b0; background: rgba(0,0,0,.4); padding: 2px 7px; border-radius: 999px; }
.fz-card-chips { display: flex; gap: 7px; margin-top: 8px; }
.fz-chip-col { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fz-chip-wrap { position: relative; display: flex; }
.fz-chip { width: 100%; font-size: 12px; font-weight: 600; padding: 7px 4px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: all .12s; }
.fz-chip.bg.on { background: var(--bg-chip-soft); border-color: var(--bg-chip-ring); color: #bcd3ff; }
.fz-chip.pose.on { background: var(--pose-chip-soft); border-color: var(--pose-chip-ring); color: #aef0c8; }
.fz-chip-pop { position: absolute; bottom: calc(100% + 6px); left: 0; width: 200px; background: #1b1b20; border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.55); z-index: 30; opacity: 0; visibility: hidden; transform: translateY(5px); transition: opacity .12s, transform .12s; }
/* hover 弹出；focus-within 锁定：点进面板(选项/自定义输入框获焦)后即使鼠标移开也不收起，
   修「自定义文案输入框打字时面板闪退」(纯 hover 面板容不下文本输入) */
.fz-chip-wrap:hover .fz-chip-pop,
.fz-chip-wrap:focus-within .fz-chip-pop { opacity: 1; visibility: visible; transform: none; }
.fz-chip-pop::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 10px; }
.fz-chip-wrap.pose .fz-chip-pop { left: auto; right: 0; }
.fz-chip-pop.down { top: calc(100% + 6px); bottom: auto; }  /* #4 顶排卡片：上方空间不足时改向下弹，不盖比例标题 */
.fz-chip-pop.down::after { top: auto; bottom: 100%; }
.fz-chip-pop .pl { font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.fz-chip-pop .pl.bg { color: #bcd3ff; }
.fz-chip-pop .pl.pose { color: #aef0c8; }
.fz-chip-pop .opt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cfcfd6; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.fz-chip-pop .opt:hover { background: var(--card); }
.fz-chip-pop .opt input { width: auto; accent-color: var(--accent); margin: 0; flex: none; }
.fz-custom { width: 100%; background: var(--stage); border: 1px solid var(--border); border-radius: 7px; color: var(--fg); font-size: 12px; padding: 7px 9px; margin-top: 4px; }
.fz-chip-cap { font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 链接裂变重设计：结果对比视图 ===== */
.fz-rtoolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: rgba(18,18,22,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 16px; position: sticky; top: 8px; z-index: 20; }  /* 实底+磨砂：sticky 滚动时把下方组标题模糊化盖住，不再透出清晰文字（原 --panel-strong 半透会重叠） */
.fz-breview-toolbar{position:sticky;top:8px;z-index:20;display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding:12px 14px;margin-bottom:8px;border:1px solid var(--border);border-radius:8px;background:rgba(18,18,22,.94);backdrop-filter:blur(10px)}
.fz-breview-toolbar b{font-size:15px}.fz-breview-toolbar span{font-size:12.5px;color:#d6d6dc}.fz-breview-toolbar small{margin-left:auto;color:var(--muted);font-size:11.5px}
.fz-breview-group{padding:16px 0 20px;border-bottom:1px solid var(--border)}
.fz-breview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.fz-breview-head div{min-width:0}.fz-breview-head b{display:block;font-size:15px}.fz-breview-head span{display:block;margin-top:3px;color:var(--muted);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fz-breview-head small{flex:none;color:#b8bac2;font-size:11.5px}
.fz-breview-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:12px}
.fz-breview-pair{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px;border:1px solid var(--border);border-radius:8px;background:rgba(255,255,255,.025);min-width:0}
.fz-breview-media{position:relative;aspect-ratio:3/4;min-width:0;overflow:hidden;border-radius:6px;background:var(--stage)}
.fz-breview-media>img{width:100%;height:100%;display:block;object-fit:contain}.fz-breview-media .fz-rstate{width:100%;height:100%;aspect-ratio:auto;border-radius:0;padding:10px;text-align:center}.fz-breview-media .fz-rstate span{font-size:10.5px;font-weight:400;line-height:1.35;overflow-wrap:anywhere}
.fz-breview-copy-hover{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;background:rgba(10,10,13,.48);opacity:0;transition:opacity .15s}
.fz-breview-generated:hover .fz-breview-copy-hover{opacity:1}
.fz-breview-copy-hover button{display:inline-flex;align-items:center;gap:5px;padding:7px 10px;border:1px solid rgba(247,107,28,.5);border-radius:6px;background:rgba(18,18,22,.92);color:#f9a76b;font-family:inherit;font-size:11px;line-height:1;font-weight:700;cursor:pointer}
.fz-breview-copy-hover svg{width:14px;height:14px}
.fz-breview-copy-running{position:absolute;inset:0;z-index:4;display:flex;align-items:center;justify-content:center;gap:7px;background:rgba(10,10,13,.66);color:#f9a76b;font-size:12px;font-weight:700}
.fz-breview-copy-running .fz-spin{width:16px;height:16px;margin:0}
.fz-breview-copy-editor{position:absolute;inset:7px;z-index:5;display:flex;flex-direction:column;gap:7px;padding:10px;border:1px solid rgba(247,107,28,.5);border-radius:6px;background:rgba(18,18,22,.97);box-shadow:0 12px 30px rgba(0,0,0,.42)}
.fz-breview-copy-editor label{color:#f2f2f4;font-size:11.5px;font-weight:700;padding-right:22px}
.fz-breview-copy-editor textarea{flex:1;min-height:64px;resize:none;border:1px solid var(--border);border-radius:6px;background:rgba(255,255,255,.045);color:var(--fg);padding:8px;font-family:inherit;font-size:11px;line-height:1.5;outline:none}
.fz-breview-copy-editor textarea:focus{border-color:var(--accent)}
.fz-breview-copy-editor .err{color:#fca5a5;font-size:10px;line-height:1.3;max-height:40px;overflow:auto}
.fz-breview-copy-close{position:absolute;top:6px;right:6px;width:24px;height:24px;border:0;background:transparent;color:var(--muted);font-size:18px;line-height:1;cursor:pointer}
.fz-breview-copy-close:hover{color:var(--fg)}
.fz-breview-copy-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.fz-breview-copy-actions span{color:var(--muted);font-size:9.5px}
.fz-breview-copy-actions button{padding:6px 9px;border:0;border-radius:6px;background:var(--accent);color:#1a1300;font-family:inherit;font-size:10.5px;line-height:1;font-weight:700;cursor:pointer}
.fz-breview-copy-actions button:disabled{opacity:.5;cursor:default}
.fz-breview-pair footer{grid-column:1/-1;display:flex;align-items:center;gap:8px;min-height:28px;padding:2px 3px 0;color:var(--muted);font-size:11px}.fz-breview-pair footer>span{min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fz-breview-pair footer button{flex:none;padding:5px 8px;border:1px solid rgba(239,68,68,.35);border-radius:6px;background:rgba(239,68,68,.09);color:#fca5a5;font:inherit;cursor:pointer}.fz-breview-pair footer small{flex:none;color:var(--muted)}
@media(max-width:620px){.fz-breview-grid{grid-template-columns:1fr}.fz-breview-pair{grid-template-columns:1fr}.fz-breview-pair footer{grid-column:1}.fz-breview-toolbar small{width:100%;margin-left:0}}
.fz-rprog { font-size: 13px; font-weight: 600; }
.fz-racts { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* 结果视图顶栏：两个并列等大的方向按钮（裂变新链接 / 替换原链接，co-equal 二选一） */
.fz-dir-group { display: flex; align-items: flex-start; gap: 12px; }
.fz-dir-btn {
  width: 220px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 11px 16px; min-height: 56px;
  border-radius: var(--radius); cursor: pointer; font-family: inherit;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent);
  transition: all .18s ease;
}
.fz-dir-btn:hover { background: rgba(247,107,28,0.22); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(247,107,28,0.18); }
.fz-dir-btn:active { transform: translateY(0); }
.fz-dir-main { font-size: 15px; font-weight: 700; line-height: 1.2; }
.fz-dir-sub { font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1.2; }
.fz-rcols { display: flex; flex-wrap: wrap; gap: 12px; align-items: start; }
.fz-rcol { display: flex; flex-direction: column; gap: 8px; width: 150px; }
.fz-rsep { font-size: 11px; color: var(--muted); text-align: center; }
.fz-rcard .fz-thumb { position: relative; }
.fz-rhover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .12s; z-index: 4; }  /* #2 生成图悬停操作层 */
.fz-rcard .fz-thumb:hover .fz-rhover { opacity: 1; }
.fz-rhover button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.5); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.fz-rhover button:hover:not(:disabled) { background: var(--accent); color: #000; border-color: var(--accent); }
.fz-rhover button:disabled { opacity: .45; cursor: not-allowed; }
.fz-rcap { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.fz-badge { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.fz-badge.orig { background: rgba(255,255,255,.16); color: #e6e6ea; }
.fz-badge.gen { background: var(--accent); color: #000; }
.fz-badge.keep { background: rgba(255,255,255,.10); color: var(--muted); }
.fz-vtag { position: absolute; bottom: 6px; left: 6px; right: 6px; font-size: 10px; font-weight: 600; text-align: center; padding: 2px 4px; border-radius: 5px; }
.fz-vtag.bg { background: var(--bg-chip-soft); color: #bcd3ff; }
.fz-vtag.pose { background: var(--pose-chip-soft); color: #aef0c8; }
.fz-rstate { aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--stage); border-radius: 8px; font-size: 12px; color: var(--muted); }
.fz-rstate.fail { color: var(--danger); }
.fz-rstate.timeout { color: #e0681a; }  /* 软超时：琥珀色，区别于红色硬失败——图很可能在后台跑完、会进历史 */
.fz-rstate.insufficient { color: #f76b1c; font-weight: 600; background: rgba(247,107,28,.08); }  /* 余额不足·已跳过：品牌橙+浅橙底，点右上角充值后可单张补生成 */
.fz-rstate.queued { color: var(--muted); opacity: .6; }  /* 排队中：比"生成中"更淡、沙漏静态不转，逐张排队时还没轮到的张显示这个 */
/* 裂变结果勾选圈：勾选=采用（完成自动勾上，取消=不推送这张）。仿 .gen-cell-check。
   z-index 必须高于 .fz-rhover(4)：悬停操作层 inset:0 铺满整图，压住圈会让点击全部落空 */
.fz-pick {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1.5px solid rgba(255,255,255,.6);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; color: transparent; transition: all .12s ease; z-index: 5;
}
.fz-pick:hover { background: rgba(0,0,0,.75); border-color: #fff; }
.fz-pick.on { background: var(--accent); border-color: var(--accent); color: var(--on-bg); box-shadow: 0 2px 8px rgba(247,107,28,.4); }
.fz-pick svg.lucide { width: 13px; height: 13px; stroke-width: 3; }
.fz-spin { width: 20px; height: 20px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: fzspin .8s linear infinite; }
@keyframes fzspin { to { transform: rotate(360deg); } }
.choice-desc { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.choice.on .choice-desc { color: rgba(247,107,28,.7); }
/* 场景角度标签：正面=蓝、侧面=紫，挂在 choice-block 的右上角 */
.preset-view-tag {
  position: absolute; top: 6px; right: 8px;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 8px;
  letter-spacing: 0.02em;
}
.preset-view-tag.is-front { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
.preset-view-tag.is-side  { background: rgba(192, 132, 252, 0.18); color: #c4b5fd; }
.choice.on .preset-view-tag.is-front { background: rgba(96, 165, 250, 0.28); color: #bfdbfe; }
.choice.on .preset-view-tag.is-side  { background: rgba(192, 132, 252, 0.28); color: #ddd6fe; }
.choice-num { width: 40px; height: 40px; text-align: center; padding: 0; }

/* radio 列表 */
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; cursor: pointer;
}
.radio-row input { margin: 2px 0 0; accent-color: var(--accent); }
.radio-row .r-sub { font-size: 11px; color: var(--muted); }

/* 上传区 */
.upload {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 24px 12px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 12px; line-height: 1.6;
  background: var(--card);
  transition: all .18s ease;
}
.upload:hover, .upload.dragover {
  border-color: var(--accent-ring); background: var(--accent-soft);
  color: var(--fg);
}
.upload-preview { position: relative; display: inline-block; }
.upload-preview img { max-height: 200px; border-radius: var(--radius); display: block; }
.upload-x {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--on-bg); border: none;
  font-size: 14px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(247,107,28,0.35);
}

/* 按钮 */
.btn-primary {
  width: 100%; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: var(--on-bg); border: none;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  line-height: 1.4; min-height: 42px;
  transition: all .18s ease;
  box-shadow: 0 8px 24px rgba(247,107,28,0.22),
              0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(247,107,28,0.32),
              0 1px 0 rgba(255, 255, 255, 0.3) inset;
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.btn-text {
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0;
  font-family: inherit;
}
.btn-text:hover { color: var(--fg); }
.btn-pager { display: inline-flex; align-items: center; gap: 4px; }

/* 历史页码栏：完整页码版（[<] 1 2 ... 5 [6] 7 ... 12 [>]） */
.pager-bar {
  display: flex; align-items: center; gap: 4px;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.pager-btn {
  min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-family: inherit; font-size: 12px;
  transition: all .15s ease;
}
.pager-btn:hover:not(:disabled) { background: var(--card-hover); color: var(--fg); border-color: var(--border-strong); }
.pager-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pager-btn.on {
  background: var(--accent); color: var(--on-bg); border-color: var(--accent);
  font-weight: 600;
}
.pager-arrow svg.lucide { width: 12px; height: 12px; }
.pager-ellipsis { color: var(--muted); padding: 0 4px; }
.pager-info { font-size: 11px; color: var(--muted); margin-left: 10px; }

input[type="text"], textarea {
  width: 100%; font-size: 13px; padding: 9px 12px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit;
  transition: all .15s ease;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { margin-top: 8px; resize: vertical; line-height: 1.6; }

/* ===== 右栏:空状态 / 进度 / 结果 ===== */
.empty {
  min-height: 640px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; gap: 18px;
}
.empty-illust { max-width: 280px; width: 60%; opacity: .9; display: block; }
.empty-icon-fallback { stroke-width: 1.5; opacity: .35; }
svg.lucide.empty-icon-fallback { width: 60px; height: 60px; }

/* ===== Lucide 图标通用 ===== */
svg.lucide {
  width: 1em; height: 1em; stroke-width: 2;
  vertical-align: -0.125em; flex-shrink: 0;
}
svg.lucide.inline-icon { width: 0.85em; height: 0.85em; margin-left: 4px; }
/* 三按钮图标·金色点睛版（2026-06-13）：比文字略大、右留间距 */
svg.lucide.bic { width: 15px; height: 15px; margin-right: 5px; vertical-align: -3px; }
.upload-x { display: inline-flex; align-items: center; justify-content: center; }
.upload-x svg.lucide { width: 14px; height: 14px; stroke-width: 2.5; }
/* .tab 已用 flex gap 处理图标-文字间距 */
.btn-primary svg.lucide { width: 1.05em; height: 1.05em; }

.progress-wrap { margin-bottom: 20px; }
.progress-text { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.progress-track {
  height: 6px; background: var(--card); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; background: var(--accent); transition: width .4s ease;
  box-shadow: 0 0 12px rgba(247,107,28,0.5);
}
.indeterminate-bar {
  position: relative; overflow: hidden; height: 6px;
  background: var(--card); border-radius: 999px; border: 1px solid var(--border);
}
.indeterminate-bar::after {
  content: ""; position: absolute; left: -40%; top: 0; bottom: 0;
  width: 40%; background: var(--accent);
  animation: indeterminate 1.2s infinite ease-in-out;
}
@keyframes indeterminate { 0% { left: -40%; } 100% { left: 100%; } }

.section-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; letter-spacing: -0.01em; }

.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.result-head { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.result-imgs { display: grid; }
.result-imgs.multi { grid-template-columns: repeat(2, 1fr); }
.result-imgs img { width: 100%; display: block; }
.result-meta { padding: 8px 12px; font-size: 11px; color: var(--muted); }
.fallback-note { color: var(--accent); margin-top: 4px; }
.result-pending, .result-failed { padding: 20px 14px; text-align: left; font-size: 12px; }
.result-pending { color: var(--muted); text-align: center; }
.result-failed { color: var(--danger); }
.result-failed .err-title { font-weight: 600; margin-bottom: 8px; text-align: center; }
.result-failed .err-zh {
  color: var(--fg);
  background: rgba(239,68,68,0.08); border-left: 3px solid var(--danger);
  padding: 8px 10px; border-radius: 4px; line-height: 1.6; margin-bottom: 8px;
}
.result-failed .err-raw { color: var(--muted); font-size: 10px; word-break: break-all; opacity: 0.7; line-height: 1.5; }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 8px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 历史 tab — 卡片统一规格 =====
   每张卡固定 320px 高：图区 220px（contain 完整显示，不裁不变形）+ body 100px（紧凑信息） */
.history-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  column-gap: 14px; row-gap: 4px;  /* 横向保留，纵向贴紧 */
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
.history-card {
  height: 320px;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all .18s ease;
}
.history-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
/* 图区：固定 220px 高，contain 让任意比例的图都完整显示，留白用深底色 */
.history-card > a {
  height: 220px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a0a; overflow: hidden;
}
.history-card > a img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
/* 缩略图占位：404 兜底（thumb-missing，文件意外缺失）+ 过期自动清理（thumb-purged，retention 删的） */
.history-card > a.thumb-missing, .history-card > a.thumb-purged { background: #1d1d1a; text-decoration: none; }
.history-card > a.thumb-missing img { display: none; }
.history-card > a.thumb-missing::before {
  content: '🗂 图片已清理 / 缺失';
  font-size: 12px; color: #7a7468;
}
.history-card > a.thumb-purged::before {
  content: '🗂 已过期自动清理';
  font-size: 12px; color: #7a7468;
}
/* body：100px 高紧凑信息，3 行内容 + 底部 footer 自动贴底 */
.history-body {
  flex: 1; min-height: 0;
  padding: 10px 12px;
  display: flex; flex-direction: column;
  font-size: 11px;
  overflow: hidden;
}
.history-body .h-preset {
  font-size: 13px; font-weight: 600; color: var(--fg);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-body .h-meta {
  color: var(--muted); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-body .h-foot {
  color: #666; font-size: 10px;
  margin-top: auto; padding-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 提示词设置 modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-panel {
  background:
    linear-gradient(135deg, rgba(247,107,28,0.04), transparent),
    rgba(24, 24, 28, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: min(720px, 92vw); max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.modal-wide {
  width: 96vw;
  max-width: none;
  height: 94vh;
  max-height: 94vh;
}
.modal-wide .modal-body { padding: 18px 24px; }
.modal-wide .prompt-area { min-height: 320px; }
/* 本地保存等小设置：紧凑居中弹窗（按内容高度，不撑满屏），替代撑满屏的 modal-wide */
.modal-compact { width: min(440px, 92vw); overflow: visible; }
.modal-compact .modal-body { padding: 18px 22px; }
.ls-lead { display: block; font-size: 13px; color: var(--muted, #8b909b); margin-bottom: 10px; }
.ls-folder-ico { margin-right: 1px; }
.ls-reauth-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--warn, #e0a23c); }
/* 本地保存：点击=直接弹系统选文件夹框（不是下拉菜单） */
.ls-locbox { width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 13px; background: var(--card); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-family: inherit; font-size: 13px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.ls-locbox:hover:not(:disabled) { border-color: var(--accent, #f76b1c); box-shadow: 0 0 0 3px var(--accent-soft, rgba(247,107,28,0.12)); }
.ls-locbox:disabled { opacity: .5; cursor: not-allowed; }
.ls-locbox-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-locbox-action { flex: none; color: var(--accent, #f76b1c); font-size: 12px; font-weight: 500; }
.ls-alt { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.ls-alt-link { background: none; border: none; padding: 0; color: var(--muted, #8b909b); font-size: 12px; cursor: pointer; font-family: inherit; }
.ls-alt-link:hover { color: var(--fg); text-decoration: underline; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; margin: 0; letter-spacing: -0.01em; }

/* settings modal 顶部 tabs（提示词/用量/接口） */
.settings-tabs { display: flex; gap: 4px; margin-left: 24px; flex: 1; }
.settings-tab {
  font-size: 12px; padding: 6px 14px; border-radius: var(--radius);
  background: transparent; color: var(--muted); border: 1px solid transparent;
  cursor: pointer; font-family: inherit; transition: all .15s ease;
}
.settings-tab:hover { color: var(--fg); background: var(--card); }
.settings-tab.on {
  background: var(--accent); color: var(--on-bg); font-weight: 600;
  border-color: var(--accent);
}

/* 用量统计 - 顶部 stat 卡片网格 */
.usage-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; text-align: left;
}
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-val { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

/* 通用 settings 表格 */
.settings-section-title { font-size: 13px; margin: 18px 0 8px; font-weight: 600; color: var(--fg); }
.settings-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.settings-table th, .settings-table td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.settings-table th { color: var(--muted); font-weight: 500; background: var(--card); }
.settings-table td.cell-label { color: var(--muted); width: 35%; }

/* 接口配置 - engine 卡片 */
.config-list { display: flex; flex-direction: column; gap: 10px; }
.config-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.config-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.config-name { font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.config-badge {
  padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.config-status { font-size: 11px; font-weight: 600; }
.config-status.ok { color: #4ade80; }
.config-status.miss { color: var(--danger); }
.config-meta { font-size: 11px; color: var(--muted); display: flex; gap: 14px; margin-bottom: 4px; font-family: Menlo, monospace; }
.config-url { font-size: 11px; color: var(--muted); font-family: Menlo, monospace; word-break: break-all; }
.config-note { font-size: 11px; color: var(--accent); margin-top: 4px; }

.modal-foot-meta { font-size: 12px; color: var(--muted); }
.modal-x {
  background: transparent; border: none; color: var(--muted);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
  font-family: inherit;
}
.modal-x:hover { color: var(--fg); }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
.modal-loading, .modal-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-foot-right { display: flex; align-items: center; gap: 12px; }
.modal-confirm { width: auto; padding: 8px 18px; font-size: 13px; }

/* 全局规则展示区（modal 顶部，可折叠、只读） */
.prompt-global {
  background: linear-gradient(135deg, rgba(247,107,28,0.04), rgba(247,107,28,0.02)),
              rgba(255,255,255,0.03);
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.prompt-global summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  outline: none;
}
.prompt-global summary::-webkit-details-marker { display: none; }
.prompt-global summary::before {
  content: "▸"; color: var(--muted); font-size: 10px; transition: transform .2s;
}
.prompt-global[open] summary::before { transform: rotate(90deg); }
.prompt-global-body { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.prompt-global-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-family: Menlo, monospace; }
.prompt-readonly {
  background: rgba(0,0,0,0.2);
  color: #c8c8d0;
  cursor: default;
  border-color: rgba(255,255,255,0.06);
}
.prompt-readonly:focus { box-shadow: none; border-color: rgba(255,255,255,0.06); }

/* === 提示词设置 modal 左右两栏布局 ===
   注意：用 .modal-body.settings-split 提升 specificity 到 (0,2,0)，
   平 .modal-wide .modal-body 的 specificity，靠后定义 win；
   不能用 !important，否则会盖住 Vue v-show 的 inline display:none，导致切 tab 时不隐藏。 */
.modal-body.settings-split {
  display: flex;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

/* 左侧导航 */
.settings-sidebar {
  width: 240px; flex-shrink: 0;
  background: rgba(0, 0, 0, 0.18);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.sidebar-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
  margin-bottom: 4px; padding: 0 10px;
}
.sidebar-loading { color: var(--muted); font-size: 12px; padding: 8px 10px; }
.sidebar-item {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 8px 10px;
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 6px;
  font-size: 13px; cursor: pointer; text-align: left;
  font-family: inherit;
  transition: all .12s ease;
}
.sidebar-item:hover { background: var(--card); color: var(--fg); }
.sidebar-item.on {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-ring);
  font-weight: 600;
}
.sidebar-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; flex-shrink: 0;
}
.sidebar-flag {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: rgba(247,107,28,0.18); color: var(--accent);
  font-weight: 600; flex-shrink: 0;
}
.sidebar-item-icon { font-size: 14px; flex-shrink: 0; }
.sidebar-item-global { color: var(--accent); }
.sidebar-item-global:hover { background: rgba(247,107,28,0.06); color: var(--accent); }
.sidebar-item-global.on {
  background: var(--accent); color: var(--on-bg);
  border-color: var(--accent);
}

/* 全局规则（折叠到 sidebar 底部） */
.sidebar-global {
  background: rgba(247,107,28,0.04);
  border: 1px solid var(--accent-ring);
  border-radius: 6px;
  margin-top: auto;
}
.sidebar-global summary {
  list-style: none; cursor: pointer;
  padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--accent); font-weight: 600;
  outline: none;
}
.sidebar-global summary::-webkit-details-marker { display: none; }
.sidebar-global summary::after {
  content: "▸"; color: var(--muted); font-size: 10px; transition: transform .2s;
}
.sidebar-global[open] summary::after { transform: rotate(90deg); }
.sidebar-global-hint { color: var(--muted); font-size: 10px; font-weight: 400; margin-right: 6px; }
.sidebar-global-body {
  padding: 10px; border-top: 1px solid var(--accent-ring);
}
.sidebar-global-body .prompt-area { font-size: 11px; padding: 8px; }
.sidebar-global-note { font-size: 10px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }

/* 右侧内容区 */
.settings-content {
  flex: 1; padding: 22px 26px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  min-width: 0;
}
.content-pane { display: flex; flex-direction: column; height: 100%; min-height: 360px; }
.content-head { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.content-title { font-size: 17px; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.01em; }
.content-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meta-pill {
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  background: rgba(255, 255, 255, 0.06); color: var(--muted);
}
.meta-pill.active { background: rgba(34, 197, 94, 0.18); color: #4ade80; font-weight: 600; }
.meta-pill.warn { background: rgba(247,107,28,0.18); color: var(--accent); font-weight: 600; }
.content-textarea {
  flex: 1; min-height: 360px;
  font-size: 13px; line-height: 1.65;
}

/* 全局规则满幅展示（替代之前的小框） */
.content-global-grid {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  min-height: 0;
}
.content-global-block {
  display: flex; flex-direction: column;
  min-height: 0;
}
.content-textarea-readonly {
  flex: 1; min-height: 120px;
  font-size: 12px; line-height: 1.65;
  margin-top: 4px;
}

/* 提示词 modal 的场景目录 chip（旧版，保留兼容用，新版用 sidebar-item） */
.prompt-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.prompt-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 7px 12px; border-radius: var(--radius);
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.prompt-tab:hover { color: var(--fg); border-color: var(--border-strong); }
.prompt-tab.on {
  background: var(--accent); color: var(--on-bg);
  border-color: var(--accent); font-weight: 600;
  box-shadow: 0 2px 8px rgba(247,107,28,0.25);
}
.prompt-tab-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.prompt-tab.on .prompt-tab-dot { background: rgba(0,0,0,0.5); }
.prompt-tab-flag {
  padding: 0 6px; border-radius: 3px; font-size: 10px; font-weight: 600;
  background: rgba(247,107,28,0.18); color: var(--accent);
}
.prompt-tab.on .prompt-tab-flag { background: rgba(0,0,0,0.18); color: var(--on-bg); }

.prompt-section { margin-bottom: 16px; }
.prompt-section:last-child { margin-bottom: 0; }
.prompt-section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px; font-size: 12px;
}
.prompt-section-title { color: var(--accent); font-weight: 600; }
.prompt-section-meta { color: var(--muted); }
.prompt-section-tag {
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  background: rgba(255,255,255,0.06); color: var(--muted);
}
.prompt-section-tag.active {
  background: rgba(34,197,94,0.18); color: #4ade80;
}
.prompt-section-flag {
  margin-left: auto; padding: 2px 8px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px;
}
.prompt-area {
  width: 100%;
  font-family: "SF Mono", "PingFang SC", Menlo, monospace;
  font-size: 12px; line-height: 1.6; padding: 10px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  resize: vertical; min-height: 200px;
  transition: all .15s ease;
}
.prompt-area:focus {
  outline: none;
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ===== 模特描述 tab ===== */
.settings-tab-hint {
  margin: 0 0 16px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; color: var(--fg-muted); line-height: 1.5;
}
.body-desc-row { margin-bottom: 18px; }
.body-desc-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.body-desc-label { font-size: 13px; font-weight: 500; color: var(--fg); }
.body-desc-row .prompt-area { min-height: 90px; }

/* ===== 图片 lightbox ===== */
.lightbox-backdrop {
  background: rgba(0,0,0,0.94);
  flex-direction: column;
  padding: 24px;
}
.lightbox-close {
  position: absolute; top: 12px; right: 18px;
  font-size: 32px; color: var(--fg); z-index: 1002;
}
.lightbox-img {
  max-width: 92vw; max-height: 82vh;
  object-fit: contain; border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  background: #000;
}
.lightbox-bar {
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 16px;
}
/* lightbox / 编辑面板里的按钮：横排不换行；.btn-primary 默认 width:100% 在这里不适用 */
.lightbox-bar .btn-primary, .lightbox-bar .btn-secondary, .lightbox-bar .btn-text,
.edit-actions .btn-primary, .edit-actions .btn-secondary, .edit-actions .btn-text {
  width: auto;
  white-space: nowrap;
  flex: 0 0 auto;
}
.lightbox-download {
  padding: 9px 22px; font-size: 13px;
  text-decoration: none;
}
.lightbox-tip { font-size: 11px; color: var(--muted); }

/* 提示词改图：lightbox 内输入条独占一行 */
.lightbox-iteration-row {
  display: flex; align-items: stretch; gap: 10px;
  margin-bottom: 18px;
  max-width: 720px; width: 100%;
}
.lightbox-iteration-input {
  flex: 1; min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font: inherit;
  resize: vertical;
}
.lightbox-iteration-input:focus {
  outline: none;
  border-color: #f76b1c;
  background: rgba(255,255,255,0.10);
}
.lightbox-iteration-row .btn-primary,
.lightbox-iteration-row .btn-secondary {
  width: auto; white-space: nowrap; flex: 0 0 auto;
  padding: 0 18px;
}
.result-card img, .history-card img { cursor: zoom-in; }

/* lightbox 内的次按钮（"编辑加文案"） */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.08); color: var(--fg);
  border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius);
  cursor: pointer; transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.16); }
.btn-secondary svg.lucide { width: 1.05em; height: 1.05em; }

/* ===== lightbox 编辑模式 ===== */
.edit-stage {
  width: 96vw; max-width: 1400px; height: 90vh;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.edit-toolbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px;
  background: var(--panel-strong, #1c1c1c);
  border-bottom: 1px solid var(--border);
}
.edit-back { display: inline-flex; align-items: center; gap: 4px; }
.edit-title { font-size: 14px; font-weight: 500; }
.edit-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.edit-body { flex: 1; display: flex; min-height: 0; }
.edit-panel {
  flex: 0 0 320px; padding: 18px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.edit-tpl-name {
  font-size: 13px; color: var(--muted);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
/* 模板选择条 */
.edit-tpl-picker {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.edit-tpl-label { font-size: 12px; color: var(--muted); }
/* 字体样式：可点卡片 2 列 */
.edit-tpl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.edit-tpl-card {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 8px 9px; background: var(--card); color: #c2c7d0;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.edit-tpl-card:hover { border-color: var(--border-strong); color: #fff; }
.edit-tpl-card.on { background: linear-gradient(135deg, #ff8a3d, #f76b1c); border-color: transparent; color: #fff; }
.tpl-card-name { font-size: 12.5px; font-weight: 600; }
.tpl-card-desc { font-size: 10.5px; opacity: .72; line-height: 1.3; }
.edit-tpl-card.on .tpl-card-desc { opacity: .92; }
.edit-tpl-actions { display: flex; gap: 6px; }
/* 字体颜色：一排色块 + hex */
.edit-color { margin: 0 0 14px; }
.edit-color-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.edit-sw { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.edit-sw:hover { border-color: var(--border-strong); }
.edit-sw.on { border-color: #f76b1c; }
.edit-sw-hex { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; }
.edit-sw-hex input { width: 54px; background: transparent; border: 0; outline: none; color: var(--fg); font-size: 12px; font-family: inherit; }
.edit-tpl-select {
  flex: 1; padding: 6px 24px 6px 8px; font-size: 12px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit;
}
.btn-tpl-action {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; line-height: 1;
}
.btn-tpl-action:hover { background: var(--card-hover); border-color: var(--border-strong); }
.btn-tpl-delete:hover { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.5); color: var(--danger, #ef4444); }
/* B 模式：临时调整状态条 */
.edit-dirty-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 8px 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; color: var(--muted);
}
.edit-dirty-row.dirty {
  background: rgba(247,107,28,0.10);
  border-color: rgba(247,107,28,0.4);
  color: var(--fg);
}
.edit-dirty-state { flex: 1; }
.edit-dirty-actions { display: flex; gap: 6px; }
.btn-save-tpl {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  background: var(--accent); color: var(--on-bg);
  border: none; border-radius: 4px; cursor: pointer; font-family: inherit;
}
.btn-save-tpl:hover { filter: brightness(1.05); }
.btn-discard {
  padding: 4px 10px; font-size: 11px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-family: inherit;
}
.btn-discard:hover { color: var(--fg); border-color: var(--border-strong); }
/* 尺寸切换 tab */
.edit-aspect-tabs {
  display: flex; gap: 4px;
  background: var(--card); padding: 3px;
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 14px;
}
.edit-aspect-tab {
  flex: 1; padding: 6px 8px; font-size: 12px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--muted); cursor: pointer; font-family: inherit;
  transition: all .15s ease;
}
.edit-aspect-tab:hover { color: var(--fg); }
.edit-aspect-tab.on {
  background: var(--accent); color: var(--on-bg); font-weight: 600;
}
.edit-aspect-hint { font-size: 11px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.btn-apply-other {
  width: 100%; padding: 7px 10px; font-size: 12px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-family: inherit;
  margin-bottom: 14px;
  transition: all .15s ease;
}
.btn-apply-other:hover { background: var(--card-hover); border-color: var(--border-strong); }
.edit-field { margin-bottom: 14px; }
.edit-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.edit-field input[type=text] {
  width: 100%; padding: 9px 11px;
  background: #222; border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-size: 14px;
}
.edit-field textarea {
  width: 100%; padding: 9px 11px;
  background: #222; border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-size: 14px; font-family: inherit; line-height: 1.7;
  resize: vertical; min-height: 92px;
}
.edit-size-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 12px; color: var(--muted);
}
.edit-size-label { min-width: 76px; }
.edit-size-btn {
  width: 28px; height: 28px; border-radius: 6px;
  background: #2a2a2a; color: var(--fg); border: 1px solid var(--border);
  cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1;
}
.edit-size-btn:hover { background: #333; border-color: #555; }
.edit-size-val { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; color: var(--fg); }
.edit-hint { font-size: 11px; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.edit-error { font-size: 12px; color: var(--danger, #ef4444); margin-top: 12px; }
.edit-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: #0a0a0a; min-width: 0; min-height: 0;
}
/* 画布区域：多图时 inline style 会注入 aspect-ratio + height:100%（按第一张图撑开），
   箭头钉在它的左右边，切图不动；单图时无约束，stage 自适应 canvas 尺寸 */
.edit-canvas-stage {
  position: relative;
  max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.edit-canvas {
  display: block;
  max-width: 100%; max-height: 100%;
  border: 1px solid var(--border); border-radius: 6px;
  background: #222; user-select: none;
}
.edit-nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #111;
  cursor: pointer; z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: background .15s, transform .15s;
}
.edit-nav-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}
.edit-nav-arrow svg.lucide {
  width: 28px; height: 28px; stroke-width: 2.6;
}
.edit-nav-prev { left: 36px; }
.edit-nav-next { right: 36px; }

/* ===== 历史卡片：编辑型 task 徽章 ===== */
.history-card { position: relative; }
.history-card.is-edit { border-color: #C92C2C; }
.h-edit-badge {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; font-size: 11px; font-weight: 500;
  background: rgba(201, 44, 44, 0.92); color: #fff;
  border-radius: 10px;
  pointer-events: none;
}
.h-edit-badge svg.lucide { width: 12px; height: 12px; }

/* ===== 卡片右上角：收藏星标；左上角：拓展尺寸按钮 ===== */
.h-star, .h-expand-btn {
  position: absolute; top: 8px; z-index: 3;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); color: rgba(255, 255, 255, 0.7);
  cursor: pointer; font-size: 16px; line-height: 1;
  transition: background .15s, color .15s, transform .15s;
}
.h-star { right: 8px; }
.h-expand-btn { left: 8px; font-size: 14px; }
.h-star:hover, .h-expand-btn:hover { background: rgba(0, 0, 0, 0.75); color: #fff; }
.h-star.on { color: #f76b1c; background: rgba(0, 0, 0, 0.55); }
.h-star.on:hover { transform: scale(1.1); }

/* 拓展 picker：在卡片上覆盖一层选 aspect 的弹层 */
.expand-picker-overlay {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.expand-picker-overlay .expand-picker {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}

/* ===== 响应式:窄屏堆叠回单列 ===== */
@media (max-width: 860px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .workspace { flex-direction: column; }
  .panel { width: 100%; }
  .results { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 链接裂变 · 历史抽屉 V1 干净网格（只作用于 fission 抽屉 .as-drawer，不动其它 tab 历史）===== */
.as-drawer .history-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  column-gap: 14px; row-gap: 14px;
}
.as-drawer .history-card { height: auto; border-radius: var(--radius-lg); }
.as-drawer .history-card.is-fav { box-shadow: inset 0 0 0 2px var(--accent); }
/* 方图 cover，替代原 220px contain 黑边 */
.as-drawer .history-card > a,
.as-drawer .history-card .history-thumb-wrap,
.as-drawer .history-card > .history-pending-placeholder,
.as-drawer .history-card > .history-failed-placeholder {
  height: auto; aspect-ratio: 1 / 1; width: 100%;
}
.as-drawer .history-card > a img,
.as-drawer .history-card .history-thumb-wrap .history-thumb { object-fit: cover; }
/* 紧凑信息条；时间/用户悬停才显，减噪 */
.as-drawer .history-body { flex: none; padding: 8px 10px; }
.as-drawer .history-body .h-foot {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .18s ease, opacity .18s ease;
}
.as-drawer .history-card:hover .h-foot { max-height: 16px; opacity: 1; }
/* 占位卡也撑方形 + 配深色（原 cream 在暗底里突兀）*/
.as-drawer .history-pending-placeholder { background: rgba(255,255,255,0.03); }
.as-drawer .history-failed-placeholder { background: rgba(239,107,107,0.08); }
.as-drawer .history-pending-placeholder .pending-text,
.as-drawer .history-failed-placeholder .err-zh { color: var(--muted); }
.as-drawer .history-failed-placeholder .err-title { color: #ef6b6b; }
/* 卡片信息瘦身：默认只显「比例」，预设/引擎/成本/时间悬停才显 */
.as-drawer .h-dim { display: none; }
.as-drawer .history-card:hover .h-dim { display: block; }
.as-drawer .history-card:hover span.h-dim { display: inline; }
/* 主图组头部：突出「推送淘宝」主按钮、弱化「下载」 */
.as-drawer .btn-set-download { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.as-drawer .btn-set-push:not(.is-pushed) { background: var(--accent); color: #1a1a1a; border: none; font-weight: 600; }
/* 「裂变新链接」次级按钮：浅色卡片上用深炭底白字保证对比，层级低于黄色「替换原链接」主按钮 */
.as-drawer .btn-set-fission {
  font-size: 12px; padding: 4px 12px;
  background: #1a1a1a; color: #fff;
  border: none; border-radius: 4px;
  font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.as-drawer .btn-set-fission:hover { background: #3d3d3d; }
/* 单张悬停出「下载」按钮（左上角多选框下方，悬停才显）*/
.as-drawer .h-dl-btn {
  position: absolute; top: 40px; left: 6px; z-index: 3;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: rgba(0,0,0,.5); color: rgba(255,255,255,.8);
  opacity: 0; transition: opacity .15s, background .15s; cursor: pointer;
}
.as-drawer .history-card:hover .h-dl-btn { opacity: 1; }
.as-drawer .h-dl-btn:hover { background: rgba(0,0,0,.8); color: #fff; }
.as-drawer .h-dl-btn svg.lucide { width: 14px; height: 14px; }
/* 主图组卡片也用响应式网格（原固定 4 列在窄抽屉里挤成 88px 太小）*/
.as-drawer .history-set-cards { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
/* 链接裂变历史不做「加文案」：藏掉给主图组加文案按钮 + 编辑角标（铺量用不到，纯噪声）*/
.as-drawer .btn-set-edit,
.as-drawer .h-edit-badge { display: none; }

/* ===========================================================================
 * 用量与账单页（usage view）
 * 设计跟 frontend/usage-mockup.html 一致；mockup 文件保留作设计参考
 * =========================================================================== */

.usage-view { padding-top: 4px; }

/* —— 顶部 KPI 4 张卡 —— */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    rgba(22, 22, 26, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  position: relative;
  transition: all .18s ease;
}
.kpi-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.kpi-card.kpi-warn { border-color: rgba(247,107,28,0.45); }
.kpi-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-val-unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.kpi-delta { font-size: 11px; margin-top: 6px; }
.kpi-delta.up { color: #f87171; }
.kpi-delta.down { color: #4ade80; }
.kpi-spark { position: absolute; right: 12px; bottom: 10px; opacity: .5; }

/* —— 对账状态条 —— */
.recon-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px;
}
.recon-bar .recon-title { color: var(--muted); flex-shrink: 0; }
.recon-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(34,197,94,0.12); color: #4ade80;
  font-weight: 500;
}
.recon-chip.pending { background: rgba(247,107,28,0.15); color: var(--accent); }
.recon-chip.diff-bad { background: rgba(239,68,68,0.15); color: #f87171; }
.recon-chip-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.recon-bar .recon-action { margin-left: auto; }

/* —— 主体两栏：图表/表格 + 预算 —— */
.usage-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: flex-start; }

.usage-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005)),
    rgba(14, 14, 18, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.usage-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.usage-card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.usage-card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* —— 工具栏（维度/指标/时间切换） —— */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.toolbar-group { display: inline-flex; align-items: center; gap: 6px; }
.toolbar-group-label { color: var(--muted); }
.pill-group {
  display: inline-flex; background: var(--card);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px;
}
.pill {
  padding: 5px 11px; font-size: 11px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; border-radius: 4px; font-family: inherit;
  transition: all .12s;
}
.pill:hover { color: var(--fg); }
.pill.on { background: var(--accent); color: var(--on-bg); font-weight: 600; }

/* —— 趋势图（inline SVG） —— */
.chart-wrap { position: relative; height: 260px; margin-top: 8px; }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; }
.chart-svg { width: 100%; height: 100%; display: block; }
.chart-axis-label { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart-bar { transition: opacity .15s; cursor: pointer; }
.chart-bar:hover { opacity: 0.75; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }

/* —— 明细表 —— */
.detail-scroll { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.detail-table thead th {
  text-align: left; padding: 10px 8px; font-weight: 500;
  color: var(--muted); background: rgba(0,0,0,0.18);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.detail-table tbody td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.detail-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.detail-table tbody tr.row-diff { background: rgba(239,68,68,0.05); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: "SF Mono", Menlo, monospace; font-size: 11px; }
.recon-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.recon-status.estimated { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.recon-status.matched { background: rgba(34,197,94,0.16); color: #4ade80; }
.recon-status.diff { background: rgba(239,68,68,0.16); color: #f87171; }
.diff-text.up { color: #f87171; }
.diff-text.down { color: #4ade80; }
.req-id { color: var(--muted); cursor: copy; }
.req-id:hover { color: var(--accent); }

/* —— provider badge —— */
.prov-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.prov-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.prov-seedream { background: rgba(99,102,241,0.18); color: #a5b4fc; }
.prov-seedream::before { background: #6366f1; }
.prov-seedream-4 { background: rgba(168,85,247,0.18); color: #d8b4fe; }
.prov-seedream-4::before { background: #a855f7; }
.prov-nb2 { background: rgba(34,197,94,0.16); color: #86efac; }
.prov-nb2::before { background: #22c55e; }
.prov-dashscope { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.prov-dashscope::before { background: #94a3b8; }
.prov-other { background: rgba(247,107,28,0.15); color: var(--accent); }
.prov-other::before { background: var(--accent); }

/* —— 筛选 / 工具按钮 —— */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filter-input {
  padding: 6px 10px; font-size: 12px; min-width: 200px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit;
}
.filter-select {
  padding: 5px 26px 5px 10px; font-size: 12px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.btn-mini {
  font-size: 11px; padding: 5px 10px; border-radius: 5px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none;
}
.btn-mini:hover { border-color: var(--border-strong); background: var(--card-hover); }
.btn-mini.primary { background: var(--accent); color: var(--on-bg); border-color: var(--accent); font-weight: 600; }
.btn-mini:disabled { opacity: .35; cursor: not-allowed; }

.footer-pager { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; font-size: 11px; color: var(--muted); }
.usage-loading { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) {
  .usage-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 图组（spec 2026-05-16-size-expansion）===== */
.image-set-group {
  grid-column: 1 / -1;            /* 占满 results 网格的一整行 */
  border: 1px solid #d99a6b;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  background: #fbf9f7;
}
.image-set-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.image-set-header .image-set-label { margin-right: auto; display: inline-flex; align-items: center; gap: 4px; }
.image-set-label svg.lucide { width: 14px; height: 14px; }
/* 加文案图组：红色调跟单卡 is-edit 一致 */
.history-set-group.is-edit-set .image-set-label { color: #C92C2C; }
.history-set-group.is-edit-set { box-shadow: inset 3px 0 0 #C92C2C; padding-left: 8px; }
.image-set-label {
  font-size: 12px;
  color: #7A5A3F;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.btn-set-download {
  font-size: 12px;
  padding: 4px 10px;
  background: #d99a6b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-set-download:hover { opacity: 0.85; }
.btn-set-edit {
  font-size: 12px;
  padding: 4px 10px;
  background: #C92C2C;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-set-edit:hover { opacity: 0.85; }
.btn-set-push {
  font-size: 12px;
  padding: 4px 10px;
  background: #f76b1c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-set-push:hover { opacity: 0.85; }
.btn-set-push.is-pushed {
  background: #27ae60;  /* 绿色：已完成 */
  color: #fff;
}
.btn-set-push.is-pushed:hover { background: #2ecc71; }
/* 图组级星标：跟卡片级 .h-star 视觉一致，但 inline 排在 header 里 */
.set-star {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35); color: rgba(255, 255, 255, 0.7);
  cursor: pointer; font-size: 16px; line-height: 1;
  transition: background .15s, color .15s, transform .15s;
}
.set-star:hover { background: rgba(0, 0, 0, 0.6); color: #fff; }
.set-star.on { color: #f76b1c; background: rgba(247,107,28,0.15); }
.set-star.on:hover { transform: scale(1.1); }
.image-set-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* 历史区图组：横排紧凑 */
.history-set-group {
  grid-column: 1 / -1;
  border: 1px solid #d99a6b;
  border-radius: 8px;
  padding: 10px;
  margin: 6px 0;
  background: #fbf9f7;
}
.history-set-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);  /* 跟单张视图同 4 列 */
  gap: 14px;
}

/* 「拓展尺寸」按钮 */
.btn-expand {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  background: #E8D5BC;
  color: #5C3F2A;
  border: 1px solid #d99a6b;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
}
.btn-expand:hover:not(:disabled) { background: #DDC4A6; }
.btn-expand:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 生成进度弹窗（首页合并后，生成走弹窗；衣架 + 计数器 + 进度条，沿用 empty.svg 调性） ===== */
.gen-modal-backdrop {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(8, 8, 10, 0.78);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gen-modal {
  position: relative;
  background: #131316;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  width: 100%; max-width: 460px;
  overflow: hidden;
}
/* 宽版：左右分栏 — 左侧栏=信息+按钮，右主区=图片占满 */
.gen-modal-wide {
  max-width: min(1400px, 95vw);
  max-height: 92vh;
  display: flex; flex-direction: row;
}

/* 左侧栏：固定宽，顶部信息 + 底部按钮 */
.gen-modal-side {
  width: 260px; flex-shrink: 0;
  background: rgba(0, 0, 0, 0.25);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 18px;
  /* 拓展尺寸 picker 浮在按钮右侧（漂出 side 到图片区）必须有 z-index 把整个 side 抬到 main 上面,
     否则 .gen-modal-main 里的图片卡会因为文档顺序在后而盖住 picker。
     overflow 用 visible 不裁切右浮的 picker (内容溢出由弹窗整体滚条管) */
  overflow: visible;
  position: relative;
  z-index: 5;
}
.gen-side-top { text-align: center; }
.gen-hanger-side { width: 120px; height: 96px; margin: 0 auto 14px; display: block; }
.gen-side-bottom {
  margin-top: auto;
  padding-top: 18px;
  display: flex; flex-direction: column; gap: 8px;
}

/* 侧栏按钮：纵排，占满宽度 */
.btn-gen-side {
  width: 100%; justify-content: center;
}

/* 提示词改图 inline 输入框 */
.gen-iteration-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: inherit;
  font: inherit;
  margin-bottom: 6px;
  box-sizing: border-box;
}
.gen-iteration-input:focus {
  outline: none;
  border-color: #f76b1c;
  background: rgba(255,255,255,0.10);
}

/* 右主区：图片网格占满 */
.gen-modal-main {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
}

/* 批量优化弹窗：主区复用 fz-result 配对，顶部对齐可滚动 */
.gen-modal-fission { flex: 1; align-self: stretch; overflow-y: auto; min-width: 0; padding: 4px 4px 4px 0; }
/* 一列一对布局：grid auto-fill 等宽列（180-220px），每列=原图在上+对应生成格在下 */
.gen-modal-fission .fzm-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); gap: 18px 12px; align-items: start; }
.gen-modal-fission .fzm-pair { display: flex; flex-direction: column; min-width: 0; }
/* 缩略图固定高 + contain：混合比例(1:1/3:4/2:3)时原图盒/结果盒仍全部水平对齐 */
.gen-modal-fission .fzm-pair .fz-thumb { height: 220px; flex: none; background: var(--stage); }
.gen-modal-fission .fzm-pair .fz-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gen-modal-fission .fzm-pair .fz-rstate { aspect-ratio: auto; height: 100%; }
.gen-modal-fission .fzm-sep { text-align: center; margin: 8px 0 6px; }
.gen-modal-fission .fzm-pair .fz-thumb:hover .fz-rhover { opacity: 1; }  /* 没有 .fz-rcard 包裹，hover 操作层在这里重新挂上 */
/* 弹窗侧栏两个方向按钮：单行紧凑，视觉对齐历史抽屉那对（深炭次按钮 + accent 黄主按钮） */
.gen-modal-fz-acts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.fz-act-line {
  width: 100%; box-sizing: border-box;
  padding: 9px 14px;
  border: none; border-radius: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  line-height: 1.2; white-space: nowrap;
  cursor: pointer; transition: background .15s, filter .15s;
}
/* 次按钮：深炭底白字（弹窗侧栏本身偏暗，加 1px 描边保证轮廓可辨） */
.fz-act-line.is-fission { background: #1a1a1a; color: #fff; border: 1px solid var(--border-strong); }
.fz-act-line.is-fission:hover { background: #3d3d3d; }
/* 主按钮：accent 黄底深字 */
.fz-act-line.is-replace { background: var(--accent); color: #1a1a1a; }
.fz-act-line.is-replace:hover { filter: brightness(1.07); }

/* 实时结果网格（grid-template-columns + maxWidth 由 :style 动态绑定，按张数自适应） */
.gen-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.gen-result-cell { display: flex; flex-direction: column; gap: 6px; }
.gen-result-img-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  /* aspect-ratio 由 template 内联 :style 按每张 task 的 aspect_ratio 动态设置；
     这里写 3/4 只是 fallback（pending 态、aspect 缺失等异常情况） */
  aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.gen-result-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  cursor: zoom-in;
}
.gen-result-cell.status-done .gen-result-img-wrap {
  border-color: var(--accent-ring);
  box-shadow: 0 2px 12px rgba(247,107,28,0.12);
}
/* 选中态：粗黄边框 + 更明显发光 */
.gen-result-cell.selected .gen-result-img-wrap {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 4px 20px rgba(247,107,28,0.32);
}

/* 右上角选中圈：未选 = 半透明边框圆；选中 = 黄色实心 + 对勾 */
.gen-cell-check {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; color: transparent;
  transition: all .12s ease;
  z-index: 2;
}
.gen-cell-check:hover { background: rgba(0, 0, 0, 0.75); border-color: #fff; }
.gen-cell-check.on {
  background: var(--accent); border-color: var(--accent); color: var(--on-bg);
  box-shadow: 0 2px 8px rgba(247,107,28,0.4);
}
.gen-cell-check svg.lucide { width: 14px; height: 14px; stroke-width: 3; }

/* 右下角放大按钮 */
.gen-cell-zoom {
  position: absolute; bottom: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease, background .15s ease;
  z-index: 2;
}
.gen-result-img-wrap:hover .gen-cell-zoom { opacity: 1; }
.gen-cell-zoom:hover { background: rgba(0, 0, 0, 0.85); color: #fff; }
.gen-cell-zoom svg.lucide { width: 14px; height: 14px; }

/* hover 显示的「单卡重新生成」按钮（done / 失败都可点）：底部居中，不挡右下放大/右上勾选。2026-06-15 */
.gen-cell-regen {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 14px; white-space: nowrap;
  background: rgba(0, 0, 0, 0.62); border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff; font-size: 12px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .15s ease, background .15s ease;
  z-index: 3;
}
.gen-result-img-wrap:hover .gen-cell-regen { opacity: 1; }
.gen-cell-regen:hover { background: var(--accent); border-color: var(--accent); color: var(--on-bg); }
.gen-result-loading {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 11px;
}
.gen-result-loading .spinner {
  width: 22px; height: 22px; border-width: 2px;
}
.gen-result-loading-text { font-family: Menlo, monospace; }
.gen-result-loading-engine {
  font-size: 11px; color: var(--fg-muted, #888);
  margin-top: -2px;
  letter-spacing: 0.02em;
}
.gen-result-fail {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--danger);
}
.gen-result-fail-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(239,68,68,0.15); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.gen-result-fail-text { font-size: 11px; font-weight: 600; }
.gen-result-fail-zh {
  font-size: 12px; color: #f87171; font-weight: 500;
  text-align: center; padding: 0 10px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.gen-result-fail-raw {
  font-size: 10px; color: #888; font-family: Menlo, monospace;
  text-align: center; padding: 0 8px; line-height: 1.4; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px;
}
.gen-result-label {
  font-size: 11px; color: var(--muted);
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gen-result-engine {
  font-size: 10px; color: var(--muted); opacity: .7;
  text-align: center; margin-top: 1px;
}
.gen-result-engine.is-fallback {
  color: #e0681a; opacity: 1;
}
.fallback-badge {
  font-size: 9px; font-weight: 600;
}
.gen-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; border-radius: 4px; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 2;
}
.gen-modal-close:hover { background: var(--card-hover); color: var(--fg); }
.gen-hanger-wrap {
  display: flex; justify-content: center;
  margin: 36px 0 24px;
}
.gen-hanger {
  width: 180px; height: 140px;
  animation: gen-hanger-float 3.2s ease-in-out infinite;
}
@keyframes gen-hanger-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.gen-hanger .sparkle-a, .gen-hanger .sparkle-b, .gen-hanger .sparkle-c {
  animation: gen-sparkle-twinkle 2.4s ease-in-out infinite;
}
.gen-hanger .sparkle-b { animation-delay: 0.7s; }
.gen-hanger .sparkle-c { animation-delay: 1.4s; }
@keyframes gen-sparkle-twinkle {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}
.gen-modal-text {
  text-align: center; padding: 0 32px 8px;
}
.gen-modal-title {
  font-size: 13px; color: var(--muted); margin: 0 0 6px;
}
.gen-modal-counter {
  font-size: 38px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.gen-modal-counter .total {
  color: var(--muted); font-size: 24px; font-weight: 500;
}
.gen-modal-meta {
  font-size: 12px; color: var(--muted);
  margin-top: 10px;
  font-family: Menlo, monospace;
}
.gen-modal-progress {
  margin: 0 0 10px;
  height: 3px;
  background: var(--panel);
  border-radius: 2px;
  overflow: hidden;
}
.gen-modal-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 12px var(--accent-soft);
  transition: width .35s ease;
}
.gen-modal-foot {
  padding: 20px 24px 22px;
  display: flex; justify-content: center;
  flex-direction: column; align-items: center; gap: 0;
}
.btn-gen-bg {
  font: inherit; padding: 8px 18px;
  border-radius: 6px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--muted);
  cursor: pointer; font-size: 12px;
  font-family: inherit;
}
.btn-gen-bg:hover { color: var(--fg); background: var(--card-hover); }

/* 生成完成态的批量操作按钮组 */
.gen-modal-actions {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  width: 100%; flex-wrap: wrap;
}
.gen-modal-sel-hint {
  font-size: 12px; color: var(--muted);
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}
.btn-gen-action {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; font-family: inherit;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-ring);
  cursor: pointer;
  transition: all .15s ease;
}
.btn-gen-action:hover:not(:disabled) {
  background: var(--accent); color: var(--on-bg); border-color: var(--accent);
}
.btn-gen-action:disabled {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 1;
}
.btn-gen-action:disabled svg.lucide { opacity: 0.6; }
.btn-gen-action svg.lucide { width: 1em; height: 1em; }
/* 「拓展主图尺寸」按钮：主文案加粗，比例子文案另起一行缩小变淡（侧栏批量按钮 + 灯箱按钮共用） */
.expand-label {
  display: flex; flex-direction: column; align-items: center;
  gap: 1px; line-height: 1.2;
}
.expand-label strong { font-weight: 600; }
.expand-label small { font-size: 10px; opacity: 0.6; font-weight: 400; }

/* 推送到淘宝按钮：橙色突出，跟下载/加文案的黄色区分 */
.btn-gen-action.btn-gen-taobao {
  background: rgba(255, 111, 31, 0.16);
  color: #f76b1c;
  border-color: rgba(255, 111, 31, 0.5);
}
.btn-gen-action.btn-gen-taobao:hover:not(:disabled) {
  background: #f76b1c; color: #fff; border-color: #f76b1c;
}

/* 批量拓展 picker：浮在「拓展尺寸」按钮**右侧**（漂出侧边栏，在图片区里显眼） */
.gen-btn-with-picker { position: relative; }
.gen-batch-expand-picker {
  position: absolute;
  left: calc(100% + 14px);   /* 按钮右边缘 + 间距 */
  top: 0;                     /* 跟按钮顶对齐 */
  width: 280px;
  padding: 14px 16px;
  background: #1a1a1c;        /* 弹窗背景同色，比 var(--card) 实一点 */
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  z-index: 10;
}
.gen-batch-expand-label {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}

/* 合并后右栏（stage 里直接放历史 grid）：调整顶部间距 */
.stage.stage-history { padding-top: 16px; }
.stage.stage-history .section-title { margin-top: 0; }

/* #5 裂变历史抽屉：仅裂变 tab 把共享历史区改成右侧滑出，让裂变区独占主版面（其他 tab 无 .as-drawer，保持常驻） */
.stage-history.as-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(880px, 92vw); margin: 0; border-radius: 0; border-left: 1px solid var(--border); background: var(--bg-base); box-shadow: -14px 0 44px rgba(0,0,0,.5); transform: translateX(100%); transition: transform .25s ease; z-index: 60; overflow-y: auto; padding: 16px 20px 28px; }
.stage-history.as-drawer.open { transform: none; }
.fz-hist-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
/* 历史浮钮：深玻璃胶囊（半透明+毛玻璃），线性时钟图标+文字同色，hover 过渡香槟金（与空状态 hero 谱系一致）+轻微上浮 */
.fz-hist-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(20,20,24,.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: rgba(236,236,236,.88); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: border-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease; }
.fz-hist-fab svg.lucide { width: 15px; height: 15px; }
.fz-hist-fab:hover { border-color: rgba(247,107,28,.55); color: #f4a86a; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 18px rgba(247,107,28,.12); }
.fz-hist-close { position: absolute; top: 14px; right: 16px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font-size: 16px; cursor: pointer; z-index: 2; }
.fz-hist-close:hover { border-color: var(--border-strong); background: var(--card-hover); }

/* 拓展尺寸：勾选 picker（点 btn-expand 后原地切到这个，让用户选要拓哪几个尺寸再发请求） */
.expand-picker {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap; font-size: 12px;
}
.expand-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer; user-select: none;
  font-size: 12px; line-height: 1.2;
  transition: all .14s ease;
}
.expand-chip:hover { background: var(--card-hover); color: var(--fg); }
.expand-chip.on {
  background: #E8D5BC; color: #5C3F2A;
  border-color: #d99a6b; font-weight: 600;
}
.btn-expand-confirm {
  font-size: 12px; padding: 4px 10px;
  background: var(--accent); color: var(--on-bg);
  border: 1px solid var(--accent);
  border-radius: 4px; cursor: pointer;
  font-weight: 600; font-family: inherit;
}
.btn-expand-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-expand-cancel {
  font-size: 12px; padding: 4px 10px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; font-family: inherit;
}
.btn-expand-cancel:hover { color: var(--fg); border-color: var(--border-strong); }

/* lightbox 切换条 */
.lightbox-switcher {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.lightbox-switcher button {
  padding: 4px 14px;
  border: 1px solid #d99a6b;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  color: #5C3F2A;
}
.lightbox-switcher button.active {
  background: #d99a6b;
  color: white;
}

/* 排队/失败 占位：跟图区一样 220px 高，保持卡片整齐 */
.history-pending-placeholder,
.history-failed-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #f5efe8;
  padding: 12px;
  height: 220px; flex-shrink: 0;
  overflow: hidden;
  text-align: center;
}
.history-pending-placeholder .pending-text {
  margin-top: 8px;
  font-size: 12px;
  color: #7A5A3F;
}
.history-failed-placeholder {
  background: #fdf2f0;
}
.history-failed-placeholder .err-title {
  color: #c92c2c;
  font-weight: 600;
  font-size: 13px;
}
.history-failed-placeholder .err-zh {
  font-size: 12px;
  color: #5C3F2A;
  margin-top: 4px;
}
.history-failed-placeholder .err-zh {
  /* 中文友好提示限制 3 行，超出省略 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-failed-placeholder .err-raw {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  word-break: break-all;
  /* 原始错误限制 2 行，鼠标悬停在卡上想看全的话用 title 提示（已有 t.error_message）*/
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* pending 卡的文字不再淡化（之前 is-edit 那套灰度可能影响视觉，这里显式覆盖）*/
.history-card.is-pending .history-body,
.history-card.is-failed .history-body {
  opacity: 1;
}

/* 历史 tab 子视图切换：单张 / 图组 */
.history-view-toggle {
  display: flex;
  gap: 8px;
  margin: -8px 0 16px 0;
}
.history-view-pill {
  padding: 6px 16px;
  font-size: 13px;
  background: white;
  color: #7A5A3F;
  border: 1px solid #d99a6b;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.history-view-pill:hover { background: #f5efe8; }
.history-view-pill.on {
  background: #d99a6b;
  color: white;
  font-weight: 600;
}
.history-empty-hint {
  text-align: center;
  color: var(--muted, #999);
  font-size: 13px;
  margin: 20px 0;
  padding: 16px;
  background: #fafafa;
  border-radius: 6px;
}

/* 三个折叠下拉同行：生图引擎 / 输出尺寸 / 输出数量 */
.triple-row { display: flex; gap: 8px; align-items: flex-start; }
.triple-col { flex: 1; min-width: 0; }
.lbl-sub { color: var(--muted); font-weight: 400; opacity: 0.8; }

/* 通用折叠下拉 */
.dd { position: relative; }
.dd-trigger {
  width: 100%; display: flex; align-items: center;
  font-size: 13px; padding: 9px 28px 9px 10px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-family: inherit; text-align: left;
  white-space: nowrap; overflow: hidden;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: all .15s ease;
}
.dd-trigger > span { overflow: hidden; text-overflow: ellipsis; }
.dd-trigger:hover { border-color: var(--border-strong); }
.dd-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd-panel {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; z-index: 30;
  background: #1c1c20; border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}
.dd-panel--wide { min-width: 248px; }   /* 引擎面板放得下名字+说明 */
.dd-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 13px; white-space: nowrap;
  background: transparent; border: none; border-radius: 6px;
  color: var(--fg); cursor: pointer; font-family: inherit; text-align: left;
  transition: background .12s ease;
}
.dd-opt:hover { background: var(--card-hover); }
.dd-opt.on { color: var(--accent); font-weight: 600; }
.dd-opt--col { flex-direction: column; align-items: flex-start; gap: 2px; }
.dd-opt-main { display: flex; align-items: center; gap: 8px; }
.dd-tick { width: 14px; height: 14px; flex: none; color: var(--accent); }
.dd-ratio { min-width: 30px; }
.dd-opt .r-sub { margin-left: auto; font-size: 11px; color: var(--muted); }
.dd-opt--col .r-sub { margin-left: 22px; }   /* 引擎说明缩进对齐名字 */

/* ===== 文案板块卡片（左面板上半） — 跟元素库视觉对齐，可折叠 ===== */
.copy-panel-section {
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid #2c2c2c;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.12s;
}
.copy-panel-section.collapsed { padding: 10px 12px; }
.copy-head { cursor: pointer; user-select: none; }
.copy-head:hover h4 { color: #4ea1ff; }
.copy-panel-section .copy-head { margin-bottom: 0; }
.copy-panel-section:not(.collapsed) .copy-head { margin-bottom: 10px; }
.copy-head .caret { font-size: 9px; color: #888; margin-left: 4px; }
.copy-hint { font-size: 11px; color: #888; }
/* 紧凑化内部 fields/picker（覆盖原本 .edit-* 默认的大 padding） */
.copy-panel-section .edit-tpl-picker {
  margin-bottom: 8px; padding-bottom: 8px;
}
.copy-panel-section .edit-aspect-tabs { margin-bottom: 8px; }
.copy-panel-section .edit-field { margin-bottom: 8px; }
.copy-panel-section .edit-field:last-of-type { margin-bottom: 0; }
.copy-panel-section .edit-field label { margin-bottom: 3px; font-size: 11px; }
.copy-panel-section .edit-field input[type=text] {
  padding: 6px 9px; font-size: 12px;
}
.copy-panel-section .edit-field textarea {
  padding: 7px 9px; font-size: 13px; min-height: 80px;
}
.copy-panel-section .edit-aspect-hint { margin: 0 0 8px; font-size: 11px; }

/* ===== 元素库板块（左面板下半，与文案上下并列）— 同款卡片包裹 ===== */
.elem-panel-section {
  margin-top: 12px;
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid #2c2c2c;
  border-radius: 10px;
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 280px;
}
.elem-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.elem-section-head h4 {
  margin: 0; font-size: 13px; color: #e0e0e0; font-weight: 600;
}
.elem-upload-btn {
  background: linear-gradient(135deg, #5a8cff, #4a7cef);
  color: #fff; border: 0; padding: 4px 10px;
  border-radius: 6px; cursor: pointer; font-size: 12px;
}
.elem-upload-btn:hover { filter: brightness(1.1); }

.elem-tabs {
  display: flex; gap: 4px; margin-bottom: 8px;
}
.elem-tabs button {
  flex: 1; background: #0e0e0e; border: 1px solid #2a2a2a; color: #aaa;
  padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 11px;
}
.elem-tabs button.on { background: #1f2530; color: #eee; border-color: #4ea1ff; }

.elem-search-input {
  width: 100%; padding: 5px 9px; background: #0e0e0e; border: 1px solid #2a2a2a;
  color: #eee; border-radius: 6px; font-size: 11px; margin-bottom: 8px;
  box-sizing: border-box;
}

.elem-panel-section .elem-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 4px 0 0; margin: 0;
}
.elem-panel-section .elem-grid {
  grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.elem-panel-section .elem-card { padding: 4px 2px; }
.elem-panel-section .elem-card-name { font-size: 10px; }

/* ===== 元素库抽屉（旧右侧抽屉样式，已废弃，保留以防回退） ===== */
.elem-drawer-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: rgba(20,20,20,0.92); color: #eee; border: 1px solid #333;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.elem-drawer-toggle:hover { background: #2a2a2a; }

.elem-drawer {
  width: 320px; background: #161616; border-left: 1px solid #2a2a2a;
  display: flex; flex-direction: column;
  transition: margin-right 0.2s;
  height: 100%;
}
.elem-drawer.collapsed { margin-right: -320px; }
.elem-drawer-header { padding: 12px; border-bottom: 1px solid #2a2a2a; }
.elem-drawer-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.elem-drawer-tabs button {
  flex: 1; background: transparent; border: 1px solid #333; color: #aaa;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.elem-drawer-tabs button.on { background: #2a2a2a; color: #eee; border-color: #4ea1ff; }
.elem-drawer-search { display: flex; gap: 6px; }
.elem-drawer-search input {
  flex: 1; padding: 6px 10px; background: #0e0e0e; border: 1px solid #333;
  color: #eee; border-radius: 6px; font-size: 12px;
}
.elem-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.elem-empty { color: #777; font-size: 12px; text-align: center; padding: 20px; }
.elem-cat { margin-bottom: 16px; }
.elem-cat h5 {
  font-size: 12px; color: #aaa; margin: 0 0 8px; display: flex; align-items: center;
}
.elem-cat h5 span { color: #555; font-size: 11px; margin-left: 6px; }
.elem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* 元素卡 — 圆形缩略图 + 下方居中文字 */
.elem-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 2px; cursor: pointer; position: relative;
  border-radius: 8px; transition: background 0.12s;
}
.elem-card:hover { background: rgba(78, 161, 255, 0.08); }
.elem-card.active { background: rgba(78, 161, 255, 0.16); }
.elem-card.active .elem-card-thumb {
  border-color: #4ea1ff;
  box-shadow: 0 0 0 2px rgba(78, 161, 255, 0.35);
}
.elem-card.active .elem-card-name { color: #4ea1ff; font-weight: 600; }

.elem-card-thumb {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: #fafafa;
  overflow: hidden; position: relative;
  border: 2px solid transparent;
  transition: border-color 0.12s;
}
.elem-card:hover .elem-card-thumb { border-color: #4ea1ff; }
.elem-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}

.elem-card-name {
  font-size: 11px; color: #ddd; text-align: center;
  margin-top: 5px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}

.elem-pinned {
  position: absolute; top: -2px; left: -2px; font-size: 11px;
  background: rgba(255,200,0,0.95); color: #222; padding: 1px 5px;
  border-radius: 10px; font-weight: 700; z-index: 2;
}
.elem-del {
  position: absolute; top: -2px; right: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.7); color: #fff; border: 0;
  font-size: 12px; line-height: 18px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s; padding: 0;
  z-index: 2;
}
.elem-card:hover .elem-del { opacity: 1; }
.elem-del:hover { background: #c92c2c; }

.elem-card-trash .elem-card-thumb { opacity: 0.55; }
.elem-restore {
  font-size: 11px; padding: 3px 8px; margin-top: 4px;
}
.modal-upload-elem { width: 440px; }
.modal-upload-elem .up-row { margin-bottom: 12px; }
.modal-upload-elem .up-row label {
  display: block; font-size: 12px; color: #aaa; margin-bottom: 4px;
}
.modal-upload-elem .up-row input[type="text"],
.modal-upload-elem .up-row input[type="file"] {
  width: 100%; padding: 8px 10px; background: #0e0e0e; border: 1px solid #333;
  color: #eee; border-radius: 6px; font-size: 13px;
}
.modal-upload-elem .up-checkbox label {
  color: #ddd; font-size: 13px; cursor: pointer;
}
.modal-upload-elem .up-checkbox input { margin-right: 6px; }
.modal-upload-elem .up-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;
}
.up-mode-tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
  background: #0e0e0e; padding: 4px; border-radius: 8px;
  border: 1px solid #2a2a2a;
}
.up-mode-tabs button {
  flex: 1; background: transparent; border: 0; color: #999;
  padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: all 0.12s;
}
.up-mode-tabs button.on { background: #1f2530; color: #fff; }
.up-mode-tabs button:hover:not(.on) { color: #ccc; }
.up-row select.up-input, .modal-upload-elem .up-row select {
  width: 100%; padding: 8px 10px; background: #0e0e0e; border: 1px solid #333;
  color: #eee; border-radius: 6px; font-size: 13px;
}
.up-optional { color: #666; font-size: 11px; }
.modal-upload-elem.drag-over {
  outline: 2px dashed #4ea1ff; outline-offset: -4px;
  background: #1a2030;
}
.modal-upload-elem .up-selected {
  margin-top: 6px; font-size: 12px; color: #6ec07a;
}

/* 元素库操作浮动 toast */
.elem-toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 8px; font-size: 13px; color: #fff;
  z-index: 9999; box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  animation: elemToastIn 0.22s ease-out;
}
.elem-toast.out { animation: elemToastOut 0.22s ease-out forwards; }
.elem-toast-ok { background: linear-gradient(135deg, #3ca25f, #2e8b4d); }
.elem-toast-err { background: linear-gradient(135deg, #c9434f, #a8323d); }
@keyframes elemToastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes elemToastOut {
  to { opacity: 0; transform: translate(-50%, -8px); }
}

/* ===== 登录遮罩 + U1 顶栏用户区（auth.js 注入，Vue 之外；AUTH 关闭时这些都不出现）===== */

/* —— 全屏登录遮罩 —— */
#ps-login-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 8, 10, 0.72);              /* 半透明：背后 app 可见,即梦式小窗 */
  backdrop-filter: blur(3px);
  color: var(--fg);
  font-family: "Inter", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
}
.ps-login-card { position: relative; }            /* 给 ✕ 定位用 */
.ps-login-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--fg);
  opacity: .5; font-size: 18px; cursor: pointer; line-height: 1;
}
.ps-login-close:hover { opacity: 1; }
.ps-login-card {
  width: 360px; max-width: 90vw; text-align: center;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--border);
  border-radius: 18px; padding: 44px 36px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.ps-login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 15px;
  background: linear-gradient(135deg, #ffa04d, #e85d12);
  color: #1a1300; font-size: 28px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.ps-login-title { font-size: 21px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.01em; }
.ps-login-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }
.ps-login-err { color: #ff5c5c; font-size: 13px; min-height: 18px; margin: 0 0 10px; line-height: 1.5; }
.ps-feishu-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 48px; border: none; border-radius: 12px; cursor: pointer;
  background: #3370ff; color: #fff; font-size: 15px; font-weight: 700; font-family: inherit;
  transition: filter .15s;
}
.ps-feishu-btn:hover { filter: brightness(1.1); }
.ps-feishu-btn:active { filter: brightness(.92); }
.ps-feishu-btn:disabled { opacity: .6; cursor: default; }
.ps-admin-form { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.ps-login-input {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px; margin: 5px 0;
  background: rgba(0, 0, 0, 0.32); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px; font-family: inherit;
}
.ps-login-input::placeholder { color: #6b6b73; }
.ps-login-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ps-admin-btn {
  width: 100%; height: 44px; margin-top: 8px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--on-bg); font-size: 14px; font-weight: 700; letter-spacing: 2px; font-family: inherit;
}
.ps-admin-btn:hover { filter: brightness(1.06); }
.ps-admin-btn:disabled { opacity: .6; cursor: default; }
.ps-admin-link {
  position: absolute; right: 22px; bottom: 18px;
  color: #5d5d66; font-size: 12px; cursor: pointer; user-select: none;
}
.ps-admin-link:hover { color: var(--fg); text-decoration: underline; }

/* —— 手机号验证码视图：验证码输入 + 发码按钮一行 —— */
.ps-code-row { display: flex; gap: 8px; }
.ps-code-row .ps-login-input { flex: 1; }
.ps-code-btn {
  flex: 0 0 auto; height: 44px; margin: 5px 0; padding: 0 14px; white-space: nowrap;
  border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); color: var(--fg); font-size: 13px; font-family: inherit;
  transition: border-color .15s, color .15s;
}
.ps-code-btn:hover { border-color: var(--accent-ring); color: var(--accent); }
.ps-code-btn:disabled { opacity: .55; cursor: default; }
/* 开发模式提示（短信未配真发） */
.ps-login-devhint { color: var(--muted); font-size: 11.5px; margin: 10px 0 0; line-height: 1.5; }
/* 飞书登录次要样式：小链接按钮 */
.ps-alt-row { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ps-feishu-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; background: none; cursor: pointer; font-family: inherit;
  color: #6f95e6; font-size: 12.5px; padding: 4px 6px;
}
.ps-feishu-link:hover { color: #8eaef0; text-decoration: underline; }
.ps-feishu-link:disabled { opacity: .6; cursor: default; }

/* —— 已绑手机号菜单项：不可点（仅展示）—— */
.ps-mi-static { color: var(--muted); cursor: default; }
.ps-mi-static:hover { background: none; }

/* —— 绑定手机号小弹层 —— */
.ps-bind-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  font-family: "Inter", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
}
.ps-bind-card {
  width: 340px; max-width: 90vw;
  background: #16161a; border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); color: var(--fg);
}
.ps-bind-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.ps-bind-actions { display: flex; gap: 10px; margin-top: 6px; }
.ps-bind-actions .ps-rc-close { flex: 1; width: auto; margin: 0; }
.ps-bind-actions .ps-admin-btn { flex: 1; width: auto; margin: 0; }

/* —— U1 用户区：侧栏左下壳填充（登录后 auth.js 写入 .as-points / .as-avatar）—— */
/* 登录态：member 在侧栏看不到用量与账单（接口本就 admin-only） */
body.ps-member .as-util-usage { display: none; }
/* 登录态侧栏壳：头像实线圈 + 可点 */
body.ps-authed .as-avatar { border-style: solid; cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--accent); }
body.ps-authed .as-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
body.ps-authed .as-points { cursor: pointer; }

/* 菜单内头像（ps-who-av）复用基础圆形样式 */
.ps-who-av {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  background: linear-gradient(135deg, #5b8def, #9b6ef3); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  border: 2px solid transparent; overflow: hidden;
}
.ps-who-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* —— 头像下拉菜单 + 充值面板：fixed 左下，紧贴侧栏用户区上方 —— */
.ps-menu, .ps-rcpop {
  position: fixed; left: 88px; bottom: 14px; z-index: 200; width: 252px;
  background: #232327; border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); padding: 8px;
  display: none;
}
.ps-menu.open, .ps-rcpop.open { display: block; animation: psMenuIn .18s ease; }
@keyframes psMenuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ps-who { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.ps-who .ps-avatar { width: 38px; height: 38px; cursor: default; }
.ps-who .ps-avatar:hover { border-color: transparent; }
.ps-who-meta b { font-size: 13.5px; display: block; }
.ps-who-meta i { font-size: 11px; color: var(--muted); font-style: normal; }
.ps-mi {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: none; color: var(--fg); cursor: pointer; text-align: left;
  font-size: 13px; font-weight: 600; padding: 9px 10px; border-radius: 9px; font-family: inherit;
}
.ps-mi:hover { background: var(--panel-strong); }
.ps-mi:active { background: rgba(255, 255, 255, 0.1); }
.ps-mi-red { color: var(--danger); }
.ps-badge { margin-left: auto; font-size: 10px; background: var(--accent-soft); color: var(--accent); padding: 2px 7px; border-radius: 999px; }

/* —— 充值面板（简化版：余额大数字 + 联系管理员充值）—— */
.ps-rcpop { padding: 16px 16px 14px; }
.ps-rcpop h4 { margin: 0 0 10px; font-size: 14px; }
.ps-rc-balance { text-align: center; margin: 6px 0 2px; }
.ps-rc-balance b { font-size: 34px; color: var(--accent); font-weight: 800; }
.ps-rc-balance span { font-size: 13px; color: var(--muted); margin-left: 4px; }
.ps-rc-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 14px; line-height: 1.6; }
.ps-rc-close {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; background: transparent;
  color: var(--fg); font-size: 13px; font-weight: 600; padding: 9px 0; cursor: pointer; font-family: inherit;
}
.ps-rc-close:hover { border-color: var(--accent-ring); color: var(--accent); }
.ps-rc-go {
  display: block; width: 100%; box-sizing: border-box; text-align: center;
  border: none; border-radius: 10px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700; padding: 11px 0; margin: 4px 0 8px;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.ps-rc-go:hover { filter: brightness(1.06); }

/* —— 充值小窗口（iframe 弹 /recharge?embed=1，取代整页跳转）2026-06-21 —— */
.ps-rc-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); padding: 20px; }
.ps-rc-modal.open { display: flex; animation: psMenuIn .18s ease; }
.ps-rc-win { position: relative; width: 460px; max-width: 94vw; height: 495px; max-height: 90vh; background: #0f0f13; border: 1px solid var(--border-strong); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.ps-rc-frame { width: 100%; height: 100%; border: 0; display: block; }
.ps-rc-x { position: absolute; top: 11px; right: 13px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.08); color: #c9c9d2; font-size: 15px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.ps-rc-x:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ===== 联系客服 / 意见反馈：微信二维码小窗 ===== */
.ps-qr-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); padding: 20px; }
.ps-qr-modal.open { display: flex; animation: psMenuIn .18s ease; }
.ps-qr-win { position: relative; width: 300px; max-width: 92vw; background: #0f0f13; border: 1px solid var(--border-strong); border-radius: 18px; padding: 22px 22px 18px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.ps-qr-win h4 { margin: 0 0 16px; font-size: 15px; color: var(--fg); font-weight: 600; }
.ps-qr-img { width: 216px; height: 216px; border-radius: 12px; background: #fff; padding: 9px; display: block; margin: 0 auto; box-sizing: border-box; user-select: none; }
.ps-qr-tip { margin: 14px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.ps-qr-x { position: absolute; top: 11px; right: 13px; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.08); color: #c9c9d2; font-size: 15px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.ps-qr-x:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ===== placed-layer: 画布上的置放元素层 ===== */
.edit-canvas-stage { position: relative; }
.placed-layer {
  position: absolute; inset: 0; pointer-events: none;
}
.placed-layer .placed-item {
  position: absolute; pointer-events: auto; cursor: move; user-select: none;
  border-radius: 50%; overflow: hidden;
  background: #fff;
}
.placed-layer .placed-item img {
  width: 100%; height: 100%; display: block; pointer-events: none;
  object-fit: contain;  /* 圆形内完整显示元素，不裁掉标题/数字等 */
}
.placed-layer .placed-item.selected { outline: 2px solid #4ea1ff; outline-offset: 1px; }
.placed-layer .ph-handle {
  position: absolute; width: 12px; height: 12px; background: #4ea1ff;
  border: 2px solid #fff; border-radius: 50%;
}
.placed-layer .ph-handle.ph-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.placed-layer .ph-handle.ph-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.placed-layer .ph-handle.ph-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.placed-layer .ph-handle.ph-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.placed-layer .placed-toolbar {
  position: absolute; top: -38px; left: 0; display: flex; gap: 4px;
  background: rgba(20,20,20,0.96); padding: 4px 6px; border-radius: 6px;
  white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.placed-layer .placed-toolbar button {
  background: transparent; border: 0; color: #ddd; font-size: 12px;
  padding: 4px 8px; cursor: pointer; border-radius: 4px;
}
.placed-layer .placed-toolbar button:hover { background: #333; }
.placed-layer .placed-toolbar button.danger:hover { background: #582020; color: #ff8080; }
.placed-layer .placed-toolbar button:disabled { opacity: 0.35; cursor: default; }
.placed-layer .placed-toolbar button:disabled:hover { background: transparent; }

/* —— 视频生成 tab —— */
/* 合并卡片：素材区 + textarea + 模板按钮共享一个边框，参照即梦 */
.video-compose {
  border: 1px solid #d4cdb8;
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  display: flex; flex-direction: column; gap: 10px;
}
.video-compose .video-refs { margin: 0; }
.video-compose .video-prompt-input {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  outline: none;
  width: 100%;
  resize: vertical;
}
.video-compose .video-prompt-input:focus { outline: none; }
.video-compose .video-templates { margin-top: 0; }
.field-sublabel { color: #a59f90; font-size: 11px; font-weight: normal; margin-left: 4px; }
.video-refs { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-add {
  width: 80px; height: 80px; border: 2px dashed #d4cdb8;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #a59f90; flex-direction: column;
}
.ref-card { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; }
.ref-card img, .ref-card video { width: 100%; height: 100%; object-fit: cover; }
.ref-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px;
  padding: 1px 5px; border-radius: 3px;
}
.ref-x {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.6); border: 0; color: #fff; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.ref-anon-spinner {
  position: absolute; inset: 0; background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #6b614e;
}
.ref-upscale-tag {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(247,107,28,0.92); color: #4a3f1a;
  font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600;
}
.video-prompt-input { width: 100%; padding: 8px; border-radius: 6px;
  border: 1px solid #d4cdb8; font-size: 13px; resize: vertical; }
.video-templates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.template-chip {
  font-size: 11px; padding: 3px 10px; border: 1px solid #d4cdb8;
  background: #fff; border-radius: 999px; cursor: pointer; color: #6b614e;
}
.template-chip:hover { background: #f5f0e1; }
.mention-menu {
  position: fixed; background: #232228; border: 1px solid #4a4750;
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.55);
  z-index: 1000; min-width: 120px; padding: 4px;
}
.mention-item {
  padding: 8px 14px; cursor: pointer;
  color: #f0ead8; font-size: 14px; font-weight: 500;
  border-radius: 5px;
}
.mention-item:hover { background: #f76b1c; color: #1a1814; }
.cost-estimate { font-size: 13px; color: #6b614e; margin-bottom: 8px; }
.gen-modal-video-area {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #1a1814; border-radius: 8px;
}
.gen-modal-video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.gen-modal-video-waiting {
  text-align: center; color: #a59f90;
}
.gen-modal-waiting-icon { font-size: 64px; margin-bottom: 12px; }
.gen-modal-waiting-tip { font-size: 12px; opacity: 0.7; margin-top: 4px; }
.gen-modal-counter.video-mode { font-size: 36px; }
.gen-modal-counter.video-mode.is-fail { color: #e5484d; }
/* 视频生成失败：modal 画面里显示中文原因 */
.gen-modal-video-fail {
  max-width: 560px; text-align: center; padding: 32px;
  color: #e8e2d0;
}
.gen-modal-video-fail .vfail-icon {
  width: 56px; height: 56px; line-height: 56px; margin: 0 auto 16px;
  border-radius: 50%; background: rgba(229,72,77,0.15);
  color: #e5484d; font-size: 28px; font-weight: 700;
}
.gen-modal-video-fail .vfail-title {
  font-size: 18px; font-weight: 600; color: #e5484d; margin-bottom: 12px;
}
.gen-modal-video-fail .vfail-reason {
  font-size: 15px; line-height: 1.7; color: #e8e2d0; text-align: left;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 14px;
}
.gen-modal-video-fail .vfail-raw-wrap { text-align: left; }
.gen-modal-video-fail .vfail-raw-wrap summary {
  cursor: pointer; font-size: 12px; color: #a59f90; user-select: none;
}
.gen-modal-video-fail .vfail-raw {
  font-size: 11px; color: #8a8276; word-break: break-all;
  margin-top: 8px; font-family: ui-monospace, monospace;
}
.video-status-banner {
  display: flex; align-items: center; gap: 8px;
  background: #fff3ea; border: 1px solid #f76b1c; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: #6b614e;
  margin-bottom: 10px;
}
.video-status-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #d4cdb8; border-top-color: #f76b1c;
  border-radius: 50%; animation: video-spin 0.8s linear infinite;
}
@keyframes video-spin {
  to { transform: rotate(360deg); }
}
/* 视频缩略图容器与图片 <a> 容器对齐：固定 220px 高 + 居中 + 黑底 */
.history-thumb-wrap {
  position: relative;
  height: 220px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a0a; overflow: hidden;
}
.history-thumb.video-thumb {
  cursor: pointer; display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.video-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: rgba(255,255,255,0.9); pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ===== 风格蒸馏 / 视频生成 · 即梦式大输入卡板式（jm-*） =====
   居中问候标题 + 980px 大卡 + 卡底胶囊工具条 + 金色圆形生成钮；
   历史复用 .as-drawer 抽屉。胶囊下拉复用 .dd / .dd-panel / .dd-opt。 */
.workspace-hero { flex-direction: column; }
.workspace-hero > .panel { width: 100%; max-width: none; }
.jm-panel {
  background: none; border: none; box-shadow: none;
  padding: clamp(40px, 9vh, 110px) 0 24px;
}
.jm-title { text-align: center; font-size: 32px; font-weight: 700; letter-spacing: 1px; margin: 0 0 36px; }
.jm-title:has(+ .jm-sub) { margin-bottom: 11px; }   /* 有副标时标题收紧，不动换装/视频的无副标标题 */
/* 无副标的 tab（标题直接接页签）补出等高的副标位 → 5 个 tab 表头同高、切换时输入卡不再上下跳 */
.jm-title:has(+ .mod-tabs) { margin-bottom: 63px; }
/* 副标题恒 1 行（窄屏不换行致下方位移）；过长截断省略 */
.jm-sub { text-align: center; font-size: 14px; color: var(--muted); margin: 0 0 30px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jm-card {
  max-width: 980px; margin: 0 auto; position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 26px; padding: 24px 24px 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  transition: border-color .2s, box-shadow .2s;
}
/* 即梦式板块页签 · B1 精装版：互叠档案夹贴卡顶，悬停轻浮起，选中升高 + 顶沿品牌色发丝线 */
.mod-tabs { display: flex; max-width: 980px; margin: 0 auto; position: relative; }
.mod-tab {
  flex: 1; position: relative; z-index: 1; border: none; cursor: pointer; text-align: center;
  margin-bottom: -14px; padding: 14px 0 28px;
  background: rgba(255,255,255,.045);
  color: var(--muted); font-size: 14.5px; font-weight: 600;
  border-radius: 22px 22px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);   /* 顶部内高光：玻璃质感 */
  transition: transform .25s ease, background .2s, color .2s;
}
.mod-tab + .mod-tab { margin-left: -10px; }           /* 页签轻微互叠，档案夹感 */
.mod-tab:hover:not(.on) { color: var(--fg); background: rgba(255,255,255,.08); transform: translateY(-3px); }
.mod-tab.on {
  /* 实色 ≈ 深底 + 4% 白，与半透明卡片视觉一致；选中页签必须不透明才能和卡片无缝接 */
  background: #1b1b1f; color: var(--fg); z-index: 3; font-weight: 700;
  transform: translateY(-5px); padding-bottom: 33px;
  box-shadow: 0 -10px 30px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.07);
}
.mod-tab.on::before {                                  /* 顶沿一根品牌色发丝线 */
  content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 2px;
  border-radius: 99px; background: var(--accent); opacity: .85;
}
svg.lucide.mod-ico { width: 19px; height: 19px; margin-right: 7px; vertical-align: -4px; }  /* 页签品牌图标(方案B双色)，盖过 svg.lucide 的 1em */
.mod-tabs--dense svg.lucide.mod-ico { width: 16px; margin-right: 6px; }                     /* 收缩态略小 */
.mod-badge {
  display: none; margin-left: 8px; font-size: 10.5px; font-weight: 700; vertical-align: 2px;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px;
}
.mod-tab.on .mod-badge { display: inline-block; animation: modBadgePop .38s cubic-bezier(.34,1.56,.64,1); }
@keyframes modBadgePop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.mod-tabs + .jm-card { border-top-left-radius: 0; border-top-right-radius: 0; z-index: 2; }
/* 切板块时标题/卡片淡入（v-if 重建 DOM，挂载即播一次） */
.jm-title { animation: jmSwapIn .32s ease; }
.jm-card { animation: jmSwapIn .34s ease; }
@keyframes jmSwapIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* 收缩态/用量页小条版：不塞卡片后面，独立小页签（保持轻量，不带升降/角标） */
.mod-tabs--dense { margin: 0 0 12px; max-width: 560px; gap: 4px; }
.mod-tabs--dense .mod-tab { padding: 8px 0 9px; margin-bottom: 0; font-size: 12.5px; border-radius: 10px; box-shadow: none; }
.mod-tabs--dense .mod-tab + .mod-tab { margin-left: 0; }
.mod-tabs--dense .mod-tab:hover:not(.on) { transform: none; }
.mod-tabs--dense .mod-tab.on { background: var(--accent); color: #1a1300; transform: none; padding-bottom: 9px; box-shadow: none; }
.mod-tabs--dense .mod-tab.on::before { display: none; }
.mod-tabs--dense .mod-badge { display: none !important; }
/* —— 视频生成「未开放」锁（2026-06-21）：仅管理员可进。普通会员(ps-member)/匿名访客(ps-anon)及鉴权未就绪(无 class)一律锁住、不可点；
   只有 ps-admin（管理员）或 ps-noauth（本地裸跑）放行。默认锁住 → 避免登录态加载完成前的「先可点后变锁」闪烁 —— */
body:not(.ps-admin):not(.ps-noauth) .mod-tab[data-tab="video"] {
  pointer-events: none; opacity: .5; cursor: not-allowed;
}
body:not(.ps-admin):not(.ps-noauth) .mod-tab[data-tab="video"]::after {
  content: "🔒 未开放"; display: inline-block; margin-left: 8px;
  font-size: 10.5px; font-weight: 700; vertical-align: 2px;
  background: rgba(255,255,255,.07); color: var(--muted);
  border-radius: 999px; padding: 2px 8px;
}
/* 收缩态（用量页 dense 小页签）：只留锁图标，避免文字撑破窄页签 */
body:not(.ps-admin):not(.ps-noauth) .mod-tabs--dense .mod-tab[data-tab="video"]::after {
  content: "🔒"; background: none; padding: 0; margin-left: 4px;
}
.jm-card:focus-within { border-color: var(--accent-ring); box-shadow: 0 18px 60px rgba(0,0,0,.4), 0 0 0 3px var(--accent-soft); }

/* 上传缩略图（斜置）+ 参考素材条 */
.jm-body { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; min-height: 124px; }
.jm-thumb {
  flex: 0 0 auto; width: 96px; height: 122px; border-radius: 12px; cursor: pointer;
  border: 1.5px dashed var(--border-strong); background: rgba(255,255,255,.03);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-6deg); margin: 4px 6px 0 2px; position: relative;
  transition: border-color .2s, transform .2s;
}
.jm-thumb:hover { border-color: var(--accent-ring); transform: rotate(-3.5deg) scale(1.02); }
.jm-thumb-empty { text-align: center; }
.jm-plus { display: block; font-size: 30px; line-height: 1; color: var(--muted); font-weight: 300; }
.jm-thumb-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.jm-thumb.has-img { border-style: solid; }
.jm-thumb.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.jm-thumb-x {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: #2a2a2e; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.jm-thumb-x svg.lucide { width: 11px; height: 11px; }
.jm-thumb-x:hover { color: var(--fg); }
.jm-refs { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }

/* 主输入 */
.jm-input {
  flex: 1; min-width: 280px; min-height: 110px; resize: none; align-self: stretch;
  background: transparent; border: none; outline: none; box-shadow: none; color: var(--fg);
  font: inherit; font-size: 15.5px; line-height: 1.7; padding: 12px 4px 0;
}
.jm-input:focus { background: transparent; border: none; box-shadow: none; }
.jm-input::placeholder { color: var(--muted); opacity: .55; }

/* 胶囊工具条 */
.jm-toolbar { display: flex; align-items: center; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.jm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 12px; color: var(--fg);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.jm-pill:hover { border-color: var(--border-strong); background: rgba(255,255,255,.07); }
/* 信息胶囊（搜推素材固定模型标注）：橙色亮态、不可点 */
.jm-pill--ro { cursor: default; color: var(--accent); border-color: var(--accent-ring); background: var(--accent-soft); }
.jm-pill--ro:hover { border-color: var(--accent-ring); background: var(--accent-soft); }

/* 搜推素材抓图期间的醒目状态横幅：替代灰色小字，点 ↑ 后立刻可见，免得顾客以为没反应 */
.sm-grab-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  max-width: 980px; margin: 16px auto 0; padding: 12px 18px;
  background: var(--accent-soft); border: 1px solid var(--accent-ring); border-radius: 12px;
  color: var(--accent); font-size: 15px; font-weight: 600;
}
.sm-grab-spin { width: 18px; height: 18px; margin: 0; flex: none; }            /* 横幅内联 spinner */
.jm-send-spin { width: 20px; height: 20px; margin: 0; border-color: rgba(255,255,255,.18); border-top-color: var(--accent); }  /* ↑ 按钮转圈（禁用态灰底上用橙顶才看得清）*/

/* 搜推素材结果区顶对齐：盖掉 .gen-modal-main 的 align-items:center。
   否则内容超过弹窗高度时会被垂直居中，顶部（坑位切换条）溢出到可视区上方且滚不回去。 */
.gen-modal-sm { align-self: flex-start; width: 100%; }

/* 搜推素材结果：坑位切换条 + 按套展示（9 张图当场重组 1/2/3 套，每套配文案） */
.sm-slot-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 2px 14px; }
.sm-slot-lbl { font-size: 13px; color: var(--muted); }
.sm-slot-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.15;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px; padding: 6px 14px;
  color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.sm-slot-btn:hover { border-color: var(--border-strong); }
.sm-slot-btn.on { border-color: var(--accent-ring); background: var(--accent-soft); color: var(--accent); }
.sm-slot-sub { font-size: 10px; opacity: .7; }
.sm-copy-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px;
  color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s; }
.sm-copy-btn:hover:not(:disabled) { border-color: var(--accent-ring); }
.sm-copy-btn:disabled { opacity: .5; cursor: not-allowed; }
.sm-copy-btn svg.lucide { width: 15px; height: 15px; }
.sm-set { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: rgba(255,255,255,.02); }
.sm-set-head { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; color: var(--fg); }
.sm-set-hint { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
.sm-set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 190px)); gap: 8px; margin-bottom: 10px; }
.sm-set-grid a { display: block; }
.sm-set-grid img { width: 100%; border-radius: 7px; display: block; }
.sm-set-copy { border-top: 1px dashed var(--border); padding-top: 8px; }
.sm-copy-title { font-weight: 600; margin-bottom: 3px; font-size: 13.5px; }
.sm-copy-body { white-space: pre-wrap; font-size: 12.5px; color: #bbb; line-height: 1.6; }
.sm-copy-topics { color: #f76b1c; font-size: 12px; margin-top: 4px; }
.sm-set-copy--empty { color: var(--muted); font-size: 12.5px; border-top: none; padding-top: 0; }
.jm-pill.open { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.jm-caret { font-size: 9px; opacity: .5; }
.jm-badge { background: var(--accent-soft); color: var(--accent); border-radius: 8px; font-size: 11px; padding: 1px 6px; font-weight: 600; }
.jm-pill-sep { width: 1px; height: 14px; background: var(--border-strong); }
.jm-dim { color: var(--muted); }
.jm-toggle.on { border-color: var(--accent-ring); color: var(--accent); background: var(--accent-soft); }
.jm-dd-hint { margin: 4px 6px 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.jm-dd-divider { border-top: 1px solid var(--border); margin: 4px 4px; }

/* 右侧：总张数/预估 + 圆形生成钮 */
.jm-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.jm-total { font-size: 13px; color: var(--muted); white-space: nowrap; }
.jm-total b { color: var(--fg); font-weight: 600; }
.jm-spark { color: var(--accent); margin-right: 3px; }
.jm-pt-sep { margin: 0 6px; color: var(--border-strong); }   /* 张数 · 点数 之间的分隔点 */
.jm-send {
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: linear-gradient(135deg, #ffa04d, #e85d12); color: #1a1300;
  font-size: 20px; font-family: inherit; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 22px rgba(247,107,28,.25); transition: transform .15s, box-shadow .15s;
}
.jm-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(247,107,28,.35); }
.jm-send:disabled { background: rgba(255,255,255,.08); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.jm-send-sec { font-size: 12px; font-weight: 600; }

/* 卡下提示行 */
.jm-hint { max-width: 980px; margin: 14px auto 0; text-align: center; color: var(--muted); opacity: .7; font-size: 12.5px; }
.jm-hint.warn { color: #f76b1c; opacity: 1; }

/* 视频生成状态条在卡内占整行 */
.jm-card .video-status-banner { margin-top: 12px; }

@media (max-width: 860px) {
  .jm-panel { padding-top: 28px; }
  .jm-title { font-size: 24px; margin-bottom: 22px; }
  .jm-card { padding: 16px 14px 12px; }
  .mod-tab { font-size: 12px; padding: 10px 0 24px; }
  .mod-ico { display: none; }
  .jm-right { margin-left: 0; width: 100%; justify-content: flex-end; }
}

/* ===== 批量换装 · 模特图批量区（jm-persons，空位常驻虚线格） ===== */
.jm-persons {
  flex: 1; align-self: stretch; min-width: 280px; min-height: 124px; cursor: pointer; border-radius: 14px;
  display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; align-items: flex-start;
  padding: 10px 4px 6px; transition: background .15s;
}
.jm-persons:hover { background: rgba(255,255,255,.02); }
.jm-person-card { position: relative; width: 74px; height: 96px; border-radius: 10px; border: 1px solid var(--border-strong); overflow: hidden; cursor: default; }
.jm-person-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jm-person-tag { position: absolute; top: 5px; left: 5px; background: rgba(0,0,0,.55); border-radius: 5px; font-size: 10px; padding: 1px 5px; color: #eee; }
.jm-person-x {
  position: absolute; top: 4px; right: 4px; width: 17px; height: 17px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #ccc; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.jm-person-x svg.lucide { width: 10px; height: 10px; }
.jm-person-x:hover { color: #fff; background: rgba(0,0,0,.75); }
.jm-person-slot {
  width: 74px; height: 96px; border-radius: 10px; border: 1.5px dashed var(--border-strong);
  background: rgba(255,255,255,.02); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: border-color .15s;
}
.jm-persons:hover .jm-person-slot { border-color: var(--accent-ring); }
.jm-slot-plus { font-size: 20px; line-height: 1; font-weight: 300; }
.jm-slot-label { font-size: 10.5px; color: var(--muted); opacity: .7; }
.jm-persons-hint { width: 100%; order: 9; margin: 4px 0 0; color: var(--muted); opacity: .6; font-size: 12.5px; line-height: 1.6; pointer-events: none; }

/* ===== 链接裂变 · 空态即梦式贴链接卡 ===== */
.jm-body--bar { min-height: 64px; align-items: center; flex-wrap: nowrap; gap: 12px; padding: 4px 6px 0; }
.jm-link-ico { font-size: 18px; opacity: .8; flex: none; }
.jm-input--line { min-height: auto; height: 44px; padding: 0 4px; line-height: 44px; font-size: 16px; }
.jm-prog { color: var(--accent); opacity: 1; }
/* 裂变空态面板沿用 jm-panel 透明化；选图阶段恢复 fz-panel 原样 */
.fz-panel.jm-panel .fz-title-row { display: none; }
/* 干掉全局 input[type=text] 的盒样式（特异性持平靠后置胜出），保持卡内无缝观感 */
input.jm-input--line, input.jm-input--line:focus {
  background: transparent; border: none; box-shadow: none; outline: none; border-radius: 0;
}

/* ===== 右下角浮钮组 + 角落工具「链接换图」 ===== */
.corner-fabs { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.corner-fabs .fz-hist-fab { position: static; }
.ct-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 850; }  /* 850/855 > genModal backdrop(800)：从生成弹窗内点「传图片空间」也能盖在其上，否则面板被遮=点了没反应 */
.ct-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(540px, 94vw); z-index: 855;
  background: var(--bg-base); border-left: 1px solid var(--border);
  box-shadow: -14px 0 44px rgba(0,0,0,.5); overflow-y: auto; padding: 18px 22px 30px;
  animation: ctSlideIn .22s ease;
}
@keyframes ctSlideIn { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.ct-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ct-head h2 { margin: 0; font-size: 16.5px; }
.ct-head-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.ct-x { background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; }
.ct-x:hover { color: var(--fg); }
.ct-link { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px;
  color: var(--fg); font: inherit; font-size: 13px; padding: 10px 12px; outline: none; margin-bottom: 14px; }
.ct-link:focus { border-color: var(--accent-ring); box-shadow: none; }
.ct-row { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.ct-thumb { width: 52px; height: 66px; border-radius: 8px; overflow: hidden; flex: none; }
.ct-thumb.sq { height: 52px; }
.ct-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-ar { flex: none; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.07); border-radius: 6px; padding: 2px 7px; }
.ct-ar.a11 { color: #8ec9ff; } .ct-ar.a34 { color: #9be29b; } .ct-ar.a23 { color: #e2b69b; }
.ct-ar.bad { color: #ef8989; }
.ct-dim { font-size: 12.5px; color: var(--muted); flex: none; }
.ct-slot { flex: 1; background: #1b1b1f; border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--fg); font: inherit; font-size: 13px; padding: 8px 10px; outline: none; }
.ct-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; flex: none; }
.ct-del:hover { color: var(--fg); }
.ct-add { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 12px; text-align: center;
  color: var(--muted); opacity: .8; font-size: 12.5px; cursor: pointer; margin-top: 12px; transition: border-color .15s; }
.ct-add:hover { border-color: var(--accent-ring); }
.ct-go { margin-top: 16px; width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #ffa04d, #e85d12); color: #1a1300; font: inherit; font-size: 14.5px; font-weight: 700; }
.ct-go:disabled { background: rgba(255,255,255,.08); color: var(--muted); cursor: not-allowed; }
.ct-note { margin-top: 10px; font-size: 12px; color: var(--muted); opacity: .75; line-height: 1.7; text-align: center; }

/* 角落工具：传图片空间补充（命名输入 / 文件夹行 / 进度行金色） */
.ct-name { flex: 1; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg); font: inherit; font-size: 13px; padding: 8px 10px; outline: none; }
.ct-name:focus { border-color: var(--accent-ring); box-shadow: none; }
.ct-folder { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.ct-prog { color: var(--accent); opacity: 1; }
/* ===== 当日创作页：一天一页，时间线排图 ===== */
/* 创作历史页（导航平级 tab）：主区记录流，自身滚动 */
.hist-view { height: calc(100vh - 56px); overflow-y: auto; padding: 4px 8px 40px; }
/* 板块筛选条：sticky 在历史流最顶（z 高过日期头），日期头 top 顺移到其下方 */
.hist-filter { position: sticky; top: 0; z-index: 6; max-width: 1080px; margin: 0 auto; padding: 8px 0; background: rgba(14,14,16,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hist-day { margin-bottom: 34px; }
.hist-day-head { font-size: 17px; font-weight: 700; margin: 0 auto 18px; max-width: 1080px; display: flex; align-items: baseline; gap: 10px; position: sticky; top: 44px; z-index: 5; padding: 10px 0; background: rgba(14,14,16,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hist-day-head span { font-size: 12px; font-weight: 600; color: var(--muted); }
.hist-load { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 0 30px; }
.day-empty { margin: 120px auto; text-align: center; color: var(--muted); font-size: 14px; }
.day-line { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 30px; }
.day-node { display: grid; grid-template-columns: 120px 1fr; gap: 18px; }
.day-time { position: relative; padding-left: 18px; }
.day-time::before { content: ''; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.day-time::after { content: ''; position: absolute; left: 4px; top: 26px; bottom: -30px; width: 1px; background: var(--border); }
.day-node:last-child .day-time::after { display: none; }
.day-time b { display: block; font-size: 15px; }
.day-time span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.day-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.day-grid img { height: 200px; width: auto; border-radius: 12px; border: 1px solid var(--border); cursor: zoom-in; background: rgba(0,0,0,.3); }  /* 统一高、宽随原图比例（1:1/3:4/2:3 原样不裁） */
.day-grid img:hover { border-color: var(--accent-ring); }
/* 旧竖版用户区（.as-user 一套）已删（2026-06-12）：宽侧栏不存在了，残留的 align-self:flex-start
   还把窄轨头像顶去左边 16px；点数胶囊/头像样式现统一走下面 rail2 一套 */
/* 创作历史组操作（取代旧抽屉）：时间列下小按钮竖排 */
.day-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-right: 14px; }
.day-act { font-size: 11px; font-weight: 600; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--fg); cursor: pointer; text-align: center; white-space: nowrap; font-family: inherit; }
.day-act:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 左侧栏 V2（方案A 即梦式极简窄轨）===== */
/* 2026-06-12 用户反馈"左边logo都太小"：轨72→80、logo34→42、图标19→23、头像32→38 整体放大一档 */
.app-side.rail2 { width: 80px; padding: 14px 0 12px; align-items: center; }
/* logo 可点回创作：明显的金色波纹环 + 弹跳（金=品牌金，跟侧栏系列统一；2026-06-13 加强可见度——
   光晕加在金 logo 上同色融掉看不见，改用实描边圆环从 logo 扩散） */
.rv-logo-btn { position: relative; flex: 0 0 auto; display: block; border: none; background: none;
  padding: 0; margin-bottom: 7px; cursor: pointer; border-radius: 13px; }
.rv-logo { display: block; transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.rv-logo-btn:hover .rv-logo { transform: scale(1.08); }
.rv-logo-btn:active .rv-logo { transform: scale(.9); }
/* 点击：金色圆环从 logo 边缘向外扩散淡出（明显的金色动向）+ logo 明显弹一下 */
.rv-logo-btn::after { content: ''; position: absolute; inset: -3px; border-radius: 15px;
  border: 2.5px solid var(--accent); opacity: 0; pointer-events: none; }
.rv-logo-btn.pulse::after { animation: rvLogoRing .6s ease-out; }
.rv-logo-btn.pulse .rv-logo { animation: rvLogoFlash .6s ease; }
@keyframes rvLogoRing {
  0%   { opacity: .95; transform: scale(.7); }
  100% { opacity: 0;   transform: scale(1.6); }
}
@keyframes rvLogoFlash {
  0%, 100% { transform: scale(1); }
  35%      { transform: scale(1.14); }
}
/* 工具名+版本两行（2026-06-12 找回：窄轨改版时随旧品牌行丢了） */
.rv-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 14px; cursor: default; }
.rv-meta b { font-size: 10.5px; font-weight: 700; color: var(--fg); letter-spacing: 1px; }
.rv-meta span { font-size: 9px; color: var(--muted); letter-spacing: .4px; }
.rv-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; padding: 10px 0; border: none; background: none; color: var(--muted); cursor: pointer; font-family: inherit; }
.rv-it i { font-style: normal; line-height: 1; display: flex; }
.rv-svg { width: 23px; height: 23px; display: block; transition: transform .28s cubic-bezier(.34,1.56,.64,1); }   /* 统一线性图标，currentColor 随三态变色 2026-06-22 */
.rv-it span { font-size: 11.5px; letter-spacing: .5px; transition: transform .28s cubic-bezier(.34,1.56,.64,1); }
.rv-it:hover { color: var(--fg); }
.rv-it.on { color: var(--accent); }                                  /* 激活态金色（SVG currentColor 随之变金，不再靠 emoji 光晕 hack） */
.rv-it:active .rv-svg { transform: scale(1.2); }                     /* 方案C 点击 pop：按下放大、松开弹性回 */
.rv-it:active span { transform: scale(1.08); }
.rv-it::before { content: ''; position: absolute; left: 7px; top: 50%; width: 3px; height: 26px; border-radius: 2px;   /* 方案C 选中态：左侧橙竖条 */
  background: var(--accent); transform: translateY(-50%) scaleY(0); transition: transform .26s cubic-bezier(.34,1.56,.64,1); }
.rv-it.on::before { transform: translateY(-50%) scaleY(1); }
.fz-batch-nav-btn i{position:relative;width:28px;height:28px;align-items:center;justify-content:center}
.fz-batch-nav-ico{width:28px;height:28px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.035);border:1px solid var(--border);color:var(--muted);font-size:13px;font-weight:800;letter-spacing:0}
.fz-batch-nav-btn b{position:absolute;right:-7px;bottom:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:var(--accent);color:#1a1300;font-size:10px;line-height:18px;box-shadow:0 4px 12px rgba(0,0,0,.35)}
.fz-batch-nav-btn.on .fz-batch-nav-ico{background:var(--accent);color:#1a1300;border-color:var(--accent)}
.rv-sp { flex: 1; }
.rail2 .as-points { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid rgba(247,107,28,.35); background: var(--accent-soft); color: var(--accent); padding: 5px 12px; border-radius: 14px; cursor: pointer; font-family: inherit; margin-bottom: 12px; transition: background .15s, border-color .15s; }
.rail2 .as-points:hover { background: rgba(247,107,28,.22); border-color: rgba(247,107,28,.55); }
.rail2 .as-points .pt-num { font-size: 12.5px; font-weight: 700; line-height: 1.1; }
.rail2 .as-points .pt-rc { font-size: 8.5px; font-weight: 500; line-height: 1; opacity: .82; letter-spacing: .3px; }
.rail2 .as-points[hidden] { display: none; }
.rail2 .as-avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px dashed var(--border-strong); background: var(--panel-strong); margin-bottom: 12px; flex: 0 0 auto; }
/* .rv-ico（轨上📊⚙️）已删（2026-06-12）：与头像菜单「用量与账单/设置」重复 */
.rv-dot { width: 9px; height: 9px; border-radius: 50%; background: #2ea043; box-shadow: 0 0 7px #2ea043; margin-top: 8px; flex: 0 0 auto; }
/* 左侧栏固定常显（2026-06-13）：原 @media(max-width:900px) 隐藏 rail2 的规则已去 */

/* —— 公网延迟登录：匿名态弱化 —— */
body.ps-anon .as-auth-only { display: none !important; }   /* 匿名藏历史(及其内的收藏) */
.as-avatar.as-login-btn {                                  /* 头像壳 → 「登录/注册」引导按钮 */
  width: 46px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1.18; text-align: center;
  color: #fff; background: var(--accent, #f76b1c);
  cursor: pointer; border: none; border-radius: 10px;
}
.as-avatar.as-login-btn:hover { filter: brightness(1.08); }

/* ===== 大牌风格蒸馏画廊（自由生图板 · 方案A 按品类分组）===== */
.gal { margin: 22px auto 0; max-width: 1080px; }   /* 居中收宽：防宽屏卡片过大、跟创作列对齐 */
.gal-group { margin-bottom: 26px; }
.gal-group:last-child { margin-bottom: 0; }
.gal-grp-h { font-size: 13px; font-weight: 700; color: #cfcfd6; margin: 2px 0 12px; display: flex; align-items: center; gap: 8px; }
.gal-grp-h::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.gal-grp-n { font-size: 11px; color: #7d7d86; font-weight: 500; }
.gal-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; flex-wrap: wrap; }
.gal-bar { width: 4px; height: 21px; border-radius: 2px; background: linear-gradient(#ff8a3d, #f76b1c); flex: none; }
.gal-h2 { font-size: 19px; font-weight: 700; margin: 0; color: #fff; letter-spacing: .3px; }
.gal-badge { font-size: 11px; font-weight: 600; color: #f9a25e; background: rgba(247, 107, 28, .13); border: 1px solid rgba(247, 107, 28, .28); padding: 2px 9px; border-radius: 20px; }
.gal-sub { color: #8a8a92; font-size: 13px; margin-left: auto; }
.gal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 1000px) { .gal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .gal-grid { grid-template-columns: repeat(2, 1fr); } }
.gal-card { position: relative; border-radius: 14px; overflow: hidden; cursor: default; border: 1.5px solid rgba(255, 255, 255, .08); background: #1a1a1f; transition: transform .2s, border-color .2s; aspect-ratio: 3 / 4; }
.gal-card img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: .45s; }
.gal-card:hover img { transform: scale(1.05); }
.gal-card:hover { border-color: rgba(247, 107, 28, .55); transform: translateY(-3px); }
.gal-card-ov { position: absolute; inset: auto 0 0 0; padding: 34px 14px 13px; background: linear-gradient(transparent, rgba(0, 0, 0, .9)); pointer-events: none; }
.gal-card-bn { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gal-card-cat { display: inline-block; margin-top: 7px; font-size: 11px; font-weight: 600; color: #f9b87f; background: rgba(247, 107, 28, .18); border: 1px solid rgba(247, 107, 28, .4); padding: 2px 9px; border-radius: 11px; }
.gal-card-hover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; opacity: 0; transition: .2s; background: rgba(10, 10, 12, .5); }
.gal-card:hover .gal-card-hover { opacity: 1; }
.gal-card-act { background: rgba(247, 107, 28, .95); border: none; color: #fff; font-size: 13px; padding: 8px 18px; border-radius: 22px; font-weight: 600; cursor: pointer; transition: background .15s; }
.gal-card-act:hover { background: #ff7d33; }
.gal-card-act--ghost { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .4); }
.gal-card-act--ghost:hover { background: rgba(255, 255, 255, .2); }
.jm-pill--ghost { color: #9a9aa3; cursor: default; opacity: .75; }

/* 参考图多图上传（自由生图板）—— 用独立 .jm-up，避免和 video tab 的 .jm-refs 撞 */
.jm-up { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.jm-up-item { position: relative; width: 88px; height: 110px; border-radius: 11px; overflow: hidden; border: 1px solid var(--border-strong); flex: none; }
.jm-up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jm-up-x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: none; background: #2a2a2e; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.jm-up-x svg.lucide { width: 11px; height: 11px; }
.jm-up-x:hover { color: var(--fg); }
.jm-up-add { width: 88px; height: 110px; border-radius: 11px; border: 1.5px dashed var(--border-strong); background: rgba(255,255,255,.03); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; transition: border-color .2s; }
.jm-up-add:hover { border-color: var(--accent-ring); }
.jm-up-add .jm-plus { font-size: 28px; }
.jm-up-add .lbl { font-size: 11px; color: var(--muted); }
.jm-up-add .jm-opt { font-size: 9px; color: var(--muted); opacity: .6; margin-top: -3px; }   /* 「选填」：参考图下方更小更淡的次提示 */

/* @ 引用图 picker（自由生图板）—— teleport 到 body，浮在光标边上 */
.at-chip { cursor: pointer; }
.at-pick { position: fixed; z-index: 900; display: flex; flex-direction: column; gap: 3px; background: #1c1c20; border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.5); max-width: 240px; }
.at-pick-empty { font-size: 12px; color: var(--muted); padding: 4px 6px; }
.at-pick-item { display: flex; align-items: center; gap: 8px; background: transparent; border: none; border-radius: 7px; padding: 5px 12px 5px 5px; cursor: pointer; color: var(--fg); font-size: 13px; text-align: left; }
.at-pick-item:hover { background: rgba(255,255,255,.07); }
.at-pick-item img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; display: block; }

/* ===== 本地保存三态控件 ===== */
.ls-modes { display: flex; gap: 8px; margin-top: 10px; }
.ls-mode {
  flex: 1; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2, #1b1e24); color: var(--ink, #e6e8ec);
  border: 1px solid var(--line, #333a45); font-size: 13px; transition: all .15s;
}
.ls-mode:hover:not(:disabled) { border-color: var(--brand, #f76b1c); }
.ls-mode.on { background: var(--brand, #f76b1c); color: #fff; border-color: var(--brand, #f76b1c); }
.ls-mode:disabled { opacity: .45; cursor: not-allowed; }
.ls-folder-row {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  font-size: 13px; color: var(--muted, #8b909b);
}
.ls-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 自由生图比例选择器：横排比例小卡（暗色，跟工具栏一致；选中=品牌橙；形状按 w:h 缩略） */
.dd-panel--ratios { min-width: 250px; padding: 9px 11px 11px; }
.rg-lbl { font-size: 11px; color: var(--muted); margin: 1px 0 8px; }
.rg-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-btn { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; width: 52px; height: 54px; padding: 6px 0 5px; cursor: pointer; background: var(--card); border: 1px solid var(--border); border-radius: 9px; transition: border-color .12s, background .12s; }
.rg-btn:hover { border-color: var(--accent-ring); }
.rg-btn.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-ring); }
.rg-glyph { display: block; border: 1.6px solid var(--muted); border-radius: 3px; }
.rg-btn.on .rg-glyph { border-color: var(--accent); }
.rg-cap { font-size: 11px; line-height: 1; color: var(--fg); }
.rg-btn.on .rg-cap { color: var(--accent); font-weight: 600; }

/* ===== 批量裂变任务侧栏 ===== */
.fz-batch-input{width:100%;border:1px solid var(--border);border-radius:10px;padding:10px 12px;font-size:13px;line-height:1.7;resize:vertical;outline:none;background:rgba(255,255,255,.035);color:var(--fg)}
.fz-batch-input:focus{border-color:var(--accent-ring);box-shadow:0 0 0 3px var(--accent-soft)}
.fz-go-btn{background:var(--accent);color:#1a1300;border:0;border-radius:8px;padding:8px 18px;font-size:13px;font-weight:700;margin-top:8px;cursor:pointer}
.fz-go-btn:disabled{opacity:.6;cursor:default}
.fz-batch-side{
  position:fixed;left:94px;top:16px;bottom:16px;width:328px;z-index:42;
  display:flex;flex-direction:column;gap:12px;padding:14px;
  background:rgba(18,18,22,.86);border:1px solid var(--border);border-radius:14px;
  box-shadow:0 24px 70px rgba(0,0,0,.42);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
}
.fz-panel > div.fz-batch-side{position:fixed !important}
.fz-batch-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);padding-bottom:12px}
.fz-batch-head b{display:block;font-size:15px}
.fz-batch-head span{display:block;margin-top:3px;color:var(--muted);font-size:12px}
.fz-batch-head-actions{display:flex;align-items:center;gap:8px}
.fz-batch-head em{font-style:normal;color:#f9a76b;background:rgba(247,107,28,.12);border:1px solid rgba(247,107,28,.24);border-radius:999px;padding:4px 9px;font-size:11px;font-weight:700;white-space:nowrap}
.fz-batch-close{width:26px;height:26px;border-radius:8px;border:1px solid var(--border);background:rgba(255,255,255,.035);color:var(--muted);cursor:pointer;font-size:18px;line-height:1}
.fz-batch-close:hover{color:var(--fg);border-color:var(--border-strong);background:rgba(255,255,255,.07)}
.fz-batch-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.fz-batch-metrics span{background:rgba(255,255,255,.045);border:1px solid var(--border);border-radius:8px;padding:8px 9px;color:var(--muted);font-size:11px}
.fz-batch-metrics b{color:var(--fg);font-size:15px;margin-right:4px}
.fz-batch-gen-progress{display:flex;flex-direction:column;gap:7px;padding:2px 1px 4px}
.fz-batch-gen-progress>div{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px}
.fz-batch-gen-progress b{color:var(--fg);font-size:12px}.fz-batch-gen-progress span{color:var(--muted)}
.fz-batch-gen-progress>i{display:block;height:7px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.10);font-style:normal}
.fz-batch-gen-progress>i>em{display:block;height:100%;border-radius:inherit;background:var(--accent);transition:width .6s ease}
.fz-batch-publish{display:grid;grid-template-columns:1fr;gap:8px;padding:10px;border:1px solid rgba(247,107,28,.22);border-radius:10px;background:rgba(247,107,28,.07)}
.fz-title-opt{display:inline-flex;align-items:center;gap:7px;min-height:26px;color:#d6d6dc;font-size:12px;line-height:1.2;cursor:pointer;white-space:nowrap}
.fz-title-opt input{width:15px;height:15px;margin:0;accent-color:var(--accent);cursor:pointer}
.fz-racts>.fz-title-opt{margin-right:2px}
.fz-batch-pub-btn{height:36px;border-radius:8px;border:1px solid var(--border-strong);background:rgba(255,255,255,.055);color:var(--fg);font-family:inherit;font-size:12.5px;font-weight:800;cursor:pointer}
.fz-batch-pub-btn.main{border-color:var(--accent);background:var(--accent);color:#1a1300}
.fz-batch-pub-btn:hover:not(:disabled){filter:brightness(1.06);transform:translateY(-1px)}
.fz-batch-pub-btn:disabled{opacity:.5;cursor:default;transform:none}
.fz-task-list{display:flex;flex-direction:column;gap:8px;overflow:auto;padding-right:2px}
.fz-task-row{width:100%;display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;
  border:1px solid var(--border);background:rgba(255,255,255,.035);color:var(--fg);border-radius:10px;padding:8px;cursor:pointer;font-family:inherit}
.fz-task-row:hover{border-color:var(--border-strong);background:rgba(255,255,255,.06)}
.fz-task-row.on{border-color:var(--accent-ring);box-shadow:0 0 0 1px rgba(247,107,28,.14)}
.fz-task-row.fail{border-color:rgba(239,68,68,.36)}
.fz-task-row.configured{background:rgba(34,197,94,.07)}
.fz-task-row.skipped{opacity:.62}
.fz-batch-thumb{width:40px;height:52px;min-height:0;flex:none;border-radius:7px;object-fit:cover;background:rgba(255,255,255,.08);display:inline-block}
.fz-batch-thumb-empty{background:linear-gradient(135deg,rgba(255,255,255,.10),rgba(247,107,28,.10))}
.fz-task-main{min-width:0}
.fz-task-main strong{display:block;font-size:12.5px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fz-task-main small{display:block;color:var(--muted);font-size:11px;line-height:1.35;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fz-task-main .fz-stage-progress{display:flex;gap:4px;margin-top:7px;font-style:normal}
.fz-task-main .fz-stage{display:flex;width:22px;flex:none;flex-direction:column;align-items:center;gap:4px}
.fz-task-main .seg{width:100%;height:3px;border-radius:999px;background:rgba(255,255,255,.12)}
.fz-task-main .fz-stage-name{color:rgba(255,255,255,.34);font-size:9px;line-height:1;white-space:nowrap}
.fz-task-main .fz-stage.done .seg{background:rgba(34,197,94,.65)}
.fz-task-main .fz-stage.done .fz-stage-name{color:rgba(134,239,172,.72)}
.fz-task-main .fz-stage.cur .seg{background:var(--accent)}
.fz-task-main .fz-stage.cur .fz-stage-name{color:#f9a76b;font-weight:700}
.fz-bstate{font-size:11px;padding:4px 8px;border-radius:999px;font-weight:700;display:inline-block;white-space:nowrap}
.fz-bstate.grab{background:rgba(99,102,241,.16);color:#a5b4fc}.fz-bstate.config{background:rgba(59,130,246,.14);color:#93c5fd}
.fz-bstate.generate{background:rgba(247,107,28,.14);color:#f9a76b}.fz-bstate.select{background:rgba(168,85,247,.14);color:#d8b4fe}
.fz-bstate.publish{background:rgba(34,197,94,.15);color:#86efac}.fz-bstate.fail{background:rgba(239,68,68,.16);color:#fca5a5}
.fz-flowbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 16px;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:rgba(255,255,255,.045)}
.fz-flow-meta{min-width:0}
.fz-flow-meta b{display:block;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fz-flow-meta span{display:block;color:var(--muted);font-size:12px;margin-top:3px}
.fz-flow-meta span.err{color:#fca5a5}
.fz-flow-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.fz-more-menu,.fz-bulk-menu{position:relative}
.fz-flow-more{width:36px;height:36px;padding:0;border:1px solid var(--border);border-radius:8px;background:rgba(255,255,255,.035);color:var(--fg);font-size:16px;letter-spacing:1px;cursor:pointer}
.fz-flow-more:hover:not(:disabled),.fz-flow-more.open{background:rgba(255,255,255,.08);border-color:var(--border-strong)}.fz-flow-more:disabled{opacity:.45;cursor:default}
.fz-flow-btn{border-radius:8px;border:1px solid var(--border);padding:8px 12px;font-family:inherit;font-size:12.5px;font-weight:700;cursor:pointer;white-space:nowrap}
.fz-flow-btn.ghost{background:rgba(255,255,255,.035);color:var(--fg)}
.fz-flow-btn.ghost:hover:not(:disabled){background:rgba(255,255,255,.07)}
.fz-flow-btn.main{background:var(--accent);border-color:var(--accent);color:#1a1300}
.fz-flow-btn:disabled{opacity:.48;cursor:default}
@media (max-width:1180px){
  .fz-batch-side{position:fixed;left:16px;right:16px;top:auto;bottom:86px;width:auto;max-height:min(520px,calc(100vh - 120px))}
}
