/* 首页「视频智能体·编导」制作面板
 * 首页原生视图：点击 电商带货/同城到店/品牌广告/剧情短片 卡片后在主区域就地展开，不弹浮层。
 * 左列操作区底部固定生成按钮，右列实例演示 + 生成结果回显。
 * 依赖 chat-home.css 中 .chr 定义的 --chr-* 变量；面板作为 .chr 的网格子节点渲染。
 */

.vdp[hidden] {
    display: none !important;
}

.vdp {
    grid-column: 2 / -1;
    grid-row: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
    padding: 8px 18px 18px 6px;
    color: var(--chr-text);
    font-family: inherit;
}

/* 展开制作视图时隐藏首页主内容与对话历史，只保留左侧图标栏 */
.chr.is-vdp-view .chr-main,
.chr.is-vdp-view .chr-history,
.chr.is-vdp-view .chr-history-backdrop {
    display: none !important;
}

.vdp-dialog {
    display: grid;
    grid-template-columns: clamp(520px, 42vw, 780px) minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--chr-line);
    border-radius: 20px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow-soft);
    overflow: hidden;
    animation: vdpFade .16s ease both;
}

/* 左侧操作区 */

.vdp-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--chr-line);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--chr-panel-2) 55%, transparent), transparent 220px),
        var(--chr-panel);
}

.vdp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    padding: 14px 16px 13px;
    border-bottom: 1px solid var(--chr-line);
}

.vdp-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.vdp-identity-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--chr-accent) 26%, transparent), color-mix(in srgb, var(--chr-accent-2) 26%, transparent));
    color: var(--chr-accent);
    border: 1px solid color-mix(in srgb, var(--chr-accent) 35%, transparent);
}

.vdp-identity-icon svg {
    width: 20px;
    height: 20px;
}

.vdp-identity-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vdp-identity-copy strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
}

.vdp-identity-copy small {
    color: var(--chr-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.vdp-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.vdp-new {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 10px;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.vdp-new:hover {
    background: var(--chr-panel-3);
    color: var(--chr-text);
    border-color: color-mix(in srgb, var(--chr-accent) 45%, var(--chr-line-strong));
}

.vdp-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--chr-line-strong);
    border-radius: 10px;
    background: transparent;
    color: var(--chr-muted);
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.vdp-close:hover {
    background: var(--chr-panel-3);
    color: var(--chr-text);
}

.vdp-close svg {
    width: 16px;
    height: 16px;
}

.vdp-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--chr-line-strong) transparent;
}

.vdp-body::-webkit-scrollbar {
    width: 8px;
}

.vdp-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--chr-line-strong);
    background-clip: padding-box;
}

.vdp-card {
    flex: none;
    padding: 11px 12px 10px;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--chr-panel-2) 78%, transparent);
}

.vdp-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.vdp-card-head strong {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.vdp-card-head strong em {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-accent-3) 18%, transparent);
    color: var(--chr-accent-3);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    vertical-align: 1px;
}

.vdp-card-head small {
    min-width: 0;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.4;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 复刻方式 */

.vdp-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.vdp-mode {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 9px 6px 8px;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel);
    color: var(--chr-text);
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.vdp-mode:hover {
    border-color: var(--chr-line-strong);
    background: var(--chr-panel-2);
}

.vdp-mode.is-active {
    border-color: color-mix(in srgb, var(--chr-accent) 62%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 11%, var(--chr-panel));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--chr-accent) 30%, transparent) inset;
}

.vdp-mode-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--chr-panel-3);
    color: var(--chr-soft);
}

.vdp-mode.is-active .vdp-mode-icon {
    background: color-mix(in srgb, var(--chr-accent) 18%, transparent);
    color: var(--chr-accent);
}

.vdp-mode-icon svg {
    width: 16px;
    height: 16px;
}

.vdp-mode-copy {
    display: block;
    min-width: 0;
}

.vdp-mode-copy strong {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.vdp-mode-check {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--chr-accent);
    color: #04121a;
    font-size: 10px;
    font-weight: 800;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .16s ease, transform .16s ease;
}

.vdp-mode.is-active .vdp-mode-check {
    opacity: 1;
    transform: scale(1);
}

.vdp-mode-hint {
    margin: 8px 2px 0;
    color: var(--chr-soft);
    font-size: 11.5px;
    line-height: 1.5;
}

/* 参考素材槽位 */

.vdp-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.vdp-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px 7px;
    border: 1px dashed var(--chr-line-strong);
    border-radius: 12px;
    background: var(--chr-panel);
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.vdp-slot:hover,
.vdp-slot:focus-within {
    border-color: color-mix(in srgb, var(--chr-accent) 50%, var(--chr-line-strong));
    background: var(--chr-panel-2);
}

.vdp-slot.has-file {
    border-style: solid;
    border-color: color-mix(in srgb, var(--chr-accent) 42%, transparent);
}

.vdp-slot.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.vdp-slot-thumb {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-color: var(--chr-panel-3);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--chr-muted);
    overflow: hidden;
}

.vdp-slot-thumb svg {
    width: 20px;
    height: 20px;
}

.vdp-slot-thumb.has-image svg {
    display: none;
}

/* 参考视频用首帧预览，图片按缩略图裁切铺满，避免撑破格子 */
.vdp-slot-thumb img,
.vdp-slot-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vdp-slot-thumb.has-audio svg {
    color: var(--chr-accent);
}

.vdp-slot.has-file .vdp-slot-thumb {
    color: var(--chr-accent);
}

.vdp-slot-name {
    display: block;
    max-width: 100%;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vdp-slot-tip {
    display: block;
    max-width: 100%;
    color: var(--chr-muted);
    font-size: 9.5px;
    line-height: 1.25;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    white-space: nowrap;
}



.vdp-slot-clear {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.vdp-slot-clear:hover {
    background: rgba(239, 68, 68, .85);
}

/* 一个槽位上传多张时的逐张缩略图条：两列大格子，超过 4 张用「+N」进大图看 */
.vdp-slot-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    margin-top: 4px;
}

.vdp-slot-strip[hidden] {
    display: none;
}

.vdp-slot-strip-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--chr-panel-3);
    cursor: zoom-in;
    outline-offset: 2px;
}

.vdp-slot-strip-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vdp-slot-strip-item.is-more {
    display: grid;
    place-items: center;
    border: 1px dashed var(--chr-line-strong);
    color: var(--chr-soft);
    font-size: 12px;
    font-weight: 700;
    cursor: zoom-in;
}

.vdp-slot-strip-item.is-more:hover {
    border-color: var(--chr-accent);
    color: var(--chr-accent);
}

