* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.upload-area:hover, .upload-area.drag-over {
    background-color: #e1f0fa;
    border-color: #2980b9;
}

.upload-icon {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-text {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.file-input {
    display: none;
}

.settings {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.setting {
    margin-bottom: 15px;
}

.setting:last-child {
    margin-bottom: 0;
}

.setting label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

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

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: white;
}

.quality-value {
    margin-left: 10px;
    font-weight: bold;
    color: #3498db;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.image-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    background-color: white;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-preview {
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-info {
    padding: 15px;
}

.filename {
    font-weight: bold;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.size-info {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.original-size, .compressed-size {
    display: block;
    margin-bottom: 5px;
}

.savings {
    font-weight: bold;
    color: #27ae60;
}

.image-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    flex: 1;
}

.btn-compress {
    background-color: #3498db;
}

.btn-download {
    background-color: #2ecc71;
}

.btn-download:hover {
    background-color: #27ae60;
}

.btn-remove {
    background-color: #e74c3c;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.setting-tip {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
    font-style: italic;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
    
    .images-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* 高亮显示JPG转PNG选项 */
#jpgToPngOption {
    background-color: #e1f5fe;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #03a9f4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(3, 169, 244, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(3, 169, 244, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(3, 169, 244, 0);
    }
}

/* 处理中状态样式 */
.image-item.processing {
    position: relative;
}

.image-item.processing::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* 添加响应式断点优化 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        margin-bottom: 10px;
        width: 100%;
    }
}

/* 针对Cloudflare CDN优化尺寸的加载动画 */
@media (prefers-reduced-motion: no-preference) {
    .upload-icon svg {
        transition: transform 0.3s ease;
    }
    
    .upload-area:hover .upload-icon svg {
        transform: translateY(-5px);
    }
}