/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 商店横排样式 */
.shop-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.shop-item {
    flex: 1 0 calc(25% - 15px);
    border: 1px solid #d4af37;
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    min-width: 150px;
    color: #d4af37;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
    color: #d4af37;
}

.shop-refresh-info {
    color: #d4af37;
    font-size: 14px;
}

/* 武功修炼样式 */
.martial-arts-section {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #d4af37;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #d4af37;
    display: flex;
    flex-direction: column;
}

.martial-art-category {
    margin-bottom: 15px;
}

.martial-art-category h4 {
    margin-bottom: 10px;
    color: #d4af37;
    font-size: 16px;
    border-bottom: 1px solid #8b7355;
    padding-bottom: 5px;
}

.martial-art-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.martial-art-item {
    padding: 10px;
    width: 180px; /* 短竖列宽度 */
    border: 1px solid #8b7355;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    color: #d4af37;
    box-sizing: border-box;
    flex-shrink: 0;
}

.martial-art-item h4 {
    margin-top: 0;
    color: #d4af37;
}

/* 武功分类标签样式 */
.martial-art-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #8b7355;
}

.martial-art-tab {
    padding: 8px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    color: #000000;
    border: 1px solid #8b7355;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'SimSun', serif;
}

.martial-art-tab:hover {
    background-color: rgba(139, 115, 85, 0.3);
    transform: translateY(-1px);
}

