* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.title {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.icon-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    width: 100%;
    height: 300px;
    border: 3px dashed #667eea;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9ff;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #5568d3;
    background: #f0f4ff;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.upload-placeholder {
    text-align: center;
    color: #667eea;
}

.upload-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 14px;
    color: #999;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    flex: 1;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* 加载提示 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #667eea;
    font-size: 16px;
}

/* 匹配结果 */
.match-result {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #667eea;
}

.result-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
}

.result-images {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.result-item {
    flex: 1;
    text-align: center;
}

.result-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.result-image {
    width: 100%;
    max-width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.similarity-indicator {
    flex: 0 0 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.similarity-bar {
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, #667eea 0%, #ffd700 50%, #ff69b4 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.similarity-text {
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 相似列表 */
.similar-list {
    margin-bottom: 30px;
}

.list-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.similar-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.similar-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    cursor: pointer;
}

.similar-item:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.similar-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.similar-item .similarity-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* 匹配记录 */
.match-records {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.records-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.record-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.record-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.record-user {
    font-size: 14px;
    color: #666;
    min-width: 100px;
}

.record-images {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #667eea;
}

.record-bar {
    width: 50px;
    height: 8px;
    background: linear-gradient(90deg, #667eea 0%, #ffd700 50%, #ff69b4 100%);
    border-radius: 4px;
}

.record-time {
    font-size: 12px;
    color: #999;
    min-width: 80px;
    text-align: right;
}

.record-empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.pair-upload {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pair-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pair-item label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.pair-item input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 10px;
    cursor: pointer;
}

.pair-preview {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 2px solid #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .result-images {
        flex-direction: column;
    }
    
    .similarity-indicator {
        flex: 1;
        width: 100%;
    }
    
    .similarity-bar {
        width: 100%;
    }
    
    .record-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .record-images {
        width: 100%;
    }
    
    .record-time {
        text-align: left;
    }
}
