* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px 30px;
}

.upload-area {
    border: 3px dashed #333;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f5f5f5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #000;
    background: #e8e8e8;
}

.upload-area.dragover {
    border-color: #000;
    background: #d0d0d0;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #000;
    stroke-width: 2;
}

.upload-area h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
}

#fileInput {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    pointer-events: all;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.settings-panel {
    margin-top: 30px;
    padding: 25px;
    background: #f5f5f5;
    border-radius: 15px;
    border: 1px solid #ddd;
}

.settings-panel h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3em;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.setting-item label {
    font-weight: 600;
    color: #555;
    min-width: 150px;
}

.setting-item input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: none;
}

.setting-item input[type="number"] {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

.setting-item input[type="number"]:focus {
    border-color: #000;
}

.setting-item select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.setting-item select:focus {
    border-color: #000;
}

#qualityValue {
    font-weight: 600;
    color: #000;
    min-width: 50px;
    text-align: right;
}

.compress-btn {
    width: 100%;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.compress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.compress-btn:active {
    transform: translateY(0);
}

.results {
    margin-top: 30px;
}

.result-item {
    background: #f5f5f5;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.result-header h4 {
    color: #333;
    font-size: 1.1em;
}

.file-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #666;
}

.file-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .comparison {
        grid-template-columns: 1fr;
    }
}

.image-preview {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.image-preview p {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.compression-stats {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #000;
    display: block;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.download-btn {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #000;
    font-size: 1.2em;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #ddd;
}

.success-badge {
    display: inline-block;
    background: #000;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

