:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #fbfbff;
  --text: #161827;
  --muted: #80879a;
  --line: #e7e9f2;
  --line-strong: #d9ddea;
  --primary: #6d5dfc;
  --primary2: #8b5cf6;
  --danger: #ef476f;
  --success: #19b57a;
  --warning: #e7a800;
  --blue: #3b82f6;
  --shadow: 0 18px 45px rgba(28, 32, 74, .08);
  --shadow-strong: 0 18px 55px rgba(95, 78, 255, .18);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  height: 72px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  backdrop-filter: blur(18px);
  z-index: 50;
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.gem-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: transparent;
  background: radial-gradient(circle at 30% 30%, #ffd97a 0%, #ffb24c 38%, #ff8f3c 66%, #ff6f3d 100%);
  box-shadow: 0 12px 24px rgba(255,133,53,.28);
}

.brand h1 { margin: 0; font-size: 21px; letter-spacing: .2px; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.top-nav { flex: 1; display: flex; justify-content: center; gap: 8px; align-items: center; }
.nav-btn {
  min-width: 78px;
  padding: 10px 14px;
  color: #777b8d;
  background: transparent;
  border-radius: 12px;
  font-weight: 700;
}
.nav-btn.active,
.nav-btn:hover { background: var(--primary); color: white; box-shadow: 0 8px 18px rgba(109,93,252,.25); }
.nav-btn.disabled { opacity: .58; cursor: default; }
.nav-btn.disabled:hover { background: transparent; color: #777b8d; box-shadow: none; }
.status-pill {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.status-pill.ok { color: var(--success); border-color: rgba(25,181,122,.35); background: rgba(25,181,122,.08); }
.status-pill.bad { color: var(--danger); border-color: rgba(239,71,111,.35); background: rgba(239,71,111,.08); }
.status-pill.warn { color: var(--warning); border-color: rgba(231,168,0,.35); background: rgba(231,168,0,.08); }
.content { flex: 1; min-height: 0; overflow: hidden; }
.tab { display: none; height: 100%; }
.tab.active { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* Main Ai-vision style workspace */
.studio-tab { padding: 18px 22px; }
.studio-layout {
  height: calc(100vh - 108px);
  display: grid;
  grid-template-columns: 455px minmax(0, 1fr);
  gap: 20px;
}
.composer-panel,
.preview-panel .card-lite,
.settings-page-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.composer-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.composer-scroll {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 0;
  scrollbar-width: thin;
}
.composer-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.92), #fff 32%);
  padding: 12px 22px 18px;
  z-index: 5;
}
.field-grid { display: grid; gap: 14px; }
.two-cols { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 8px; color: #171827; font-weight: 800; font-size: 14px; margin: 0; }
small { color: var(--muted); line-height: 1.45; font-weight: 500; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  box-shadow: 0 10px 24px rgba(24, 26, 51, .05);
}
select { appearance: auto; }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; box-shadow: none; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(109,93,252,.11); }
.required { color: #ff4c7d; }
.prompt-area { margin-top: 16px; }
.prompt-area textarea { min-height: 315px; border-radius: 0 0 14px 14px; border-top-color: var(--line); }
.prompt-area small { display: inline; margin-left: 4px; }

.ratio-picks { margin-top: 14px; display: grid; gap: 10px; }
.ratio-picks > span { font-size: 14px; font-weight: 900; }
.sr-ratio-select { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ratio-buttons { display: flex; gap: 9px; flex-wrap: wrap; }
.ratio-buttons button {
  width: 50px;
  height: 60px;
  border-radius: 10px;
  background: #f3efff;
  color: #555b70;
  border: 1px solid #ece7ff;
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 800;
}
.ratio-buttons button.active { background: #eee9ff; color: var(--primary); border-color: #d5c9ff; box-shadow: inset 0 0 0 1px #c6b8ff; }
.ratio-buttons i { display: block; border: 2px solid #b6a9d8; border-radius: 3px; background: rgba(109,93,252,.06); }
.r-4-3 { width: 25px; height: 20px; }
.r-9-16 { width: 16px; height: 27px; }
.r-3-4 { width: 19px; height: 26px; }
.r-16-9 { width: 28px; height: 17px; }
.r-1-1 { width: 24px; height: 24px; }
.r-21-9 { width: 31px; height: 14px; }

.mini-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.checkline { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #4e5366; }
.checkline input { width: 17px; height: 17px; box-shadow: none; }
.compact-check { padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfbff; }
.collapsed-lite { margin-top: 12px; }
.collapsed-lite textarea { min-height: 74px; }
.smart-panel { margin: 14px 0 16px; padding: 12px; border-radius: 16px; background: #f7fbff; border: 1px solid #dbeafe; }
.slim-smart { margin-bottom: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.section-head h3 { margin: 0 0 6px; font-size: 20px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.flat-head { margin-bottom: 10px; }
.flat-head strong { display: block; margin-bottom: 4px; }

.preview-panel { min-height: 0; display: grid; grid-template-rows: 250px minmax(0, 1fr); gap: 16px; }
.card-lite { min-width: 0; overflow: hidden; }
.reference-strip { padding: 18px 18px 12px; }
.result-stage { padding: 18px; min-height: 0; display: flex; flex-direction: column; }
.stage-head { flex: 0 0 auto; }
.upload-and-options { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; align-items: stretch; }
.upload-box {
  border: 1px dashed #cbcfe0;
  border-radius: 14px;
  padding: 14px;
  background: #fcfcff;
  text-align: center;
  min-height: 90px;
  display: grid;
  place-items: center;
}
.upload-box input { border: none; box-shadow: none; padding: 6px; }
.upload-box p { margin: 2px 0 4px; font-weight: 900; color: var(--primary); }
.upload-box.dragover { border-color: var(--primary); background: #f4f1ff; }
.upload-options { display: grid; gap: 8px; }
.upload-options label textarea { min-height: 60px; }
.queue-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wrap-actions { justify-content: flex-end; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions-row.left { justify-content: flex-start; }
.no-sticky { position: static; padding: 0; background: transparent; margin: 10px 0 0; }
button {
  border-radius: 11px;
  padding: 10px 13px;
  color: #fff;
  font-weight: 900;
  background: #e9ecf4;
  color: #343849;
}
button.primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; box-shadow: var(--shadow-strong); }
button.secondary { background: #eef1f7; color: #3a4053; border: 1px solid #dfe3ef; }
button.ghost { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
button.danger { background: #fff0f4; color: #d92959; border: 1px solid #ffd3df; }
button:disabled { opacity: .55; cursor: not-allowed; }
.one-click-btn { min-width: 126px; font-size: 15px; padding: 12px 20px; }
.inline-result {
  margin-top: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--line);
  background: #fbfbff;
  color: var(--muted);
  white-space: pre-wrap;
}
.inline-result.ok { color: #087349; border-color: rgba(25,181,122,.28); background: rgba(25,181,122,.07); }
.inline-result.warn { color: #8a6500; border-color: rgba(231,168,0,.35); background: rgba(231,168,0,.08); }
.inline-result.bad { color: #b91c47; border-color: rgba(239,71,111,.35); background: rgba(239,71,111,.08); }
.inline-result.info { color: #245a97; border-color: #dbeafe; background: #f4f8ff; }
.hidden { display: none !important; }
.warning { border: 1px solid rgba(231,168,0,.35); color: #8a6500; background: rgba(231,168,0,.08); padding: 10px; border-radius: 12px; margin-top: 10px; }

/* Reference gallery: horizontal, no long vertical scrolling */
.image-list { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; overflow-y: hidden; padding: 2px 4px 8px; min-height: 0; }
.image-list:empty { display: none; }
.image-item {
  flex: 0 0 210px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  padding: 9px;
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.image-item-head { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.image-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card-actions { display: flex; gap: 5px; flex-wrap: nowrap; }
.image-item img { width: 100%; height: 75px; object-fit: contain; background: #f6f7fb; border: 1px solid var(--line); border-radius: 9px; }
.image-item code { display: block; word-break: break-all; max-height: 34px; overflow: auto; color: #526079; }
.ref-card .tag-label { gap: 4px; font-size: 12px; }
.ref-card .tag-label input { padding: 7px 8px; border-radius: 9px; font-size: 12px; box-shadow: none; }
.mini-btn { padding: 6px 7px; border-radius: 8px; font-size: 12px; white-space: nowrap; background: #eef6ff; color: #2563eb; border: 1px solid #dbeafe; }
.danger-mini { background: #fff0f4; color: #d92959; border-color: #ffd3df; }

/* Queue / generated video display in stage */
.task-list { display: grid; gap: 12px; overflow: auto; padding: 2px 4px 12px; min-height: 0; }
.result-stage .task-list { flex: 1; }
.task-list.empty { color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: 18px; min-height: 100%; place-items: center; align-content: center; background: linear-gradient(180deg, #fff, #fbfbff); }
.stage-empty { display: grid !important; }
.stage-empty strong { display: block; font-size: 18px; margin: 4px 0; color: #5c6377; }
.stage-empty span { display: block; font-size: 13px; color: var(--muted); }
.empty-spinner { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: #f1f2f8; color: #aaaec1; font-size: 24px; }
.task-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; box-shadow: 0 10px 26px rgba(28,32,74,.06); }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.task-title { font-weight: 900; color: #202436; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { padding: 5px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); background: #f8fafc; white-space: nowrap; }
.badge.running { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }
.badge.done { color: #087349; border-color: rgba(25,181,122,.28); background: rgba(25,181,122,.07); }
.badge.fail { color: #b91c47; border-color: rgba(239,71,111,.35); background: rgba(239,71,111,.08); }
.task-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 10px; }
.task-body { margin-top: 10px; color: #4e5366; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.task-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.video-result { margin-top: 12px; border-radius: 16px; overflow: hidden; background: #0b1020; border: 1px solid #10172a; }
.video-result video { display: block; width: 100%; max-height: 480px; background: #0b1020; }
.video-result .video-caption { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; color: #dbeafe; font-size: 12px; }

/* Settings and history */
.settings-page-card {
  margin: 18px 22px;
  height: calc(100vh - 108px);
  overflow: auto;
  padding: 22px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setup-grid { grid-template-columns: 1fr 1fr; }
.path-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.slim-path-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.settings-check { align-self: end; }
.note { border: 1px solid #dbeafe; background: #f4f8ff; color: #245a97; border-radius: 16px; padding: 14px; display: grid; gap: 7px; margin-top: 18px; line-height: 1.55; }
.note code { word-break: break-all; }
.manual-query { margin: 10px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfbff; }
.recover-panel-visible { border-color: #dbeafe; background: #f4f8ff; }
.recover-panel-visible h3 { margin: 0 0 8px; color: #245a97; }
.recover-panel-visible p { margin: 0 0 12px; color: #5b6d8e; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 460px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #151827;
  color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  font-weight: 800;
  z-index: 100;
}
code { word-break: break-all; }

@media (max-width: 1260px) {
  body { overflow: auto; }
  .content { overflow: visible; }
  .studio-layout { height: auto; grid-template-columns: 1fr; }
  .composer-panel { height: auto; }
  .preview-panel { grid-template-rows: auto minmax(520px, auto); }
  .settings-page-card { height: auto; }
}
@media (max-width: 820px) {
  .app-header { height: auto; padding: 12px; flex-wrap: wrap; }
  .brand { min-width: 0; }
  .top-nav { order: 3; justify-content: flex-start; overflow-x: auto; width: 100%; }
  .studio-tab { padding: 12px; }
  .studio-layout { height: auto; }
  .two-cols, .form-grid, .setup-grid, .upload-and-options { grid-template-columns: 1fr; }
  .mini-controls { grid-template-columns: 1fr; }
  .prompt-area textarea { min-height: 240px; }
  .composer-scroll { padding: 16px; }
  .reference-strip, .result-stage { padding: 14px; }
  .settings-page-card { margin: 12px; }
}

/* V8 multi-user workspace */
.workspace-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, rgba(117, 90, 220, .18), rgba(245, 247, 252, .96) 45%, rgba(245, 247, 252, .98));
  backdrop-filter: blur(6px);
}
.workspace-gate.hidden { display: none; }
.workspace-card {
  width: min(460px, calc(100vw - 32px));
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(124, 103, 214, .22);
  border-radius: 26px;
  padding: 32px;
  box-shadow: 0 24px 70px rgba(51, 47, 89, .18);
  display: grid;
  gap: 14px;
}
.workspace-card h2 { margin: 0; font-size: 26px; color: #1b1b2f; }
.workspace-card p { margin: 0 0 6px; color: #70758a; line-height: 1.6; }
.workspace-card label { display: grid; gap: 8px; font-weight: 700; color: #1d2337; }
.workspace-card input {
  width: 100%;
  border: 1px solid #dedff0;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  background: #fff;
}
.gem-logo.large { width: 52px; height: 52px; font-size: 24px; }
.wide-btn { width: 100%; justify-content: center; }
.header-right-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.workspace-pill {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(116, 86, 220, .10);
  color: #5d45bf;
  border: 1px solid rgba(116, 86, 220, .20);
  font-weight: 800;
  white-space: nowrap;
}
.small-nav-btn {
  border: 1px solid rgba(116, 86, 220, .22);
  background: #fff;
  color: #5c4abb;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}
.small-nav-btn:hover { transform: translateY(-1px); }
.small-nav-btn.danger-lite { color: #d92959; border-color: #ffd3df; background: #fff0f4; }
@media (max-width: 900px) {
  .header-right-tools { width: 100%; justify-content: flex-start; }
}

/* V10 visual workspace upgrades */
.ref-strip-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #edf0fb;
  background: #fbfcff;
  border-radius: 14px;
}
.ref-strip-toolbar div { display: flex; align-items: baseline; gap: 10px; color: #677086; font-size: 13px; }
.ref-strip-toolbar strong { color: #1c2440; font-size: 14px; }
.ref-strip-toolbar .ghost.active { background: #efeafd; color: #6f49e8; border-color: #d8ccff; }
.visual-ref-list {
  gap: 12px;
  padding: 10px 4px 12px;
  max-height: 245px;
  align-items: stretch;
  scroll-snap-type: x proximity;
}
.visual-ref-card {
  flex: 0 0 165px;
  padding: 8px;
  border-radius: 18px;
  scroll-snap-align: start;
  box-shadow: 0 12px 32px rgba(27,35,68,.07);
  border-color: #e9ecf8;
  position: relative;
}
.visual-ref-card.matched {
  border-color: rgba(116,86,220,.55);
  box-shadow: 0 15px 38px rgba(116,86,220,.16);
}
.ref-thumb-wrap {
  position: relative;
  height: 112px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg,#f5f7ff,#ffffff);
  border: 1px solid #e9edf8;
}
.ref-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  cursor: zoom-in;
}
.ref-thumb-missing { height: 100%; display: grid; place-items: center; color: #9aa1b7; }
.ref-badge, .ref-hit-badge {
  position: absolute;
  top: 7px;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}
.ref-badge { left: 7px; background: rgba(255,255,255,.82); color: #667085; }
.ref-badge.ok { color: #087349; }
.ref-badge.warn { color: #a86d00; }
.ref-hit-badge { right: 7px; background: rgba(116,86,220,.92); color: #fff; }
.ref-card-title {
  font-weight: 900;
  font-size: 12px;
  color: #1f2945;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.compact-tag { gap: 4px !important; }
.compact-tag span { font-size: 11px; color: #7d8498; }
.compact-tag input { padding: 7px 8px !important; border-radius: 10px !important; font-size: 12px !important; }
.ref-card-actions { justify-content: space-between; }
.empty-ref-filter {
  min-width: 360px;
  padding: 18px;
  border: 1px dashed #d9def0;
  border-radius: 16px;
  color: #6b7280;
  background: #fbfcff;
}
.active-refs-bar {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f4efff;
  color: #5d43c8;
  border: 1px solid #e1d7ff;
  border-radius: 14px;
  font-size: 13px;
}
.active-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ded6ff;
  font-weight: 800;
}
.active-ref-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: rgba(12,17,30,.72);
  backdrop-filter: blur(5px);
}
.image-lightbox-card {
  width: min(860px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  border-radius: 24px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 35px 90px rgba(0,0,0,.32);
  position: relative;
  display: grid;
  gap: 10px;
}
.image-lightbox-card img { width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 16px; background: #f8fafc; }
.image-lightbox-card strong { color: #1d243a; padding: 0 6px 4px; }
.image-lightbox-close {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(12,17,30,.74);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.queue-actions-stack { align-items: flex-end; gap: 8px; }
.queue-tools-row { display: flex; gap: 8px; justify-content: flex-end; }
.task-filter-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f1f3fa;
  border: 1px solid #e6e9f4;
}
.task-filter-tabs button {
  border: 0;
  background: transparent;
  color: #72798d;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}
.task-filter-tabs button.active { background: #fff; color: #7053e8; box-shadow: 0 4px 14px rgba(50,56,92,.10); }
.visual-task-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-content: start; }
.visual-task-card {
  display: grid;
  grid-template-rows: 210px auto;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid #e9ecf7;
  box-shadow: 0 16px 44px rgba(23,32,64,.08);
}
.visual-task-card.running { border-color: rgba(76,116,255,.28); }
.visual-task-card.done { border-color: rgba(25,181,122,.28); }
.visual-task-card.fail { border-color: rgba(239,71,111,.28); }
.task-visual {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #ffffff 0, #f3f5fb 55%, #e8ebf5 100%);
  display: grid;
  place-items: center;
}
.task-visual > img, .task-visual > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0b1020;
}
.task-visual > video { object-fit: contain; }
.task-visual > img { filter: saturate(.95); transform: scale(1.02); }
.video-placeholder-bg {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #c4c8d7;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: .08em;
  background: linear-gradient(135deg,#f7f8fc,#eceffc);
}
.progress-glass {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.68));
  backdrop-filter: blur(2px);
}
.progress-glass strong {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #34405f;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(22,26,45,.08);
}
.progress-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#7357f2 calc(var(--p) * 1%), rgba(255,255,255,.72) 0);
  box-shadow: 0 12px 34px rgba(84,67,190,.22);
  position: relative;
}
.progress-ring::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
}
.progress-ring span { position: relative; font-weight: 950; color: #4f3db6; font-size: 18px; }
.floating-badge { position: absolute; right: 12px; top: 12px; box-shadow: 0 8px 24px rgba(15,20,45,.14); }
.task-content { padding: 14px; display: grid; gap: 10px; }
.compact-head { margin: 0; }
.progress-number { font-size: 18px; color: #7053e8; white-space: nowrap; }
.progress-number.done { color: #087349; }
.progress-number.fail { color: #b91c47; }
.visual-progress-bar { height: 8px; border-radius: 999px; background: #eef1f8; overflow: hidden; }
.visual-progress-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#7357f2,#69a6ff); transition: width .35s ease; }
.visual-task-card.done .visual-progress-bar i { background: linear-gradient(90deg,#19b57a,#7bd7b1); }
.visual-task-card.fail .visual-progress-bar i { background: linear-gradient(90deg,#ef476f,#ff8daa); }
.compact-meta { font-size: 12px; gap: 6px 10px; }
.task-ref-row { display: flex; flex-wrap: wrap; gap: 6px; }
.task-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid #e6e9f4;
  background: #fbfcff;
  padding: 4px 8px;
  color: #566076;
  font-size: 12px;
  font-weight: 800;
}
.task-ref-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.error-summary {
  border: 1px solid #ffd2dc;
  background: #fff4f7;
  color: #bf2850;
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}
.task-details {
  border: 1px solid #edf0f8;
  border-radius: 12px;
  background: #fbfcff;
  overflow: hidden;
}
.task-details summary {
  cursor: pointer;
  padding: 8px 10px;
  color: #687088;
  font-weight: 900;
  font-size: 12px;
}
.task-details pre {
  margin: 0;
  padding: 10px;
  border-top: 1px solid #edf0f8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow: auto;
  font-size: 12px;
  color: #485269;
}
.compact-actions { margin-top: 0; gap: 6px; }
.compact-actions button { padding: 7px 9px; border-radius: 10px; font-size: 12px; }
@media (max-width: 820px) {
  .visual-task-grid { grid-template-columns: 1fr; }
  .visual-task-card { grid-template-rows: 190px auto; }
  .queue-actions-stack { align-items: stretch; }
  .queue-tools-row { justify-content: flex-start; }
}

.pending-card { opacity: .96; }
.pending-card .ref-thumb-wrap { border-style: dashed; }
.mini-tip { font-size: 11px; color: #8a6b00; font-weight: 700; }
.match-preview-box { white-space: normal !important; }
.match-preview-rich { display: grid; gap: 12px; }
.match-summary { font-weight: 700; color: #1f2945; }
.match-task-card { background: rgba(255,255,255,.72); border: 1px solid #dfe5f4; border-radius: 14px; padding: 10px; }
.match-task-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.match-task-head strong { color: #1b2440; }
.match-task-head span { font-size: 12px; color: #6f49e8; font-weight: 800; }
.match-thumb-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.match-thumb { flex: 0 0 120px; border: 1px solid #e4e9f8; border-radius: 12px; background: #fff; overflow: hidden; }
.match-thumb img, .match-thumb-placeholder { width: 100%; height: 84px; object-fit: cover; display: block; background: linear-gradient(135deg,#f5f7ff,#ffffff); }
.match-thumb img { cursor: zoom-in; }
.match-thumb-placeholder { display: grid; place-items: center; color: #98a0b6; }
.match-thumb-name { font-weight: 800; font-size: 12px; color: #1f2945; padding: 6px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-thumb-hit { font-size: 11px; color: #65708a; padding: 4px 8px 8px; line-height: 1.35; min-height: 36px; }
.match-none { color: #7d859a; font-size: 13px; padding: 6px 4px; }

.citrus-logo::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.96);
  background:
    conic-gradient(from 0deg,
      transparent 0deg 18deg, rgba(255,255,255,.98) 18deg 22deg,
      transparent 22deg 68deg, rgba(255,255,255,.98) 68deg 72deg,
      transparent 72deg 118deg, rgba(255,255,255,.98) 118deg 122deg,
      transparent 122deg 168deg, rgba(255,255,255,.98) 168deg 172deg,
      transparent 172deg 218deg, rgba(255,255,255,.98) 218deg 222deg,
      transparent 222deg 268deg, rgba(255,255,255,.98) 268deg 272deg,
      transparent 272deg 318deg, rgba(255,255,255,.98) 318deg 322deg,
      transparent 322deg 360deg);
}
.citrus-logo::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  right: 5px;
  top: 4px;
  border-radius: 10px 10px 2px 10px;
  background: linear-gradient(135deg, #7de07b, #29b867);
  transform: rotate(35deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.gem-logo.large { width: 56px; height: 56px; border-radius: 18px; }
.top-nav { flex: 1; display: flex; justify-content: center; gap: 10px; align-items: center; }
.nav-btn { min-width: 92px; padding: 11px 16px; }
.moved-tip-panel { background: #fafbff; }
.moved-tip-panel .inline-result { margin-top: 6px; }
.match-stage-card { min-height: 320px; display: flex; flex-direction: column; gap: 10px; }
.preview-topline { margin-top: 0; }
.settings-upload-manager { margin-top: 18px; border: 1px solid var(--line); }
.settings-upload-layout { align-items: stretch; }
.settings-upload-layout .upload-box { min-height: 180px; }
.settings-upload-layout .upload-options { min-width: 320px; }
#matchPreview.match-preview-box { min-height: 190px; }
#matchPreview .match-thumb { flex-basis: 132px; }
#matchPreview .match-thumb img, #matchPreview .match-thumb-placeholder { height: 96px; }

/* V14: complete reference preview, script import, and 8-parallel whole-drama workflow */
.preview-panel {
  grid-template-rows: minmax(460px, 50vh) minmax(0, 1fr) !important;
}
.match-stage-card {
  min-height: 460px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.match-stage-card #matchPreview {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 290px;
  max-height: none;
}
.match-preview-rich { padding-bottom: 8px; }
.match-task-card { overflow: visible; }
.match-thumb-row {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  align-items: stretch;
  max-height: none;
}
.match-thumb { flex: 0 0 152px !important; }
.match-thumb img,
.match-thumb-placeholder { height: 112px !important; }
.match-thumb-name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35;
  min-height: 34px;
}
.match-thumb-hit {
  min-height: auto !important;
  word-break: break-word;
}
.script-import-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #ffe0bc;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf4, #fff);
  display: grid;
  gap: 10px;
}
.script-import-panel strong {
  display: block;
  font-size: 14px;
  color: #1f2945;
  margin-bottom: 4px;
}
.script-import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.script-import-actions input[type="file"] {
  padding: 9px 10px;
  box-shadow: none;
}
.script-import-status {
  border: 1px solid #ffe0bc;
  background: #fff7ed;
  color: #9a4a0b;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.mini-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1260px) {
  .preview-panel { grid-template-rows: auto minmax(520px, auto) !important; }
  .match-stage-card { min-height: auto; }
  .script-import-actions { grid-template-columns: 1fr; }
}

/* V15: current-section script loading + pause/resume controls */
.script-control-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ffe0bc;
  background: #fffaf4;
  border-radius: 12px;
}
.script-control-panel.hidden { display: none; }
.script-current-pill {
  font-size: 12px;
  font-weight: 900;
  color: #9a4a0b;
  background: #fff4e6;
  border: 1px solid #ffd4a5;
  border-radius: 999px;
  padding: 8px 10px;
}
.script-control-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.actions-row.sticky-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.actions-row.sticky-actions .one-click-btn {
  grid-column: span 2;
}
#pauseQueueBtn {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}
#runQueueBtn {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}
.preview-panel {
  grid-template-rows: minmax(430px, 48vh) minmax(0, 1fr) !important;
}
.match-stage-card {
  min-height: 430px;
  overflow: hidden;
}
.match-stage-card #matchPreview {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 250px;
  max-height: none;
}
.match-thumb-row {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  align-items: stretch;
  max-height: none;
}
.match-thumb {
  flex: 0 0 152px !important;
}
.match-thumb img,
.match-thumb-placeholder {
  height: 112px !important;
}
.match-thumb-name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35;
  min-height: 34px;
}
.match-thumb-hit {
  min-height: auto !important;
  word-break: break-word;
}
.prompt-area textarea {
  min-height: 330px;
}
@media (max-width: 1260px) {
  .preview-panel {
    grid-template-rows: auto minmax(520px, auto) !important;
  }
  .match-stage-card {
    min-height: auto;
  }
  .actions-row.sticky-actions {
    grid-template-columns: 1fr;
  }
  .actions-row.sticky-actions .one-click-btn {
    grid-column: span 1;
  }
}

/* V16: batch safety + readable queue summary */
.queue-summary-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  background: #f4f8ff;
  color: #245a97;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
}
.queue-summary-card strong {
  color: #173a68;
  font-size: 14px;
}
.queue-summary-card span {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 5px 9px;
}
.queue-summary-card em {
  width: 100%;
  color: #5b6d8e;
  font-style: normal;
  font-weight: 600;
}
.queue-paused-badge {
  color: #e11d48;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 5px 9px;
}
.visual-task-card.fail {
  background: #fffafa;
}
.visual-task-card.fail .task-visual {
  background: linear-gradient(135deg, #fff1f2, #fff);
}
.visual-task-card.fail .progress-glass {
  background: rgba(255,255,255,.82);
}
.error-summary {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.45;
}

/* V17: restore requested workflow layout */
.script-import-panel {
  margin-top: 14px;
  padding: 12px;
}
.script-import-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.current-section-hint {
  margin-top: 12px;
  border: 1px solid #dbeafe;
  background: #f4f8ff;
  color: #245a97;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.45;
  font-size: 13px;
  font-weight: 800;
}
.current-section-hint.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}
.prompt-area {
  margin-top: 12px;
}
.prompt-area textarea {
  min-height: 360px !important;
  font-size: 14px;
}
.match-stage-card {
  min-height: 350px !important;
}
.match-stage-card #matchPreview {
  min-height: 210px !important;
  background: #f8fbff;
}
.auto-preview-empty {
  height: 100%;
  min-height: 185px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: #5b6d8e;
}
.auto-preview-empty strong {
  color: #245a97;
  font-size: 18px;
}
.auto-preview-empty span {
  max-width: 560px;
  line-height: 1.6;
}
.actions-row.sticky-actions {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px;
}
.actions-row.sticky-actions .one-click-btn {
  grid-column: 1 / -1;
  height: 48px;
  font-size: 17px;
}
#pauseQueueBtn,
#runQueueBtn {
  height: 44px;
  font-size: 16px;
  font-weight: 950;
}
#addQueueBtn,
#instantRunBtn {
  height: 40px;
}
#previewMatchBtn {
  font-weight: 900;
}
@media (max-width: 1260px) {
  .actions-row.sticky-actions {
    grid-template-columns: 1fr !important;
  }
}

/* V18: provider switching */
#apiProvider {
  font-weight: 900;
}
#apiBaseUrl, #modelNameCustom {
  font-family: Consolas, "Microsoft YaHei", monospace;
}
.settings-page-card .setup-grid label:nth-child(1),
.settings-page-card .setup-grid label:nth-child(2) {
  border-color: #fed7aa;
  background: #fffaf4;
}


/* V21: 精简布局 + 放大当前节提示词 */
.composer-scroll {
  gap: 10px !important;
  padding-bottom: 10px !important;
}
.field-grid.compact-fields,
.script-import-panel,
.current-section-hint,
.prompt-area,
.mini-controls {
  margin-top: 8px !important;
}
.script-import-panel {
  padding: 10px !important;
}
.script-import-actions {
  gap: 8px !important;
}
.script-import-status {
  padding: 8px 10px !important;
  min-height: unset !important;
}
.script-control-panel {
  padding: 8px !important;
  gap: 8px !important;
}
.current-section-hint {
  padding: 8px 10px !important;
  font-size: 12px !important;
}
.prompt-area small {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}
.prompt-area textarea#prompt {
  min-height: 470px !important;
  height: min(58vh, 620px) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  padding: 14px !important;
}
.mini-controls {
  gap: 8px !important;
  padding: 8px 0 4px !important;
}
.compact-check {
  padding: 7px 9px !important;
}
.composer-footer {
  padding-top: 10px !important;
}
.actions-row.sticky-actions {
  gap: 8px !important;
}
.actions-row.sticky-actions .one-click-btn {
  height: 50px !important;
}
#pauseQueueBtn,
#runQueueBtn {
  height: 44px !important;
}
.reference-strip.card-lite.match-stage-card {
  min-height: 330px !important;
}
.match-stage-card #matchPreview {
  min-height: 210px !important;
}
.video-stage-card {
  margin-top: 10px !important;
}
@media (max-height: 820px) {
  .prompt-area textarea#prompt {
    min-height: 390px !important;
    height: 50vh !important;
  }
}

/* V22: 多人隔离增强 */
.workspace-actions-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.workspace-tip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.workspace-tip-grid div {
  border: 1px solid #dbeafe;
  background: #f4f8ff;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 4px;
}
.workspace-tip-grid strong { color: #245a97; font-size: 13px; }
.workspace-tip-grid span { color: #5b6d8e; font-size: 12px; line-height: 1.45; }
.multiuser-status-card {
  margin: 14px 0;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #047857;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.multiuser-status-card strong { color: #065f46; }
.multiuser-status-card p { margin: 4px 0 0; line-height: 1.6; color: #047857; }
.multiuser-status-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.multiuser-status-list span {
  border: 1px solid #bbf7d0;
  background: #fff;
  color: #047857;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
@media (max-width: 720px) {
  .workspace-actions-row { grid-template-columns: 1fr; }
  .workspace-tip-grid { grid-template-columns: 1fr; }
}


/* V23 SaaS 多人版 */
.saas-login-card {
  max-width: 620px;
}
.online-pill {
  background: #ecfdf5;
  color: #047857;
  border-color: #bbf7d0;
}
.admin-tab .settings-page-card {
  display: grid;
  gap: 16px;
}
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}
.admin-stat {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.admin-stat strong {
  display: block;
  font-size: 28px;
  color: var(--primary);
  line-height: 1.1;
}
.admin-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.admin-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
}
.admin-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.admin-card h4 {
  margin: 0;
  font-size: 17px;
}
.admin-card label {
  display: grid;
  gap: 6px;
  color: #2b3150;
  font-size: 13px;
  font-weight: 900;
}
.admin-card input,
.admin-card select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.admin-wide {
  min-width: 0;
}
.admin-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  max-height: 520px;
}
.admin-table.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.admin-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
.admin-table th {
  background: #f5f7ff;
  color: #4f5a78;
  position: sticky;
  top: 0;
  z-index: 1;
}
.admin-table td input,
.admin-table td select {
  min-width: 120px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.admin-actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 260px;
}
.admin-actions-cell button {
  padding: 7px 9px;
  border-radius: 9px;
}
.ok-text {
  color: #047857;
  font-weight: 900;
}
.bad-text {
  color: #e11d48;
  font-weight: 900;
}
.muted-text {
  color: var(--muted);
  margin: 0;
}
@media (max-width: 1280px) {
  .admin-stats-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 780px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}


/* V24 登录修复 */
#workspaceGateMsg {
  white-space: pre-line;
  line-height: 1.6;
}
.saas-login-card .workspace-actions-row {
  grid-template-columns: 1fr auto auto;
}
.saas-login-card .workspace-actions-row .wide-btn {
  min-width: 180px;
}
@media (max-width: 620px) {
  .saas-login-card .workspace-actions-row {
    grid-template-columns: 1fr;
  }
}


/* V25 外部访问优化 */
.external-login-tip {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 14px;
  color: #1e3a8a;
  line-height: 1.55;
  font-size: 13px;
}
.external-login-tip strong,
.external-login-tip span {
  display: block;
}
.external-login-tip code {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 1px 5px;
}
.external-access-card {
  grid-column: 1 / -1;
}
.external-address-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.external-address-grid > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
  display: grid;
  gap: 6px;
}
.external-address-grid strong {
  color: #344064;
}
.external-address-grid code,
#externalUserGuide {
  width: 100%;
  word-break: break-all;
}
#externalUserGuide {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
  color: #182033;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.6;
  resize: vertical;
}
.external-access-note {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
}
@media (max-width: 1000px) {
  .external-address-grid {
    grid-template-columns: 1fr;
  }
}


/* V26: 参考图调度预览紧凑版 */
.preview-panel {
  grid-template-rows: minmax(230px, 30vh) minmax(0, 1fr) !important;
  gap: 10px !important;
}
.reference-strip.card-lite.match-stage-card,
.match-stage-card {
  min-height: 230px !important;
  padding: 12px 14px !important;
}
.match-stage-card .section-head,
.reference-strip .section-head {
  margin-bottom: 6px !important;
  padding-bottom: 4px !important;
}
.match-stage-card .section-head h3,
.reference-strip .section-head h3 {
  margin: 0 !important;
  line-height: 1.2 !important;
}
.match-stage-card .section-head p,
.reference-strip .section-head p {
  display: none !important;
}
.ref-strip-toolbar.preview-topline {
  margin: 4px 0 6px !important;
  padding: 8px 10px !important;
  min-height: unset !important;
}
#matchPreview {
  min-height: 115px !important;
  max-height: 190px !important;
  padding: 10px !important;
  overflow: auto !important;
}
.match-stage-card #matchPreview {
  min-height: 115px !important;
}
.match-group,
.match-stage,
.match-section-block {
  margin-top: 6px !important;
  gap: 6px !important;
}
.match-thumb-row {
  gap: 8px !important;
}
.match-thumb {
  flex-basis: 120px !important;
  min-height: 122px !important;
  padding: 7px !important;
}
.match-thumb img {
  width: 88px !important;
  height: 88px !important;
}
.active-refs-bar {
  margin-top: 6px !important;
  padding: 7px 9px !important;
}
.result-stage.card-lite,
.video-stage-card {
  margin-top: 0 !important;
}
@media (max-height: 850px) {
  .preview-panel {
    grid-template-rows: minmax(205px, 27vh) minmax(0, 1fr) !important;
  }
  .reference-strip.card-lite.match-stage-card,
  .match-stage-card {
    min-height: 205px !important;
  }
  #matchPreview {
    min-height: 95px !important;
    max-height: 160px !important;
  }
}


/* V27: 参考图完整显示，无内部滚动，无裁切 */
.preview-panel {
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 8px !important;
  overflow: visible !important;
}
.reference-strip.card-lite.match-stage-card,
.reference-strip,
.match-stage-card {
  min-height: unset !important;
  height: auto !important;
  max-height: none !important;
  padding: 10px 14px 8px !important;
  overflow: visible !important;
}
.match-stage-card .section-head,
.reference-strip .section-head {
  margin-bottom: 4px !important;
  padding-bottom: 0 !important;
}
.match-stage-card .section-head h3,
.reference-strip .section-head h3 {
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
}
.match-stage-card .section-head p,
.reference-strip .section-head p,
.match-summary {
  display: none !important;
}
.ref-strip-toolbar.preview-topline {
  margin: 4px 0 6px !important;
  padding: 7px 10px !important;
  min-height: 0 !important;
  line-height: 1.2 !important;
}
.ref-strip-toolbar.preview-topline span {
  font-size: 12px !important;
}
#matchPreview,
.match-stage-card #matchPreview,
.inline-result.match-preview-box {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 8px 10px !important;
}
.match-preview-rich {
  display: grid !important;
  gap: 6px !important;
}
.match-task-card {
  padding: 7px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  overflow: visible !important;
}
.match-task-head {
  margin-bottom: 5px !important;
  min-height: 0 !important;
}
.match-task-head strong {
  font-size: 13px !important;
}
.match-task-head span {
  font-size: 12px !important;
}
.match-thumb-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  overflow: visible !important;
  padding-bottom: 0 !important;
}
.match-thumb {
  flex: 0 0 118px !important;
  width: 118px !important;
  min-height: 135px !important;
  overflow: visible !important;
  border-radius: 12px !important;
}
.match-thumb img,
.match-thumb-placeholder {
  width: 100% !important;
  height: 92px !important;
  object-fit: contain !important;
  background: linear-gradient(135deg,#f5f7ff,#ffffff) !important;
}
.match-thumb-name {
  padding: 5px 7px 0 !important;
  font-size: 11.5px !important;
}
.match-thumb-hit {
  padding: 3px 7px 6px !important;
  font-size: 10.8px !important;
  min-height: unset !important;
}
.active-refs-bar {
  margin-top: 5px !important;
  padding: 6px 9px !important;
}
.result-stage.card-lite,
.video-stage-card {
  margin-top: 0 !important;
}
.card-lite {
  overflow: visible !important;
}

/* 如果当前节命中参考图较多，让页面本身滚动，不在参考图框里单独滚动 */
.content {
  overflow: auto !important;
}
.studio-layout {
  min-height: calc(100vh - 108px) !important;
  height: auto !important;
}
@media (max-height: 850px) {
  .reference-strip.card-lite.match-stage-card,
  .reference-strip,
  .match-stage-card {
    padding-top: 8px !important;
  }
  .match-thumb {
    flex-basis: 112px !important;
    width: 112px !important;
  }
  .match-thumb img,
  .match-thumb-placeholder {
    height: 86px !important;
  }
}


/* V28: 左侧生成按钮固定可见 + 输入区压缩 */
.content {
  overflow: hidden !important;
}
.studio-tab {
  padding: 10px 16px !important;
  height: 100% !important;
  overflow: hidden !important;
}
.studio-layout {
  height: calc(100vh - 86px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  grid-template-columns: 455px minmax(0, 1fr) !important;
  gap: 14px !important;
}
.composer-panel {
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.composer-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 14px 18px 6px !important;
}
.composer-footer {
  flex: 0 0 auto !important;
  position: relative !important;
  bottom: auto !important;
  padding: 8px 16px 10px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.96), #fff) !important;
  border-top: 1px solid var(--line) !important;
  box-shadow: 0 -8px 18px rgba(20, 24, 45, .05) !important;
  z-index: 20 !important;
}
.field-grid.compact-fields {
  gap: 10px !important;
}
.field-grid.compact-fields label {
  gap: 5px !important;
}
.field-grid.compact-fields input,
.field-grid.compact-fields select {
  padding: 9px 11px !important;
}
.field-grid.compact-fields small {
  line-height: 1.25 !important;
  font-size: 12px !important;
}
.ratio-picks {
  margin-top: 10px !important;
}
.ratio-buttons {
  gap: 8px !important;
}
.ratio-buttons button {
  min-width: 48px !important;
  padding: 7px 8px !important;
}
.script-import-panel {
  margin-top: 8px !important;
  padding: 10px !important;
  border-radius: 14px !important;
  gap: 8px !important;
}
.script-import-panel strong {
  font-size: 14px !important;
}
.script-import-panel small {
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.script-import-actions {
  gap: 7px !important;
}
.script-import-actions input[type="file"] {
  padding: 7px !important;
}
.script-import-actions button {
  padding: 8px 11px !important;
}
.script-import-status {
  padding: 7px 9px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.script-control-panel {
  padding: 7px !important;
  gap: 7px !important;
}
.script-current-pill {
  padding: 7px 9px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.script-control-actions button {
  padding: 8px 11px !important;
}
.current-section-hint {
  margin-top: 8px !important;
  padding: 7px 9px !important;
  font-size: 12px !important;
}
.prompt-area {
  margin-top: 8px !important;
  gap: 5px !important;
}
.prompt-area small {
  font-size: 12px !important;
  line-height: 1.3 !important;
}
.prompt-area textarea#prompt {
  min-height: 210px !important;
  height: clamp(210px, 31vh, 330px) !important;
  max-height: 330px !important;
  padding: 11px 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}
.mini-controls {
  margin-top: 7px !important;
  gap: 6px !important;
  padding: 4px 0 2px !important;
}
.compact-check {
  padding: 6px 8px !important;
  font-size: 12px !important;
}
#oneClickResult {
  margin-bottom: 6px !important;
  padding: 7px 9px !important;
  font-size: 12px !important;
}
.actions-row.sticky-actions {
  display: grid !important;
  grid-template-columns: 1.3fr 1fr 1fr !important;
  gap: 7px !important;
}
.actions-row.sticky-actions button {
  min-height: 38px !important;
  height: 40px !important;
  padding: 8px 10px !important;
  font-size: 14px !important;
  border-radius: 11px !important;
}
.actions-row.sticky-actions #oneClickRunBtn {
  grid-column: 1 / -1 !important;
  height: 44px !important;
}
.actions-row.sticky-actions #addQueueBtn,
.actions-row.sticky-actions #instantRunBtn {
  height: 38px !important;
}
.preview-panel {
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
}
.result-stage {
  min-height: 360px !important;
}
@media (max-height: 820px) {
  .studio-tab {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  .studio-layout {
    height: calc(100vh - 74px) !important;
  }
  .composer-scroll {
    padding-top: 10px !important;
  }
  .prompt-area textarea#prompt {
    min-height: 160px !important;
    height: 24vh !important;
    max-height: 220px !important;
  }
  .script-import-panel small,
  .field-grid.compact-fields small,
  .prompt-area small {
    display: none !important;
  }
  .script-import-status {
    max-height: 46px !important;
    overflow: hidden !important;
  }
  .actions-row.sticky-actions button {
    height: 36px !important;
    min-height: 36px !important;
  }
  .actions-row.sticky-actions #oneClickRunBtn {
    height: 40px !important;
  }
}


/* V30: 批量补生助手 */
.section-assist-panel {
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #eadfff;
  border-radius: 14px;
  background: linear-gradient(180deg, #faf8ff 0%, #f5f8ff 100%);
  display: grid;
  gap: 7px;
}
.section-assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.section-assist-head strong {
  font-size: 14px;
}
.section-status-summary {
  font-size: 12px;
  color: #5f6476;
}
.section-assist-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.section-assist-actions button {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12.5px;
  border-radius: 10px;
}
.repair-actions button:nth-child(2),
.repair-actions button:nth-child(3) {
  font-weight: 900;
}
.missing-sections-box {
  display: grid;
  gap: 5px;
}
.missing-label {
  font-size: 12px;
  color: #5f6476;
}
.missing-section-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
  max-height: 86px;
  overflow-y: auto;
  padding-right: 2px;
}
.missing-chip {
  border: 1px solid #d7dcf5;
  background: #fff;
  color: #38415e;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
  transition: .18s ease;
}
.missing-chip:hover {
  transform: translateY(-1px);
  border-color: #8a68ff;
  color: #5136bf;
}
.missing-chip.failed {
  background: #fff1f3;
  border-color: #ffb5c0;
  color: #cf3358;
}
.missing-chip.pending,
.missing-chip.running {
  background: #fff8ec;
  border-color: #ffd190;
  color: #b26900;
}
.missing-chip.ungenerated {
  background: #eef4ff;
  border-color: #caddff;
  color: #2c63cb;
}
.missing-chip.current {
  box-shadow: 0 0 0 2px rgba(122, 92, 255, .22);
  border-color: #7b57ff;
}
.missing-empty {
  font-size: 12px;
  color: #17a34a;
  padding: 4px 0;
}
.script-current-pill em {
  font-style: normal;
  font-weight: 700;
  color: #7b57ff;
}
.actions-row.sticky-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.actions-row.sticky-actions #oneClickRunBtn {
  grid-column: 1 / -1 !important;
}
.actions-row.sticky-actions #runCurrentSectionBtnFooter,
.actions-row.sticky-actions #jumpFirstMissingBtnFooter,
.actions-row.sticky-actions #pauseQueueBtn,
.actions-row.sticky-actions #runQueueBtn {
  height: 38px !important;
}
@media (max-width: 1200px) {
  .section-assist-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-height: 820px) {
  .section-assist-panel {
    padding: 7px;
    gap: 5px;
  }
  .section-assist-actions button {
    min-height: 32px;
    font-size: 12px;
  }
  .missing-section-list {
    max-height: 66px;
  }
}


/* V31: 补生助手常显；没导入剧本也显示位置和提示 */
.section-assist-panel {
  display: grid !important;
}
.section-assist-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.25);
}
.missing-empty.muted-empty {
  color: #687087;
  background: #f8fbff;
  border: 1px dashed #d7def2;
  border-radius: 10px;
  padding: 7px 9px;
  line-height: 1.45;
}
#sectionStatusSummary {
  font-weight: 700;
}


/* V32: 三栏完整显示布局
   左：参数/剧本/补生/按钮
   中：参考图调度预览
   右：视频生成显示区域
*/
html, body {
  overflow: hidden !important;
}
.app-shell {
  height: 100vh !important;
  overflow: hidden !important;
}
.topbar {
  height: 68px !important;
  min-height: 68px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.content {
  height: calc(100vh - 68px) !important;
  overflow: hidden !important;
}
.studio-tab {
  height: 100% !important;
  overflow: hidden !important;
  padding: 8px 12px !important;
}
.studio-layout {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-columns: 405px minmax(360px, 0.85fr) minmax(520px, 1.25fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
}
.composer-panel {
  grid-column: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 16px !important;
}
.preview-panel {
  grid-column: 2 / 4 !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.25fr) !important;
  grid-template-rows: 1fr !important;
  gap: 10px !important;
}
.reference-strip.card-lite.match-stage-card,
.reference-strip,
.match-stage-card {
  grid-column: 1 !important;
  grid-row: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 12px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
}
.result-stage.card-lite,
.result-stage,
.video-stage-card {
  grid-column: 2 !important;
  grid-row: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 12px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
}
.reference-strip .section-head,
.match-stage-card .section-head,
.result-stage .section-head {
  flex: 0 0 auto !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
}
.reference-strip .section-head h3,
.result-stage .section-head h3 {
  font-size: 17px !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}
.reference-strip .section-head p,
.result-stage .section-head p {
  display: none !important;
}
.ref-strip-toolbar.preview-topline {
  flex: 0 0 auto !important;
  margin: 0 0 6px !important;
  padding: 7px 9px !important;
  min-height: 0 !important;
}
.ref-strip-toolbar.preview-topline span {
  font-size: 11.5px !important;
}
#matchPreview,
.match-stage-card #matchPreview,
.inline-result.match-preview-box {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 8px !important;
  display: block !important;
}
.match-preview-rich {
  height: 100% !important;
  overflow: hidden !important;
  display: grid !important;
  align-content: start !important;
  gap: 6px !important;
}
.match-task-card {
  padding: 7px !important;
  border-radius: 12px !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
.match-task-head {
  min-height: 0 !important;
  margin-bottom: 5px !important;
}
.match-task-head strong {
  font-size: 12.5px !important;
}
.match-task-head span {
  font-size: 11.5px !important;
}
.match-thumb-row {
  gap: 6px !important;
  overflow: hidden !important;
  align-content: start !important;
}
.match-thumb {
  flex: 0 0 94px !important;
  width: 94px !important;
  min-height: 116px !important;
  padding: 5px !important;
}
.match-thumb img,
.match-thumb-placeholder {
  height: 72px !important;
  width: 100% !important;
  object-fit: contain !important;
}
.match-thumb-name {
  font-size: 10.5px !important;
  padding: 4px 5px 0 !important;
  line-height: 1.2 !important;
}
.match-thumb-hit {
  font-size: 10px !important;
  padding: 2px 5px 4px !important;
  line-height: 1.15 !important;
}
.active-refs-bar,
#publicCheckResult {
  flex: 0 0 auto !important;
  margin-top: 6px !important;
  max-height: 54px !important;
  overflow: hidden !important;
  padding: 6px 8px !important;
}

/* Left column compact: no searching by scroll; buttons always visible */
.composer-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 10px 14px 4px !important;
  gap: 7px !important;
}
.composer-footer {
  flex: 0 0 auto !important;
  padding: 7px 14px 8px !important;
}
.field-grid.compact-fields {
  gap: 7px !important;
}
.field-grid.compact-fields label {
  gap: 3px !important;
  font-size: 12.5px !important;
}
.field-grid.compact-fields input,
.field-grid.compact-fields select {
  min-height: 36px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
}
.field-grid.compact-fields small {
  display: none !important;
}
.ratio-picks {
  margin-top: 6px !important;
}
.ratio-picks > span {
  font-size: 12.5px !important;
}
.ratio-buttons {
  gap: 6px !important;
}
.ratio-buttons button {
  min-width: 43px !important;
  padding: 6px 6px !important;
  font-size: 11.5px !important;
}
.ratio-buttons i {
  transform: scale(.82);
  margin-bottom: 2px !important;
}
.script-import-panel {
  margin-top: 6px !important;
  padding: 8px !important;
  gap: 6px !important;
  border-radius: 12px !important;
}
.script-import-panel strong {
  font-size: 13px !important;
}
.script-import-panel small {
  display: none !important;
}
.script-import-actions {
  grid-template-columns: 1.2fr .68fr .48fr !important;
  gap: 5px !important;
}
.script-import-actions input[type="file"] {
  min-height: 34px !important;
  padding: 6px !important;
  font-size: 12px !important;
}
.script-import-actions button {
  min-height: 34px !important;
  padding: 7px 8px !important;
  font-size: 12px !important;
}
.script-import-status {
  padding: 6px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  max-height: 42px !important;
  overflow: hidden !important;
}
.script-control-panel {
  padding: 6px !important;
  gap: 5px !important;
}
.script-current-pill {
  padding: 6px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  max-height: 40px !important;
  overflow: hidden !important;
}
.script-control-actions {
  gap: 5px !important;
}
.script-control-actions button {
  min-height: 32px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
}
.current-section-hint {
  margin-top: 6px !important;
  padding: 6px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  max-height: 32px !important;
  overflow: hidden !important;
}
.section-assist-panel {
  margin-top: 6px !important;
  padding: 7px !important;
  gap: 5px !important;
  border-radius: 12px !important;
}
.section-assist-head strong {
  font-size: 12.5px !important;
}
.section-status-summary {
  font-size: 11px !important;
}
.section-assist-actions {
  gap: 5px !important;
}
.section-assist-actions button {
  min-height: 30px !important;
  padding: 5px 6px !important;
  font-size: 11.5px !important;
  border-radius: 8px !important;
}
.missing-sections-box {
  gap: 4px !important;
}
.missing-label {
  display: none !important;
}
.missing-section-list {
  max-height: 54px !important;
  overflow: hidden !important;
  gap: 4px !important;
}
.missing-chip {
  padding: 4px 7px !important;
  font-size: 10.8px !important;
}
.prompt-area {
  margin-top: 6px !important;
  gap: 4px !important;
  font-size: 12.5px !important;
}
.prompt-area small {
  display: none !important;
}
.prompt-area textarea#prompt {
  min-height: 126px !important;
  height: clamp(126px, 18vh, 190px) !important;
  max-height: 190px !important;
  padding: 9px !important;
  font-size: 12.5px !important;
  line-height: 1.42 !important;
}
.mini-controls {
  display: none !important;
}
#oneClickResult {
  max-height: 38px !important;
  overflow: hidden !important;
  margin-bottom: 5px !important;
  padding: 6px 8px !important;
  font-size: 11.5px !important;
}
.actions-row.sticky-actions {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}
.actions-row.sticky-actions #oneClickRunBtn {
  grid-column: 1 / -1 !important;
  height: 42px !important;
}
.actions-row.sticky-actions button {
  min-height: 34px !important;
  height: 34px !important;
  padding: 6px 7px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
}

/* Right column video area compact, full visible */
.stage-head {
  align-items: center !important;
}
.task-filters {
  gap: 6px !important;
}
.task-filters button {
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
}
#queueList {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.task-list.visual-task-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 8px !important;
  align-content: start !important;
}
.stage-empty {
  height: 100% !important;
}

/* On narrower screens, keep three regions but smaller */
@media (max-width: 1450px) {
  .studio-layout {
    grid-template-columns: 380px minmax(320px, .8fr) minmax(450px, 1.2fr) !important;
    gap: 8px !important;
  }
  .preview-panel {
    grid-template-columns: minmax(320px, .8fr) minmax(450px, 1.2fr) !important;
    gap: 8px !important;
  }
  .composer-scroll {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}
@media (max-height: 780px) {
  .topbar {
    height: 60px !important;
    min-height: 60px !important;
  }
  .content {
    height: calc(100vh - 60px) !important;
  }
  .prompt-area textarea#prompt {
    min-height: 88px !important;
    height: 13vh !important;
    max-height: 125px !important;
  }
  .script-import-status,
  .current-section-hint {
    display: none !important;
  }
  .missing-section-list {
    max-height: 36px !important;
  }
}


/* V33: 将补生助手移到中栏上半部分，左栏释放给提示词 */
.studio-layout {
  grid-template-columns: 405px minmax(390px, .86fr) minmax(520px, 1.2fr) !important;
}
.preview-panel {
  grid-column: 2 / 4 !important;
  display: grid !important;
  grid-template-columns: minmax(390px, .86fr) minmax(520px, 1.2fr) !important;
  grid-template-rows: minmax(235px, 34%) minmax(0, 1fr) !important;
  gap: 10px !important;
}
.preview-panel > .section-assist-panel {
  grid-column: 1 !important;
  grid-row: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 10px !important;
  border-radius: 16px !important;
}
.reference-strip.card-lite.match-stage-card,
.reference-strip,
.match-stage-card {
  grid-column: 1 !important;
  grid-row: 2 !important;
  height: 100% !important;
  min-height: 0 !important;
}
.result-stage.card-lite,
.result-stage,
.video-stage-card {
  grid-column: 2 !important;
  grid-row: 1 / 3 !important;
  height: 100% !important;
}

/* 中栏补生助手完整显示但压缩 */
.preview-panel > .section-assist-panel .section-assist-head {
  margin: 0 !important;
}
.preview-panel > .section-assist-panel .section-assist-head strong {
  font-size: 15px !important;
}
.preview-panel > .section-assist-panel .section-status-summary {
  font-size: 11.8px !important;
  line-height: 1.25 !important;
}
.preview-panel > .section-assist-panel .section-assist-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
.preview-panel > .section-assist-panel .section-assist-actions button {
  min-height: 32px !important;
  height: 32px !important;
  padding: 5px 6px !important;
  font-size: 11.8px !important;
  border-radius: 9px !important;
}
.preview-panel > .section-assist-panel .missing-sections-box {
  min-height: 0 !important;
  flex: 1 1 auto !important;
}
.preview-panel > .section-assist-panel .missing-section-list {
  max-height: 82px !important;
  overflow: hidden !important;
  gap: 5px !important;
}
.preview-panel > .section-assist-panel .missing-chip {
  padding: 4px 7px !important;
  font-size: 10.8px !important;
}

/* 参考图在中栏下半部分，压缩但保留完整区域 */
.reference-strip.card-lite.match-stage-card {
  padding: 10px !important;
}
.reference-strip .section-head,
.match-stage-card .section-head {
  margin-bottom: 5px !important;
}
.ref-strip-toolbar.preview-topline {
  padding: 6px 8px !important;
  margin-bottom: 5px !important;
}
#matchPreview,
.match-stage-card #matchPreview {
  padding: 7px !important;
}
.match-thumb {
  flex-basis: 86px !important;
  width: 86px !important;
  min-height: 106px !important;
}
.match-thumb img,
.match-thumb-placeholder {
  height: 64px !important;
}

/* 左栏专门给提示词腾空间，不再放补生助手 */
.composer-scroll {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 9px 12px 4px !important;
  gap: 6px !important;
}
.field-grid.compact-fields {
  flex: 0 0 auto !important;
}
.ratio-picks {
  flex: 0 0 auto !important;
}
.script-import-panel {
  flex: 0 0 auto !important;
}
.current-section-hint {
  flex: 0 0 auto !important;
  max-height: 28px !important;
}
.prompt-area {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.prompt-area textarea#prompt {
  flex: 1 1 auto !important;
  min-height: 260px !important;
  height: auto !important;
  max-height: none !important;
  font-size: 13px !important;
  line-height: 1.48 !important;
  padding: 10px !important;
  resize: none !important;
}
.prompt-area > small {
  display: none !important;
}

/* 脚本导入再压缩一点，让提示词更高 */
.script-import-panel {
  padding: 7px !important;
  gap: 5px !important;
}
.script-import-actions input[type="file"],
.script-import-actions button {
  min-height: 31px !important;
  height: 31px !important;
}
.script-import-status {
  max-height: 35px !important;
  padding: 5px 7px !important;
}
.script-control-panel {
  padding: 5px !important;
}
.script-current-pill {
  max-height: 34px !important;
  padding: 5px 7px !important;
}
.script-control-actions button {
  min-height: 29px !important;
  height: 29px !important;
}
.composer-footer {
  padding: 6px 12px 7px !important;
}
.actions-row.sticky-actions button {
  height: 32px !important;
  min-height: 32px !important;
}
.actions-row.sticky-actions #oneClickRunBtn {
  height: 40px !important;
}

/* 不让中栏/右栏出现页面级滚动 */
.preview-panel,
.preview-panel > .section-assist-panel,
.reference-strip,
.result-stage {
  overflow: hidden !important;
}

@media (max-width: 1500px) {
  .studio-layout {
    grid-template-columns: 390px minmax(350px, .84fr) minmax(470px, 1.16fr) !important;
  }
  .preview-panel {
    grid-template-columns: minmax(350px, .84fr) minmax(470px, 1.16fr) !important;
  }
  .preview-panel > .section-assist-panel .section-assist-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-height: 780px) {
  .preview-panel {
    grid-template-rows: minmax(190px, 31%) minmax(0, 1fr) !important;
  }
  .prompt-area textarea#prompt {
    min-height: 190px !important;
  }
  .preview-panel > .section-assist-panel .repair-actions {
    display: none !important;
  }
  .preview-panel > .section-assist-panel .missing-section-list {
    max-height: 45px !important;
  }
}

/* V50: JSON / model diagnosis visibility fixes */
.model-diagnosis-box {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}
.json-help {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.5;
}
.task-json-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  white-space: pre;
}
.json-inline-actions,
.json-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.json-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
}
.json-modal-overlay.hidden { display: none; }
.json-modal-card {
  width: min(980px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}
.json-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.json-modal-textarea {
  width: 100%;
  height: min(62vh, 560px);
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #020617;
  color: #e2e8f0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  white-space: pre;
}


/* V53: 右侧视频生成显示区域 40窗口紧凑网格
   目标：右侧区域自己滚动，整页不滚动；卡片缩小，常规桌面高度下可同时看到约40个生成窗口。 */
html, body, .app-shell, .content, .studio-tab, .studio-layout, .preview-panel {
  overflow: hidden !important;
}
.result-stage.card-lite,
.result-stage,
.video-stage-card {
  overflow: hidden !important;
  min-height: 0 !important;
}
.result-stage .stage-head {
  flex: 0 0 auto !important;
  min-height: 42px !important;
  margin-bottom: 6px !important;
}
.result-stage .stage-head h3 {
  font-size: 15px !important;
}
.result-stage .queue-actions-stack {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 5px !important;
}
.result-stage .task-filter-tabs button,
.result-stage .queue-tools-row button {
  min-height: 28px !important;
  height: 28px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  border-radius: 10px !important;
}
#queueList.task-list.visual-task-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  padding: 2px 6px 10px 2px !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important;
  grid-auto-rows: 84px !important;
  gap: 6px !important;
  align-content: start !important;
  scrollbar-gutter: stable !important;
}
#queueList.task-list.visual-task-grid::-webkit-scrollbar { width: 10px; }
#queueList.task-list.visual-task-grid::-webkit-scrollbar-track { background: #eef1f8; border-radius: 999px; }
#queueList.task-list.visual-task-grid::-webkit-scrollbar-thumb { background: #b8c0d6; border-radius: 999px; border: 2px solid #eef1f8; }
#queueList .visual-task-card {
  position: relative !important;
  display: block !important;
  height: 84px !important;
  min-height: 84px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  padding: 0 !important;
  box-shadow: 0 5px 14px rgba(23,32,64,.10) !important;
  background: #fff !important;
}
#queueList .task-visual {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit !important;
}
#queueList .task-visual > img,
#queueList .task-visual > video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: none !important;
  filter: saturate(.98) !important;
}
#queueList .video-placeholder-bg {
  font-size: 15px !important;
  letter-spacing: .04em !important;
}
#queueList .progress-glass {
  inset: 0 !important;
  gap: 2px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.54)) !important;
  backdrop-filter: blur(1.2px) !important;
}
#queueList .progress-ring {
  width: 38px !important;
  height: 38px !important;
  box-shadow: 0 5px 14px rgba(84,67,190,.20) !important;
}
#queueList .progress-ring::before { inset: 5px !important; }
#queueList .progress-ring span { font-size: 10px !important; }
#queueList .progress-glass strong {
  font-size: 9px !important;
  padding: 2px 6px !important;
  box-shadow: none !important;
}
#queueList .floating-badge {
  top: 5px !important;
  right: 5px !important;
  font-size: 9px !important;
  padding: 2px 5px !important;
  border-radius: 999px !important;
}
#queueList .task-content {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  padding: 18px 5px 5px !important;
  gap: 2px !important;
  min-height: 31px !important;
  background: linear-gradient(180deg, rgba(15,23,42,0), rgba(15,23,42,.78)) !important;
  color: #fff !important;
  pointer-events: none !important;
}
#queueList .task-head.compact-head {
  margin: 0 !important;
  display: flex !important;
  gap: 4px !important;
  align-items: center !important;
}
#queueList .task-title {
  color: #fff !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.45) !important;
}
#queueList .progress-number {
  font-size: 10px !important;
  color: #fff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.55) !important;
}
#queueList .visual-progress-bar {
  height: 3px !important;
  background: rgba(255,255,255,.42) !important;
}
#queueList .task-meta.compact-meta,
#queueList .task-ref-row,
#queueList .error-summary,
#queueList .model-diagnosis-box,
#queueList .task-details {
  display: none !important;
}
#queueList .task-actions.compact-actions {
  pointer-events: auto !important;
  display: none !important;
  position: absolute !important;
  left: 5px !important;
  right: 5px !important;
  bottom: 5px !important;
  z-index: 5 !important;
  gap: 3px !important;
  padding: 4px !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 8px 20px rgba(15,23,42,.18) !important;
}
#queueList .visual-task-card:hover .task-actions.compact-actions {
  display: flex !important;
  flex-wrap: wrap !important;
}
#queueList .visual-task-card:hover .task-content {
  min-height: 54px !important;
  background: linear-gradient(180deg, rgba(15,23,42,.18), rgba(15,23,42,.86)) !important;
}
#queueList .task-actions.compact-actions button {
  height: 21px !important;
  min-height: 21px !important;
  padding: 2px 5px !important;
  border-radius: 7px !important;
  font-size: 9px !important;
  line-height: 1 !important;
}
#queueList .visual-task-card.done .progress-glass {
  display: none !important;
}
#queueList .visual-task-card.done .task-visual > video {
  object-fit: cover !important;
}
#queueList .visual-task-card.fail {
  border-color: rgba(239,71,111,.70) !important;
}
#queueList .visual-task-card.fail::after {
  content: '失败';
  position: absolute;
  left: 5px;
  top: 5px;
  z-index: 4;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #be123c;
  font-weight: 900;
  font-size: 9px;
}
#queueList.task-list.empty.stage-empty {
  overflow: hidden !important;
}
@media (min-width: 1600px) {
  #queueList.task-list.visual-task-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    grid-auto-rows: 88px !important;
  }
  #queueList .visual-task-card { height: 88px !important; min-height: 88px !important; }
}
@media (max-height: 780px) {
  #queueList.task-list.visual-task-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    grid-auto-rows: 76px !important;
    gap: 5px !important;
  }
  #queueList .visual-task-card { height: 76px !important; min-height: 76px !important; }
  #queueList .progress-ring { width: 32px !important; height: 32px !important; }
}

/* V73: local/remote generated video preview fix */
.video-play-overlay {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(79, 70, 229, .92);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .24);
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
#queueList .video-play-overlay {
  left: 5px !important;
  right: auto !important;
  bottom: 5px !important;
  padding: 2px 6px !important;
  font-size: 9px !important;
}
.video-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(6px);
}
.video-preview-overlay.hidden { display: none; }
.video-preview-card {
  width: min(980px, 96vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: #0b1020;
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
}
.video-preview-head,
.video-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.video-preview-head strong {
  max-width: 760px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.video-preview-card video {
  width: 100%;
  max-height: 76vh;
  background: #000;
  border-radius: 12px;
  object-fit: contain;
}

/* V88 强制检测版 */





/* V99.6 全剧角色身份证、服装状态与一致性复核 */
.video-character-registry-panel{margin-bottom:10px;padding:12px;border:1px solid #ded8ff;background:#fbfaff;border-radius:14px}.video-character-registry-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.video-character-registry-head h3{margin:0 0 4px;font-size:16px}.video-character-registry-head p{margin:0;color:#6d6477;font-size:12px}.video-character-registry-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:9px;margin-top:10px}.continuity-registry-card{display:grid;grid-template-columns:54px 1fr auto;gap:9px;align-items:center;background:#fff;border:1px solid #e5e0ff;border-radius:12px;padding:8px}.continuity-registry-avatar{width:54px;height:54px;border-radius:10px;background:#ede9ff;color:#5b45c7;display:flex;align-items:center;justify-content:center;font-weight:900;overflow:hidden}.continuity-registry-avatar img{width:100%;height:100%;object-fit:cover}.continuity-registry-main{display:flex;flex-direction:column;min-width:0}.continuity-registry-main strong{font-size:14px}.continuity-registry-main span,.continuity-registry-main small{font-size:11px;color:#746b7c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.continuity-registry-checks{display:flex;flex-direction:column;gap:3px;font-size:10px}.continuity-registry-checks span{padding:2px 5px;border-radius:999px}.continuity-registry-checks .ok{background:#e8fff0;color:#16834c}.continuity-registry-checks .bad{background:#fff0f3;color:#c53b61}.continuity-registry-checks .warn{background:#fff8df;color:#9a6b00}.continuity-registry-empty{padding:16px;text-align:center;color:#82798b;border:1px dashed #d8d1ff;border-radius:11px}.continuity-registry-tip{font-size:11px;color:#6d6477;margin-top:8px}.continuity-audit-modal{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center}.continuity-audit-modal.hidden{display:none}.continuity-audit-backdrop{position:absolute;inset:0;background:rgba(21,18,35,.58)}.continuity-audit-dialog{position:relative;width:min(1180px,94vw);max-height:92vh;overflow:auto;background:#fff;border-radius:18px;padding:16px;box-shadow:0 24px 80px rgba(0,0,0,.28)}.continuity-audit-head{display:flex;justify-content:space-between;gap:12px;align-items:center}.continuity-audit-head>div{display:flex;flex-direction:column}.continuity-audit-head span{font-size:12px;color:#756c7c}.continuity-audit-scores{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}.continuity-audit-scores div{padding:10px;background:#f7f5ff;border-radius:12px;text-align:center}.continuity-audit-scores strong{display:block;font-size:26px;color:#654dff}.continuity-audit-scores span{font-size:11px;color:#6e6577}.continuity-audit-frames{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:9px}.continuity-audit-frames figure{margin:0;background:#f4f3f8;border-radius:11px;overflow:hidden}.continuity-audit-frames img{width:100%;aspect-ratio:9/16;object-fit:contain;background:#111;display:block}.continuity-audit-frames figcaption{font-size:11px;padding:6px;text-align:center}.continuity-audit-note{margin-top:10px;padding:9px;background:#fff7df;color:#8a6500;border-radius:10px;font-size:12px}.continuity-audit-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}@media(max-width:900px){.video-character-registry-head{flex-direction:column}.continuity-audit-frames{grid-template-columns:repeat(2,1fr)}.continuity-audit-scores{grid-template-columns:1fr}}


/* V100.9 镜头状态机 + 道具追踪 + 轴线锁定 + 尾帧接力 */
#videoContinuityLockBanner{display:none!important}
.preview-panel{position:relative!important}

/* 参考图区域不再被角色身份证和连续性说明挤占；内容可完整滚动 */
.reference-strip.card-lite.match-stage-card,
.reference-strip,
.match-stage-card{
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
#matchPreview,
.match-stage-card #matchPreview,
#matchPreview.match-preview-box{
  flex:1 1 auto!important;
  min-height:150px!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable!important;
  overscroll-behavior:contain!important;
}
#matchPreview .match-preview-rich{
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
  min-height:max-content!important;
}
#matchPreview .match-task-card{
  flex:0 0 auto!important;
  min-height:154px!important;
  overflow:visible!important;
}
#matchPreview .match-thumb-row{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
  min-height:112px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding:4px 2px 8px!important;
  scrollbar-gutter:stable!important;
}
#matchPreview .match-thumb{
  flex:0 0 108px!important;
  width:108px!important;
  min-height:108px!important;
}
#matchPreview .match-thumb img,
#matchPreview .match-thumb-placeholder{
  height:76px!important;
  object-fit:contain!important;
}
#activeRefsBar.active-refs-bar{
  flex:0 0 auto!important;
  max-height:54px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  white-space:nowrap!important;
}

