* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* 顶部区域 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* 通用卡片样式 */
.upload-section, .params-section, .files-section, .results-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* 上传区域 */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.upload-area p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.hint {
    font-size: 0.9rem !important;
    color: #888 !important;
}

.upload-btn {
    margin-top: 16px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 参数区域 */
.params-section h2, .files-section h2, .results-section h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.param-group {
    display: flex;
    flex-direction: column;
}

.param-group label {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 6px;
}

.param-group select, .param-group input {
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.param-group select:focus, .param-group input:focus {
    outline: none;
    border-color: #667eea;
}

.param-group input[type="range"] {
    padding: 10px 0;
}

.param-group input[type="number"] {
    width: 120px;
}

#qualityValue {
    font-weight: bold;
    color: #667eea;
}

.convert-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.convert-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 文件列表 */
.files-container {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.file-item:hover {
    border-color: #667eea;
}

.file-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 1rem;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.8rem;
    color: #888;
}

.file-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-pending {
    background: #f0f0f0;
    color: #666;
}

.status-uploading {
    background: #e6f7ff;
    color: #1890ff;
}

.status-converting {
    background: #fff7e6;
    color: #fa8c16;
}

.status-success {
    background: #f6ffed;
    color: #52c41a;
}

.status-error {
    background: #fff2f0;
    color: #ff4d4f;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
}

.remove-btn:hover {
    color: #ff4d4f;
}

/* 结果区域 */
.results-container {
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e6f7ff;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fafafa;
}

.result-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 16px;
}

.result-info {
    flex: 1;
}

.result-name {
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
}

.result-size {
    font-size: 0.8rem;
    color: #888;
}

.download-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
}

.batch-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.download-all-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 底部区域 */
.footer {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.footer-content h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 8px;
}

.footer-content p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .upload-area {
        padding: 24px 16px;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
    
    .file-item, .result-item {
        flex-wrap: wrap;
    }
    
    .file-info, .result-info {
        margin-bottom: 10px;
        width: calc(100% - 60px);
    }
    
    .result-info {
        width: calc(100% - 76px);
    }
}