/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* 游戏容器样式 */
.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 100%;
    width: fit-content;
}

/* 标题和控制区域样式 */
header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2em;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
}

select, button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

/* 游戏信息区域样式 */
.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.mines-counter, .timer {
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 5px;
    min-width: 120px;
}

/* 游戏状态样式 */
.game-status {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

/* 游戏棋盘样式 */
.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.game-board {
    display: grid;
    gap: 1px;
    background-color: #ddd;
    padding: 1px;
    border-radius: 4px;
}

/* 单元格样式 */
.cell {
    width: 30px;
    height: 30px;
    background-color: #e0e0e0;
    border: 1px solid #bbb;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.cell:hover {
    background-color: #d0d0d0;
}

.cell.revealed {
    background-color: #f8f9fa;
}

.cell.mine {
    background-color: #ff4444;
}

.cell.flagged {
    background-color: #ffe066;
}

/* 数字颜色 */
.cell[data-number="1"] { color: #0000FF; }
.cell[data-number="2"] { color: #008000; }
.cell[data-number="3"] { color: #FF0000; }
.cell[data-number="4"] { color: #000080; }
.cell[data-number="5"] { color: #800000; }
.cell[data-number="6"] { color: #008080; }
.cell[data-number="7"] { color: #000000; }
.cell[data-number="8"] { color: #808080; }

/* 游戏说明样式 */
.instructions {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.instructions ul {
    list-style-position: inside;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .cell {
        width: clamp(18px, 5.5vw, 25px);
        height: clamp(18px, 5.5vw, 25px);
        font-size: 12px;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}
