:root {
  --bg: #0d1016;
  --bg-soft: #141922;
  --panel: #171d28;
  --panel-2: #1d2431;
  --line: #262e3d;
  --text: #e6ebf2;
  --text-dim: #8d99ad;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --ok: #37c98a;
  --warn: #e8b23a;
  --err: #f0605f;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(120deg, #151b26 0%, #10141c 60%, #151221 100%);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 700; letter-spacing: .5px;
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 650; }
.brand .sub { margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
  padding: 5px 11px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
}
.pill.good { color: var(--ok); border-color: #22503c; }
.pill.bad { color: var(--err); border-color: #4d2626; }
.pill.warn { color: var(--warn); border-color: #4a3c1c; }

/* ---------- 顶栏：模型档位左右拨动 ---------- */
.tier-switch {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px;
}
.tier-arrow {
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-dim); font-size: 10px; line-height: 1;
  width: 22px; height: 22px; border-radius: 999px;
}
.tier-arrow:hover { color: var(--text); background: #232b3a; }
.tier-arrow:disabled { opacity: .4; cursor: default; }
.tier-label {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
  padding: 0 4px; cursor: default;
}
.tier-label b { color: var(--text); font-weight: 600; }
.tier-label em { font-style: normal; font-size: 11px; color: var(--accent); }
/* 低价档：提醒它会把面料抹平（颜色跟 warn 一致） */
.tier-label.warn b { color: var(--warn); }
.tier-label.warn em { color: var(--warn); }

/* ---------- 标签 ---------- */
.tabs {
  display: flex; gap: 4px; padding: 10px 22px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  position: sticky; top: 69px; z-index: 30;
}
.tab {
  background: transparent; border: 0; color: var(--text-dim);
  padding: 10px 16px; border-radius: 10px 10px 0 0; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); background: #1a212d; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); background: var(--panel); }
.tab em { font-style: normal; color: var(--accent); font-size: 12px; }

/* ---------- 「上新素材」一级入口 + 悬浮二级导航 ---------- */
.tab-group { position: relative; display: flex; }
.tab-parent { display: inline-flex; align-items: center; gap: 6px; }
.tab-parent .caret { font-style: normal; font-size: 10px; opacity: .7; transition: transform .15s; }
.tab-group.open .caret { transform: rotate(180deg); }
/* 父项在「悬浮中 / 展开了 / 当前视图属于这一组」三种情况下都要有选中的样子 —— 
   二级导航里的步骤被激活时，一级入口必须跟着高亮，否则用户看不出自己在哪一步。 */
.tab-group:hover > .tab-parent,
.tab-group:focus-within > .tab-parent,
.tab-group.open > .tab-parent,
.tab-group.active > .tab-parent {
  color: var(--text); background: #1a212d; border-bottom-color: var(--accent);
}
.submenu {
  position: absolute; top: 100%; left: 0; z-index: 60;
  min-width: 244px; padding: 6px;
  display: none; flex-direction: column; gap: 2px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .45);
}
.tab-group.open .submenu { display: flex; }
.submenu { max-height:calc(100vh - 150px); overflow-y:auto; }
.submenu a.tab { text-decoration:none; }
.submenu .tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 8px 10px;
  border-radius: 8px; border-bottom: 0;
}
.submenu .tab small { color: var(--text-dim); font-size: 11px; }
.submenu .tab.active { background: var(--panel-2); color: var(--text); }
.submenu .tab.active small { color: var(--accent); }

/* ---------- 视图 ---------- */
.view { display: none; padding: 18px 22px 40px; }
.view.active { display: block; }
#view-flow.active {
  padding: 10px 10px 26px;
}
#view-flow #product-console {
  width: 100%;
  max-width: none;
  border-radius: 0 !important;
  background: #f5f6f2;
}

/* 生成台：左边 1、选模特图；中间 2、选服装图；右边 3、生成参数。
   前两栏要「竖向全屏」——高度撑满视口，图片网格自己在内部滚动，
   否则一次只看得见十几张图，翻批次要来回滚整页。 */
.studio {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.5fr) 330px;
  gap: 16px;
  align-items: start;
}
.library { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }

/* Demo：左边两栏叠着放（1 参考图 / 2 人台图），中间写补充要求，右边看结果。
   两个选图面板都是 `.panel.fill`，但一列里叠两个，各自的高度要分一半，
   所以这里覆盖掉 .panel.fill 的「撑满视口」。 */
.studio.demo { grid-template-columns: minmax(240px, 1fr) minmax(300px, 360px) minmax(300px, 1.2fr); }
.demo-picks { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* 一列里叠着两个选图面板（1 参考图 / 2 人台图）：各分一半高度，
   网格在自己内部滚动 —— 照搬 .panel.fill 那套（竖屏全高 + 网格内部滚动） */
.demo-picks .panel.fill { height: calc((100vh - 200px) / 2); min-height: 300px; }
.studio.demo .thumb.result { cursor: zoom-in; }
.studio.demo .thumb.result img { object-fit: contain; background: #0f1218; }
/* 仿写的结果区和 Demo 一样：一屏一张大图，点开看原图 */
.studio.copy .thumb.result { cursor: zoom-in; }
.studio.copy .thumb.result img { object-fit: contain; background: #0f1218; }
/* 结果区：一张图占满整个预览区，多张时向下滚动逐张看。
   原来它挂的是 `.grid.clothes`（5 列小卡片），在右侧这一栏里小到看不清 —— 这里整条覆盖掉。
   选择器带 id，特异性高于 `.grid.clothes` 与媒体查询里那几条，不需要 !important。
   仿写的结果区（#copy-result-grid）共用同一套。 */
#demo-result-grid,
#copy-result-grid {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-auto-rows: 100%;
  align-content: start;
  overflow-y: auto;
}
/* 「正在生成…」这类空态：占满整块并居中，别缩在左上角 */
#demo-result-grid.empty,
#copy-result-grid.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 结果图右上角那组按钮：✓ 确认（入库）+ ✎ 继续改（拿它当新图1）。
   .compare-box 里也用同一个容器，所以这两个按钮自己不做绝对定位。 */
.result-actions {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.btn-confirm,
.btn-reuse {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(12,16,24,.68);
  color: #e8eefc;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.btn-confirm:hover,
.btn-reuse:hover {
  border-color: var(--accent);
  color: #fff;
  background: rgba(91,140,255,.35);
}
.btn-confirm.done {
  border-color: #2f7d4f;
  color: #b9f0cd;
  background: rgba(28,78,50,.78);
  cursor: default;
}
.btn-reuse { border-color: rgba(155,190,255,.5); }

/* 左右滑动对比：左边原始参考图、右边生成结果，中间拖一条竖线。
   不开对比时这个 id 依旧是上面那套「一屏一张」的网格。 */
#btn-demo-compare.on {
  border-color: var(--accent);
  color: #cfe0ff;
  background: rgba(91,140,255,.14);
}
#demo-result-grid.compare {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.compare-box {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1218;
  cursor: ew-resize;
  user-select: none;
  /* 手指拖动时不要让页面跟着滚 */
  touch-action: none;
}
.compare-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* 事件一律由 .compare-box 接，图片不参与命中测试，拖动不会卡顿 */
  pointer-events: none;
}
.cmp-before { will-change: clip-path; }
.cmp-line {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.65);
  pointer-events: none;
}
.cmp-knob {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #1a1f2b;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.cmp-tag {
  position: absolute; top: 8px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.55); color: #dfe6f2;
  font-size: 11px; pointer-events: none;
}
.cmp-tag.left { left: 8px; }
.cmp-tag.right { right: 8px; }
.compare-strip {
  flex: 0 0 auto;
  display: flex; gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.compare-strip .mini {
  flex: 0 0 auto;
  width: 52px; height: 68px;
  border-radius: 6px; overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-soft);
  cursor: pointer;
}
.compare-strip .mini.active { border-color: var(--accent); }
.compare-strip .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 生成进度条：点完生成就留在本页，右边实时报进度与出图 */
.demo-progress {
  flex: 0 0 auto; margin-bottom: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #161c26;
  font-size: 12px; color: var(--text-dim);
}
.demo-progress b { color: var(--text); }
.demo-progress.busy { border-color: #4a3c1c; color: var(--warn); }
.demo-progress.err { border-color: #5a2a2a; color: #ff8b8b; }
.demo-progress .bar {
  display: block; height: 3px; margin-top: 7px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: demo-sweep 1.4s linear infinite;
}
@keyframes demo-sweep { from { background-position: -200px 0; } to { background-position: 200px 0; } }

/* 结果面板尽量留在右侧：真窄的窗口才堆成一列 */
@media (max-width: 1180px) {
  .studio.demo { grid-template-columns: 1fr 1fr; }
  .studio.demo > .panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .studio.demo { grid-template-columns: 1fr; }
  .studio.demo > .panel:last-child { grid-column: auto; }
}
/* 素人素材仿写：四栏（我们的模特 / 素人素材 / 参数 / 结果）。
   跟 IP换装 是一样的布局习惯，只是列宽按两边的图网格调了一下。 */
.studio.copy {
  grid-template-columns: minmax(230px, 1fr) minmax(230px, 1fr) minmax(250px, 0.85fr) minmax(260px, 1fr);
}
@media (max-width: 1500px) {
  .studio.copy { grid-template-columns: 1fr 1fr; }
  .studio.copy > .panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .studio.copy { grid-template-columns: 1fr; }
  .studio.copy > .panel:last-child { grid-column: auto; }
}

/* 仿写结果区：永远「上面一张大图 + 下面一排小图」，大图自己不滚动
   （用户要的是点小图切换，不是往下拉）。结构跟 Demo 的对比模式一致，
   小图条就放在大图容器里，所以一定贴在大图下方。 */
#copy-result-grid.stacked {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
#copy-result-grid.stacked > .compare-box { flex: 1 1 auto; min-height: 0; }
#copy-result-grid.stacked > .thumb.result {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;   /* 覆盖 .thumb 的 3/4，高度交给 flex 撑满 */
}
#copy-result-grid.stacked > .compare-strip { flex: 0 0 auto; }

/* 页面内大图预览：内置浏览器会把 window.open 当弹窗拦掉，所以点图都在这里看 */
.image-viewer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* 画廊舞台：左右切换只换这一块，不重建整个模态（否则每切一张都闪一下） */
.iv-stage { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.iv-stage.is-loading {
  min-height: min(62vh, 560px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(244,240,232,.96), rgba(231,226,216,.9));
}
.image-viewer.actual .iv-stage { justify-content: flex-start; }
.iv-loading, .iv-msg {
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-align: center;
}
.iv-loading b, .iv-msg { color: var(--text); }
.iv-loading small, .iv-msg small { color: var(--text-dim); }
.iv-msg.bad { padding: 36px; }
.media-loading-dot {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(111, 99, 80, .18);
  border-top-color: var(--accent, #765f3f);
  border-radius: 50%;
  animation: media-loading-spin .8s linear infinite;
}
@keyframes media-loading-spin { to { transform: rotate(360deg); } }
.iv-nav { display: flex; align-items: center; gap: 10px; }
.iv-nav .hint { margin: 0; font-variant-numeric: tabular-nums; }
/* 产出缩略图左上角的「重跑」 */
.flc-regen { position: absolute; left: 4px; top: 4px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: rgba(10, 14, 22, .62); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; z-index: 3; }
.flc-thumb:hover .flc-regen { opacity: 1; }
.flc-regen:hover { background: var(--accent); }
.image-viewer img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 10px;
  background: #0f1218;
  cursor: zoom-out;
}
/* 视频：素材库里视频卡片长得跟图片一样，点开要能真放 */
.image-viewer video.image-viewer-media {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
  background: #0f1218;
}
.image-viewer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; width: 100%;
}
.image-viewer-bar .hint { margin: 0; }

/* 预览面板里的元信息（归属类型 / 真实尺寸 / 体积 / 格式）—— 控制台点图时用 */
.image-viewer-info {
  display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px;
  width: 100%; font-size: 12px; line-height: 1.8; text-align: left;
}
.image-viewer-info:empty { display: none; }
.image-viewer-info .k { color: var(--text-dim); white-space: nowrap; }
.image-viewer-info .v { word-break: break-all; font-variant-numeric: tabular-nums; }
/* 带参数时把图压矮一点：不然 2048×2048 竖图会把下面那几行参数顶出可视区，
   用户还得滚动才能看到体积/格式（参数一屏看完才是重点）。 */
.image-viewer.has-info img,
.image-viewer.has-info video.image-viewer-media { max-height: 56vh; }

/* 「1:1 实际像素」模式：图片按真实像素铺开（靠 modal-body 滚动）——
   「适应窗口」会把 2048×2048 缩到几百像素，看不出细节。 */
.image-viewer.actual { align-items: flex-start; }
.image-viewer.actual img { max-width: none; max-height: none; width: auto; height: auto; cursor: zoom-in; }

/* 仿写结果右上角的「＋选 / ✎再改一版」：.result-actions 已经是绝对定位，这里只压住角标 */
.copy-actions { z-index: 3; }
/* 同位置会撞上对比模式的右侧标签，把它挪到底部 */
#copy-result-grid .cmp-tag.right { top: auto; bottom: 8px; }

/* 结果区下方那条选择栏：勾了几张 · 建新 IP · 做姿势裂变 */
.pick-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0 0;
}
.pick-bar .hint { margin: 0; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }

