/* 转绘功能页样式(redraw-*.js 配套)。与 .tongflow-workspace 同层级的全屏顶替页。 */

.redraw-workspace {
  --redraw-bg: #0a0d12;
  --redraw-panel: rgba(17, 21, 28, 0.9);
  --redraw-panel-strong: rgba(13, 17, 23, 0.97);
  --redraw-line: rgba(170, 190, 195, 0.16);
  --redraw-copy: #e2e8e5;
  --redraw-muted: rgba(200, 212, 210, 0.55);
  --redraw-accent: #69d1c9;
  --redraw-warm: #d4aa68;
  --redraw-danger: #ff7068;
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--redraw-copy);
  background: var(--redraw-bg);
  isolation: isolate;
}

.redraw-workspace[hidden] { display: none; }

.redraw-workspace.is-open { animation: redraw-workspace-enter 320ms cubic-bezier(.2, .76, .24, 1) both; }

body.redraw-workspace-open { overflow: hidden; }

@keyframes redraw-workspace-enter {
  from { opacity: 0; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

.redraw-workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 12%, rgba(81, 158, 156, 0.07), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(176, 103, 116, 0.05), transparent 28%);
}

/* ---------- 顶栏 ---------- */

.redraw-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--redraw-line);
  background: var(--redraw-panel-strong);
}

.redraw-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--redraw-line);
  border-radius: 6px;
  background: transparent;
  color: var(--redraw-copy);
  cursor: pointer;
}

.redraw-back-button:hover { border-color: var(--redraw-accent); color: var(--redraw-accent); }

.redraw-topbar-title { display: flex; flex-direction: column; min-width: 0; }

.redraw-topbar-title span {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--redraw-muted);
}

.redraw-topbar-title strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.redraw-topbar-actions { display: flex; align-items: center; gap: 8px; }

.redraw-count-badge {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--redraw-accent);
  color: #082423;
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.redraw-topbar-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.redraw-topbar-settings label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--redraw-muted);
}

.redraw-topbar-settings select {
  padding: 5px 8px;
  border: 1px solid var(--redraw-line);
  border-radius: 6px;
  background: var(--redraw-panel);
  color: var(--redraw-copy);
}

/* ---------- 三栏布局 ---------- */

.redraw-layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 320px;
  gap: 10px;
  min-height: 0;
  padding: 10px;
}

.redraw-left,
.redraw-right {
  overflow-y: auto;
  border: 1px solid var(--redraw-line);
  border-radius: 10px;
  background: var(--redraw-panel);
  padding: 10px;
  min-height: 0;
}

.redraw-center {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

/* ---------- 中栏播放器 ---------- */

.redraw-players {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 0;
}

.redraw-player {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 0;
  border: 1px solid var(--redraw-line);
  border-radius: 10px;
  background: var(--redraw-panel);
  overflow: hidden;
}

.redraw-player figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--redraw-muted);
  border-bottom: 1px solid var(--redraw-line);
}

.redraw-source-actions { display: inline-flex; gap: 4px; }

.redraw-source-actions .mini-button[hidden] { display: none; }

.redraw-mute-btn.is-muted { opacity: 0.55; }

.redraw-player-box {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070a;
}

.redraw-player-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.redraw-player-box video[hidden] { display: none; }

.redraw-source-upload {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--redraw-muted);
  border: 1px dashed var(--redraw-line);
  border-radius: 8px;
  margin: 12px;
  transition: color 160ms, border-color 160ms;
}

.redraw-source-upload:hover { color: var(--redraw-accent); border-color: var(--redraw-accent); }

.redraw-source-upload[hidden] { display: none; }

.redraw-player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--redraw-muted);
  pointer-events: none;
}

.redraw-player-empty[hidden] { display: none; }

/* 原片断开黑屏遮罩(同步播放经过插入镜头组时) */

.redraw-source-gap-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: rgba(200, 212, 210, 0.5);
  font-size: 12px;
  letter-spacing: 0.12em;
  z-index: 2;
}

.redraw-source-gap-overlay[hidden] { display: none; }

/* ---------- 时间轨道 ---------- */

.redraw-timeline-host {
  flex: 0 0 190px;
  border: 1px solid var(--redraw-line);
  border-radius: 10px;
  background: var(--redraw-panel);
  padding: 8px 12px;
  overflow: hidden;
}

