﻿/* 移除 Google Fonts 外部引用以符�?CSP 策略 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background-color: #faf9f5; /* 极淡灰白背景 */
    color: #2d3748;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1280px; /* 缩小最大宽度，留出更多空白 */
    margin: 0 auto;
    padding: 0 40px; /* 增加两侧内边�?*/
}

/* 顶部导航（与主页 index 一致） */
.topnav {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    max-width: 1280px; margin: 0 auto; padding: 14px 0 0; flex-wrap: wrap;
}
.topnav .brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.topnav .brand .logo { width: 30px; height: 30px; border-radius: 9px; flex: none; display: block; }
.topnav .brand-name { background: linear-gradient(105deg,#4285F4 0%,#9B72CB 36%,#EA4986 68%,#FF8A3D 100%); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.topnav .brand-sep { width: 1px; height: 18px; background: #e2e8f0; margin: 0 2px; }
.topnav .brand-tool { font-weight: 650; font-size: 14.5px; color: #2d3748; }
.topnav .nav-back {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px;
    border: 1px solid #e2e8f0; background: #ffffff; font-size: 12.5px;
    color: #718096; text-decoration: none; transition: .12s;
}
.topnav .nav-back:hover { border-color: #cbd5e0; color: #2d3748; }
.topnav .nav-back svg { width: 14px; height: 14px; }

/* 顶部标题 */
.header-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
}

/* 主布局：左右分�?*/
.main-content {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 35px;
    margin-bottom: 40px;
    align-items: start;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.right-panel {
    min-width: 0;
}

/* 卡片通用样式 */
.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.card h3 {
    font-size: 0.95rem; /* 稍微调小标题字体 */
    font-weight: 700;
    color: #2d3748;
    padding: 12px 20px; /* 减小内边距 */
    margin: 0;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
}

.card-body {
    padding: 14px 20px;
}

/* 图标盒子 */
.icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 徽章 */
.badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #edf2f7;
    color: #718096;
    margin-left: auto;
    font-weight: 500;
}
.badge-blue { background: #ebf8ff; color: #4299e1; }

/* 表单元素 */
.input-group { margin-bottom: 16px; }
.input-group:last-child { margin-bottom: 0; }

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea,
.input-group select,
#customImageModelInput,
#customVideoModelInput,
#imageUrls,
#customOptimizerModelInput,
#customNInput {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 13px; /* 统一小字�?*/
    color: #2d3748;
    transition: all 0.2s;
    background: #f7fafc;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus,
#customImageModelInput:focus,
#customVideoModelInput:focus,
#imageUrls:focus,
#customOptimizerModelInput:focus,
#customNInput:focus {
    background: #fff;
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
    outline: none;
}

/* 移除所有隐藏 radio 按钮的焦点轮廓 */
input[type="radio"] {
    outline: none !important;
}

input[type="radio"]:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 单独针对创意描述文本域优�?*/
#prompt {
    font-size: 13.5px !important;
    line-height: 1.7;
    padding: 12px 14px !important;
    min-height: 160px;
    max-height: 450px;
    transition: height 0.2s ease;
}

.input-group textarea { resize: vertical; min-height: 100px; font-family: inherit; }

/* ========== API配置输入容器样式 ========== */
.api-input-container {
    position: relative;
    transition: all 0.3s ease;
    padding: 12px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.api-input-container.empty {
    border: 2px solid #fc8181 !important;
    background: linear-gradient(135deg, rgba(252, 129, 129, 0.05), rgba(245, 101, 101, 0.08)) !important;
    animation: apiPulse 2s ease-in-out infinite;
}

@keyframes apiPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(252, 129, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(252, 129, 129, 0);
    }
}

.api-input-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.api-input-header label {
    margin: 0;
    font-weight: 600;
    color: #4a5568;
}

.api-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.api-status-badge::before {
    content: '✓ 已配置';
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.api-input-container.empty .api-status-badge::before {
    content: '⚠️ 必填';
    color: #f56565;
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========== 提示词输入区域样�?========== */
.prompt-input-container {
    padding: 15px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

/* 空提示词时的红色警告效果 */
.prompt-input-container.empty {
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

.prompt-header {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* 已填写状�?- 绿色 */
.prompt-input-container:not(.empty) .prompt-header {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border-left: 3px solid #38b2ac;
}

/* 空状�?- 红色脉冲 */
.prompt-input-container.empty .prompt-header {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-left: 3px solid #f56565;
    animation: promptPulse 2s ease-in-out infinite;
}

@keyframes promptPulse {
    0%, 100% {
        background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.4);
    }
    50% {
        background: linear-gradient(135deg, #ffe5e5 0%, #ffd5d5 100%);
        box-shadow: 0 0 0 8px rgba(245, 101, 101, 0);
    }
}

.prompt-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 8px;
    transition: all 0.3s ease;
}

/* 已填写徽�?- 绿色 */
.prompt-input-container:not(.empty) .prompt-status-badge {
    background: #38b2ac;
    color: white;
}

/* 空徽�?- 红色跳动 */
.prompt-input-container.empty .prompt-status-badge {
    background: #f56565;
    color: white;
    animation: badgePulse 1.5s ease-in-out infinite;
}

/* 更新徽章文字 */
.prompt-input-container:not(.empty) .prompt-status-badge::before {
    content: '�?已填�?;
}

.prompt-input-container.empty .prompt-status-badge::before {
    content: '⚠️ 必填';
}

.prompt-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
    margin: 6px 0 3px 0;
    display: inline-block;
}

.prompt-hint {
    font-size: 0.8rem;
    color: #718096;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

.highlight-group textarea {
    border-color: #e2e8f0;
    background: #fff;
    font-size: 1rem;
    border: 2px solid #cbd5e0;
    transition: all 0.2s;
}

.highlight-group textarea:focus {
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

/* 空状态时的textarea边框 */
.prompt-input-container.empty textarea {
    border-color: #fc8181;
}

.prompt-input-container.empty textarea:focus {
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.15);
}

/* 模型选择 */
.model-selection-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* 自适应高度的多选框 */
#imageModels {
    min-height: 130px;
    max-height: 190px;
    height: auto;
    background: #fff;
    padding: 8px;
    line-height: 1.5;
}
#videoModels {
    min-height: 130px;
    max-height: 240px;
    height: auto;
    background: #fff;
    padding: 8px;
    line-height: 1.5;
}

/* 优化选项样式 */
#imageModels option,
#videoModels option {
    padding: 4px 6px;
    color: #2d3748;
}

/* 选中状态的样式 */
#imageModels option:checked,
#videoModels option:checked {
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    color: white;
    font-weight: 600;
}

/* 悬停状�?- 未选中�?*/
#imageModels option:hover:not(:checked),
#videoModels option:hover:not(:checked) {
    background: #f7f9fc;
    color: #2d3748;
}

/* 悬停状�?- 已选中时（保持选中样式，稍微加深） */
#imageModels option:checked:hover,
#videoModels option:checked:hover {
    background: linear-gradient(135deg, #c0613f 0%, #a84f36 100%);
    color: white;
    font-weight: 600;
}

.model-column {
    display: flex;
    flex-direction: column;
}
.model-column label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

/* ========== 选择器标题样�?========== */
.selector-header {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-left: 3px solid #f56565;
    border-radius: 6px;
    animation: headerPulse 2s ease-in-out infinite;
}

.selector-header .required-badge {
    display: inline-block;
    background: #f56565;
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 6px;
    animation: badgePulse 1.5s ease-in-out infinite;
}

.selector-header .selector-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d3748;
    margin: 6px 0 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selector-header .selector-hint {
    font-size: 0.8rem;
    color: #718096;
    margin: 0;
    line-height: 1.3;
}

/* 脉冲动画 */
@keyframes headerPulse {
    0%, 100% {
        background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.4);
    }
    50% {
        background: linear-gradient(135deg, #ffe5e5 0%, #ffd5d5 100%);
        box-shadow: 0 0 0 8px rgba(245, 101, 101, 0);
    }
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 选中后停止动�?*/
.model-type-selector:has(input[type="radio"]:checked) .selector-header,
.video-platform-selector:has(input[type="radio"]:checked) .selector-header {
    animation: none;
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border-left-color: #38b2ac;
}

.model-type-selector:has(input[type="radio"]:checked) .required-badge,
.video-platform-selector:has(input[type="radio"]:checked) .required-badge {
    animation: none;
    background: #38b2ac;
}

/* ========== 选项卡片增强 ========== */
.selector-options {
    display: flex;
    gap: 12px;
}

/* 模型类型选择器样�?- 增强版（缩小版） */
.model-type-selector {
    margin-bottom: 18px;
    padding: 12px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

/* 未选择时的提示效果 */
.model-type-selector:not(:has(input[type="radio"]:checked)) {
    border-color: #f56565;
    box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.1);
}

.model-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
}

.model-type-option:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.model-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    outline: none;
}

/* 选项内容布局 */
.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.option-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.option-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d3748;
}

.option-desc {
    font-size: 0.75rem;
    color: #718096;
}

/* 选中状�?*/
.model-type-option:has(input[type="radio"]:checked) {
    border-color: #d97757;
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.08) 0%, rgba(192, 97, 63, 0.08) 100%);
    box-shadow: 0 0 0 4px rgba(217, 119, 87, 0.15);
    transform: scale(1.02);
}

.model-type-option:has(input[type="radio"]:checked) .option-title {
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.model-type-option:has(input[type="radio"]:checked) .option-icon {
    transform: scale(1.1);
}

/* 保持旧的type-label样式以防万一 */
.type-label {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.3s ease;
}



/* 视频平台选择器样�?- 增强版（缩小版） */
.video-platform-selector {
    margin-bottom: 15px;
    padding: 12px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

/* 未选择时的提示效果 */
.video-platform-selector:not(:has(input[type="radio"]:checked)) {
    border-color: #f56565;
    box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.1);
}

.video-platform-selector .selector-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.platform-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    position: relative;
    min-height: 45px;
}

.platform-option:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.platform-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    outline: none;
}

.platform-option:has(input[type="radio"]:checked) {
    border-color: #d97757;
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.12) 0%, rgba(192, 97, 63, 0.12) 100%);
    color: #d97757;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.2);
    transform: scale(1.05);
}

/* 平台模型列表样式 */
.platform-models {
    margin-bottom: 15px;
}

.platform-models select {
    width: 100%;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    line-height: 1.5;
}

.platform-models select option {
    padding: 6px;
    color: #2d3748;
    background: #fff;
}

.platform-models select option:checked {
    background: #e8ebfd;
    color: #4553c0;
    font-weight: 600;
}

.platform-models select option:hover {
    background: #f0f2ff;
    color: #2d3748;
}

/* 多模态输入区�?select 专属样式 */
#doubaoImageScene {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid #dde4f8;
    border-radius: 7px;
    font-size: 0.8rem;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

#doubaoImageScene:focus {
    border-color: #d97757;
    box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.15);
}

/* 通用 select option 颜色修复（防止展开时白字问题） */
select option {
    color: #2d3748;
    background: #fff;
}

select option:checked,
select option:hover {
    color: #2d3748;
    background: #e8ebfd;
}

/* Veo 模型选择器的单选按钮样�?*/
.radio-button {
    position: relative;
    display: block;
}

.radio-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-button:has(input[type="radio"]:checked) {
    border-color: #d97757 !important;
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.12) 0%, rgba(192, 97, 63, 0.12) 100%) !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.2) !important;
    transform: scale(1.02);
}

.radio-button:has(input[type="radio"]:checked) > div {
    color: #d97757;
    font-weight: 700;
}

/* Sora2 Pro 专属分辨率按�?- 金色选中状态覆�?*/
.sora2-pro-size:has(input[type="radio"]:checked) {
    border-color: #d4a017 !important;
    background: linear-gradient(135deg, rgba(212, 160, 23, 0.15) 0%, rgba(184, 134, 11, 0.15) 100%) !important;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.25) !important;
}

.sora2-pro-size:has(input[type="radio"]:checked) > div {
    color: #b8860b !important;
    font-weight: 700;
}

/* 响应式调�?*/
@media (max-width: 768px) {
    .video-platform-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 参数网格 */
.param-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* 上传区域 */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.file-upload { position: relative; width: 100%; }

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.2s;
    color: #718096;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
}

