/* ================================================================
 * modules/video.css - 图像编辑模块样式（Wan2.1 视频生成）
 * 即梦风格 · 沉浸式暗色布局 · 左侧参数面板 + 右侧大画布
 * ================================================================ */

/* === 视频编辑模式容器 === */
.content.video-mode {
  padding: 0 !important;
  overflow: hidden;
  background: #0f1117;
}
.content.video-mode > .empty-state,
.content.video-mode > .messages,
.content.video-mode > .input-area {
  display: none !important;
}
.content.video-mode > .video-editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* === 主容器 === */
.video-editor-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0f1117;
  color: #e2e8f0;
}

/* === 顶部 Header === */
.video-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #161b27;
  padding: 0 20px;
  flex-shrink: 0;
  height: 52px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 12px;
}

/* PC header 视频标题 */
.header-video-title {
  margin-left: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.08));
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid rgba(99,102,241,0.2);
}

/* 功能标签容器 — 即梦风格 Tab */
.video-editor-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 即梦风格标签按钮 */
.vtab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
  user-select: none;
}
.vtab:hover {
  border-color: rgba(99,102,241,0.4);
  color: rgba(255,255,255,0.8);
  background: rgba(99,102,241,0.06);
}
.vtab.active {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.1));
  color: #e2e8f0;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99,102,241,0.2);
}
.vtab-icon {
  font-size: 14px;
  line-height: 1;
}
.vtab-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(251,146,60,0.2);
  color: #fb923c;
  font-weight: 600;
}
.vtab-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.vtab-disabled:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.4);
}
/* 状态指示 */
.video-editor-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.05);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.video-editor-status .wan-status-dot { font-size: 8px; margin-right: 2px; }
.video-editor-status.online  { color: #4ade80; border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }
.video-editor-status.offline { color: #f87171; border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.08); }
.video-editor-status.loading { color: #fbbf24; border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.08); }
.video-editor-status.partial { color: #60a5fa; border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.08); }
.video-editor-status.error   { color: #f87171; border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.08); }
.video-editor-status.inactive { color: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.06); background: rgba(255,255,255,0.03); cursor: default; }

/* Header 右侧容器：视频模型选择 + 服务状态 */
.video-editor-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 视频模型选择器（Header 内联） */
.video-model-selector {
  display: flex;
  align-items: center;
}
.vp-select-header {
  height: 32px;
  padding: 0 32px 0 12px;
  font-size: 12px;
  min-width: 180px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #e2e8f0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.vp-select-header:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.08);
}
.vp-select-header:focus {
  border-color: #6366f1;
  background: rgba(99,102,241,0.1);
}

/* loading 动画点 */
.wan-spinner {
  display: inline-block;
  animation: wan-spin 0.8s steps(8) infinite;
  font-size: 14px;
  line-height: 1;
}
@keyframes wan-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 刷新按钮 */
.wan-refresh-btn {
  padding: 2px 6px;
  border-radius: 4px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.wan-refresh-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* === 主体布局 === */
.video-editor-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* === 左侧参数面板（width 动画，收起时底栏自动扩大） === */
.video-params-panel {
  width: 320px;
  min-width: 0;
  max-width: 360px;
  background: #161b27;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}
.video-params-panel.collapsed {
  width: 0 !important;
  min-width: 0;
  opacity: 0;
  border-right: none;
  pointer-events: none;
}

/* 参数面板内容区 */
.video-params-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.video-params-scroll::-webkit-scrollbar { width: 4px; }
.video-params-scroll::-webkit-scrollbar-track { background: transparent; }
.video-params-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* 参数区块 */
.vpanel-section {
  margin-bottom: 20px;
}
.vpanel-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}

/* 图片上传区 */
.vp-upload-zone {
  border: 2px dashed rgba(99,102,241,0.35);
  border-radius: 10px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(99,102,241,0.04);
  position: relative;
  overflow: hidden;
}
.vp-upload-zone:hover {
  border-color: rgba(99,102,241,0.7);
  background: rgba(99,102,241,0.08);
}
.vp-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.vp-upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.vp-upload-text {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-align: center;
  line-height: 1.5;
}
.vp-upload-hint {
  font-size: 11px;
  color: rgba(99,102,241,0.7);
  margin-top: 4px;
}
.vp-image-preview {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}
.vp-image-preview img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.vp-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.vp-image-remove:hover { background: rgba(239,68,68,0.8); }

/* 模型模式下拉选择器 */
.video-mode-select {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.video-mode-select:hover {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.08);
}
.video-mode-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
.video-mode-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.video-mode-select option {
  background: #161b27;
  color: #e2e8f0;
}

/* 模型就绪标记 */
.tab-badge {
  display: inline-block;
  font-size: 10px;
  color: #4ade80;
  padding: 1px 4px;
  background: rgba(74,222,128,0.15);
  border-radius: 4px;
  font-weight: bold;
  white-space: nowrap;
}

/* 比例选择器 */
.vp-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.vp-ratio-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.03);
  min-height: 60px;
}
.vp-ratio-item:hover {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.08);
}
.vp-ratio-item.active {
  border-color: #6366f1;
  background: rgba(99,102,241,0.15);
}
.vp-ratio-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
.vp-ratio-label {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  line-height: 1.2;
}
.vp-ratio-item.active .vp-ratio-label { color: #a5b4fc; }

/* 通用表单元素 */
.vp-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.vp-label span { color: rgba(255,255,255,0.8); font-weight: 500; }

.vp-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.vp-select:focus { outline: none; border-color: #6366f1; }
.vp-select option { background: #1e2433; color: #e2e8f0; }

.vp-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vp-slider {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  cursor: pointer;
}
.vp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}
.vp-slider-val {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vp-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.vp-input:focus { outline: none; border-color: #6366f1; }
.vp-input::placeholder { color: rgba(255,255,255,0.25); }

/* 质量/时长快速选择 */
.vp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vp-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.vp-chip:hover {
  border-color: rgba(99,102,241,0.5);
  color: rgba(255,255,255,0.8);
}
.vp-chip.active {
  border-color: #6366f1;
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
}

/* === 模型选择卡片 (ComfyUI) === */
.model-card {
  width: 72px;
  padding: 6px 4px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.15s ease;
}
.model-card:hover { background: rgba(255,255,255,0.08); }
.model-card-sel {
  border-color: #3b82f6 !important;
  background: rgba(59,130,246,0.15) !important;
}
.model-card-name { font-size: 9px; color: rgba(255,255,255,0.5); margin-bottom: 2px; word-break: break-all; }
.model-card-file { font-size: 8px; color: rgba(255,255,255,0.3); word-break: break-all; }

/* 分隔线 */
.vp-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 12px 0;
}

/* === 角色参考图卡片 === */
.char-imgs-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.char-img-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 72px;
  flex-shrink: 0;
}
.char-img-preview {
  position: relative;
  width: 72px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
.char-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.char-img-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
}
.char-img-remove:hover { background: rgba(239,68,68,0.8); }

.char-img-label {
  width: 100%;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  font-size: 10px;
  text-align: center;
  box-sizing: border-box;
  transition: border-color 0.2s;
  outline: none;
}
.char-img-label:focus {
  border-color: #6366f1;
  background: rgba(99,102,241,0.08);
}
.char-img-label::placeholder { color: rgba(255,255,255,0.2); }

/* 添加角色按钮 */
.char-img-add {
  width: 72px;
  height: 120px;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.char-img-add:hover {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.06);
}
.char-img-add input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.char-img-add-icon {
  font-size: 22px;
  color: rgba(255,255,255,0.3);
  line-height: 1;
  margin-bottom: 4px;
}
.char-img-add-text {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  line-height: 1.3;
}

/* ── 1080P AI 超分 开关 ── */
.vp-upscale-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.vp-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.vp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.vp-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 22px;
  transition: 0.25s;
}
.vp-toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  transition: 0.25s;
}
.vp-toggle input:checked + .vp-toggle-slider {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}
.vp-toggle input:checked + .vp-toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}
.vp-upscale-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  transition: opacity 0.2s;
}

