/* 🔥 Seedance 2.0 视频生成页面专用样式 */

/* 火热标签 */
.hot-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff5f6d, #ff9a3c);
    border-radius: 11px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(255, 95, 109, 0.35);
    animation: hotPulse 1.6s ease-in-out infinite;
}
@keyframes hotPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}
@keyframes seedanceSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 预览区加载文本动画（三点循环） */
.loading-dots::after {
    content: '';
    display: inline-block;
    width: 24px;
    text-align: left;
    animation: seedanceDots 1.4s steps(4, end) infinite;
}
@keyframes seedanceDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* 润色请求中：按钮与提示词输入框脉冲动画 */
@keyframes seedanceEnhancePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 68, 254, 0.55), 0 0 0 0 rgba(52, 68, 254, 0.0);
        border-color: #3444fe;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(52, 68, 254, 0.0), 0 0 18px 2px rgba(52, 68, 254, 0.45);
        border-color: #6a78ff;
    }
}
@keyframes seedanceEnhanceBtnPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 68, 254, 0.55);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(52, 68, 254, 0.0), 0 4px 16px rgba(52, 68, 254, 0.55);
    }
}
.enhance-pulse {
    animation: seedanceEnhanceBtnPulse 1.2s ease-in-out infinite !important;
    pointer-events: none;
    background: linear-gradient(135deg, #3444fe, #6a78ff) !important;
    color: #fff !important;
    border-color: #3444fe !important;
}
.prompt-pulse {
    animation: seedanceEnhancePulse 1.2s ease-in-out infinite !important;
    outline: none !important;
    border: 1.5px solid #3444fe !important;
}

/* Seedance 2.0 下拉框：自定义三角，点击/聚焦时不消失 */
select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
select.form-control:focus,
select.form-control:active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* 参考素材区 — 统一上传 */
.ref-media-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    align-items: center;
}
.ref-media-upload-row .upload-area-compact {
    width: 80px;
    height: 80px;
    border: 2px dashed rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}
.ref-media-upload-row .upload-area-compact:hover {
    border-color: #5867dd;
    background: rgba(88, 103, 221, 0.08);
}
.ref-media-upload-row .upload-area-compact.uploading {
    pointer-events: none;
    opacity: 0.55;
}
.ref-media-upload-row .upload-plus-icon {
    font-size: 28px;
    color: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    line-height: 1;
}
.ref-media-upload-row .uploaded-image {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.ref-media-upload-row .uploaded-image img,
.ref-media-upload-row .uploaded-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ref-media-upload-row .uploaded-image.audio-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8ecff, #f0f4ff);
}
.ref-media-upload-row .uploaded-image .ref-audio-icon {
    font-size: 28px;
    line-height: 1;
}
.ref-media-upload-row .uploaded-image .remove-image,
.ref-media-upload-row .uploaded-image .ref-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 7;
    padding: 0;
}
.ref-media-upload-row .uploaded-image .remove-image:hover,
.ref-media-upload-row .uploaded-image .ref-remove:hover {
    background: #f44336;
}

