body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    user-select: none; /* 禁止选择文本 */
}

.game-container {
    background-color: #c0c0c0;
    border: 3px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 10px;
    text-align: center;
}

h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 5px 10px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
}

#reset-button {
    font-size: 24px;
    padding: 2px 5px;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    background-color: #c0c0c0;
    cursor: pointer;
}

#reset-button:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

#game-board {
    display: grid;
    /* grid-template-columns 和 grid-template-rows 会由 JS 设置 */
    border: 3px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    /* gap: 1px; */ /* 可以加格子间隙，但经典扫雷没有 */
}

.cell {
    width: 30px;
    height: 30px;
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box; /* 确保边框包含在宽高内 */
}

.cell.revealed {
    background-color: #bdbdbd;
    border: 1px solid #808080;
    cursor: default;
}

.cell.mine {
    background-color: red; /* 游戏结束时显示 */
}

.cell.flagged::before {
    content: '🚩';
    font-size: 18px;
}

/* 不同数字显示不同颜色 */
.cell[data-value="1"] { color: blue; }
.cell[data-value="2"] { color: green; }
.cell[data-value="3"] { color: red; }
.cell[data-value="4"] { color: darkblue; }
.cell[data-value="5"] { color: brown; }
.cell[data-value="6"] { color: cyan; }
.cell[data-value="7"] { color: black; }
.cell[data-value="8"] { color: grey; }

.message {
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
    min-height: 25px; /* 避免消息出现/消失时布局跳动 */
}
