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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #F5F5F5;
    color: #333333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 标题 */
h1 {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #333333;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.2;
}

h1 .title-en {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #333333;
}

h1 .title-cn {
    font-size: 28px;
    font-weight: 700;
    color: #333333;
}

/* 上传区域 */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.upload-area {
    background: white;
    border: 2px dashed #CCCCCC;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #007AFF;
    background-color: #F8F9FA;
}

.upload-area.dragover {
    border-color: #007AFF;
    background-color: #E8F4FD;
}

.upload-area h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 20px;
}

.upload-btn {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background-color: #0056CC;
}

.upload-btn:active {
    background-color: #004499;
}

.upload-hint {
    margin-top: 15px;
    color: #666666;
    font-size: 14px;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #F0F0F0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-info span {
    font-size: 14px;
    color: #333333;
}

/* 操作区域 */
.action-section {
    text-align: center;
    margin-bottom: 30px;
}

.process-btn {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 80%;
    max-width: 400px;
    height: 50px;
}

.process-btn:hover:not(:disabled) {
    background-color: #0056CC;
}

.process-btn:disabled {
    background-color: #CCCCCC;
    cursor: not-allowed;
}

.process-btn:active:not(:disabled) {
    background-color: #004499;
}

/* 状态显示 */
.status-section {
    text-align: center;
    margin-bottom: 30px;
}

.status-text {
    font-size: 16px;
    color: #666666;
}

.status-text.processing {
    color: #007AFF;
}

.status-text.success {
    color: #28A745;
}

.status-text.error {
    color: #DC3545;
}

.status-text.info {
    color: #2196F3;
}

/* 上传进度条 */
.upload-progress-container {
    margin-top: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    text-align: center;
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

/* 下载区域 */
.download-section {
    margin-top: 20px;
    text-align: center;
}

.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 240px;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.download-btn:hover:not(:disabled) {
    background-color: #45a049;
}

.download-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.download-btn .btn-status {
    font-size: 18px;
}

.download-btn .btn-text {
    font-weight: 500;
}

/* 视频结果区域 */
.video-result {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-result h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 15px;
}

.video-preview-container {
    margin-bottom: 15px;
    text-align: center;
}

.video-preview-container video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: #000;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 240px;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.preview-btn:hover:not(:disabled) {
    background-color: #1976D2;
}

.preview-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.preview-btn .btn-status {
    font-size: 18px;
}

.preview-btn .btn-text {
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    h1 {
        margin-bottom: 30px;
    }
    
    h1 .title-en {
        font-size: 24px;
    }
    
    h1 .title-cn {
        font-size: 24px;
    }
    
    /* 如果屏幕足够宽，尝试一行显示 */
    @media (min-width: 360px) {
        h1 {
            flex-direction: row;
            justify-content: center;
            align-items: baseline;
            gap: 8px;
        }
        
        h1 .title-en {
            font-size: 22px;
        }
        
        h1 .title-cn {
            font-size: 22px;
        }
    }
    
    /* 更宽的屏幕，一行显示，调整间距 */
    @media (min-width: 400px) {
        h1 {
            gap: 10px;
        }
        
        h1 .title-en {
            font-size: 24px;
        }
        
        h1 .title-cn {
            font-size: 24px;
        }
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    /* 手机端按钮优化：最小触摸区域44x44px（Apple HIG标准） */
    .upload-btn,
    .process-btn,
    .download-btn,
    .preview-btn {
        width: 95%;
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px; /* 防止iOS自动缩放 */
        -webkit-tap-highlight-color: rgba(0, 122, 255, 0.3); /* iOS触摸反馈 */
    }
    
    .video-preview-container video {
        max-width: 100%;
        max-height: 300px;
    }
    
    /* 手机端错误提示优化 */
    .status-text.error {
        font-size: 14px;
        line-height: 1.5;
        padding: 10px;
        background-color: #fff3cd;
        border-radius: 4px;
        white-space: pre-wrap;
        word-wrap: break-word;
        max-height: 200px;
        overflow-y: auto;
        text-align: left;
    }
    
    /* 手机端信息提示优化 */
    .status-text.info {
        font-size: 14px;
        line-height: 1.5;
        padding: 10px;
        background-color: #d1ecf1;
        border-radius: 4px;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