.ref-media-upload-row .ref-seq-num {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 5;
    padding: 1px 4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.62);
    border-radius: 4px;
    line-height: 1.3;
    pointer-events: none;
}
.ref-media-upload-row .ref-kind-tag {
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: 4;
    padding: 1px 4px;
    font-size: 8px;
    color: #fff;
    background: rgba(88, 103, 221, 0.88);
    border-radius: 3px;
    pointer-events: none;
}
.ref-media-upload-row .cv-kuaizi-star,
.ref-media-upload-row .cv-kuaizi-checking {
    z-index: 6;
}
.ref-media-upload-row .cv-kuaizi-checking {
    font-size: 8px;
    padding: 1px 4px;
    max-width: calc(100% - 6px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.ref-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.ref-section-head label { margin: 0; }
.ref-ctx-hint {
    font-size: 11px;
    font-weight: 400;
    color: #5867dd;
    white-space: nowrap;
}
.ref-media-upload-row.is-drag-hover {
    outline: 2px dashed #3444fe;
    outline-offset: 4px;
    border-radius: 6px;
    background: rgba(52, 68, 254, 0.04);
}
.ref-media-summary {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}
.ref-unified-grid {
    grid-template-columns: repeat(4, 1fr);
}
.ref-item--unified .ref-seq-num {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 5;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.62);
    border-radius: 4px;
    line-height: 1.4;
    pointer-events: none;
}
.ref-item--unified .ref-kind-tag {
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: 4;
    padding: 1px 5px;
    font-size: 9px;
    color: #fff;
    background: rgba(88, 103, 221, 0.88);
    border-radius: 4px;
    pointer-events: none;
}
.ref-item--unified .ref-audio-icon {
    font-size: 28px;
    line-height: 1;
}
/* 合规校验徽章（与无限画板 ai_canvas.css 统一，左下角） */
.ref-item .cv-kuaizi-star {
    position: absolute;
    bottom: 4px;
    left: 4px;
    top: auto;
    right: auto;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2b7bff 0%, #1858d6 100%);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(24, 88, 214, 0.45);
    pointer-events: none;
    z-index: 6;
}
.ref-item .cv-kuaizi-star svg { width: 12px; height: 12px; }
.ref-item .cv-kuaizi-checking {
    position: absolute;
    bottom: 4px;
    left: 4px;
    top: auto;
    right: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(245, 166, 35, 0.92);
    color: #fff;
    font-size: 10px;
    line-height: 1.4;
    border-radius: 3px;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(245, 166, 35, 0.45);
    z-index: 6;
}
.ref-item .cv-kuaizi-checking-dot {
    width: 9px;
    height: 9px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-top-color: #fff;
    border-radius: 50%;
    animation: refVerifySpin 0.7s linear infinite;
    flex-shrink: 0;
}
/* 右键合规菜单 */
.ref-media-upload-row .upload-area-compact .ref-slot-label {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: #5867dd;
    font-weight: 600;
    pointer-events: none;
}
.ref-media-upload-row .uploaded-image .ref-slot-label {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9px;
    color: #fff;
    background: rgba(88, 103, 221, 0.82);
    padding: 1px 0;
    pointer-events: none;
}
.ref-mode-hint { margin-top: 6px; }
.ref-mode-asset-hint { margin-top: 4px; margin-bottom: 0; }
.sd-ref-ctx-menu {
    position: fixed;
    z-index: 100110;
    min-width: 200px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #e0e3eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.cv-commitment-mask { z-index: 100110 !important; }
.sd-ref-ctx-menu .sd-ctx-row {
    padding: 9px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.12s;
}
.sd-ref-ctx-menu .sd-ctx-row:hover { background: #f0f3ff; color: #3444fe; }
/* @ 引用弹层 */
.ref-mention-popup {
    position: fixed;
    z-index: 100110;
    min-width: 240px;
    max-width: 340px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e3eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    padding: 4px 0;
}
.ref-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: background 0.12s;
}
.ref-mention-item.active,
.ref-mention-item:hover { background: #eef1ff; color: #3444fe; }
.ref-mention-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f2f8;
    border: 1px solid #e8ebf2;
}
.ref-mention-thumb--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.ref-mention-seq {
    font-weight: 700;
    color: #5867dd;
    min-width: 24px;
}
.ref-mention-kind {
    margin-left: auto;
    font-size: 10px;
    color: #888;
    background: #f0f2f8;
    padding: 1px 5px;
    border-radius: 4px;
}
.prompt-label-row + .form-control,
.form-group .form-control#promptInput {
    position: relative;
}
.form-group:has(#promptInput) { position: relative; }

.reference-section .ref-hint {
    margin: 4px 0 10px;
    font-size: 12px;
    color: #888;
}
.ref-group {
    margin-bottom: 14px;
    padding: 10px;
    background: #f8f9fc;
    border-radius: 8px;
    border: 1px solid #ececf1;
}
.ref-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ref-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}
.ref-count {
    font-size: 12px;
    color: #888;
}
.ref-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.ref-upload-grid:empty {
    display: none;
}
.ref-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ddd;
}
.ref-item img,
.ref-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ref-item.audio-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, #e8ecff, #f0f4ff);
}
.ref-item.audio-item .audio-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3px 4px;
    font-size: 10px;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ref-item .ref-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ref-item .ref-remove:hover { background: #f44336; }
.ref-item .ref-role {
    position: absolute;
    top: 3px;
    left: 3px;
    padding: 2px 6px;
    font-size: 10px;
    color: #fff;
    background: rgba(88, 103, 221, 0.85);
    border-radius: 8px;
}
.ref-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    font-size: 12px;
    color: #666;
    background: #fff;
    border: 1.5px dashed #ccd0dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-upload-btn:hover {
    border-color: #5867dd;
    color: #5867dd;
    background: #f5f7ff;
}
.ref-upload-btn .plus { font-size: 16px; }
.ref-upload-btn.uploading {
    pointer-events: none;
    opacity: 0.6;
}

