/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 标题栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* 主内容区 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.task-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.task-item:hover {
    background: #f0f0f0;
}

.task-item.active {
    background: #e8eaf6;
    border-left: 3px solid #667eea;
}

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.task-item-name {
    font-weight: 500;
    font-size: 14px;
}

.task-item-delete {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

.task-item-delete:hover {
    color: #f44336;
}

.task-item-time {
    font-size: 12px;
    color: #999;
}

/* 工作区 */
.workspace {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #fafafa;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 16px;
}

.task-workspace {
    max-width: 900px;
    margin: 0 auto;
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
}

.step.active .step-number {
    background: #667eea;
}

.step.completed .step-number {
    background: #4caf50;
}

.step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* 步骤内容 */
.step-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #e0e0e0;
    color: #333;
}

.btn:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.upload-area.dragging {
    border-color: #667eea;
    background: #e8eaf6;
}

.upload-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 12px;
    color: #999;
}

/* 文件预览 */
.file-preview {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 10px;
}

.file-icon {
    font-size: 32px;
    margin-right: 15px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.file-meta {
    font-size: 12px;
    color: #999;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* 波形图 */
.waveform-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.waveform-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.waveform-tip {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

#waveform {
    margin-bottom: 15px;
    position: relative;
    min-height: 128px;
}

/* 区域选择器样式 */
.region-overlay {
    pointer-events: none;
}

.region-selector {
    pointer-events: auto !important;
}

.region-handle-left,
.region-handle-right {
    pointer-events: auto !important;
}

.waveform-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-display {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.time-item {
    display: flex;
    flex-direction: column;
}

.time-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
}

.time-value {
    font-weight: 600;
    color: #333;
}

.auto-desc-status {
    margin-bottom: 12px;
    color: #667eea;
    font-size: 14px;
}

.auto-desc-status.error {
    color: #e53935;
}

.cut-preview {
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9ff;
    margin-bottom: 16px;
}

.cut-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cut-preview-title {
    font-weight: 600;
    color: #333;
}

.cut-preview-time {
    font-size: 13px;
    color: #666;
}

.cut-preview-actions {
    display: flex;
    gap: 10px;
}

/* 文本区域 */
.textarea-group {
    margin-bottom: 20px;
}

.textarea-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.textarea-group textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.textarea-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* 视频列表 */
.video-list {
    margin-top: 20px;
}

.video-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.video-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.video-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.video-status.queued {
    background: #fff3cd;
    color: #856404;
}

.video-status.in_progress {
    background: #cce5ff;
    color: #004085;
}

.video-status.completed {
    background: #d4edda;
    color: #155724;
}

.video-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    transition: width 0.3s;
}

.video-preview {
    margin-top: 15px;
}

.video-preview video {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingText {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* 加载状态文本 */
.loading-text {
    text-align: center;
    padding: 40px 20px;
    color: #667eea;
    font-size: 16px;
    font-weight: 500;
    background: #f0f4ff;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* 复选框样式优化 */
.video-checkbox {
    accent-color: #667eea;
    cursor: pointer;
}

.video-checkbox:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
    }

    .step-indicator {
        overflow-x: auto;
        padding: 0 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
