:root {
  color-scheme: var(--dz-scheme, light);
  --page: var(--dz-page);
  --surface: var(--dz-surface);
  --text: var(--dz-text);
  --muted: var(--dz-muted);
  --line: var(--dz-border);
  --orange: var(--dz-accent);
  --orange-dark: var(--dz-accent);
  --orange-soft: var(--dz-accent-soft);
  --green: var(--dz-success);
  --red: var(--dz-danger);
  --shadow: 0 8px 28px rgba(31, 35, 41, 0.06);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--text); }
.public-announcement { position: sticky; top: 0; z-index: 10; width: 100%; padding: 9px 20px; background: #fff8e8; border-bottom: 1px solid #f0d9a6; color: #77511d; text-align: center; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.sidebar {
  position: fixed; inset: var(--announcement-height, 0px) auto 0 0; width: 220px; padding: 26px 14px 18px;
  background: var(--dz-surface); border-right: 1px solid var(--dz-border); display: flex; flex-direction: column; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 12px 30px; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--orange); color: var(--orange); font-weight: 800; border-radius: 7px; }
nav { display: grid; gap: 6px; }
.nav-item { border: 0; background: transparent; color: var(--dz-secondary); height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 12px; border-radius: 6px; width: 100%; }
.nav-item svg { width: 19px; }
.nav-item:hover, .nav-item.active { color: var(--orange-dark); background: var(--orange-soft); }
.page-view.hidden { display: none; }
.transcript-page { max-width: 1420px; margin: 0 auto; padding: 26px 34px 50px; }
.transcript-layout { display: grid; grid-template-columns: minmax(360px, 430px) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.transcript-settings, .transcript-results { padding: 22px; }
.transcript-settings { display: grid; gap: 10px; align-content: start; }
.transcript-settings input, .transcript-settings select { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: var(--surface); color: var(--text); }
.transcript-dropzone { min-height: 190px; border: 1px dashed var(--dz-border); border-radius: 8px; background: var(--dz-subtle); color: var(--text); display: grid; place-content: center; justify-items: center; gap: 9px; padding: 24px; transition: border-color .2s, background .2s; }
.transcript-dropzone:hover, .transcript-dropzone.dragging { border-color: var(--orange); background: var(--orange-soft); }
.transcript-dropzone svg { width: 27px; height: 27px; color: var(--orange-dark); }
.transcript-dropzone strong { font-size: 16px; }
.transcript-dropzone span { color: var(--muted); font-size: 12px; }
.transcript-dropzone small { color: var(--dz-muted); letter-spacing: .12em; font-size: 10px; }
.transcript-settings .file-status { margin: 0; overflow-wrap: anywhere; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.checkbox-line input { width: auto; }
.transcript-settings .primary-button { margin-top: 8px; justify-content: center; }
.transcript-cdk { width: 100%; margin-top: 4px; display: block; }
.transcript-cdk .cdk-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; width: 100%; }
.transcript-cdk .cdk-input-wrap { width: 100%; min-width: 0; }
.transcript-cdk .cdk-entry > button { width: auto; min-width: 0; padding-left: 10px; padding-right: 10px; font-size: 12px; }
.transcript-cdk .cdk-preview { position: static; width: 100%; justify-content: center; padding-top: 7px; overflow: hidden; }
.transcript-list { display: grid; gap: 14px; margin-top: 18px; }
.transcript-result-item { border: 1px solid var(--border); border-radius: 6px; padding: 14px; background: var(--surface); }
.transcript-result-item h3 { margin: 0 0 10px; font-size: 15px; }
.transcript-result-item textarea { width: 100%; min-height: 220px; resize: vertical; box-sizing: border-box; border: 1px solid var(--border); border-radius: 4px; padding: 10px; line-height: 1.6; background: var(--page); color: var(--text); }
.transcript-result-item .result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.transcript-result-item .transcript-delete { color: var(--red); }
.storyboard-page { padding: 26px 34px 50px; }
.storyboard-layout { max-width: 1420px; margin: 0 auto; display: grid; grid-template-columns: minmax(420px, .85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.storyboard-input, .storyboard-results { padding: 22px; }
.storyboard-input { display: grid; gap: 14px; }
.storyboard-source-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.storyboard-settings { display: grid; grid-template-columns: 1fr 150px; gap: 12px; }
.storyboard-settings label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.storyboard-settings input { width: 100%; box-sizing: border-box; height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; }
.storyboard-dropzone { min-height: 170px; }
.storyboard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.storyboard-toolbar-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex-wrap: wrap; }
.unit-transfer-header-actions { align-items: center; justify-content: flex-end; }
.secondary-button.storyboard-action-button { flex: 0 0 auto; width: auto; min-width: 0; color: var(--orange-dark); border-color: var(--orange); background: var(--dz-surface); white-space: nowrap; }
.secondary-button.storyboard-action-button:not(:disabled):hover { color:var(--dz-on-accent); border-color: var(--orange); background: var(--orange); }
.storyboard-action-button svg { flex: 0 0 17px; }
.storyboard-units { display: grid; gap: 10px; padding-top: 14px; max-height: 720px; overflow: auto; }
.storyboard-unit { position: relative; display: grid !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "body" !important; gap: 14px; border: 1px solid var(--line); border-radius: 7px; padding: 58px 14px 13px; background: var(--dz-surface); }
.storyboard-unit.selected { border-color: var(--orange); background: var(--orange-soft); }
.storyboard-unit > .storyboard-unit-head { position: absolute !important; top: 13px; left: 14px; right: 14px; display: flex !important; align-items: center; gap: 10px; width: auto !important; min-width: 0; flex-wrap: nowrap; white-space: nowrap; }
.storyboard-unit > .unit-body { grid-area: body; display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-areas: "editor video"; align-items: start; gap: 14px; min-width: 0; }
.storyboard-unit > .unit-body > .unit-editor { grid-area: editor; }
.storyboard-unit > .unit-body > .unit-video-panel { grid-area: video; }
.storyboard-unit-head label { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; min-width: 0; }
.storyboard-unit-head label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storyboard-unit-head > span:nth-child(2) { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.unit-status { flex: 0 0 auto; margin-left: auto; padding: 4px 7px; border-radius: 4px; color: var(--orange-dark); background: var(--orange-soft); font-size: 11px; white-space: nowrap; }
.unit-status.video_completed { color: var(--green); background: color-mix(in srgb, var(--dz-success) 10%, var(--dz-surface)); }
.unit-status.failed { color: var(--red); background: var(--dz-danger-soft); }
.storyboard-unit p { margin: 10px 0 4px; color: var(--dz-secondary); font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.storyboard-unit-actions { display: flex; justify-content: flex-end; gap: 14px; }
.storyboard-global-model, .unit-model { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.storyboard-global-model { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; margin-bottom: 12px; }
.storyboard-global-model > label { display: grid; gap: 6px; min-width: 0; }
.storyboard-global-model > label:first-child { flex: 0 1 auto; width: max-content; min-width: 280px; max-width: min(560px, 100%); }
.storyboard-global-model > label:first-child select { width: auto; min-width: 280px; max-width: 100%; }
.storyboard-global-model > label:nth-child(2) { flex: 0 0 84px; }
.storyboard-global-model > label:nth-child(3) { flex: 0 0 78px; }
.storyboard-global-model > label:nth-child(4) { flex: 0 0 88px; }
.storyboard-global-model select, .unit-model select, .storyboard-settings select { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; background: var(--dz-surface); color: var(--text); font: inherit; cursor: pointer; }
  .unit-editor { position: relative; grid-area: editor; min-width: 0; display: grid; gap: 7px; }
  .unit-reference-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 34px; padding: 5px 0; }
  .unit-reference-label { width: 100%; color: var(--muted); font-size: 11px; }
  .unit-reference-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 190px; padding: 3px 7px 3px 3px; border: 1px solid var(--dz-border); border-radius: 14px; background: var(--dz-accent-soft); color: var(--dz-accent-hover); font-size: 11px; }
  .unit-reference-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--dz-subtle); }
  .unit-reference-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .unit-reference-empty { color: var(--muted); font-size: 11px; }
  .unit-mention-menu { position: fixed; z-index: 50; overflow: hidden; border: 1px solid var(--dz-accent); border-radius: 8px; background: var(--dz-surface); color: var(--text); box-shadow: 0 12px 28px rgba(65,42,20,.18); }
  .unit-mention-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--dz-border); padding: 2px 4px 0; }
  .unit-mention-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 8px 9px 7px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
  .unit-mention-tabs button.active { border-bottom-color: var(--orange); color: var(--orange-dark); }
  .unit-mention-tabs button small { margin-left: 4px; color: var(--muted); }
  .unit-mention-list { max-height: 260px; overflow-y: auto; padding: 4px 0 6px; }
  .unit-mention-group>strong { display: block; padding: 5px 10px 3px; color: var(--orange-dark); font-size: 10px; }
  .unit-mention-group[data-mention-group="character"]>strong { color: var(--dz-ref-character); }
  .unit-mention-group[data-mention-group="prop"]>strong { color: var(--dz-ref-prop); }
  .unit-mention-menu [role="option"] { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; border-radius: 0; padding: 6px 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
  .unit-mention-menu [role="option"]:hover { background: var(--orange-soft); color: var(--text); }
  .unit-mention-menu [role="option"] img { width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--dz-border); border-radius: 5px; object-fit: cover; background: var(--dz-subtle); }
  .unit-mention-menu [role="option"] span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .unit-mention-menu [role="option"] small { color: var(--muted); font-size: 10px; }
  .unit-prompt-editor { width: 100%; min-height: 250px; max-height: 420px; box-sizing: border-box; resize: vertical; overflow: auto; white-space: pre-wrap; color: var(--dz-secondary); font: inherit; font-size: 13px; line-height: 1.65; border: 1px solid var(--line); border-radius: 5px; padding: 10px; background: var(--dz-surface); }
  .unit-prompt-editor[contenteditable="true"] { outline: none; overflow-y: auto; }
  .unit-prompt-editor[contenteditable="true"]:focus { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-soft); }
  .prompt-mention { display: inline; white-space: nowrap; padding: 1px 3px; border-radius: 4px; font-weight: 600; cursor: pointer; }
  .prompt-mention-character { color: var(--dz-ref-character); background: var(--dz-ref-character-bg); }
  .prompt-mention-scene { color: var(--dz-ref-scene); background: var(--dz-ref-scene-bg); }
  .prompt-mention-prop { color: var(--dz-ref-prop); background: var(--dz-ref-prop-bg); }
  .unit-save-state { color: var(--green); font-size: 11px; }
  .unit-generate-button { width: 100%; justify-content: center; padding: 9px 10px; }
  .unit-generate-button span { font-size: 11px; opacity: .78; }
  .unit-generate-button.is-generating { cursor: wait; opacity: .72; }
  .unit-generate-button.is-generating svg, .unit-video-card.pending svg { animation: storyboard-spin 1s linear infinite; }
  @keyframes storyboard-spin { to { transform: rotate(360deg); } }
  .unit-video-panel { grid-area: video; min-width: 0; display: grid; align-content: start; gap: 8px; }
  .unit-video-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; flex-wrap: nowrap; color: var(--text); font-size: 13px; font-weight: 650; white-space: nowrap; }
  .unit-video-heading-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
  .unit-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
  .unit-icon-button:hover { color: var(--text); background: var(--dz-subtle); }
  .unit-icon-button svg { width: 14px; height: 14px; }
  .unit-video-history { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--dz-surface); }
  .unit-video-version { border: 0; border-radius: 3px; padding: 2px 5px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; }
  .unit-video-version:hover, .unit-video-version.active { color: var(--text); background: var(--dz-subtle); }
  .unit-video-heading > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .unit-video-state { flex: 0 0 auto; padding: 3px 7px; border-radius: 4px; color: var(--orange-dark); background: var(--orange-soft); font-size: 10px; font-weight: 500; white-space: nowrap; }
  .unit-video-state.video_completed { color: var(--green); background: color-mix(in srgb, var(--dz-success) 10%, var(--dz-surface)); }
  .unit-video-state.failed { color: var(--red); background: var(--dz-danger-soft); }
  .unit-video-frame { width: 100%; height: 300px; overflow: hidden; border-radius: 6px; background: var(--dz-text); }
  .unit-video { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; background: var(--dz-text); }
  .unit-video-card { display: grid; align-content: center; justify-items: center; gap: 6px; width: 100%; min-height: 300px; box-sizing: border-box; padding: 16px; border: 1px dashed var(--line); border-radius: 6px; background: var(--dz-subtle); color: var(--dz-secondary); text-align: center; }
  .unit-video-card svg { width: 24px; color: currentColor; }
  .unit-video-card.failed { border-color: var(--dz-danger); background: var(--dz-danger-soft); color: var(--dz-danger); }
  .unit-video-card.pending { border-color: var(--orange); background: var(--orange-soft); color: var(--dz-accent-hover); }
  .unit-download-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: max-content; text-decoration: none; }
  .unit-download-button svg { width: 15px; color: currentColor; }
  .unit-video-card strong, .unit-video-card small { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; text-align: center; }
  .unit-video-card small { color: inherit; }
  .unit-progress { position: relative; height: 5px; overflow: hidden; border-radius: 4px; background: var(--dz-border); }
  .unit-progress-bar { height: 100%; min-width: 3px; border-radius: inherit; background: var(--orange); transition: width .35s ease; }
  .unit-progress span { position: absolute; right: 0; bottom: 7px; color: var(--muted); font-size: 10px; }
  .unit-video-options { display: grid; gap: 8px; }
  .unit-model-primary, .unit-video-suboptions { min-width: 0; }
  .unit-video-suboptions { display: grid; grid-template-columns: minmax(78px, 1fr) minmax(68px, .87fr) minmax(78px, 1fr); gap: 8px; }
  .unit-video-suboptions select { padding-left: 8px; }
  .unit-video-meta { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid var(--dz-border); border-radius: 6px; background: var(--dz-subtle); color: var(--dz-secondary); font-size: 11px; line-height: 1.45; }
  .unit-video-meta strong { min-width: 0; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
  .unit-video-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 9px; padding: 10px; border: 1px solid var(--dz-border); border-radius: 6px; color: var(--muted); font-size: 11px; }
  .unit-video-summary > span { min-width: 0; white-space: nowrap; }
  .unit-video-summary b { min-width: 0; overflow-wrap: anywhere; word-break: break-word; color: var(--text); font-weight: 600; }