.martial-art-tab.active {
    background-color: rgba(139, 115, 85, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

.martial-art-tab-content {
    min-height: 100px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0 5px 5px 5px;
    border: 1px solid #8b7355;
    border-top: none;
}

.practice-status-item {
    padding: 10px;
    border: 1px solid #8b7355;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    color: #d4af37;
}

.practicing {
    color: #00ff00;
    font-weight: bold;
}

.experience-bar {
    width: 100%;
    height: 10px;
    background-color: #ddd;
    border-radius: 5px;
    margin: 5px 0;
    overflow: hidden;
}

.experience-progress {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.empty-message {
    color: #8b7355;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e6e6e6;
    line-height: 1.2;
    overflow-x: hidden;
    font-size: 12px;
    overflow-y: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    height: 100vh;
    overflow-y: auto;
}

/* 头部样式 */
.game-header {
    text-align: center;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid #d4af37;
}

.game-header h1 {
    color: #d4af37;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 人物属性和装备左右分区 */
.character-section {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.character-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.equipment-section {
    width: 300px; /* 设置装备栏固定宽度 */
}

/* 玩家信息 */
.player-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid #d4af37;
}

.level-info, .health-info {
    display: flex;
    gap: 10px;
}

/* 玩家属性 */
.player-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid #d4af37;
}

.stat-item {
    padding: 2px 5px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 11px;
}

/* 战斗属性 */
.combat-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid #d4af37;
}

.dps-info, .gold-info {
    font-size: 1em;
    font-weight: bold;
}

.dps-info {
    color: #ff6b6b;
}

.gold-info {
    color: #ffd93d;
}

/* 装备部分 */
.equipment-section {
    margin-bottom: 5px;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.equipment-section h2 {
    text-align: center;
    margin-bottom: 5px;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 3px;
    font-size: 14px;
}

.equipment-slots {
    display: flex;
    justify-content: space-around;
    gap: 5px;
}

.equipment-slot {
    flex: 1;
    text-align: center;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid #d4af37;
    font-size: 11px;
    min-height: 50px;
}

.equipment-item {
    margin-top: 5px;
    padding: 3px;
    background: rgba(255, 217, 61, 0.2);
    border-radius: 5px;
    color: #ffd93d;
    font-weight: bold;
    font-size: 10px;
}

/* 地图区域 */
.map-section {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    position: relative;
}

.map-container {
    position: relative;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400"><defs><linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:#d2b48c;stop-opacity:1" /><stop offset="50%" style="stop-color:#8b4513;stop-opacity:0.8" /><stop offset="100%" style="stop-color:#2f4f4f;stop-opacity:1" /></linearGradient></defs><rect width="800" height="400" fill="url(%23bg)" /><path d="M100,100 Q200,50 300,100 T500,100" stroke="#8b7355" stroke-width="3" fill="none" /><path d="M50,200 Q150,150 250,200 T450,200" stroke="#8b7355" stroke-width="3" fill="none" /><circle cx="150" cy="150" r="10" fill="#228B22" /><circle cx="350" cy="150" r="15" fill="#8B4513" /><circle cx="250" cy="250" r="8" fill="#228B22" /><text x="150" y="140" font-family="SimSun" font-size="14" fill="#ffffff" text-anchor="middle">光明顶</text><text x="350" y="130" font-family="SimSun" font-size="14" fill="#ffffff" text-anchor="middle">华山派</text><text x="250" y="240" font-family="SimSun" font-size="14" fill="#ffffff" text-anchor="middle">少林寺</text><text x="50" y="30" font-family="SimSun" font-size="16" fill="#ffffff">西</text><text x="750" y="30" font-family="SimSun" font-size="16" fill="#ffffff">东</text><text x="50" y="380" font-family="SimSun" font-size="16" fill="#ffffff">南</text><text x="750" y="380" font-family="SimSun" font-size="16" fill="#ffffff">北</text></svg>');
    background-size: cover;
    background-position: center;
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 5px;
    height: 200px; /* 调整高度以适应垂直布局 */
    overflow: hidden;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    z-index: 0;
}

.map-enemy {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(139, 69, 19, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #d4af37;
    font-size: 9px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    background-image: radial-gradient(circle, rgba(255,215,0,0.3) 0%, rgba(139,69,19,0) 70%);
    z-index: 10;
}

.map-enemy:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    border-color: #ffd700;
}

.enemy-level {
    font-weight: bold;
    color: #ffd700;
    font-size: 0.9em;
    margin-bottom: 3px;
    text-shadow: 1px 1px 2px #000;
    font-family: 'SimSun', serif;
    display: none; /* 默认隐藏等级显示 */
}

.map-enemy.show-level .enemy-level {
    display: block; /* 点击时显示等级 */
}

.enemy-icon {
    font-size: 2em;
    text-shadow: 2px 2px 3px #000;
    animation: float 2s infinite ease-in-out;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

.combat-icon {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #ff0000;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

/* 区域标记样式 */
.region-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.region-name {
    background-color: rgba(0, 0, 0, 0.7);
    color: #d4af37;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #d4af37;
    font-family: 'SimSun', serif;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.region-level {
    background-color: rgba(0, 0, 0, 0.7);
    color: #4CAF50;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #4CAF50;
    font-family: 'SimSun', serif;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    margin-top: 3px;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

/* 敌人战斗选项 */
.enemy-options {
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    color: #fff;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    text-align: center;
}

.enemy-options h3 {
    color: #d4af37;
    margin-bottom: 20px;
}

/* 副本区域 */
.dungeon-section {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.dungeon-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
}

.dungeons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dungeon {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid #d4af37;
    transition: all 0.3s ease;
}

.dungeon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

/* 商店部分 */
.shop-section {
    margin-bottom: 30px;
}

.shop-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.shop-item {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid #d4af37;
    font-size: 12px;
}

.shop-item span {
    display: block;
    margin-bottom: 5px;
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 5px;
}

.map-section {
    flex: 1; /* 让地图区域占据一定高度 */
}

/* 系统消息 */
.system-messages {
    margin-bottom: 5px;
    max-height: 60px;
    overflow-y: auto;
    font-size: 11px;
    position: relative;
}

.system-messages h2 {
    text-align: center;
    margin-bottom: 3px;
    color: #d4af37;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 2px;
    font-size: 12px;
}

/* 战斗信息区域 */
.combat-section {
    flex: 1; /* 让战斗信息区域也占据一部分高度 */
    padding: 10px;
    border: 1px solid #FFD700;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    margin-right: 0;
    margin-top: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.combat-section h2 {
    text-align: center;
    margin-bottom: 3px;
    color: #d4af37;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 2px;
    font-size: 12px;
}

#messages {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #d4af37;
    height: 230px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

/* 战斗动画容器 */
#battle-animation-container {
    width: 100%;
    height: 350px;
    background-color: #1a1a2e;
    background-image: linear-gradient(45deg, #2c3e50 25%, transparent 25%), 
                      linear-gradient(-45deg, #2c3e50 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #2c3e50 75%), 
                      linear-gradient(-45deg, transparent 75%, #2c3e50 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 3px solid #4a4a6a;
}

/* 战斗双方区域 */
.battle-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 35%;
    height: 100%;
}

/* 精灵名称 */
.sprite-name {
    color: #ffcc00;
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
}

/* VS容器 */
.vs-container {
    width: 30%;
    text-align: center;
}

/* VS文本 */
#versus-text {
    font-size: 36px;
    color: #ff6600;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* 角色精灵 */
.battle-sprite {
    font-size: 64px;
    transition: transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

/* 玩家精灵 */
.player-sprite {
    transform: scaleX(-1); /* 翻转玩家精灵，使其面向敌人 */
}

/* 敌人精灵 */
.enemy-sprite {
    transform: scaleX(1);
}

/* 地面效果层 */
#ground-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.attack-range {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid #ffd700;
    border-radius: 50%;
    opacity: 0.6;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
    display: none;
}

.ground-aura {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(135, 206, 235, 0.3) 0%, rgba(135, 206, 235, 0) 70%);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: rotate 4s linear infinite;
    display: none;
}

/* 血量条 */
.health-bar {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    border: 2px solid #555;
    overflow: hidden;
    z-index: 20;
}

.health-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 100%;
    transition: width 0.3s ease-in-out;
}

/* 战斗特效层 */
#battle-effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* 战斗特效 */
.battle-effect {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

/* 剑气特效 */
.sword-effect {
    width: 60px;
    height: 8px;
    background: linear-gradient(90deg, transparent, #00ccff, transparent);
    border-radius: 4px;
    top: 50%;
    left: 25%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px #00ccff, 0 0 20px rgba(0, 204, 255, 0.5);
}

@keyframes swordSlash {
    0% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(0) scaleX(0); 
    }
    50% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(150px) scaleX(3); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-50%) translateX(300px) scaleX(5); 
    }
}

/* 拳风特效 */
.fist-effect {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #ff6600 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 25%;
    transform: translateY(-50%);
    box-shadow: 0 0 20px #ff6600;
}

@keyframes fistPunch {
    0% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(0) scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: translateY(-50%) translateX(150px) scale(1.2); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-50%) translateX(300px) scale(0.5); 
    }
}

/* 棍法特效 */
.staff-effect {
    width: 8px;
    height: 80px;
    background: linear-gradient(180deg, transparent, #00ff88, transparent);
    border-radius: 4px;
    top: 50%;
    left: 25%;
    transform: translateY(-50%) rotate(0deg);
    box-shadow: 0 0 10px #00ff88;
}

@keyframes staffSwing {
    0% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(0) rotate(0deg); 
    }
    25% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(100px) rotate(-45deg); 
    }
    50% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(200px) rotate(0deg); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-50%) translateX(300px) rotate(45deg); 
    }
}

/* 匕首特效 */
.dagger-effect {
    width: 40px;
    height: 6px;
    background: linear-gradient(90deg, transparent, #ff00ff, transparent);
    border-radius: 3px;
    top: 50%;
    left: 25%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px #ff00ff;
}

@keyframes daggerStab {
    0% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(0) scaleX(0.8); 
    }
    30% { 
        opacity: 1; 
        transform: translateY(-50%) translateX(100px) scaleX(1.2); 
    }
    60% { 
        opacity: 0.8; 
        transform: translateY(-50%) translateX(200px) scaleX(0.9); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-50%) translateX(300px) scaleX(0.5); 
    }
}

