/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    text-align: center;
}

h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 20px;
}

.upload-label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-label:hover {
    background-color: #0056b3;
}

#fileInput {
    display: none;
}

/* 压缩质量控制 */
.quality-control {
    margin-bottom: 20px;
}

.quality-control label {
    font-size: 14px;
    color: #555;
}

#quality {
    width: 60%;
    margin: 0 10px;
}

#qualityValue {
    font-size: 14px;
    color: #333;
}

/* 按钮组 */
.button-group {
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #28a745;
    color: #fff;
}

.btn-primary:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-secondary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 预览区域 */
.preview-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.preview-section img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* 图片预览项 */
.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.preview-item img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.preview-item .size-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 模态框样式 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9); /* 半透明黑色背景 */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    transition: transform 0.3s ease; /* 添加缩放动画 */
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

/* 模态框控制按钮 */
.modal-controls {
    position: absolute;
    top: 20px;
    left: 35px;
}

.modal-btn {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    color: #333;
    font-size: 20px;
    padding: 10px 15px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.modal-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}