.file-upload-label:hover {
    border-color: #d97757;
    background: #ebf4ff;
    color: #c0613f;
}

.upload-icon { font-size: 1.5rem; margin-bottom: 4px; display: block; }

.file-upload input[type="file"] { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    opacity: 0; cursor: pointer; 
}

.url-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.url-input-wrapper textarea {
    min-height: 40px;
    height: 40px;
    padding: 8px 12px;
}
.btn-url-load {
    width: 100%;
    padding: 6px;
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    color: #4a5568;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-url-load.active {
    background: #d97757;
    color: white;
}

/* 图片预览 */
.image-preview-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.image-preview-container > div {
    position: relative;
    width: 60px;
    height: 60px;
}
.mj-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.delete-image-btn {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #e53e3e; color: white;
    border: 2px solid white;
    font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* 操作�?*/
.action-bar {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px -10px rgba(217, 119, 87, 0.5);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(217, 119, 87, 0.6);
}
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.mode-badge {
    text-align: center;
    font-size: 0.85rem;
    color: #718096;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 右侧结果区域 */
.result-body {
    display: flex;
    flex-direction: column;
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 自适应填充，避免留�?*/
    gap: 20px;
}

/* gallery-grid 有内容时才占据空�?*/
.gallery-grid:not(:empty) {
    min-height: 200px;
}

/* 空状态样�?*/
.empty-state {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #cbd5e0;
    pointer-events: none; /* 让点击穿�?*/
}
.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    opacity: 0.5;
}
.empty-state p { font-size: 1.1rem; font-weight: 500; }

.generated-image {
    width: 100%;
    height: 100%; /* 撑满容器 */
    object-fit: cover; /* 保持比例裁剪填充 */
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: block;
}
.generated-image:hover { transform: scale(1.02); }

/* 结果中的分组容器 */
.result-prompt-info {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 15px;
    border: 1px solid #edf2f7;
    word-break: break-all;
}

.btn-result-action {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.btn-result-action:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* 日志区域优化 */
.log-section {
    margin-top: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    background: #edf2f7;
    border-bottom: 1px solid #e2e8f0;
}

.log-panel {
    background: #ffffff;
    color: #4a5568;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    height: 300px; /* 初始高度，JS _autoResize() 会动态调�?*/
    overflow: hidden; /* 面板本身不滚动，让内�?scrollable-area 独立滚动 */
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
    resize: vertical; /* 保留用户手动拖拽功能 */
    min-height: 200px;
    display: flex;
    flex-direction: column;
    transition: height 0.2s ease;
}

/* 日志面板：固定置顶区（POST 请求体） */
.log-pinned-area {
    flex-shrink: 0;
    background: linear-gradient(135deg, #fffaf0, #fff8e6);
    border: 2px solid #ed8936;
    border-radius: 8px;
    margin: 12px 16px 0 16px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(237, 137, 54, 0.15);
}

.log-pinned-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c05621;
    background: rgba(237, 137, 54, 0.12);
    padding: 6px 12px;
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid rgba(237, 137, 54, 0.2);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.log-pinned-clear-btn {
    background: none;
    border: none;
    color: #c05621;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.log-pinned-clear-btn:hover {
    opacity: 1;
}

.log-pinned-area .log-request-block {
    margin: 0;
    border-left: none;
    border-radius: 0 0 6px 6px;
    background: transparent;
}

/* 日志面板：滚动区（GET 等轮询日志） */
.log-scrollable-area {
    flex: 1;
    padding: 12px 16px 16px 16px;
    overflow-y: auto;
    min-height: 0;
}

/* POSTMAN风格日志样式 */
.log-request-block {
    margin: 12px 0;
    padding: 12px;
    background: #f7fafc;
    border-left: 4px solid #4299e1;
    border-radius: 4px;
}

.log-request-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.log-method {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-method-get {
    background: #48bb78;
    color: white;
}

.log-method-post {
    background: #ed8936;
    color: white;
}

.log-method-put {
    background: #4299e1;
    color: white;
}

.log-method-delete {
    background: #f56565;
    color: white;
}

.log-url {
    color: #2d3748;
    font-size: 0.85rem;
    word-break: break-all;
}

.log-request-data {
    margin-top: 8px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.log-header-item {
    color: #718096;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.log-body-title {
    color: #4a5568;
    font-weight: 600;
    font-size: 0.8rem;
    margin: 8px 0 4px 0;
}

.log-body-content {
    padding: 8px;
    background: #f8fafc;
    border-radius: 4px;
}

.log-param-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
}

.log-param-key {
    color: #2d3748;
    font-weight: 600;
    min-width: 120px;
}

.log-param-type {
    color: #805ad5;
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #faf5ff;
    border-radius: 3px;
}

.log-param-value {
    color: #4a5568;
    word-break: break-all;
}

.log-response-block {
    margin: 12px 0;
    padding: 12px;
    background: #f7fafc;
    border-left: 4px solid #48bb78;
    border-radius: 4px;
}

.log-response-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.log-response-label {
    color: #4a5568;
    font-size: 0.85rem;
}

.log-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.log-status-success {
    background: #c6f6d5;
    color: #22543d;
}

.log-status-error {
    background: #fed7d7;
    color: #742a2a;
}

.log-status-info {
    background: #bee3f8;
    color: #2c5282;
}

.log-response-data {
    margin-top: 8px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #2d3748;
    max-height: 400px;
    overflow-y: auto;
}

/* 普通日志样�?*/
.log-line {
    margin: 8px 0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.log-data {
    margin: 4px 0 8px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #2d3748;
    max-height: 300px;
    overflow-y: auto;
}

.log-info {
    background: #ebf8ff;
    color: #2c5282;
}

.log-warn {
    background: #fefcbf;
    color: #744210;
}

.log-error {
    background: #fed7d7;
    color: #742a2a;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.btn-icon:hover { background: #e2e8f0; }

/* 历史记录全宽卡片 */
.history-card { margin-top: 0; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f7fafc;
}
.card-header h3 { border: none; padding: 0; }

.history-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 强制每行4�?*/
    gap: 15px;
    padding: 20px;
}

@media (max-width: 1100px) {
    .history-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .history-grid { grid-template-columns: repeat(2, 1fr); }
}

.history-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}
.history-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}
.history-item.selected {
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.3);
}

.history-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.history-prompt {
    padding: 8px 10px;
    font-size: 12px; /* 更小的字�?*/
    color: #4a5568;
    line-height: 1.4;
}
.history-prompt strong {
    font-size: 12px; /* 标题也变�?*/
}
.history-time {
    padding: 0 10px 8px;
    font-size: 11px; /* 更小的字�?*/
    color: #a0aec0;
}

.history-logs {
    padding: 0 10px 10px;
}

.history-logs summary {
    font-size: 11px;
    cursor: pointer;
    color: #718096;
    margin-bottom: 4px;
    outline: none;
    font-weight: 500;
}

.history-logs pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    font-size: 10px; /* 更小的字�?*/
    color: #4a5568;
    max-height: 120px; /* 固定高度 */
    overflow-y: auto; /* 支持滚动 */
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    margin: 0;
}

/* 自定义滚动条样式 */
.history-logs pre::-webkit-scrollbar {
    width: 4px;
}
.history-logs pre::-webkit-scrollbar-track {
    background: transparent;
}
.history-logs pre::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}
.history-logs pre::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.history-item-checkbox {
    position: absolute;
    top: 8px; left: 8px;
    transform: scale(1.1);
    z-index: 10;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 15px;
    border-top: 1px solid #f0f0f0;
}
.page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4a5568;
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}
.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.page-info {
    font-size: 0.85rem;
    color: #718096;
}

