/* === 全局重置 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    color: #fff;
}

/* === 主画布 === */
#main-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* === 加载提示 === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content p {
    margin-top: 16px;
    font-size: 16px;
}

.loading-hint {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.6);
}

/* === Spinner 动画 === */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === 操作说明浮层 === */
#instructions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.instructions-content {
    background: #fff;
    color: #333;
    padding: 40px 48px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.instructions-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.instructions-content p {
    font-size: 18px;
    margin: 12px 0;
    line-height: 1.6;
}

.instructions-content .hint {
    font-size: 13px;
    color: #999;
    margin-top: 20px;
}

#start-btn {
    margin-top: 24px;
    padding: 12px 40px;
    font-size: 18px;
    background: linear-gradient(135deg, #4fc3f7, #0288d1);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(79, 195, 247, 0.4);
}

#start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(79, 195, 247, 0.6);
}

#start-btn:active {
    transform: scale(0.98);
}

/* === HUD 信息 === */
#hud {
    position: fixed;
    top: 10px;
    left: 10px;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    gap: 16px;
    pointer-events: none;
}

/* === QR码容器 === */
#qr-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

#qr-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    font-size: 22px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

#qr-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

#qr-popup {
    position: absolute;
    bottom: 54px;
    right: 0;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
}

#qr-popup p {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

#qr-canvas {
    display: block;
    margin: 0 auto;
}

/* === 移动端适配 === */
@media (max-width: 600px) {
    .instructions-content {
        padding: 28px 24px;
    }

    .instructions-content h2 {
        font-size: 20px;
    }

    .instructions-content p {
        font-size: 16px;
    }

    #start-btn {
        padding: 12px 32px;
        font-size: 16px;
    }

    #hud {
        font-size: 12px;
        gap: 10px;
    }

    .loading-content p {
        font-size: 14px;
    }

    #qr-container {
        display: none;
    }
}