/* 双轨容器与贯穿游标 */

.redraw-timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.redraw-timeline-toolbar .mini-button.is-active {
  border-color: var(--redraw-warm, #d4aa68);
  color: var(--redraw-warm, #d4aa68);
}

.redraw-timeline-lanes {
  position: relative;
}

.redraw-timeline-playhead-host {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 52px;
  right: 0;
  pointer-events: none;
}

.redraw-timeline-lane {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 6px;
}

.redraw-timeline-lane-tag {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--redraw-muted);
  white-space: nowrap;
}

.redraw-timeline-lane .redraw-timeline-track { flex: 1; }

.redraw-timeline-result.is-empty {
  border-style: dashed;
  --redraw-segment-border: rgba(170, 190, 195, 0.28);
  background: transparent;
  color: var(--redraw-muted);
}

.redraw-timeline-result.has-result {
  --redraw-segment-border: rgba(212, 170, 104, 0.7);
  background: rgba(212, 170, 104, 0.18);
}

/* 用户「通过」标记:淡绿色 */

.redraw-timeline-result.is-approved {
  --redraw-segment-border: rgba(126, 211, 132, 0.75);
  background: rgba(126, 211, 132, 0.22);
}

.redraw-panel-actions .is-approved {
  border-color: rgba(126, 211, 132, 0.75);
  color: #7ed384;
}

.redraw-timeline-result.is-failed {
  --redraw-segment-border: rgba(255, 112, 104, 0.6);
  background: rgba(255, 112, 104, 0.1);
}

/* 原片轨断开灰色块(插入镜头组) */

.redraw-timeline-gap {
  border-style: dashed;
  --redraw-segment-border: rgba(170, 190, 195, 0.3);
  background: repeating-linear-gradient(135deg, rgba(104, 110, 118, 0.82) 0 6px, rgba(76, 82, 90, 0.82) 6px 12px);
  color: rgba(200, 212, 210, 0.45);
  justify-content: center;
  align-items: center;
}

/* 转绘结果超出原片段时,源轨以灰色空缺延长;该区域不参与点击 seek。 */

.redraw-timeline-overflow {
  background: #545a62;
  border-style: dashed;
  --redraw-segment-border: rgba(170, 190, 195, 0.24);
  pointer-events: none;
  cursor: default;
}

.redraw-timeline-source-missing {
  pointer-events: none;
  cursor: default;
  z-index: 1;
}

.redraw-timeline-result.is-sourceless { border-style: solid; }

/* 片段边界悬浮 + 插入按钮 */

.redraw-timeline-insert {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--redraw-accent, #69d1c9);
  background: rgba(8, 12, 15, 0.92);
  color: var(--redraw-accent, #69d1c9);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.redraw-timeline-track:hover .redraw-timeline-insert {
  opacity: 1;
  pointer-events: auto;
}

.redraw-timeline-insert:hover {
  background: var(--redraw-accent, #69d1c9);
  color: #082423;
}

.redraw-timeline-ruler {
  position: relative;
  height: 18px;
  margin-bottom: 6px;
  margin-left: 52px;
  font-size: 10px;
  color: var(--redraw-muted);
}

.redraw-timeline-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.redraw-timeline-mark i {
  display: block;
  width: 1px;
  height: 5px;
  margin: 0 auto 1px;
  background: var(--redraw-line);
}

.redraw-timeline-track {
  position: relative;
  height: 48px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--redraw-line);
  cursor: pointer;
}

.redraw-timeline-segment {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  /* 窄片段不能被左右内边距撑宽，否则接缝处会覆盖相邻色块。 */
  padding: 2px 0;
  --redraw-segment-border: rgba(105, 209, 201, 0.4);
  border: 0;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--redraw-segment-border);
  background: rgba(105, 209, 201, 0.12);
  color: var(--redraw-copy);
  font-size: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: background 140ms, box-shadow 140ms;
}

.redraw-timeline-segment:hover { background: rgba(105, 209, 201, 0.22); }

.redraw-timeline-segment.is-active {
  --redraw-segment-border: var(--redraw-accent);
  background: rgba(105, 209, 201, 0.3);
  box-shadow: 0 0 0 1px var(--redraw-accent) inset;
}

.redraw-timeline-gap,
.redraw-timeline-gap:hover,
.redraw-timeline-gap.is-active {
  --redraw-segment-border: rgba(170, 190, 195, 0.3);
  background: repeating-linear-gradient(135deg, rgba(104, 110, 118, 0.82) 0 6px, rgba(76, 82, 90, 0.82) 6px 12px);
  box-shadow: inset 0 0 0 1px var(--redraw-segment-border);
}

.redraw-timeline-segment.has-result { --redraw-segment-border: rgba(212, 170, 104, 0.66); }

.redraw-timeline-segment.is-generating {
  --redraw-segment-border: var(--redraw-warm);
  animation: redraw-segment-pulse 1.2s ease-in-out infinite;
}

@keyframes redraw-segment-pulse {
  0%, 100% { background: rgba(212, 170, 104, 0.12); }
  50% { background: rgba(212, 170, 104, 0.3); }
}

.redraw-timeline-segment-label { font-weight: 700; }

.redraw-timeline-segment-time { color: var(--redraw-muted); font-size: 9px; }

.redraw-timeline-playhead {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 2px;
  background: var(--redraw-warm);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(212, 170, 104, 0.7);
}

.redraw-timeline-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
  color: var(--redraw-muted);
}

