/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 主要内容样式 */
main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 40px;
}

.upload-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-box {
    flex: 1;
    text-align: center;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-box h3 {
    margin-bottom: 15px;
    color: #555;
}

.upload-label {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-weight: bold;
}

.upload-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.upload-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

#sourceImage, #compareImage {
    display: none;
}

.image-canvas {
    margin-top: 20px;
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: none;
}

/* 控制区域样式 */
.controls {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

#compareBtn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

#compareBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

#compareBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.feature-type-control, .threshold-control, .area-control {
    display: inline-block;
    margin: 0 20px;
}

.feature-type-control label, .threshold-control label, .area-control label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background-color: white;
    cursor: pointer;
}

input[type="range"] {
    width: 200px;
    margin-right: 10px;
}

/* 结果区域样式 */
.result-section {
    text-align: center;
}

.result-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.result-container {
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.result-canvas {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: none;
}

#downloadBtn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#downloadBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

#downloadBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 底部样式 */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .upload-container {
        flex-direction: column;
    }
    
    .threshold-control, .area-control {
        display: block;
        margin: 15px 0;
    }
    
    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}