/* UI 全局容器 */
#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 999;
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.4);
    padding: 6px;
    border-radius: 30px;
    backdrop-filter: blur(8px); /* 磨砂玻璃效果 */
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* 图标按钮基础样式 */
#ui button {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.7);
    color: #666;
    font-size: 18px; /* 控制图标大小 */
    border-radius: 50%; /* 变成正圆形 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 鼠标悬停 */
#ui button:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.05);
}

/* 激活状态（当前选中的模式） */
#ui button.active {
    background: #A9A4FF; /* 梦幻紫主题色 */
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(169, 164, 255, 0.4);
}
/* ==================== 屏幕核心2D悬浮准心系统 ==================== */
#htmlCursor {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: rgba(169, 164, 255, 0.7); /* 治愈柔和紫 */
    border: 2px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none; /* 防止遮挡鼠标点击 */
    box-shadow: 0 0 8px rgba(169, 164, 255, 0.6);
    transition: all 0.2s ease;
}

/* 盯着物体时的“蓄力圈”融合态 */
#htmlCursor.fusing {
    width: 24px;
    height: 24px;
    background: rgba(169, 164, 255, 0.2);
    border: 2px solid #A9A4FF;
    animation: pulseLock 1.5s infinite linear;
}

/* 激活自动前行状态时的“箭头/扩散”动效 */
#htmlCursor.walking {
    width: 8px;
    height: 8px;
    background: #00FFCC; /* 变成灵动的青绿色代表在前行 */
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px #00FFCC;
}

@keyframes pulseLock {
    0% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(0.7); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
}
/* 强制场景始终撑满浏览器窗口 */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* 防止手机端出现滚动条 */
}

a-scene {
    display: block;
    width: 100vw;
    height: 100vh;
}
#joystick-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30%;
    height: 40%;
    z-index: 1000;
    pointer-events: none; /* 让摇杆容器不遮挡点击 */
}

/* 确保 nippejs 的触控区域能被点击 */
#joystick-container .nipple {
    pointer-events: auto;
}/* 底部统一控制栏 */
#controls-bar {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-around; /* 均匀分布 */
    align-items: center;
    z-index: 2000;
    pointer-events: none; /* 确保不阻挡底部其他操作 */
}

/* 所有按钮统一设置，确保可点击 */
.control-btn {
    pointer-events: auto;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #A9A4FF;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* 摇杆容器（左侧） */
#joystick-container {
    width: 120px;
    height: 120px;
    pointer-events: auto;
}