/* ============================================================
   全站移动端适配（手机浏览器）
   说明：仅调整布局尺寸与触控体验，不改变任何业务逻辑
   ============================================================ */

html {
    -webkit-text-size-adjust: 100%;
}

/* 表格容器：手机上可横向滑动，滚动条更细 */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #c7cdd4;
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 767.98px) {
    /* 输入框统一 16px，避免 iOS 聚焦时自动放大页面 */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm {
        font-size: 16px !important;
    }
    .input-group-text {
        font-size: 15px;
    }

    /* 页面左右留白收紧，给表格留出更多横向空间 */
    .container-fluid {
        padding-left: .55rem !important;
        padding-right: .55rem !important;
    }

    /* 卡片内边距更紧凑 */
    .card-body {
        padding: .85rem;
    }
    .card-header {
        padding: .55rem .8rem;
        flex-wrap: wrap;
        gap: .4rem;
    }

    /* 表格：小字号 + 紧凑单元格，配合横向滚动查看全部列 */
    .table {
        font-size: .8rem;
    }
    .table > :not(caption) > * > * {
        padding: .4rem .45rem;
    }

    /* 按钮加大点击区域，方便手指操作 */
    .btn {
        min-height: 36px;
    }
    .btn-sm {
        min-height: 32px;
        padding: .28rem .62rem;
    }
    .btn-group {
        flex-wrap: wrap;
        gap: .25rem;
    }
    .btn-group > .btn {
        border-radius: .375rem !important;
    }

    /* 标题与数字适当收小，避免手机上过于夸张 */
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.15rem; }
    h4, .h4 { font-size: 1.1rem; }
    h5, .h5 { font-size: 1.02rem; }
    .display-4, .display-5, .display-6 { font-size: 1.5rem !important; }
    .fs-4 { font-size: 1.2rem !important; }
    .fs-5 { font-size: 1.05rem !important; }

    /* 模态框铺满可用宽度 */
    .modal-dialog {
        margin: .5rem;
    }
    .modal-body {
        padding: .9rem;
    }

    /* 统计卡片数值收小 */
    .stat-card .value {
        font-size: 1.15rem;
    }

    /* 分页控件居中并允许换行 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: .2rem;
    }

    /* 滑动容器内的表格：内容不折断、不换行，超宽时整体横向滑动 */
    .table-responsive .table td,
    .table-responsive .table th {
        white-space: nowrap;
        word-break: normal;
        word-wrap: normal;
    }

    /* 无滑动容器的表格仍允许断行，避免撑破页面 */
    .table td,
    .table th {
        word-break: break-word;
    }

    /* 标题与操作按钮同一行时，空间不足自动换行 */
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: .5rem;
    }

    /* 页面顶部与卡片间距收紧 */
    .container-fluid.mt-4,
    .container-fluid.py-3 {
        margin-top: .85rem !important;
        padding-top: 0 !important;
    }
}

@media (max-width: 399.98px) {
    .table {
        font-size: .75rem;
    }
    .btn {
        font-size: .82rem;
    }
}