@media (max-width: 1100px) { .storyboard-unit { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 900px) { .storyboard-page { padding: 14px; } .storyboard-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .storyboard-unit { grid-template-columns: 1fr !important; grid-template-areas: "body" !important; padding-top: 58px; } .storyboard-unit > .unit-body { grid-template-columns: 1fr; grid-template-areas: "editor" "video"; } .unit-video-panel { width: min(100%, max(240px, 66.6667%)); justify-self: end; } .unit-video-frame { height: 300px; } .unit-video-card { min-height: 180px; } }
@media (max-width: 700px) { .storyboard-toolbar { align-items: flex-start; flex-wrap: wrap; } .storyboard-toolbar-actions { flex: 1 1 100%; } }
@media (max-width: 360px) { .unit-video-suboptions { grid-template-columns: repeat(2, minmax(0, 1fr)); } .unit-video-suboptions > label:last-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .storyboard-settings { grid-template-columns: 1fr; } .storyboard-unit-head { gap: 7px; } }
@media (max-width: 700px) { .storyboard-global-model { align-items: stretch; flex-wrap: wrap; } .storyboard-global-model > label:first-child { flex: 1 1 100%; width: 100%; min-width: 0; max-width: none; } .storyboard-global-model > label:first-child select { width: 100%; min-width: 0; } .storyboard-global-model > label:nth-child(2), .storyboard-global-model > label:nth-child(3), .storyboard-global-model > label:nth-child(4) { flex: 1 1 0; } }
@media (max-width: 900px) { .transcript-page { padding: 14px; } .transcript-layout { grid-template-columns: 1fr; } }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; }
.version { color: var(--dz-muted); font-size: 12px; padding-left: 14px; }

