* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
}

.controls {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #5a6fd8;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.canvas-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.canvas-wrapper h3 {
    color: #555;
    font-size: 1.1rem;
    font-weight: 600;
}

canvas {
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    cursor: crosshair;
    background: #fafafa;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

canvas:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

#drawingCanvas {
    cursor: crosshair;
}

.button-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn, .clear-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.action-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.action-btn:active {
    transform: translateY(0);
}

.clear-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

.clear-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .controls {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .canvas-container {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    canvas {
        width: 280px;
        height: 280px;
    }
    
    .button-container {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn, .clear-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 5px;
    }
    
    canvas {
        width: 250px;
        height: 250px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
}