* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background: #000;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== 主题选择器 ===== */
.theme-switcher-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 165, 0, 0.8);
    border: 2px solid rgba(255, 200, 0, 0.8);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    z-index: 150;
}

.theme-switcher-btn:hover {
    background: rgba(255, 165, 0, 0.95);
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.theme-switcher-btn.active {
    background: rgba(255, 200, 0, 0.9);
}

.theme-selector-panel {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 50, 80, 0.95);
    border: 2px solid rgba(255, 165, 0, 0.6);
    border-radius: 12px;
    padding: 20px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 140;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.theme-selector-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.theme-selector-panel h2 {
    color: rgba(255, 200, 0, 1);
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(60, 100, 150, 0.6);
    border: 2px solid rgba(100, 160, 255, 0.4);
    border-radius: 8px;
    color: rgba(200, 220, 255, 0.95);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: bold;
    font-family: inherit;
}

.theme-option-btn:hover {
    background: rgba(80, 120, 170, 0.8);
    border-color: rgba(150, 190, 255, 0.7);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(100, 160, 255, 0.3);
}

.theme-option-btn .emoji {
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

.theme-option-btn .name {
    flex: 1;
}
.scene-selector {
    position: absolute;
    top: 90px;
    left: 20px;
    z-index: 100;
}

.scene-selector-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(70, 130, 180, 0.8);
    border: 2px solid rgba(100, 160, 255, 0.6);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.scene-selector-toggle:hover {
    background: rgba(70, 130, 180, 0.95);
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.scene-selector-toggle.active {
    background: rgba(100, 160, 255, 0.9);
}

.scene-list {
    position: absolute;
    top: 70px;
    left: 0;
    background: rgba(30, 50, 80, 0.95);
    border: 2px solid rgba(100, 160, 255, 0.4);
    border-radius: 8px;
    padding: 10px;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.scene-list.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scene-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(60, 100, 150, 0.6);
    border: 1px solid rgba(100, 160, 255, 0.3);
    border-radius: 5px;
    color: rgba(200, 220, 255, 0.9);
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-btn:hover {
    background: rgba(80, 120, 170, 0.8);
    border-color: rgba(150, 190, 255, 0.6);
    color: white;
    transform: translateX(5px);
}

.scene-btn.active {
    background: rgba(100, 160, 255, 0.8);
    border-color: rgba(200, 220, 255, 0.8);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(100, 160, 255, 0.5);
}

.scene-btn:last-child {
    margin-bottom: 0;
}

/* ===== 场景名称 ===== */
.scene-name {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(30, 50, 80, 0.8);
    color: rgba(200, 220, 255, 0.95);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    border-left: 4px solid rgba(100, 160, 255, 0.6);
    backdrop-filter: blur(5px);
}

/* ===== 控制按钮 ===== */
.controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 50;
}

.control-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(70, 130, 180, 0.8);
    border: 2px solid rgba(100, 160, 255, 0.6);
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.control-btn:hover {
    background: rgba(70, 130, 180, 0.95);
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

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

/* ===== Hotspots ===== */
#hotspots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    pointer-events: none;
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(100, 160, 255, 0.7),
                    0 0 20px rgba(100, 160, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(100, 160, 255, 0),
                    0 0 30px rgba(100, 160, 255, 0.8);
    }
}

/* 闪烁动画 */
@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(100, 160, 255, 0.8)) 
                drop-shadow(0 0 15px rgba(100, 160, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(100, 160, 255, 1)) 
                drop-shadow(0 0 25px rgba(100, 160, 255, 0.8));
    }
}

.portal-hotspot {
    position: absolute;
    width: 70px;
    height: 70px;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: all 0.2s ease;
    transform: translate(-50%, -50%) scale(1);
    border: 3px solid rgba(100, 160, 255, 0.8);
    border-radius: 50%;
    background: rgba(100, 160, 255, 0.15);
    backdrop-filter: blur(5px);
    
    /* 脉冲效果 */
    animation: pulse 2s infinite;
}

.portal-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    animation: glow 0.6s infinite;
    background: rgba(100, 160, 255, 0.25);
    border-color: rgba(100, 160, 255, 1);
}

.portal-hotspot.entrance {
    border-color: rgba(0, 200, 100, 0.8);
    background: rgba(0, 200, 100, 0.15);
    animation: pulse 2.5s infinite;
}

.portal-hotspot.entrance:hover {
    border-color: rgba(0, 200, 100, 1);
    background: rgba(0, 200, 100, 0.25);
    filter: drop-shadow(0 0 15px rgba(0, 200, 100, 1)) 
            drop-shadow(0 0 25px rgba(0, 200, 100, 0.8));
}

.portal-label {
    display: none;
}

/* ===== 调试信息 ===== */
.debug-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 50, 80, 0.85);
    border: 2px solid rgba(100, 160, 255, 0.4);
    border-radius: 8px;
    padding: 15px 20px;
    color: rgba(200, 220, 255, 0.95);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    z-index: 40;
    transition: background 0.3s ease;
    backdrop-filter: blur(5px);
}

.debug-info div {
    margin: 3px 0;
}

.debug-info span {
    color: rgba(150, 190, 255, 0.95);
    font-weight: bold;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .scene-selector-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .scene-list {
        top: 60px;
        min-width: 150px;
    }
    
    .scene-btn {
        padding: 10px 12px;
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .scene-name {
        font-size: 14px;
        padding: 8px 15px;
        right: 10px;
        top: 10px;
    }
    
    .controls {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .debug-info {
        font-size: 11px;
        padding: 10px 15px;
        max-width: 90vw;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .debug-info {
        display: none;
    }
}

/* ===== 滚动条美化 ===== */
.scene-list::-webkit-scrollbar {
    width: 6px;
}

.scene-list::-webkit-scrollbar-track {
    background: rgba(30, 50, 80, 0.5);
    border-radius: 3px;
}

.scene-list::-webkit-scrollbar-thumb {
    background: rgba(100, 160, 255, 0.5);
    border-radius: 3px;
}

.scene-list::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 160, 255, 0.8);
}
