/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置页面背景和字体 */
body {
    background-color: #f0f0f0;
    font-family: 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 游戏容器样式 */
.game-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 95%;
}

/* 游戏标题样式 */
h1 {
    color: #333;
    margin-bottom: 20px;
}

/* 操作说明样式 */
.instructions {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: left;
}

.instructions h2 {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.instructions p {
    color: #666;
    margin: 8px 0;
    line-height: 1.4;
}

/* 分数容器样式 */
.score-container {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #666;
}

/* 游戏画布样式 */
#gameCanvas {
    border: 2px solid #333;
    border-radius: 5px;
    background-color: #fff;
    margin-bottom: 15px;
    max-width: 400px;
    width: 100%;
}

/* 控制按钮样式 */
.controls button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.controls button:hover {
    background-color: #45a049;
}

/* 移动设备控制器样式 */
.mobile-controls {
    display: none;
    margin-top: 20px;
}

.mobile-controls button {
    background-color: #666;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    margin: 5px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    transition: background-color 0.3s;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .mobile-controls {
        display: block;
    }
    
    h1 {
        font-size: 1.5em;
    }

    .instructions {
        font-size: 0.9em;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.7);
    transition: transform 0.3s;
    max-width: 90%;
    width: 400px;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.modal p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.2em;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-button {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.modal-button:not(.primary) {
    background-color: #f0f0f0;
    color: #666;
}

.modal-button:not(.primary):hover {
    background-color: #e0e0e0;
}

.modal-button.primary {
    background-color: #4CAF50;
    color: white;
}

.modal-button.primary:hover {
    background-color: #45a049;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
    }

    .modal h2 {
        font-size: 1.5em;
    }

    .modal p {
        font-size: 1.1em;
    }

    .modal-button {
        padding: 8px 20px;
    }
} 