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

html, body {
    height: 100%;
    width: 100%;
}

body {
    background-color: #f0f5ff;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('../../页面图片/background.png');
    background-size: cover;
    background-position: center;
}

.container {
    width: 100%;
    max-width: 1100px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
}

h1 {
    color: #5ba8cc;
    margin-bottom: 5px;
    font-size: 2.3rem;
}

.subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

h2 {
    color: #5ba8cc;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

p {
    color: #333;
    margin-bottom: 15px;
    font-size: 1rem;
}

.game-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.face-detection-area {
    flex: 1;
    min-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(238, 242, 255, 0.5);
    border-radius: 15px;
    padding: 20px;
}

#input-area {
    width: 500px;
    height: 375px;
    position: relative;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

#video-container, #image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#video, #uploaded-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #eee;
}

#video-overlay, #image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    background-color: #5ba8cc;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #5ba8cc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 76, 221, 0.3);
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    filter: brightness(0) invert(1);
}

.file-input-wrapper {
    position: relative;
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

#faces-container {
    display: none;
}

.face-item {
    display: none;
}

.face-display {
    width: 100%;
    height: auto;
    max-width: 300px;
    margin: 15px auto;
    text-align: center;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-face {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    background-color: rgba(255, 255, 255, 0.8);
    object-fit: contain;
    display: block;
}

.face-display:empty::before,
.face-display.empty::before {
    content: '在这里显示检测到的人脸';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #777;
    font-size: 0.9rem;
    text-align: center;
    width: 80%;
}

#result-message {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    font-size: 0.95rem;
    color: #666;
}

.navigation {
    display: none;
}

.nav-btn, .home-btn {
    display: none;
}

#loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

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

.hidden {
    display: none !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #5ba8cc;
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.step-number {
    width: 30px;
    height: 30px;
    background-color: #5ba8cc;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-shrink: 0;
}

.modal-note {
    font-style: italic;
    color: #888;
    font-size: 0.9rem;
    margin-top: 15px;
}

@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .face-detection-area, .result-area {
        min-width: auto;
        width: 100%;
    }
    
    #input-area {
        width: 100%;
        max-width: 500px;
        height: auto;
        aspect-ratio: 4/3;
    }
    
    #video, #uploaded-image, #video-overlay, #image-overlay {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
}

/* 更新返回按钮样式 */
.back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #5ba8cc;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    background-color: #5ba8cc;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 76, 221, 0.3);
}

/* 更新下一页按钮样式 */
.next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6e8efb, #5ba8cc);
    color: white;
    text-decoration: none;
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    margin: 20px auto;
    transition: all 0.3s ease;
    max-width: 180px;
    box-shadow: 0 6px 20px rgba(74, 76, 221, 0.25);
    position: relative;
    overflow: hidden;
}

.next-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    border-radius: 50px;
}

.next-btn:hover {
    background: linear-gradient(135deg, #5d7eee, #5ba8cc);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 76, 221, 0.4);
}

.next-btn svg {
    transition: transform 0.3s ease;
}

.next-btn:hover svg {
    transform: translateX(5px);
}

.face-display:not(:empty):has(img[src=""]) #main-face {
    display: none;
}

#main-face[src=""] {
    display: none;
} 