/* ---------- 左栏资产 ---------- */

.redraw-asset-toolbar { margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }

.redraw-asset-toolbar-row { display: flex; gap: 8px; }

.redraw-asset-toolbar-row label { flex: 1; }

.redraw-asset-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--redraw-muted);
}

.redraw-asset-toolbar select {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--redraw-line);
  border-radius: 6px;
  background: var(--redraw-panel-strong);
  color: var(--redraw-copy);
}

.redraw-asset-group { margin-bottom: 14px; }

.redraw-asset-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.redraw-asset-group-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.redraw-asset-group-list .redraw-asset-empty { grid-column: 1 / -1; }

.redraw-asset-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--redraw-muted);
  text-align: center;
  border: 1px dashed var(--redraw-line);
  border-radius: 8px;
}

.redraw-asset-card {
  position: relative;
  border: 1px solid var(--redraw-line);
  border-radius: 8px;
  background: var(--redraw-panel-strong);
  overflow: hidden;
}

.redraw-asset-card.is-generating { border-color: var(--redraw-warm); }

.redraw-asset-card.is-paste-preview-target,
.redraw-staging.is-paste-preview-target {
  border-color: var(--redraw-accent);
  box-shadow: 0 0 0 2px rgba(105, 209, 201, 0.2), 0 0 20px rgba(105, 209, 201, 0.16);
  animation: redraw-paste-target-pulse 1.25s ease-in-out infinite;
}

.redraw-asset-card.is-dragover,
.redraw-staging.is-dragover {
  border-color: var(--redraw-warm);
  box-shadow: 0 0 0 2px rgba(212, 170, 104, 0.25), 0 0 22px rgba(212, 170, 104, 0.2);
}

