/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 版本切换 */
.version-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.version-btn {
    padding: 10px 30px;
    border: 2px solid white;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.version-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.version-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 简化版日志 */
.simple-log {
    font-family: 'Courier New', monospace;
    color: #333;
}

.simple-log .log-item {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #e0e0e0;
}

.simple-log .log-item:last-child {
    border-bottom: none;
}

.simple-log .log-time {
    color: #999;
    font-size: 0.85rem;
    margin-right: 10px;
}

.simple-log .log-success {
    color: #28a745;
}

.simple-log .log-error {
    color: #dc3545;
}

.simple-log .log-info {
    color: #17a2b8;
}

/* 步骤卡片 */
.step-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
}

.step-header h2 {
    font-size: 1.5rem;
    color: #333;
}

/* 上传容器 */
.upload-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    height: 300px; /* 固定高度 */
}

/* 上传区域 */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px; /* 固定高度，与容器一致 */
    box-sizing: border-box;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-placeholder svg {
    color: #667eea;
    margin-bottom: 15px;
}

.upload-placeholder p {
    font-size: 1.1rem;
    color: #666;
    margin: 5px 0;
}

.hint {
    font-size: 0.9rem;
    color: #999;
}

/* 按钮 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 状态消息 */
.status-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 方案列表 */
.schemes-list {
    margin-bottom: 20px;
}

.scheme-item {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scheme-item:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.scheme-item.selected {
    border-color: #667eea;
    background: #e8ebff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.scheme-item h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.scheme-segments {
    margin-top: 10px;
}

.segment-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.segment-item .segment-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.segment-item .segment-lines {
    color: #666;
    font-size: 0.85rem;
}

/* 剪辑列表 */
.clips-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.clip-item {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.clip-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.clip-item h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.clip-video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #000;
    aspect-ratio: 9 / 16;
    object-fit: contain;
}

.clip-actions {
    display: flex;
    gap: 10px;
}

.clip-item .btn-download {
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.clip-video {
    cursor: pointer;
}

.clip-video::-webkit-media-controls-play-button {
    background-color: rgba(102, 126, 234, 0.8);
    border-radius: 50%;
}

/* 上传预览区域 */
.upload-preview {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    height: 100%; /* 与上传区域高度一致 */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#upload-preview-container {
    height: 300px; /* 与上传区域高度一致 */
    display: flex;
    align-items: stretch;
}

.upload-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.upload-preview-title {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    flex: 1;
}

.upload-replace-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.upload-replace-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.upload-replace-btn:active {
    transform: translateY(0);
}

.upload-replace-btn svg {
    width: 16px;
    height: 16px;
}

.upload-replace-text {
    display: inline;
}

#upload-preview-video {
    width: 100%;
    border-radius: 8px;
    background: #000;
    flex: 1;
    cursor: pointer;
    object-fit: contain;
    min-height: 0; /* 允许flex收缩 */
}

.upload-preview-filename {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 响应式 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .step-card {
        padding: 20px;
    }
    
    .clips-list {
        grid-template-columns: 1fr;
    }
    
    /* 移动端：上传成功后隐藏拖拽框，预览区域全宽显示 */
    .upload-container.has-preview #upload-area {
        display: none !important;
    }
    
    .upload-container.has-preview #upload-preview-container {
        flex: 1 1 100% !important;
        width: 100%;
    }
    
    .upload-replace-text {
        display: none;
    }
    
    .upload-replace-btn {
        padding: 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
        align-items: center;
    }
    
    .upload-replace-btn svg {
        width: 18px;
        height: 18px;
    }
}