/* === 右侧主内容区 === */
.video-main-area {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  background: #0f1117;
  position: relative;
  /* overflow: hidden 会裁切 absolute 定位的子元素，去掉 */
}

/* 右侧列：画布 + 底部操作栏（垂直排列） */
.video-right-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* 预览大画布 */
.video-canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.video-canvas-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.05) 0%, transparent 65%);
  pointer-events: none;
}
.video-canvas-inner {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* 空状态 */
.video-canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  text-align: center;
  padding: 40px;
  border: 2px dashed rgba(255,255,255,0.08);
  border-radius: 16px;
  min-width: 300px;
  min-height: 200px;
  width: 100%;
  max-width: 640px;
  background: rgba(255,255,255,0.02);
  transition: all 0.3s;
}
.video-canvas-placeholder.drag-over {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.06);
}
.video-canvas-placeholder .vcp-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.video-canvas-placeholder .vcp-title { font-size: 16px; margin-bottom: 8px; color: rgba(255,255,255,0.3); }
.video-canvas-placeholder .vcp-sub { font-size: 13px; line-height: 1.6; }

/* 已生成的视频 */
.video-canvas-result {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.video-canvas-result video {
  max-width: 100%;
  max-height: calc(100vh - 280px);
  border-radius: 12px;
  display: block;
}

/* 生成进度覆盖层 */
.video-generating-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15,17,23,0.8);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  z-index: 10;
  gap: 16px;
}
.vgo-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: jimeng-spin 0.8s linear infinite;
}
.vgo-text {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  text-align: center;
  max-width: 260px;
  word-break: break-word;
}
.vgo-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.vgo-pct {
  font-size: 20px;
  color: #6366f1;
  font-weight: 600;
  margin: 4px 0;
}
.vgo-progress {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.vgo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* === 底部操作栏 === */
.video-bottom-bar {
  flex-shrink: 0;
  background: #161b27;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 历史缩略图栏 */
.video-history-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-bottom: 4px;
  min-height: 80px;
  align-items: center;
}
.video-history-strip::-webkit-scrollbar { height: 3px; }
.video-history-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.video-history-empty {
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  padding: 8px 0;
}
.video-history-item {
  flex-shrink: 0;
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  cursor: default;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.video-history-item:hover { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.06); }
.video-history-item .vhi-thumb {
  font-size: 16px;
  opacity: 0.6;
}
.video-history-item .vhi-label {
  font-size: 8px;
  color: rgba(255,255,255,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 74px;
  padding: 0 3px;
}
.video-history-item .vhi-meta {
  font-size: 7px;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
}

/* 提示词输入行 */
.video-prompt-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.video-prompt-wrap {
  flex: 1;
  position: relative;
}
.video-prompt-textarea {
  width: 100%;
  min-height: 100px;
  max-height: 200px;
  padding: 12px 44px 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.video-prompt-textarea:focus {
  outline: none;
  border-color: rgba(99,102,241,0.6);
  background: rgba(255,255,255,0.08);
}
.video-prompt-textarea::placeholder { color: rgba(255,255,255,0.25); }

/* 负面提示词开关图标 */
.video-neg-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}
.video-neg-toggle:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.video-neg-toggle.active { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.3); }

/* 负面提示词输入框（展开时显示） */
.video-neg-prompt {
  margin-top: 6px;
}
.video-neg-textarea {
  width: 100%;
  min-height: 36px;
  max-height: 72px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.05);
  color: rgba(255,200,200,0.8);
  font-size: 13px;
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
}
.video-neg-textarea:focus { outline: none; border-color: rgba(239,68,68,0.5); }
.video-neg-textarea::placeholder { color: rgba(255,150,150,0.3); }

