* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #eaeaea;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* 上传区域样式 */
.upload-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.upload-container {
    width: 48%;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .upload-container {
        width: 100%;
    }
}

.upload-container h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.description {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.upload-area {
    border: 2px dashed #dcdde1;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative; /* 添加相对定位 */
}

.upload-area:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.upload-area.highlight {
    border-color: #3498db;
    background-color: #f8f9fa;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.upload-area i {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 15px;
    display: block;
}

.upload-area p {
    color: #7f8c8d;
}

/* 修改文件输入框样式，使其覆盖整个上传区域 */
.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.preview {
    margin-top: 20px;
    position: relative;
}

.preview img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background-color: rgba(231, 76, 60, 1);
}

/* 按钮样式 */
.action-section {
    text-align: center;
    margin-bottom: 40px;
}

.primary-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.primary-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.primary-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.secondary-btn:hover {
    background-color: #27ae60;
}

/* 结果区域样式 */
.result-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.result-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.result-container {
    position: relative;
    min-height: 200px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-image {
    text-align: center;
}

.result-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.result-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* 历史记录样式 */
.history-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.history-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.history-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #eaeaea;
}