:root {
    --primary: #2196F3;
    --secondary: #4CAF50;
    --background: #f8f9fa;
    --text: #2c3e50;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-upload {
    margin-bottom: 15px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.settings {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

input[type="range"] {
    width: 150px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    cursor: pointer;
}

#quality-value {
    min-width: 40px;
    text-align: right;
    font-weight: 500;
}

.previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.preview-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

canvas {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 15px;
    background: repeating-conic-gradient(#f5f5f5 0% 25%, white 0% 50%) 50%/20px 20px;
}

.info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.export-bar {
    text-align: center;
    margin-top: 30px;
}

.export-btn {
    background: #9C27B0;
    padding: 15px 50px;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .settings {
        grid-template-columns: 1fr;
    }
    
    .setting-group {
        flex-wrap: wrap;
    }
    
    input[type="range"] {
        width: 100%;
    }
}