.btn-outline {
    padding: 6px 16px;
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: #a0aec0;
    background: #f7fafc;
}
.btn-outline.danger { color: #e53e3e; border-color: #feb2b2; }
.btn-outline.danger:hover { background: #fff5f5; border-color: #fc8181; }

/* Loading */
.loading { display: none; padding: 40px; text-align: center; color: #718096; }
.loading.show { display: block; }
.spinner {
    border: 3px solid #edf2f7;
    border-top: 3px solid #d97757;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 公告弹窗样式 (还原备份版并优化) */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.8); /* 增加透明�?*/
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1); /* 柔和阴影 */
    padding: 20px 25px;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-radius: 16px;
    max-width: 380px; /* 恢复原有宽度 */
    font-size: 14px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

.toast-content p { margin: 0; }
.toast-content strong { color: #434190; }
.toast-content a { color: #d97757; text-decoration: none; font-weight: 600;}
.toast-content a:hover { text-decoration: underline; }

.toast-header { font-size: 1.1em; font-weight: 600; color: #333; margin-bottom: 15px; border-bottom: none; padding-bottom: 0; display: block; }
.toast-section { margin-bottom: 12px; }
.toast-section > strong { display: block; margin-bottom: 8px; font-size: 1em; color: #434190; }
.toast-section ul { list-style: none; padding: 5px 0 0 5px; margin: 0; }
.toast-section code {
    background: linear-gradient(135deg, #d97757, #c0613f);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
    margin: 4px 2px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.toast-section code:hover {
    transform: scale(1.1) rotate(-2deg);
}

.toast-tips {
    background: rgba(217, 119, 87, 0.1); padding: 8px 12px; border-radius: 8px; font-size: 0.9em; margin-top: 10px; border-left: none; color: inherit;
}
.toast-tips strong { color: #d97757; }

.toast button {
    background: rgba(0,0,0,0.05);
    border: none;
    cursor: pointer;
    color: #888;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    flex-shrink: 0;
    transition: background-color 0.3s, color 0.3s;
    position: static; /* 恢复静态定�?*/
}

.toast button:hover {
    background-color: rgba(0,0,0,0.1);
    color: #333;
}

/* 新模型公告的特殊样式 */
.toast-section .new-model {
    background: linear-gradient(135deg, #f97794 0%, #623aa2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(249, 119, 148, 0.4);
    transform: scale(1.05);
    transform-origin: left center;
    display: inline-block;
    transition: transform 0.3s ease;
    border: none; /* 移除边框 */
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 1em;
}

.toast-section .new-model:hover {
    transform: scale(1.2) rotate(-2deg);
}

.link-card {
    background: linear-gradient(to right, #faf9f5, #e9ecef);
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #2d3748;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.link-card:hover {
    background: #fff;
    border-color: #d97757;
    color: #d97757;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(217, 119, 87, 0.15);
}

.wechat-id {
    font-weight: 800;
    color: #2d3748;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0fff4;
    border: 1px dashed #9ae6b4;
    transition: all 0.2s;
    margin-left: 5px;
}
.wechat-id:hover {
    background: #c6f6d5;
    border-color: #48bb78;
}
.wechat-id:active {
    transform: scale(0.95);
}

/* 提示信息 */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10000; /* 提高到最高层级，确保显示在所有模态框上方 */
    display: none;
}
.toast-notification.show { display: block; animation: fadeInDown 0.3s; }
.toast-notification.success { background: #48bb78; }
.toast-notification.error { background: #f56565; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 响应�?*/
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .action-bar {
        position: static;
    }
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
}
.custom-checkbox input { margin: 0; }

/* ========== 视频任务UI样式 ========== */

/* 视频任务容器 */
.video-tasks-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.video-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.video-tasks-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    padding: 0;
    border: none;
}

.tasks-count {
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(217, 119, 87, 0.3);
}

/* 垂直滚动容器 */
.video-tasks-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 600px;
    padding: 5px;
    margin: 0;
}

.video-tasks-scroll::-webkit-scrollbar {
    width: 8px;
}

.video-tasks-scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.video-tasks-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.video-tasks-scroll::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 任务列表 - 网格布局，每�?�?*/
.video-tasks-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
}

/* 任务卡片 */
.video-task-card {
    width: 100%;
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.video-task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.video-task-card.selected {
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.2);
}

/* 任务复选框 */
.task-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #d97757;
}

/* 预览�?*/
.task-preview {
    width: 100%;
    height: 158px;
    background: #1a202c;
    position: relative;
    overflow: hidden;
}

.task-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 加载占位�?- 优化布局 */
.task-loading-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    color: white;
    position: relative;
    gap: 20px;
    padding: 20px;
}

.task-loading-placeholder p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                 0 0 20px rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                     0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                     0 0 30px rgba(255, 255, 255, 0.4);
    }
}

/* 加载动画 - 优化后更显眼 */
.loading-spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-right-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite, pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* 错误占位�?*/
.task-error-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #feb2b2;
    color: #742a2a;
    padding: 20px;
    text-align: center;
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.task-error-placeholder p {
    font-size: 0.85rem;
    margin: 0;
}

/* 提示词显示区�?*/
.task-prompt-display {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 15px;
    overflow-y: auto;
    font-size: 0.75rem;
    line-height: 1.5;
}

.task-prompt-display .prompt-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-prompt-display .prompt-section {
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.task-prompt-display .prompt-section strong {
    display: block;
    color: #4a5568;
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.task-prompt-display .prompt-section p {
    margin: 0;
    color: #2d3748;
    word-break: break-word;
    white-space: pre-wrap;
}

.task-prompt-display::-webkit-scrollbar {
    width: 4px;
}

.task-prompt-display::-webkit-scrollbar-track {
    background: transparent;
}

.task-prompt-display::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.task-prompt-display::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 进度覆盖�?*/
.task-progress-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* 播放按钮覆盖�?*/
.task-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.task-preview:hover .task-play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #d97757;
    transition: transform 0.2s;
}

.play-button:hover {
    transform: scale(1.1);
}

/* 进度�?- 优化后更显眼 */
.task-progress-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e0 100%);
    position: relative;
    overflow: hidden;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #10b981 100%);
    background-size: 200% 100%;
    transition: width 0.5s ease;
    position: relative;
    animation: progressGradient 2s ease infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 100%);
    border-radius: 4px 4px 0 0;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 任务信息 */
.task-info {
    padding: 12px 15px;
    background: white;
    flex-grow: 1;
}

.task-id {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-status {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.task-status.status-queued {
    color: #ed8936;
}

.task-status.status-in_progress {
    color: #4299e1;
}

.task-status.status-completed {
    color: #48bb78;
}

.task-status.status-failed {
    color: #f56565;
}

.task-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

/* 任务操作按钮 */
.task-actions {
    display: flex;
    gap: 8px;
    padding: 0 15px 12px;
    border-top: 1px solid #f7fafc;
    padding-top: 12px;
}

.btn-task-action {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-task-action:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.btn-task-action span {
    font-size: 1rem;
}

.btn-view-prompt:hover {
    border-color: #d97757;
    color: #d97757;
}

.btn-remove-display:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

/* ========== 视频成功弹窗样式 ========== */

.video-success-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    width: 420px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e8e8e8;
    z-index: 2000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    padding: 16px 20px;
}

.video-success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.video-success-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-success-toast .toast-icon {
    width: 24px;
    height: 24px;
    background: #52c41a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    font-weight: bold;
}

.video-success-toast .toast-text {
    flex: 1;
    line-height: 1.5;
}

.video-success-toast .toast-title {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin: 0;
}

.video-success-toast .toast-id {
    font-size: 13px;
    color: #666;
    margin: 2px 0 0 0;
    font-family: 'Monaco', 'Courier New', monospace;
    word-break: break-all;
}

.video-success-toast .toast-id span {
    color: #666;
    font-weight: normal;
}

.video-success-toast .toast-status {
    font-size: 13px;
    color: #666;
    margin: 2px 0 0 0;
}

.video-success-toast .toast-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.video-success-toast .toast-close:hover {
    color: #333;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .video-tasks-list {
        grid-template-columns: 1fr;
    }
    
    .video-success-toast {
        width: calc(100% - 40px);
        right: -100%;
    }
    
    .video-success-toast.show {
        right: 20px;
    }
}

/* ========== 视频帧提取模态框样式 ========== */

.video-frame-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.video-frame-container {
    width: 94%;
    max-width: 1200px;
    height: 85vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 标题�?*/
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.8);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .icon {
    font-size: 1.5rem;
}

.header-left h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #2d3748;
}

.header-left .subtitle {
    font-size: 0.8rem;
    color: #718096;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #4a5568;
}

/* 操作�?*/
.modal-toolbar {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.btn-toolbar {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-toolbar:hover {
    border-color: #cbd5e0;
    background: #f1f5f9;
}

.url-input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.duration-display {
    font-size: 0.8rem;
    color: #718096;
    margin-left: auto;
    white-space: nowrap;
}

.error-display {
    font-size: 0.85rem;
    color: #e53e3e;
}

/* 主内容区 */
.video-preview-section {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    overflow-y: auto;
    background: #f8fafc;
}

/* 预览面板 */
.preview-panel, .result-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-panel h4, .result-panel h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    object-fit: contain;
}

.frame-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-extract-frame {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-extract-frame:hover {
    border-color: #d97757;
    color: #d97757;
    background: #f0f4ff;
}

.grid-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #4a5568;
}

.grid-option {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.grid-option.active {
    background: #4a5568;
    color: white;
    border-color: #4a5568;
}

/* 结果面板 */
.frames-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.frame-result-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #fcfcfc;
}

.frame-label {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
}

.frame-preview-img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.frame-preview-empty {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    color: #a0aec0;
    font-size: 0.9rem;
}

.frame-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.btn-download {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    border-color: #48bb78;
    color: #48bb78;
}

/* 拼贴结果 */
.collage-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.collage-info {
    font-size: 0.85rem;
    color: #718096;
}

.collage-preview {
    flex: 1;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fcfcfc;
    overflow: hidden;
    position: relative;
    min-height: 300px;
}

.collage-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.collage-hint {
    position: absolute;
    color: #a0aec0;
    font-size: 0.9rem;
    pointer-events: none;
}

.collage-canvas + .collage-hint {
    display: none;
}

.btn-download-collage {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-download-collage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.3);
}

/* 响应�?*/
@media (max-width: 768px) {
    .video-preview-section {
        grid-template-columns: 1fr;
    }
    
    .frame-action-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .url-input {
        max-width: none;
    }
}

/* ========== 提示词库模态框样式 ========== */

.prompt-library-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.prompt-library-container {
    width: 96%;
    max-width: 1400px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 工具�?*/
.prompt-toolbar {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-bar {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    height: 40px;
    padding-left: 40px;
    padding-right: 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-bar input:focus {
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon-filter {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-filter:hover {
    background: #f1f5f9;
}

.dropdown-container {
    position: relative;
}

.btn-filter-dropdown {
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-filter-dropdown:hover {
    background: #f1f5f9;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 160px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 8px 0;
    z-index: 10;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f7fafc;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* 标签�?*/
.prompt-tabs {
    padding: 12px 24px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.prompt-filter-chip {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #718096;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-filter-chip:hover {
    background: #f7fafc;
}

.prompt-filter-chip.active {
    background: #d97757;
    color: white;
    border-color: #d97757;
}

.btn-add-prompt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #d97757;
    color: white;
    border: none;
    cursor: pointer;
    display: none; /* 暂时隐藏入口 */
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-left: auto;
    transition: transform 0.2s;
}

.btn-add-prompt:hover {
    transform: scale(1.1);
    background: #c0613f;
}

/* 内容�?*/
.prompt-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8fafc;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.prompt-loading, .prompt-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #a0aec0;
    font-size: 0.9rem;
    gap: 16px;
}

/* 提示词卡�?*/
.prompt-card-item {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
}

.prompt-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.prompt-card-preview {
    height: 160px;
    position: relative;
    background: #f1f5f9;
    overflow: hidden;
}

.prompt-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prompt-card-preview .no-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 0.8rem;
}

.prompt-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 1;
    pointer-events: none; /* 让点击事件穿透到图片 */
}

.prompt-card-title {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-card-tags {
    display: flex;
    gap: 6px;
}

.prompt-card-tags span {
    background: rgba(255,255,255,0.9);
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.prompt-card-tags span.mode {
    background: #48bb78;
    color: white;
}

.prompt-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: auto; /* 恢复收藏按钮的点击事�?*/
}

.prompt-card-item:hover .prompt-fav-btn,
.prompt-fav-btn.active {
    opacity: 1;
}

.prompt-fav-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

.prompt-fav-btn.active {
    color: #fbbf24;
}

.prompt-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-text {
    font-size: 0.8rem;
    color: #718096;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.author {
    font-size: 0.75rem;
    color: #a0aec0;
}

.prompt-copy-btn {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #718096;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-copy-btn:hover {
    background: #f7fafc;
    color: #4a5568;
    border-color: #cbd5e0;
}

/* 分页 */
.prompt-pagination {
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.btn-page {
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-page:not(:disabled):hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.page-info {
    font-size: 0.9rem;
    color: #718096;
}

/* 响应�?*/
@media (max-width: 768px) {
    .prompt-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-bar {
        max-width: none;
    }
    
    .filter-actions {
        justify-content: space-between;
    }
    
    .prompt-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ========== 图片分割模态框样式 ========== */

.image-slicer-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.image-slicer-container {
    width: 95%;
    max-width: 1400px;
    height: 85vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.slicer-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    padding: 24px;
    overflow-y: auto;
    background: #f8fafc;
}

.slicer-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.slicer-panel h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
}

.slicer-canvas-wrap {
    flex: 1;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: #fcfcfc;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.empty-state-text {
    color: #a0aec0;
    font-size: 0.9rem;
}

.slicer-image-box {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.slicer-image-box img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.lines-layer {
    position: absolute;
    inset: 0;
}

.slice-line {
    position: absolute;
    background: rgba(217, 119, 87, 0.8);
    z-index: 10;
}

.slice-line.h {
    left: 0;
    right: 0;
    height: 2px;
    cursor: ns-resize;
}

.slice-line.v {
    top: 0;
    bottom: 0;
    width: 2px;
    cursor: ew-resize;
}

.slice-line-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 20;
}

.slice-line.h .slice-line-handle {
    right: 0;
    top: -9px;
}

.slice-line.v .slice-line-handle {
    bottom: 0;
    left: -9px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 6px;
    border-left: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.toolbar-group .label {
    font-size: 0.75rem;
    color: #4a5568;
    white-space: nowrap;
}

.slicer-mode-btn {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 45px;
}

.slicer-mode-btn.active {
    background: #d97757;
    color: white;
    border-color: #d97757;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #4a5568;
    cursor: pointer;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.btn-danger {
    color: #e53e3e;
}

.btn-danger:hover {
    background: #fff5f5;
    border-color: #feb2b2;
}

.btn-primary {
    background: #d97757;
    color: white;
    border-color: #d97757;
}

.btn-primary:hover {
    background: #c0613f;
    border-color: #c0613f;
}

.divider {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    flex-shrink: 0;
    margin: 0 2px;
}

#slicerBgColor {
    width: 28px;
    height: 28px;
    padding: 2px;
    border-radius: 4px;
    cursor: pointer;
}

/* 图片分割工具栏特定按钮优�?*/
#slicerUploadBtn,
#slicerClearBtn,
#slicerGenerateBtn,
#slicerDownloadAllBtn {
    padding: 6px 8px;
    font-size: 0.75rem;
    min-width: auto;
}

#slicerGenerateBtn {
    max-width: 120px;
}

.slicer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.slicer-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.slicer-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f8fafc;
    display: block;
}

.slicer-item-info {
    padding: 10px;
    font-size: 0.8rem;
    color: #718096;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    white-space: nowrap;
}

.slicer-item-info span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.slicer-download-btn {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 2px;
    font-size: 1rem;
}

.slicer-download-btn:hover {
    color: #d97757;
}

.slicer-results-empty {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
    font-size: 0.9rem;
}

/* 响应�?*/
@media (max-width: 768px) {
    .slicer-content {
        grid-template-columns: 1fr;
    }
    
    .modal-toolbar {
        flex-wrap: wrap;
    }
    
    .toolbar-group {
        border: none;
        padding: 0;
    }
}

/* ========== 快捷时间线模态框样式 ========== */

.quick-timeline-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.quick-timeline-container {
    width: 96%;
    max-width: 1400px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1a1a; /* 深色背景更适合时间�?*/
}

.timeline-preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 200px;
    padding: 20px;
}

.timeline-preview {
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16/9;
}

.timeline-track-area {
    height: 240px;
    background: #262626;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.timeline-tracks {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px;
    display: flex;
    gap: 2px;
    align-items: center;
}

.timeline-clip {
    height: 120px;
    min-width: 160px;
    background: #333;
    border-radius: 8px;
    border: 2px solid #444;
    cursor: grab;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.timeline-clip:hover {
    border-color: #666;
}

.timeline-clip.active {
    border-color: #d97757;
    box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.3);
}

.timeline-clip.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.timeline-clip.drag-over {
    border-left: 4px solid #d97757;
}

.clip-thumb {
    flex: 1;
    background-size: cover;
    background-position: center;
    position: relative;
}

.clip-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
}

.clip-info {
    height: 32px;
    background: #1f1f1f;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #333;
}

.clip-name {
    color: #ccc;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.clip-remove-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
}

.clip-remove-btn:hover {
    color: #e53e3e;
}

.timeline-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    border: 2px dashed #444;
    border-radius: 12px;
}

.timeline-mode-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.timeline-mode-btn.active {
    background: #d97757;
    color: white;
    border-color: #d97757;
}

/* ========== API配置折叠样式 ========== */

/* API配置卡片 */
.api-config-card {
    margin-bottom: 0;
    transition: all 0.3s ease;
}

/* API配置标题栏（可点击） */
.api-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #f7fafc;
    transition: background 0.2s ease;
}

.api-config-header:hover {
    background: #f7fafc;
}

/* 标题左侧 */
.api-config-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-config-title h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
    padding: 0;
    border: none;
    background: transparent;
}

/* 状态徽�?*/
.api-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.api-status.configured {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.api-status.required {
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
    border: 1px solid rgba(245, 101, 101, 0.3);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 展开/收起图标 */
.api-toggle-icon {
    font-size: 1.2rem;
    color: #718096;
    transition: transform 0.3s ease;
}

.api-config-card.collapsed .api-toggle-icon {
    transform: rotate(-90deg);
}

/* API配置内容�?*/
.api-config-body {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.api-config-card.collapsed .api-config-body {
    max-height: 0;
    opacity: 0;
}

/* ========== 工具栏样�?========== */

/* 工具栏卡�?*/
.tools-card {
    margin-bottom: 0;
}

/* 工具网格布局 - 3�?�?*/
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* 工具按钮 - 扁长横向布局 */
.tool-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.tool-button:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tool-button:active {
    transform: translateY(0);
}

/* 工具图标 - 柔和彩色 */
.tool-icon {
    font-size: 1.25rem;
    filter: saturate(0.65) brightness(1.05);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tool-button:hover .tool-icon {
    filter: saturate(1) brightness(1);
    transform: scale(1.08);
}

/* 工具标签 */
.tool-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.tool-button:hover .tool-label {
    color: #2d3748;
}

/* 响应式：小屏幕改�?�?*/
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-button {
        padding: 9px 10px;
    }
    
    .tool-icon {
        font-size: 1.15rem;
    }
    
    .tool-label {
        font-size: 0.75rem;
    }
}

/* ========== 分镜设计模态框样式 ========== */

.storyboard-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.storyboard-container {
    width: 96%;
    max-width: 1400px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.storyboard-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    padding: 24px;
    overflow-y: auto;
    background: #f8fafc;
}

.storyboard-grid-panel {
    display: flex;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.storyboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    overflow-y: auto;
    padding-right: 8px;
}

.storyboard-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storyboard-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.storyboard-card .card-header .actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.storyboard-card .idx {
    font-size: 0.75rem;
    color: #a0aec0;
}

.image-area {
    height: 120px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    background: #fcfcfc;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.image-area:hover, .image-area.drag-over {
    border-color: #d97757;
    background: #f0f4ff;
}

.image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-area .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #a0aec0;
    font-size: 0.8rem;
}

.image-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-area:hover .image-actions {
    opacity: 1;
}

.btn-icon-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e2e8f0;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.btn-icon-circle:hover {
    color: #e53e3e;
    background: white;
}

.desc-input {
    width: 100%;
    height: 60px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    resize: none;
}

.meta-row {
    display: flex;
    gap: 8px;
}

.duration-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
}

.dialogue-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 100px;
    overflow-y: auto;
    padding: 4px 0;
    border-top: 1px dashed #e2e8f0;
}

.empty-dialogue {
    text-align: center;
    color: #a0aec0;
    font-size: 0.75rem;
    padding: 8px 0;
}

.dialogue-item {
    display: flex;
    gap: 4px;
    align-items: center;
}

.role-select {
    width: 70px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
}

.dialogue-text {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
}

.btn-add-dialogue {
    width: 100%;
    padding: 6px;
    border: 1px dashed #e2e8f0;
    background: white;
    color: #718096;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-add-dialogue:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.storyboard-roles-panel {
    width: 240px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.storyboard-roles-panel .panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.storyboard-roles-panel .panel-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #2d3748;
}

.roles-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-item {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #edf2f7;
}

.role-name-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: #4a5568;
}

.storyboard-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-card, .script-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-card {
    flex: 1;
}

.script-card {
    height: 300px;
}

.preview-card .card-header, .script-card .card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-card .card-header h4, .script-card .card-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #2d3748;
}

.preview-box {
    flex: 1;
    background: #f1f5f9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px;
}

.preview-box canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.preview-box .empty-text {
    position: absolute;
    color: #a0aec0;
    font-size: 0.9rem;
}

#storyboardScript {
    flex: 1;
    resize: none;
    border: none;
    padding: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #4a5568;
    background: #fff;
}

.glass-select-sm {
    height: 32px;
    padding: 0 24px 0 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 0.85rem;
    color: #4a5568;
    cursor: pointer;
}

.btn-sm {
    height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-sm:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-icon-sm {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #a0aec0;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm:hover {
    color: #e53e3e;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

/* ========== XHS 灵感实验室模态框样式 ========== */

.xhs-lab-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.xhs-lab-container {
    width: 96%;
    max-width: 1400px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.xhs-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.xhs-sidebar {
    width: 260px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.xhs-sidebar .sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #718096;
    border-bottom: 1px solid #e2e8f0;
}

.text-btn-danger {
    background: none;
    border: none;
    color: #e53e3e;
    font-size: 0.8rem;
    cursor: pointer;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.history-item .title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item .date {
    font-size: 0.75rem;
    color: #a0aec0;
}

.xhs-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    overflow-y: auto;
    background: #ffffff;
}

.xhs-results {
    width: 400px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.input-card, .preview-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.input-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-card .card-header, .preview-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding: 0;
    border: none;
}

.preview-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0;
}

#xhsTopicInput {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    resize: none;
    background: #f8fafc;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

.image-count-input {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #718096;
}

.image-count-input input {
    width: 40px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
}

.ref-images-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ref-image-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
}

.ref-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-image-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-preview {
    padding: 20px;
    min-height: 200px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4a5568;
    white-space: pre-wrap;
}

.content-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 12px;
}

.results-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.results-header .options {
    display: flex;
    gap: 8px;
    align-items: center;
}

.shot-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shot-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.shot-visual {
    height: 160px;
    background: #e2e8f0;
}

.shot-info {
    padding: 12px;
}

.shot-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.shot-desc {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 8px;
}

.shot-prompt {
    font-size: 0.75rem;
    color: #a0aec0;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.shot-actions {
    display: flex;
    gap: 8px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.btn-xs:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* ========== 图片预览模态框样式 ========== */

.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999; /* 最高层�?*/
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    cursor: zoom-out;
}

.image-preview-content {
    position: relative;
    width: 90vw;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 1;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.image-preview-wrapper {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    min-height: 300px;
    position: relative;
}

.image-preview-wrapper img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.image-preview-wrapper img.zoomed {
    cursor: grab;
    transform: scale(2);
}

.mj-preview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mj-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.image-preview-info {
    width: 100%;
    background: #1f1f1f;
    padding: 20px;
    border-top: 1px solid #333;
    animation: slideUp 0.3s ease;
}

.preview-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.image-preview-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #e2e8f0;
    font-weight: 700;
}

.btn-copy-preview {
    background: #d97757;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy-preview:hover {
    background: #c0613f;
}

.image-preview-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #a0aec0;
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    background: #2d3748;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

/* 自定�?Prompt 模态框样式 */
.add-prompt-modal {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.add-prompt-container {
    width: 600px;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
    border: 1px solid #333;
}

.add-prompt-header {
    padding: 16px 24px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-prompt-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-close-dark {
    background: transparent;
    border: none;
    color: #718096;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close-dark:hover {
    color: #e2e8f0;
}

.add-prompt-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dark-input, .dark-textarea, .dark-select {
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px 12px;
    color: #e2e8f0;
    font-size: 0.95rem;
    width: 100%;
}

.dark-input:focus, .dark-textarea:focus, .dark-select:focus {
    border-color: #d97757;
    outline: none;
}

.dark-textarea {
    min-height: 100px;
    resize: vertical;
}

.mode-toggle {
    flex-direction: row;
    background: #2d2d2d;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #444;
}

.radio-tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #718096;
}

.radio-tab:hover {
    color: #e2e8f0;
}

.radio-tab:has(input:checked) {
    background: #3d3d3d;
    color: #fff;
    font-weight: 600;
}

.radio-tab input {
    display: none;
}

.upload-area {
    height: 160px;
    border: 2px dashed #444;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #252525;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #d97757;
    background: #2a2a2a;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #718096;
}

.upload-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.btn-remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 12px;
}

.col-category {
    width: 40%;
}

.col-subcategory {
    width: 60%;
}

.add-prompt-footer {
    padding: 16px 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-dark-cancel {
    background: transparent;
    border: 1px solid #444;
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-dark-cancel:hover {
    border-color: #718096;
}

.btn-dark-save {
    background: #d97757;
    border: none;
    color: white;
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-dark-save:hover {
    background: #c0613f;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .image-preview-content img {
        max-height: 60vh;
    }
    
    .image-preview-info {
        max-width: 90vw;
        padding: 12px 16px;
    }
    
    .image-preview-close {
        top: 10px;
        right: 10px;
    }
}

/* ========== QuickTimeline 新增样式 ========== */

.timeline-scroll-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    background: #262626;
}

.timeline-ruler {
    height: 24px;
    background: #1f1f1f;
    border-bottom: 1px solid #333;
    position: relative;
    width: fit-content;
    min-width: 100%;
}

.ruler-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid #444;
    font-size: 10px;
    color: #888;
    padding-left: 2px;
    pointer-events: none;
}

.timeline-tracks {
    position: relative;
    height: 140px;
    display: flex;
    align-items: center;
    padding: 10px 0;
    width: fit-content;
    min-width: 100%;
}

.timeline-clip-item {
    height: 100px;
    background: #333;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #444;
    position: relative;
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
}

.timeline-clip-item.active {
    border: 2px solid #d97757;
    z-index: 10;
}

.timeline-clip-item.drag-over {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(217, 119, 87, 0.5);
    z-index: 20;
}

.clip-inner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.clip-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: #eee;
    font-size: 10px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-dur {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 2px;
}

.clip-del-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.timeline-clip-item:hover .clip-del-btn {
    display: flex;
}

.timeline-clip-item:hover .clip-del-btn:hover {
    background: #e53e3e;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e53e3e;
    z-index: 30;
    pointer-events: none;
}

.timeline-playhead::after {
    content: '';
    position: absolute;
    top: 0;
    left: -5px;
    width: 12px;
    height: 12px;
    background: #e53e3e;
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.timeline-add-block {
    height: 100px;
    background: #2a2a2a;
    border: 1px dashed #444;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.2s;
}

.timeline-add-block:hover {
    background: #333;
    color: #888;
}

.preview-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.timeline-preview-area:hover .preview-controls-overlay {
    opacity: 1;
}

.control-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.1s;
}

.control-btn:hover {
    transform: scale(1.1);
}

.play-btn {
    font-size: 20px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d97757;
    cursor: pointer;
}

.time-display {
    font-size: 12px;
    font-family: monospace;
    min-width: 80px;
    text-align: right;
}

/* ========== XhsLab 新增样式 ========== */

.xhs-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
}

