		/* ==========================================================================
   1. 基础重置 
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    color: white;
}

/* ==========================================================================
   2. 核心布局
   ========================================================================== */
main#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1; 
}

canvas {
    display: block;
    /* 移动端全屏，PC端留边 */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持比例 */
    z-index: 10; 
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
}



/* ==========================================================================
   3. 左右面板样式
   ========================================================================== */
.left-panel {
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 85vw; /* 确保面板不会撑满屏幕 */
    position: absolute;
    left: 15px;
    top: 80px;
    bottom: 15px;
    width: 220px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.right-panel {
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 85vw; /* 确保面板不会撑满屏幕 */
    position: absolute;
    right: 15px;
    top: 80px;
    bottom: 15px;
    width: 220px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.panel-card {
    background: rgba(15, 15, 35, 0.95);
    border-radius: 15px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.panel-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #00d9ff;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.stat-value {
    font-family: monospace;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
    font-size: 16px;
}

.stat-label {
    color: #aaa;
    font-size: 14px;
}

.health-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0040, #ff6b00, #ffd700);
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
/* 商店 */
.shop-item {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 107, 0, 0.1) 100%);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px; /* 确保间距 */
}
/* 游戏说明 */
.game-info {
    background: rgba(15, 15, 35, 0.95);
    border-radius: 15px;
    padding: 15px;
    border: 2px solid rgba(0, 255, 100, 0.3);
    box-shadow: 0 8px 32px rgba(0, 255, 100, 0.2);
}

.game-info h3 {
    margin: 0 0 10px 0;
    color: #00ff64;
    text-shadow: 0 0 10px rgba(0, 255, 100, 0.5);
}

.game-info p {
    font-size: 12px;
    line-height: 1.6;
    opacity: 0.9;
}
/* 控制按钮 */
.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.control-button {
    padding: 10px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2) 0%, rgba(0, 150, 255, 0.2) 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(0, 217, 255, 0.3);
    text-align: center;
    font-size: 13px;
}

.control-button:hover {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.3) 0%, rgba(0, 150, 255, 0.3) 100%);
    border-color: #00d9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.3);
}

/* ==========================================================================
   4. 移动端遥感 (新增适配)
   ========================================================================== */
.joystick {
    position: fixed;
    bottom: 50px;
    left: 50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 5000; /* 高于画布，低于弹窗 */
    touch-action: none;

}

.joystick-handle {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 50px;
    height: 50px;
    background: rgba(0, 217, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* ==========================================================================
   5. 教程导航按钮
   ========================================================================== */

    .tutorial-nav-btn {
        padding: 8px 15px;
        background: rgba(0, 217, 255, 0.2);
        border: 1px solid rgba(0, 217, 255, 0.3);
        border-radius: 8px;
        color: white;
        cursor: pointer;
        transition: all 0.3s;
        margin: 5px;
    }
    
    .tutorial-nav-btn:hover {
        background: rgba(0, 217, 255, 0.3);
        transform: translateY(-2px);
    }
    
    /* 教程内容区 */
    .tutorial-content {
        background: rgba(15, 15, 35, 0.8);
        border-radius: 15px;
        padding: 20px;
        border: 1px solid rgba(0, 217, 255, 0.2);
    }
    
    /* 教程页面 */
    .tutorial-page {
        text-align: left;
    }
    
    /* 教程部分 */
    .tutorial-section {
        margin-bottom: 25px;
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .tutorial-section h4 {
        color: #00d9ff;
        margin-bottom: 15px;
    }
    
    /* 教程项目 */
    .tutorial-item {
        display: flex;
        align-items: flex-start;
        margin-bottom: 15px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
    }
    
    .tutorial-icon {
        font-size: 20px;
        margin-right: 15px;
        min-width: 40px;
        text-align: center;
    }
    
    .tutorial-text {
        flex: 1;
    }
    
    /* 危险项目 */
    .danger-item {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
        padding: 8px;
        background: rgba(255, 0, 0, 0.1);
        border-radius: 6px;
    }
    
    .danger-icon {
        font-size: 20px;
        margin-right: 15px;
    }
    
    .danger-text {
        flex: 1;
    }
    
    /* 提示框 */
    .tutorial-tip {
        background: rgba(255, 215, 0, 0.1);
        border: 1px solid rgba(255, 215, 0, 0.3);
        border-radius: 8px;
        padding: 12px;
        margin-top: 15px;
        font-weight: bold;
    }
    
    /* 商店项目教程样式 */
    .shop-item-tutorial {
        display: flex;
        align-items: flex-start;
        margin-bottom: 15px;
        padding: 12px;
        background: rgba(255, 215, 0, 0.1);
        border-radius: 8px;
        border: 1px solid rgba(255, 215, 0, 0.3);
    }
    
    .shop-icon {
        font-size: 24px;
        margin-right: 15px;
        min-width: 40px;
        text-align: center;
    }
    
    .shop-details {
        flex: 1;
    }
    
    /* 任务类型 */
    .task-type {
        background: rgba(0, 217, 255, 0.1);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .task-type h5 {
        color: #00ff64;
        margin-bottom: 8px;
    }
    
    .task-type ul {
        margin: 0;
        padding-left: 20px;
    }
    
    /* 难度表格 */
    .difficulty-table {
        width: 100%;
        border-collapse: collapse;
        margin: 15px 0;
    }
    
    .difficulty-table th,
    .difficulty-table td {
        padding: 8px;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .difficulty-table th {
        background: rgba(0, 217, 255, 0.2);
        color: #00d9ff;
    }
    
    .difficulty-table tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.05);
    }
    
    /* 皮肤预览 */
    .skin-preview {
        padding: 10px 15px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        text-align: center;
        font-weight: bold;
    }
    
    /* 分页指示器 */
    .page-indicator {
        padding: 5px 15px;
        background: rgba(0, 217, 255, 0.2);
        border-radius: 50px;
        font-weight: bold;
    }

/* ==========================================================================
   6. 其他原有样式 
   ========================================================================== */
/* 弹窗 */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.98) 0%, rgba(30, 30, 60, 0.98) 100%);
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.modal h2 {
    margin: 0 0 20px 0;
    font-size: 32px;
    text-shadow: 0 0 20px currentColor;
}

.game-over {
    border-color: #ff0040;
}

.victory {
    border-color: #00ff40;
}

.start-screen {
    border-color: #00d9ff;
}

.tutorial button {
    position: relative;
    z-index: 202;
    pointer-events: auto; 
}
/* 顶部信息栏 */
.top-bar {
	position: absolute;
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
	z-index: 101;
}

.level-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 12px 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    text-align: center;
    backdrop-filter: blur(10px);
}