/* 单张删除：放在缩略图右上角，点一下会先弹确认，不会一碰就丢素材 */
.vdp-slot-strip-remove {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 0 6px 0 6px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.vdp-slot-strip-remove:hover {
    background: rgba(239, 68, 68, .9);
}

.vdp-hint {
    margin: 8px 2px 0;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.45;
}

.vdp-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.vdp-attachments[hidden] {
    display: none;
}

/* 参考视频 */

.vdp-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px dashed var(--chr-line-strong);
    border-radius: 13px;
    background: var(--chr-panel);
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.vdp-drop:hover,
.vdp-drop.is-drag {
    border-color: var(--chr-accent);
    background: color-mix(in srgb, var(--chr-accent) 8%, var(--chr-panel));
}

.vdp-drop[hidden] {
    display: none;
}

.vdp-drop-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--chr-panel-3);
    color: var(--chr-accent);
}

.vdp-drop-icon svg {
    width: 18px;
    height: 18px;
}

.vdp-drop-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vdp-drop-copy strong {
    font-size: 12.5px;
    font-weight: 600;
}

.vdp-drop-copy small {
    color: var(--chr-muted);
    font-size: 11px;
}

.vdp-video {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--chr-line);
    border-radius: 13px;
    background: var(--chr-panel);
}

.vdp-video[hidden] {
    display: none;
}

.vdp-video video {
    flex: none;
    width: 122px;
    height: 70px;
    border-radius: 8px;
    background: #000;
    object-fit: cover;
}

.vdp-video-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.vdp-video-meta strong {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdp-video-meta small {
    color: var(--chr-muted);
    font-size: 11px;
}

.vdp-video-remove {
    flex: none;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--chr-soft);
    font-size: 11.5px;
    cursor: pointer;
}

.vdp-video-remove:hover {
    border-color: rgba(248, 113, 113, .45);
    color: #fca5a5;
}

/* 补充说明（自适应剩余高度） */

.vdp-card-note {
    flex: 1 1 auto;
    min-height: 132px;
    display: flex;
    flex-direction: column;
}

.vdp-textarea {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 62px;
    padding: 9px 11px;
    border: 1px solid var(--chr-line);
    border-radius: 11px;
    background: var(--chr-panel);
    color: var(--chr-text);
    font-size: 12.5px;
    line-height: 1.55;
    resize: none;
    outline: none;
    transition: border-color .16s ease;
}

.vdp-textarea::placeholder {
    color: var(--chr-muted);
}

.vdp-textarea:focus {
    border-color: color-mix(in srgb, var(--chr-accent) 55%, transparent);
}

.vdp-count {
    margin-top: 4px;
    color: var(--chr-muted);
    font-size: 10.5px;
    text-align: right;
}

/* 底部操作区（固定贴底） */

.vdp-foot {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 11px 16px 14px;
    border-top: 1px solid var(--chr-line);
    background: color-mix(in srgb, var(--chr-panel-2) 72%, transparent);
}

.vdp-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 8px;
}

.vdp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.vdp-field-label {
    color: var(--chr-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .02em;
}

.vdp-field select {
    width: 100%;
    height: 34px;
    min-width: 0;
    padding: 0 8px;
    border: 1px solid var(--chr-line);
    border-radius: 9px;
    background: var(--chr-panel);
    color: var(--chr-text);
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.vdp-field select:focus {
    border-color: color-mix(in srgb, var(--chr-accent) 55%, transparent);
}

.vdp-field select:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* 视频模型是主要选择项：标签与下拉都加重，用户一眼就能看到 */
.vdp-field-model .vdp-field-label {
    color: var(--chr-text);
    font-size: 11.5px;
    font-weight: 700;
}

.vdp-field-model select.vdp-select-model {
    height: 42px;
    padding: 0 10px;
    border: 1.5px solid color-mix(in srgb, var(--chr-accent) 60%, var(--chr-line));
    border-radius: 11px;
    background: color-mix(in srgb, var(--chr-accent) 14%, var(--chr-panel));
    color: var(--chr-text);
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chr-accent) 10%, transparent);
}

.vdp-field-model select.vdp-select-model:focus {
    border-color: var(--chr-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chr-accent) 18%, transparent);
}

/* 写词模型与视频模型同排，高度保持一致 */
.vdp-field-prompt-model select {
    height: 42px;
    border-radius: 11px;
    font-size: 12.5px;
}

/* 视频模型占整行：模型名较长（含后缀），需要足够宽度完整显示 */
.vdp-field-model,
.vdp-field-prompt-model {
    grid-column: 1 / -1;
}

/* 时长独占一行：标签 + 滑杆 + 延长按钮 */
.vdp-field-range {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.vdp-field-range .vdp-field-label {
    flex: none;
    font-size: 11px;
    color: var(--chr-muted);
    white-space: nowrap;
}

.vdp-field-range .vdp-field-label b {
    color: var(--chr-text);
    font-weight: 700;
}

.vdp-field-range input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 18px;
    margin: 0;
    accent-color: var(--chr-accent);
    cursor: pointer;
}

/* 固定时长下拉 / 自由时长输入 */
.vdp-field-range input.vdp-duration-input,
.vdp-field-range select[data-vdp-duration-fixed] {
    flex: none;
    width: 92px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--chr-line);
    border-radius: 8px;
    background: var(--chr-panel);
    color: var(--chr-text);
    font-size: 12px;
    line-height: 1;
}

.vdp-field-range input.vdp-duration-input:focus,
.vdp-field-range select[data-vdp-duration-fixed]:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--chr-accent) 55%, transparent);
}

.vdp-extend {
    flex: none;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.vdp-extend:hover,
.vdp-extend[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--chr-accent) 55%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 8%, var(--chr-panel));
    color: var(--chr-text);
}

.vdp-model-note {
    margin: 0;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.45;
}

.vdp-model-note[hidden] {
    display: none;
}

.vdp-model-note.is-warning {
    color: #fbbf24;
}

/* 制作方式（直接制作）与预计消耗：只显示总共要花多少积分，不单列智能体加价 */
/* 制作方式：默认先分析出脚本再确认，勾选后直接写词出片。
   这一块是「选错会多等一轮」的关键开关，做成卡片 + 开关，比一行小字checkbox更容易看见。 */
.vdp-direct-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel-2);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.vdp-direct-field[hidden] {
    display: none !important;
}

/* 打开直接制作时整块高亮：和主按钮同色，用户一眼能看出当前是哪种模式 */
.vdp-direct-field.is-on {
    border-color: color-mix(in srgb, var(--chr-accent) 60%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 10%, var(--chr-panel));
    box-shadow: inset 3px 0 0 var(--chr-accent);
}

.vdp-direct-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.vdp-direct-title {
    color: var(--chr-text);
    font-size: 12px;
    font-weight: 600;
}

.vdp-direct-state {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.7;
}

.vdp-direct-field.is-on .vdp-direct-state {
    background: var(--chr-accent);
    color: #fff;
}

.vdp-direct-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
}

/* 原生 checkbox 只留可点/可读，视觉交给后面的开关 */
.vdp-direct-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.vdp-direct-switch {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 20px;
    margin-top: 1px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-muted) 35%, transparent);
    transition: background .16s ease;
}