.provider-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.xhs-provider-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.xhs-provider-btn.active {
    background: white;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.input-area-wrapper {
    position: relative;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

#xhsTopicInput {
    border: none;
    background: transparent;
}

.input-area-wrapper:focus-within {
    border-color: #d97757;
    background: white;
}

.shot-card {
    transition: transform 0.2s;
}

.shot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.shot-visual {
    position: relative;
}

/* ========== QuickTimeline 2.0 (Clean Light Theme) ========== */

.quick-timeline-container {
    background: #ffffff !important;
    color: #2d3748;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.quick-timeline-container .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.quick-timeline-container .modal-header h3 {
    color: #2d3748 !important;
}
.quick-timeline-container .modal-header .subtitle {
    color: #718096 !important;
}
.quick-timeline-container .btn-close {
    color: #a0aec0 !important;
}
.quick-timeline-container .btn-close:hover {
    color: #4a5568 !important;
}

/* 紧凑工具�?- 浅色 */
.compact-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.compact-toolbar .btn-toolbar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #4a5568 !important;
    padding: 0 12px;
    height: 32px;
    font-size: 13px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.compact-toolbar .btn-toolbar:hover {
    background: #edf2f7 !important;
    color: #2d3748 !important;
    border-color: #cbd5e0 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.compact-toolbar .btn-danger {
    color: #e53e3e !important;
    border-color: #feb2b2 !important;
}
.compact-toolbar .btn-danger:hover {
    background: #fff5f5 !important;
    border-color: #fc8181 !important;
}

#timelineMergeBtn {
    max-width: 120px;
}

