/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 顶部标题区域 */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #86868b;
}

/* 主要内容区域 */
.main {
    background: white;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #d2d2d7;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #0071e3;
    background-color: rgba(0, 113, 227, 0.05);
}

.upload-inner {
    max-width: 400px;
    margin: 0 auto;
}

.upload-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: #86868b;
}

.file-input {
    display: none;
}

/* 加载状态指示器 */
.loading-indicator {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(0, 113, 227, 0.2);
    border-top-color: #0071e3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 错误提示区域 */
.error-message {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

/* 压缩设置区域 */
.settings {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f5f5f7;
    border-radius: 12px;
}

.quality-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quality-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: #d2d2d7;
    border-radius: 2px;
    outline: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #0071e3;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.quality-hint {
    font-size: 0.85rem;
    color: #86868b;
    margin-top: 0.5rem;
}

/* 预览区域 */
.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.preview-box {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 1.5rem;
}

.preview-box h3 {
    font-size: 1.1rem;
    color: #1d1d1f;
    margin-bottom: 1rem;
}

.image-container {
    width: 100%;
    min-height: 200px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.file-info {
    font-size: 0.9rem;
    color: #86868b;
}

/* 下载按钮区域 */
.download-area {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.download-btn {
    background: #0071e3;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #0077ed;
    transform: translateY(-1px);
}

.download-btn:active {
    transform: translateY(0);
}

.reset-btn {
    background: transparent;
    color: #0071e3;
    border: 1px solid #0071e3;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: rgba(0, 113, 227, 0.05);
}

/* 使用提示区域 */
.tips {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f5f5f7;
    border-radius: 12px;
}

.tips h3 {
    font-size: 1.1rem;
    color: #1d1d1f;
    margin-bottom: 1rem;
}

.tips ul {
    padding-left: 1.5rem;
}

.tips li {
    margin-bottom: 0.5rem;
    color: #515154;
    font-size: 0.95rem;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 3rem;
    color: #86868b;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2rem;
    }
    
    .download-area {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn, .reset-btn {
        width: 100%;
        max-width: 300px;
    }
}