body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

.game-container {
    width: 90%;
    margin: 50px auto;
    text-align: center;
}

h1 {
    margin-bottom: 30px;
}

.control-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-panel input {
    width: 70px;
    height: 32px;
    padding: 0 8px;
    box-sizing: border-box;
}

.control-panel button {
    height: 32px;
    padding: 0 16px;
    cursor: pointer;
}

.mine-count {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    border: 1px solid #999;
    background-color: white;
    box-sizing: border-box;
}

#game-board {
    display: grid;
    justify-content: center;
    margin-top: 30px;
}

.cell-button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #7aa7d9;
    background-color: #4f91d9;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 30px;
    box-sizing: border-box;
}

.cell-button:hover {
    background-color: #6aa7e8;
}

/* 所有已经打开的格子统一变成白色 */
.cell-button.opened,
.cell-button.opened:hover,
.cell-button.opened:disabled {
    background-color: white;
    border: 1px solid #cccccc;
    opacity: 1;
    cursor: default;
}

/* 空白格 */
.cell-button.empty-cell,
.cell-button.empty-cell:disabled {
    background-color: white;
}

/* 插旗格子 */
.cell-button.marked {
    background-color: #ffd966;
}

/* 地雷格子 */
.cell-button.mine,
.cell-button.mine:disabled {
    background-color: #ff9999;
}

/* 防止 disabled 按钮自动变透明 */
.cell-button:disabled {
    opacity: 1;
}

/* 数字颜色 */
.cell-button.number-1 {
    color: blue;
}

.cell-button.number-2 {
    color: green;
}

.cell-button.number-3 {
    color: red;
}

.cell-button.number-4 {
    color: darkblue;
}

.cell-button.number-5 {
    color: darkred;
}

.cell-button.number-6 {
    color: darkcyan;
}

.cell-button.number-7 {
    color: black;
}

.cell-button.number-8 {
    color: gray;
}