* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

html, body {
    height: 100%;
    background-color: #f5f7fa;
    background-image: url('../../页面图片/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #333;
}

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

/* 背景下的内容区域样式增强 */
.info-panel, .faces-gallery, .comparison-area, .features-comparison, .modal-content {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* 返回按钮 */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-btn:hover {
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

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

h1 {
    font-size: 2.2rem;
    color: #3b82f6;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #64748b;
}

/* 信息面板 */
.info-panel {
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.explanation-box {
    text-align: center;
}

.explanation-box h3 {
    color: #3b82f6;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.explanation-box p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #555;
}

/* 人脸选择区域 */
.faces-gallery {
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.faces-gallery h2 {
    text-align: center;
    color: #3b82f6;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.faces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    justify-items: center;
}

.face-card {
    width: 150px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.face-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.face-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.face-card.selected {
    border: 3px solid #3b82f6;
}

/* 比对区域 */
.comparison-area {
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.comparison-area h2 {
    text-align: center;
    color: #3b82f6;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.comparison-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.comparison-slot {
    width: 200px;
    height: 240px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto 20px;
}

.slot-placeholder {
    color: #94a3b8;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
}

.slot-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.slot-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.slot-image-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.comparison-slot.has-image .slot-placeholder {
    display: none;
}

.comparison-slot.has-image .slot-image-container {
    display: block;
}

.comparison-slot.drag-over {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.comparison-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    min-width: 200px;
}

#compare-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    width: 100%;
    max-width: 200px;
}

#compare-btn:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#compare-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.similarity-container {
    width: 100%;
    text-align: center;
}

.similarity-container h3 {
    margin-bottom: 15px;
    color: #3b82f6;
}

.similarity-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

#similarity-percentage {
    font-size: 2rem;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 10px;
}

.similarity-bar {
    width: 100%;
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.similarity-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 6px;
    transition: width 1s ease-in-out;
}

#similarity-comment {
    font-size: 0.9rem;
    color: #64748b;
}

/* 特征比对区域 */
.features-comparison {
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.features-comparison h2 {
    text-align: center;
    color: #3b82f6;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.feature-item {
    text-align: center;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.feature-item h3 {
    margin-bottom: 15px;
    color: #3b82f6;
    font-size: 1.2rem;
}

.feature-similarity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.feature-meter {
    flex-grow: 1;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
}

.feature-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 4px;
    width: 0%;
    transition: width 1s ease-in-out;
}

.feature-similarity span {
    font-weight: bold;
    color: #3b82f6;
    width: 50px;
    text-align: right;
}

/* 特征图像样式 */
.feature-images {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-bottom: 10px;
}

.feature-image-container {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.feature-image-container:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

.feature-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.feature-explanation {
    text-align: center;
    padding: 15px;
    background-color: #f1f5f9;
    border-radius: 10px;
}

.feature-explanation p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
}

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #3b82f6;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.next-btn svg {
    margin-left: 10px;
}

.next-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 加载指示器 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    font-size: 1.2rem;
    color: #64748b;
}

.hidden {
    display: none;
}

/* 教学弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: 0 auto;
    pointer-events: auto;
}

/* 当弹窗显示时的样式 */
.modal[style*="display: block"] {
    opacity: 1;
    visibility: visible;
}

.modal[style*="display: block"] .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.modal h2 {
    text-align: center;
    color: #3b82f6;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.facts-carousel {
    margin-bottom: 30px;
}

.fact-items {
    position: relative;
    height: 100px;
    margin-bottom: 20px;
}

.fact-item {
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s;
    text-align: center;
    padding: 15px;
    background-color: #f1f5f9;
    border-radius: 10px;
}

.fact-item.active {
    opacity: 1;
}

.fact-item p {
    font-size: 1.1rem;
    color: #334155;
    line-height: 1.6;
}

.fact-navigation {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.fact-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #e2e8f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fact-dot.active {
    background-color: #3b82f6;
}

.instructions-list {
    margin-bottom: 30px;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.instruction-icon {
    font-size: 2rem;
    margin-right: 20px;
    width: 40px;
    text-align: center;
}

.instruction-text h3 {
    color: #3b82f6;
    margin-bottom: 5px;
}

.instruction-text p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.5;
}

.action-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    width: 80%;
    max-width: 200px;
}

.action-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .comparison-container {
        flex-direction: column;
    }
    
    .comparison-slot {
        margin-bottom: 20px;
    }
    
    .comparison-controls {
        order: 3;
        width: 100%;
        padding: 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .faces-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .face-card {
        width: 120px;
        height: 150px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* 人脸操作区域 */
.faces-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.action-button.secondary {
    background-color: #94a3b8;
}

.action-button.secondary:hover {
    background-color: #64748b;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.action-button svg {
    width: 20px;
    height: 20px;
}

.image-count-info {
    font-size: 0.9rem;
    color: #64748b;
    margin-left: 10px;
}

/* 摄像头区域 */
.camera-container {
    background-color: #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.camera-preview-container {
    width: 100%;
    max-width: 500px;
    height: 375px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 15px;
}

/* 用户图片显示区域 */
.upload-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    background-color: #f1f5f9;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.upload-placeholder p {
    font-size: 1.1rem;
}

.user-face-card {
    width: 150px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.user-face-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.user-face-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.user-face-card.selected {
    border: 3px solid #3b82f6;
}

.user-face-card .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-face-card:hover .delete-btn {
    opacity: 1;
}

.user-face-card .delete-btn:hover {
    background-color: rgb(239, 68, 68);
}

.hidden {
    display: none !important;
} 