/* ========== 视频任务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, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 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;
}

/* 任务列表 - 网格布局，每行2个 */
.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: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 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: #667eea;
}

/* 预览区 */
.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, #667eea 0%, #764ba2 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: #667eea;
    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: #667eea;
    color: #667eea;
}

.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;
    }
}