.ref-role-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ref-role-row label { font-size: 12px; color: #666; min-width: 56px; }

/* 画面比例 */
.ratio-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.ratio-btn {
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1.5px solid #e0e3eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
}
.ratio-btn:hover { border-color: #a8b0d0; }
.ratio-btn.active {
    color: #fff;
    border-color: #5867dd;
    background: linear-gradient(135deg, #5867dd, #7986e3);
}

/* 时长滑块 */
.duration-slider {
    width: 100%;
    margin: 6px 0 4px;
    accent-color: #5867dd;
}
.duration-marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}

/* 高级选项 */
.advanced-options .toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}
.advanced-options .toggle-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #5867dd;
    cursor: pointer;
}
.advanced-options .seed-input {
    margin-top: 8px;
}
.advanced-options .seed-input label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}
.advanced-options .seed-input .form-control {
    padding: 6px 10px;
    font-size: 13px;
}

.ref-role-row .form-control { flex: 1; padding: 5px 8px; font-size: 12px; }


/* 🎬 提示词快速插入浮层（镜头/情绪/光影） */
.prompt-picker-popup {
    position: absolute;
    z-index: 9999;
    min-width: 220px;
    max-width: 320px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e3eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.prompt-picker-popup .pp-title {
    flex: 1 0 100%;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}
.prompt-picker-popup .pp-chip {
    padding: 5px 10px;
    font-size: 12px;
    color: #444;
    background: #f5f7fb;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all .15s;
}
.prompt-picker-popup .pp-chip:hover {
    color: #3444fe;
    background: #eef1ff;
    border-color: #c6cdff;
}


/* ==================== Seedance 2.0 合规校验（首页图生视频上传） ==================== */
.ref-compliance-hint {
    margin: 0 0 10px; padding: 10px 12px; font-size: 12px; line-height: 1.6;
    color: #3d4a8f; background: #eef1ff; border: 1px solid #c6cdff; border-radius: 8px;
}
.ref-item { position: relative; }
.ref-item .cv-seedance-shield {
    position: absolute; top: 4px; left: 4px; width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2b7bff 0%, #1858d6 100%); color: #fff;
    border-radius: 50%; box-shadow: 0 2px 6px rgba(24,88,214,0.45);
    pointer-events: none; z-index: 4;
}
.ref-item .cv-seedance-shield svg { width: 11px; height: 11px; }
.ref-item .ref-verifying {
    position: absolute; top: 4px; left: 4px; width: 18px; height: 18px;
    border-radius: 50%; border: 2px solid rgba(43,123,255,0.25); border-top-color: #2b7bff;
    animation: refVerifySpin 0.7s linear infinite; z-index: 4; pointer-events: none;
    box-sizing: border-box;
}
.ref-item .ref-verify-btn {
    position: absolute; bottom: 4px; left: 4px; z-index: 5;
    padding: 2px 7px; font-size: 10px; line-height: 1.4; cursor: pointer;
    color: #fff; background: rgba(52,68,254,0.92); border: none; border-radius: 4px;
}
.ref-item .ref-verify-btn:hover { background: #2333ed; }
@keyframes refVerifySpin { to { transform: rotate(360deg); } }

/* 承诺书弹窗（与画板版本风格统一） */
.cv-commitment-mask {
    position: fixed; inset: 0; background: rgba(15,18,28,0.55);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 10070; display: flex; align-items: center; justify-content: center;
    animation: cvCommitFade 0.18s ease-out;
}
@keyframes cvCommitFade { from { opacity: 0; } to { opacity: 1; } }
.cv-commitment-box {
    width: 560px; max-width: 92vw; max-height: 88vh; background: #fff;
    border-radius: 6px; box-shadow: 0 24px 80px rgba(0,0,0,0.32);
    display: flex; flex-direction: column; overflow: hidden;
}
.cv-commitment-head { padding: 18px 22px 12px; border-bottom: 1px solid #ececec; }
.cv-commitment-head h3 { margin: 0 0 4px; font-size: 16px; color: #1a1a1a; font-weight: 600; }
.cv-commitment-head p { margin: 0; font-size: 12px; color: #888; line-height: 1.6; }
.cv-commitment-body { flex: 1; min-height: 0; padding: 16px 22px; overflow-y: auto; font-size: 13px; color: #333; line-height: 1.85; }
.cv-commitment-body strong { color: #1a1a1a; }
.cv-commitment-body ol { padding-left: 22px; margin: 6px 0; }
.cv-commitment-body ol > li { margin-bottom: 8px; }
.cv-commitment-body ul { padding-left: 18px; margin: 4px 0 8px; }
.cv-commitment-body ul li { font-size: 12px; color: #555; margin-bottom: 3px; }
.cv-commitment-agree {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 22px; border-top: 1px solid #ececec; background: #fafbff;
}
.cv-commitment-agree input[type="checkbox"] { margin-top: 3px; width: 14px; height: 14px; accent-color: #3444fe; cursor: pointer; }
.cv-commitment-agree label { font-size: 13px; color: #1a1a1a; cursor: pointer; line-height: 1.5; }
.cv-commitment-foot { padding: 12px 22px 16px; display: flex; justify-content: flex-end; gap: 8px; }
.cv-commitment-foot button {
    padding: 7px 18px; border-radius: 3px; font-size: 13px; cursor: pointer;
    border: 1px solid #ececec; background: #fff; color: #555; transition: all 0.15s;
}
.cv-commitment-foot button:hover { border-color: #c8c8c8; color: #1a1a1a; }
.cv-commitment-foot button.cv-commit-ok { background: #3444fe; border-color: #3444fe; color: #fff; }
.cv-commitment-foot button.cv-commit-ok:hover { background: #2333ed; border-color: #2333ed; }
.cv-commitment-foot button.cv-commit-ok:disabled { background: #b0b7e8; border-color: #b0b7e8; cursor: not-allowed; }


/* ==================== Seedance 2.0 预置虚拟人像（asset:// 协议） ==================== */
/* 「使用虚拟人像」按钮（位于上传参考图按钮下方） */
.ref-vportrait-btn {
    width: 100%; margin-top: 6px; padding: 8px 10px;
    background: linear-gradient(135deg, #f5f7ff 0%, #eef0ff 100%);
    border: 1px dashed #5867dd; border-radius: 6px;
    font-size: 12px; color: #3444fe; cursor: pointer;
    transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ref-vportrait-btn:hover { background: #eef0ff; border-style: solid; }

/* asset:// 来源徽标（覆盖于参考图缩略图角落） */
.ref-item .ref-asset-badge {
    position: absolute; top: 4px; right: 4px; padding: 1px 5px;
    font-size: 10px; line-height: 1.4; background: rgba(52, 68, 254, 0.92); color: #fff;
    border-radius: 8px; font-weight: 500; letter-spacing: 0.2px;
}

/* 虚拟人像选择器弹窗（与画板共用同名 class，独立样式覆盖） */
.cv-vportrait-modal { position: fixed; inset: 0; z-index: 10050; }
.cv-vportrait-mask { position: absolute; inset: 0; background: rgba(20, 22, 36, 0.45); }
.cv-vportrait-box { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 860px; max-width: 92vw; max-height: 86vh; background: #fff; border-radius: 8px;
    box-shadow: 0 14px 50px rgba(20, 22, 36, 0.25); display: flex; flex-direction: column; overflow: hidden; }
.cv-vportrait-head { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid #ececec; background: #fafbff; }
.cv-vportrait-head h3 { margin: 0; font-size: 15px; color: #1a1a1a; font-weight: 600; }
.cv-vportrait-close { background: transparent; border: 0; font-size: 22px; line-height: 1; color: #999; cursor: pointer; padding: 0 6px; }
.cv-vportrait-close:hover { color: #1a1a1a; }
.cv-vportrait-hint { padding: 10px 20px; font-size: 12px; color: #6a7280; background: #f7f8fc; border-bottom: 1px solid #ececec; line-height: 1.6; }
.cv-vportrait-hint a { color: #3444fe; text-decoration: none; margin-left: 6px; }
.cv-vportrait-hint a:hover { text-decoration: underline; }
/* ── 公共虚拟人像快捷区（管理员维护，与画板共用语义） ── */
.cv-vp-public { padding: 10px 20px 12px; background: #fff; border-bottom: 1px solid #ececec; }
.cv-vp-public-label { font-size: 12.5px; font-weight: 600; color: #1a1a1a; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.cv-vp-public-badge { font-size: 10px; font-weight: 500; color: #fff; background: linear-gradient(135deg,#3444fe,#7b8aff); padding: 2px 7px; border-radius: 2px; }
.cv-vp-public-strip { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scrollbar-width: thin; }
.cv-vp-public-strip::-webkit-scrollbar { height: 6px; }
.cv-vp-public-strip::-webkit-scrollbar-thumb { background: #d8dbe5; border-radius: 3px; }
.cv-vp-public-card { flex: 0 0 100px; cursor: pointer; border: 1.5px solid #e3e6ee; border-radius: 4px; overflow: hidden; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; background: #fff; display: flex; flex-direction: column; }
.cv-vp-public-card:hover { border-color: #3444fe; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52,68,254,0.18); }
.cv-vp-public-cover { width: 100%; aspect-ratio: 3 / 4; background: #f4f6fb url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%22 height=%22100%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23c5cad8%22 stroke-width=%221.5%22><circle cx=%2212%22 cy=%228%22 r=%224%22/><path d=%22M4 21v-2a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v2%22/></svg>') no-repeat center/30px; }
.cv-vp-public-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-vp-public-name { font-size: 11px; color: #333; text-align: center; padding: 4px 4px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-vportrait-body { display: grid; grid-template-columns: 1fr 320px; gap: 0; flex: 1 1 auto; overflow: hidden; }
.cv-vportrait-list { padding: 14px 16px; overflow-y: auto; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-content: start; }
.cv-vp-empty { grid-column: 1 / -1; padding: 28px 8px; text-align: center; color: #8a93a6; font-size: 13px; }
.cv-vp-item { position: relative; background: #fff; border: 1px solid #e3e6ee; border-radius: 6px;
    overflow: hidden; transition: all 0.15s; display: flex; flex-direction: column; }
.cv-vp-item:hover { border-color: #3444fe; box-shadow: 0 4px 14px rgba(52, 68, 254, 0.12); transform: translateY(-1px); }
.cv-vp-thumb { width: 100%; aspect-ratio: 3 / 4; background: #f4f6fb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cv-vp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-vp-noprev { font-size: 12px; color: #b0b7c5; }
.cv-vp-meta { padding: 8px 10px; }
.cv-vp-name { font-size: 13px; color: #1a1a1a; font-weight: 500; line-height: 1.4; display: flex; align-items: center; gap: 6px; }
.cv-vp-tag { font-size: 11px; background: #eef0ff; color: #3444fe; padding: 1px 6px; border-radius: 9px; line-height: 1.4; }
.cv-vp-asset { font-size: 11px; color: #8a93a6; font-family: 'Consolas', 'Monaco', monospace; margin-top: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-vp-pick { position: absolute; left: 8px; bottom: 8px; right: 36px; padding: 6px 0;
    background: #3444fe; color: #fff; border: 0; border-radius: 4px; font-size: 12px; cursor: pointer;
    opacity: 0; transform: translateY(4px); transition: all 0.15s; }
.cv-vp-item:hover .cv-vp-pick { opacity: 1; transform: translateY(0); }
.cv-vp-pick:hover { background: #2333ed; }
.cv-vp-del { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px;
    background: rgba(0, 0, 0, 0.5); color: #fff; border: 0; border-radius: 50%; cursor: pointer;
    font-size: 13px; line-height: 22px; padding: 0; opacity: 0; transition: all 0.15s; }
.cv-vp-item:hover .cv-vp-del { opacity: 1; }
.cv-vp-del:hover { background: #e53935; }
.cv-vportrait-form { padding: 14px 18px; border-left: 1px solid #ececec; background: #fafbff; overflow-y: auto; }
.cv-vportrait-form h4 { margin: 0 0 12px; font-size: 13px; color: #1a1a1a; font-weight: 600; }
.cv-vportrait-form label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; margin-top: 10px; }
.cv-vportrait-form label:first-of-type { margin-top: 0; }
.cv-vp-req { color: #e53935; margin-left: 2px; }
.cv-vportrait-form input[type="text"] { width: 100%; padding: 7px 10px;
    border: 1px solid #d8dbe5; border-radius: 3px; font-size: 13px; background: #fff; color: #1a1a1a;
    box-sizing: border-box; transition: border-color 0.15s; }
.cv-vportrait-form input[type="text"]:focus { outline: none; border-color: #3444fe; }
.cv-vp-row { display: flex; gap: 8px; }
.cv-vp-row input[type="text"] { flex: 1 1 auto; }
.cv-vp-form-err { margin-top: 10px; padding: 6px 10px; background: #fdecea;
    border: 1px solid #f5c6c2; color: #c0392b; border-radius: 3px; font-size: 12px; }
.cv-vp-save { width: 100%; margin-top: 14px; padding: 9px 0; background: #3444fe; color: #fff;
    border: 0; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.cv-vp-save:hover { background: #2333ed; }
@media (max-width: 720px) {
    .cv-vportrait-body { grid-template-columns: 1fr; }
    .cv-vportrait-form { border-left: 0; border-top: 1px solid #ececec; }
}

/* history_panel_unified.css 已通过 HTML <link> 独立加载，不再 @import 串行阻塞 */

/* ========== 预览区：视频为主、文本为辅 ========== */
.preview-content:has(.sd-preview-frame) {
    border: none;
    background: #0c0c10;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    min-height: 0;
}

.sd-preview-frame {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.sd-preview-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: radial-gradient(ellipse at center, #1a1a22 0%, #0c0c10 70%);
}

.sd-preview-video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    background: #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.sd-preview-meta {
    flex: 0 0 auto;
    padding: 8px 14px 10px;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sd-preview-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 22px;
}

.sd-preview-meta-spacer {
    flex: 1 1 auto;
}

.sd-preview-badge {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #3444fe, #6a78ff);
    color: #fff;
    border-radius: 10px;
    white-space: nowrap;
}

.sd-preview-params {
    font-size: 11px;
    color: #3444fe;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(100%, 420px);
}

.sd-preview-prompt {
    margin: 4px 0 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: #666;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sd-preview-copy {
    flex: 0 0 auto;
    padding: 3px 8px;
    font-size: 11px;
    background: #f5f6fa;
    border: 1px solid #e0e3eb;
    border-radius: 5px;
    cursor: pointer;
    color: #3444fe;
    transition: background 0.15s;
}

.sd-preview-copy:hover {
    background: #eef0ff;
}

.sd-empty-preview {
    padding: 24px;
}

.sd-empty-preview .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.sd-empty-preview p {
    font-size: 13px;
    color: #999;
}

/* 生成历史面板 — 对齐 AI 图像编辑页（尺寸由 unified css 定义） */