@media (max-width: 1500px) {
  .studio { grid-template-columns: 1fr 1fr; }
  /* 窄屏时参数面板掉到第二行，占满整行更好读 */
  .studio > .panel:not(.fill) { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .studio, .library, .settings { grid-template-columns: 1fr; }
  .studio > .panel:not(.fill) { grid-column: auto; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.panel.wide { grid-column: 1 / -1; }

/* ---------- 竖向全屏面板 ---------- */
.panel.fill {
  height: calc(100vh - 172px);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel.fill .panel-head,
.panel.fill .ip-list,
.panel.fill .row-between,
.panel.fill .batch-bar,
.panel.fill .folders,
.panel.fill > .hint { flex: 0 0 auto; }

/* 面板 1：模特图网格占满剩余高度，内部滚动 */
.panel.fill .grid.models { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; align-content: start; }
.panel.fill .grid.models.empty { display: flex; align-items: center; justify-content: center; }

/* 面板 2：服装图网格占满剩余高度，底部提示常驻 */
.panel.fill .dropzone { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.panel.fill .grid.clothes { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; }
.panel.fill #clothes-hint { flex: 0 0 auto; padding-top: 8px; }
/* 姿势裂变的两栏同样是「网格内部滚动、底部提示与「显示更多」常驻」 */
.panel.fill .dropzone > .hint { flex: 0 0 auto; padding-top: 8px; }
.panel.fill .dropzone > .btn.full { flex: 0 0 auto; margin-top: 8px; }

/* 共享图库的图只能看不能删，角标替代删除按钮，避免误以为「这里也能删」 */
.thumb .badge {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  padding: 1px 5px; border-radius: 5px;
  background: rgba(15, 18, 24, .78); color: var(--text-dim);
  font-size: 10px; font-style: normal; letter-spacing: .5px;
}

/* 双人拼合：勾选顺序就是「第①个 / 第②个」，用 data-order 画个序号角标 */
.thumb[data-order]::after {
  content: attr(data-order);
  position: absolute; top: 5px; left: 5px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

/* 拼合预览弹窗里的图：两个人并排，别撑破弹窗 */
img.compose-preview {
  display: block; width: 100%; max-height: 58vh; object-fit: contain;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}

/* 「即将发送的参考图」：图1 / 图2 / 图3 排一行，顺序就是发出去的顺序 */
.ref-row {
  display: grid; gap: 10px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.ref-row figure { margin: 0; }
.ref-row img,
.ref-row .ref-empty {
  width: 100%; height: 240px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 8px; background: #0f1218;
}
.ref-row .ref-empty {
  display: grid; place-items: center;
  color: var(--text-dim); font-size: 12px;
}
.ref-row figcaption {
  margin-top: 5px; font-size: 12px; color: var(--text-dim); text-align: center;
}
.ref-row figure.missing img { border-color: var(--warn); }

/* ---------- 批次素材选择条 ---------- */
.batch-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.src-switch { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex: 0 0 auto; }
.src-chip {
  background: var(--panel-2); border: 0; color: var(--text-dim);
  padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.src-chip + .src-chip { border-left: 1px solid var(--line); }
.src-chip:hover { color: var(--text); }
.src-chip.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
.batch-select { flex: 1 1 180px; min-width: 150px; width: auto; }
.cloth-search-row { margin-bottom: 8px; }
#clothes-more { flex: 0 0 auto; margin: 8px 0 0; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 650; flex: 0 0 auto; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; justify-content: flex-end; }

.mini-title {
  margin: 16px 0 8px; font-size: 13px; font-weight: 600;
  display: flex; align-items: baseline; gap: 8px;
}
.req { color: var(--err); font-size: 11px; font-weight: 500; }

/* ---------- 控件 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: .15s;
}
.btn:hover { background: #242d3c; border-color: #33405a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.danger-solid { background: linear-gradient(135deg, #e0574f, #c2403a); border-color: transparent; color: #fff; font-weight: 600; }
.btn.danger-solid:hover { filter: brightness(1.1); }
.btn.mini { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.full { width: 100%; margin-top: 10px; }
.btn.danger { color: var(--err); border-color: #4d2626; }

.input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); padding: 8px 10px; border-radius: 9px; outline: none;
}
.input:focus { border-color: var(--accent); }
.input[readonly] { color: var(--text-dim); }
.area { resize: vertical; line-height: 1.55; }
.search { flex: 1 1 90px; min-width: 80px; max-width: 220px; width: auto; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > .input { flex: 1; }
.dash { color: var(--text-dim); }

.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.actions.tight { margin-top: 0; margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.hint.bad { color: var(--err); }
.hint.good { color: var(--ok); }
.hint.warn-text { color: var(--warn); }

/* ---------- IP / 网格 ---------- */
.ip-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ip-chip {
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 13px;
}
.ip-chip.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.ip-chip small { color: var(--text-dim); margin-left: 5px; }
.ip-chip.active small { color: #dfe6ff; }

.grid { display: grid; gap: 8px; }
/* 必须写 max-content：缩略图的高度完全来自 aspect-ratio（没有显式 height），
   在 flex 容器里（竖向全屏面板）用默认的 auto 行高时，Chromium 算出来的行高只有
   几像素，几百张图会全部叠在一起 —— 看上去像「只加载了一行」。
   max-content 才会把 aspect-ratio 换算出的高度算进行高。 */
.grid.models, .grid.clothes, .grid.outputs { grid-auto-rows: max-content; }
.grid.models { grid-template-columns: repeat(4, 1fr); max-height: 420px; overflow-y: auto; }
.grid.clothes { grid-template-columns: repeat(5, 1fr); }
.grid.outputs { grid-template-columns: repeat(6, 1fr); }

/* 模特图区兼作拖拽上传目标 */
.grid.models.empty {
  min-height: 150px; max-height: none;
  border: 1px dashed var(--line); border-radius: 10px; padding: 14px;
}
.grid.models.over { outline: 2px dashed var(--accent); outline-offset: 3px; background: rgba(91,140,255,.05); }
.empty-state { grid-column: 1 / -1; color: var(--text-dim); font-size: 12px; line-height: 2; }
.empty-state b { color: var(--text); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.row-between .hint { margin: 0; }
@media (max-width: 1200px) {
  .grid.models { grid-template-columns: repeat(3, 1fr); }
  .grid.clothes, .grid.outputs { grid-template-columns: repeat(4, 1fr); }
}

.thumb {
  position: relative; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: var(--bg-soft);
  cursor: pointer; aspect-ratio: 3 / 4;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.18); }
.thumb .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  font-size: 11px; padding: 14px 6px 5px; color: #dfe6f2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thumb .tick {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent); color: #fff;
  display: none; place-items: center; font-size: 12px; font-weight: 700;
}
.thumb.selected .tick { display: grid; }
.thumb .del {
  position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; border: 0;
  border-radius: 50%; background: rgba(0,0,0,.6); color: #ffb3b3;
  cursor: pointer; display: none; place-items: center; font-size: 12px;
}
.thumb:hover .del { display: grid; }
/* 选中槽位角标：直接写「图2 / 图3」，用户一眼能看出这张是主件还是第二件 */
.thumb .slot-badge {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  padding: 2px 7px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 10px; line-height: 1.6; font-weight: 700; pointer-events: none;
}
.thumb.second { border-color: var(--warn, #d9a441); box-shadow: 0 0 0 3px rgba(217, 164, 65, .18); }
.thumb.second .slot-badge { background: var(--warn, #d9a441); color: #2b2109; }
.thumb.second .tick { background: var(--warn, #d9a441); color: #2b2109; }

/* 图2 / 图3 两个槽位：单品图只有一件衣服，两张各占一个槽才能换整套 */
.cloth-slots { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; }
.cloth-slot {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 10px;
  border: 1px dashed var(--line); background: var(--bg-soft);
}
.cloth-slot.filled { border-style: solid; border-color: #2b437a; }
.cloth-slot .slot-thumb {
  width: 38px; height: 48px; flex: 0 0 auto;
  border-radius: 6px; object-fit: cover; background: var(--panel-2);
  display: grid; place-items: center; color: var(--text-dim); font-size: 16px;
}
.cloth-slot .slot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cloth-slot .slot-text b { font-size: 12px; font-weight: 600; }
.cloth-slot .slot-text span {
  font-size: 11px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 服装图角标：这张到底是「只有衣服的单品图」还是「真人穿着照」。
   直接标在缩略图上 —— 选错文件夹是换装丢版型、丢面料细节的最主要原因，
   而光看缩略图根本分不出来（两者都是白底）。放在 cap 上方，避开勾选和删除按钮。 */
.thumb .kind-badge {
  position: absolute; left: 5px; bottom: 30px;
  padding: 2px 6px; border-radius: 999px;
  font-size: 10px; line-height: 1.5; font-weight: 700; letter-spacing: .2px;
  pointer-events: none;
}
.thumb .kind-badge.flat { background: rgba(35, 160, 95, .92); color: #eafff3; }
.thumb .kind-badge.full { background: rgba(49, 110, 220, .92); color: #e8f1ff; }
.thumb .kind-badge.worn {
  background: rgba(0, 0, 0, .62); color: #ffc9a3;
  border: 1px solid rgba(255, 170, 110, .5);
}

.dropzone { min-height: 180px; }
.dropzone.over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }

.folders { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.folder-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim);
}
.folder-chip.active { color: var(--text); border-color: var(--accent); }

/* ---------- 汇总 ---------- */
.summary {
  margin-top: 8px; padding: 12px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 12px; line-height: 1.8; color: var(--text-dim);
}
.summary b { color: var(--text); }
.summary .big { font-size: 20px; color: var(--accent); font-weight: 700; }
.summary .missing {
  color: var(--warn); font-weight: 600; font-size: 12px;
  margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px dashed var(--line);
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--text-dim); font-weight: 500; position: sticky; top: 0; background: var(--panel); font-size: 12px; }
.table tr:hover td { background: #1a212d; }
.table .mono { font-family: Consolas, monospace; font-size: 12px; color: var(--text-dim); }
.table img.mini-thumb { width: 34px; height: 44px; object-fit: cover; border-radius: 5px; }

/* ---------- 生成时间列 ---------- */
.table td.time-cell { white-space: nowrap; }
.table .dur { font-family: Consolas, monospace; font-size: 12px; color: var(--text); }
.table .dur[data-live] { color: var(--accent); }
.sub-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---------- 「各画幅需要多少张」清点表（flowShowPlan 弹窗内） ---------- */
.flow-census { margin-top: 10px; display: grid; gap: 8px; }
.flow-census-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* 弹窗外层已经有滚动条了，这两张表别再各带一个（会出现三个滚动区，很难用） */
.flow-census .table-wrap { max-height: none; overflow-y: visible; }
.flow-census .table th, .flow-census .table td { padding: 5px 8px; }
.flow-census .table th { position: static; }

.account-bad { color: var(--err); }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; white-space: nowrap; border: 1px solid; }
.badge.pending { color: var(--text-dim); border-color: var(--line); }
.badge.submitting, .badge.running, .badge.downloading, .badge.postprocessing { color: var(--accent); border-color: #2b437a; }
.badge.done { color: var(--ok); border-color: #22503c; }
.badge.failed { color: var(--err); border-color: #4d2626; }
.badge.canceled { color: var(--warn); border-color: #4a3c1c; }

/* ---------- 树 ---------- */
.tree { max-height: 55vh; overflow-y: auto; font-size: 13px; }
.tree .ip-row { padding: 7px 9px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; }
.tree .ip-row:hover { background: var(--panel-2); }
.tree .ip-row.active { background: var(--panel-2); color: var(--accent); }
.tree .dates { margin: 0 0 6px 12px; border-left: 1px solid var(--line); padding-left: 10px; }
.tree .date-row { padding: 5px 8px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; color: var(--text-dim); }
.tree .date-row:hover { background: var(--panel-2); }
.tree .date-row.active { color: var(--accent); background: var(--panel-2); }
.tree em { font-style: normal; font-size: 11px; }

/* ---------- 成品库：瀑布流文件夹 + 点进去的成品页 ----------
   .panel.wide 默认横跨整行（队列/设置页要的就是这个）；
   成品库是文件浏览器的用法：目录在左、内容在右，所以只在这里覆盖掉。 */
.library > .panel.wide { grid-column: auto; }

/* 真瀑布流用 CSS 多列：图片保持自己的宽高比（不裁切），
   高度自然参差，列高由浏览器自己平衡。 */
.masonry { column-count: 4; column-gap: 10px; }
.masonry > * { break-inside: avoid; margin: 0 0 10px; }
@media (max-width: 1500px) { .masonry { column-count: 3; } }
@media (max-width: 1100px) { .masonry { column-count: 2; } }

/* 下载/打包下载是 <a>，样式要对齐按钮 */
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

.folder-card {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--panel-2); cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.folder-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.folder-card img { display: block; width: 100%; height: auto; }
.folder-card figcaption { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.folder-card figcaption b { font-size: 13px; }
.folder-card figcaption span { font-size: 11px; color: var(--text-dim); }
.folder-badge {
  position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .62); color: #dfe6f2; font-size: 11px; font-weight: 600;
}

.shot {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--panel-2);
}
.shot img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.shot figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 9px; border-top: 1px solid var(--line);
}
.shot-name { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-actions { display: flex; gap: 4px; flex: 0 0 auto; }

/* ---------- 提示词库 ---------- */
/* 卡片 = 成品缩略图 + 提示词开头：先看图、再对词，这是这个页面存在的意义 */
.pcard {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--panel-2); cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.pcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.pcard img { display: block; width: 100%; height: auto; }
.pcard figcaption { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.pcard .pbadges { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .pbadges span {
  padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 10px; color: var(--text-dim);
}
.pcard .ptext {
  margin: 0; font-size: 11px; line-height: 1.6; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard .pmeta { font-size: 10px; color: var(--text-dim); opacity: .8; }

.prompt-detail { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 14px; }
.prompt-detail .pd-image img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.pd-facts { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.pd-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 12px; }
.pd-facts dt { color: var(--text-dim); }
.pd-facts dd { margin: 0; }
.pd-prompt-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.pd-prompt-head .warn { color: var(--warn); font-size: 11px; }
.pd-prompt {
  max-height: 320px; overflow: auto; margin: 0; padding: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
}
/* 详情里「同词其它成品」的小卡片：比列表卡片小一号，一屏能扫完 */
.masonry.siblings { column-count: 5; margin-top: 8px; }
.masonry.siblings > * { margin-bottom: 8px; }
.pcard.mini figcaption { padding: 5px 7px; }
.pcard.mini .pmeta { font-size: 10px; }
@media (max-width: 1500px) { .masonry.siblings { column-count: 4; } }
@media (max-width: 1100px) { .masonry.siblings { column-count: 3; } }
@media (max-width: 900px) { .prompt-detail { grid-template-columns: 1fr; } }

/* ---------- 行编辑器 ---------- */
.rows { display: flex; flex-direction: column; gap: 6px; }
.row-item { display: grid; grid-template-columns: 70px 1fr 1.2fr 30px; gap: 6px; align-items: center; }
.row-item .input { padding: 6px 8px; font-size: 12px; }
.icon-btn {
  border: 1px solid var(--line); background: transparent; color: var(--err);
  border-radius: 7px; cursor: pointer; height: 30px;
}

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- 各 IP 输出目录 ---------- */
.ip-out-row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.ip-out-row .tag {
  font-size: 12px; text-align: center; padding: 6px 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ip-out-row .input { padding: 6px 8px; font-size: 12px; }
.ip-out-row .input::placeholder { color: #5d677a; }
/* 已经不在 models 目录里的 IP（配置里还留着），标暗一点提醒可以清掉 */
.ip-out-row.orphan .tag { color: var(--text-dim); border-style: dashed; }
.ip-out-empty { margin-bottom: 6px; }

/* ---------- 博主素材库 ---------- */
.media-library-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.media-stat {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.media-stat span {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
}
.media-stat b {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.1;
  color: var(--text);
}
.media-library-toolbar { margin-bottom: 8px; }
.media-library-search { flex: 1 1 260px; max-width: 460px; }
.media-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.media-style-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.media-style-card:hover {
  transform: translateY(-2px);
  border-color: #3b4c70;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .28);
}
.media-style-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #ecebe7;
  overflow: hidden;
}
.media-style-cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #ecebe7;
}
.media-style-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #77736c;
  font-size: 12px;
  letter-spacing: .04em;
}
.media-style-cover.is-loading .media-style-fallback span::before,
.media-asset-cover.is-loading .media-asset-fallback span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1.5px solid rgba(90, 84, 74, .24);
  border-top-color: #68573e;
  border-radius: 50%;
  animation: media-loading-spin .8s linear infinite;
}
.media-style-fallback span {
  padding: 7px 11px;
  border: 1px solid rgba(90, 84, 74, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
}
.media-style-cover.is-broken .media-style-fallback { display: grid; }
.media-style-cover .media-code {
  position: absolute;
  z-index: 2;
  left: 9px;
  bottom: 9px;
  max-width: calc(100% - 92px);
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 7px;
  background: rgba(255, 255, 255, .88);
  color: #2d3138;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(32, 36, 42, .12);
  backdrop-filter: blur(8px);
}
.media-style-cover .media-kind-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: #3b4658;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(32, 36, 42, .12);
  backdrop-filter: blur(8px);
}
.media-style-body { padding: 10px; }
.media-style-path {
  min-height: 32px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-style-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.media-count {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 10px;
}
.media-count.image { color: #92b3ff; border-color: #2b3f6d; }
.media-count.video { color: #c4a8ff; border-color: #3d3160; }
.media-library-empty {
  padding: 34px 10px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.media-source-tabs {
  margin: 4px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.feishu-content-shell { display: grid; gap: 14px; }
.feishu-content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.feishu-content-head h3 { margin: 0 0 6px; font-size: 18px; }
.feishu-content-head p { margin: 0; color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.feishu-content-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.feishu-content-toolbar label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.feishu-content-toolbar #feishu-month { min-width: 150px; }
.feishu-content-toolbar .hint { margin-left: auto; }
.feishu-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  border: 1px solid var(--line);
}
.feishu-stat { padding: 13px 15px; border-right: 1px solid var(--line); background: var(--panel); }
.feishu-stat:last-child { border-right: 0; }
.feishu-stat span { display: block; font-size: 10px; letter-spacing: .08em; color: var(--text-dim); }
.feishu-stat b { display: block; margin-top: 6px; font-size: 22px; font-family: var(--serif); font-weight: 600; }
.feishu-date-groups { display: grid; gap: 16px; }
.feishu-date-group { border: 1px solid var(--line); background: var(--panel); }
.feishu-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.feishu-date-head b { font-family: var(--serif); font-size: 16px; }
.feishu-date-head span { color: var(--text-dim); font-size: 11px; }
.feishu-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 12px;
}
.feishu-content-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  min-width: 0;
  border: 1px solid var(--line-2);
  background: var(--panel);
}
.feishu-content-cover {
  min-height: 142px;
  background: var(--bg-soft);
  overflow: hidden;
}
.feishu-content-cover img { width: 100%; height: 100%; min-height: 142px; object-fit: cover; display: block; }
.feishu-content-cover.no-cover { display: grid; place-items: center; color: var(--text-dim); font-size: 11px; }
.feishu-content-body { min-width: 0; padding: 10px 11px; display: flex; flex-direction: column; gap: 7px; }
.feishu-content-top { display: flex; align-items: center; gap: 6px; }
.feishu-content-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.feishu-platform, .feishu-state {
  flex: none;
  border: 1px solid var(--line);
  padding: 2px 6px;
  font-size: 9px;
  color: var(--text-dim);
}
.feishu-state.ok { color: var(--ok); border-color: #bed0b4; background: #f4f8f1; }
.feishu-state.miss { color: var(--warn); border-color: #dbc39d; background: #fffaf1; }
.feishu-state.bad { color: var(--err); border-color: #dfbbb2; background: #fff6f3; }
.cover-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 14px; }
.cover-controls label { display: grid; gap: 6px; font-size: 12px; color: var(--text-dim); }
.cover-controls input { max-width: 230px; }
.cover-controls #cover-time { width: 120px; }
.brand-cover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 18px; }
.cover-previous { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--border, #ddd7cd); }
.cover-previous summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
.brand-cover-card figcaption span { flex-basis: 100%; line-height: 1.5; }
.brand-cover-card { margin: 0; min-width: 0; }
.brand-cover-card img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.brand-cover-card img { cursor: default; }
.brand-cover-card.is-selected { outline: 2px solid var(--accent, #59674c); outline-offset: 5px; }
.brand-cover-card figcaption button { margin-left: auto; }
.cover-frame-previews { display: flex; flex-wrap: wrap; gap: 20px; margin: 18px 0; }
.cover-frame-picker { width: min(100%, 380px); min-width: 0; }
.cover-frame-picker video { width: 100%; height: 280px; display: block; object-fit: contain; background: var(--panel-2); }
.cover-frame-picker label { display: flex; justify-content: space-between; margin: 12px 0 6px; font-size: 13px; }
.cover-frame-picker output { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cover-frame-picker input[type=range] { width: 100%; cursor: ew-resize; accent-color: #59674c; }
.cover-controls .cover-second-toggle { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.cover-applied { display: grid; gap: 12px; margin-top: 24px; }
.cover-applied video { width: min(100%, 420px); max-height: 560px; background: var(--panel-2); }
.media-publish-layout { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr); gap: 28px; }
.media-publish-preview video { width: 100%; max-height: 460px; display: block; background: var(--panel-2); }
.media-publish-preview .publish-cover { max-width: 125px; max-height: 166px; object-fit: contain; display: block; margin: 16px 0 10px; }
.media-publish-form { display: grid; align-content: start; gap: 14px; }
.media-publish-form > label { display: grid; gap: 7px; }
.media-publish-form > .publish-more-accounts { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12px; }
.media-publish-platforms, .media-publish-options { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.media-publish-platforms label { display: flex; gap: 6px; align-items: center; }
.media-publish-accounts { max-height: 290px; overflow: auto; border-block: 1px solid var(--border); }
.publish-account { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.publish-account span { display: grid; flex: 1; gap: 4px; }
.publish-account small, .publish-account em { font-style: normal; font-size: 12px; color: var(--text-dim); }
.publish-account.is-unavailable { opacity: .6; }
.publish-platform-result { display: grid; gap: 5px; padding: 12px 0; font-size: 13px; border-top: 1px solid var(--border); }
@media(max-width: 760px) { .media-publish-layout { grid-template-columns: 1fr; } }
.brand-cover-card figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; font-size: 12px; }
.brand-cover-card figcaption span { color: var(--text-dim); }
@media(max-width: 760px) { .brand-cover-grid { grid-template-columns: 1fr; } }
.feishu-meta { font-size: 10px; color: var(--text-dim); line-height: 1.55; overflow-wrap: anywhere; }
.feishu-folder { font-family: ui-monospace, Consolas, monospace; font-size: 9px; color: var(--text-dim); overflow-wrap: anywhere; }
.feishu-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.feishu-card-actions .btn { padding: 5px 8px; font-size: 10px; }
.feishu-assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.feishu-asset-card { margin: 0; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.feishu-asset-card img, .feishu-asset-card video { display: block; width: 100%; height: 230px; object-fit: contain; background: #f4f1e9; }
.feishu-asset-card video { background: #111; }
.feishu-asset-card figcaption { padding: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--text-dim); }
@media (max-width: 900px) {
  .feishu-summary { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .feishu-content-head { display: block; }
  .feishu-content-head .btn { margin-top: 12px; }
}
@media (max-width: 570px) {
  .feishu-summary { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .feishu-content-toolbar { align-items: stretch; }
  .feishu-content-toolbar .hint { width: 100%; margin-left: 0; }
  .feishu-content-grid { grid-template-columns: 1fr; }
}

.media-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
/* Demo「补充要求」那一行：标题与「LLM 优化」按钮两端对齐 */
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.field-head > .btn {
  flex: none;
}
/* LLM 优化结果的对比框（原文 / 优化后） */
.polish-box {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.polish-box.polished {
  border-color: #5b8cff;
  background: var(--bg-soft);
}

.media-asset-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  /* 一个款号可能有上千个素材。content-visibility 让浏览器跳过屏幕外卡片的
     布局与绘制，否则一次性渲染 1000+ 个卡片会明显卡住（实测 1.2s → 0.3s）。 */
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}
.media-asset-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #ecebe7;
  cursor: zoom-in;
  overflow: hidden;
}
.media-asset-cover img,
.media-asset-cover video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #ecebe7;
}
.media-asset-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #77736c;
  font-size: 11px;
}
.media-asset-fallback span {
  padding: 5px 9px;
  border: 1px solid rgba(90, 84, 74, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
}
.media-asset-cover.is-broken .media-asset-fallback { display: grid; }
.media-play-mark {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  color: #303641;
  font-size: 12px;
  font-style: normal;
  box-shadow: 0 3px 14px rgba(30, 34, 40, .18);
  backdrop-filter: blur(8px);
}
.media-asset-cover > .media-asset-kind {
  position: absolute;
  z-index: 2;
  left: 7px;
  bottom: 7px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 6px;
  background: rgba(255, 255, 255, .88);
  color: #3b4658;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(32, 36, 42, .12);
}
.media-asset-body { padding: 8px; }
.media-asset-name {
  min-height: 32px;
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.media-asset-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 10px;
}
.media-asset-actions { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 7px 7px; }
.media-asset-actions .btn { flex: 1 0 auto; padding: 4px 5px; font-size: 10px; white-space: nowrap; }

@media (max-width: 1100px) {
  .media-library-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .media-library-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Doctor ---------- */
.doctor { display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--line); }
.check-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; margin-top: 5px; }
.check-row.ok .dot { background: var(--ok); }
.check-row.bad .dot { background: var(--err); }
.check-row.warnrow .dot { background: var(--warn); }
.check-row .name { min-width: 150px; font-weight: 600; font-size: 12px; }
.check-row .detail { color: var(--text-dim); font-size: 12px; word-break: break-all; }

/* ---------- 模态 ---------- */
.modal { position: fixed; inset: 0; background: rgba(5,8,13,.72); display: grid; place-items: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(920px, 92vw); max-height: 86vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 14px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-body pre { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; font-size: 12px; line-height: 1.6; }

/* ---------- 经典版式管理窗口 ---------- */
/* 左边是版式清单（当选择器用），右边是编辑器；都是动态渲染的，事件用委托挂 */
.layout-manager { display: flex; gap: 14px; align-items: flex-start; }
.layout-list { flex: 0 0 150px; display: flex; flex-direction: column; gap: 6px; }
.layout-list .btn { justify-content: flex-start; text-align: left; }
.layout-list .btn.active { border-color: var(--accent); color: var(--text); }
.layout-editor { flex: 1; min-width: 0; }
.layout-editor textarea.area { min-height: 150px; }

/* ---------- 详情页板块（模板 + 资料表 + 文案 + 出图） ---------- */
/* 三栏：左模板 / 中资料表与文案 / 右出图结果。窄屏折成一栏。 */
.studio.detail { grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.4fr) minmax(300px, 1.1fr); }
@media (max-width: 1400px) { .studio.detail { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .studio.detail { grid-template-columns: 1fr; } }

/* 标签小方块：文字卡 / 图片版 / 空白 / 有内容 */
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; border: 1px solid var(--line); color: var(--text-dim); }
.tag-card { color: var(--accent); border-color: #2b3f6d; }
.tag-image { color: #b98cff; border-color: #3d3160; }
.tag-empty { color: var(--warn); border-color: #4a3c1c; }
.tag-have { color: var(--ok); border-color: #22503c; }

/* ---------- 内容审核（账号内容审核 · 款号白名单 · 素材来源标准） ---------- */
.console-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.console-bar .hint { margin: 0; flex: 1 1 240px; }
.console-pane { display: flex; flex-direction: column; gap: 14px; }
/* 三个子页里只有「待审内容」用左右分栏，另外两个是单栏通栏 */
.console-pane .library { align-items: start; }

/* 提示条：凭据没配 / 读取失败 / 发布结果 */
.console-note {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px;
  font-size: 12px; line-height: 1.7; background: var(--bg-soft); color: var(--text-dim);
  margin-bottom: 12px;
}
.console-note b { color: var(--text); }
.fail-box { border-color: #4a3030; background: #171212; }
.fail-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fail-head b { color: #f0b4b4; font-size: 13px; }
.fail-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.fail-acts .hint { flex: 1 1 320px; min-width: 220px; }
.console-note.err { border-color: #4d2626; background: rgba(240,96,95,.08); color: #ffb4b3; }
.console-note.warn { border-color: #4a3c1c; background: rgba(232,178,58,.08); color: #f0d090; }
.console-note.ok { border-color: #22503c; background: rgba(55,201,138,.08); color: #9fe6c4; }
.console-note code {
  background: #0d1016; border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; font-size: 11px; color: var(--text);
}

/* 账号分类筛选（左栏顶部）：chip 太多会溢出，所以自己换行、各自带框 */
.src-switch.wrap {
  border: 0; border-radius: 0; overflow: visible; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
}
.src-switch.wrap .src-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.src-switch.wrap .src-chip + .src-chip { border-left: 1px solid var(--line); }
.src-switch.wrap .src-chip.active { border-color: transparent; }
/* 「这个分类今天没有内容」—— 淡一点，但仍然看得见（分类不该因为没内容就消失） */
.src-switch.wrap .src-chip.dim em { opacity: .5; }

/* 账号分组标题（左栏按分类分组） */
.kind-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin: 10px 0 2px; padding: 0 9px 4px; font-size: 11px; font-weight: 700;
  color: var(--text-dim); letter-spacing: .4px;
  border-bottom: 1px dashed var(--line);
}
.kind-head:first-child { margin-top: 2px; }
.kind-head em { font-style: normal; font-weight: 500; font-size: 10px; opacity: .85; }

/* 账号行：`[平台图标] 账号名 …… 计数`。
   左栏只有 230px 宽，所以名字必须自己能缩（min-width:0 + ellipsis），
   不能把右边的计数挤出去 —— 图标和计数都 flex:0 0 auto 钉住。
   ⚠️ 限定在 `#console-accounts`：`.ip-row` 在成品库的树里也用着，别把那边一起改了。 */
#console-accounts .ip-row { gap: 6px; align-items: center; padding: 7px 6px; }
#console-accounts .ip-row .acct-name {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#console-accounts .ip-row > em { flex: 0 0 auto; opacity: .8; font-size: 10px; }

/* 平台小图标：品牌近似色的圆角小方块 + 一个字 */
.acct-badge {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 5px;
  font-style: normal; font-size: 10px; font-weight: 700; line-height: 1;
  color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.acct-badge.all { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.acct-badge.unknown { background: #333c4d; color: var(--text-dim); }

/* 账号分组标题（素材来源标准页，跨满两列） */
.std-group-head {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 12px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.std-group-head:first-child { margin-top: 0; }
.std-group-head.sub {
  margin: 8px 0 0; padding: 0 0 4px 12px; border-bottom: 1px dashed var(--line);
}
.std-group-head.sub .std-group-kind { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.std-group-kind { font-size: 14px; font-weight: 700; }
.std-group-head em { font-style: normal; font-size: 11px; color: var(--text-dim); }
.std-card-head .kind-select { padding: 2px 6px; font-size: 11px; width: auto; flex: 0 0 auto; }

/* 账号分组标题 */
.console-group {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 18px 0 8px; font-size: 14px; font-weight: 650;
}
.console-group:first-child { margin-top: 4px; }

/* 一条待审内容 */
.audit-card {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
  padding: 12px; margin-bottom: 10px;
}
/* 刚提交审核（等飞书把「状态」改过来）的那张：绿边 + 说明，
   别让人以为没点动、又去点一次。下一次对账拿到新状态后这张卡片会自己消失。 */
.audit-card.pending-out { border-color: #2b6b4f; background: #16221c; }
.audit-card.pending-out .audit-acts { color: var(--ok); }
.audit-meta {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--text-dim); margin-bottom: 8px;
}
.audit-meta .code { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.audit-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: 8px 0; }
.audit-imgs .ph {
  aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; background: #0f1218; position: relative;
}
.audit-imgs .ph img, .audit-imgs .ph video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 每格右上角「摘掉这一张」。
   一直可见（不是 hover 才出现）—— 用户的原话是「没有删除的地方」，藏起来等于还是没有。 */
.audit-imgs .ph-del {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px;
  background: rgba(9, 12, 17, .72); color: var(--text-dim);
  font-size: 14px; line-height: 1; cursor: pointer;
}
.audit-imgs .ph-del:hover { background: var(--err); color: #fff; }
.audit-imgs .ph-del:disabled { opacity: .4; cursor: default; }
.audit-imgs .ph.empty {
  display: grid; place-items: center; color: var(--text-dim); font-size: 12px;
}
.audit-title { font-weight: 600; margin: 6px 0 4px; }
.audit-body {
  white-space: pre-wrap; font-size: 12px; line-height: 1.7; color: var(--text-dim);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; max-height: 150px; overflow: auto;
}
.audit-line { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.audit-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn.ok { border-color: #22503c; color: var(--ok); }
.btn.ok:hover { background: rgba(55,201,138,.12); }

/* 款号白名单 */
.pool-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
}
.pool-card {
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  background: var(--panel-2); cursor: pointer; transition: .15s; display: flex; flex-direction: column;
}
.pool-card:hover { border-color: #33405a; transform: translateY(-1px); }
.pool-card.on { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(55,201,138,.22); }
.pool-card .cover { position: relative; aspect-ratio: 3 / 4; background: #0f1218; }
.pool-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pool-card .cover .none { display: grid; place-items: center; height: 100%; color: var(--text-dim); font-size: 12px; }
.pool-card .pick {
  position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: rgba(13,16,22,.72); border: 1px solid var(--line); color: var(--text-dim);
}
.pool-card.on .pick { background: var(--ok); border-color: transparent; color: #06281c; }
.pool-card .cover .batch {
  position: absolute; left: 6px; top: 6px; font-size: 10px; padding: 1px 6px;
  border-radius: 5px; background: rgba(13,16,22,.78); color: var(--text-dim); border: 1px solid var(--line);
}
.pool-body { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 4px; }
.pool-body b { font-size: 14px; letter-spacing: .3px; }
.pool-tags { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 10px 8px; }
.pool-tags .tag.on { color: var(--ok); border-color: #22503c; }
.pool-tags .tag.autumn { color: #f0a35e; border-color: #4a3421; }
.pool-tags .tag.spring { color: #6fc0e8; border-color: #23404d; }
.pool-tags .tag.dim { opacity: .6; }
.pool-empty { grid-column: 1 / -1; color: var(--text-dim); font-size: 12px; line-height: 2; }

/* 素材来源标准 */
.std-card { display: flex; flex-direction: column; gap: 10px; }
.std-card-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.std-card-head b { font-size: 13px; }
.std-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.std-fields .field.wide { grid-column: 1 / -1; }
.std-fields .field { margin-bottom: 8px; }
.std-fields .input, .std-fields select { padding: 6px 9px; font-size: 12px; }
.hist-item {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  padding: 7px 9px; border-radius: 8px; background: var(--bg-soft);
  border: 1px solid var(--line); font-size: 12px;
}
.hist-item .when { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.hist-item .act { font-weight: 600; }
.hist-item .ver { color: var(--accent); font-variant-numeric: tabular-nums; }

@media (max-width: 1000px) {
  .std-fields { grid-template-columns: 1fr; }
}

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { padding: 11px 15px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; max-width: 420px; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
.toast.ok { border-color: #22503c; }
.toast.err { border-color: #4d2626; }
.toast.warn { border-color: #4a3c1c; }

::selection { background: rgba(91,140,255,.35); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b3446; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }


/* ================================================================== 详情页 · 鳗MUN 版式（36 模块）
   商品资料表单 + 模块卡片（左：鳗MUN 参考 / 右：改图路径 + 文字）。全部沿用全局变量。 */
.mm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.mm-form .full { grid-column: 1 / -1; }
.mm-form textarea.input { min-height: 0; }

.mm-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); margin-bottom: 12px; overflow: hidden; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.mm-head .mm-name { font-weight: 650; font-size: 13px; }
.mm-head .mm-size { color: var(--text-dim); font-size: 12px; margin-left: 8px; }
.mm-tag { font-size: 11px; color: var(--accent); background: rgba(91, 140, 255, .12); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.mm-body { display: flex; gap: 12px; padding: 10px 12px; align-items: flex-start; }
.mm-ref { flex: 0 0 34%; min-width: 0; border-right: 1px solid var(--line); padding-right: 12px; }
.mm-ref .mm-refh { display: block; font-size: 11px; color: var(--accent); margin-bottom: 6px; }
.mm-ref img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); display: block; margin-bottom: 6px; }
.mm-ref .mm-refmiss { font-size: 11px; color: var(--text-dim); line-height: 1.6; }
.mm-ref .mm-refmiss code { color: var(--text); }
.mm-ref .mm-rt { font-size: 12px; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.mm-edit { flex: 1 1 66%; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mm-imgbox { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 9px; background: var(--panel); }
.mm-imgbox.picking { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91, 140, 255, .18); }
.mm-meta { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 5px; }
.mm-imgbox img.mm-pv { max-width: 100%; max-height: 130px; display: none; margin-top: 6px; border-radius: 6px; }
.mm-imgbox .row-between { gap: 8px; }
.mm-imgbox .row-between > .mm-path { flex: 1 1 auto; min-width: 0; }
.mm-imgbox .row-between > .btn { flex: 0 0 auto; white-space: nowrap; }
.mm-txt textarea { margin-top: 2px; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.mm-thumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; overflow: hidden; }
.mm-thumb:hover { border-color: var(--accent); }
.mm-thumb img { width: 100%; height: 104px; object-fit: cover; display: block; }
@media (max-width: 1100px) {
  .mm-form { grid-template-columns: 1fr; }
  .mm-body { flex-direction: column; }
  .mm-ref { flex: 1 1 auto; border-right: none; padding-right: 0; }
}


/* ================================================================== 详情页：左（资料 + 36 模块）/ 右（参考详情页）
   右侧那一栏把线上详情页按原顺序竖排出来当参考；窄屏折成一列。 */
.studio.detail { grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); align-items: start; }
.mm-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mm-main > .panel { margin: 0; }

.mm-repage { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 24px); }
.mm-repage .panel-head { flex-wrap: wrap; row-gap: 6px; }
.mm-repage .batch-select { max-width: 210px; }
.mm-ref-bar { gap: 8px; flex-wrap: wrap; }
.mm-ref-bar .field.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.mm-ref-bar .field.inline > span { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
/* 详情页顶部的「商品资料表」面板（模板 / 按路径填充 / 已录入款号） */
.mm-src-bar { margin-bottom: 4px; }
.mm-src-bar .mm-src-path { flex: 1 1 auto; min-width: 220px; }
.mm-src-bar .mm-src-path > .input { flex: 1 1 auto; min-width: 0; }
.mm-src-bar + .hint { margin-top: 0; }
.mm-src-bar ~ #mm-src-info { line-height: 1.7; }
.mm-src-bar ~ #mm-src-info .mm-dim,
#mm-src-info .mm-dim { color: var(--text-dim); }
.mm-src-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.mm-src-list .mm-src-tip, .mm-src-list .mm-src-empty { color: var(--text-dim); font-size: 12px; }
.mm-src-list .mm-src-empty { line-height: 1.7; }
.mm-src-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel-2, rgba(255,255,255,.03)); }
.mm-src-chip:hover { border-color: var(--accent); }
.mm-src-open, .mm-src-del { background: none; border: 0; color: var(--text); cursor: pointer; font-size: 12px; padding: 3px 8px; }
.mm-src-open em { color: var(--text-dim); font-style: normal; margin-left: 6px; }
.mm-src-del { color: var(--text-dim); border-left: 1px solid var(--line); padding: 3px 7px; }
.mm-src-del:hover { color: var(--danger, #e06c75); }

/* ---------- 「细节图」独立页面（上新素材 → ⑥ 细节图） ---------- */
/* 素材网格（点一张 = 选/取消参考图）+ 参考图 chips + 提示词 + 成品网格 */
.studio.diy { grid-template-columns: minmax(0, 1fr); }
.diy-block { margin-top: 10px; }
.diy-block-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.diy-block-head > b { font-size: 13px; }
.diy-block-head > span { color: var(--text-dim); font-size: 12px; }
.diy-materials {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 4px;
}
.diy-mat {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); cursor: pointer; overflow: hidden;
}
.diy-mat img { width: 100%; height: 104px; object-fit: cover; display: block; background: #0f1218; }
.diy-mat .diy-mat-nothumb {
  display: flex; align-items: center; justify-content: center;
  height: 104px; font-size: 11px; color: var(--text-dim);
}
.diy-mat > span {
  display: block; padding: 2px 4px 3px; font-size: 10px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.diy-mat:hover { border-color: var(--accent); }
.diy-mat.on { border-color: var(--accent); }
.diy-mat.on::after {
  content: '✓'; position: absolute; right: 4px; top: 4px; width: 16px; height: 16px;
  line-height: 16px; text-align: center; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px;
}
.diy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.diy-bar .field.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.diy-bar .field.inline > span { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
#diy-prompt { resize: vertical; }

/* 按部位生成：一行一个部位（勾选 + 名称 + 提示词） */
.diy-parts { display: flex; flex-direction: column; gap: 6px; }
.diy-part {
  display: grid; grid-template-columns: 18px 56px minmax(0, 1fr) 108px;
  align-items: start; gap: 8px; margin: 0;
}
.diy-part > b, .diy-part > label > b { font-size: 12.5px; font-weight: 600; padding-top: 7px; white-space: nowrap; }
.diy-part > label { padding-top: 0; cursor: pointer; }
.diy-part > input[type="checkbox"] { margin: 9px 0 0; accent-color: var(--accent); }
.diy-part .diy-part-prompt { font-size: 12px; line-height: 1.5; resize: vertical; }
.diy-part-side { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding-top: 2px; }
.diy-part-info { font-size: 10.5px; color: var(--text-dim); line-height: 1.3; word-break: break-all; }
.diy-part-info:empty { display: none; }

/* 识别/改名结果表 */
.diy-tag-table { margin-top: 4px; }
.diy-tag-scroll { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.diy-tag-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.diy-tag-tbl th, .diy-tag-tbl td {
  padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.diy-tag-tbl th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; z-index: 1; }
.diy-tag-tbl tr:hover td { background: rgba(255, 255, 255, .03); }
.diy-tag-old { color: var(--text-dim); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.diy-tag-new { color: var(--accent); font-variant-numeric: tabular-nums; }
.mm-custom-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 8px; margin-top: 8px;
}
.mm-custom-grid .mm-custom-empty { grid-column: 1 / -1; }.mm-custom-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.mm-custom-card img {
  width: 100%; height: 124px; object-fit: cover; display: block;
  background: #0f1218; cursor: zoom-in;
}
.mm-custom-card .meta {
  padding: 4px 6px 0; font-size: 11px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-custom-card .acts { display: flex; gap: 4px; padding: 4px 5px 5px; }
.mm-custom-card .acts .btn { padding: 1px 6px; font-size: 11px; }

.mm-refpage-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.mm-refshot { position: relative; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); cursor: zoom-in; }
.mm-refshot:hover { border-color: var(--accent); }
.mm-refshot img { width: 100%; display: block; }
.mm-refshot .mm-refidx {
  position: absolute; left: 6px; top: 6px; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: rgba(13, 16, 22, .78); border: 1px solid var(--line); color: var(--text);
}
.mm-refshot .mm-refmap {
  position: absolute; right: 6px; top: 6px; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: rgba(91, 140, 255, .9); color: #fff;
}
@media (max-width: 1200px) {
  .studio.detail { grid-template-columns: 1fr; }
  .mm-repage { position: static; max-height: none; }
  .mm-refpage-body { max-height: 60vh; }
}

/* ---------- 视频生成（出片机那套分镜应用，同源嵌进来） ---------- */
/* 整块就是「一行工具条 + 一个撑满剩余高度的 iframe」。
   高度必须给死：iframe 没有内在高度，父级不给高度它就只有 0。
   顶栏 69px + 标签行 ~51px 是固定的，所以用 100vh 减掉。
   ⚠ 这里必须等于**实际的**偏移量（实测 120px）：写 115 时会多出 5px，
   整页就会冒一条能看出来的纵向滚动条（实测 scrollHeight 1255 > 视口 1249）。 */
#view-video.active {
  display: flex; flex-direction: column; gap: 12px;
  height: calc(100vh - 120px); padding-bottom: 18px;
}
.video-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 0 0 auto; }
.video-bar .hint { margin: 0; flex: 1 1 260px; }
.video-bar .head-actions { flex: 0 0 auto; }
.video-frame {
  position: relative; flex: 1 1 auto; min-height: 420px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #0f1218; overflow: hidden;
}
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #0f1218; }
/* 上游不通时的提示页（居中、可读，不出现白屏） */
.video-empty {
  position: absolute; inset: 0; padding: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
}
.video-empty .inline { gap: 8px; margin-top: 6px; }
.video-empty code {
  background: #1d2431; border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-size: 12px; color: var(--text);
}
@media (max-width: 900px) {
  #view-video.active { height: auto; }
  .video-frame { min-height: 70vh; }
}

/* ---------- 素材中心（宿主上那套「素材库上传台」，同源嵌进来） ---------- */
/* 版式跟「视频生成」一模一样（一行工具条 + 撑满剩余高度的 iframe），
   所以直接复用 .video-bar / .video-frame / .video-empty 那套类名，
   这里只补「哪个 view 要撑满」—— 否则 iframe 没有内在高度，会被压成 0。 */
#view-material.active {
  display: flex; flex-direction: column; gap: 12px;
  height: calc(100vh - 120px); padding-bottom: 18px;
}
@media (max-width: 900px) {
  #view-material.active { height: auto; }
}

/* ==================================================================
   商品录入（Demo 前那一页）：一个款号的全部原始图文
   文字字段复用 .mm-form；「素材挑」网格复用 .mm-grid / .mm-thumb
   ================================================================== */
.studio.goods { grid-template-columns: minmax(0, 1fr); }

.goods-pick { gap: 10px; flex-wrap: wrap; }
.goods-pick .field { margin: 0; }

.goods-grid {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 62vh; overflow-y: auto; padding-right: 4px;
}

.goods-cat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; }
.goods-cat-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.goods-cat-head em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted, #8b93a7); }
.goods-cat-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 10px; }

.goods-slot {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
}
.goods-slot.on { border-color: var(--accent); }
/* 「选填」的槽位整格淡一点：让必填的那 20 格一眼先跳出来（42 格逐个写「必填」两个字太吵） */
.goods-slot.opt { opacity: .72; }
.goods-slot.opt:hover { opacity: 1; }
.goods-slot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 5px 7px 3px; font-size: 12px; }
.goods-slot-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-slot-head span { flex: 0 0 auto; color: var(--muted, #8b93a7); font-size: 11px; }
.goods-slot-head .need-star { color: #e0715f; font-style: normal; font-weight: 700; margin-left: 2px; }
.goods-slot-head .opt-tag { font-style: normal; margin-left: 4px; opacity: .8; }
/* 模块产出方式徽标：调模型的用暖色标出来（一眼看出哪些会花钱） */
.mm-tag.mm-mode { border: 1px solid currentColor; opacity: .9; }
.mm-tag.mm-mode.spend { color: #e0a95f; }
.mm-head .btn[disabled] { opacity: .5; cursor: not-allowed; }
/* 这一格要什么：画幅 + 交付精度（完整取景要求放 title 里，不占版面） */
.goods-slot-spec { padding: 0 7px 4px; font-size: 11px; color: var(--muted, #8b93a7); cursor: help; }
.goods-slot-spec b { color: var(--fg, #e6e9f2); font-weight: 600; }
.goods-slot.need .goods-slot-spec b { color: #e0a95f; }
.goods-cat-head em b { color: var(--fg, #e6e9f2); font-weight: 600; }
.goods-cat-head .need-star-note { color: #e0715f; }
.goods-slot-img { height: 106px; background: #0f1218; display: flex; align-items: center; justify-content: center; }
.goods-slot-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* 没有原始素材、但已经有成品图的格子：「未填」只占一条，把版面留给成品图 */
.goods-slot.has-gen .goods-slot-img.no-src { height: 34px; }
.goods-slot-name { padding: 3px 7px 0; font-size: 11px; color: var(--muted, #8b93a7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-slot-acts { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 7px 7px; }
.goods-slot-acts .btn { padding: 2px 6px; font-size: 11px; }

/* 成品图回填区：这个槽位所属模块已经出过图的，直接在原始素材图下面贴出来。
   点图 = 看原图大图（含尺寸/体积），旁边还有「重新生成」—— 不满意就地重出一张。 */
.goods-slot-gen {
  margin: 6px 6px 0;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.goods-genimg {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #0f1218;
  border-radius: 5px;
  cursor: zoom-in;
}
.goods-genmeta { padding: 4px 1px 0; font-size: 11px; color: var(--muted, #8b93a7); line-height: 1.45; }
.goods-genmeta b { color: var(--ok); font-weight: 600; }
.goods-genacts { padding: 5px 0 0; }
.goods-slot.has-gen { border-color: var(--ok); box-shadow: 0 0 0 1px rgba(55, 201, 138, .28) inset; }
.goods-cat-head em b.gen-n { color: var(--ok); }

/* 固定文案字段（品牌行/副标）：只展示、不给输入框 —— 每款都一样，没必要填 */
.mm-fixed {
  display: block;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--fg, #e6e9ef);
  font-size: 13px;
  letter-spacing: 0.2px;
  user-select: text;
  word-break: break-word;
  /* 固定文案可能是多行的（购物须知）—— 保留换行和空行，否则会挤成一坨 */
  white-space: pre-wrap;
  line-height: 1.75;
}
/* 详情页模块里的固定文案块：和上面同款外观，但用在大卡片的窄栏里，字号略小 */
.mm-edit .mm-fixedval {
  display: block; padding: 7px 9px; border: 1px dashed var(--line); border-radius: 6px;
  background: var(--panel); color: var(--fg, #e6e9ef); font-size: 12px;
  user-select: text; word-break: break-word; white-space: pre-wrap; line-height: 1.7;
}
.mm-edit .mm-txt > .mm-meta { margin-bottom: 2px; }

/* 商品资料字段分组：基础属性（原样用）/ AI 优化文案（会被模型改写）/ 固定文案，视觉上分开。
   三组都带一条左边，左边缘因此对齐；AI 组那条换成强调色。 */
.mm-form .mm-group { grid-column: 1 / -1; border-left: 3px solid var(--line); padding-left: 12px; }
.mm-group + .mm-group { margin-top: 2px; }
.mm-group-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;
  padding: 0 0 4px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
}
.mm-group-head b { font-size: 12.5px; letter-spacing: 0.3px; }
/* 组说明压成一行小字（完整说明在 title 里，hover 可见），不再单独占一大行 */
.mm-group-head span { color: var(--muted, #8b93a7); font-size: 11.5px; cursor: help; }
.mm-group[data-mm-group="ai"] { border-left-color: var(--accent); }

/* 商品录入的「交付物齐备度」行（#goods-deliver） */
#goods-deliver b { color: var(--fg, #e6e9f2); font-weight: 600; }
#goods-deliver .dl.ok { color: var(--ok); }
#goods-deliver .dl.todo { color: var(--muted, #8b93a7); }
#goods-deliver .sub { color: var(--muted, #8b93a7); margin-left: 8px; font-size: 12px; }
/* 字段两列排开；同一行的两个框高度对齐（textarea 跟着所在行撑满）。
   ⚠ 组里的 .field 必须清掉全局那 12px 下边距 —— 否则和 grid gap 叠成 20 多像素，整组看着是散的。 */
.mm-group-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.mm-group-body .full { grid-column: 1 / -1; }
.mm-group-body > .field {
  display: flex; flex-direction: column; gap: 4px;
  margin: 0; min-width: 0;
}
.mm-group-body > .field > label,
.mm-group-body > .field > .field-head { font-size: 11.5px; line-height: 1.4; color: var(--text-dim); }
.mm-group-body > .field > .field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mm-group-body > .field > .input { flex: 1 1 auto; }
.mm-group-body .input { padding: 6px 9px; border-radius: 7px; font-size: 12.5px; }
.mm-group-body textarea.input { line-height: 1.45; resize: vertical; }
/* 尺码表是「逗号分隔的表格」：等宽字体列才对得齐，错行一眼能看出来 */
.mm-group-body [data-mm-g="size"],
.mm-group-body [data-goods-g="size"] {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px;
}
.mm-group[data-mm-group="ai"] .mm-group-head b { color: var(--accent); }
/* AI 优化文案那两栏：label 与「✨ AI 优化」按钮两端对齐 */
.mm-form .field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mm-form .field-head .field-acts { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.mm-form .field-head .btn { padding: 1px 7px; font-size: 11px; }

/* 仿写页「从链接导入」：粘链接 → 下载 → 下完在「素人素材参考图」里选 */
.link-import { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel); }
.link-import-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.link-import-head b { font-size: 13px; }
.link-import-head span { color: var(--muted, #8b93a7); font-size: 12px; }
.link-import .row-between { gap: 8px; }
.link-import .row-between > #copy-link-url { flex: 1 1 auto; min-width: 0; }
.link-import .hint { margin-top: 8px; }
@media (max-width: 1100px) {
  .mm-group-body { grid-template-columns: 1fr; }
}

/* ==================================================================
   商品录入 · 左录入 / 右效果图
   ================================================================== */
.goods-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.goods-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.goods-col > .panel { margin: 0; }

/* 右栏跟着滚：左边填字的时候右边一直能看见效果图 */
.goods-effect {
  position: sticky;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 24px);
  margin: 0;
}
.goods-effect .panel-head { flex-wrap: wrap; row-gap: 6px; }
.goods-effect-src { margin: 0 0 2px; }
.goods-effect-src .src-chip { padding: 3px 10px; font-size: 12px; }
.goods-effect-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.goods-ef-meta { font-size: 11px; color: var(--text-dim); line-height: 1.7; }
.goods-ef-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.goods-ef-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  padding: 6px 8px; font-size: 12px;
}
.goods-ef-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-ef-img { background: #0f1218; display: flex; align-items: center; justify-content: center; }
.goods-ef-img img { width: 100%; max-height: 300px; object-fit: contain; display: block; cursor: zoom-in; }
.goods-ef-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; padding: 4px; }
.goods-ef-files img { width: 100%; height: 70px; object-fit: cover; display: block; border-radius: 6px; cursor: zoom-in; }
.goods-ef-note { padding: 5px 8px 7px; font-size: 11px; color: var(--text-dim); line-height: 1.6; }
.goods-ef-empty { font-size: 12px; color: var(--text-dim); line-height: 1.9; }
.goods-ef-empty b { color: var(--fg, #e6e9f2); }
.goods-ef-empty code { font-size: 11px; word-break: break-all; }

/* ---------- 详情页预览（右栏「成品图」） ----------
   图与图之间**不留缝、不加边框**，拼起来就是一条真实详情页长图；
   序号/尺寸只在鼠标移到某一段时才浮出来 —— 常驻会把「预览」变成「列表」。 */
.dp-preview {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1218;
}
.dp-seg { position: relative; line-height: 0; }
.dp-seg img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.dp-no {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.5;
  background: rgba(8, 10, 14, .74);
  color: #cfd6e6;
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}
.dp-seg:hover .dp-no { opacity: 1; }
/* 缺的模块在原位置留一条占位：跳过不排会让人以为后面整体错位了一格 */
.dp-miss {
  padding: 11px 8px;
  font-size: 11px;
  line-height: 1.6;
  color: #e0a95f;
  border-top: 1px dashed #4a3a1c;
  border-bottom: 1px dashed #4a3a1c;
  background: repeating-linear-gradient(45deg, #1a1710, #1a1710 6px, #15130e 6px, #15130e 12px);
}
.dp-miss b { color: #e0a95f; font-weight: 700; margin-right: 4px; }
/* 整页预览弹窗：按 750 宽排，跟手机端详情页同比例 */
.dp-full-meta { font-size: 12px; color: var(--text-dim); line-height: 1.8; margin-bottom: 10px; }
.dp-full { width: 750px; max-width: 100%; margin: 0 auto; }
.dp-full .dp-preview { border-radius: 0; }

/* 成本价：单占一行，摆在文字资料最上面（内部数据，不进详情页） */
.goods-cost { margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px dashed var(--line); }.goods-cost .field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.goods-cost label { font-size: 12px; color: var(--text-dim); }
.goods-cost-note { font-size: 11px; color: var(--muted, #8b93a7); }
.goods-cost-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.goods-cost-row > span { color: var(--text-dim); }
.goods-cost-row input { max-width: 190px; font-variant-numeric: tabular-nums; }

/* 聚水潭建商品：必要资料核对表 + 模拟上传结果 */
.erp-check { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 12px; }
.erp-check th, .erp-check td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.erp-check th { color: var(--text-dim); font-weight: 500; }
.erp-check td.erp-st { white-space: nowrap; width: 76px; font-variant-numeric: tabular-nums; }
.erp-check tr.erp-ok td.erp-st { color: #35b46a; }
.erp-check tr.erp-warn td.erp-st { color: #d99a2b; }
.erp-check tr.erp-missing td.erp-st { color: #e0555a; }
.erp-check td.erp-val { color: var(--text-dim); max-width: 380px; word-break: break-all; }
.erp-item-json { margin: 8px 0 0; padding: 10px; max-height: 380px; overflow: auto;
  background: var(--bg-soft, #f6f7f9); border: 1px solid var(--line); border-radius: 6px;
  font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }

/* 上传区：拖进来 / 点选 → 猜槽位 → 确认后一起传 */
.goods-drop { min-height: 0; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.goods-drop-hint {
  padding: 16px 10px; text-align: center; font-size: 12px; line-height: 1.9;
  color: var(--text-dim); border: 1px dashed var(--line); border-radius: 10px; cursor: pointer;
}
.goods-drop-hint:hover { border-color: var(--accent); }
.goods-drop-hint span { font-size: 11px; color: var(--muted, #8b93a7); }
.goods-up-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.goods-up-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.goods-up-item.bad { border-color: var(--err); }
.goods-up-item img { width: 100%; height: 92px; object-fit: contain; background: #0f1218; display: block; }
.goods-up-body { padding: 6px 7px 7px; display: flex; flex-direction: column; gap: 5px; }
.goods-up-name { font-size: 11px; color: var(--muted, #8b93a7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-up-item select { font-size: 11px; }
.goods-up-acts { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.goods-up-item .btn { padding: 2px 7px; font-size: 11px; }
.goods-up-state { font-size: 11px; color: var(--text-dim); }
.goods-up-state.ok { color: var(--ok); }
.goods-up-state.bad { color: var(--err); }

@media (max-width: 1200px) {
  .goods-split { grid-template-columns: 1fr; }
  .goods-effect { position: static; max-height: none; }
  .goods-effect-body { overflow: visible; }
}

/* ==================================================================
   详情页 · 「生成此模块」的进度与成品图
   ================================================================== */
.mm-gen-state { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.mm-gen-state.ok { color: var(--ok); }
.mm-gen-state.bad { color: var(--err); }

.mm-genbox:empty { display: none; }
/* 成品图现在在「素材图槽」那一栏里（左参考 / 右成品），不再是卡片底部整宽的一块 ——
   所以这里去掉外边距，并跟图片槽保持同样的虚线框观感。 */
.mm-edit .mm-genbox { display: block; }
.mm-edit .mm-genbox:not(:empty) { margin-bottom: 2px; }
.mm-gen {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2, rgba(255,255,255,.03));
}
.mm-edit .mm-gen { margin: 0; border-style: solid; border-color: var(--ok, #3aa76d); }
.mm-gen-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 12px;
    flex-wrap: wrap;
}
.mm-gen-head b { font-weight: 600; flex: 0 0 auto; }
.mm-gen-meta { flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-gen-acts { flex: 0 0 auto; display: inline-flex; gap: 6px; }
.mm-gen-acts .btn { padding: 1px 7px; font-size: 11px; }
.mm-gen-warn {
  padding: 5px 10px; font-size: 11px; line-height: 1.7;
  color: var(--warn); background: rgba(255, 176, 32, .08);
}
/* 卡片里空间有限：成品图压到 260px 高（点开大图看细节），不然一屏塞不下几张卡。
   宽度**不拉满** —— 竖图拉满会在两边留一大片黑，看着像没出全。 */
.mm-genimg {
  display: block; max-width: 100%; max-height: 260px;
  margin: 0 auto; object-fit: contain;
  background: #0f1218; cursor: zoom-in;
}
.mm-gen-prompt { border-top: 1px solid var(--line); }
.mm-gen-prompt > summary {
  padding: 6px 10px; font-size: 11px; color: var(--text-dim); cursor: pointer;
}
.mm-gen-prompt > summary:hover { color: var(--accent); }
.mm-gen-prompt > pre {
  margin: 0; padding: 8px 10px 10px; max-height: 260px; overflow: auto;
  font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  color: var(--text-dim); background: #0f1218;
}

/* 生成前的确认框：计划明细 */
.mm-plan { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.mm-plan-row { display: flex; gap: 10px; font-size: 12px; line-height: 1.8; }
.mm-plan-row > span { flex: 0 0 58px; color: var(--text-dim); }
.mm-plan-row > b { flex: 1 1 auto; min-width: 0; font-weight: 600; word-break: break-word; }
#modal-body .mm-gen-prompt { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }

/* ---------- 流水线（n8n 编排层）：一个款一条 ----------
   一行 = 一个款：款号 + 整体状态 + 进度 + 11 个步骤点 + 一排操作。
   点的颜色就是「这一步什么状态」，鼠标悬停看标题（步骤名 + 类型 + 状态）。 */
.flow-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.flow-empty {
  padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--text-dim); font-size: 12px; line-height: 1.8;
}
#flow-n8n { margin: 4px 0 0; }
#flow-n8n b { color: var(--warn); }

.flow-row {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.flow-row:hover { border-color: #33405a; }
.flow-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow-row-main .flow-style { font-size: 15px; letter-spacing: .4px; }
.flow-count { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.flow-cur { font-size: 12px; color: var(--accent); }
.flow-when { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.flow-row-dots { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.flow-row-ops { display: flex; gap: 6px; flex-wrap: wrap; }

.flow-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #2a3444; border: 1px solid #3a465c; display: inline-block; flex: 0 0 auto;
}
.flow-dot.running { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.22); }
.flow-dot.done { background: var(--ok); border-color: var(--ok); }
.flow-dot.failed { background: var(--err); border-color: var(--err); }
.flow-dot.wait { background: var(--warn); border-color: var(--warn); }
.flow-dot.skipped { background: #46536b; border-color: #566480; }
.flow-dot.canceled { background: #3a3a3a; border-color: #4a4a4a; }

.pill.pending { color: var(--text-dim); }
.pill.running { color: var(--accent); border-color: #2b437a; }
.pill.done { color: var(--ok); border-color: #22503c; }
.pill.failed { color: var(--err); border-color: #4d2626; }
.pill.wait { color: var(--warn); border-color: #4a3c1c; }
.pill.skipped, .pill.canceled { color: var(--text-dim); }

.flow-detail {
  margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 12px;
}
.flow-detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.flow-detail-head .flow-step-ops { margin-left: auto; display: flex; gap: 6px; }
.flow-steps { display: flex; flex-direction: column; gap: 6px; }
.flow-step {
  border: 1px solid var(--line); border-left: 3px solid #3a465c; border-radius: 9px;
  background: var(--panel); padding: 8px 10px;
}
.flow-step.running { border-left-color: var(--accent); }
.flow-step.done { border-left-color: var(--ok); }
.flow-step.failed { border-left-color: var(--err); }
.flow-step.wait { border-left-color: var(--warn); }
.flow-step.canceled { border-left-color: #4a4a4a; opacity: .7; }
.flow-step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-step-head b { font-size: 13px; }
.flow-step-ops { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.flow-note { color: var(--text-dim); }
.flow-art { word-break: break-all; }
.flow-art code { margin-right: 6px; }
.flow-log { margin-top: 10px; }
.flow-log > summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
.flow-logline { font-size: 12px; line-height: 1.8; word-break: break-word; }
.flow-pre {
  margin: 6px 0 0; padding: 8px; max-height: 240px; overflow: auto;
  background: #0f1218; border: 1px solid var(--line); border-radius: 8px;
  font-size: 11px; line-height: 1.6;
}

/* ---------- 流水线控制台（多款并排看 n8n 推进） ----------
   复用上面那套 .flow-step / .flow-dot / .pill，这里只加「两栏布局 + 产出图」两块。 */
.flc-body { display: grid; grid-template-columns: minmax(230px, 320px) 1fr; gap: 12px; align-items: start; }
.flc-run-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 300px); overflow-y: auto; }
.flc-run {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); padding: 8px 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
}
.flc-run:hover { border-color: #33405a; }
.flc-run.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(91,140,255,.35); }
.flc-run-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flc-run-meta { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.flc-steps { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 330px); overflow-y: auto; }
.flc-out { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.flc-missing { color: var(--warn); }
.flc-progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 6px 0; }
.flc-progress > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* 主图成品：按规格分组，每族一排缩略图 */
.flc-main { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.flc-mrow { margin: 8px 0; }
.flc-mhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flc-mgrid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.flc-mthumb { width: 76px; height: 76px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.flc-mthumb:hover { border-color: var(--accent); }
/* 台账卡片右上角的删除：只删台账，不动资料/成品 */
.flc-del-run { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px; line-height: 1;
  opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.flc-run:hover .flc-del-run { opacity: 1; }
.flc-del-run:hover { background: #c8372d; color: #fff; }
.flc-run { position: relative; }

/* 详情页 36 个模块的成品预览格子 */
.flc-dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px; margin-top: 6px; }
.flc-dcell { position: relative; aspect-ratio: 3 / 4; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; background: #fff; cursor: zoom-in;
  display: flex; align-items: center; justify-content: center; }
.flc-dcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flc-dcell:hover { border-color: var(--accent); }
.flc-dcell.miss { cursor: default; background: #f6f7f9; color: var(--text-dim);
  font-size: 10px; border-style: dashed; }
.flc-dcell.miss:hover { border-color: var(--line); }

/* 主图「换一张」选择器 */
.swap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; margin: 10px 0; max-height: 56vh; overflow-y: auto; }
.swap-cell { border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  cursor: pointer; background: #fff; }
.swap-cell img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 3/4; }
.swap-cell:hover { border-color: var(--accent); }
.swap-cell.current { border-color: var(--ok, #2f9e44); }

/* 底图缩略图右上角的删除：悬停才出现 */
.thumb-del { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: rgba(10, 14, 22, .62); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; z-index: 3; }
.thumb:hover .thumb-del { opacity: 1; }
.thumb-del:hover { background: #c8372d; }
/* 每张详情页图右上角的「重新生成」：悬停才出现，避免抢眼 */
.flc-dregen { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: rgba(10, 14, 22, .62); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.flc-dcell:hover .flc-dregen { opacity: 1; }
.flc-dregen:hover { background: var(--accent); }

/* 预览弹窗里的「描述问题 → 重新生成」区 */
.iv-fix { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.iv-fix .input { width: 100%; resize: vertical; font-size: 13px; }
.iv-fix .actions { justify-content: flex-start; align-items: center; gap: 10px; }
.iv-fix .actions .hint { margin: 0; }
.flc-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.flc-thumb {
  position: relative; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden;
  background: #0d1017; border: 1px solid var(--line); cursor: zoom-in;
}
.flc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 审核用的删除按钮：常驻但低对比（不然看不出「这里能删」），悬停才全亮。
   只靠 hover 显示的话，鼠标没移上去就等于「没有按钮」—— 用户明确要的是看得见。 */
.flc-thumb .flc-del {
  position: absolute; top: 3px; right: 3px; z-index: 2; width: 18px; height: 18px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #ffb3b3;
  cursor: pointer; display: grid; place-items: center; font-size: 11px; line-height: 1;
  opacity: .38; transition: opacity .15s, background .15s;
}
.flc-thumb:hover .flc-del { opacity: 1; }
.flc-thumb .flc-del:hover { background: rgba(190, 40, 40, .92); color: #fff; }
/* 文件已经不在了（被删/被改名）：给个说法，别留一张破图 */
.flc-thumb.flc-gone { cursor: default; }
.flc-gone-text {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-size: 11px; color: var(--text-dim);
  background: repeating-linear-gradient(45deg, #0d1017, #0d1017 6px, #12161f 6px, #12161f 12px);
}
@media (max-width: 1100px) { .flc-body { grid-template-columns: 1fr; } }

/* ================= 素材库「剪辑器」（内置，不跳剪映） ================= */
.clip-editor { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(350px, .85fr); gap: 16px; }
@media (max-width: 1100px) { .clip-editor { grid-template-columns: 1fr; } }
.clip-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.clip-stage video { width: 100%; max-height: 60vh; background: #000; border-radius: var(--radius); }
.clip-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.clip-block {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.clip-block-head { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 13px; }
.clip-block-head .hint { font-weight: 400; }
/* ⚠️ `.clip-block { display: flex }` 的优先级压过浏览器默认的 `[hidden] { display: none }`，
   于是「成片预览」那块在还没渲染时就显出来了 —— 一个空播放器加一个还不能用的
   「覆盖原视频」，看着像已经出片了。必须显式兜住。 */
.clip-block[hidden] { display: none; }
/* 时间轴：底条 + 保留段 + 播放头。按住左右拖 = 快进/快退，轻点一下 = 跳到那里。 */
.clip-timeline {
  position: relative; height: 36px;
  cursor: ew-resize;        /* 明确告诉人「这里可以左右拖」 */
  touch-action: none;       /* 触屏上让 pointermove 归我们，不要被页面滚动吃掉 */
  user-select: none;
}
.clip-timeline.dragging { cursor: grabbing; }
.clip-timeline.dragging .clip-playhead { background: var(--accent-2); }
.clip-track {
  position: relative; height: 36px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: inherit;
}
.clip-seg {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: .8; border-right: 1px solid rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center;
}
.clip-seg span { font-size: 11px; color: #fff; opacity: .85; }
/* 选中的段（Delete 键删的就是它）——必须一眼看得出来，不然删错都不知道 */
.clip-seg.active {
  opacity: 1; box-shadow: inset 0 0 0 2px #fff, 0 0 8px rgba(0, 0, 0, .55);
}
.clip-playhead {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text);
  pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
}
/* 快捷键提示：不写出来没人猜得到 */
.clip-keys {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
}
.clip-keys kbd {
  font: inherit; font-size: 11px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
}
.clip-rows { display: flex; flex-direction: column; gap: 6px; max-height: 128px; overflow-y: auto; }
.clip-row {
  display: flex; align-items: center; gap: 6px;
  padding: 0 4px; margin: 0 -4px; border-radius: 6px; cursor: pointer;
}
.clip-row.active { background: rgba(255, 255, 255, .06); }
.clip-row.active .clip-row-no { color: var(--accent-2); font-weight: 700; }
.clip-row input, .clip-row button { cursor: auto; }
.clip-row-no { width: 16px; text-align: center; color: var(--text-dim); font-size: 12px; }
.clip-row-input { width: 78px; padding: 4px 6px; }
.clip-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.clip-tool { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); }
.clip-tool-input { width: 74px; padding: 4px 6px; }
.clip-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clip-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.clip-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
#clip-result { width: 100%; max-height: 30vh; background: #000; border-radius: 8px; }

/* ---------- 控制台 · 批次全流程（一键跑完整批） ---------- */
.flc-batch-track {
  height: 6px; margin: 0 4px 10px;
  background: var(--panel-2); border-radius: 99px; overflow: hidden;
}
.flc-batch-track > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .35s ease;
}
.flc-batch-log {
  max-height: 210px; overflow: auto; margin: 0 4px 12px; padding: 8px 10px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px; line-height: 1.75;
}
.flc-batch-line { color: var(--text-dim); }
.flc-batch-line em { font-style: normal; color: #5b6478; margin-right: 8px; }
.flc-batch-line.ok { color: var(--ok); }
.flc-batch-line.warn { color: var(--warn); }
.flc-batch-line.bad { color: var(--err); }

.flc-batch-review-list { display: flex; flex-direction: column; gap: 12px; padding: 0 4px 6px; }
.flc-rev-card { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.flc-rev-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.flc-rev-head b { font-size: 15px; letter-spacing: .5px; }
.flc-rev-fail { font-size: 12px; color: var(--err); margin-bottom: 6px; }
.flc-rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.flc-rev-thumb { margin: 0; text-align: center; }
.flc-rev-thumb img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; cursor: zoom-in;
  border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line);
}
.flc-rev-thumb figcaption { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.flc-rev-missing { font-size: 12px; color: var(--warn); margin-bottom: 6px; }
.flc-batch-styles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 4px 10px; }
.flc-bs {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 9px; border-radius: 99px; font-size: 12px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
}
.flc-bs em { font-style: normal; font-size: 11px; opacity: .85; }
.flc-bs.run { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px rgba(91,140,255,.35) inset; }
.flc-bs.ok { border-color: rgba(55,201,138,.5); color: var(--ok); }
.flc-bs.warn { border-color: rgba(232,178,58,.5); color: var(--warn); }

/* ================================================================== 虚拟模特（Demo 第一步）
   第一步横跨整行，下面仍然是原来的三栏（图1 / 补充要求 / 结果）。 */
/* 这一步是「面板 + 表单」，不是「撑满一屏、内部滚动的选图区」：
   .panel.fill 那套 height / overflow 必须盖掉（同级选择器压不住，这里加 .studio.demo 提权） */
.studio.demo .vmodel-panel { grid-column: 1 / -1; height: auto; min-height: 0; overflow: visible; }
.vmodel-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 14px; align-items: start;
}
/* 身份网格自己滚，右侧表单/详情跟着内容长高（页面滚动），不要被 .panel.fill 的视口高度裁掉 */
.vmodel-lib .dropzone { display: block; max-height: 520px; overflow-y: auto; }
#vmodel-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); overflow: visible; }
.vmodel-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vmodel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.vmodel-head b { font-size: 13px; }
.vmodel-form { display: flex; flex-direction: column; gap: 4px; }
.vmodel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.vmodel-form .field { margin-bottom: 8px; }
.vmodel-angles { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.vmodel-angles .check { margin-bottom: 0; font-size: 12px; }
.vmodel-angles .check.locked { opacity: .85; }
.vmodel-card-meta {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(0,0,0,.62); color: #dfe6f2; font-size: 10px;
}
.vmodel-card.busy .vmodel-card-meta { color: var(--warn); }
.vmodel-blank {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 8px; text-align: center; font-size: 11px; color: var(--text-dim);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.03), rgba(255,255,255,.03) 8px, transparent 8px, transparent 16px);
}
.vmodel-angle-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.vmodel-angle.anchor { border-color: rgba(91,140,255,.5); }
.vmodel-angle-retry { position: absolute; left: 6px; bottom: 26px; z-index: 3; }
/* 第一步占掉顶部一整行后，两个选图面板不用再各撑半屏 */
.studio.demo .demo-picks .panel.fill { height: calc((100vh - 620px) / 2); min-height: 260px; }
@media (max-width: 1400px) {
  .vmodel-split { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
  #vmodel-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
