* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

#gameCanvas {
    background-color: #e8f4f8;
    border: 2px solid #88c1d3;
    border-radius: 5px;
    margin-bottom: 15px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

#restartBtn {
    background-color: #f44336;
    display: none; /* 初始状态隐藏 */
}

#restartBtn:hover {
    background-color: #d32f2f;
}

#restartBtn.active {
    display: inline-block; /* 游戏激活时显示 */
}

#hintBtn {
    background-color: #ff9800;
    display: none; /* 初始状态隐藏 */
}

#hintBtn.active {
    display: inline-block; /* 游戏激活时显示 */
}

.score-container, .time-container, .hint-container  {
    background-color: #f1f1f1;
    padding: 5px 15px;
    border-radius: 20px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px 40px;
    border: none;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    color: #2196F3;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 15px;
}

.rules-container {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05);
}

.modal-content ol {
    padding-left: 30px;
    margin-top: 10px;
}

.modal-content li {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 16px;
    color: #444;
    padding-left: 5px;
    text-align: left;
}

.close {
    position: absolute;
    right: 25px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #2196F3;
    text-decoration: none;
}

#rulesBtn {
    background-color: #2196F3;
}

#rulesBtn:hover {
    background-color: #0b7dda;
}

/* 自定义提示框特定样式 */
#alertModal .modal-content {
    padding: 25px 35px; /* 调整内边距 */
    max-width: 400px; /* 调整最大宽度 */
    text-align: center; /* 内容居中 */
}

#alertModal h2 {
    font-size: 22px; /* 调整标题字号 */
    color: #f44336; /* 更改标题颜色 */
    border-bottom: none; /* 移除下边框 */
    margin-bottom: 15px;
}

#alertModal p {
    margin-bottom: 25px; /* 增加消息和按钮间距 */
}

#alertModal .alert-close {
    top: 10px;
    right: 15px;
}

#alertOkBtn {
    background-color: #2196F3;
    transition: background-color 0.3s;
}

#alertOkBtn:hover {
    background-color: #0b7dda;
}

#hintBtn.disabled,
#hintBtn:disabled,
button.disabled {
    background-color: #bdbdbd;
    color: #888;
    border: 1px solid #ccc;
}