.compact-toolbar .btn-primary {
    background: linear-gradient(135deg, #d97757 0%, #c0613f 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(217, 119, 87, 0.3);
}
.compact-toolbar .btn-primary:hover {
    background: linear-gradient(135deg, #c0613f 0%, #a84f36 100%) !important;
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.4);
}

.compact-toolbar .label {
    color: #718096 !important;
    font-size: 13px;
    font-weight: 600;
    margin-right: 4px;
}

.compact-toolbar .divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 4px;
    flex-shrink: 0;
}

.compact-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.compact-toolbar .flex-1 {
    flex: 1;
    min-width: 20px;
}

/* 缩放滑块 - 浅色适配 */
.zoom-slider {
    width: 100px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}
.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d97757;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.2);
    transition: all 0.2s;
}
.zoom-slider::-webkit-slider-thumb:hover {
    background: #c0613f;
    transform: scale(1.1);
}

/* 轨道区域布局 - 浅色 */
.timeline-track-area {
    background: #edf2f7 !important;
    border-top: 1px solid #e2e8f0 !important;
    height: 280px !important;
    display: flex;
    flex-direction: row;
}

/* 左侧轨道�?- 白色 */
.timeline-headers {
    width: 60px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding-top: 32px;
    z-index: 20;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.02);
}

.track-header-item {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
    color: #a0aec0;
}

.track-header-item .icon {
    font-size: 1.2rem;
    color: #718096;
}

/* 右侧滚动�?*/
.timeline-scroll-container {
    flex: 1;
    background: #edf2f7 !important;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

/* 标尺 - 浅色 */
.timeline-ruler {
    height: 32px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    position: relative;
    cursor: ew-resize;
}

/* 主刻�?- 显示文字 */
.ruler-mark-major {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 2px solid #718096 !important;
    color: #718096 !important;
    font-family: -apple-system, monospace;
    font-size: 11px;
    font-weight: 600;
    padding-left: 4px;
    line-height: 32px;
    pointer-events: none;
}

/* 次刻�?- 只显示线 */
.ruler-mark-minor {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid #e2e8f0 !important;
    pointer-events: none;
}

/* 兼容旧的ruler-mark�?*/
.ruler-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid #cbd5e0 !important;
    color: #718096 !important;
    font-family: -apple-system, monospace;
    font-size: 11px;
    font-weight: 500;
    padding-left: 4px;
    line-height: 32px;
    pointer-events: none;
}

/* 网格背景 - 仅显示秒网格 */
.timeline-grid-bg {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image: linear-gradient(
        to right,
        rgba(160, 174, 192, 0.3) 1px,
        transparent 1px
    );
    background-size: 24px 100%; /* 默认值，JS会动态更新 */
}

/* 三行布局容器 */
.assets-upload-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* 每一行 */
.asset-upload-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: grid;
    grid-template-columns: 100px 2fr 140px;
    grid-template-rows: auto auto;
    gap: 10px;
    align-items: center;
}

.asset-upload-row:hover {
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e0;
}

/* 左侧：标题和计数 */
.asset-row-left {
    grid-column: 1;
    grid-row: 1;
}

/* 中间：URL 输入 */
.asset-row-center {
    grid-column: 2;
    grid-row: 1;
}

/* 右侧：上传区域 */
.asset-row-right {
    grid-column: 3;
    grid-row: 1;
    position: relative;
}

/* 底部：素材列表（横跨所有列） */
.asset-row-bottom {
    grid-column: 1 / -1;
    grid-row: 2;
}

@media (max-width: 1024px) {
    .asset-upload-row {
        grid-template-columns: 120px 1fr 160px;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .asset-upload-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 12px;
    }
    
    .asset-row-left {
        grid-column: 1;
        grid-row: 1;
    }
    
    .asset-row-center {
        grid-column: 1;
        grid-row: 2;
    }
    
    .asset-row-right {
        grid-column: 1;
        grid-row: 3;
    }
    
    .asset-row-bottom {
        grid-column: 1;
        grid-row: 4;
    }
}

.asset-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: -0.01em;
}

.asset-count {
    background: linear-gradient(135deg, #e8f3ff 0%, #f0f4ff 100%);
    color: #cf6c4d;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e0ebff;
}

.url-input-compact {
    display: flex;
    gap: 8px;
}

.url-input-compact input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8125rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    min-width: 0;
    transition: all 0.2s ease;
    background: #fafbff;
}

.url-input-compact input:focus {
    outline: none;
    border-color: #d97757;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

.url-input-compact input::placeholder {
    color: #a0aec0;
}

.url-input-compact button {
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: linear-gradient(135deg, #d97757 0%, #cf6c4d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(217, 119, 87, 0.2);
}

.url-input-compact button:hover {
    background: linear-gradient(135deg, #cf6c4d 0%, #a84f36 100%);
    box-shadow: 0 4px 8px rgba(217, 119, 87, 0.3);
    transform: translateY(-1px);
}

.url-input-compact button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(217, 119, 87, 0.2);
}

.upload-zone-compact {
    background: linear-gradient(135deg, #fafbff 0%, #f7f9ff 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.7rem;
    color: #718096;
    user-select: none;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.upload-zone-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.05) 0%, rgba(217, 119, 87, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.upload-zone-compact:hover::before {
    opacity: 1;
}

.upload-zone-compact:hover,
.upload-zone-compact.dragover {
    border-color: #d97757;
    background: linear-gradient(135deg, #f7f9ff 0%, #eef2ff 100%);
    color: #cf6c4d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.12);
}

.upload-zone-compact.dragover {
    border-style: solid;
    border-width: 2px;
    box-shadow: 0 6px 16px rgba(217, 119, 87, 0.18);
}

.media-list-compact {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
    margin-top: 6px;
}

.media-list-compact::-webkit-scrollbar {
    width: 6px;
}

.media-list-compact::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.media-list-compact::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    transition: background 0.2s;
}

.media-list-compact::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.file-input {
    display: none;
}

.media-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: #fafbff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 80px;
    flex-shrink: 0;
}

.media-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.03) 0%, rgba(217, 119, 87, 0.01) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.media-item:hover::before {
    opacity: 1;
}

.media-item.clickable {
    cursor: pointer;
}

.media-item.clickable:hover {
    background: #ffffff;
    border-color: #d97757;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.12);
}

.media-item.success {
    border-color: #48bb78;
    background: #f0fff4;
}

.media-preview {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.media-preview.video-thumbnail {
    position: relative;
    width: 72px;
    height: 54px;
    background: #1a202c;
    cursor: pointer;
}

.video-preview-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding-left: 2px;
    color: #fff;
    font-size: 9px;
    background: rgba(26, 32, 44, 0.72);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.video-thumbnail.is-ready .video-preview-play {
    display: flex;
}

.video-preview-status {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    padding: 1px 3px;
    border-radius: 3px;
    color: #fff;
    font-size: 0.55rem;
    line-height: 1.3;
    text-align: center;
    background: rgba(26, 32, 44, 0.72);
    pointer-events: none;
}

.video-thumbnail.is-ready .video-preview-status {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.video-thumbnail.is-ready:hover .video-preview-status,
.video-thumbnail:focus-within .video-preview-status {
    opacity: 1;
}

.video-thumbnail.has-error::before {
    content: '🎬';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 13px;
    font-size: 18px;
}

.video-thumbnail.has-error video,
.video-thumbnail.has-error .video-preview-play {
    visibility: hidden;
}

.media-info {
    flex: 1;
    min-width: 0;
}

.media-name {
    font-size: 0.7rem;
    color: #1a202c;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
    max-width: 70px;
}

.media-tag {
    font-size: 0.65rem;
    color: #cf6c4d;
    font-weight: 600;
    background: #e8f3ff;
    padding: 2px 5px;
    border-radius: 4px;
    display: inline-block;
}

.media-status {
    font-size: 0.6875rem;
    color: #38a169;
    font-weight: 600;
}

.btn-remove {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.2);
}

.btn-remove:hover {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.3);
}

.btn-remove:active {
    transform: scale(0.95);
}


/* ===== 新增：提示词工具栏（@引用素材） ===== */
.prompt-toolbar-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
    position: relative;
}

.mention-btn-inline {
    background: #f0f4ff;
    border: 1px solid #c3d0ff;
    color: #d97757;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.mention-btn-inline:hover {
    background: #d97757;
    color: white;
    border-color: #d97757;
}

.mention-popup-inline {
    position: absolute;
    top: 32px;
    right: 0;
    width: 240px;
    max-height: 260px;
    background: #fff;
    border: 1.5px solid #d97757;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.18s ease;
}

.mention-popup-inline.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mention-popup-header {
    padding: 9px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    border-bottom: 1px solid #e9ecef;
    background: #faf9f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mention-popup-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.mention-popup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.12s;
    font-size: 0.78rem;
}

.mention-popup-item:hover {
    background: #eef1ff;
    color: #d97757;
}

.mention-popup-item span {
    color: #d97757;
    font-family: monospace;
    font-size: 0.75rem;
}

.mention-popup-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 0.78rem;
    color: #a0aec0;
}

/* 轨道容器 */
.timeline-tracks {
    position: relative;
    height: calc(280px - 32px) !important;
    min-height: 100%;
    padding: 20px 0 !important;
    display: block !important;
}

/* 视频片段样式 - 浅色卡片 */
.timeline-clip-item {
    position: absolute;
    top: 20px;
    height: 100px !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    cursor: grab;
    transition: all 0.2s ease;
}

.timeline-clip-item:hover {
    border-color: #cbd5e0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.timeline-clip-item.active {
    border: 2px solid #d97757 !important;
    box-shadow: 0 4px 16px rgba(217, 119, 87, 0.3);
    z-index: 10;
}

.timeline-clip-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: scale(0.98);
}

.timeline-clip-item.drag-over {
    border-color: #d97757 !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.2);
}

/* 片段内部 */
.clip-inner {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background-color: #333; /* 深色背景，未加载帧时显示 */
    position: relative;
    z-index: 2; /* 确保内容在帧图层之上 */
    background: transparent !important; /* 让位给帧图层 */
}

/* 视频帧序列容�?*/
.clip-frames-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    border-radius: 8px;
    opacity: 0.8;
}

.clip-frame-item {
    height: 100%;
    background-size: cover;
    background-position: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.clip-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95) !important;
    color: #2d3748 !important;
    font-size: 11px !important;
    padding: 6px 8px !important;
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-dur {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-family: monospace;
}

.clip-del-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-clip-item:hover .clip-del-btn {
    display: flex;
}

.clip-del-btn:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

/* 游标 - 精致红色，可拖动 */
.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px !important;
    background: #e53e3e !important;
    z-index: 100;
    pointer-events: auto; /* 允许交互 */
    cursor: ew-resize;
    box-shadow: 0 0 8px rgba(229, 62, 62, 0.6);
    transition: box-shadow 0.2s;
}

.timeline-playhead:hover {
    box-shadow: 0 0 12px rgba(229, 62, 62, 0.8);
}

.timeline-playhead::before {
    content: '';
    position: absolute;
    top: 0;
    left: -7px;
    width: 16px;
    height: 16px;
    background: #e53e3e;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: ew-resize;
    transition: all 0.2s;
}