.vdp-direct-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .28);
    transition: transform .16s ease;
}

.vdp-direct-field.is-on .vdp-direct-switch {
    background: var(--chr-accent);
}

.vdp-direct-field.is-on .vdp-direct-switch::after {
    transform: translateX(14px);
}

.vdp-direct-option input:focus-visible + .vdp-direct-switch {
    outline: 2px solid color-mix(in srgb, var(--chr-accent) 65%, transparent);
    outline-offset: 2px;
}

.vdp-direct-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vdp-direct-text strong {
    color: var(--chr-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.vdp-direct-text small {
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.5;
}

.vdp-estimate {
    margin: 0;
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1.5;
}

.vdp-estimate[hidden] {
    display: none;
}

.vdp-estimate strong {
    color: var(--chr-text);
    font-weight: 600;
}

.vdp-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #04121a;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--chr-accent) 22%, transparent);
    transition: filter .16s ease, opacity .16s ease;
}

.vdp-submit:hover {
    filter: brightness(1.05);
}

.vdp-submit:disabled {
    opacity: .58;
    cursor: not-allowed;
    filter: none;
}

.vdp-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, .25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: vdpSpin .7s linear infinite;
}

.vdp.is-submitting .vdp-spinner {
    display: block;
}

.vdp.is-submitting .vdp-submit {
    cursor: progress;
}

.vdp-status {
    margin: 0;
    color: var(--chr-muted);
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
}

.vdp-status[hidden] {
    display: none;
}

.vdp-status.is-error {
    color: #fca5a5;
}

.vdp-status.is-ok {
    color: #5eead4;
}

.vdp-status a {
    color: var(--chr-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 右侧示例与结果 */

.vdp-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    padding: 20px 20px 16px;
    background: var(--chr-panel);
    /* 播放区 + 最近记录超出一屏时可以滚动，别把最近记录顶到面板外面 */
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* 画布标题居中，右上角只留一个轻量入口 */
.vdp-side-head {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 96px;
}

.vdp-side-titles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.vdp-side-titles strong {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.25;
}

.vdp-side-titles small {
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1.5;
}

.vdp-side-link {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 11.5px;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease;
}

.vdp-side-link:hover {
    border-color: color-mix(in srgb, var(--chr-accent) 48%, var(--chr-line));
    color: var(--chr-text);
}

/* 当前智能体/玩法组的最近制作记录 */
.vdp-recent {
    flex: none;
    min-height: 0;
    padding-top: 12px;
    border-top: 1px solid var(--chr-line);
}

.vdp-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.vdp-recent-head strong {
    color: var(--chr-text);
    font-size: 12.5px;
    font-weight: 600;
}

.vdp-recent-head a {
    color: var(--chr-accent);
    font-size: 11.5px;
    text-decoration: none;
}

.vdp-recent-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.vdp-recent-nav .vdp-recent-page {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 6px;
    background: transparent;
    color: var(--chr-text);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.vdp-recent-nav .vdp-recent-page:disabled {
    opacity: 0.35;
    cursor: default;
}

.vdp-recent-page-num {
    min-width: 30px;
    color: var(--chr-muted);
    font-size: 11px;
    font-style: normal;
    text-align: center;
}

.vdp-recent-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
}

.vdp-recent-empty {
    margin: 0;
    color: var(--chr-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

/* 最近记录：与深度复刻一致的大卡片（缩略图 + 时间 + 状态 + 下载/重试/删除） */
.vdp-recent-item {
    flex: 0 0 108px;
    width: 108px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.vdp-recent-thumb {
    position: relative;
    display: block;
    width: 108px;
    height: 66px;
    overflow: hidden;
    border: 1px solid var(--chr-line);
    border-radius: 9px;
    background: var(--chr-panel-2);
}

.vdp-recent-item.is-failed .vdp-recent-thumb {
    border-color: rgba(248, 113, 113, .5);
}

.vdp-recent-thumb img,
.vdp-recent-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0b1018;
}

.vdp-recent-thumb video {
    pointer-events: none;
}

/* 小图上的播放按钮：点击整块记录就到右侧大预览区播放 */
.vdp-recent-play {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.vdp-recent-play::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(6, 10, 16, .55);
    border: 1px solid rgba(255, 255, 255, .42);
}

.vdp-recent-play svg {
    position: relative;
    width: 13px;
    height: 13px;
    margin-left: 1px;
    color: #fff;
}

/* 下载：缩略图下方的文字链接，不触发整块记录的点击 */
.vdp-recent-download {
    flex: none;
    color: var(--chr-accent);
    font-size: 10.5px;
    line-height: 1.2;
    cursor: pointer;
}

.vdp-recent-download:hover {
    text-decoration: underline;
}

/* 时间 + 状态：与深度复刻一致的卡片文字区 */
.vdp-recent-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: var(--chr-muted);
    font-size: 10.5px;
    line-height: 1.2;
}

.vdp-recent-line small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdp-recent-state {
    color: var(--chr-muted);
    font-size: 10.5px;
    line-height: 1.2;
}

.vdp-recent-item.is-pending .vdp-recent-state {
    color: #fbbf24;
}

.vdp-recent-item.is-failed .vdp-recent-state {
    color: #f87171;
}

.vdp-recent-item.is-pending .vdp-recent-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 16, .45);
}

.vdp-recent-retry {
    align-self: flex-start;
    margin-top: 1px;
    padding: 2px 7px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 46%, transparent);
    border-radius: 999px;
    color: var(--chr-accent);
    font-size: 10.5px;
    line-height: 1.2;
    cursor: pointer;
}

.vdp-recent-retry:hover {
    background: color-mix(in srgb, var(--chr-accent) 12%, transparent);
}

/* 删除：缩略图右上角 */
.vdp-recent-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 3;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(6, 10, 16, .66);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.vdp-recent-delete:hover {
    background: rgba(6, 10, 16, .86);
}

/* 示例画布：中间一张主图，两侧略微缩小淡出，避免三张并排占满 */
.vdp-showcase {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(200px, 30vh, 320px);
    padding: 2px 0;
}

.vdp-showcase-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    min-width: 0;
    height: 100%;
}

.vdp-showcase-item:nth-child(1),
.vdp-showcase-item:nth-child(3) {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 30%;
    max-width: 250px;
    height: 82%;
    transform: translateY(-50%);
    opacity: .55;
}

.vdp-showcase-item:nth-child(1) {
    left: 2%;
}

.vdp-showcase-item:nth-child(3) {
    right: 2%;
}

.vdp-showcase-item:nth-child(2) {
    position: relative;
    z-index: 2;
    width: min(46%, 400px);
    height: 100%;
}

