/* ===== 移动端通用适配（YANG云校通） =====
   用于不继承 base.html 的独立页面：票据管理、加密票据、公开检索、公开报名、
   快速录入、登录页、错误页等。桌面端不受任何影响。
   注意：base.html 内的业务页面有自己更细的移动端样式，不引用本文件。 */
@media (max-width: 768px) {
    html { -webkit-text-size-adjust: 100%; }
    body { overflow-x: hidden; }

    /* 顶栏：单行不换行，紧凑（换行会把下面的内容挤出可视区） */
    .navbar, .navbar-receipt { flex-wrap: nowrap !important; gap: 6px; }
    .navbar .navbar-brand, .navbar-receipt .brand {
        font-size: .95rem !important; max-width: 46vw;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .navbar small, .navbar-receipt small { display: none !important; }
    .navbar .btn, .navbar-receipt .btn { padding: .16rem .4rem !important; font-size: .76rem !important; }

    /* 容器留白收紧 */
    .container-fluid { padding-left: .6rem !important; padding-right: .6rem !important; }
    .container-fluid.p-4, .container-fluid.p-5 { padding: .6rem !important; }

    /* 卡片 */
    .card, .panel-card { margin-bottom: .7rem !important; border-radius: 10px !important; }
    .card-header { padding: .55rem .7rem !important; font-size: .95rem; flex-wrap: wrap; gap: .3rem; }
    .card-body { padding: .7rem !important; }

    /* 表格：横向滚动 + 紧凑 */
    .table-responsive, .table-scroll-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { font-size: 12.5px !important; margin-bottom: 0;
        display: block; width: 100%; max-width: 100%; overflow-x: auto;
        -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .table th, .table td { padding: .32rem .38rem !important; white-space: nowrap; }
    .table th { font-size: 12px !important; }

    /* 按钮 */
    .btn { padding: .28rem .5rem; font-size: .82rem; }
    .btn-sm { padding: .16rem .4rem !important; font-size: .74rem !important; }

    /* 栅格：手机单列 + 间距收紧 */
    .row.g-4, .row.g-3 { --bs-gutter-x: .5rem; --bs-gutter-y: .5rem; }
    .row > [class*="col-"] { margin-bottom: .45rem; }

    /* 表单：16px 防 iOS 聚焦自动放大 */
    .form-control, .form-select { font-size: 16px !important; padding: .35rem .5rem; }
    .form-control-sm, .form-select-sm { font-size: 16px !important; }
    .form-label { margin-bottom: .2rem; font-size: .85rem; }

    /* 统计卡 */
    .sum-card { padding: .6rem !important; }
    .sum-card .sum-value { font-size: 1.15rem !important; }
    .sum-card .sum-label { font-size: .78rem !important; }

    /* 模态框全屏 */
    .modal-dialog { margin: 0 !important; max-width: 100vw !important; }
    .modal-body { max-height: calc(100vh - 190px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .modal-footer { position: sticky; bottom: 0; background: #fff; flex-wrap: wrap; }

    /* 下拉/浮层不出屏 */
    .dropdown-menu { max-width: calc(100vw - 16px); }

    /* 收据/票据展示框不超出屏幕 */
    .receipt-box { max-width: 100% !important; margin: 0 !important; }

    /* 长文本与链接不撑破布局 */
    .card-body, .modal-body { word-break: break-word; }
}
