/* StuLink 移动端通用适配（2026-10-28）
 * 目标：手机上「看数据」可用 —— 宽表默认只留关键列，其余一键展开；
 * 桌面端与打印不受影响。
 */
@media (max-width: 767.98px) {
    /* 宽表精简栏 */
    .mt-bar {
        display: flex; align-items: center; gap: 8px;
        padding: 6px 10px; margin-bottom: 6px;
        background: var(--sl-surface-2);
        border: 1px solid var(--sl-border);
        border-radius: 8px;
        font-size: 12.5px; color: var(--sl-text-muted);
    }
    .mt-bar .mt-btn { margin-left: auto; white-space: nowrap; }
    /* 被精简掉的列（表头 + 单元格） */
    table.mt-on th.mt-off, table.mt-on td.mt-off { display: none !important; }
    table.mt-on.mt-all th.mt-off, table.mt-on.mt-all td.mt-off { display: table-cell !important; }

    /* 触屏横向滚动更顺滑；表格首列吸附在手机上容易挡住内容，取消吸附 */
    .table-responsive, .g-table, .ld-wrap { -webkit-overflow-scrolling: touch; }
    .g-table tbody td:first-child { position: static; }

    /* 页头工具栏在手机上换行更紧凑 */
    .g-filter-bar { row-gap: 6px; }
    .g-filter-bar .btn { padding: .2rem .55rem; }

/* 2026-10-28：手机端表格不再强制 760px 下限（精简后只剩 5 列，留白会很丑） */
    .tbl-card .g-table { min-width: 0 !important; width: 100%; }
    .tbl-card .g-table thead th,
    .tbl-card .g-table tbody td { font-size: 13px; padding: .3rem .4rem; }
    /* 成绩分析：图表再压低一点，表/图都留给首屏 */
    .chart-pane .tbl-chart { height: 260px; }
    .tbl-card { margin-bottom: .75rem !important; }

    /* 卡片留白收紧，给数据更多空间 */
    .card-body { padding: .5rem; }
    .tbl-card .card-header { padding: 6px 10px; }
    /* ===== 2026-10-28 第二批：触控可用性 ===== */
    /* iOS Safari：输入框字号 <16px 会在聚焦时强制放大页面，这里统一到 16px */
    input, select, textarea, .form-control, .form-select { font-size: 16px !important; }
    /* 触控目标不小于 34px，避免误触 */
    .btn-sm { min-height: 34px; }
    /* 底部安全区（iPhone 刘海/手势条） */
    body { padding-bottom: env(safe-area-inset-bottom, 0); }

    /* 宿舍「点选学生 → 点空床位」的底部提示条 */
    .mt-pickbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1055;
        background: #1e293b; color: #fff; font-size: 13px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
        display: flex; align-items: center; gap: 8px;
    }
    .student-item.picked {
        background: #dbeafe;
        box-shadow: inset 3px 0 0 #2563eb;
    }
}
/* 桌面端不显示精简栏（缩回宽屏时由 JS 撤掉，这里兜底） */
@media (min-width: 768px) {
    .mt-bar { display: none !important; }
}
@media print {
    table.mt-on th.mt-off, table.mt-on td.mt-off { display: table-cell !important; }
    .mt-bar { display: none !important; }
}