:root {
    --primary-color: #FF6B00;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --text-color: #333333;
    --border-radius: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background-color: var(--card-background);
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.upload-area:hover {
    background-color: rgba(0, 122, 255, 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    fill: var(--primary-color);
    margin-bottom: 1rem;
}

.compression-controls {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.preview-section {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.preview-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.preview-box {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    margin: 10px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-box:hover {
    transform: translateY(-2px);
}

.preview-box img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 10px;
}

.download-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-btn:hover {
    background-color: #E65D00;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .preview-container {
        flex-direction: column;
    }
    
    .preview-box {
        width: 100%;
        max-width: 100%;
    }
}

/* 添加拖拽反馈样式 */
.upload-area.dragover {
    background-color: rgba(0, 122, 255, 0.1);
    border-color: #0056b3;
    transform: scale(1.02);
}

/* 添加进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* 添加预览对样式 */
.preview-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

/* 错误消息样式 */
.error-message {
    background-color: #FF4D4F;
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    text-align: center;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: var(--shadow);
    animation: slideDown 0.3s ease;
}

/* 图片信息样式优化 */
.image-details {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* 进度条样式优化 */
.progress-bar {
    margin: 1rem 0;
    background: #f5f5f7;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .preview-pair {
        grid-template-columns: 1fr;
    }
}

/* 添加上传提示样式 */
.upload-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* 调整错误容器样式 */
#errorContainer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}