.vdp-showcase-thumb {
    --vdp-tone: var(--chr-accent);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    background:
        radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--vdp-tone) 22%, transparent), transparent 64%),
        linear-gradient(160deg, color-mix(in srgb, var(--vdp-tone) 12%, var(--chr-panel)), var(--chr-panel-2) 78%);
    box-shadow: 0 16px 32px color-mix(in srgb, #0f172a 10%, transparent);
    overflow: hidden;
}

.vdp-showcase-thumb[data-tone="2"] {
    --vdp-tone: var(--chr-accent-2);
}

.vdp-showcase-thumb[data-tone="3"] {
    --vdp-tone: var(--chr-accent-3);
}

.vdp-showcase-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-panel) 84%, transparent);
    color: var(--chr-soft);
    font-size: 10px;
    font-weight: 600;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.vdp-showcase-play {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--chr-line);
    border-radius: 50%;
    background: color-mix(in srgb, var(--chr-panel) 88%, transparent);
    color: var(--chr-text);
    box-shadow: 0 8px 18px color-mix(in srgb, #0f172a 14%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.vdp-showcase-play svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.vdp-showcase-item figcaption {
    display: none;
    color: var(--chr-muted);
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdp-showcase-item:nth-child(2) figcaption {
    display: block;
}

/* 出片后让视频独占画布 */
.vdp-side:has(.vdp-stage[data-state="success"]) .vdp-showcase,
.vdp-side:has(.vdp-stage[data-state="success"]) .vdp-script {
    display: none;
}

/* 分镜脚本：先出脚本、用户确认后才制作视频 */
.vdp-script {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.vdp-script[hidden] {
    display: none;
}

.vdp-side:has(.vdp-script:not([hidden])) .vdp-showcase {
    display: none;
}

.vdp-script-head {
    flex: none;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
}

.vdp-script-head strong {
    font-size: 13px;
    font-weight: 700;
}

.vdp-script-head small {
    color: var(--chr-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.vdp-script-body {
    flex: 1 1 auto;
    width: 100%;
    min-height: 180px;
    max-height: 46vh;
    padding: 12px 14px;
    border: 1px solid var(--chr-line);
    border-radius: 14px;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.85;
    resize: none;
    outline: none;
    transition: border-color .16s ease;
}

.vdp-script-body:focus {
    border-color: color-mix(in srgb, var(--chr-accent) 46%, var(--chr-line));
}

.vdp-script-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vdp-script-regen {
    flex: none;
    height: 36px;
    padding: 0 15px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease;
}

.vdp-script-regen:hover {
    border-color: color-mix(in srgb, var(--chr-accent) 44%, var(--chr-line));
    color: var(--chr-text);
}

.vdp-script-confirm {
    flex: 1 1 auto;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #04121a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .16s ease, opacity .16s ease;
}

.vdp-script-confirm:hover {
    filter: brightness(1.06);
}

.vdp.is-scripting .vdp-script-regen,
.vdp.is-scripting .vdp-script-confirm,
.vdp.is-submitting .vdp-script-regen,
.vdp.is-submitting .vdp-script-confirm {
    opacity: .55;
    pointer-events: none;
}

/* ===== 直接制作：右侧提示词编辑区（与左侧需求框双向同步） ===== */
.vdp-prompt-editor {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.vdp-prompt-editor[hidden] {
    display: none;
}

.vdp-side:has(.vdp-prompt-editor:not([hidden])) .vdp-showcase {
    display: none;
}

.vdp-prompt-editor-head {
    flex: none;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
}

.vdp-prompt-editor-head strong {
    font-size: 13px;
    font-weight: 700;
}

.vdp-prompt-editor-head small {
    color: var(--chr-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.vdp-prompt-editor-body {
    flex: 1 1 auto;
    width: 100%;
    min-height: 220px;
    max-height: 56vh;
    padding: 12px 14px;
    border: 1px solid var(--chr-line);
    border-radius: 14px;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.85;
    resize: none;
    outline: none;
}

.vdp-prompt-editor-body:focus {
    border-color: color-mix(in srgb, var(--chr-accent) 46%, var(--chr-line));
}

.vdp-prompt-editor-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vdp-prompt-editor-submit {
    flex: 1 1 auto;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #04121a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .16s ease, opacity .16s ease;
}

.vdp-prompt-editor-submit:hover {
    filter: brightness(1.06);
}

.vdp.is-submitting .vdp-prompt-editor-submit {
    opacity: .55;
    pointer-events: none;
}

/* 生成结果：与深度复刻一致，成片以小卡展示，点小卡在弹层放大播放 */
.vdp-stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    margin-top: auto;
    padding: 12px 14px 13px;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    background: var(--chr-panel-2);
}

/* 有成片时占满画布，小卡从左上排列；单行拉满高度，分析结果才有空间把提示词放大 */
.vdp-stage[data-state="success"] .vdp-stage-frame {
    grid-template-rows: minmax(0, 1fr);
    place-items: stretch;
    align-content: start;
    padding: 2px;
    background: none;
    border-radius: 0;
    overflow-y: auto;
}

.vdp-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    align-content: start;
    gap: 10px;
    width: 100%;
}

.vdp-result-grid[hidden] {
    display: none;
}

.vdp-result-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.vdp-result-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--chr-panel-3);
    cursor: pointer;
}

.vdp-result-media img,
.vdp-result-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.vdp-result-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0) 42%, rgba(3, 7, 18, .55));
}

.vdp-result-play svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .45));
}

.vdp-result-card figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.2;
}