.level-display h2 {
    font-size: 24px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.level-display .sub {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 3px;
}

button {
    background: linear-gradient(135deg, #ff6b00, #ff8c00);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
footer.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    font-size: 12px;
    z-index: 100;
}
/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.8);
}

/* ==========================================================================
   7. GM模式样式 - 已移出媒体查询，现在所有设备都生效
   ========================================================================== */
.gm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 20, 50, 0.98) 0%, rgba(40, 40, 80, 0.98) 100%);
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #8a2be2;
    box-shadow: 0 0 40px rgba(138, 43, 226, 0.5);
    z-index: 1000000; /* 确保最高层级 */
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    display: none; /* 默认隐藏 */
}

.gm-modal h2 {
    color: #8a2be2;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    margin-bottom: 20px;
    text-align: center;
}

.gm-control-group {
    margin-bottom: 15px;
}

.gm-control-group label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
    font-size: 14px;
}

.gm-input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    color: white;
    font-size: 16px;
}

.gm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.gm-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.gm-button.apply {
    background: linear-gradient(135deg, #8a2be2, #9b30ff);
    color: white;
}

.gm-button.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gm-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.gm-button.apply:hover {
    background: linear-gradient(135deg, #9b30ff, #a64dff);
}

.gm-button.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gm-status {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #0f0;
}

.gm-hotkey-hint {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: #8a2be2;
    z-index: 10000;
}

/* GM模式遮罩层 */
.gm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: none;
}

/* 确保其他模态框不会干扰GM模式 */
.modal {
    z-index: 200 !important; /* 保持较低，让GM模式可以覆盖 */
}

/* ==========================================================================
   8. 移动端响应式样式
   ========================================================================== */
/* 只针对移动端（屏幕宽度小于 1200px）的修改 */
@media (max-width: 1200px) {
    #joystick {
        display: block !important;
        background-color: rgba(0, 217, 255, 0.2) !important;
        border-color: rgba(0, 217, 255, 0.5) !important;
    }
}

	.left-panel {
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 85vw; /* 确保面板不会撑满屏幕 */
    position: absolute;
    left: 15px;
    top: 80px;
    bottom: 15px;
    width: 220px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
	}

	.right-panel {
		transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
		max-width: 85vw; /* 确保面板不会撑满屏幕 */
		position: absolute;
		right: 15px;
		top: 80;
		bottom: 15px;
		width: 220px;
		z-index: 50;
		display: flex;
		flex-direction: column;
		gap: 12px;
		overflow-y: auto;
	}
    .left-panel .panel-content, .right-panel .panel-content {
        display: none; /* 手机端默认折叠 */
    }

    /* 确保虚拟摇杆层级最高 */
    .joystick {
        z-index: 999;
        bottom: 50px;
        left: 50px;
    }
    footer.footer {
        bottom: 0;
        text-align: center;
        padding: 5px;
    }
}