.timeline-playhead:hover::before {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* 拖动时的样式 */
.timeline-playhead.dragging {
    box-shadow: 0 0 16px rgba(229, 62, 62, 1);
}

.timeline-playhead.dragging::before {
    transform: rotate(-45deg) scale(1.2);
}

/* 预览�?- 深色背景 */
.timeline-preview-area {
    flex: 1;
    background: #1a202c !important;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 300px;
}

.timeline-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 控制�?- 新版布局 */
.preview-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95) !important;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px !important;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.3s;
}

.timeline-preview-area:hover .preview-controls-overlay {
    opacity: 1;
}

.control-bar-top {
    width: 100%;
    display: flex;
    align-items: center;
}

.control-bar-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    margin-top: 4px;
}

.center-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.right-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.time-container {
    display: flex;
    align-items: center;
}

.control-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #4a5568 !important;
    font-size: 1.1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 0;
}

.control-btn:hover {
    color: #2d3748 !important;
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.play-btn {
    background: #10b981 !important; /* 绿色播放按钮 */
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
}

.play-btn:hover {
    background: #059669 !important;
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(16, 185, 129, 0.4);
}

.time-display {
    color: #4a5568 !important;
    font-weight: 600;
    font-size: 14px;
    font-family: monospace;
    min-width: 100px;
}

/* 进度�?- 宽大气风格（带绿色填充） */
.progress-bar {
    flex: 1;
    height: 8px !important;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    /* 动态进度填�?*/
    background-image: linear-gradient(#10b981, #10b981);
    background-size: var(--progress, 0%) 100%;
    background-repeat: no-repeat;
}

.progress-bar::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: transparent; /* 背景�?input 本身控制 */
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    background: #10b981 !important; /* 绿色滑块 */
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffffff;
    transition: transform 0.1s;
    margin-top: -5px; /* (8 - 18) / 2 = -5px 垂直居中 */
}

.progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* 滚动条美�?*/
.timeline-scroll-container::-webkit-scrollbar {
    height: 10px;
    background: #f7fafc;
}

.timeline-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 5px;
    border: 2px solid #f7fafc;
    transition: background 0.2s;
}

.timeline-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 添加按钮 */
.timeline-add-block {
    position: absolute;
    top: 20px;
    height: 100px;
    width: 100px;
    background: #ffffff !important;
    border: 2px dashed #cbd5e0 !important;
    color: #a0aec0 !important;
    border-radius: 10px !important;
    font-size: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-add-block:hover {
    border-color: #d97757 !important;
    color: #d97757 !important;
    background: #f7fafc !important;
    transform: scale(1.02);
}

/* 空状态提�?*/
.timeline-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a0aec0;
    font-size: 14px;
    text-align: center;
    pointer-events: none;
}






/* ========== ��Ƶ��ѯģ̬����ʽ ========== */

.video-query-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.video-query-container {
    width: 90%;
    max-width: 900px;
    max-height: 95vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.video-query-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    min-height: 0;
    height: 100%;
}

/* �������� */
.query-input-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

/* 输入行样式 */
.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.input-row label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.input-row .glass-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.input-row .glass-input:focus {
    outline: none;
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

/* 按钮行样式 */
.button-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.button-row .input-hint {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
    flex: 1;
}

.button-row .btn-query {
    flex-shrink: 0;
    width: 130px;
    padding: 10px 24px;
    font-size: 0.95rem;
}

/* 兼容旧的inline样式 */
.input-group-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.input-group-inline label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.input-group-inline .glass-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.input-group-inline .glass-input:focus {
    outline: none;
    border-color: #d97757;
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

.input-group-inline .btn-query {
    flex-shrink: 0;
    width: auto;
    min-width: 110px;
    max-width: 140px;
    padding: 10px 18px;
    white-space: nowrap;
}

.input-hint {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
    padding-left: 92px;
}

/* ʾ������־���� */
.example-section,
.log-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.btn-copy-sm,
.btn-clear-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-sm:hover {
    background: #d97757;
    color: white;
    border-color: #d97757;
}

.btn-clear-sm:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

/* ����� */
.code-block {
    background: #1a202c;
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #2d3748;
    border-bottom: 1px solid #4a5568;
}

.code-label {
    background: #48bb78;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.code-path {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.highlight-text {
    color: #fbbf24;
    font-weight: 600;
}

.code-body {
    padding: 16px;
}

.code-body pre {
    margin: 0;
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.code-body code {
    color: inherit;
}

/* ��־���� */
.log-container {
    background: #f7fafc;
    border-radius: 8px;
    padding: 12px;
    min-height: 120px;
    max-height: none;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.log-empty {
    color: #a0aec0;
    text-align: center;
    padding: 20px;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: white;
    border-left: 3px solid #cbd5e0;
}

.log-entry.success {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.log-entry.error {
    border-left-color: #e53e3e;
    background: #fff5f5;
}

.log-entry.info {
    border-left-color: #4299e1;
    background: #ebf8ff;
}

.log-time {
    color: #718096;
    font-size: 0.75rem;
    margin-right: 8px;
}

.log-message {
    color: #2d3748;
}

/* ��Ƶ������� */
.video-result-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-sm:hover {
    background: #d97757;
    color: white;
    border-color: #d97757;
    transform: translateY(-1px);
}

.video-preview-wrapper {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-preview-wrapper .video-preview {
    width: 100%;
    max-height: 280px;
    display: block;
}

.btn-icon {
    font-size: 1rem;
}

/* ===== 参考素材区域样式 ===== */
.reference-media-container {
    background: #f8faff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.media-row {
    transition: all 0.2s ease;
}

.media-row-header {
    transition: all 0.2s ease;
}

.media-row-header:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}

.add-media-btn:hover {
    background: #cf6c4d !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(217, 119, 87, 0.3);
}

.add-media-btn:active {
    transform: translateY(0);
}

.media-inputs-container {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-input-row {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 媒体输入框样式增强 */
.media-input-row input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

.media-input-row button:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    transform: scale(1.05);
}

.media-input-row button:active {
    transform: scale(0.95);
}

/* ===================== 真人素材库（Real Person Library）样式 ===================== */

/* 资产组卡片 */
.rpl-group-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.rpl-group-card:hover {
    box-shadow: 0 4px 16px rgba(100, 120, 200, 0.1);
}

/* 组头部 */
.rpl-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8faff, #f0f4ff);
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    user-select: none;
}
.rpl-group-header:hover {
    background: linear-gradient(135deg, #f0f4ff, #e8eeff);
}

/* 折叠按钮 */
.rpl-group-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #d97757;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
}
.rpl-group-toggle:hover {
    background: #e8eeff;
}

/* 组名 */
.rpl-group-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* 操作按钮组 */
.rpl-group-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* 组内容区 */
.rpl-group-content {
    padding: 10px 14px 14px;
}

/* 组元信息行（group ID + 数量） */
.rpl-group-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

/* 可复制的 ID 文本 */
.rpl-copyable-id {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.72rem;
    color: #d97757;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    padding: 2px 6px;
    background: #eef1ff;
    border-radius: 4px;
    border: 1px solid #c3d4fa;
    transition: background 0.15s;
}
.rpl-copyable-id:hover {
    background: #dde4ff;
}

/* 资产网格 */
.rpl-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
}

/* 资产格子 */
.rpl-asset-cell {
    position: relative;
    width: 120px;
    border-radius: 10px;
    overflow: visible;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px;
    border: 2px solid #e2e8f0;
}
.rpl-asset-cell:hover {
    border-color: #d97757;
    box-shadow: 0 8px 24px rgba(217, 119, 87, 0.2);
    transform: translateY(-4px);
}

/* 资产悬浮操作层 */
.rpl-asset-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.85) 100%);
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}
.rpl-asset-cell:hover .rpl-asset-overlay {
    opacity: 1;
}

/* 资产状态角标 */
.rpl-asset-status-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 0.58rem;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    z-index: 2;
}
.rpl-asset-status-badge.rpl-status-processing {
    background: #d69e2e;
}
.rpl-asset-status-badge.rpl-status-failed {
    background: #e53e3e;
}
.rpl-asset-status-badge.rpl-status-active {
    background: #38a169;
}


/* ==================== Midjourney 样式 ==================== */
/* 配色沿用站点既有的 #667eea → #764ba2 紫蓝主色，避免 MJ 模块与其他卡片割裂 */

/* ---------- MJ 模式选择器 ---------- */
.mj-mode-card {
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .25s ease, transform .25s ease;
}
.mj-mode-card.visible { opacity: 1; transform: translateY(0); }

.mj-mode-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 14px;
}
.mj-mode-card h3 .icon-box {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex: none;
}

.mj-mode-selector { display: flex; gap: 10px; }