@keyframes redraw-paste-target-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.redraw-asset-thumb {
  position: relative;
  height: 96px;
  cursor: pointer;
  background: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redraw-paste-target-label {
  position: absolute;
  z-index: 2;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 4px 6px;
  border: 1px solid rgba(105, 209, 201, 0.65);
  border-radius: 5px;
  background: rgba(5, 10, 13, 0.9);
  color: var(--redraw-accent);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.redraw-staging { position: relative; }

.redraw-staging > .redraw-paste-target-label {
  left: 8px;
  right: 8px;
  bottom: 8px;
}

.redraw-asset-card.is-paste-preview-target .redraw-paste-target-label,
.redraw-staging.is-paste-preview-target .redraw-paste-target-label {
  opacity: 1;
  transform: translateY(0);
}

.redraw-asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.redraw-asset-thumb-empty { font-size: 12px; color: var(--redraw-muted); }

.redraw-asset-thumb-failed {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(188, 87, 77, 0.85);
  font-size: 10px;
}

.redraw-asset-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
}

.redraw-asset-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.redraw-asset-actions { display: flex; gap: 4px; }

.redraw-workspace .mini-button,
.redraw-modal .mini-button {
  padding: 3px 8px;
  border: 1px solid var(--redraw-line, rgba(170, 190, 195, 0.16));
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 140ms, color 140ms;
}

.redraw-workspace .mini-button:hover:not(:disabled),
.redraw-modal .mini-button:hover:not(:disabled) { border-color: var(--redraw-accent, #69d1c9); color: var(--redraw-accent, #69d1c9); }

.redraw-workspace .mini-button:disabled,
.redraw-modal .mini-button:disabled { opacity: 0.5; cursor: default; }

.redraw-workspace .mini-button.is-danger:hover,
.redraw-modal .mini-button.is-danger:hover { border-color: var(--redraw-danger, #ff7068); color: var(--redraw-danger, #ff7068); }

.redraw-asset-upload { display: inline-flex; cursor: pointer; }

.redraw-asset-audio {
  position: absolute;
  z-index: 3;
  left: 6px;
  top: 6px;
  display: inline-grid;
  min-width: 56px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(8, 12, 15, 0.82);
  border: 1px solid var(--redraw-line);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  color: var(--redraw-muted);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.redraw-asset-audio > span { grid-area: 1 / 1; transition: opacity 140ms ease; }

.redraw-asset-audio-drop-hint { opacity: 0; }

.redraw-asset-audio.has-audio { color: var(--redraw-accent); border-color: rgba(105, 209, 201, 0.5); }

.redraw-asset-audio.is-audio-dragover {
  color: var(--redraw-warm);
  border-color: var(--redraw-warm);
  background: rgba(23, 18, 10, 0.94);
  box-shadow: 0 0 0 2px rgba(212, 170, 104, 0.22);
}

.redraw-asset-audio.is-audio-dragover .redraw-asset-audio-value { opacity: 0; }
.redraw-asset-audio.is-audio-dragover .redraw-asset-audio-drop-hint { opacity: 1; }

/* ---------- 右栏 ---------- */

.redraw-panel-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.redraw-panel-title span { font-size: 12px; color: var(--redraw-muted); }

.redraw-panel-status { font-size: 11px; }

.redraw-panel-status[data-status="generating"] { color: var(--redraw-warm); }

.redraw-panel-status[data-status="failed"] { color: var(--redraw-danger); }

.redraw-panel-status[data-status="done"] { color: var(--redraw-accent); }

.redraw-panel-delete { margin-left: auto; }

.redraw-panel-block {
  margin-bottom: 12px;
  border: 1px solid var(--redraw-line);
  border-radius: 8px;
  background: var(--redraw-panel-strong);
  padding: 8px;
}

.redraw-panel-block > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}

.redraw-block-hint { font-size: 10px; color: var(--redraw-muted); }

.redraw-staging-header {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 3px !important;
}

.redraw-staging-header .redraw-block-hint {
  display: block;
  line-height: 1.35;
}

.redraw-staging-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.redraw-staging-chip {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid var(--redraw-line);
  border-radius: 6px;
  overflow: hidden;
  background: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.redraw-staging-chip img { width: 100%; height: 100%; object-fit: cover; }

.redraw-staging-chip i { font-size: 10px; color: var(--redraw-muted); }

.redraw-staging-chip button {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0 0 0 6px;
  background: rgba(8, 10, 14, 0.8);
  color: var(--redraw-copy);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.redraw-staging-chip button:hover { color: var(--redraw-danger); }

.redraw-staging-add {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--redraw-line);
  border-radius: 6px;
  color: var(--redraw-muted);
  cursor: pointer;
  font-size: 18px;
}

.redraw-staging-add:hover { color: var(--redraw-accent); border-color: var(--redraw-accent); }

.redraw-binding-list { display: flex; flex-direction: column; gap: 6px; }

.redraw-binding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.redraw-binding-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.redraw-binding-toggles { display: flex; gap: 4px; }

.redraw-toggle {
  padding: 2px 8px;
  border: 1px solid var(--redraw-line);
  border-radius: 10px;
  background: transparent;
  color: var(--redraw-muted);
  font-size: 10px;
  cursor: pointer;
}

.redraw-toggle.is-on {
  color: #082423;
  background: var(--redraw-accent);
  border-color: var(--redraw-accent);
}

.redraw-toggle:disabled { opacity: 0.45; cursor: default; }

.redraw-prompt-block textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--redraw-line);
  border-radius: 6px;
  background: rgba(5, 7, 10, 0.7);
  color: var(--redraw-copy);
  padding: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.redraw-panel-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* 生成时长滑条 */

.redraw-duration-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.redraw-duration-row input[type="range"] {
  flex: 1;
  accent-color: var(--redraw-accent, #69d1c9);
}

.redraw-duration-value {
  flex: 0 0 auto;
  min-width: 64px;
  text-align: right;
  font-size: 12px;
  color: var(--redraw-warm, #d4aa68);
}

.redraw-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.redraw-history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid var(--redraw-line);
  border-radius: 6px;
  font-size: 11px;
}

.redraw-history-item.is-primary { border-color: rgba(212, 170, 104, 0.7); background: rgba(212, 170, 104, 0.08); }

.redraw-history-play {
  width: 22px;
  height: 22px;
  border: 1px solid var(--redraw-line);
  border-radius: 50%;
  background: transparent;
  color: var(--redraw-copy);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.redraw-history-play:hover { border-color: var(--redraw-accent); color: var(--redraw-accent); }

.redraw-history-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.redraw-history-meta { color: var(--redraw-muted); font-size: 10px; }

/* ---------- 通用弹窗 ---------- */

.redraw-modal {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redraw-modal[hidden] { display: none; }

.redraw-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(3px);
}

.redraw-modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-width: min(92vw, 860px);
  max-height: 88vh;
  border: 1px solid var(--redraw-line, rgba(170, 190, 195, 0.16));
  border-radius: 12px;
  background: #0d1117;
  color: #e2e8e5;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.redraw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(170, 190, 195, 0.16);
}

/* 全集反推弹窗 */

.redraw-fr-card { width: min(92vw, 860px); }

.redraw-fr-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1;
}

.redraw-fr-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid rgba(170, 190, 195, 0.16);
  overflow-y: auto;
}

.redraw-fr-slots label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: rgba(200, 212, 210, 0.66);
}

.redraw-fr-slots input[type="text"],
.redraw-fr-slots input[type="number"],
.redraw-fr-slots textarea,
.redraw-fr-slots select {
  padding: 6px 8px;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 6px;
  background: rgba(5, 7, 10, 0.7);
  color: #e2e8e5;
  font-size: 12px;
}

.redraw-fr-check {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
}

.redraw-fr-cost { margin: 0; font-size: 11px; color: #d4aa68; }

.redraw-fr-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.redraw-fr-actions [hidden] { display: none !important; }

.redraw-fr-result {
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 8px;
  overflow-y: auto;
  min-height: 320px;
}

.redraw-fr-status {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.redraw-fr-status[data-tone="failed"] { color: #ff7068; }

.redraw-fr-status[data-tone="done"] { color: #69d1c9; }

.redraw-fr-warnings p { margin: 0 0 4px; font-size: 11px; color: #d4aa68; }

.redraw-fr-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.redraw-fr-chip {
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(170, 190, 195, 0.25);
  font-size: 11px;
}

.redraw-fr-chip[data-kind="person"] { border-color: rgba(105, 209, 201, 0.55); color: #69d1c9; }

.redraw-fr-chip[data-kind="scene"] { border-color: rgba(212, 170, 104, 0.55); color: #d4aa68; }

.redraw-fr-chip[data-kind="prop"] { border-color: rgba(176, 130, 190, 0.55); color: #c39ad0; }

.redraw-fr-seg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(170, 190, 195, 0.14);
  border-radius: 6px;
  font-size: 12px;
}

.redraw-fr-seg[data-status="running"] { border-color: rgba(212, 170, 104, 0.6); }

.redraw-fr-seg[data-status="done"] { border-color: rgba(105, 209, 201, 0.45); }

.redraw-fr-seg[data-status="failed"] { border-color: rgba(255, 112, 104, 0.6); }

.redraw-fr-seg-index { font-weight: 700; }

.redraw-fr-seg-time { color: rgba(200, 212, 210, 0.6); }

.redraw-fr-seg-status {
  margin-left: auto;
  font-size: 11px;
  color: rgba(200, 212, 210, 0.66);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 55%;
}

/* 资产编辑弹窗 */

.redraw-asset-editor-card { width: min(92vw, 760px); }

.redraw-asset-editor-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.redraw-asset-editor-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid rgba(170, 190, 195, 0.16);
  overflow-y: auto;
}

.redraw-asset-editor-image {
  position: relative;
  min-height: 200px;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 8px;
  background: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.redraw-asset-editor-image.has-image { cursor: zoom-in; }

.redraw-asset-editor-image img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: contain;
}

.redraw-asset-editor-media-empty {
  font-size: 12px;
  color: rgba(200, 212, 210, 0.55);
  padding: 8px;
  text-align: center;
}

.redraw-asset-editor-audio {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.redraw-asset-editor-audio[hidden] { display: none; }

.redraw-asset-editor-audio audio { width: 100%; height: 32px; }

.redraw-asset-editor-audio-name {
  font-size: 11px;
  color: #69d1c9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 图片放大层 */

.redraw-image-zoom {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 8, 0.88);
  cursor: zoom-out;
}

.redraw-image-zoom[hidden] { display: none; }

.redraw-image-zoom img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

/* 转绘页打开时魇月自有媒体预览层要盖过转绘工作区(1600)与弹窗(1700)。 */
body.redraw-workspace-open .media-preview-layer { z-index: 1900; }

.redraw-asset-editor-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  overflow-y: auto;
}

.redraw-asset-editor-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: rgba(200, 212, 210, 0.66);
}

.redraw-asset-editor-body input,
.redraw-asset-editor-body textarea {
  padding: 7px 9px;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 6px;
  background: rgba(5, 7, 10, 0.7);
  color: #e2e8e5;
  font-size: 12px;
  line-height: 1.5;
}

.redraw-asset-editor-actions { display: flex; gap: 8px; }

.redraw-asset-editor-actions .is-danger { margin-left: auto; }

/* 字幕逐条卡片 */

.redraw-prompt-zoom-subtitle-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.7);
  padding: 8px;
}

.redraw-subtitle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(170, 190, 195, 0.14);
  border-radius: 6px;
  background: rgba(13, 17, 23, 0.8);
}

.redraw-subtitle-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.redraw-subtitle-item-meta {
  font-size: 10px;
  color: rgba(200, 212, 210, 0.5);
}

.redraw-subtitle-item-text {
  font-size: 12px;
  color: #cfe0dd;
  line-height: 1.5;
  word-break: break-word;
}

.redraw-subtitle-item .mini-button { flex: 0 0 auto; }

/* 提示词放大弹窗(三段式:画面 1 : 字幕 1 : 提示词 3) */

.redraw-prompt-zoom-card {
  width: min(98vw, 1900px);
  /* 覆盖基类 .redraw-modal-card 的 max-width: min(92vw, 860px) 钳制。 */
  max-width: 98vw;
  height: min(96vh, 1100px);
  max-height: 96vh;
}

.redraw-prompt-zoom-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 3fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 14px 16px 16px;
}

.redraw-prompt-zoom-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.redraw-prompt-zoom-videobox {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 8px;
  background: #05070a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redraw-prompt-zoom-videobox video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.redraw-prompt-zoom-videohint {
  position: absolute;
  left: 8px;
  top: 6px;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(8, 10, 14, 0.75);
  font-size: 11px;
  color: #d4aa68;
  pointer-events: none;
}

.redraw-prompt-zoom-subtitle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.redraw-prompt-zoom-subtitle header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(200, 212, 210, 0.66);
}

.redraw-prompt-zoom-subtitle textarea {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.7);
  color: #cfe0dd;
  padding: 8px;
  font-size: 12px;
  line-height: 1.6;
}

.redraw-prompt-zoom-card #redrawPromptZoomText {
  min-height: 0;
  resize: none;
  border: 1px solid rgba(170, 190, 195, 0.2);
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.7);
  color: #e2e8e5;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .redraw-prompt-zoom-layout { grid-template-columns: 1fr; }
  .redraw-prompt-zoom-videobox video { max-height: 180px; }
}

/* 窄屏适配 */

@media (max-width: 1180px) {
  .redraw-layout { grid-template-columns: 210px minmax(0, 1fr) 280px; }
}

@media (max-width: 960px) {
  .redraw-layout {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(200px, auto);
    overflow-y: auto;
  }
  .redraw-players { grid-template-columns: 1fr; }
  .redraw-fr-body { grid-template-columns: 1fr; }
  .redraw-fr-slots { border-right: 0; border-bottom: 1px solid rgba(170, 190, 195, 0.16); }
}
