/* ============================================
   放置RPG战斗游戏 - 样式表
   ============================================ */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 页面基础样式 */
body {
    background: linear-gradient(135deg, #0c0c2e, #1a1a3e);
    color: #f0f8ff;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 游戏标题 */
.game-header {
    text-align: center;
    padding: 25px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.game-header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #ffd700, #ff9900);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    color: #b0b0ff;
}

/* 游戏主容器 */
.game-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (min-width: 1024px) {
    .game-container {
        grid-template-columns: 2fr 1fr;
    }
}

/* 面板通用样式 */
.battle-panel,
.player-panel {
    background: rgba(20, 20, 40, 0.8);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(100, 100, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 面板标题 */
h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffd700;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 战斗面板特定样式 */
.battle-panel {
    border-color: rgba(255, 69, 0, 0.3);
}

/* 关卡信息 */
.stage-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.stage-title {
    font-size: 1.5rem;
    color: #00ccff;
    margin-bottom: 10px;
}

.stage-progress {
    font-size: 1.1rem;
    margin-top: 10px;
}

.progress-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #00cc66, #00ff99);
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
}

/* 战斗显示区域 */
.battle-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    gap: 20px;
}

.character {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.character.player {
    border: 2px solid #00aaff;
}

.character.enemy {
    border: 2px solid #ff5555;
}

.character:hover {
    transform: translateY(-5px);
}

.char-icon {
    font-size: 4.5rem;
    margin-bottom: 15px;
}

.player .char-icon {
    color: #00aaff;
}

.enemy .char-icon {
    color: #ff5555;
}

.char-info {
    margin-top: 10px;
}

.char-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.char-level {
    font-size: 1.1rem;
    color: #ffd700;
    margin-bottom: 15px;
}

/* 血条样式 */
.health-bar {
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 11px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.health-fill {
    height: 100%;
    border-radius: 11px;
    transition: width 0.5s ease;
}

.player .health-fill {
    background: linear-gradient(to right, #00aa00, #00ff00);
}

.enemy .health-fill {
    background: linear-gradient(to right, #aa0000, #ff0000);
}

.health-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 22px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-size: 0.9rem;
}

/* VS标志 */
.vs {
    font-size: 2.5rem;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    padding: 0 20px;
}

/* 战斗控制 */
.battle-controls {
    margin: 25px 0;
}

.auto-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-toggle,
.btn-attack {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-toggle {
    background: linear-gradient(to right, #4444ff, #2222aa);
    color: white;
}

.btn-toggle.active {
    background: linear-gradient(to right, #00aa00, #007700);
}

.btn-attack {
    background: linear-gradient(to right, #ff6600, #cc4400);
    color: white;
}

.btn-toggle:hover:not(:disabled),
.btn-attack:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.btn-toggle:disabled,
.btn-attack:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 技能容器 */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.skill-btn {
    flex: 1;
    min-width: 150px;
    background: linear-gradient(to bottom, #333366, #222244);
    border: 2px solid #6666ff;
    border-radius: 10px;
    padding: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.skill-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    border-color: #ffd700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffd700;
}

.skill-desc {
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.9;
}

.skill-cooldown {
    font-size: 0.8rem;
    color: #ff9900;
    font-weight: bold;
}

/* 战斗日志 */
.battle-log {
    margin-top: 30px;
}

.battle-log h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #00ccff;
}

.log-content {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(100, 100, 255, 0.2);
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.log-entry:last-child {
    border-bottom: none;
}

/* 玩家面板 */
.player-panel {
    border-color: rgba(0, 200, 255, 0.3);
}

/* 状态网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(0, 0, 0, 0.4);
}

.stat-name {
    font-size: 0.95rem;
    color: #b0b0ff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ffaa;
}

/* 经验条 */
.exp-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.exp-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.level {
    color: #ffd700;
    font-weight: bold;
}

.exp-bar {
    height: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 7.5px;
    overflow: hidden;
}

.exp-fill {
    height: 100%;
    background: linear-gradient(to right, #ff9900, #ffcc00);
    border-radius: 7.5px;
    width: 0%;
    transition: width 0.5s ease;
}

/* 升级商店 */
.upgrade-shop {
    margin-top: 30px;
}

.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upgrade-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border-left: 4px solid #9d4edd;
}

.upgrade-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(5px);
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffd700;
    margin-bottom: 5px;
}

.upgrade-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.upgrade-cost {
    color: #ff9900;
    font-weight: bold;
    font-size: 1.1rem;
}

.upgrade-btn {
    background: linear-gradient(to right, #9d4edd, #7b2cbf);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.upgrade-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #b15eff, #8a2be2);
    transform: translateY(-3px);
}

.upgrade-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-count {
    color: #00ffaa;
    font-weight: bold;
    margin-right: 15px;
}

/* 游戏控制 */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.control-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    justify-content: center;
}

.control-btn.save {
    background: linear-gradient(to right, #00aa44, #007733);
    color: white;
}

.control-btn.reset {
    background: linear-gradient(to right, #ff4444, #cc2222);
    color: white;
}

.control-btn.export {
    background: linear-gradient(to right, #4444ff, #2222aa);
    color: white;
}

.control-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* 游戏统计 */
.game-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.stat {
    text-align: center;
    min-width: 150px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #b0b0ff;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ffaa;
}

/* 页脚 */
.game-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #8888ff;
    font-size: 0.9rem;
}

.hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #ff9900;
}

/* 通知消息 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 200, 100, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s;
    z-index: 1000;
    max-width: 300px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1s infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
    }

    .battle-display {
        flex-direction: column;
    }

    .vs {
        padding: 20px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 100%;
        max-width: 300px;
    }


    /* 在CSS末尾添加简单样式 */
    /* 音乐控制样式 */
    .music-control {
        position: fixed;
        bottom: 20px;
        right: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
        z-index: 1000;
    }

    .music-btn {
        background: linear-gradient(to right, #4caf50, #2e7d32);
        color: white;
        border: none;
        border-radius: 20px;
        padding: 10px 20px;
        font-size: 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
        transition: all 0.3s;
    }

    .music-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    }

    .music-btn.playing {
        background: linear-gradient(to right, #f44336, #c62828);
    }

    .music-btn.playing i {
        content: "\f04c";
        /* 暂停图标 */
    }

    #bgm-volume {
        width: 80px;
        height: 8px;
        -webkit-appearance: none;
        background: linear-gradient(to right, #333, #4caf50);
        border-radius: 4px;
        outline: none;
    }

    #bgm-volume::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #4caf50;
        cursor: pointer;
        border: 2px solid white;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    }

    #bgm-volume::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #4caf50;
        cursor: pointer;
        border: 2px solid white;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    }




}