/* 一键展开参考图预览，完整覆盖中右两栏；按 Esc 或“恢复布局”退出 */
.preview-panel.reference-preview-expanded .reference-strip.card-lite.match-stage-card,
.preview-panel.reference-preview-expanded .reference-strip{
  position:absolute!important;
  inset:0!important;
  z-index:80!important;
  width:100%!important;
  height:100%!important;
  max-height:none!important;
  grid-column:1 / 3!important;
  grid-row:1 / 3!important;
  background:#fff!important;
  box-shadow:0 18px 55px rgba(35,26,75,.22)!important;
}
.preview-panel.reference-preview-expanded > .section-assist-panel,
.preview-panel.reference-preview-expanded > .result-stage{
  visibility:hidden!important;
  pointer-events:none!important;
}
.preview-panel.reference-preview-expanded #matchPreview{
  min-height:0!important;
  height:100%!important;
}
.preview-panel.reference-preview-expanded #matchPreview .match-preview-rich{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr))!important;
  align-content:start!important;
}

/* 角色身份证不再参与主页面网格排版，重建后视频区大小保持不变 */
.video-registry-backdrop{
  position:fixed!important;
  inset:0!important;
  z-index:1997!important;
  background:rgba(20,16,38,.34)!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transition:opacity .18s ease,visibility .18s ease!important;
}
.video-registry-backdrop.is-open{
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
}
.video-character-registry-panel.video-registry-drawer{
  --registry-card-min:190px;
  position:fixed!important;
  top:78px!important;
  right:12px!important;
  bottom:12px!important;
  z-index:1998!important;
  display:flex!important;
  flex-direction:column!important;
  width:min(720px,65vw)!important;
  height:auto!important;
  max-height:calc(100vh - 90px)!important;
  margin:0!important;
  padding:12px!important;
  overflow:hidden!important;
  transform:translateX(calc(100% + 28px))!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  box-shadow:0 22px 70px rgba(31,24,72,.3)!important;
  transition:transform .22s ease,opacity .18s ease,visibility .18s ease,width .18s ease!important;
}
.video-character-registry-panel.video-registry-drawer.is-open{
  transform:translateX(0)!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
}
.video-character-registry-panel.registry-size-small{width:min(720px,65vw)!important;--registry-card-min:180px}
.video-character-registry-panel.registry-size-medium{width:min(980px,78vw)!important;--registry-card-min:220px}
.video-character-registry-panel.registry-size-large{width:min(1280px,90vw)!important;--registry-card-min:250px}
.video-registry-drawer .video-character-registry-head{
  flex:0 0 auto!important;
  align-items:flex-start!important;
  padding-bottom:8px!important;
  border-bottom:1px solid #ece8ff!important;
}
.registry-drawer-controls{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  flex-wrap:wrap!important;
}
.registry-zoom-label{
  min-width:42px!important;
  text-align:center!important;
  padding:5px 8px!important;
  border-radius:999px!important;
  background:#f0edff!important;
  color:#5c45c7!important;
  font-size:12px!important;
  font-weight:800!important;
}
.registry-drawer-actions{
  flex:0 0 auto!important;
  padding:8px 0!important;
  border-bottom:1px solid #f0edff!important;
}
.video-registry-drawer .video-character-registry-list{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  grid-template-columns:repeat(auto-fill,minmax(var(--registry-card-min),1fr))!important;
  align-content:start!important;
  padding:2px 4px 10px 0!important;
  scrollbar-gutter:stable!important;
}
.video-registry-drawer.registry-size-small .continuity-registry-card{
  grid-template-columns:40px 1fr auto!important;
  gap:6px!important;
  padding:6px!important;
}
.video-registry-drawer.registry-size-small .continuity-registry-avatar{
  width:40px!important;
  height:40px!important;
}
.video-registry-drawer.registry-size-small .continuity-registry-main strong{font-size:12px!important}
.video-registry-drawer.registry-size-small .continuity-registry-main span,
.video-registry-drawer.registry-size-small .continuity-registry-main small{font-size:9.5px!important}
.video-registry-drawer.registry-size-small .continuity-registry-checks{font-size:9px!important}
.video-registry-drawer .continuity-registry-tip{
  flex:0 0 auto!important;
  margin-top:6px!important;
  padding-top:6px!important;
  border-top:1px solid #f0edff!important;
}
.continuity-registry-open-btn span{
  display:inline-flex!important;
  min-width:18px!important;
  height:18px!important;
  align-items:center!important;
  justify-content:center!important;
  margin-left:4px!important;
  padding:0 5px!important;
  border-radius:999px!important;
  background:#ebe7ff!important;
  color:#5d46c9!important;
  font-size:10px!important;
  font-weight:900!important;
}
@media(max-width:900px){
  .video-character-registry-panel.video-registry-drawer,
  .video-character-registry-panel.registry-size-small,
  .video-character-registry-panel.registry-size-medium,
  .video-character-registry-panel.registry-size-large{
    top:68px!important;
    right:6px!important;
    bottom:6px!important;
    width:calc(100vw - 12px)!important;
    max-height:calc(100vh - 74px)!important;
  }
  .video-registry-drawer .video-character-registry-list{
    grid-template-columns:1fr!important;
  }
}