.mj-mode-option {
    flex: 1;
    display: block;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all .18s ease;
}
.mj-mode-option:hover { border-color: #b8c0ff; background: #fafbff; }
.mj-mode-option.mj-mode-active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102,126,234,.08), rgba(118,75,162,.08));
}
.mj-mode-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.mode-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.mode-icon {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    border-radius: 10px;
    background: #f1f3f9;
    flex: none;
    transition: background .18s ease;
}
.mj-mode-active .mode-icon { background: linear-gradient(135deg, #667eea, #764ba2); }
.mode-name { font-size: 0.85rem; font-weight: 600; color: #2d3748; }
.mj-mode-active .mode-name { color: #5568d3; }
.mode-desc { font-size: 0.72rem; color: #a0aec0; line-height: 1.4; }

.mj-mode-tip {
    display: flex; align-items: flex-start; gap: 8px;
    margin-top: 12px; padding: 9px 12px;
    background: #fffbf0;
    border: 1px solid #fbe6c2;
    border-radius: 8px;
}
.mj-mode-tip .tip-icon { font-size: 14px; flex: none; line-height: 1.5; }
.mj-mode-tip .tip-text { font-size: 0.75rem; color: #975a16; line-height: 1.5; }

/* ---------- MJ 参数面板 ---------- */
.mj-params-panel {
    margin-top: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

.param-section { margin-bottom: 16px; }
.param-section:last-child { margin-bottom: 0; }

.param-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; font-weight: 600;
    color: #4a5568; margin-bottom: 9px;
}
.param-icon { font-size: 0.9rem; }

.aspect-ratio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}
.aspect-ratio-option {
    display: flex; align-items: center; justify-content: center;
    padding: 9px 4px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all .16s ease;
}
.aspect-ratio-option input[type="radio"] { display: none; }
.aspect-ratio-option:hover { border-color: #b8c0ff; background: #fafbff; }
.aspect-ratio-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102,126,234,.1), rgba(118,75,162,.1));
}
.aspect-ratio-label { font-size: 0.78rem; font-weight: 600; color: #4a5568; }
.aspect-ratio-option.selected .aspect-ratio-label { color: #5568d3; }

.param-select {
    width: 100%;
    padding: 8px 11px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease;
}
.param-select:hover { border-color: #b8c0ff; }
.param-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.12);
}

.param-section-collapsible { border-top: 1px solid #edf0f5; padding-top: 14px; }
.param-collapse-header {
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; user-select: none; padding: 2px 0;
}
.param-collapse-header .param-label { margin-bottom: 0; }
.param-collapse-header:hover .param-label { color: #5568d3; }
.collapse-icon { font-size: 0.7rem; color: #a0aec0; }
.param-collapse-content { padding-top: 12px; }

.param-subsection { margin-bottom: 11px; }
.param-subsection:last-child { margin-bottom: 0; }
.param-sublabel {
    display: block;
    font-size: 0.76rem; font-weight: 500;
    color: #718096; margin-bottom: 5px;
}
.param-sublabel input[type="checkbox"] {
    width: 15px; height: 15px;
    cursor: pointer; accent-color: #667eea;
    vertical-align: -2px;
}

.param-reset-btn {
    width: 100%;
    padding: 9px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem; font-weight: 500;
    color: #718096;
    cursor: pointer;
    transition: all .16s ease;
}
.param-reset-btn:hover { background: #edf2f7; color: #4a5568; }

/* ---------- MJ 任务卡片 ---------- */
/* 与「创作画廊」内其他结果卡片同构：白底 + 细边 + 柔和阴影，不用重描边 */
.mj-task-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: box-shadow .2s ease;
}
.mj-task-card:hover { box-shadow: 0 4px 14px rgba(102,126,234,.1); }
.mj-task-card.task-failed { background: #fffafa; border-color: #fed7d7; }

.mj-task-card .task-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.task-header-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-header-right { display: flex; align-items: center; gap: 8px; }

.mj-badge {
    padding: 3px 9px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 6px;
    font-size: 0.7rem; font-weight: 600;
    letter-spacing: .01em;
}
.mode-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px;
    background: #f1f3f9;
    border-radius: 6px;
    font-size: 0.7rem; font-weight: 600;
    color: #5568d3;
}

.mj-task-card .task-status {
    font-size: 0.72rem; font-weight: 600;
    padding: 3px 9px; border-radius: 20px;
    white-space: nowrap;
}
.status-progress { background: #ebf4ff; color: #3182ce; }
.status-success  { background: #f0fff4; color: #276749; }
.status-failure  { background: #fff5f5; color: #c53030; }
.status-pending  { background: #fffaf0; color: #b7791f; }

.task-delete-btn {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 15px; line-height: 1;
    color: #cbd5e0;
    cursor: pointer;
    transition: all .16s ease;
    flex: none;
}
.task-delete-btn:hover { background: #fff5f5; border-color: #feb2b2; color: #e53e3e; }

.mj-task-card .task-prompt {
    font-size: 0.78rem;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 11px;
    word-break: break-word;
}

.mj-task-card .task-image-container {
    width: 100%;
    min-height: 160px;
    display: flex; align-items: center; justify-content: center;
    background: #f7fafc;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 11px;
}
.mj-task-card .task-image {
    width: 100%; height: auto; display: block;
    cursor: zoom-in;
    transition: transform .25s ease;
}
.mj-task-card .task-image:hover { transform: scale(1.015); }

/* 独立类名：项目里已有一个 70px 的 .loading-spinner 旋转圆环，同名会被叠加成竖排且整体旋转 */
.mj-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 36px 20px; width: 100%;
}
.mj-spinner {
    width: 30px; height: 30px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: mjSpin .9s linear infinite;
    flex: none;
}
@keyframes mjSpin { to { transform: rotate(360deg); } }
.mj-loading-text { font-size: 0.75rem; color: #a0aec0; white-space: nowrap; }

.task-error {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 32px 20px; text-align: center;
}
.task-error .error-icon { font-size: 30px; opacity: .85; }
.task-error .error-message {
    font-size: 0.78rem; color: #c53030;
    line-height: 1.6; max-width: 90%; word-break: break-word;
}

.mj-task-card .task-progress {
    position: relative;
    height: 5px;
    background: #edf2f7;
    border-radius: 3px;
    margin-top: 18px;
    margin-bottom: 9px;
}
.mj-task-card .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width .35s ease;
}
.mj-task-card .progress-bar.progress-complete {
    background: linear-gradient(90deg, #48bb78, #38a169);
}
/* 进度百分比放到进度条上方，避免 5px 高度里叠字糊成一团 */
.mj-task-card .progress-text {
    position: absolute; right: 0; top: -16px;
    font-size: 0.68rem; font-weight: 600; color: #a0aec0;
}

.mj-task-card .task-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.68rem; color: #cbd5e0;
}
.mj-task-card .task-meta .task-id { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- MJ 动作按钮 ---------- */
.mj-task-card .task-actions { display: none; margin-top: 12px; }
.mj-task-card.task-complete .task-actions { display: block; }

.mj-action-buttons {
    display: flex; flex-direction: column; gap: 7px;
    padding-top: 11px;
    border-top: 1px solid #edf0f5;
}
.mj-button-group { display: flex; gap: 6px; flex-wrap: wrap; }

.mj-btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.76rem; font-weight: 600;
    cursor: pointer;
    transition: all .16s ease;
    display: inline-flex; align-items: center; gap: 4px;
    position: relative; overflow: hidden;
}
.mj-btn:disabled { opacity: .55; cursor: not-allowed; }

/* U 系列主色实心、V 系列描边、高级操作中性：三级视觉权重，不用高饱和撞色 */
.mj-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.mj-btn-primary:hover:not(:disabled) {
    box-shadow: 0 3px 10px rgba(102,126,234,.32);
    transform: translateY(-1px);
}
.mj-btn-warning {
    background: #fff; color: #5568d3; border-color: #c3cbf7;
}
.mj-btn-warning:hover:not(:disabled) { background: #f5f7ff; border-color: #667eea; }
.mj-btn-info {
    background: #f1f3f9; color: #5568d3;
}
.mj-btn-info:hover:not(:disabled) { background: #e6eaf5; }
.mj-btn-secondary {
    background: #f7fafc; color: #718096; border-color: #e2e8f0;
}
.mj-btn-secondary:hover:not(:disabled) { background: #edf2f7; color: #4a5568; }

.mj-btn-loading::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
    animation: mjShimmer 1.2s infinite;
}
@keyframes mjShimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

.task-removing { animation: mjFadeOut .28s ease forwards; }
@keyframes mjFadeOut {
    to { opacity: 0; transform: translateX(16px); }
}

/* ---------- 图片全屏预览 ---------- */
.image-preview-overlay {
    position: fixed; inset: 0;
    background: rgba(20,17,12,.9);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .25s ease;
}
.image-preview-overlay.visible { opacity: 1; }
.image-preview-overlay.closing { opacity: 0; }

/* 预览遮罩用独立前缀，避免与上传预览区的 .image-preview-container 撞车 */
.mj-preview-box {
    position: relative;
    max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column; align-items: center;
}
.mj-preview-box img {
    max-width: 100%; max-height: 78vh;
    object-fit: contain;
    border-radius: 10px;
}
.mj-preview-close {
    position: absolute; top: -42px; right: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.14);
    border: none; border-radius: 50%;
    font-size: 20px; color: #fff;
    cursor: pointer; transition: all .16s ease;
}
.mj-preview-close:hover { background: rgba(255,255,255,.26); }

.mj-preview-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: nowrap; }
.mj-preview-btn {
    flex: none;
    white-space: nowrap;
    padding: 8px 16px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    color: #fff; font-size: 0.8rem;
    cursor: pointer; text-decoration: none;
    transition: all .16s ease;
}
.mj-preview-btn:hover { background: rgba(255,255,255,.22); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .mj-mode-selector { flex-direction: column; }
    .mode-content { flex-direction: row; text-align: left; }
    .mode-info { flex: 1; }
    .mj-task-card .task-header { align-items: flex-start; }
    .mj-btn { flex: 1; justify-content: center; min-width: 62px; }
}

/* ---------- MJ 参数面板新增控件 ---------- */

/* 两列栅格：把影响画面的参数并排放，缩短纵向滚动 */
.param-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.param-grid-2 .param-section { margin-bottom: 0; }

.param-input {
    width: 100%;
    padding: 8px 11px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #2d3748;
    background: #fff;
    transition: border-color .16s ease;
}
.param-input::placeholder { color: #cbd5e0; }
.param-input:hover { border-color: #b8c0ff; }
.param-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.12);
}

/* 参数原始写法标记，如 --sref */
.param-flag {
    display: inline-block;
    padding: 1px 5px;
    margin-left: 4px;
    background: #f1f3f9;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 600;
    color: #5568d3;
}

.param-badge {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 6px;
    background: #ebf4ff;
    color: #3182ce;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}
.param-badge-warn { background: #fffaf0; color: #b7791f; }

.param-hint {
    margin-top: 5px;
    font-size: 0.7rem;
    color: #a0aec0;
    line-height: 1.5;
}

.param-divider {
    height: 1px;
    background: #edf0f5;
    margin: 14px 0;
}

.param-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.param-check {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.76rem;
    color: #4a5568;
    cursor: pointer;
    transition: all .16s ease;
}
.param-check:hover { border-color: #b8c0ff; background: #fafbff; }
.param-check input[type="checkbox"] {
    width: 15px; height: 15px;
    cursor: pointer;
    accent-color: #667eea;
    flex: none;
}
.param-check span { display: flex; align-items: center; }

.param-reset-btn-sm {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #a0aec0;
    cursor: pointer;
    transition: all .16s ease;
}
.param-reset-btn-sm:hover { background: #f7fafc; color: #718096; }

/* 最终提示词预览：让用户看清参数如何拼接 */
.mj-prompt-preview {
    background: #f7fafc;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
}
.preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #718096;
}
.preview-body {
    display: block;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.6;
    color: #4a5568;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

/* 任务卡片：文本类结果（describe / shorten） */
.task-text-result {
    padding: 14px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #4a5568;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
    width: 100%;
}

/* 任务卡片底部工具条 */
.mj-tool-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 9px;
    border-top: 1px dashed #edf0f5;
}
.mj-tool-btn {
    padding: 5px 11px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    text-decoration: none;
    transition: all .16s ease;
}
.mj-tool-btn:hover { background: #edf2f7; color: #4a5568; border-color: #cbd5e0; }

@media (max-width: 640px) {
    .param-grid-2 { grid-template-columns: 1fr; }
    .param-checks { grid-template-columns: 1fr; }
}

/* ---------- MJ 结果图宫格 ---------- */
/* 网关对 IMAGINE 返回拆开的四张图（imageUrls），按 2×2 排布还原 Midjourney 的宫格观感 */
.mj-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: 100%;
}
.mj-grid-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #f7fafc;
}
.mj-grid-cell img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform .2s ease;
}
.mj-grid-cell:hover img { transform: scale(1.03); }
.mj-grid-index {
    position: absolute; left: 6px; bottom: 6px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.55);
    color: #fff;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    pointer-events: none;
}
.mj-grid-broken {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #f7fafc;
    color: #cbd5e0;
    font-size: 0.72rem;
}

/* MJ 视频结果（转视频动作返回 videoUrl/videoUrls） */
.mj-video-cell {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    margin-bottom: 4px;
}
.mj-video-cell:last-child { margin-bottom: 0; }
.mj-video-cell video {
    width: 100%;
    display: block;
    max-height: 420px;
    object-fit: contain;
}

/* ==================== MJ 生成中：水波纹进度 ==================== */
/* 六层长波缓慢错位浮动：
   1) 舞台高 210px，生成期间就占足版面，不显局促
   2) 波长 320–760px，波峰 22–46px，一屏只见 1–2 个起伏，幅度明显
   3) 六级色阶由极浅到中调，整体压浅，远层近乎白雾
   4) 远层重虚化、近层清晰，做出空气透视
   5) 周期 18–42s，相邻层反向，避免整体同步平移 */
.mj-stage {
    position: relative;
    width: 100%;
    height: 210px;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(180deg, #fdfdff 0%, #f7f8fc 100%);
    border: 1px solid #f0f2f8;
    transition: opacity .5s ease, height .5s ease, border-color .5s ease;
}

.mj-stage-fill {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 0;
    transition: height 1s cubic-bezier(.33,.7,.36,1);
    will-change: height;
}

/* 每层 = 顶部波形 + 其下同色实体，两层 background 拼成 */
.mj-wave {
    position: absolute;
    left: 0; bottom: 0;
    width: 200%;
    height: 100%;
    background-repeat: repeat-x, no-repeat;
    background-position: 0 0, 0 var(--crest);
    background-size: var(--len) var(--crest), 100% calc(100% - var(--crest) + 1px);
    animation: mjDrift var(--dur) ease-in-out infinite;
    animation-direction: var(--dir, normal);
    will-change: transform;
}

/* 层 1：最远，几乎是白雾 */
.mj-wave-1 {
    --len: 760px; --crest: 46px; --dur: 42s;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 760 46' preserveAspectRatio='none'%3E%3Cpath d='M0 23 Q 95 3 190 23 T 380 23 T 570 23 T 760 23 V46 H0 Z' fill='%23eef1f9'/%3E%3C/svg%3E"),
        linear-gradient(#eef1f9, #eef1f9);
    filter: blur(3.5px);
}

/* 层 2 */
.mj-wave-2 {
    --len: 660px; --crest: 40px; --dur: 36s; --dir: reverse;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 660 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20 Q 82 3 165 20 T 330 20 T 495 20 T 660 20 V40 H0 Z' fill='%23e3e8f6'/%3E%3C/svg%3E"),
        linear-gradient(#e3e8f6, #e3e8f6);
    filter: blur(2.6px);
}

/* 层 3 */
.mj-wave-3 {
    --len: 560px; --crest: 34px; --dur: 30s;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 34' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q 70 3 140 17 T 280 17 T 420 17 T 560 17 V34 H0 Z' fill='%23d8dff2'/%3E%3C/svg%3E"),
        linear-gradient(#d8dff2, #d8dff2);
    filter: blur(1.8px);
}

/* 层 4 */
.mj-wave-4 {
    --len: 470px; --crest: 30px; --dur: 25s; --dir: reverse;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 470 30' preserveAspectRatio='none'%3E%3Cpath d='M0 15 Q 59 3 117 15 T 235 15 T 352 15 T 470 15 V30 H0 Z' fill='%23ccd5ee'/%3E%3C/svg%3E"),
        linear-gradient(#ccd5ee, #ccd5ee);
    filter: blur(1.1px);
}

/* 层 5 */
.mj-wave-5 {
    --len: 390px; --crest: 26px; --dur: 21s;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 26' preserveAspectRatio='none'%3E%3Cpath d='M0 13 Q 49 2 97 13 T 195 13 T 292 13 T 390 13 V26 H0 Z' fill='%23bfcae9'/%3E%3C/svg%3E"),
        linear-gradient(#bfcae9, #bfcae9);
    filter: blur(.5px);
}

/* 层 6：最近，最深也只到中浅调，保持清晰 */
.mj-wave-6 {
    --len: 320px; --crest: 22px; --dur: 18s; --dir: reverse;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 22' preserveAspectRatio='none'%3E%3Cpath d='M0 11 Q 40 2 80 11 T 160 11 T 240 11 T 320 11 V22 H0 Z' fill='%23b0bde3'/%3E%3C/svg%3E"),
        linear-gradient(#b0bde3, #b0bde3);
    opacity: .9;
}

/* 横向漂移叠轻微纵向起伏；宽 200% 配 -50% 位移，循环无缝 */
@keyframes mjDrift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(-25%, -4px, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

.mj-stage-frost {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.30) 0%, rgba(255,255,255,0) 38%);
    pointer-events: none;
}

.mj-stage-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}
.mj-stage-pct {
    font-size: 2.4rem;
    font-weight: 200;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #5a63a0;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 16px rgba(255,255,255,.98), 0 0 5px rgba(255,255,255,.95);
}
.mj-stage-pct small {
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 3px;
    opacity: .55;
}
.mj-stage .mj-loading-text {
    font-size: 0.74rem;
    color: #6b74b0;
    letter-spacing: .06em;
    text-shadow: 0 1px 10px rgba(255,255,255,.98);
}

.mj-stage-done {
    opacity: 0;
    height: 0;
    border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .mj-wave { animation: none; }
    .mj-stage-fill { transition: none; }
}

@media (max-width: 640px) {
    .mj-stage { height: 170px; }
    .mj-stage-pct { font-size: 2rem; }
}

/* ==================== 结果图单张操作 ==================== */
.mj-cell-actions {
    position: absolute;
    top: 6px; right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all .18s ease;
}
.mj-grid-cell:hover .mj-cell-actions { opacity: 1; transform: translateY(0); }
.mj-cell-actions a,
.mj-cell-actions button {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 0.72rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .16s ease;
}
.mj-cell-actions a:hover,
.mj-cell-actions button:hover { background: rgba(0,0,0,.78); }

/* 工具条里的逐张原图入口 */
.mj-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}
.mj-tool-label { font-size: 0.75rem; color: #a0aec0; }
.mj-tool-num {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #5568d3;
    text-decoration: none;
    transition: all .16s ease;
}
.mj-tool-num:hover {
    background: #5568d3; color: #fff; border-color: #5568d3;
    transform: translateY(-1px);
}

/* ==================== MJ 动作按钮：放大加重，撑起版面 ==================== */
/* 原先 padding 8px/字号 13px 在大图下显得局促，这里整体加码并强化层级 */
.mj-action-buttons { gap: 10px; }
.mj-button-group { gap: 8px; }

.mj-btn {
    padding: 11px 20px;
    min-width: 64px;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: .02em;
    box-shadow: 0 2px 6px rgba(0,0,0,.07);
    transition: transform .18s cubic-bezier(.34,1.4,.64,1), box-shadow .18s ease, filter .18s ease;
}
.mj-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

/* U 系列是主操作，给足存在感 */
.mj-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 3px 10px rgba(102,126,234,.32);
}
.mj-btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(102,126,234,.42); }

/* V 系列为次级操作，用描边区分，避免与 U 抢焦点 */
.mj-btn-warning {
    background: #fff;
    color: #5568d3;
    border: 1.5px solid #c3cbf7;
    box-shadow: 0 2px 6px rgba(102,126,234,.10);
}
.mj-btn-warning:hover:not(:disabled) {
    background: #f4f6ff;
    border-color: #8f9df0;
    box-shadow: 0 5px 14px rgba(102,126,234,.20);
}

.mj-btn-info {
    background: #f7f9ff;
    color: #4a5568;
    border: 1.5px solid #e2e8f0;
    box-shadow: none;
}
.mj-btn-info:hover:not(:disabled) { background: #eef2ff; border-color: #c3cbf7; color: #5568d3; }

.mj-btn-secondary {
    background: #fafbfc;
    color: #718096;
    border: 1.5px solid #e9ecef;
    box-shadow: none;
}
.mj-btn-secondary:hover:not(:disabled) { background: #f1f5f9; color: #4a5568; }

/* 工具条与动作区拉开距离，形成主次分区 */
.mj-tool-row {
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf0f5;
}
.mj-tool-btn {
    padding: 8px 15px;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 500;
}
.mj-tool-btn:hover { transform: translateY(-1px); }

/* 卡片本身也放宽呼吸感 */
.mj-task-card { padding: 18px; }
.mj-task-card .task-prompt { font-size: 0.82rem; line-height: 1.65; margin-bottom: 14px; }
.mj-task-card .task-image-container { margin-bottom: 12px; }

@media (max-width: 640px) {
    .mj-btn { padding: 10px 14px; min-width: 54px; font-size: 0.8rem; }
    .mj-stage-pct { font-size: 2.4rem; }
    .mj-cell-actions { opacity: 1; transform: none; }
}

/* ===================== 提示词库 2.0 ===================== */
/* 数据由 prompt-proxy.php 每小时抓取，以下样式服务于新增的
   NEW 角标 / 更新时间状态栏 / 来源筛选 / 无限滚动计数。 */

/* 新收录角标：只在服务端判定 isNew（首见时间在窗口内）的条目上出现 */
.prompt-new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    pointer-events: none;
}

/* 底部状态栏：左侧「已显示 N / M 条」，右侧「X 分钟前更新」 */
.prompt-statusbar {
    padding: 10px 24px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: #718096;
}

.prompt-statusbar .prompt-updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: help;
}

.prompt-statusbar .prompt-updated::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #48bb78;   /* 数据是活的 */
}

/* 分类/来源下拉里的条数徽标 */
.dropdown-item .cat-count {
    float: right;
    margin-left: 12px;
    color: #a0aec0;
    font-size: 0.78rem;
}

/* 分类现在由服务端动态下发（约 20 项），菜单需要可滚动 */
.prompt-library-modal .dropdown-menu {
    max-height: 320px;
    overflow-y: auto;
}

/* 刷新按钮：请求期间转圈 */
#promptRefreshBtn.spinning {
    animation: promptSpin 0.9s linear infinite;
    opacity: 0.6;
}

@keyframes promptSpin {
    to { transform: rotate(360deg); }
}

#promptScrollSentinel {
    height: 1px;
}

.prompt-empty-sub {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #a0aec0;
}

/* ==================== MJ 按钮：窄卡片下同比例缩小而非换行 ==================== */
/* U1-U4、V1-V4 走等分栅格：列数由 --cols 指定，宽度随卡片走。
   多任务并排时卡片会变窄，此时按钮整体缩小，始终保持一行。 */
.mj-group-even {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    gap: 6px;
}
.mj-group-even .mj-btn {
    min-width: 0;          /* 允许被压缩到比内容更窄 */
    padding-left: 4px;
    padding-right: 4px;
    /* 字号随容器宽度收缩，窄到极限也不溢出 */
    font-size: clamp(0.7rem, 2.2cqw, 0.86rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 让上面的 cqw 生效：把动作区声明为容器查询上下文 */
.task-actions {
    container-type: inline-size;
}

/* 不支持容器查询时的兜底：用视口宽度近似 */
@supports not (container-type: inline-size) {
    .mj-group-even .mj-btn { font-size: 0.78rem; }
}

/* 单列组（重新生成等）保持自适应宽度，不强行拉满 */
.mj-button-group:not(.mj-group-even) { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==================== 灵感档案：MJ 多图切换 ==================== */
/* MJ 一次出 4 张按一条记录存档，档案卡片里做左右切换，
   否则除封面外的几张完全无从查看。 */
.history-gallery {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}
.history-gallery .history-image {
    display: block;
    width: 100%;
    cursor: zoom-in;
}

/* 左右箭头：悬浮时才显形，不干扰浏览 */
.hg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.42);
    backdrop-filter: blur(3px);
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .18s ease, background .18s ease;
    z-index: 2;
}
.history-gallery:hover .hg-nav { opacity: 1; }
.hg-nav:hover { background: rgba(0,0,0,.66); }
.hg-prev { left: 0; border-radius: 0 8px 8px 0; }
.hg-next { right: 0; border-radius: 8px 0 0 8px; }

/* 底部圆点指示 */
.hg-dots {
    position: absolute;
    left: 0; right: 0; bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}
.hg-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    box-shadow: 0 0 3px rgba(0,0,0,.4);
    cursor: pointer;
    transition: all .18s ease;
}
.hg-dot:hover { background: rgba(255,255,255,.8); }
.hg-dot.active {
    background: #fff;
    width: 16px;
    border-radius: 3px;
}

/* 右上角张数计数 */
.hg-count {
    position: absolute;
    top: 8px; right: 8px;
    padding: 2px 7px;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(3px);
    border-radius: 5px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: .02em;
    z-index: 2;
    pointer-events: none;
}

/* 触屏没有 hover，箭头常驻 */
@media (hover: none) {
    .hg-nav { opacity: .85; }
}

/* ==================== 组图大图预览 ==================== */
/* MJ 一次出 4 张，放大后仍需左右切换与序号，否则等于只看得到一张 */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 18, .92);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .2s ease;
}
.gallery-modal.visible { opacity: 1; }
.gallery-modal.closing { opacity: 0; }

.gm-img {
    max-width: 88vw;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
    user-select: none;
}

.gm-close {
    position: absolute;
    top: 20px; right: 24px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.12);
    border: none; border-radius: 50%;
    color: #fff; font-size: 24px; line-height: 1;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}
.gm-close:hover { background: rgba(255,255,255,.24); transform: scale(1.06); }

/* 左右切换：贴边大热区，便于连续点击 */
.gm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 92px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(4px);
    border: none;
    color: #fff;
    font-size: 34px; line-height: 1;
    cursor: pointer;
    transition: background .16s ease;
}
.gm-nav:hover { background: rgba(255,255,255,.22); }
.gm-prev { left: 18px; border-radius: 10px; }
.gm-next { right: 18px; border-radius: 10px; }

/* 底部信息条：序号 + 缩略图导航 + 原图链接 */
.gm-bar {
    position: absolute;
    left: 0; right: 0; bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0 20px;
}
.gm-count {
    padding: 6px 14px;
    background: rgba(255,255,255,.12);
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.gm-thumbs {
    display: flex;
    gap: 8px;
}
.gm-thumb {
    width: 52px; height: 52px;
    object-fit: cover;
    border-radius: 7px;
    cursor: pointer;
    opacity: .45;
    border: 2px solid transparent;
    transition: all .16s ease;
}
.gm-thumb:hover { opacity: .8; }
.gm-thumb.active {
    opacity: 1;
    border-color: #fff;
    transform: translateY(-2px);
}
.gm-open {
    padding: 6px 14px;
    background: rgba(255,255,255,.12);
    border-radius: 20px;
    color: #fff;
    font-size: 0.78rem;
    text-decoration: none;
    transition: background .16s ease;
}
.gm-open:hover { background: rgba(255,255,255,.24); }

@media (max-width: 640px) {
    .gm-nav { width: 40px; height: 72px; font-size: 28px; }
    .gm-prev { left: 6px; }
    .gm-next { right: 6px; }
    .gm-img { max-width: 94vw; max-height: 62vh; }
    .gm-thumb { width: 42px; height: 42px; }
    .gm-bar { gap: 10px; bottom: 14px; }
}