/* 闪电特效 */
.lightning-effect {
    width: 200px;
    height: 200px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 0 L60 30 L40 40 L60 50 L30 70 L50 100" stroke="white" stroke-width="3" fill="none"/></svg>') center/contain no-repeat;
    filter: drop-shadow(0 0 10px #00FFFF);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes lightningStrike {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg); 
    }
    30% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1) rotate(-5deg); 
    }
    70% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.1) rotate(3deg); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg); 
    }
}

/* 光环特效 */
.aura-effect {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(255, 215, 0, 0) 70%);
    border: 3px solid rgba(255, 215, 0, 0.8);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes auraPulse {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(1.8); 
    }
}

/* 冲击特效 */
.impact-effect {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #FF6B6B;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes impactWave {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(0.5); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(3); 
    }
}

@keyframes rotate {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg); 
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg); 
    }
}

@keyframes pulse {
    0% { 
        opacity: 0.6; 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
    100% { 
        opacity: 0.6; 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* 暴击特效 */
.crit-effect {
    position: absolute;
    top: 30%;
    right: 25%;
    font-size: 36px;
    color: #ff0000;
    font-weight: bold;
    text-shadow: 0 0 10px #ff0000, 0 0 20px rgba(255, 0, 0, 0.8);
}

@keyframes critAnimation {
    0% { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5) translateY(-20px); 
    }
    100% { 
        opacity: 0; 
        transform: scale(2) translateY(-40px); 
    }
}

/* 伤害数值显示 */
.damage-display {
    position: absolute;
    top: 30%;
    right: 25%;
    font-size: 24px;
    color: #ff3333;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
}

/* 技能名称显示 */
.skill-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #87CEEB;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px #87CEEB;
    opacity: 0;
    z-index: 30;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 15px;
    border-radius: 20px;
    border: 2px solid #87CEEB;
}

@keyframes skillNameShow {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-10px); 
    }
    20% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    80% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(10px); 
    }
}

