        /* ================================================================
           响应式布局：手机端（≤600px）
           - 卡片内边距缩小
           - 按钮纵向排列
           - 帮助面板改为全屏覆盖
           - 关闭毛玻璃效果以提升低端机性能
           ================================================================ */
        @media (max-width: 720px) {
            body {
                justify-content: flex-start;
                flex-direction: column;
                box-sizing: border-box;
                padding: 14px 0 24px;
            }

            .theme-switch-row {
                position: static;
                z-index: 2;
                max-width: calc(100% - 24px);
                margin: 0 auto 10px;
                padding: 2px 8px;
                box-sizing: border-box;
                flex-wrap: wrap;
                justify-content: center;
                gap: 7px;
                border: 0;
                border-radius: 0;
                background: transparent;
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
                box-shadow: none;
            }

            .theme-auto-label {
                margin-left: 2px;
            }
        }

        @media (max-width: 380px) {
            .theme-switch-row {
                gap: 6px 8px;
                padding-inline: 8px;
            }

            .theme-auto-label {
                width: 100%;
                justify-content: center;
                margin-left: 0;
            }
        }

        @media (max-width: 600px) {
            .container {
                padding: 1.5rem;
                width: calc(100% - 24px);
                max-width: 520px;
            }
            .mode-btn { flex: 1 1 calc(50% - 5px); }
            .btn-group { flex-direction: column; gap: 10px; }
            .btn-group button { width: 100%; }
            .math-history-item {
                grid-template-columns: minmax(0, 1fr);
            }
            .math-history-main {
                grid-template-columns: minmax(0, 1fr);
            }
            .math-history-result {
                text-align: left;
            }
            .math-history-actions {
                display: grid;
                grid-template-columns: 1fr 1fr;
            }
            .math-history-action {
                min-height: 36px;
            }
            .math-history-feedback {
                text-align: left;
            }

            /* 窄屏下帮助面板改为覆盖在卡片上，避免溢出视口 */
            .help-panel {
                left: 0;
                top: 0;
                width: 100%;
                max-width: none;
                height: 100%;
                border-radius: 20px;
                transform: translateY(-20px);
            }
            .help-panel.show {
                transform: translateY(0);
            }

            /* 移动端关闭毛玻璃，避免低端设备卡顿 */
            .container {
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
                background: var(--card-bg-solid);
            }
            .help-panel {
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
                background: var(--card-bg-solid);
            }
        }