.vdp-result-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdp-result-download {
    flex: none;
    color: var(--chr-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== 生成结果双页签：预览 / 分析结果（与深度复刻一致） ===== */
.vdp-stage-tabs {
    display: flex;
    flex: none;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    padding: 2px;
    border-radius: 9px;
    background: var(--chr-panel-3);
}

.vdp-stage-tab {
    flex: none;
    height: 22px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--chr-muted);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.vdp-stage-tab:hover {
    color: var(--chr-text);
}

.vdp-stage-tab.is-active {
    background: var(--chr-panel);
    color: var(--chr-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

/* 分析结果：提示词 + 分镜脚本 + 复制/播放/下载 */
.vdp-analysis {
    display: flex;
    flex-direction: column;
    align-content: start;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.vdp-analysis[hidden] {
    display: none;
}

.vdp-analysis-empty {
    margin: 0;
    color: var(--chr-muted);
    font-size: 12.5px;
}

.vdp-analysis-item {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 12px 14px;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel-3);
}

.vdp-analysis-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.vdp-analysis-head strong {
    font-size: 14px;
    font-weight: 700;
}

.vdp-analysis-head small {
    color: var(--chr-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.vdp-analysis-label {
    color: var(--chr-text);
    font-size: 12px;
    font-weight: 600;
    opacity: .72;
}

/* 提示词/脚本占满卡片剩余高度：有多大空间就显示多大，不再挤成几行小字 */
.vdp-analysis-text {
    flex: 1 1 auto;
    min-height: 2.6em;
    max-height: none;
    margin: 0;
    overflow: auto;
    color: var(--chr-text);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.vdp-analysis-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.vdp-analysis-action {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--chr-text);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.vdp-analysis-action:hover {
    border-color: var(--chr-accent);
    color: var(--chr-accent);
}

.vdp-analysis-copy {
    border-color: var(--chr-accent);
    color: var(--chr-accent);
}

.vdp-analysis-copy.is-copied {
    opacity: .72;
}

/* 放大预览弹层：弹层挂在 body 上，所以颜色变量都带深色兜底 */
.vdp-viewer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483000;
    display: none;
    place-items: center;
    padding: 24px;
    color: var(--chr-text, #f5f6f8);
}

.vdp-viewer.is-open {
    display: grid;
}

.vdp-viewer[hidden] {
    display: none;
}

.vdp-viewer-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(2, 6, 23, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.vdp-viewer-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(960px, 94vw);
    max-height: 92vh;
    padding: 12px 14px 16px;
    border: 1px solid var(--chr-line, rgba(255, 255, 255, .12));
    border-radius: 16px;
    background: var(--chr-panel, #171920);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .26);
}

.vdp-viewer-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vdp-viewer-head strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdp-viewer-open,
.vdp-viewer-download {
    flex: none;
    color: var(--chr-accent, #22d3ee);
    font-size: 12px;
    text-decoration: none;
}

.vdp-viewer-open:hover,
.vdp-viewer-download:hover {
    text-decoration: underline;
}

.vdp-viewer-open[hidden],
.vdp-viewer-download[hidden] {
    display: none;
}

.vdp-viewer-close {
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--chr-line, rgba(255, 255, 255, .12));
    border-radius: 50%;
    background: var(--chr-panel-2, #1c1f27);
    color: var(--chr-text, #f5f6f8);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.vdp-viewer-frame {
    display: grid;
    place-items: center;
    min-height: 0;
    border-radius: 12px;
    background: #000;
    overflow: hidden;
}

.vdp-viewer-video {
    display: block;
    width: 100%;
    max-height: 76vh;
    background: #000;
    object-fit: contain;
}

/* 生成结果区里的兜底播放器：弹层不可见时也一定能看到视频 */
.vdp-inline {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    border-radius: 12px;
    background: #000;
    overflow: hidden;
}

.vdp-inline[hidden] {
    display: none;
}

.vdp-inline video {
    display: block;
    width: 100%;
    max-height: 60vh;
    background: #000;
    object-fit: contain;
}

/* AI 推理进度条：生成中按时间平滑推进 */
.vdp-progress {
    grid-column: 1 / -1;
    justify-self: stretch;
    margin-top: 10px;
    width: 100%;
    max-width: 420px;
}

.vdp-progress[hidden] {
    display: none;
}

.vdp-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.vdp-progress-head strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.vdp-progress-head span {
    color: var(--chr-muted);
    font-size: 11.5px;
}

.vdp-progress-track {
    height: 6px;
    border-radius: 999px;
    background: var(--chr-panel-3);
    overflow: hidden;
}

.vdp-progress-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--chr-accent), var(--chr-accent-2));
    transition: width .4s ease;
}

/* 长视频分段：段清单、失败段补做、分割素材与合并成片 */
.vdp-lv {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--chr-line);
    border-radius: 10px;
    background: var(--chr-panel-3);
    color: var(--chr-text);
}

.vdp-lv[hidden] {
    display: none;
}

.vdp-lv-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--chr-muted);
}

.vdp-lv-head strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--chr-text);
}

.vdp-lv-head small {
    font-size: 11px;
    color: var(--chr-muted);
}

.vdp-lv-note {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--chr-soft);
}

.vdp-lv-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.vdp-lv-seg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel-2);
    font-size: 11px;
    color: var(--chr-soft);
}

.vdp-lv-seg.is-succeeded {
    border-color: color-mix(in srgb, #22c55e 45%, var(--chr-line));
    color: #86efac;
}

.vdp-lv-seg.is-failed {
    border-color: color-mix(in srgb, #ef4444 48%, var(--chr-line));
    color: #fca5a5;
}

.vdp-lv-seg.is-pending {
    border-color: color-mix(in srgb, var(--chr-accent) 45%, var(--chr-line));
    color: var(--chr-accent);
}

.vdp-lv-reason {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: #fca5a5;
}

.vdp-lv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.vdp-lv-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 55%, var(--chr-line));
    border-radius: 999px;
    background: transparent;
    color: var(--chr-accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.vdp-lv-btn:hover {
    background: color-mix(in srgb, var(--chr-accent) 14%, transparent);
}

.vdp-lv-btn.is-ghost {
    border-color: var(--chr-line);
    color: var(--chr-soft);
    font-weight: 500;
}

.vdp-lv-btn.is-ghost:hover {
    color: var(--chr-accent);
}

@media (max-width: 640px) {
    .vdp-result-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 8px;
    }

    .vdp-viewer {
        padding: 10px;
    }

    .vdp-viewer-dialog {
        width: 100%;
        max-height: 94vh;
    }
}

.vdp-stage-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vdp-stage-head strong {
    font-size: 13px;
    font-weight: 700;
}

.vdp-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 21px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--chr-panel-3);
    color: var(--chr-muted);
    font-size: 10.5px;
    font-weight: 600;
}

.vdp-stage[data-state="pending"] .vdp-stage-badge,
.vdp-stage[data-state="scripting"] .vdp-stage-badge {
    background: color-mix(in srgb, var(--chr-accent) 16%, transparent);
    color: var(--chr-accent);
}

.vdp-stage[data-state="script"] .vdp-stage-badge {
    background: color-mix(in srgb, var(--chr-accent-2) 18%, transparent);
    color: var(--chr-accent-2);
}

.vdp-stage[data-state="success"] .vdp-stage-badge {
    background: color-mix(in srgb, #10b981 18%, transparent);
    color: #34d399;
}

.vdp-stage[data-state="failed"] .vdp-stage-badge {
    background: color-mix(in srgb, #ef4444 16%, transparent);
    color: #f87171;
}

.vdp-stage-frame {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background:
        radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--chr-panel-3) 60%, transparent), transparent 70%),
        color-mix(in srgb, var(--chr-panel-3) 45%, transparent);
    overflow: hidden;
}

/* 待生成 / 生成中 / 失败：一个作品只占一个小方图，不预留整列大画布 */
.vdp-stage:not([data-state="success"]) {
    flex: 0 0 auto;
}

.vdp-stage:not([data-state="success"]) .vdp-stage-frame {
    flex: 0 0 auto;
    place-items: start;
    background: none;
    border-radius: 0;
    overflow: visible;
}

.vdp-stage-idle {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    min-width: 0;
}

.vdp-stage-idle[hidden] {
    display: none;
}