/* V100.9 镜头状态机 / 道具追踪 / 轴线锁 / 尾帧接力 */
.shot-continuity-panel{margin:10px 0;border:1px solid #cfd8ff;background:linear-gradient(135deg,#f7f9ff,#f4fff9);border-radius:14px;overflow:hidden}
.shot-continuity-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;padding:12px 14px;list-style:none}
.shot-continuity-panel>summary::-webkit-details-marker{display:none}
.shot-continuity-panel>summary span:first-child{display:flex;align-items:center;gap:10px;min-width:0}
.shot-continuity-panel>summary strong{font-size:15px;color:#25326a}
.shot-continuity-panel>summary small{color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.continuity-status-badge{font-size:11px;font-weight:800;padding:4px 9px;border-radius:999px;background:#eef1ff;color:#5e4fd7;white-space:nowrap}
.continuity-status-badge.ok{background:#e7faef;color:#13783f}.continuity-status-badge.warn{background:#fff4d8;color:#9b6500}.continuity-status-badge.bad{background:#ffe9ef;color:#b82955}
.shot-continuity-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:0 14px 10px}
.shot-continuity-tools .checkline{margin-right:auto}
.shot-continuity-summary{margin:0 14px 10px;padding:9px 11px;border-radius:10px;background:#fff;border:1px solid #e4e8f5;font-size:12px;line-height:1.55;color:#4b5565}
.shot-continuity-timeline{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px;padding:0 14px 14px;max-height:310px;overflow:auto}
.shot-state-card{border:1px solid #dfe4f2;background:#fff;border-radius:11px;padding:9px;min-width:0}
.shot-state-card.has-conflict{border-color:#ffb5c8;background:#fff8fa}
.shot-state-card .shot-state-head{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:5px}
.shot-state-card .shot-state-head strong{font-size:13px;color:#2f3566}.shot-state-card .shot-state-head span{font-size:10px;padding:2px 6px;border-radius:999px;background:#eef1ff;color:#5e4fd7}
.shot-state-card p{margin:3px 0;font-size:11px;line-height:1.45;color:#5f6674;word-break:break-word}
.shot-state-card .conflict-line{color:#b82955;font-weight:700}
.tail-frame-relay-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 7px;border-radius:999px;background:#e9f9ff;color:#08789b;font-size:10px;font-weight:800}
@media(max-width:1180px){.shot-continuity-timeline{grid-template-columns:1fr}.shot-continuity-tools .checkline{width:100%;margin-right:0}}

/* V100.9：结果卡片自适应 + 一致性复核状态不再挤进小卡片 */
.continuity-review-badge{
  position:absolute;
  left:8px;
  top:8px;
  z-index:7;
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  line-height:1;
  background:rgba(255,255,255,.94);
  color:#7a5d00;
  border:1px solid rgba(240,187,64,.55);
  box-shadow:0 5px 15px rgba(15,23,42,.14);
  pointer-events:none;
}
.continuity-review-badge.ok{color:#0f7a46;border-color:rgba(25,181,122,.42);background:rgba(239,255,246,.96)}
.continuity-review-badge.bad{color:#be123c;border-color:rgba(239,71,111,.44);background:rgba(255,242,246,.97)}
.continuity-review-badge.warn{color:#8a6500;border-color:rgba(240,187,64,.55);background:rgba(255,249,226,.97)}

#queueList .task-review-detail,
#queueList .task-content > .inline-result{
  display:none!important;
}
#queueList .continuity-review-badge{
  left:5px!important;
  top:5px!important;
  padding:2px 5px!important;
  font-size:9px!important;
}

/* 1-2条任务时不再只有一个邮票大小的卡片 */
#queueList.queue-density-large{
  grid-template-columns:repeat(auto-fill,minmax(300px,440px))!important;
  grid-auto-rows:250px!important;
  justify-content:start!important;
  gap:12px!important;
}
#queueList.queue-density-large .visual-task-card{
  height:250px!important;
  min-height:250px!important;
  border-radius:16px!important;
}
#queueList.queue-density-large .task-title{font-size:13px!important;line-height:1.3!important}
#queueList.queue-density-large .progress-number{font-size:12px!important}
#queueList.queue-density-large .task-content{padding:44px 10px 10px!important;min-height:62px!important}
#queueList.queue-density-large .video-play-overlay{padding:6px 10px!important;font-size:11px!important;left:10px!important;bottom:10px!important}
#queueList.queue-density-large .floating-badge{top:9px!important;right:9px!important;font-size:10px!important;padding:4px 8px!important}
#queueList.queue-density-large .continuity-review-badge{left:9px!important;top:9px!important;font-size:10px!important;padding:4px 8px!important}

/* 3-8条任务使用中等卡片，仍能直接分辨画面 */
#queueList.queue-density-medium{
  grid-template-columns:repeat(auto-fill,minmax(190px,1fr))!important;
  grid-auto-rows:145px!important;
  gap:8px!important;
}
#queueList.queue-density-medium .visual-task-card{
  height:145px!important;
  min-height:145px!important;
  border-radius:13px!important;
}
#queueList.queue-density-medium .task-content{padding:32px 7px 7px!important;min-height:46px!important}
#queueList.queue-density-medium .task-title{font-size:11px!important}
#queueList.queue-density-medium .floating-badge{top:6px!important;right:6px!important}
#queueList.queue-density-medium .continuity-review-badge{left:6px!important;top:6px!important}

/* 9条以上继续使用原来的40窗口紧凑模式 */
#queueList.queue-density-compact .visual-task-card{
  min-width:0!important;
}

/* 历史记录中的视频稳定预览 */
#historyList .task-visual > video{
  background:#0a0f18;
  object-fit:contain;
}
#historyList .continuity-review-badge{
  top:10px;
  left:10px;
}

@media(max-width:900px){
  #queueList.queue-density-large,
  #queueList.queue-density-medium{
    grid-template-columns:1fr!important;
    grid-auto-rows:220px!important;
  }
  #queueList.queue-density-large .visual-task-card,
  #queueList.queue-density-medium .visual-task-card{
    height:220px!important;
    min-height:220px!important;
  }
}

/* =========================================================
   V100.9：中栏独立滚动 + 右侧视频生成区贯穿整栏
   解决：参考图下方内容被裁切、连续性面板产生隐式网格行、右下出现空白断层
   ========================================================= */
.preview-panel{
  grid-template-columns:minmax(390px,.86fr) minmax(520px,1.2fr)!important;
  grid-template-rows:minmax(220px,32%) minmax(250px,1fr) auto!important;
  gap:10px!important;
  min-height:0!important;
  overflow:hidden!important;
}
.preview-panel > .section-assist-panel{
  grid-column:1!important;
  grid-row:1!important;
  min-height:0!important;
}
.preview-panel > .reference-strip.card-lite.match-stage-card,
.preview-panel > .reference-strip,
.preview-panel > .match-stage-card{
  grid-column:1!important;
  grid-row:2!important;
  min-height:0!important;
  height:100%!important;
  overflow:hidden!important;
}
.preview-panel > .shot-continuity-panel{
  grid-column:1!important;
  grid-row:3!important;
  width:100%!important;
  min-width:0!important;
  min-height:46px!important;
  max-height:min(32vh,320px)!important;
  margin:0!important;
  align-self:end!important;
  overflow:hidden!important;
}
.preview-panel > .shot-continuity-panel[open]{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable!important;
  overscroll-behavior:contain!important;
}
.preview-panel > .result-stage.card-lite,
.preview-panel > .result-stage,
.preview-panel > .video-stage-card{
  grid-column:2!important;
  grid-row:1 / 4!important;
  align-self:stretch!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  margin:0!important;
}

/* 参考图标题保持固定，标题下全部内容在同一个纵向滚动区中查看 */
.reference-scroll-body{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 5px 8px 0!important;
  scrollbar-gutter:stable!important;
  overscroll-behavior:contain!important;
}
.reference-scroll-body::-webkit-scrollbar{width:10px}
.reference-scroll-body::-webkit-scrollbar-track{background:#eef1f8;border-radius:999px}
.reference-scroll-body::-webkit-scrollbar-thumb{background:#aeb8d2;border:2px solid #eef1f8;border-radius:999px}
.reference-scroll-body #matchPreview,
.reference-scroll-body #matchPreview.match-preview-box{
  flex:none!important;
  min-height:170px!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
.reference-scroll-body #matchPreview .match-preview-rich{
  height:auto!important;
  min-height:max-content!important;
  overflow:visible!important;
}
.reference-scroll-body #activeRefsBar.active-refs-bar{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  gap:6px!important;
  max-height:none!important;
  min-height:36px!important;
  overflow:visible!important;
  white-space:normal!important;
  line-height:1.5!important;
}
.reference-scroll-body #activeRefsBar.hidden,
.reference-scroll-body #publicCheckResult.hidden{display:none!important}
.reference-scroll-body #publicCheckResult{
  max-height:none!important;
  overflow:visible!important;
  margin-bottom:4px!important;
}

