/* ===================== 基础 ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --text: #262626;
  --text-2: #595959;
  --text-3: #8c8c8c;
  --border: #e8e8e8;
  --border-2: #f0f0f0;
  --bg: #f0f2f5;
  --radius: 6px;
  --stage-h: min(50vh, 480px);
  --stage-w: calc(var(--stage-h) * 0.75);
  --thumb-h: 69px;
  --tool-size: 26px;
}

html, body { height: 100%; }

body {
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.i { width: 14px; height: 14px; fill: currentColor; }
.hidden { display: none !important; }

/* ===================== 侧边栏 ===================== */
.sidebar {
  width: 180px;
  flex: 0 0 180px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
}

.logo {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-2);
}
.logo-mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, #1677ff, #69b1ff);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.logo-divider { width: 1px; height: 14px; background: var(--border); }
.logo-text { font-size: 13px; font-weight: 600; }

.identity {
  padding: 12px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--border-2);
}
.identity label { color: var(--text-2); white-space: nowrap; }

.select-mini, .select { position: relative; flex: 1; }
.select-mini select, .select select {
  width: 100%;
  height: 26px;
  padding: 0 22px 0 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  color: var(--text);
  appearance: none;
  cursor: pointer;
}
.select-mini::after, .select::after {
  content: '';
  position: absolute; right: 8px; top: 50%;
  width: 5px; height: 5px;
  border-right: 1px solid #999; border-bottom: 1px solid #999;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select select { height: 28px; min-width: 150px; }

.nav { padding: 6px 0; flex: 1; overflow-y: auto; }
.nav-item {
  height: 38px;
  padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text-2);
  cursor: pointer;
}
.nav-item:hover { background: #f5f5f5; }
.nav-item.active { color: var(--primary); font-weight: 500; }
.chev {
  width: 6px; height: 6px;
  border-right: 1.4px solid #bfbfbf; border-bottom: 1.4px solid #bfbfbf;
  transform: rotate(45deg);
  transition: transform .18s;
}
.chev.down { transform: rotate(-135deg); }

/* 审核管理二级菜单 */
.nav-sub { display: none; padding: 2px 0 4px; }
.nav-group.open .nav-sub { display: block; }

/* 二级分类标题：审核标准管理 / 审核节点管理 / 任务管理 / 审核看板 / 审核配置 */
.nav-cat + .nav-cat { margin-top: 2px; }
.nav-cat-hd {
  padding: 6px 12px 4px 20px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  border-radius: 3px;
  user-select: none;
}
.nav-cat-hd:hover { background: #f5f5f5; color: var(--text-2); }
.nav-cat-hd span { position: relative; }
.nav-cat-hd span::before {
  content: '';
  position: absolute; left: -9px; top: 50%;
  width: 3px; height: 3px;
  background: #d9d9d9;
  transform: translateY(-50%);
}
/* 二级分组的收起箭头 */
.cat-chev {
  flex: 0 0 5px;
  width: 5px; height: 5px;
  border-right: 1.2px solid #bfbfbf;
  border-bottom: 1.2px solid #bfbfbf;
  transform: rotate(-45deg);
  transition: transform .18s;
}
.nav-cat.open .cat-chev { transform: rotate(45deg); }
/* 收起时隐藏本分组下的条目（cat-lv 叶子项不在 .nav-cat 内，不受影响）*/
.nav-cat > .nav-sub-item { display: none; }
.nav-cat.open > .nav-sub-item { display: flex; }

.nav-sub-item {
  position: relative;
  display: flex; align-items: center;
  min-height: 30px;
  padding: 5px 10px 5px 30px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
}
.nav-sub-item::before {
  content: '';
  position: absolute; left: 20px; top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #d9d9d9;
  transform: translateY(-50%);
}
.nav-sub-item:hover { background: #f5f5f5; color: var(--primary); }
.nav-sub-item.active {
  background: #e6f4ff;
  color: var(--primary);
  font-weight: 500;
}
.nav-sub-item.active::before { background: var(--primary); }

/* 方案待补充的模块 */
.nav-sub-item.todo { color: var(--text-3); }
.nav-sub-item.todo:hover { color: var(--text-2); background: #fafafa; }
.nav-sub-item.todo .todo-dot {
  margin-left: 5px;
  color: #faad14;
  font-weight: 700;
}

/* 二级叶子项（无下级）：缩进与分组标题对齐 */
.nav-sub-item.cat-lv {
  padding-left: 20px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
}
.nav-sub-item.cat-lv::before {
  left: 11px;
  width: 3px; height: 3px;
  border-radius: 0;
}
.nav-sub-item.cat-lv.todo { color: var(--text-3); }

.sidebar-collapse {
  height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  border-top: 1px solid var(--border-2);
  cursor: pointer;
}
.sidebar-collapse:hover { background: #f5f5f5; }

/* ===================== 顶部条 ===================== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 48px;
  flex: 0 0 48px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.back {
  font-size: 16px; color: var(--text-2);
  cursor: pointer; line-height: 1;
}
.back:hover { color: var(--primary); }
.topbar h1 { font-size: 14px; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.stat { color: var(--text-2); font-size: 12px; }
.stat b {
  display: inline-block;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  margin-left: 3px;
  background: #f0f0f0;
  border-radius: 3px;
  text-align: center; line-height: 18px;
  font-weight: 600;
}
.divider-v { width: 1px; height: 16px; background: var(--border); }

.tb-btn {
  height: 26px;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.tb-btn:hover { background: #f0f5ff; color: var(--primary); }
.tb-btn i { font-style: normal; color: var(--text-3); }
.tb-btn:hover i { color: var(--primary); }

/* ===================== 内容区 ===================== */
.content {
  flex: 1;
  display: flex;
  gap: 8px;
  padding: 8px;
  min-height: 0;
}

.task-rail {
  width: 72px;
  flex: 0 0 72px;
  background: #fff;
  border-radius: var(--radius);
  padding: 6px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
}
.task-card {
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fafafa;
}
.task-card.active { border-color: var(--primary); }
.task-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.workspace {
  flex: 1;
  background: #fff;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ===================== 任务信息栏 ===================== */
.taskbar {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.taskbar-fields { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; }
/* 字段间细分隔线，提升信息密度下的可读性 */
.taskbar-fields .field + .field::before {
  content: ''; flex: 0 0 1px;
  width: 1px; height: 12px;
  background: var(--border);
  margin-right: 8px;
}
.field { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.field label { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.field b { font-weight: 500; color: var(--text); }
.field a { color: var(--primary); text-decoration: none; }
.field a:hover { text-decoration: underline; }
.muted { color: var(--text-3); }

.taskbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }
.link-btn {
  border: none; background: transparent;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px;
}
.link-btn:hover { color: var(--primary-hover); }

.btn {
  height: 30px;
  padding: 0 16px;
  border: 1px solid #d9d9d9;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

/* ===================== 三栏面板 ===================== */
.panels {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  min-height: 0;
}

.panel { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 0; }

/* 模板/视频审核：两栏布局，按需隐藏对应栏 */
.panels.hide-left #panelLeft { display: none; }
.panels.hide-mid #panelMid { display: none; }

/* 首图/套图审核：中栏与右栏视觉位置互换（DOM 不变，仅调 order）
   → 左：参考图  中：待审核图  右：模板/参考图 */
.panels.swap-mr #panelLeft  { order: 0; }
.panels.swap-mr #panelRight { order: 1; }
.panels.swap-mr #panelMid   { order: 2; }

/* 底部缩略图条同步：参考图组(thumbRef) | 待审核组(thumbPend) | 模板/参考组(thumbTpl) */
.thumbbar.swap-mr #thumbRef  { order: 0; }
.thumbbar.swap-mr #splitRef  { order: 1; }
.thumbbar.swap-mr #thumbPend { order: 2; }
.thumbbar.swap-mr #splitTpl  { order: 3; }
.thumbbar.swap-mr #thumbTpl  { order: 4; }

.panel-head {
  width: var(--stage-w);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  height: 22px;
  flex: 0 0 22px;
}
.panel-title { font-size: 13px; font-weight: 600; }
.panel-sub { font-size: 11px; color: var(--text-3); }
.panel-sub b { color: var(--primary); }

/* 固定 3:4 舞台 */
.stage {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 0 0 auto;
}
.stage > img,
.stage-single img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.stage-tag {
  position: absolute; top: 8px; left: 8px;
  z-index: 4;
  padding: 2px 7px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  border-radius: 3px;
  backdrop-filter: blur(2px);
}

.stage-check {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 20px; height: 20px;
  cursor: pointer;
}
.stage-check input { display: none; }
.stage-check span {
  display: block; width: 20px; height: 20px;
  border: 2px solid #fff;
  border-radius: 3px;
  background: rgba(255,255,255,.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.stage-check input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
}
.stage-check input:checked + span::after {
  content: ''; display: block;
  width: 5px; height: 9px;
  margin: 2px auto 0;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(42deg);
}

.stage-single { position: relative; width: 100%; height: 100%; }

/* 多图平铺：容器内滚动 */
.stage-tile {
  position: absolute; inset: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: start;
  overflow-y: auto;
  background: #fff;
}
.stage-tile::-webkit-scrollbar { width: 6px; }
.stage-tile::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fafafa;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover { border-color: #91caff; }
.tile.active { border-color: var(--primary); }
.tile-no {
  position: absolute; bottom: 2px; right: 3px;
  font-size: 10px; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}

/* 左右切换箭头 */
.arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 44px;
  border: none;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s;
  z-index: 4;
}
.arrow.left { left: 0; border-radius: 0 4px 4px 0; }
.arrow.right { right: 0; border-radius: 4px 0 0 4px; }
.stage:hover .arrow { opacity: 1; }
.arrow:hover { background: rgba(0,0,0,.6); }

.counter {
  position: absolute; bottom: 8px; right: 8px;
  z-index: 4;
  padding: 2px 8px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 11px;
  border-radius: 10px;
}

/* 状态徽标 */
.badge-wrap {
  position: absolute; top: 34px; left: 8px; z-index: 5;
  display: flex; flex-direction: column; gap: 4px;
}
.badge {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 3px;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge.generating { background: #e6f4ff; color: #0958d9; border: 1px solid #91caff; }
.badge.success    { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.badge.failed     { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.badge.rejected   { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }
/* 套图审核：待审核图未引用参考图 */
.badge.noref      { background: #fafafa; color: #8c8c8c; border: 1px dashed #d9d9d9; }

/* 缩略图素材类型标签（套图审核文字较长）*/
.thumb-label.mat { background: rgba(56,158,13,.85); font-size: 8.5px; padding: 1px 3px; }
.thumb-label.ref-back { background: rgba(114,46,209,.85); }
.thumb-label.ref-skc { background: rgba(212,107,8,.88); }

.spin {
  width: 8px; height: 8px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 悬浮工具栏 */
.toolbar {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex; align-items: center; gap: 1px;
  padding: 3px;
  background: rgba(30,30,32,.82);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  flex-wrap: nowrap;
  justify-content: center;
}
.tool {
  position: relative;
  width: var(--tool-size); height: var(--tool-size);
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tool:hover { background: rgba(255,255,255,.2); }
.tool .i { width: calc(var(--tool-size) * .58); height: calc(var(--tool-size) * .58); }
.tool::after {
  content: attr(data-label);
  position: absolute; bottom: 120%; left: 50%;
  transform: translateX(-50%);
  padding: 3px 7px;
  background: rgba(0,0,0,.85);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  border-radius: 3px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.tool:hover::after { opacity: 1; }

.panel-foot {
  width: var(--stage-w);
  flex: 0 0 18px;
  display: flex; align-items: center; justify-content: center;
}
.hint { font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 新增：审核标准 / 负反馈 chip + 气泡卡片 ===== */
.taskbar-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.chip-btn {
  height: 26px;
  padding: 0 9px;
  border: 1px solid #d9d9d9;
  border-radius: 13px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
  transition: all .15s;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f7ff; }
.chip-btn.on { border-color: var(--primary); color: var(--primary); background: #e6f4ff; }
.chip-btn .i { width: 13px; height: 13px; }
/* 负反馈：直接作为字段展示 */
.fb-value {
  padding: 1px 8px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  border-radius: 3px;
  font-size: 12px;
}

/* 审核标准 chip 上的版本号与更新提示 */
.chip-ver {
  padding: 1px 6px;
  background: #f0f5ff;
  color: var(--primary);
  border-radius: 8px;
  font-size: 10px; font-weight: 600;
}
.chip-new {
  padding: 1px 5px;
  background: #ff4d4f;
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
}

/* ===== 完整审核标准弹窗 ===== */
.std-card {
  width: 720px; max-width: 92vw;
  max-height: 86vh;
  display: flex; flex-direction: column;
}

.std-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex: 0 0 auto;
}
.std-ver-pick { display: flex; align-items: center; gap: 8px; }
.std-ver-pick label { color: var(--text-2); font-size: 12px; }
.std-ver-pick .select select { min-width: 200px; height: 28px; }
.std-date { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.std-filter { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.std-filter input { cursor: pointer; }

.std-diff-bar {
  padding: 8px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-2);
  font-size: 12px;
  color: var(--text-2);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  flex: 0 0 auto;
}
.diff-pill {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.diff-pill.added    { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.diff-pill.modified { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.diff-pill.removed  { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }

.std-body { padding: 4px 16px 12px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.std-group { margin-top: 10px; }
.std-group-name {
  font-size: 12px; font-weight: 600;
  color: var(--text);
  padding: 7px 0;
  position: sticky; top: 0;
  background: #fff;
  z-index: 1;
}
.std-group-name::before {
  content: ''; display: inline-block;
  width: 3px; height: 11px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.std-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 8px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
  border-bottom: 1px dashed var(--border-2);
}
.std-no {
  flex: 0 0 17px;
  width: 17px; height: 17px;
  margin-top: 2px;
  background: #f0f5ff;
  color: var(--primary);
  border-radius: 50%;
  font-size: 10px; font-weight: 600;
  text-align: center; line-height: 17px;
}
.std-must { color: #cf1322; font-size: 10px; margin-left: 4px; }

/* 版本变更高亮 */
.std-item.ch-added    { background: #f6ffed; border-left: 3px solid #52c41a; border-bottom-color: #d9f7be; }
.std-item.ch-modified { background: #fffbe6; border-left: 3px solid #faad14; border-bottom-color: #ffe58f; }
.std-item.ch-removed  { background: #fff2f0; border-left: 3px solid #ff4d4f; border-bottom-color: #ffccc7; }
.std-item.ch-removed .std-txt { text-decoration: line-through; color: #a6a6a6; }

.ch-badge {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px; font-weight: 500;
  vertical-align: 1px;
  white-space: nowrap;
}
.ch-badge.added    { background: #52c41a; color: #fff; }
.ch-badge.modified { background: #faad14; color: #fff; }
.ch-badge.removed  { background: #ff4d4f; color: #fff; }

.std-prev {
  margin-top: 4px;
  padding: 3px 8px;
  background: rgba(0,0,0,.04);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-3);
  text-decoration: line-through;
}
.std-empty { padding: 36px 0; text-align: center; color: var(--text-3); font-size: 12px; }

.std-legend { margin-right: auto; display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.lg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg.added { background: #52c41a; }
.lg.modified { background: #faad14; margin-left: 6px; }
.lg.removed { background: #ff4d4f; margin-left: 6px; }

.btn.tiny { height: 26px; padding: 0 12px; font-size: 12px; }

/* 导航折叠：为审核区腾出横向空间 */
.icon-btn {
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f0f5ff; color: var(--primary); }
.icon-btn .i { width: 16px; height: 16px; }

.sidebar { transition: flex-basis .2s ease, width .2s ease; }
body.nav-collapsed .sidebar {
  flex-basis: 0;
  width: 0;
  border-right: none;
  overflow: hidden;
}

/* 单图 / 平铺 切换 */
.mode-switch {
  display: inline-flex;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  overflow: hidden;
}
.mode-btn {
  height: 24px;
  padding: 0 8px;
  border: none;
  background: #fff;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.mode-btn + .mode-btn { border-left: 1px solid #d9d9d9; }
.mode-btn:hover { color: var(--primary); }
.mode-btn.active { background: var(--primary); color: #fff; }

/* ===================== 底部缩略图 ===================== */
.thumbbar {
  flex: 0 0 auto;
  border-top: 1px solid var(--border-2);
  padding: 7px 12px;
  display: flex; align-items: center; gap: 10px;
  background: #fff;
}
.thumb-group { display: flex; gap: 8px; flex: 0 0 auto; }
.thumb-group.scroll { overflow-x: auto; padding-bottom: 4px; flex: 1 1 0; min-width: 0; }
.thumb-group.scroll::-webkit-scrollbar { height: 5px; }
.thumb-group.scroll::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
.group-split { width: 1px; height: calc(var(--thumb-h) * 0.8); background: var(--border); flex: 0 0 1px; }

.thumb {
  position: relative;
  height: var(--thumb-h);
  width: calc(var(--thumb-h) * 0.75);
  flex: 0 0 calc(var(--thumb-h) * 0.75);
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fafafa;
  transition: transform .18s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: #91caff; }
.thumb.active { border-color: var(--primary); border-style: dashed; }
.thumb.moved { animation: pop .32s ease; }
@keyframes pop {
  0% { transform: scale(.8); opacity: .4; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

/* 缩略图左上角：参考图 / 模板图 标签 */
.thumb-label {
  position: absolute; top: 0; left: 0;
  padding: 1px 4px;
  font-size: 9px;
  color: #fff;
  background: rgba(0,0,0,.6);
  border-radius: 0 0 3px 0;
  z-index: 2;
  line-height: 1.4;
}
.thumb-label.tpl { background: rgba(22,119,255,.85); }
.thumb-label.pend { background: rgba(56,158,13,.85); }

/* 缩略图左下角：生成状态提示 */
.thumb-status {
  position: absolute; bottom: 0; left: 0;
  padding: 1px 4px;
  font-size: 9px;
  color: #fff;
  border-radius: 0 3px 0 0;
  z-index: 2;
  display: flex; align-items: center; gap: 3px;
  line-height: 1.4;
}
.thumb-status.generating { background: rgba(9,88,217,.9); }
.thumb-status.success    { background: rgba(56,158,13,.9); }
.thumb-status.failed     { background: rgba(207,19,34,.9); }
.thumb-status .spin { width: 6px; height: 6px; border-width: 1.2px; }

/* 缩略图右上角勾选 */
.thumb-check {
  position: absolute; top: 3px; right: 3px;
  z-index: 3;
  width: 15px; height: 15px;
  border: 1.5px solid #fff;
  border-radius: 2px;
  background: rgba(255,255,255,.4);
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  cursor: pointer;
}
/* 扩大点击热区，避免误触到缩略图本体 */
.thumb-check::before { content: ''; position: absolute; inset: -6px; }
.thumb.picked .thumb-check { background: var(--primary); border-color: var(--primary); }
.thumb.picked .thumb-check::after {
  content: ''; display: block;
  width: 3px; height: 6px;
  margin: 1px auto 0;
  border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: rotate(42deg);
}
.thumb.rejected img { opacity: .45; filter: grayscale(.6); }

/* ===================== 视频播放器 ===================== */
/* 覆盖层本身不拦事件，否则会遮挡左右切换箭头 */
.vp { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.vp-center, .vp-bar { pointer-events: auto; }

.vp-center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.vp-center span {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s, opacity .2s;
}
.vp-center svg { width: 26px; height: 26px; fill: #fff; }
.vp-center:hover span { background: rgba(0,0,0,.58); transform: scale(1.06); }
.vp.playing .vp-center span { opacity: 0; }
.vp.playing .vp-center:hover span { opacity: 1; }

.vp-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 38px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
}
.vp-btn {
  width: 22px; height: 22px;
  flex: 0 0 22px;
  border: none; background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.vp-btn svg { width: 17px; height: 17px; fill: #fff; }
.vp-btn.off svg { fill: rgba(255,255,255,.45); }

.vp-time {
  color: #fff; font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.vp-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.32);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.vp-track::before { content: ''; position: absolute; inset: -7px 0; }
.vp-prog {
  height: 100%; width: 0;
  background: var(--primary);
  border-radius: 2px;
  position: relative;
}
.vp-prog i {
  position: absolute; right: -5px; top: -3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* 视频模式下工具栏上提，避免遮挡播放控件 */
.stage.video .toolbar { bottom: 46px; }
.stage.video .counter { bottom: 44px; }
/* Ken Burns 运镜：由播放进度驱动 */
.stage.video #imgPend { transform-origin: 50% 42%; will-change: transform; }

/* 缩略图：视频标识 */
.thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  pointer-events: none;
}
.thumb-play svg { width: 18px; height: 18px; fill: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.thumb-dur {
  position: absolute; bottom: 0; right: 0;
  z-index: 2;
  padding: 1px 3px;
  background: rgba(0,0,0,.66);
  color: #fff;
  font-size: 9px;
  border-radius: 3px 0 0 0;
  font-variant-numeric: tabular-nums;
}

/* ===================== 弹窗 ===================== */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.65); }

.lightbox-body { position: relative; z-index: 2; }
.lightbox-body img {
  max-width: 80vw; max-height: 84vh;
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.lightbox-bar {
  margin-top: 10px;
  text-align: center;
  color: #fff;
  font-size: 12px;
}
.modal-x {
  position: absolute; top: -34px; right: 0;
  width: 28px; height: 28px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 18px;
  border-radius: 4px;
  cursor: pointer;
}
.modal-x:hover { background: rgba(255,255,255,.3); }

.modal-card {
  position: relative; z-index: 2;
  width: 720px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,.3);
}
.modal-head {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600;
}
.modal-head .modal-x {
  position: static;
  background: transparent;
  color: var(--text-3);
}
.modal-head .modal-x:hover { background: #f5f5f5; color: var(--text); }

.modal-body { display: flex; gap: 16px; padding: 16px; }
.canvas-wrap {
  position: relative;
  width: 280px; height: 373px;
  flex: 0 0 280px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
}
.canvas-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mask-rect {
  position: absolute;
  border: 1.5px dashed #1677ff;
  background: rgba(22,119,255,.18);
  pointer-events: none;
}
.canvas-hint {
  position: absolute; bottom: 8px; left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  border-radius: 10px;
  pointer-events: none;
}

.editor-side { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--text-2); }
.form-row textarea {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.form-row textarea:focus { outline: none; border-color: var(--primary); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 26px; padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.chip.active { border-color: var(--primary); color: var(--primary); background: #f0f5ff; }
.form-tip {
  margin-top: auto;
  padding: 8px 10px;
  background: #fafafa;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
}

.modal-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border-2);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ===================== Toast ===================== */
.toast-wrap {
  position: fixed; top: 60px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 8px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  font-size: 13px;
  display: flex; align-items: center; gap: 7px;
  animation: toastIn .22s ease;
}
.toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.toast.ok .dot { background: #52c41a; }
.toast.warn .dot { background: #faad14; }
.toast.err .dot { background: #ff4d4f; }
@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1200px) {
  .panels { flex-wrap: wrap; overflow: auto; }
}