/* 生成按钮 */
.video-gen-btn {
  flex-shrink: 0;
  min-width: 120px;
  height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.35);
  transition: all 0.2s;
}
.video-gen-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f52e8, #7c3aed);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
  transform: translateY(-1px);
}
.video-gen-btn:active:not(:disabled) { transform: translateY(0); }
.video-gen-btn:disabled {
  background: rgba(255,255,255,0.1);
  box-shadow: none;
  cursor: not-allowed;
  color: rgba(255,255,255,0.3);
}
.video-gen-btn.generating {
  background: rgba(99,102,241,0.25);
  border: 1px solid rgba(99,102,241,0.4);
  box-shadow: none;
}
.vgb-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: jimeng-spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* 按钮组 */
.video-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.video-action-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  white-space: nowrap;
}
.video-action-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.2);
}
.video-action-btn.download {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.3);
  color: #4ade80;
}
.video-action-btn.download:hover { background: rgba(16,185,129,0.2); }

/* 左侧参数面板收缩按钮（在 video-editor-body 中，始终可见） */
.video-panel-toggle {
  position: absolute;
  left: 320px;  /* 面板展开时贴在面板右边缘 */
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 48px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  transition: left 0.3s ease;
  z-index: 100;
  border-radius: 0 6px 6px 0;
  flex-shrink: 0;
}
.video-panel-toggle:hover { background: rgba(99,102,241,0.2); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
/* 面板收起时，按钮贴到左边缘 */
.video-panel-toggle.collapsed {
  left: 0;
}

/* === 动画 === */
@keyframes jimeng-spin {
  to { transform: rotate(360deg); }
}
@keyframes jimeng-progress {
  0% { width: 5%; }
  50% { width: 75%; }
  100% { width: 95%; }
}

/* === 响应式 === */
@media (max-width: 900px) {
  .video-params-panel { width: 260px; min-width: 240px; }
}
@media (max-width: 700px) {
  .video-params-panel { display: none; }
  .video-canvas-area { padding: 12px; }
  .video-bottom-bar { padding: 10px 12px; }
  /* H5手机端：允许垂直滚动以便看到底部按钮 */
  .content.video-mode {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .content.video-mode > .video-editor-container {
    height: auto;
    min-height: 100%;
  }
  .video-editor-body {
    overflow: visible;
    flex-direction: column;
  }
  .video-main-area {
    min-height: 0;
    height: auto;
    overflow: visible;
  }
  .video-canvas-area {
    min-height: 200px;
    flex: 0 0 auto;
  }
  /* 底部操作栏固定在视口内可滚动 */
  .video-bottom-bar {
    position: sticky;
    bottom: 0;
    background: #161b27;
    z-index: 100;
  }
  /* 历史记录栏在小屏上限制高度 */
  .video-history-strip {
    max-height: 60px;
    overflow-x: auto;
  }

  /* H5手机端：允许垂直滚动以便看到底部按钮 */
}

/* ══════════════════════════════════════════════════════
   @-mention 素材引用下拉菜单
   ══════════════════════════════════════════════════════ */
.mention-dropdown {
  position: absolute;
  top: var(--mention-top, auto);
  bottom: var(--mention-bottom, auto);
  left: var(--mention-left, 8px);
  z-index: 9999;
  background: #1a1b26;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  min-width: 320px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  padding: 4px 0;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin: 0 6px;
  border-radius: 8px;
}
.mention-item:last-child { border-bottom: none; }
.mention-item:hover, .mention-item.active {
  background: rgba(79,156,249,0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(79,156,249,0.25);
}
.mention-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mention-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mention-icon {
  font-size: 22px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}
.mention-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.mention-type {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.mention-empty {
  padding: 20px 16px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
}

/* === 右侧任务队列面板（与左侧推拉效果一致，用 width 动画让底栏自动扩大） === */
.video-queue-panel {
  width: 320px;
  min-width: 0;
  background: #161b27;
  border-left: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}
.video-queue-panel:not(.open) {
  width: 0 !important;
  opacity: 0;
  border-left: none;
  pointer-events: none;
}
/* 面板展开时恢复宽度 */
.video-queue-panel.open {
  width: 320px;
  opacity: 1;
  border-left: 1px solid rgba(255,255,255,0.06);
  pointer-events: auto;
}.vq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.vq-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
}
.vq-close {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.vq-close:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.vq-header-actions { display: flex; align-items: center; gap: 6px; }
.vq-refresh-btn {
  width: 22px; height: 22px; border-radius: 4px; background: none; border: none;
  color: rgba(255,255,255,0.3); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.vq-refresh-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.vq-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.vq-list::-webkit-scrollbar { width: 4px; }
.vq-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.vq-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  line-height: 1.6;
}
/* ── 任务队列表格 ── */
.vq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.vq-table thead th {
  position: sticky; top: 0;
  background: #1a1f2e;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  font-size: 10px;
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}
/* 7列宽度分配 */
.vq-col-id    { width: 52px; }
.vq-col-name  { width: auto; }
.vq-col-model { width: 60px; text-align: center; }
.vq-col-pos   { width: 32px; text-align: center; }
.vq-col-time  { width: 60px; text-align: center; }
.vq-col-status { width: 50px; text-align: center; }
.vq-col-act   { width: 48px; text-align: center; }
.vq-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  border-left: 3px solid transparent;
}
.vq-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.vq-table tbody tr.queued      { border-left-color: #faad14; }
.vq-table tbody tr.running     { border-left-color: #4f9cf9; }
.vq-table tbody tr.processing  { border-left-color: #4f9cf9; }
.vq-table tbody tr.concatting  { border-left-color: #b44ff9; }
.vq-table tbody tr.upscaling   { border-left-color: #b44ff9; }
/* VACE v6 新状态名 */
.vq-table tbody tr.pending     { border-left-color: #faad14; }
.vq-table tbody tr.splitting   { border-left-color: #faad14; }
.vq-table tbody tr.encoding    { border-left-color: #4f9cf9; }
.vq-table tbody tr.sampling    { border-left-color: #4f9cf9; }
.vq-table tbody tr.decoding    { border-left-color: #4f9cf9; }
.vq-table tbody tr.superres    { border-left-color: #b44ff9; }
.vq-table tbody tr.merging     { border-left-color: #b44ff9; }
.vq-table tbody tr.done        { border-left-color: #52c41a; }
.vq-table tbody tr.error       { border-left-color: #ff4d4f; }
.vq-table tbody tr.cancelled   { border-left-color: rgba(255,255,255,0.15); }
.vq-table tbody td {
  padding: 6px 4px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 已完成/失败/取消行灰显 */
.vq-table tbody tr.done td,
.vq-table tbody tr.error td,
.vq-table tbody tr.cancelled td {
  color: rgba(255,255,255,0.3);
}
/* 列对齐 */
.vq-td-id { font-size: 9px; font-family: 'SF Mono', 'Cascadia Code', monospace; color: rgba(255,255,255,0.35) !important; }
.vq-td-name { max-width: 160px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vq-td-pos { text-align: center; font-size: 10px; }
.vq-td-time { text-align: center; font-size: 9px; color: rgba(255,255,255,0.3) !important; }
.vq-td-status { text-align: center; }
.vq-td-action { text-align: center; }
@keyframes vq-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* ── 状态标签 ── */
.vq-status-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.vq-status-tag.queued     { background: rgba(250,173,20,0.15); color: #faad14; }
.vq-status-tag.running    { background: rgba(79,156,249,0.15); color: #4f9cf9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.processing { background: rgba(79,156,249,0.15); color: #4f9cf9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.concatting { background: rgba(180,79,249,0.15); color: #b44ff9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.upscaling  { background: rgba(180,79,249,0.15); color: #b44ff9; animation: vq-pulse 1.5s ease-in-out infinite; }
/* VACE v6 新状态名 */
.vq-status-tag.pending    { background: rgba(250,173,20,0.15); color: #faad14; }
.vq-status-tag.splitting  { background: rgba(250,173,20,0.15); color: #faad14; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.encoding   { background: rgba(79,156,249,0.15); color: #4f9cf9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.sampling   { background: rgba(79,156,249,0.15); color: #4f9cf9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.decoding   { background: rgba(79,156,249,0.15); color: #4f9cf9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.superres   { background: rgba(180,79,249,0.15); color: #b44ff9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.merging    { background: rgba(180,79,249,0.15); color: #b44ff9; animation: vq-pulse 1.5s ease-in-out infinite; }
.vq-status-tag.done       { background: rgba(82,196,26,0.12); color: #52c41a; }
.vq-status-tag.completed  { background: rgba(82,196,26,0.12); color: #52c41a; }
.vq-status-tag.downloaded { background: rgba(82,196,26,0.08); color: rgba(82,196,26,0.7); }
.vq-status-tag.error      { background: rgba(255,77,79,0.12); color: #ff4d4f; }
.vq-status-tag.cancelled  { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.3); }
/* ── 操作按钮组 ── */
.vq-btn-cancel {
  background: rgba(255,77,79,0.12); border: 1px solid rgba(255,77,79,0.25);
  color: #ff4d4f; cursor: pointer; font-size: 10px;
  padding: 2px 6px; border-radius: 4px; line-height: 1;
  transition: all 0.15s;
}
.vq-btn-cancel:hover { background: rgba(255,77,79,0.25); }
.vq-btn-view {
  background: rgba(79,156,249,0.12); border: 1px solid rgba(79,156,249,0.25);
  color: #4f9cf9; cursor: pointer; font-size: 11px;
  padding: 1px 5px; border-radius: 4px; line-height: 1;
  transition: all 0.15s; margin-right: 2px;
}
.vq-btn-view:hover { background: rgba(79,156,249,0.25); }
.vq-btn-retry {
  background: rgba(250,173,20,0.12); border: 1px solid rgba(250,173,20,0.25);
  color: #faad14; cursor: pointer; font-size: 11px;
  padding: 1px 5px; border-radius: 4px; line-height: 1;
  transition: all 0.15s; margin-right: 2px;
}
.vq-btn-retry:hover { background: rgba(250,173,20,0.25); }
.vq-btn-delete {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.3); cursor: pointer; font-size: 10px;
  padding: 1px 4px; border-radius: 4px; line-height: 1;
  transition: all 0.15s;
}
.vq-btn-delete:hover { background: rgba(255,77,79,0.15); color: #ff4d4f; border-color: rgba(255,77,79,0.3); }
/* v13.9: 下载到本地按钮 */
.vq-btn-dl {
  background: rgba(82,196,26,0.12); border: 1px solid rgba(82,196,26,0.25);
  color: #52c41a; cursor: pointer; font-size: 11px;
  padding: 1px 5px; border-radius: 4px; line-height: 1;
  transition: all 0.15s; margin-right: 2px;
}
.vq-btn-dl:hover { background: rgba(82,196,26,0.25); }
.vq-btn-dl[disabled] { opacity: 0.4; cursor: not-allowed; }
/* v13.10: 本地文件标识（服务器文件已清理） */
.vq-local-tag {
  display: inline-block; font-size: 13px; opacity: 0.7;
  cursor: default; margin-right: 2px; vertical-align: middle;
}
/* v13.10: 新增状态样式 */
.vq-status-tag.submitted { background: rgba(79,156,249,0.15); color: #4f9cf9; }
.vq-status-tag.downloaded { background: rgba(82,196,26,0.15); color: #52c41a; }
.vq-status-tag.queued { background: rgba(250,173,20,0.12); color: #faad14; }
/* v13.9: 计费标签 */
.vq-cost-tag {
  display: inline-block;
  font-size: 10px;
  color: #faad14;
  background: rgba(250,173,20,0.12);
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
}
/* v13.39.0: 积分预留/结算状态 */
.vq-cost-tag.vq-cost-settled {
  color: #52c41a;
  background: rgba(82,196,26,0.12);
}
.vq-cost-tag.vq-cost-reserved {
  color: rgba(250,173,20,0.6);
  background: rgba(250,173,20,0.06);
  font-style: italic;
}
.vq-td-cost { text-align: center; font-size: 11px; width: 60px; }
.vq-col-cost { width: 60px; font-size: 10px; }

/* v13.39.0: 模型类型标签 */
.vq-td-model { text-align: center; }
.vq-model-tag {
  display: inline-block;
  font-size: 9px;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.06);
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vq-model-tag.seedance { color: #4f9cf9; background: rgba(79,156,249,0.1); }
.vq-model-tag.wan2\.2, .vq-model-tag.wan2_2 { color: #52c41a; background: rgba(82,196,26,0.1); }
.vq-model-tag.gpt-image2 { color: #b44ff9; background: rgba(180,79,249,0.1); }
.vq-icon-done { color: #52c41a; font-size: 12px; }
.vq-icon-error { color: #ff4d4f; font-size: 12px; }

/* ── GPU 状态面板 ── */
.vq-gpu-panel {
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.vq-gpu-header {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.vq-gpu-grid {
  display: flex;
  gap: 8px;
}
.vq-gpu-card {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 6px 8px;
  transition: border-color 0.3s;
}
.vq-gpu-card.throttled {
  border-color: rgba(255,77,79,0.3);
  background: rgba(255,77,79,0.04);
}
.vq-gpu-label {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
  font-weight: 600;
}
.vq-gpu-meter {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin-bottom: 4px;
  overflow: hidden;
}
.vq-gpu-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease, background 0.5s ease;
  min-width: 0;
}
.vq-gpu-stats {
  display: flex;
  gap: 6px;
  font-size: 8px;
  color: rgba(255,255,255,0.35);
}
.vq-gpu-stats span {
  white-space: nowrap;
}

/* ── 历史记录区分线 ── */
.vq-section-divider {
  padding: 8px 14px 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.vq-section-label {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vq-list-history {
  max-height: 200px;
}
/* ── 空状态图标 ── */
.vq-empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.4;
}
/* 右侧队列面板收缩按钮（在 video-editor-body 中，始终可见） */
.video-queue-toggle {
  position: absolute;
  right: 320px;  /* 面板展开时贴在面板左边缘 */
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 48px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: right 0.3s ease;
  z-index: 100;
  flex-shrink: 0;
}
.video-queue-toggle:hover { background: rgba(99,102,241,0.2); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.video-queue-toggle.active { background: rgba(79,156,249,0.15); color: #4f9cf9; }
/* 面板收起时，按钮贴到右边缘 */
.video-queue-toggle:not(.open) {
  right: 0;
}
.vq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

/* ================================================================
 * 图片生成样式 (ImageGen — 即梦风格)
 * ================================================================ */

/* 图片生成提示词输入框 */
.img-prompt-textarea:focus,
.img-neg-textarea:focus {
  outline: none;
  border-color: rgba(99,102,241,0.6) !important;
  background: rgba(255,255,255,0.08) !important;
}
.img-prompt-textarea::placeholder { color: rgba(255,255,255,0.25); }
.img-neg-textarea::placeholder { color: rgba(255,255,255,0.2); }

/* 风格芯片 */
.vp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vp-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  white-space: nowrap;
}
.vp-chip:hover {
  border-color: rgba(99,102,241,0.4);
  color: rgba(255,255,255,0.8);
}
.vp-chip.active {
  border-color: #6366f1;
  background: rgba(99,102,241,0.2);
  color: #e2e8f0;
  font-weight: 600;
}

/* 图片结果卡片 hover 效果 */
.img-result-card:hover {
  border-color: rgba(99,102,241,0.5) !important;
  box-shadow: 0 4px 20px rgba(99,102,241,0.2);
}
.img-result-card:hover .img-result-actions {
  opacity: 1;
}

/* ================================================================
 * 图像工厂新增：白色主题布局兼容
 * ================================================================ */
.video-editor-content {
  display: flex;
  flex: 1;
  min-height: 0;
}
.video-editor-content > .video-settings-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}
.video-editor-content > .video-preview-area {
  width: 380px;
  min-width: 320px;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
}
.video-form-group { margin-bottom: 12px; }
.video-form-label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 500; }
.video-form-input { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.video-form-select { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; }
.video-form-textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 13px; resize: vertical; font-family: inherit; box-sizing: border-box; }
.video-form-slider { display: flex; align-items: center; gap: 8px; }
.video-form-slider input[type="range"] { flex: 1; }
.video-form-slider .value { font-size: 12px; color: var(--primary-color); font-weight: 600; min-width: 30px; }
.video-settings-section { margin-bottom: 16px; }
.video-settings-section-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 8px; }
.video-generate-btn { width: 100%; padding: 12px; border: none; border-radius: 8px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.video-generate-btn:disabled { background: #d9d9d9; cursor: not-allowed; color: #999; }
.video-generation-progress { margin-top: 8px; }
.video-generation-progress .progress-bar { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.video-generation-progress .progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 0.3s; border-radius: 3px; }
.video-generation-result { margin-top: 8px; text-align: center; }
.download-btn { padding: 8px 16px; border: 1px solid #10b981; border-radius: 6px; background: #fff; color: #10b981; cursor: pointer; font-size: 13px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
 * 远程协作 (CLI) 模式样式
 * ================================================================ */
.cli-mode-container .chat-msg { margin-bottom: 14px; animation: cli-msg-in 0.25s ease; }
@keyframes cli-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.cli-mode-container .chat-msg .msg-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cli-mode-container .chat-msg .msg-role { font-size: 12px; font-weight: 600; }
.cli-mode-container .chat-msg .msg-content { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.8); }
.cli-mode-container .chat-msg.chat-user .msg-content { color: #a5b4fc; }
.cli-mode-container .chat-msg.chat-ai .msg-content { color: #00d4ff; }
.cli-mode-container .chat-msg.chat-system .msg-content { color: rgba(255,255,255,0.6); }
.cli-mode-container .chat-msg.chat-progress .msg-content { color: #a78bfa; }
.cli-mode-container .tree-node { transition: background 0.15s; border-radius: 4px; }
.cli-mode-container .tree-node:hover { background: rgba(255,255,255,0.06); }

/* ═══ 故事板编辑器（v8.0） ═══ */
.storyboard-editor {
  display: flex; flex-direction: column; gap: 16px;
  padding: 12px 0;
}
.sb-section {
  background: rgba(255,255,255,0.03); border-radius: 10px;
  padding: 14px; border: 1px solid rgba(255,255,255,0.06);
}
.sb-section-title {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
}
.sb-ref-list {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.sb-ref-item {
  position: relative; width: 64px; height: 64px;
  border-radius: 8px; overflow: hidden; background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}
.sb-ref-item img { width: 100%; height: 100%; object-fit: cover; }
.sb-ref-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.7); font-size: 10px; text-align: center;
  padding: 2px 0; color: rgba(255,255,255,0.6);
}
.sb-ref-remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,0,0,0.7); color: #fff; border: none;
  font-size: 10px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.sb-ref-add {
  width: 64px; height: 64px; border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.4); font-size: 12px;
  transition: all 0.2s;
}
.sb-ref-add:hover { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.6); }
.sb-shot {
  background: rgba(0,0,0,0.2); border-radius: 8px;
  padding: 12px; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.sb-shot-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.sb-shot-num {
  font-size: 12px; font-weight: 600; color: #a78bfa;
}
.sb-shot-actions {
  display: flex; gap: 4px;
}
.sb-shot-actions button {
  width: 26px; height: 26px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
  font-size: 11px; transition: all 0.15s;
}
.sb-shot-actions button:hover:not(:disabled) {
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8);
}
.sb-shot-actions button:disabled { opacity: 0.3; cursor: default; }
.sb-shot-del:hover { background: rgba(255,0,0,0.2) !important; color: #ff6b6b !important; }
.sb-shot-prompt {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
  color: rgba(255,255,255,0.8); font-size: 13px; padding: 8px 10px;
  resize: vertical; font-family: inherit; line-height: 1.5;
}
.sb-shot-prompt:focus { outline: none; border-color: #a78bfa; }
.sb-shot-meta {
  margin-top: 8px; display: flex; gap: 16px; font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.sb-shot-meta input {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; color: rgba(255,255,255,0.8); padding: 2px 6px;
  font-size: 12px;
}
.sb-add-shot {
  width: 100%; padding: 10px; border-radius: 8px;
  background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.4);
  border: 1px dashed rgba(255,255,255,0.15); cursor: pointer;
  font-size: 13px; transition: all 0.2s;
}
.sb-add-shot:hover { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.6); }
.storyboard-submit {
  margin-top: 4px; background: linear-gradient(135deg, #7c3aed, #a78bfa) !important;
}

/* ================================================================
 * v13.42.3: ComfyUI 工作流编辑器内嵌模态框
 * ================================================================ */
.comfyui-editor-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.comfyui-editor-modal-content {
  width: 92vw;
  height: 90vh;
  background: #1a1a2e;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.comfyui-editor-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.comfyui-editor-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.04em;
}
.comfyui-editor-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.comfyui-editor-modal-close:hover {
  background: rgba(255, 80, 80, 0.2);
  border-color: rgba(255, 80, 80, 0.3);
  color: rgba(255, 255, 255, 0.9);
}
.comfyui-editor-modal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.comfyui-editor-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.comfyui-editor-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}
.comfyui-editor-modal-footer {
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