/* 展开参考图时，滚动区占满可用高度 */
.preview-panel.reference-preview-expanded .reference-scroll-body{
  height:100%!important;
  max-height:none!important;
}
.preview-panel.reference-preview-expanded > .shot-continuity-panel{
  visibility:hidden!important;
  pointer-events:none!important;
}

/* 右侧只有1-2个任务时，任务卡铺满结果区，视频可直接看清 */
#queueList.queue-density-large{
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr))!important;
  grid-auto-rows:minmax(320px,56vh)!important;
  justify-content:stretch!important;
  align-content:start!important;
  gap:12px!important;
}
#queueList.queue-density-large .visual-task-card{
  width:100%!important;
  height:min(56vh,560px)!important;
  min-height:320px!important;
  max-height:560px!important;
}
#queueList.queue-density-large .task-visual > video{
  object-fit:contain!important;
  background:#05070b!important;
}
#queueList.queue-density-large .task-visual > img{
  object-fit:cover!important;
}
#queueList.queue-density-medium .task-visual > video{
  object-fit:contain!important;
  background:#05070b!important;
}

/* 播放器错误与加载状态 */
.video-preview-status{
  min-height:34px;
  padding:8px 10px;
  border-radius:10px;
  background:#f4f6ff;
  color:#4e5772;
  font-size:12px;
  line-height:1.45;
}
.video-preview-status.ok{background:#eafaf1;color:#126c3f}
.video-preview-status.warn{background:#fff6df;color:#8a6200}
.video-preview-status.bad{background:#fff0f4;color:#b4234d}
.video-preview-actions{justify-content:flex-end!important}
.video-preview-card video{
  min-height:260px;
  background:#02040a!important;
}
.video-preview-card.is-loading video{opacity:.45}

@media(max-height:780px){
  .preview-panel{
    grid-template-rows:minmax(185px,29%) minmax(220px,1fr) auto!important;
  }
  .preview-panel > .shot-continuity-panel{max-height:210px!important}
  #queueList.queue-density-large .visual-task-card{
    height:min(52vh,430px)!important;
    min-height:260px!important;
  }
}
@media(max-width:1180px){
  .preview-panel{
    grid-template-columns:minmax(330px,.82fr) minmax(440px,1.18fr)!important;
  }
}

/* V100.9 reference delivery audit */
.reference-delivery-audit span{color:#596579}.reference-delivery-audit{white-space:normal}.inline-result{white-space:pre-wrap}.reference-scroll-body{scrollbar-gutter:stable}

/* V100.10.15 当前节精准参考图匹配与最终请求审计 */
.reference-plan-card{border-color:#dcd6ff;background:#fff}
.reference-plan-card.has-error{border-color:#ffb4c3;background:#fffafb}
.reference-plan-summary{display:grid;grid-template-columns:1fr;gap:5px;margin:8px 0;padding:8px;border-radius:11px;background:#f8f7ff;border:1px solid #ebe7ff}
.reference-plan-row{display:grid;grid-template-columns:132px 1fr;gap:8px;align-items:start;font-size:11px;line-height:1.45}
.reference-plan-row strong{color:#51496a;white-space:nowrap}
.reference-plan-row span{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.reference-plan-row em{font-style:normal;padding:2px 7px;border-radius:999px;background:#ede9ff;color:#5c46c8;border:1px solid #d8d0ff}
.reference-plan-row i{font-style:normal;color:#9a93a8}
.reference-plan-row.excluded em{background:#fff8df;color:#8a6500;border-color:#f3d98c}
.reference-plan-row.danger em{background:#fff0f3;color:#c33a5d;border-color:#ffb4c3}
.reference-plan-row.final em{background:#eafff2;color:#157d4b;border-color:#b7edcf}
.reference-plan-row.declared em{background:#eef6ff;color:#2464ad;border-color:#c9def8}
.reference-delivery-audit .reference-selection-ok{display:inline-block;margin-top:4px;padding:2px 7px;border-radius:999px;background:#eafff2;color:#157d4b}
@media(max-width:900px){.reference-plan-row{grid-template-columns:1fr}.reference-plan-row strong{white-space:normal}}

/* V100.9.4：角色身份证抽屉按钮点击兜底，避免遮罩/层级/旧缓存导致按钮看似无反应 */
.video-character-registry-panel.video-registry-drawer.is-open,
.video-character-registry-panel.video-registry-drawer.is-open *{
  pointer-events:auto!important;
}
.video-character-registry-panel.video-registry-drawer.is-open .registry-drawer-actions,
.video-character-registry-panel.video-registry-drawer.is-open .registry-drawer-controls{
  position:relative!important;
  z-index:5!important;
}
.video-character-registry-panel.video-registry-drawer.is-open button{
  position:relative!important;
  z-index:6!important;
  cursor:pointer!important;
}
.registry-action-status.info{background:#f5f7ff!important;color:#4054a8!important;border-color:#cfd8ff!important}
.registry-action-status.ok{background:#ecfff4!important;color:#16834c!important;border-color:#bcefd0!important}
.registry-action-status.bad{background:#fff0f3!important;color:#c53b61!important;border-color:#ffc6d2!important}


/* V100.10.18：已完成任务卡片使用稳定静态封面，避免轮询重绘时 video 元素反复重建造成闪烁。 */
.task-visual > .stable-video-poster,
#queueList .task-visual > .stable-video-poster,
#historyList .task-visual > .stable-video-poster {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transform: none !important;
  filter: saturate(.98) !important;
  animation: none !important;
  transition: none !important;
  backface-visibility: hidden;
  contain: paint;
}
.query-recovery-status { overflow-wrap: anywhere; }


/* V100.10.19：真实高并发与按条数范围生成 */
.section-range-generator{
  display:grid;
  gap:7px;
  padding:9px 10px;
  border:1px solid #d9d0ff;
  border-radius:12px;
  background:linear-gradient(135deg,#f8f5ff 0%,#eef8ff 100%);
}
.section-range-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.section-range-head strong{font-size:13px;color:#3f3274}
.range-concurrency-hint{font-size:11px;font-weight:800;padding:3px 8px;border-radius:999px;white-space:normal}
.range-concurrency-hint.ok{background:#e8fff2;color:#147a49;border:1px solid #b7edcf}
.range-concurrency-hint.warn{background:#fff7df;color:#8a6200;border:1px solid #f1d68a}
.section-range-controls{display:grid;grid-template-columns:auto auto auto auto minmax(132px,1fr);gap:7px;align-items:center}
.section-range-controls label{display:flex;align-items:center;gap:5px;font-size:12px;font-weight:700;color:#4f5268;white-space:nowrap}
.section-range-controls > span{font-size:12px;color:#74798d;text-align:center}
.section-range-controls input{width:58px;height:34px;padding:5px 7px;border:1px solid #cbc6e9;border-radius:9px;background:#fff;text-align:center;font-weight:800;color:#4e35bf}
.section-range-controls button{min-height:36px;padding:7px 12px;border-radius:10px;font-size:12.5px;font-weight:900}
.section-range-generator small{font-size:11.5px;line-height:1.45;color:#646b80}
@media(max-width:1250px){
  .section-range-controls{grid-template-columns:1fr auto 1fr 1fr}
  .section-range-controls button{grid-column:1/-1}
  .section-range-controls label{justify-content:center}
}
@media(max-width:720px){
  .section-range-controls{grid-template-columns:1fr 1fr}
  .section-range-controls > span{display:none}
  .section-range-controls label{justify-content:flex-start}
}


/* V100.10.25 同人重复可视强控 */
.unique-person-strict-panel{margin:10px 0;padding:10px 12px;border:1px solid #ffb5a8;border-radius:12px;background:linear-gradient(135deg,#fff7f4,#fffdfb);box-shadow:0 4px 14px rgba(214,73,51,.08)}
.unique-person-strict-toggle{display:flex;align-items:flex-start;gap:9px;cursor:pointer;color:#642219}
.unique-person-strict-toggle input{width:18px;height:18px;margin-top:2px;accent-color:#ef5b43;flex:0 0 auto}
.unique-person-strict-toggle span{display:flex;flex-direction:column;gap:3px;line-height:1.35}
.unique-person-strict-toggle strong{font-size:13px;color:#b52f1d}
.unique-person-strict-toggle small{font-size:11px;color:#7e514a}
.unique-person-strict-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px;flex-wrap:wrap}
.unique-person-strict-status{font-size:11px;padding:5px 8px;border-radius:999px;background:#eafaf0;color:#13733b;border:1px solid #bce8cc}
.unique-person-strict-status.warn{background:#fff5e8;color:#9a5a00;border-color:#ffd69d}
.unique-person-strict-status.bad{background:#fff0f0;color:#ad1e1e;border-color:#ffc4c4}

.unique-person-strict-panel.disabled-soft{opacity:.82;border-style:dashed}

/* V100.10.34: visible HTTPS reference relay status */
.relay-header-pill{white-space:nowrap;font-weight:700}
.relay-status-banner{display:flex;flex-direction:column;gap:3px;padding:10px 12px;margin:0 0 10px;border-radius:12px;border:1px solid rgba(231,168,0,.35);background:rgba(231,168,0,.08);color:#946200;font-size:12px;line-height:1.4}
.relay-status-banner strong{font-size:13px}
.relay-status-banner.ready{border-color:rgba(25,181,122,.38);background:rgba(25,181,122,.09);color:#087b50}
.relay-status-banner.bad{border-color:rgba(239,71,111,.4);background:rgba(239,71,111,.09);color:#b4234f}


/* V100.10.35 文案滚动拖动查看修复 */
.script-import-status,
.script-current-pill,
.section-status-summary {
  position: relative;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  text-overflow: clip !important;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.script-import-status::-webkit-scrollbar,
.script-current-pill::-webkit-scrollbar,
.section-status-summary::-webkit-scrollbar {
  height: 8px;
}
.script-import-status::-webkit-scrollbar-thumb,
.script-current-pill::-webkit-scrollbar-thumb,
.section-status-summary::-webkit-scrollbar-thumb {
  background: rgba(109, 93, 252, .35);
  border-radius: 999px;
}
.script-import-status.scrollable-drag,
.script-current-pill.scrollable-drag,
.section-status-summary.scrollable-drag {
  cursor: grab;
  user-select: text;
}
.script-import-status.scrollable-drag.dragging,
.script-current-pill.scrollable-drag.dragging,
.section-status-summary.scrollable-drag.dragging {
  cursor: grabbing;
}
.script-import-status::after,
.script-current-pill::after,
.section-status-summary::after {
  content: attr(data-scroll-hint);
  position: sticky;
  right: 0;
  float: right;
  margin-left: 8px;
  padding-left: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.92) 18px);
  color: #7a6df2;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}
.script-import-status[data-scroll-ready="0"]::after,
.script-current-pill[data-scroll-ready="0"]::after,
.section-status-summary[data-scroll-ready="0"]::after {
  content: '';
  display: none;
}
.script-import-status {
  max-height: 42px !important;
}
.script-current-pill {
  max-height: 42px !important;
}
.section-status-summary {
  max-width: 100%;
}

/* V100.10.36: cancel HTTPS relay UI and restore direct cloud reference URLs */
#referenceRelayStatus,#referenceRelayBanner{display:none!important}

/* V100.10.37 双云设置 */
#cloudStorageResult{white-space:pre-wrap;max-height:180px;overflow:auto;margin-top:7px}
[data-cloud-provider="common"].checkline{align-items:flex-start;gap:8px}
[data-cloud-provider="common"].checkline small{display:block;margin-left:0}


/* V100.10.39 固定8路真实高并发 */
#videoRangeConcurrency[readonly], #concurrency[readonly] {
  background: #f1efff !important;
  color: #5c44d8 !important;
  font-weight: 900 !important;
  cursor: default !important;
  text-align: center;
}


/* V100.10.40：长文案改为自动换行＋右侧上下滚动条 */
.script-import-status,
.script-current-pill,
.section-status-summary {
  position: relative;
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(109,93,252,.48) rgba(109,93,252,.08);
  cursor: default !important;
  user-select: text;
  -webkit-overflow-scrolling: touch;
}
.script-import-status {
  min-height: 44px !important;
  max-height: 86px !important;
  padding: 7px 24px 7px 8px !important;
  line-height: 1.4 !important;
}
.script-current-pill {
  min-height: 42px !important;
  max-height: 82px !important;
  padding: 7px 24px 7px 8px !important;
  line-height: 1.4 !important;
  border-radius: 12px !important;
}
.section-status-summary {
  min-height: 28px;
  max-height: 66px !important;
  padding-right: 18px;
  line-height: 1.4;
}
.script-import-status::-webkit-scrollbar,
.script-current-pill::-webkit-scrollbar,
.section-status-summary::-webkit-scrollbar {
  width: 9px;
  height: 0;
}
.script-import-status::-webkit-scrollbar-track,
.script-current-pill::-webkit-scrollbar-track,
.section-status-summary::-webkit-scrollbar-track {
  background: rgba(109,93,252,.07);
  border-radius: 999px;
}
.script-import-status::-webkit-scrollbar-thumb,
.script-current-pill::-webkit-scrollbar-thumb,
.section-status-summary::-webkit-scrollbar-thumb {
  background: rgba(109,93,252,.42);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.script-import-status::-webkit-scrollbar-thumb:hover,
.script-current-pill::-webkit-scrollbar-thumb:hover,
.section-status-summary::-webkit-scrollbar-thumb:hover {
  background: rgba(109,93,252,.68);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.script-import-status::after,
.script-current-pill::after,
.section-status-summary::after {
  content: none !important;
  display: none !important;
}
.script-import-status.scrollable-drag,
.script-current-pill.scrollable-drag,
.section-status-summary.scrollable-drag,
.script-import-status.scrollable-drag.dragging,
.script-current-pill.scrollable-drag.dragging,
.section-status-summary.scrollable-drag.dragging {
  cursor: default !important;
}

/* V100.10.60 Cloudflare Access browser remote access */
.form-grid .full-row { grid-column: 1 / -1; }
.remote-access-card details.note { margin-top: 14px; }
.remote-access-card details.note summary { cursor: pointer; margin-bottom: 10px; }
.remote-access-card details.note span { display: block; margin: 6px 0; line-height: 1.55; }
.remote-access-card code { user-select: all; }