.vdp-stage-idle-icon {
    position: relative;
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--chr-panel-2);
    border: 1px solid var(--chr-line);
    color: var(--chr-accent);
}

.vdp-stage-idle-icon svg {
    width: 22px;
    height: 22px;
}

.vdp-stage-idle strong {
    font-size: 12.5px;
    font-weight: 700;
}

.vdp-stage-idle small {
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* 写脚本中：预览区放大，让用户一眼看出模型正在干活 */
.vdp-stage[data-state="scripting"] .vdp-stage-idle {
    grid-template-columns: 76px minmax(0, 1fr);
    row-gap: 6px;
    padding: 18px 16px;
}

.vdp-stage[data-state="scripting"] .vdp-stage-idle-icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    border-color: color-mix(in srgb, var(--chr-accent) 55%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 12%, var(--chr-panel-2));
}

.vdp-stage[data-state="scripting"] .vdp-stage-idle-icon svg {
    display: none;
}

.vdp-stage[data-state="scripting"] .vdp-stage-idle-icon::after {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--chr-accent) 22%, transparent);
    border-top-color: var(--chr-accent);
    animation: vdpSpin .8s linear infinite;
}

.vdp-stage[data-state="scripting"] .vdp-stage-idle strong {
    font-size: 16px;
    letter-spacing: .2px;
}

.vdp-stage[data-state="scripting"] .vdp-stage-idle small {
    font-size: 12.5px;
    line-height: 1.7;
}

/* 脚本已写好：脚本框放大，方便直接看和改 */
.vdp.is-script-ready .vdp-script-body {
    min-height: 280px;
    font-size: 13.5px;
    line-height: 1.75;
}

/* 生成中：小方图内转圈即可 */
.vdp-stage[data-state="pending"] .vdp-stage-idle-icon svg {
    display: none;
}

.vdp-stage[data-state="pending"] .vdp-stage-idle-icon::after {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--chr-accent) 26%, transparent);
    border-top-color: var(--chr-accent);
    animation: vdpSpin .8s linear infinite;
}