.page-shell { margin-left: 220px; min-height: 100vh; }
.topbar { height: 94px; padding: 0 38px; display: flex; align-items: center; justify-content: flex-start; gap: 28px; background: rgba(245,246,247,.96); border-bottom: 1px solid var(--dz-border); }
.topbar h1 { font-size: 22px; margin: 0 0 6px; }
.topbar p { font-size: 13px; color: var(--muted); margin: 0; }
.global-cdk { width: min(690px, 58%); margin-left: auto; margin-right: 0; align-self: center; display: block; }
.global-cdk .cdk-entry { width: 100%; }
.global-cdk .cdk-preview { position: static; width: 255px; justify-content: flex-start; padding-top: 6px; }
.transcript-action-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; }
.transcript-action-row .primary-button { min-width: 150px; }
.account-chip { max-width: 720px; min-height: 42px; border: 1px solid #e0e2e5; background: var(--dz-surface); border-radius: 6px; padding: 9px 14px; display: flex; align-items: center; gap: 15px; text-align: left; box-shadow: 0 2px 8px rgba(0,0,0,.025); white-space: nowrap; }
.account-chip .status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.account-chip span { font-size: 12px; color: var(--muted); }
.account-chip b { color: var(--dz-secondary); font-weight: 650; }

.workspace-grid { max-width: 1420px; margin: 0 auto; padding: 26px 34px 50px; display: grid; grid-template-columns: minmax(600px, 1fr) 390px; gap: 20px; align-items: stretch; }
.surface { background: var(--surface); border: 1px solid #edeef0; border-radius: 8px; box-shadow: var(--shadow); }
.composer { padding: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2, .tasks h2 { font-size: 17px; margin: 0; }
.source-input-help { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid var(--dz-border); border-radius: 50%; background: transparent; color: var(--dz-muted); font-size: 13px; line-height: 1; cursor: help; }
.source-input-help:hover, .source-input-help:focus-visible { color: var(--dz-accent); border-color: var(--dz-accent); outline: 2px solid var(--dz-accent-soft); outline-offset: 2px; }
.step-number { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; color: var(--orange-dark); background: var(--orange-soft); font-size: 12px; font-weight: 700; }
.character-count { font-size: 12px; color: var(--muted); }
.character-count b { color: #4e5359; }
.source-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.source-tab { padding: 0 3px 11px; background: none; border: 0; color: var(--muted); position: relative; }
.source-tab.active { color: var(--text); font-weight: 600; }
.source-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--orange); }
textarea { resize: vertical; width: 100%; min-height: 250px; max-height: 520px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; line-height: 1.75; outline: none; color: var(--dz-text); }
textarea:focus, input:focus { border-color: #ffb46f; box-shadow: 0 0 0 3px rgba(255,138,42,.1); }
.dropzone { width: 100%; min-height: 250px; border: 1px dashed var(--dz-border); border-radius: 6px; background: var(--dz-subtle); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.dropzone:hover, .dropzone.dragging { border-color: var(--orange); background: var(--orange-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--orange); }
.dropzone strong { color: #45484d; }
.dropzone span { font-size: 12px; }
.file-status { margin-top: 10px; color: var(--green); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 26px 0; }

.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mode-card { min-height: 86px; position: relative; overflow: visible; text-align: left; padding: 10px 12px; border: 1px solid var(--line); background: var(--dz-surface); border-radius: 6px; display: flex; flex-direction: column; gap: 4px; }
.mode-card:hover { border-color: var(--dz-accent); }
.mode-card.selected { border-color: var(--orange); background: var(--orange-soft); box-shadow: inset 0 0 0 1px var(--orange); }
.mode-index { color: #a1a5ab; font-size: 11px; }
.mode-card strong { font-size: 14px; }
.mode-card small { color: var(--orange-dark); }
.mode-tip { opacity: 0; pointer-events: none; position: absolute; left: 50%; bottom: calc(100% + 9px); width: 210px; transform: translate(-50%, 5px); padding: 9px 11px; border: 1px solid var(--dz-border); background: var(--dz-elevated); color: var(--dz-text); box-shadow: var(--dz-shadow); font-size: 12px; line-height: 1.55; border-radius: 5px; z-index: 4; transition: .15s ease; }
.mode-card:hover .mode-tip, .mode-card:focus-visible .mode-tip { opacity: 1; transform: translate(-50%, 0); }
.duration-row { margin-top: 20px; min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: var(--dz-subtle); border-radius: 6px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-help { color: var(--muted); font-size: 12px; }
.product-choice-row { margin-top: 20px; min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px; background: var(--dz-subtle); border: 1px solid var(--dz-subtle); border-radius: 6px; }
.product-choice-row > div { min-width: 0; }
.product-select-wrap { position: relative; width: min(360px, 48%); min-width: 220px; height: 42px; border-color: var(--dz-border); box-shadow: 0 1px 2px rgba(31, 35, 40, .03); }
.product-select-wrap::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--dz-muted); border-bottom: 1.5px solid var(--dz-muted); transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.product-select-wrap:focus-within { border-color: #ffb46f; box-shadow: 0 0 0 3px rgba(255,138,42,.1); }
#product-select { width: 100%; height: 40px; padding: 0 36px 0 12px; border: 0; outline: 0; appearance: none; background: transparent; color: var(--dz-text); font-size: 13px; cursor: pointer; }
#product-select option { color: var(--dz-text); background: var(--dz-surface); }
#product-select:focus-visible { box-shadow: none; }
.duration-control { display: flex; align-items: center; gap: 7px; }
.duration-control button { width: 38px; height: 38px; border: 1px solid var(--dz-border); border-radius: 6px; background: white; display: grid; place-items: center; color: #60646a; }
.duration-control button:hover { border-color: #ffb46f; color: var(--orange-dark); background: var(--orange-soft); }
.duration-control svg { width: 15px; }
.duration-glyph { display: block; color: var(--dz-secondary); font: 700 24px/34px Arial, sans-serif; }
.duration-control button:hover .duration-glyph { color: var(--orange-dark); }
.duration-input-wrap { height: 40px; display: flex; align-items: center; border: 1px solid var(--dz-border); border-radius: 6px; background: white; overflow: hidden; }
.duration-input-wrap:focus-within { border-color: #ffb46f; box-shadow: 0 0 0 3px rgba(255,138,42,.1); }
.duration-control input { width: 46px; height: 38px; padding: 0 2px 0 8px; border: 0; outline: none; box-shadow: none; text-align: right; font-size: 16px; font-weight: 700; color: var(--dz-text); appearance: textfield; }
.duration-control input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.duration-unit { padding-right: 7px; color: var(--dz-secondary); font-size: 12px; white-space: nowrap; }
.action-bar { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; }
.price-summary { margin-right: auto; }
.price-summary span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.price-summary strong { font-size: 14px; }
.price-summary b { color: var(--orange-dark); font-size: 19px; }
.primary-button, .secondary-button { height: 42px; padding: 0 18px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; font-weight: 600; }
.primary-button { color:var(--dz-on-accent); background: var(--orange); }
.primary-button:hover { background: var(--orange-dark); }
.secondary-button { background: white; color: var(--dz-secondary); border-color: var(--dz-border); }
.secondary-button:hover { background: var(--dz-subtle); }
.primary-button:disabled, .secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.feature-disabled { position: relative; }
.feature-video-locked { position: relative; }
.feature-video-locked::after { content: "此功能暂未开放"; position: absolute; z-index: 20; left: 50%; bottom: 48px; transform: translateX(-50%) translateY(4px); white-space: nowrap; padding: 9px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: #252a31; color:var(--dz-on-accent); font-size: 14px; line-height: 1.4; font-weight: 600; letter-spacing: .02em; opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; box-shadow: 0 8px 22px rgba(21,28,36,.22); }
.feature-video-locked:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.action-button { min-width: 126px; }
.cdk-entry-stack { position: relative; display: flex; flex: 0 0 auto; }
.cdk-entry { display: flex; align-items: center; gap: 8px; margin: 0; }
.cdk-preview { position: absolute; top: 47px; left: 0; width: 255px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.cdk-preview b { color: var(--dz-text); }
.cdk-preview .status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.cdk-input-wrap { width: 255px; height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--dz-border); border-radius: 6px; background: var(--dz-surface); color: var(--muted); font-size: 12px; }
.cdk-input-wrap:focus-within { border-color: #ffb46f; box-shadow: 0 0 0 3px rgba(255,138,42,.1); }
.cdk-input-wrap input { min-width: 0; flex: 1; height: 38px; padding: 0; border: 0; outline: none; color: var(--dz-text); }
.cdk-visibility { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--dz-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cdk-visibility svg { width: 17px; height: 17px; stroke-width: 2.2; display: block; }
.task-delete-button svg { width: 14px; height: 14px; display: block; }
.cdk-visibility.hidden { display: none; }
.cdk-input-wrap input::placeholder { color: var(--dz-muted); }
.cdk-entry .cdk-purchase { height: 42px; padding: 0 13px; border: 1px solid #ffc48d; border-radius: 6px; background: var(--orange-soft); color: var(--orange-dark); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cdk-merge-trigger { height: 42px; padding: 0 13px; white-space: nowrap; }
.cdk-query-trigger { height: 42px; padding: 0 13px; white-space: nowrap; }
.cdk-purchase:hover { border-color: var(--orange); background: #ffe9d3; }
.global-cdk { display: block !important; }
.global-cdk .cdk-preview { position: static !important; left: auto; margin-left: 0; justify-content: flex-start; }
.action-button.stopping { background: var(--red); }
.action-button.stopping:hover { background: var(--dz-danger); }
button svg { width: 17px; height: 17px; }
.message { margin-top: 12px; padding: 10px 12px; border-radius: 5px; font-size: 13px; background: var(--dz-danger-soft); color: var(--red); }

.tasks { position: sticky; top: 20px; min-height: 100%; max-height: 760px; display: flex; flex-direction: column; overflow: hidden; }
.tasks-header { padding: 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.tasks-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--dz-border); border-radius: 6px; background: var(--dz-subtle); display: grid; place-items: center; color: #4d5965; transition: color .2s, background .2s, border-color .2s; }
.icon-button:hover, .icon-button:focus-visible { background: var(--orange-soft); border-color: #ffb46f; color: var(--orange-dark); }
.icon-button svg { width: 18px; height: 18px; stroke-width: 2.2; }
.icon-glyph { display: block; color: var(--dz-secondary); font: 700 25px/31px Arial, sans-serif; }
.icon-glyph-close { font-size: 25px; font-weight: 700; line-height: 28px; transform: scale(1.3); }
.task-list { min-height: 0; flex: 1; max-height: none; overflow: auto; padding: 12px; }
.task-retention-note { display: flex; align-items: center; gap: 7px; padding: 10px 18px; color: #a26728; background: var(--dz-accent-soft); border-bottom: 1px solid #f6e5d3; font-size: 11px; }
.task-retention-note svg { width: 14px; height: 14px; flex: 0 0 auto; }
.empty-state { min-height: 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--dz-muted); gap: 8px; text-align: center; }
.empty-state svg { width: 38px; height: 38px; stroke-width: 1.4; }
.empty-state strong { color: var(--dz-secondary); font-size: 14px; }
.empty-state span { font-size: 12px; }
.task-item { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-bottom: 10px; }
.task-top { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.task-name { min-width: 0; flex: 1; }
.task-name strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.task-name span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.task-status { flex: none; font-size: 11px; color: var(--orange-dark); background: var(--orange-soft); padding: 4px 7px; border-radius: 4px; height: fit-content; }
.task-status.completed { color: var(--green); background: color-mix(in srgb, var(--dz-success) 10%, var(--dz-surface)); }
.task-status.failed, .task-status.stopped { color: var(--red); background: var(--dz-danger-soft); }
.progress-label { display: flex; justify-content: space-between; color: var(--dz-secondary); font-size: 11px; margin: 14px 0 6px; }
.progress-track { width: 100%; height: 5px; background: var(--dz-subtle); overflow: hidden; border-radius: 4px; }
.progress-bar { height: 100%; background: var(--green); border-radius: 4px; transition: width .35s ease; }
.task-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: var(--orange-dark); font-size: 12px; }
.cdk-input-stack { width: 255px; flex: 0 0 255px; }
.cdk-message { margin-top: 5px; min-height: 16px; color: var(--red); font-size: 12px; line-height: 1.35; }
.cdk-message.success { color: var(--green); }
.transcript-job-item { border: 1px solid var(--dz-border); border-radius: 7px; padding: 14px; background: var(--dz-surface); }
.transcript-job-top, .transcript-job-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transcript-job-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.transcript-job-top span { flex: none; color: var(--green); font-size: 12px; font-weight: 600; }
.transcript-progress { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: var(--dz-subtle); }
.transcript-progress-bar { height: 100%; border-radius: inherit; background: var(--green); transition: width .4s ease; }
.transcript-job-meta { margin-top: 7px; color: var(--dz-secondary); font-size: 11px; }
.transcript-job-meta b { color: var(--green); }

.dialog { width: min(420px, calc(100vw - 28px)); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 24px 80px rgba(22,24,27,.22); }
.dialog::backdrop { background: rgba(25,27,30,.45); backdrop-filter: blur(2px); }
.dialog form { padding: 30px; }
.storyboard-progress-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(25,27,30,.45); backdrop-filter: blur(2px); }
.storyboard-progress-overlay.hidden { display: none; }
.storyboard-plan-live { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--orange); border-radius: 10px; margin-bottom: 12px; }
.storyboard-plan-live.hidden { display: none; }
.storyboard-plan-preview { max-height: 260px; overflow: auto; width: 100%; text-align: left; }
.storyboard-plan-preview details { border: 1px solid #eee; padding: 10px; margin-top: 8px; border-radius: 8px; }
.storyboard-plan-preview pre { white-space: pre-wrap; word-break: break-word; font: inherit; line-height: 1.6; }
.storyboard-progress-modal { width: min(420px, calc(100vw - 28px)); padding: 32px; border-radius: 10px; background: var(--dz-surface); box-shadow: 0 24px 80px rgba(22,24,27,.22); text-align: center; }
.storyboard-progress-spinner { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border: 4px solid #ffe3ca; border-top-color: var(--orange); border-radius: 50%; animation: storyboard-progress-spin 1s linear infinite; }
.storyboard-progress-spinner span { color: var(--orange-dark); font-size: 10px; font-weight: 700; animation: storyboard-progress-spin-reverse 1s linear infinite; }
.storyboard-progress-modal h2 { margin: 0 0 8px; font-size: 20px; }
.storyboard-progress-modal p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.storyboard-progress-modal strong, .storyboard-progress-modal small { display: block; }
.storyboard-progress-modal strong { color: var(--orange-dark); font-size: 13px; }
.storyboard-progress-modal small { margin-top: 9px; color: #92979c; font-size: 12px; }
.storyboard-progress-track { height: 6px; margin-bottom: 14px; overflow: hidden; border-radius: 999px; background: #fff0e2; }
.storyboard-progress-track i { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--orange); animation: storyboard-progress-slide 1.4s ease-in-out infinite; }
@keyframes storyboard-progress-spin { to { transform: rotate(360deg); } }
@keyframes storyboard-progress-spin-reverse { to { transform: rotate(-360deg); } }
@keyframes storyboard-progress-slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }

/* ArcReel storyboard shell: shared project chrome, asset navigation and dense Unit workspace. */
.storyboard-page { padding: 18px 28px 34px; background: var(--dz-subtle); }
.storyboard-projectbar { width: 100%; margin: 0 auto 10px; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.storyboard-page-message { position: fixed; top: 50%; left: 50%; z-index: 1100; width: min(460px, calc(100vw - 40px)); margin: 0; padding: 15px 20px; transform: translate(-50%, -50%); border: 1px solid #ffd2ad; border-radius: 8px; background: var(--dz-surface); color: #c45d13; box-shadow: 0 16px 44px rgba(22,24,27,.18); text-align: center; }
.storyboard-page-message.hidden { display: none; }
.storyboard-project-tools { display: flex; align-items: center; gap: 12px; }
.storyboard-project-select { display: flex; align-items: center; gap: 9px; min-width: 260px; color: var(--dz-secondary); font-size: 11px; }
.storyboard-project-select select { width: 300px; height: 34px; border: 1px solid var(--dz-border); border-radius: 6px; padding: 0 10px; background: var(--dz-surface); color: var(--dz-text); }
.storyboard-workflow { display: flex; align-items: center; gap: 9px; color: var(--dz-muted); font-size: 11px; }
.storyboard-workflow strong { color:var(--dz-on-accent); background: var(--dz-accent); border-radius: 999px; padding: 6px 12px; }
.storyboard-workflow i { color: var(--dz-border); font-style: normal; }
.storyboard-shell { width: 100%; min-height: calc(100vh - 190px); margin: 0; display: grid; grid-template-columns: 188px minmax(0, 1fr); border: 0; border-radius: 0; box-shadow: none; background: var(--dz-surface); overflow: hidden; }
.storyboard-sidebar { display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; border-right: 1px solid var(--dz-border); background: #fbfbfc; }
.storyboard-side-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--dz-secondary); font-size: 12px; text-align: left; }
.storyboard-side-item:hover, .storyboard-side-item.active { color: var(--dz-accent); background: var(--dz-accent-soft); }
.storyboard-side-item > span { flex: 1; min-width: 0; }
.storyboard-side-count { min-width: 22px; padding: 2px 6px; border-radius: 10px; color: var(--dz-muted); background: #f0f1f3; font-size: 10px; font-weight: 600; text-align: center; }
.storyboard-side-item.active .storyboard-side-count { color: #c96116; background: #ffe5d0; }
.storyboard-side-item i { width: 15px; height: 15px; }
.storyboard-sidebar-divider { height: 1px; margin: 12px 4px 8px; background: var(--dz-border); }
.storyboard-sidebar small { padding: 0 8px; color: var(--dz-muted); font-size: 10px; line-height: 1.5; }
.storyboard-open-assets { margin: 8px 4px 0; justify-content: center; }
.storyboard-main { min-width: 0; padding: 12px 18px 20px; background: var(--dz-surface); }
.storyboard-panel { min-height: calc(100vh - 220px); padding: 4px 10px 34px; }
.storyboard-panel-overview, .storyboard-panel-assets { background: var(--dz-surface); }
.storyboard-panel-overview, .storyboard-main > .storyboard-input { width: min(920px, 100%); max-width: 920px; min-height: 0; margin: 0 auto; box-sizing: border-box; padding: 22px; border: 1px solid var(--dz-border); border-radius: 8px; box-shadow: 0 8px 26px rgba(22,24,27,.06); background: var(--dz-surface); }
.storyboard-asset-host { height: calc(100vh - 196px); min-height: 720px; margin: -4px -18px -34px; overflow: hidden; background: var(--dz-page); }
.storyboard-asset-host iframe { display: block; width: 100%; height: 100%; min-height: inherit; border: 0; }
.storyboard-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 10px 0 24px; border-bottom: 1px solid var(--dz-border); }
.storyboard-panel-heading h1 { margin: 3px 0 0; color: var(--dz-text); font-size: 28px; letter-spacing: 0; }
.storyboard-panel-heading > span { color: var(--dz-muted); font-size: 12px; }
.storyboard-overview-heading-actions { display: flex; align-items: center; gap: 12px; }
.storyboard-overview-heading-actions .icon-button { color: var(--dz-danger); }
.task-top-actions { display: flex; align-items: flex-start; gap: 8px; flex: none; }
.task-delete-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--dz-border);
  border-radius: 6px;
  background: var(--dz-subtle);
  color: var(--dz-danger);
  display: grid;
  place-items: center;
}
.task-delete-button:hover,
.task-delete-button:focus-visible {
  background: var(--orange-soft);
  border-color: #ffb46f;
  color: var(--orange-dark);
}
.task-delete-button svg { width: 18px; height: 18px; stroke-width: 2.2; }
.storyboard-panel-heading .eyebrow { color: var(--dz-accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.storyboard-overview-summary { margin: 20px 0; padding: 18px 20px; border: 1px solid var(--dz-border); border-radius: 8px; background: var(--dz-accent-soft); }
.storyboard-overview-summary span { color: var(--dz-muted); font-size: 11px; }
.storyboard-overview-summary p { margin: 10px 0 0; color: var(--dz-text); font-size: 13px; line-height: 1.8; }
.storyboard-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.storyboard-overview-grid button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; min-height: 74px; padding: 14px; border: 1px solid var(--dz-border); border-radius: 7px; background: var(--dz-surface); color: var(--dz-secondary); text-align: left; }
.storyboard-overview-grid button:hover { border-color: #ffb46f; background: var(--dz-accent-soft); }
.storyboard-overview-grid button svg { color: var(--dz-accent); width: 17px; }
.storyboard-overview-grid button strong { color: var(--dz-text); font-size: 18px; }
.storyboard-overview-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--dz-border); }
.storyboard-overview-settings { display: flex; align-items: center; margin-right: auto; }
.storyboard-overview-settings label { display: inline-flex; align-items: center; gap: 7px; color: var(--dz-secondary); font-size: 12px; white-space: nowrap; }
.storyboard-overview-settings input { width: 78px; padding: 9px 10px; border: 1px solid #dfe2e5; border-radius: 6px; font: inherit; color: var(--dz-text); }
.asset-extraction-mode { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--dz-secondary); font-size: 12px; white-space: nowrap; }
.asset-extraction-mode select { appearance: none; width: 236px; max-width: 100%; min-width: 0; height: 40px; padding: 0 32px 0 12px; border: 1px solid #dfe2e5; border-radius: 6px; background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b7f86' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.asset-extraction-mode select:hover { border-color: var(--orange); }
.asset-extraction-mode select:focus-visible { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 138, 42, .12); }
.asset-extraction-mode select:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 1100px) { .storyboard-overview-actions { flex-wrap: wrap; } }
@media (max-width: 520px) { .asset-extraction-mode { width: 100%; } .asset-extraction-mode select { flex: 1; width: 0; } }
.storyboard-source-hint { color: var(--dz-muted); font-size: 12px; }
.action-cost { font-size: 12px; font-weight: 500; }
.storyboard-source-view textarea { min-height: 430px; background: var(--dz-subtle); color: var(--dz-text); cursor: default; }
.storyboard-source-hint { margin: 10px 0 0; }
.storyboard-new-project-form { display: grid; grid-column: 1 / -1; gap: 16px; width: 100%; max-width: 884px; box-sizing: border-box; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: var(--dz-surface); }
.storyboard-new-section-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.storyboard-new-section-heading > div { display: flex; align-items: center; gap: 10px; }
.storyboard-new-section-heading h2 { margin: 0; color: var(--dz-text); font-size: 17px; }
.storyboard-new-name-field { display: grid; gap: 7px; color: var(--dz-secondary); font-size: 12px; }
.storyboard-new-name-field input { height: 42px; }
.storyboard-new-intro { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; color: var(--dz-secondary); background: #fff7ef; font-size: 12px; }
.storyboard-new-intro svg { width: 16px; color: var(--dz-accent); }
.storyboard-new-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--dz-border); }
.storyboard-new-tabs .source-tab { height: auto; min-height: 0; padding: 0 0 11px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 400; }
.storyboard-new-tabs .source-tab.active { color: var(--text); font-weight: 600; }
.storyboard-new-project-form textarea { min-height: 250px; margin: 0; background: var(--dz-surface); font-size: 14px; line-height: 1.85; }
.storyboard-new-dropzone { display: flex; flex-direction: column; min-height: 250px; width: 100%; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--dz-border); border-radius: 6px; background: var(--dz-subtle); color: var(--dz-secondary); cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.storyboard-new-dropzone:hover, .storyboard-new-dropzone.dragging { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 0 0 3px rgba(255,138,42,.12); }
.storyboard-new-dropzone svg { width: 32px; height: 32px; color: var(--orange); }
.storyboard-new-dropzone strong { color: var(--dz-secondary); font-size: 15px; }
.storyboard-new-dropzone span { color: var(--dz-muted); font-size: 12px; }
.storyboard-new-divider { height: 1px; margin: 8px 0 4px; background: var(--dz-border); }
.storyboard-new-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 2px; }
.storyboard-new-form-actions .primary-button { width: auto; min-width: 108px; height: 28px; min-height: 28px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--dz-accent); border-radius: 4px; color: var(--dz-accent); background: var(--dz-surface); font-size: 12px; line-height: 18px; white-space: nowrap; }
.storyboard-new-form-actions .primary-button:hover { color:var(--dz-on-accent); background: var(--dz-accent); }
.storyboard-new-form-actions .message { margin: 0 auto 0 0; }
.storyboard-new-project-form label { display: grid; gap: 7px; color: var(--dz-secondary); font-size: 12px; }
.storyboard-new-project-form input,.storyboard-new-project-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--dz-border); border-radius: 6px; padding: 10px 12px; background: var(--dz-surface); color: var(--dz-text); font: inherit; }
.storyboard-new-project-form textarea { min-height: 320px; resize: vertical; line-height: 1.8; }
.storyboard-new-project-form .primary-button { justify-self: start; }
.storyboard-asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-top: 20px; }
.storyboard-asset-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; min-height: 106px; padding: 12px; border: 1px solid var(--dz-border); border-radius: 7px; background: var(--dz-surface); }
.storyboard-asset-card img, .storyboard-asset-placeholder { width: 76px; height: 76px; border-radius: 5px; object-fit: cover; background: #f3f4f5; }
.storyboard-asset-placeholder { display: grid; place-items: center; color: #b4b8bd; }
.storyboard-asset-card strong { color: var(--dz-text); font-size: 13px; }
.storyboard-asset-card p { display: -webkit-box; margin: 6px 0 0; overflow: hidden; color: var(--dz-muted); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.storyboard-look-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.storyboard-look-chip { padding: 2px 5px; border-radius: 4px; color: var(--dz-accent); background: var(--dz-accent-soft); font-size: 10px; }
.storyboard-inline-empty { grid-column: 1 / -1; padding: 60px 0; color: var(--dz-muted); text-align: center; font-size: 12px; }
.storyboard-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--dz-border); }
.storyboard-source-actions { display: flex; align-items: center; gap: 12px; color: var(--dz-muted); font-size: 11px; }
.storyboard-source-actions .primary-button { white-space: nowrap; }
.storyboard-input { padding: 4px 0 24px; }
.storyboard-input #storyboard-paste-panel textarea { min-height: 440px; border-color: var(--dz-border); border-radius: 6px; background: var(--dz-surface); font-size: 14px; line-height: 1.9; }
.storyboard-input .storyboard-settings { grid-template-columns: 220px; }
.storyboard-input .storyboard-settings input { background: var(--dz-surface); }
.storyboard-results { padding: 22px; }
.storyboard-results .storyboard-units { max-height: none; }
.storyboard-main .storyboard-layout { max-width: none; }
.storyboard-main > .storyboard-results { width: min(1300px, 100%); max-width: 1300px; min-height: 0; margin: 0 auto; box-sizing: border-box; border: 1px solid var(--dz-border); border-radius: 8px; box-shadow: 0 8px 26px rgba(22,24,27,.06); background: var(--dz-surface); }
@media (max-width: 900px) { .storyboard-page { padding: 12px; } .storyboard-projectbar { align-items: stretch; flex-direction: column; gap: 8px; } .storyboard-project-select select { flex: 1; width: auto; } .storyboard-workflow { overflow-x: auto; } .storyboard-shell { grid-template-columns: 1fr; } .storyboard-sidebar { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--dz-border); } .storyboard-sidebar-divider, .storyboard-sidebar small { display: none; } .storyboard-open-assets { margin: 0 0 0 auto; } .storyboard-overview-grid, .storyboard-asset-grid { grid-template-columns: 1fr; } .storyboard-overview-actions { justify-content: flex-start; flex-wrap: wrap; } .storyboard-overview-settings { margin-right: 0; } .storyboard-source-heading { align-items: flex-start; flex-direction: column; } }
.dialog-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--orange-dark); background: var(--orange-soft); }
.dialog h2 { margin: 17px 0 7px; font-size: 20px; }
.dialog p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.dialog label { display: block; font-size: 13px; margin-bottom: 7px; }
.dialog input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--dz-border); border-radius: 6px; outline: none; }
.dialog .full { width: 100%; margin-top: 14px; }
.dialog form > small { display: block; margin-top: 12px; text-align: center; color: var(--dz-muted); }
.input-error { margin-top: 7px; color: var(--red); font-size: 12px; }
.confirm-body { padding: 28px; }
.dialog-icon.danger { color: var(--red); background: var(--dz-danger-soft); }
.confirm-body h2 { margin: 17px 0 7px; }
.confirm-body > p { margin-bottom: 18px; }
.billing-rule { display: grid; gap: 7px; padding: 13px 14px; border: 1px solid var(--dz-border); border-radius: 6px; background: var(--dz-accent-soft); color: var(--dz-secondary); font-size: 12px; line-height: 1.5; }
.billing-rule strong { color: #4b3827; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.danger-button { height: 42px; padding: 0 18px; border: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color:var(--dz-on-accent); background: var(--red); font-weight: 600; }
.danger-button:hover { background: var(--dz-danger); }
.result-dialog { width: min(800px, calc(100vw - 28px)); }
.result-header { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.result-header span { color: var(--muted); font-size: 11px; }
.result-header h2 { margin: 4px 0 0; font-size: 17px; }
.result-dialog pre { margin: 0; padding: 24px; max-height: 65vh; overflow: auto; white-space: pre-wrap; font: 14px/1.8 "Microsoft YaHei", sans-serif; }
.result-actions { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.result-actions .secondary-button { color: var(--orange-dark); border-color: var(--dz-accent); background: var(--dz-surface); }
.result-actions .secondary-button:hover { color:var(--dz-on-accent); border-color: var(--orange-dark); background: var(--orange); }
.result-actions .primary-button { color: var(--orange-dark); border-color: var(--dz-accent); background: var(--dz-surface); }
.result-actions .primary-button:hover { color:var(--dz-on-accent); border-color: var(--orange-dark); background: var(--orange); }
.merge-dialog { width: min(560px, calc(100vw - 28px)); }
.merge-body { padding-bottom: 24px; }
.merge-body .result-header { padding: 20px 24px; }
.merge-body #merge-form { display: grid; gap: 12px; padding: 0 24px; }
.merge-body p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.merge-body textarea { min-height: 120px; resize: vertical; }
.merge-body .primary-button { justify-self: end; }

@media (max-width: 1050px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .tasks { position: static; min-height: 300px; max-height: 600px; }
  .empty-state { min-height: 240px; }
}
@media (min-width: 721px) {
  .global-cdk { transform: translateX(-120px); }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: 100%; height: 62px; padding: 7px 12px; flex-direction: row; border: 0; border-bottom: 1px solid var(--line); }
  .brand, .sidebar-bottom .version { display: none; }
  .sidebar nav { width: 100%; grid-template-columns: 1fr 1fr; }
  .sidebar-bottom { margin: 0; }
  .sidebar-bottom .nav-item { width: 50px; }
  .sidebar-bottom .nav-item span { display: none; }
  .nav-item { height: 48px; justify-content: center; }
  .page-shell { margin-left: 0; padding-bottom: 20px; }
  .topbar { height: auto; min-height: 82px; padding: 15px 16px; }
  .global-cdk { width: 100%; margin-top: 12px; transform: none; }
  .topbar { flex-wrap: wrap; }
  .topbar p { display: none; }
  .account-chip { max-width: 62%; min-width: 0; gap: 5px; padding: 7px 9px; white-space: normal; flex-wrap: wrap; justify-content: flex-end; }
  .account-chip .status-dot { display: none; }
  .account-chip span { font-size: 10px; }
  .workspace-grid { padding: 14px; }
  .composer { padding: 19px 15px; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .mode-tip { display: none; }
  .duration-row { align-items: flex-start; gap: 12px; }
  .product-choice-row { align-items: flex-start; gap: 12px; }
  .product-select-wrap { width: 46%; min-width: 170px; }
  .tasks { max-height: 520px; }
  .action-bar { flex-wrap: wrap; }
  .price-summary { width: 100%; }
  .cdk-entry { flex: 1 1 100%; }
  .cdk-entry-stack { flex: 1 1 100%; }
  .cdk-preview { position: static; width: auto; justify-content: flex-start; padding-top: 5px; }
  .cdk-input-wrap { min-width: 0; flex: 1; width: auto; }
  .primary-button, .secondary-button { flex: 1; }
  .transcript-action-row { align-items: stretch; flex-direction: column; }
  .transcript-action-row .primary-button { width: 100%; }
}
.cdk-mobile-label { display: none; }
:root{--community-border:#e6e9ec}
.cdk-community{display:inline-flex;align-items:center;gap:6px;border:1px solid #d8dcdf;border-radius:5px;background:var(--dz-surface);color:#30353a;padding:9px 12px;cursor:pointer;white-space:nowrap}.cdk-community:hover{border-color:#e97818;color:#e97818}.community-dialog{width:min(480px,calc(100vw - 30px));padding:0;border:0;border-radius:8px;overflow:hidden}.community-image-wrap{display:grid;place-items:center;min-height:240px;padding:24px;background:#f7f8f9}.community-image-wrap img{display:block;max-width:100%;max-height:62vh;object-fit:contain}.community-image-wrap img[src=""]{display:none}
@media (max-width: 720px) {
  .global-cdk { min-width: 0; }
  .global-cdk .cdk-entry { display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0; }
  .global-cdk .cdk-input-stack { width: auto; min-width: 0; flex: 1 1 0; }
  .global-cdk .cdk-input-wrap { width: 100%; padding: 0 6px; }
  .global-cdk .cdk-entry > button { flex: 0 0 auto; min-width: 0; height: 42px; padding: 0 6px; font-size: 12px; white-space: nowrap; }
  .global-cdk .cdk-entry > button > svg,
  .global-cdk .cdk-entry > button > i,
  .global-cdk .cdk-desktop-label { display: none; }
  .global-cdk .cdk-mobile-label { display: inline; }
  .global-cdk .cdk-message { overflow-wrap: anywhere; }
}\r\n


.unit-video-result { display: grid; gap: 8px; min-width: 0; }

.unit-reference-chip:has(select) { max-width: 320px; flex-wrap: wrap; }
.unit-reference-chip select { width: auto; max-width: 130px; min-width: 0; padding: 2px 4px; font-size: 11px; border: 1px solid var(--dz-border); border-radius: 6px; background: var(--dz-surface); color: var(--dz-text); }

/* Scope intelligent storyboard progress to the Unit workspace. */
[data-storyboard-panel="units"] { position: relative; min-height: 540px; }
#storyboard-progress-overlay { position: absolute; inset: auto; z-index: 20; padding: 12px; box-sizing: border-box; overflow: hidden; place-items: center; }
#storyboard-progress-overlay .storyboard-progress-modal { margin: 0; max-width: 100%; max-height: 100%; box-sizing: border-box; overflow: auto; }
#storyboard-progress-overlay p { white-space: pre-line; }
#storyboard-progress-overlay.storyboard-progress-finished .storyboard-progress-spinner,
#storyboard-progress-overlay.storyboard-progress-finished .storyboard-progress-track,
#storyboard-progress-overlay.storyboard-progress-finished small { display: none; }
.storyboard-unit-plan-incomplete [data-unit-save-state] { color: var(--dz-accent-hover); }
.storyboard-unit-plan-incomplete [data-unit-prompt] { background: var(--dz-surface); color: var(--dz-text); border-color: var(--dz-border); white-space: pre-wrap; }

/* The same category colors identify references in chips, text and picker headings. */
.unit-mention-group[data-mention-group="scene"]>strong{color:var(--dz-ref-scene)}
.unit-reference-chip[data-reference-type="character"]{--ui-surface:var(--dz-ref-character-bg);--ui-text:var(--dz-ref-character);color:var(--dz-ref-character);background:var(--dz-ref-character-bg);border-color:color-mix(in srgb,var(--dz-ref-character) 25%,var(--dz-border))}
.unit-reference-chip[data-reference-type="scene"]{--ui-surface:var(--dz-ref-scene-bg);--ui-text:var(--dz-ref-scene);color:var(--dz-ref-scene);background:var(--dz-ref-scene-bg);border-color:color-mix(in srgb,var(--dz-ref-scene) 25%,var(--dz-border))}
.unit-reference-chip[data-reference-type="prop"]{--ui-surface:var(--dz-ref-prop-bg);--ui-text:var(--dz-ref-prop);color:var(--dz-ref-prop);background:var(--dz-ref-prop-bg);border-color:color-mix(in srgb,var(--dz-ref-prop) 25%,var(--dz-border))}

/* Existing media stays in the single full-size preview; task notices stay compact. */
.unit-video-result .unit-video-card.unit-video-inline-notice { min-height: 0; padding: 8px 10px; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 8px; align-content: start; justify-items: start; text-align: left; }
.unit-video-inline-notice > svg, .unit-video-inline-notice > i { width: 18px; height: 18px; }
.unit-video-inline-notice > strong, .unit-video-inline-notice > small { text-align: left; }
.unit-video-inline-notice > small { grid-column: 2; }

/* Unit deletion shares the compact icon style used by video actions. */
.storyboard-unit-head > .unit-delete-button { margin-left: auto; flex: 0 0 auto; color: var(--dz-danger); }
.storyboard-unit-head > .unit-delete-button:hover,
.storyboard-unit-head > .unit-delete-button:focus-visible { color: var(--dz-danger); background: var(--dz-danger-soft); }