@keyframes damagePopup {
    0% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: translateY(-30px) scale(1.2); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-60px) scale(0.8); 
    }
}

/* 战斗动画 */
@keyframes attackAnimation {
    0% { transform: translateX(0) scaleX(1); }
    50% { transform: translateX(-20px) scaleX(1.1); }
    100% { transform: translateX(0) scaleX(1); }
}

@keyframes hitAnimation {
    0% { transform: translateX(0) scaleX(1); color: white; }
    25% { transform: translateX(5px) scaleX(1); color: #FF4444; }
    50% { transform: translateX(-5px) scaleX(1); color: #FF4444; }
    75% { transform: translateX(5px) scaleX(1); color: #FF4444; }
    100% { transform: translateX(0) scaleX(1); color: white; }
}

@keyframes victoryAnimation {
    0% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-15px) scale(1.2); }
    50% { transform: translateY(0) scale(1.1); }
    75% { transform: translateY(-10px) scale(1.2); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes defeatAnimation {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    25% { transform: translateY(10px) rotate(5deg); opacity: 0.8; }
    50% { transform: translateY(20px) rotate(-5deg); opacity: 0.6; }
    75% { transform: translateY(30px) rotate(3deg); opacity: 0.4; }
    100% { transform: translateY(40px) rotate(0deg); opacity: 0.2; }
}

@keyframes enemyAttackAnimation {
    0% { transform: translateX(0) scaleX(1); }
    50% { transform: translateX(20px) scaleX(1.1); }
    100% { transform: translateX(0) scaleX(1); }
}

@keyframes playerHitAnimation {
    0% { transform: translateX(0) scaleX(1); color: white; }
    25% { transform: translateX(-5px) scaleX(1); color: #FF4444; }
    50% { transform: translateX(5px) scaleX(1); color: #FF4444; }
    75% { transform: translateX(-5px) scaleX(1); color: #FF4444; }
    100% { transform: translateX(0) scaleX(1); color: white; }
}

/* 动画应用 */
#player-sprite.attack {
    animation: attackAnimation 0.3s ease-in-out;
}

#enemy-sprite.hit {
    animation: hitAnimation 0.5s ease-in-out;
}

#player-sprite.victory {
    animation: victoryAnimation 1s ease-in-out;
}

#enemy-sprite.defeat {
    animation: defeatAnimation 1.5s ease-in-out forwards;
}

#enemy-sprite.enemy-attacking {
    animation: enemyAttackAnimation 0.3s ease-in-out;
}

#player-sprite.hit {
    animation: playerHitAnimation 0.5s ease-in-out;
}

/* 特效动画应用 */
#sword-effect.active {
    animation: swordSlash 0.6s ease-out forwards;
}

#fist-effect.active {
    animation: fistPunch 0.5s ease-out forwards;
}

#staff-effect.active {
    animation: staffSwing 0.8s ease-out forwards;
}

#dagger-effect.active {
    animation: daggerStab 0.4s ease-out forwards;
}

#crit-effect.active {
    animation: critAnimation 1s ease-out forwards;
}

#damage-display.active {
    animation: damagePopup 1s ease-out forwards;
}

