/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 顶部标题区样式 */
header {
    text-align: center;
    padding: 2rem 1rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* 主要内容区样式 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 上传区域样式 */
.upload-container {
    background-color: #fff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.upload-container:hover {
    border-color: #2196f3;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 64px;
    height: 64px;
}

button {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background-color: #1976d2;
}

/* 预览区域样式 */
.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
}

.preview-box {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.preview-box h3 {
    color: #1d1d1f;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.image-preview {
    flex: 1;
    width: 100%;
    height: 400px;
    background-color: #f5f5f7;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-preview img:hover {
    transform: scale(1.02);
}

/* 压缩控制区样式 */
.compression-control {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compression-control label {
    display: block;
    color: #1d1d1f;
    font-weight: 500;
    margin-bottom: 1rem;
}

.size-tip {
    margin-top: 0.8rem;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

#maxSize, #originalSizeDisplay {
    color: #0066cc;
    font-weight: 500;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: #86868b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.max-size {
    color: #666;
}

#currentSize {
    color: #0066cc;
    font-weight: 500;
    margin-left: 8px;
}

/* 下载区域样式 */
.download-container {
    text-align: center;
    margin: 2rem auto;
    max-width: 1200px;
}

.download-btn {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background-color: #0077ed;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }

    .image-preview {
        height: 300px;
    }
}

/* 底部信息区样式 */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background-color: #fff;
    margin-top: 2rem;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

/* 图片预览模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    cursor: zoom-in;
}

.modal-content.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
}

.close-modal {
    position: fixed;
    right: 35px;
    top: 15px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #bbb;
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* 滑动条容器样式 */
.slider-container {
    margin: 20px 0;
    padding: 0 10px;
}

/* 滑动条基本样式 */
.size-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    outline: none;
    margin: 15px 0;
}

/* 滑动条滑块样式 */
.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* 滑块悬停效�� */
.size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.size-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* 滑动条标签样式 */
.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    color: #86868b;
    font-size: 0.9rem;
}

/* 当前大小显示样式 */
#currentSize {
    color: #0066cc;
    font-weight: 500;
    margin-left: 8px;
} 