

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

/* 加载屏幕 */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 游戏容器 */
#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 信息面板 */
#infoPanel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 2;
}

#playerStats, #controls {
    margin-bottom: 15px;
}

#playerStats h3, #controls h3 {
    margin-bottom: 5px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: left;
}

button:hover {
    background-color: #45a049;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 800px;
    position: relative;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
}

/* 通知系统 */
#notificationContainer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.notification {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    max-width: 300px;
    animation: fadeInOut 4s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* 战斗界面 */
#combatContent {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#playerCombatStats, #enemyCombatStats {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.health-bar {
    height: 20px;
    width: 100%;
    background-color: #ddd;
    border-radius: 3px;
    margin: 5px 0;
}

#playerHealthBar, #enemyHealthBar {
    height: 100%;
    width: 100%;
    background-color: #4CAF50;
    border-radius: 3px;
    transition: width 0.3s ease;
}

#enemyHealthBar {
    background-color: #f44336;
}

#combatLog {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

#combatOptions {
    display: flex;
    gap: 10px;
}

#combatOptions button {
    flex: 1;
    text-align: center;
}

/* 物品栏和任务样式 */
#inventoryContent, #questsContent {
    max-height: 400px;
    overflow-y: auto;
}

.inventory-item, .quest-item {
    padding: 10px;
    border: 1px solid #ddd;
    margin: 5px 0;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inventory-item:hover, .quest-item:hover {
    background-color: #f5f5f5;
}

.item-use-btn {
    background-color: #2196F3;
    padding: 3px 8px;
    font-size: 0.9em;
}

/* 发现效果 */
.discovery-effect {
    position: absolute;
    border-radius: 50%;
    border: 2px solid gold;
    opacity: 0.8;
    pointer-events: none;
    animation: expandDiscover 1.5s ease-out forwards;
}

@keyframes expandDiscover {
    0% { transform: scale(0); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

/* 地图控件 */
.map-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.map-controls button {
    flex: 1;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #infoPanel {
        width: 200px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    button {
        padding: 8px 12px;
        font-size: 14px;
    }

    #combatOptions {
        flex-direction: column;
    }
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* 地图放最底层 */
#bgMap {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 画布盖在地图上面 */
/* 强制把游戏画布提到最顶层 */
#gameCanvas {
    position: fixed;
    top: 0; left: 0;
    width:100%; height: 100%;
    background: transparent;

    /* 永远让点击事件“穿透”到下面去 */
    pointer-events: none;

    /* 不要把它抬太高，只要比地图（0）高就行 */
    z-index: 1;
}


/* loading 黑条也可固定定位 */
#loadingScreen{
    position:fixed;
    left:0;top:0;right:0;
    z-index:10;
}

