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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
}

/* 游戏容器 */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    /* 硬件加速优化 */
    transform: translateZ(0);
    will-change: transform;
    /* 防止移动端文本选择影响游戏体验 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #2c3e50;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #ecf0f1;
}

.game-info {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

/* 玩家属性区域 */
.player-stats {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* 硬件加速优化 */
    transform: translateZ(0);
}

.player-stats h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    margin-bottom: 15px;
}

.stat-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}
/* 状态条基础样式 */
.stat-bar {
    width: 100%;
    height: 25px;
    background-color: #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    /* 优化状态条动画 */
    transition: width 0.3s ease;
    /* 硬件加速优化 */
    transform: translateZ(0);
}

.stat-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.5s ease;
}

.stat-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 精力值条特殊样式 */
.stat-bar.energy .stat-fill {
    background-color: #27ae60;
}

/* 游戏事件区域 */
.game-event {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* 硬件加速优化 */
    transform: translateZ(0);
}

.game-event h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.event-content {
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.8;
    text-align: justify;
}

.event-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
/* 选项按钮 */
.option-btn {
    padding: 15px 20px;
    font-size: 1.1em;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    /* 硬件加速优化 */
    transform: translateZ(0);
    will-change: transform, background-color;
}

.option-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.option-btn:active {
    transform: translateY(0);
}

/* 得失信息样式 */
.gain-loss {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    padding-left: 20px;
}

.gain {
    color: #27ae60;
}

.loss {
    color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .game-container {
        padding: 10px;
        min-height: 100vh;
        box-sizing: border-box;
    }
    
    .player-stats, .game-event {
        padding: 20px;
    }
    
    .stat-bar {
        height: 20px;
    }
    
    .stat-bar span {
        font-size: 0.8em;
    }
    
    .event-content {
        font-size: 1em;
        line-height: 1.6;
    }
    
    .option-btn {
        font-size: 1em;
        padding: 12px 18px;
    }
    
    .gain-loss {
        font-size: 0.8em;
        padding-left: 15px;
    }
}

/* 小屏手机优化 (≤480px) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.6em;
    }
    
    .game-container {
        padding: 5px;
    }
    
    .player-stats, .game-event {
        padding: 15px;
    }
    
    .player-stats h2, .game-event h2 {
        font-size: 1.4em;
    }
    
    .event-content {
        font-size: 0.95em;
    }
    
    .option-btn {
        font-size: 0.95em;
        padding: 10px 15px;
        min-height: auto;
    }
    
    .gain-loss {
        font-size: 0.75em;
        padding-left: 10px;
    }
    
    .stat-item {
        margin-bottom: 12px;
    }
    
    .stat-bar {
        height: 18px;
    }
    
    .stat-bar span {
        font-size: 0.75em;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.event-content, .event-options {
    animation: fadeIn 0.5s ease-in;
}

/* 触摸反馈优化 */
.option-btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.option-btn:active {
    transform: translateY(-1px) scale(0.98);
    opacity: 0.9;
}

/* 移动端性能优化 */
@media (max-width: 768px) {
    /* 禁用某些复杂动画以提高性能 */
    .option-btn {
        transition: background-color 0.2s ease;
    }
    
    /* 优化滚动体验 */
    .player-stats, .game-event {
        -webkit-overflow-scrolling: touch;
    }
}