body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Times New Roman', serif;
    user-select: none;
}





#canvas-container {
    width: 100vw;
    height: 100vh;
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
}

.header {
    padding: 30px;
    text-align: center;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

h1 {
    margin: 0;
    font-size: 2.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 2px solid #FFD700;
    display: inline-block;
    padding-bottom: 10px;
}

.status {
    margin-top: 15px;
    font-size: 1.1rem;
    color: #ccc;
    font-style: italic;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

.instructions {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: #eee;
    background: linear-gradient(135deg, rgba(10, 20, 10, 0.95), rgba(0, 0, 0, 0.9));
    padding: 20px;
    border: 1px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
    border-radius: 4px;
}

.instructions p {
    margin: 8px 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

b {
    color: #FFD700;
    margin-right: 5px;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFD700;
    font-size: 1.5rem;
    animation: pulse 1s infinite;
    z-index: 20;
    text-align: center;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

video {
    /* 原来的写法是 display: none; (这会让苹果手机罢工) */
    /* 请改成下面这样： */

    position: absolute;
    /* 绝对定位 */
    top: 0;
    left: 0;
    opacity: 0;
    /* 这里是关键：设为“透明”，而不是“不显示” */
    pointer-events: none;
    /* 让鼠标可以穿透它点击后面的东西 */
    z-index: -1;
    /* 把它放到最底层 */
}

/* 照片弹窗 */
#photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#photo-modal.show {
    display: flex;
}

#photo-modal img {
    max-width: 50%;
    max-height: 70%;
    border: 4px solid #FFD700;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    /* Initial state for animation */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#photo-modal .close-hint {
    color: #FFD700;
    font-size: 0.9rem;
    margin-top: 15px;
    animation: pulse 1s infinite;
}

/* Start Screen Overlay */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#start-btn {
    background: linear-gradient(135deg, #FFD700, #FFAA00);
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    color: #000;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 50px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Times New Roman', serif;
}

#start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

#start-btn:active {
    transform: scale(0.95);
}

#retry-cam {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 0, 0, 0.3);
    border: 1px solid #ff4444;
    color: #fff;
    padding: 8px 15px;
    cursor: pointer;
    z-index: 200;
    display: none;
    border-radius: 4px;
}

/* Loading Screen Improvements */
#progress-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 15px auto 10px;
    overflow: hidden;
    position: relative;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: width 0.2s ease-out;
    border-radius: 3px;
}

#progress-text {
    font-family: 'Courier New', Courier, monospace;
    color: #FFD700;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.1);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 控制按钮面板 */
#control-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    pointer-events: none;
}

#control-panel.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(20, 20, 20, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 25px;
    color: #FFD700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-family: 'Times New Roman', serif;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.95), rgba(30, 30, 30, 0.98));
    border-color: #FFD700;
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
}

.control-btn:active {
    transform: scale(0.95) translateX(-5px);
}

.control-btn.active {
    background: linear-gradient(135deg, #FFD700, #FFAA00);
    color: #000;
    border-color: #FFD700;
}

.btn-icon {
    font-size: 18px;
}

.btn-text {
    font-weight: bold;
    letter-spacing: 1px;
}

/* Toast通知 */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.toast-success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.toast-warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #D32F2F);
}

/* 移动端适配 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    .instructions {
        display: none;
    }

    #control-panel {
        bottom: 20px;
        right: 20px;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    #photo-modal img {
        max-width: 85%;
        max-height: 60%;
    }
}