.vdp-stage[data-state="failed"] .vdp-stage-idle-icon {
    border-color: color-mix(in srgb, #ef4444 40%, transparent);
    color: #f87171;
}

.vdp-stage-foot {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vdp-stage-note {
    margin: 0;
    min-width: 0;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdp-stage-note.is-error {
    color: #f87171;
    white-space: normal;
}

.vdp-stage-note.is-ok {
    color: #5eead4;
}

.vdp-stage-link {
    flex: none;
    color: var(--chr-accent);
    font-size: 11.5px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.vdp-stage-link[hidden] {
    display: none;
}

/* 写脚本太久时的急救按钮：不用等自动回队，用户可以直接重写这一条 */
.vdp-stage-retry {
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    font-size: 11.5px;
    line-height: 1.4;
    cursor: pointer;
}

.vdp-stage-retry:hover {
    background: rgba(248, 113, 113, 0.2);
}

.vdp-stage-retry[hidden] {
    display: none;
}

/* 滚动锁定 */

body.vdp-open {
    overflow: hidden;
}

/* 亮色模式微调 */

html.jn-light-mode .vdp-submit,
html[data-theme="light"] .vdp-submit,
body.jn-light-mode .vdp-submit,
body[data-theme="light"] .vdp-submit {
    color: #fff;
}

html.jn-light-mode .vdp-status.is-error,
html[data-theme="light"] .vdp-status.is-error,
body.jn-light-mode .vdp-status.is-error,
body[data-theme="light"] .vdp-status.is-error {
    color: #b91c1c;
}

html.jn-light-mode .vdp-status.is-ok,
html[data-theme="light"] .vdp-status.is-ok,
body.jn-light-mode .vdp-status.is-ok,
body[data-theme="light"] .vdp-status.is-ok {
    color: #0f766e;
}

html.jn-light-mode .vdp-model-note.is-warning,
html[data-theme="light"] .vdp-model-note.is-warning,
body.jn-light-mode .vdp-model-note.is-warning,
body[data-theme="light"] .vdp-model-note.is-warning {
    color: #b45309;
}

html.jn-light-mode .vdp-stage-note.is-error,
html[data-theme="light"] .vdp-stage-note.is-error,
body.jn-light-mode .vdp-stage-note.is-error,
body[data-theme="light"] .vdp-stage-note.is-error {
    color: #b91c1c;
}

html.jn-light-mode .vdp-stage-badge,
html[data-theme="light"] .vdp-stage-badge,
body.jn-light-mode .vdp-stage-badge,
body[data-theme="light"] .vdp-stage-badge {
    color: #475569;
}

html.jn-light-mode .vdp-stage-retry,
html[data-theme="light"] .vdp-stage-retry,
body.jn-light-mode .vdp-stage-retry,
body[data-theme="light"] .vdp-stage-retry {
    border-color: rgba(185, 28, 28, 0.35);
    background: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
}

html.jn-light-mode .vdp-stage[data-state="success"] .vdp-stage-badge,
html[data-theme="light"] .vdp-stage[data-state="success"] .vdp-stage-badge,
body.jn-light-mode .vdp-stage[data-state="success"] .vdp-stage-badge,
body[data-theme="light"] .vdp-stage[data-state="success"] .vdp-stage-badge {
    color: #0f766e;
}

/* 响应式 */

@media (max-width: 1180px) {
    .vdp {
        padding: 8px 14px 14px 4px;
    }

    .vdp-dialog {
        grid-template-columns: clamp(400px, 42vw, 560px) minmax(0, 1fr);
    }

    .vdp-side {
        padding: 18px 18px 16px;
    }

    .vdp-side-head {
        padding: 0 84px;
    }

    .vdp-showcase {
        min-height: clamp(150px, 24vh, 220px);
    }

    .vdp-showcase-item:nth-child(2) {
        width: min(52%, 340px);
    }
}

@media (max-width: 980px) {
    .vdp {
        padding: 0;
    }

    .vdp-dialog {
        grid-template-columns: minmax(0, 1fr);
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .vdp-main {
        border-right: 0;
    }

    .vdp-side {
        display: none;
    }

    /* 窄屏仍然要能看到并确认脚本，否则流程会卡在“未确认” */
    .vdp-side:has(.vdp-script:not([hidden])) {
        display: flex;
        border-top: 1px solid var(--chr-line);
        padding: 16px;
    }

    .vdp-script-body {
        min-height: 160px;
        max-height: none;
        height: 240px;
        flex: none;
    }
}

@media (max-width: 760px) {
    .vdp {
        grid-column: 1;
        grid-row: 1;
    }
}

@media (max-width: 640px) {
    .vdp-top {
        padding: 12px 13px 11px;
    }

    .vdp-identity-copy small {
        display: none;
    }

    .vdp-body {
        padding: 10px 13px 8px;
        gap: 9px;
    }

    .vdp-card {
        padding: 10px 11px 9px;
        border-radius: 14px;
    }

    .vdp-card-head small {
        display: none;
    }

    .vdp-mode-copy strong {
        font-size: 11.5px;
    }

    .vdp-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vdp-foot {
        padding: 10px 13px 13px;
    }

    .vdp-fields {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .vdp-field:first-child {
        grid-column: 1 / -1;
    }

    .vdp-video {
        flex-wrap: wrap;
    }

    .vdp-video video {
        width: 100%;
        height: 148px;
    }
}

@keyframes vdpFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vdpRise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes vdpSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .vdp-dialog,
    .vdp-spinner,
    .vdp-stage[data-state="pending"] .vdp-stage-idle-icon::after {
        animation: none;
    }
}


/* 视频智能体「编导」面板：子技能选择 + 提示词芯片 */
.vdp-skills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
/* 只有「反推 + 直接制作」两个玩法时竖排：直接制作排在反推按钮下方 */
.vdp-skills.is-stacked {
    grid-template-columns: minmax(0, 1fr);
}
.vdp-skill {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    min-height: 60px;
    padding: 9px 12px;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel);
    color: var(--chr-text);
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.vdp-skill strong {
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.35;
    padding-right: 16px;
}
.vdp-skill span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.45;
    overflow: hidden;
}
.vdp-skill:hover {
    border-color: color-mix(in srgb, var(--chr-accent) 42%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 4%, var(--chr-panel));
}
.vdp-skill.is-active {
    border-color: color-mix(in srgb, var(--chr-accent) 70%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 8%, var(--chr-panel));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--chr-accent) 24%, transparent) inset;
}
.vdp-skill.is-active strong { color: var(--chr-accent); }
.vdp-skill.is-active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--chr-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}
.vdp-skill:last-child:nth-child(odd) { grid-column: 1 / -1; }

.vdp-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.vdp-chips-label { font-size: 11.5px; color: var(--chr-muted); }
.vdp-chip {
    padding: 6px 11px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 11.5px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.vdp-chip:hover {
    border-color: color-mix(in srgb, var(--chr-accent) 52%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 8%, var(--chr-panel));
    color: var(--chr-text);
}

/* 技能引用：分组 chips（1:1 对标：人物设定 / 质感增强 / 分镜故事版） */
.vdp-skillchips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vdp-skillgroup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}
.vdp-skillgroup-label {
    flex: 0 0 auto;
    font-size: 11.5px;
    line-height: 1;
    color: var(--chr-muted);
    letter-spacing: .02em;
}
.vdp-skillchip {
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 11.5px;
    line-height: 1;
    padding: 7px 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.vdp-skillchip:hover,
.vdp-skillchip.is-used {
    border-color: color-mix(in srgb, var(--chr-accent) 52%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 10%, var(--chr-panel));
    color: var(--chr-text);
}

/* 面板脚本没加载时的可见提示：否则用户只会看到空白模型下拉与空记录 */
.vdp-script-hint {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 2147483000;
    margin: 0;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--chr-accent, #6d7cff) 45%, transparent);
    background: color-mix(in srgb, var(--chr-panel, #17181d) 92%, transparent);
    color: var(--chr-text, #e8eaf2);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.vdp-script-hint[hidden] { display: none; }

/* 长视频：快速时长 + 分段说明 */
.vdp-duration-chips {
    display: inline-flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.vdp-duration-chips[hidden] { display: none; }
.vdp-duration-chips button {
    min-width: 44px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--chr-border, rgba(255,255,255,.16)) 80%, transparent);
    background: transparent;
    color: var(--chr-text, #e8eaf2);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.vdp-duration-chips button:hover {
    border-color: color-mix(in srgb, var(--chr-accent, #6d7cff) 55%, transparent);
    background: color-mix(in srgb, var(--chr-accent, #6d7cff) 12%, transparent);
}
/* 「最高可 N 秒」：文案比 5s/15s 长，单独强调一下，不要被压成两行 */
.vdp-duration-chips button[data-vdp-duration-max] {
    white-space: nowrap;
    font-weight: 600;
    border-color: color-mix(in srgb, var(--chr-accent, #6d7cff) 45%, transparent);
}
.vdp-duration-chips button[data-vdp-duration-max][hidden] { display: none; }
.vdp-duration-hint {
    display: block;
    margin-top: 6px;
    color: color-mix(in srgb, var(--chr-text, #e8eaf2) 72%, transparent);
    font-size: 12px;
    line-height: 1.5;
}
.vdp-duration-hint[hidden] { display: none; }

/* 已选素材点击预览：图片看大图、视频播放、声音试听 */
.vdp-slot.has-file, .vdp-slot.has-file .vdp-slot-thumb { cursor: zoom-in; }
.vdp-slot-thumb.has-audio, .vdp-slot-thumb.has-video { position: relative; }
.vdp-slot-thumb.has-audio::after, .vdp-slot-thumb.has-video::after {
    content: '▶';
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    pointer-events: none;
}
.vdp-preview {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 10, 20, .78);
    backdrop-filter: blur(3px);
}
.vdp-preview-inner {
    position: relative;
    max-width: min(880px, 92vw);
    max-height: 88vh;
    padding: 14px;
    border-radius: 14px;
    background: var(--chr-panel-2, #141a24);
    border: 1px solid var(--chr-line, rgba(255,255,255,.12));
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.vdp-preview-label {
    font-size: 13px;
    color: var(--chr-soft, #cbd5e1);
}
.vdp-preview-image,
.vdp-preview-video {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 10px;
    display: block;
    background: #000;
}
.vdp-preview-audio {
    width: min(420px, 80vw);
    border-radius: 10px;
}
.vdp-preview-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--chr-line, rgba(255,255,255,.2));
    background: var(--chr-panel-3, #1c2534);
    color: var(--chr-text, #e8eaf2);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.vdp-preview-close:hover { background: var(--chr-accent, #2f6bff); color: #fff; }
.vdp-preview-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    align-items: center;
}
.vdp-preview-replace,
.vdp-preview-close-text {
    border-radius: 8px;
    border: 1px solid var(--chr-line, rgba(255,255,255,.18));
    background: var(--chr-panel-3, #1c2534);
    color: var(--chr-text, #e8eaf2);
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
}
.vdp-preview-replace {
    border-color: transparent;
    background: var(--chr-accent, #2f6bff);
    color: #fff;
}
.vdp-preview-replace:hover { filter: brightness(1.08); }
.vdp-preview-close-text:hover { background: var(--chr-panel-2, #141a24); }
.vdp-preview-remove {
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, #ef4444 55%, transparent);
    background: color-mix(in srgb, #ef4444 16%, transparent);
    color: #ff9a9a;
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
}
.vdp-preview-remove:hover {
    background: color-mix(in srgb, #ef4444 28%, transparent);
    color: #fff;
}

/* 多图预览：大图 + 左右翻页 + 当前槽位全部缩略图 */
.vdp-preview-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}
.vdp-preview-nav {
    position: absolute;
    top: 50%;
    left: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0 0 2px;
    border: 0;
    border-radius: 50%;
    background: rgba(6, 10, 20, .62);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.vdp-preview-nav.is-next { left: auto; right: 6px; }
.vdp-preview-nav:hover { background: var(--chr-accent, #2f6bff); }
.vdp-preview-nav:disabled { opacity: .3; cursor: default; background: rgba(6, 10, 20, .5); }
.vdp-preview-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: min(560px, 86vw);
    max-height: 120px;
    overflow-y: auto;
}
.vdp-preview-thumb {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--chr-line, rgba(255,255,255,.16));
    border-radius: 8px;
    overflow: hidden;
    background: var(--chr-panel-3, #1c2534);
    cursor: pointer;
}
.vdp-preview-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.vdp-preview-thumb.is-active {
    border-color: var(--chr-accent, #2f6bff);
    box-shadow: 0 0 0 1px var(--chr-accent, #2f6bff);
}

/* 带缩略图的大图留出下方空间，避免多图预览超出屏幕 */
.vdp-preview-image {
    max-height: min(66vh, calc(88vh - 190px));
}

/* 宽屏左栏两列排布：整屏可见全部设置，不再需要上下滚动 */
@media (min-width: 1100px) and (min-height: 640px) {
    .vdp-side {
        overflow: hidden;
    }

    .vdp-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-content: start;
        gap: 8px 10px;
        padding: 10px 14px 8px;
        overflow-y: auto;
        scrollbar-gutter: stable;
    }

    .vdp-body > .vdp-card {
        padding: 10px 12px;
    }

    .vdp-body > .vdp-card:nth-child(3),
    .vdp-body > .vdp-fields {
        grid-column: 1 / -1;
    }

    .vdp-body .vdp-card-head {
        margin-bottom: 6px;
    }

    /* 玩法按钮改三列，5 个玩法两行放完，给下面参数留出高度 */
    .vdp-body .vdp-skills {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .vdp-body .vdp-skill {
        padding: 8px 9px;
    }

    .vdp-body .vdp-skill small {
        display: none;
    }

    /* 开场提示按钮限高，避免把参数挤到屏幕外 */
    .vdp-body .vdp-chips {
        max-height: 112px;
        overflow-y: auto;
    }

    .vdp-body .vdp-slot {
        min-height: 74px;
    }

    .vdp-body .vdp-slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .vdp-body .vdp-chips {
        margin-top: 6px;
    }

    .vdp-body textarea,
    .vdp-body .vdp-prompt {
        min-height: 92px;
    }
}

/* 反推阶段素材区只有参考视频：单个槽位占满整行，做成大号上传区 */
.vdp.is-analyze-stage .vdp-slots,
.vdp-body .vdp.is-analyze-stage .vdp-slots {
    grid-template-columns: minmax(0, 1fr);
}

.vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"],
.vdp-body .vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] {
    min-height: 118px;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 14px;
}

.vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-thumb,
.vdp-body .vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-thumb svg,
.vdp-body .vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-thumb svg {
    width: 28px;
    height: 28px;
}

.vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-name,
.vdp-body .vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-name {
    font-size: 13.5px;
}

.vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-tip,
.vdp-body .vdp.is-analyze-stage .vdp-slot[data-vdp-slot="video"] .vdp-slot-tip {
    font-size: 11.5px;
}

/* 反推阶段（选了反推玩法、还没反推出提示词）：这一步只让用户选「反推模型」。
   视频模型、语言、字幕语言、时长、画面比例、生成数量、清晰度、制作方式与需求框
   先收起来，等反推提示词成功返回、脚本区出现后再整块显示，用来制作视频；
   直接选「直接制作爆款视频」时不属于反推阶段，这些字段照常显示。 */
.vdp.is-analyze-stage [data-vdp-make-field],
.vdp-body .vdp.is-analyze-stage [data-vdp-make-field] {
    display: none !important;
}

.vdp.is-analyze-stage [data-vdp-make-card],
.vdp-body .vdp.is-analyze-stage [data-vdp-make-card] {
    display: none !important;
}

/* 反推阶段是唯一的选择器，占满整行 */
.vdp.is-analyze-stage .vdp-field-prompt-model,
.vdp-body .vdp.is-analyze-stage .vdp-field-prompt-model {
    grid-column: 1 / -1;
}

/* ---------- 手机端适配：编导面板 ---------- */
@media (max-width: 760px) {
    /* 时长行：标签独占一行，输入框与延长按钮一行，快捷时长芯片整行平铺，
       避免被挤到右侧变成竖排、压住其他字段 */
    .vdp-field-range {
        flex-wrap: wrap;
        align-items: center;
        row-gap: 8px;
    }

    .vdp-field-range .vdp-field-label {
        flex: 1 1 100%;
        white-space: normal;
    }

    .vdp-field-range input.vdp-duration-input,
    .vdp-field-range select[data-vdp-duration-fixed] {
        flex: 1 1 92px;
        width: auto;
        min-width: 0;
    }

    .vdp-field-range .vdp-extend {
        flex: 0 1 auto;
    }

    .vdp-duration-chips {
        flex: 1 1 100%;
        width: 100%;
        margin-top: 0;
    }

    .vdp-duration-chips button {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 4px;
    }

    /* 手机上的参数区分两列会让下拉过窄，统一改单列 */
    .vdp-fields {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .vdp-field-model,
    .vdp-field-range,
    .vdp-field:first-child {
        grid-column: 1 / -1 !important;
    }

    /* 底部按钮避开手机手势条 */
    .vdp-foot {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .vdp-body {
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    /* 打开制作面板/弹层时收起悬浮快捷球，避免挡住模型下拉与表单 */
    body.vdp-open .jn-quick-drawer-trigger,
    body.ecp-open .jn-quick-drawer-trigger,
    body.agent-modal-open .jn-quick-drawer-trigger {
        display: none !important;
    }
}

/* 原片台词（听写，可修正）：脚本下面单独一块，提示同音字风险 */
.vdp-transcript {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px dashed color-mix(in srgb, var(--chr-accent) 38%, var(--chr-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--chr-accent) 6%, transparent);
}

.vdp-transcript[hidden] {
    display: none !important;
}

.vdp-transcript-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vdp-transcript-head strong {
    color: var(--chr-text);
    font-size: 12px;
    font-weight: 600;
}

.vdp-transcript-head small {
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.5;
}

.vdp-transcript-body {
    width: 100%;
    min-height: 64px;
    max-height: 140px;
    padding: 8px 10px;
    border: 1px solid var(--chr-line);
    border-radius: 10px;
    background: var(--chr-panel);
    color: var(--chr-text);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
}

.vdp-transcript-body:focus {
    border-color: color-mix(in srgb, var(--chr-accent) 46%, var(--chr-line));
}
