* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

header:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
    transition: color 0.3s ease;
}

header:hover h1 {
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

header:hover p {
    color: white;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.upload-area.highlight {
    border-color: #2980b9;
    background-color: rgba(214, 234, 248, 0.8);
}

.upload-area.highlight:hover {
    background-color: rgba(214, 234, 248, 0.2);
}

.upload-icon {
    margin-bottom: 15px;
    color: #3498db;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: white;
}

.upload-btn {
    color: #3498db;
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-btn {
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.upload-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-info {
    color: rgba(255, 255, 255, 0.8);
}

.compression-section {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.compression-section:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.compression-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.compression-section:hover .compression-controls {
    background-color: rgba(255, 255, 255, 0.3);
}

.quality-control {
    display: flex;
    flex-direction: column;
    width: 60%;
    position: relative;
}

.quality-control label {
    margin-bottom: 5px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.compression-section:hover .quality-control label {
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.quality-control input {
    width: 100%;
}

.quality-progress {
    position: absolute;
    height: 8px;
    background-color: #3498db;
    border-radius: 5px;
    pointer-events: none;
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

/* 自定义滑块样式 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    transition: all 0.3s;
}

/* 滑块轨道样式 */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #d3d3d3;
    border-radius: 5px;
}

/* 滑块拖动部分样式 */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3498db; /* 蓝色滑块 */
    cursor: pointer;
    margin-top: -6px;
}

/* 滑块悬停效果 */
input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: #2980b9; /* 深蓝色 - 悬停效果 */
    box-shadow: 0 0 5px rgba(41, 128, 185, 0.5);
    transform: scale(1.1);
}

/* 滑块激活效果 */
input[type="range"]:active::-webkit-slider-thumb {
    background: #2980b9;
    transform: scale(1.2);
}

/* Firefox 滑块样式 */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #d3d3d3;
    border-radius: 5px;
}

input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

.compress-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.compress-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.compress-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.compression-section:hover .compress-btn {
    background-color: #2980b9;
    box-shadow: 0 0 10px rgba(41, 128, 185, 0.5);
}

.images-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.image-item {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.compression-section:hover .image-item {
    background-color: rgba(255, 255, 255, 0.3);
}

.image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    background-color: rgba(255, 255, 255, 0.9);
}

.compression-section:hover .image-item:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.image-preview {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    transition: all 0.3s ease;
}

.image-preview h3 {
    margin-bottom: 15px;
    text-align: center;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.compression-section:hover .image-preview h3 {
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.image-item:hover .image-preview h3 {
    color: #2c3e50;
    text-shadow: none;
}

.preview-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    background-color: white;
    transition: all 0.3s ease;
}

.compression-section:hover .preview-wrapper {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.5);
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.5s ease;
}

.file-info {
    font-size: 0.9rem;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.compression-section:hover .file-info {
    color: rgba(255, 255, 255, 0.9);
}

.image-item:hover .file-info {
    color: #7f8c8d;
}

.file-info p {
    margin-bottom: 5px;
}

.download-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: all 0.3s;
}

.download-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.download-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.batch-actions {
    margin-top: 30px;
    text-align: center;
}

.download-all-btn {
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.download-all-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.download-all-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-all-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

footer {
    margin-top: 50px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

footer:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 加载动画 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.compression-section:hover .loading-indicator {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 加载覆盖层 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.compression-section:hover .loading-overlay {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 成功上传动画 */
.upload-area.success {
    border-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
    animation: success-pulse 1s;
}

@keyframes success-pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* 脉冲动画 */
.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* 下载图标动画 */
.download-icon {
    display: inline-block;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 768px) {
    .image-preview-container {
        flex-direction: column;
    }
    
    .image-preview {
        min-width: 100%;
    }
    
    .compression-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .quality-control {
        width: 100%;
    }
}