/* 地图区域 */
.map-section {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    flex: 1;
    margin-bottom: 0;
}

#messages p {
    margin-bottom: 5px;
    padding-left: 8px;
    border-left: 3px solid #d4af37;
    line-height: 1.4;
}

/* 背包、任务、成就系统 */
.inventory-section {
    margin-bottom: 5px;
}

.inventory-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
}

.inventory-items {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    width: 100%;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border: 1px solid #d4af37;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    justify-content: center;
    font-size: 0.8em;
    flex-wrap: wrap;
    flex: 1 0 20%;
    max-width: 100px;
}

.inventory-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.item-icon {
    font-size: 1.2em;
}

.item-count {
    color: #ffd93d;
    font-weight: bold;
}

/* 背包、任务详情 */
.backpack-detail, .quests-detail {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px solid #d4af37;
}

/* 属性点分配界面 */
.stat-points-section {
    width: 90%;
    max-width: 400px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    color: #fff;
    margin: 20px auto;
    text-align: center;
}

.stat-points-section h2 {
    color: #d4af37;
    margin-bottom: 20px;
    font-family: 'SimSun', serif;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 10px;
}

.stat-points-info {
    font-size: 18px;
    margin-bottom: 20px;
    color: #d4af37;
}

.stat-allocation {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-allocation-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    width: 150px; /* 短竖列宽度 */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background-color 0.3s;
    gap: 8px;
    text-align: center;
}

.stat-allocation-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.stat-allocation-item button {
    background-color: #d4af37;
    color: #000;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.stat-allocation-item button:hover {
    background-color: #f0d060;
}

.stat-points-section button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.stat-points-section button:hover {
    background-color: #45a049;
}

/* 功能系统 */
.functions-section {
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    margin: 20px auto;
    width: 90%;
    max-width: 600px; /* 限制最大宽度，确保两排布局 */
}

.functions-section h2 {
    color: #d4af37;
    margin-bottom: 15px;
    font-family: 'SimSun', serif;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 10px;
}

.function-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    max-width: 600px;
}

.function-item {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    background-color: rgba(76, 175, 80, 0.2);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(76, 175, 80, 0.5);
    font-size: 11px;
    min-width: 80px;
    gap: 3px;
    justify-content: center;
    flex-wrap: wrap;
    flex: 1 0 20%;
    max-width: 100px;
}

.function-item:hover {
    background-color: rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.function-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

/* 成就详情 */
.achievements-detail {
    width: 90%;
    max-width: 400px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    color: #fff;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
}

.backpack-detail h2, .quests-detail h2, .achievements-detail h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
}

.backpack-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.backpack-item {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid #d4af37;
    text-align: center;
    width: 120px; /* 短竖列宽度 */
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.backpack-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.quests-list, .achievements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.quest-item, .achievement-item {
    padding: 15px;
    width: 220px; /* 短竖列宽度 */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid #d4af37;
    flex-shrink: 0;
}

.quest-item h3, .achievement-item h3 {
    color: #ffd93d;
    margin-bottom: 10px;
}

.quest-progress, .achievement-progress {
    color: #d4af37;
    font-size: 0.9em;
}

/* 转生界面 */
.reincarnation-section {
    width: 90%;
    max-width: 400px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    color: #fff;
    margin: 20px auto;
    text-align: center;
}

.reincarnation-section h2 {
    color: #d4af37;
    margin-bottom: 20px;
    font-family: 'SimSun', serif;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 10px;
}

/* 游戏控制 */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

/* 按钮样式 */
button {
    padding: 5px 10px;
    background: linear-gradient(45deg, #d4af37, #ffd93d);
    color: #1a1a2e;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

button:hover {
    background: linear-gradient(45deg, #ffd93d, #d4af37);
    transform: scale(1.05);
}

/* 模态框样式 */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.modal {
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.95);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.modal-content {
    width: 100%;
}

.modal h2 {
    color: #d4af37;
    margin-top: 0;
    font-size: 1.2em;
    text-align: center;
}

button:active {
    transform: scale(0.95);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffd93d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-info, .player-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .combat-stats {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .equipment-slots {
        flex-direction: column;
    }
    
    .dungeons, .shop-items {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* 战斗信息优化 */
#messages p {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 战斗中状态指示器 */
.map-enemy.fighting {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}