* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.upload-section {
    text-align: center;
    margin-bottom: 40px;
}

.upload-btn {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.upload-hint {
    margin-top: 15px;
    color: white;
    font-size: 14px;
    opacity: 0.9;
}

.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.image-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}

.original-image, .processed-image {
    flex: 1;
    text-align: center;
}

.original-image h3, .processed-image h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

canvas {
    border: 2px solid #ddd;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: bold;
    color: #555;
    min-width: 100px;
}

.control-group input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.control-group select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.color-preview {
    width: 60px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #0066CC;
    display: inline-block;
    vertical-align: middle;
}

.control-group input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.control-group span {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
}

.control-hint {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: -10px;
    margin-bottom: 15px;
}

.process-btn, .download-btn, .test-btn, .quick-test-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.process-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    grid-column: 1 / -1;
    margin-bottom: 15px;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.test-btn {
    background: linear-gradient(45deg, #ffa726, #ff7043);
    color: white;
    grid-column: 1 / -1;
    margin-bottom: 15px;
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.quick-test-btn {
    background: linear-gradient(45deg, #26a69a, #4db6ac);
    color: white;
    grid-column: 1 / -1;
    margin-bottom: 15px;
}

.quick-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.download-btn {
    background: linear-gradient(45deg, #56ab2f, #a8e6cf);
    color: white;
    grid-column: 1 / -1;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.instructions {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.instructions h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.instructions ol {
    padding-left: 20px;
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 10px;
    color: #555;
}

@media (max-width: 768px) {
    .image-container {
        flex-direction: column;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .control-group label {
        min-width: auto;
    }
}
