@media screen and (max-width: 768px) {
    /* 基础布局调整 */
    body {
        padding: 10px;
        font-size: 14px;
        margin: 0;
    }

    /* 控制按钮调整 */
    #control-buttons {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 10px;
    }

    /* 游戏说明样式 */
    .game-header {
        width: 100%;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .game-header h1 {
        font-size: 24px;
        margin: 0 0 15px 0;
        color: #2c3e50;
    }

    .game-header p {
        font-size: 16px;
        line-height: 1.5;
        color: #34495e;
        margin: 0 0 20px 0;
    }

    .game-header h3 {
        font-size: 20px;
        margin: 25px 0 15px 0;
        color: #2c3e50;
    }

    .game-header ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
        text-align: left;
    }

    .game-header ul li {
        padding: 10px 0;
        margin: 5px 0;
        color: #34495e;
        font-size: 15px;
        line-height: 1.4;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .game-header ul li:last-child {
        border-bottom: none;
    }

    /* 调整grid样式 */
    #grid {
        width: 100%;
        height: auto;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .line > .case {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: box-shadow 0.3s;
    }

    .line > .case:hover {
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }

    /* 调整菜单样式 */
    #menu {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 调整字体大小和间距 */
    h1, h2, h3, p {
        margin: 0;
        padding: 5px;
        width: 100%;
        text-align: center;
    }

    /* 弹窗样式 */
    .popup-content {
        width: 90%;
        max-width: 320px;
        padding: 20px;
    }
}
