/**
 * mobile.css —— 手机/小屏适配层
 * 仅在 <=767px 生效，不影响 PC 端任何样式。
 * 目标：字号与点击区域加大、查询区纵向排布、表格卡片视图可读、弹窗不超屏、登录页精简。
 * 依赖：bootstrap-table 1.24 自带卡片视图（ry-ui.js 默认 mobileResponsive: true 已开启）。
 */

@media (max-width: 767px) {

    /* ============ 1. 触摸目标与字号 ============
       输入类字号必须 >=16px，否则 iOS 聚焦输入框时页面会自动放大 */
    body {
        font-size: 14px;
        max-width: 100%;
        overflow-x: hidden;
    }
    .form-control {
        height: 40px;
        font-size: 16px;
        line-height: 1.4;
    }
    .btn { font-size: 14px; }
    .btn-xs, .btn-group-xs > .btn {
        padding: 6px 10px;
        font-size: 13px;
        min-height: 30px;
    }
    .btn-sm, .btn-group-sm > .btn {
        padding: 7px 12px;
        font-size: 14px;
        min-height: 34px;
    }
    label, .control-label { font-size: 14px; }

    /* ============ 2. 查询区（select-list）：纵向排布、控件全宽 ============ */
    .select-list ul li {
        display: block;
        width: 100%;
        margin: 0 0 8px 0;
    }
    .select-list ul li > label {
        width: auto;
        margin-right: 6px;
        vertical-align: middle;
    }
    .select-list ul li input[type="text"],
    .select-list ul li select,
    .select-list ul li .form-control {
        width: 100% !important;
    }
    /* 日期区间：两个输入框并排各占一半，中间“至”隐藏 */
    .select-list ul li .time input { width: 48% !important; }
    .select-list ul li .time span { display: none; }
    .select-list .btn { margin-top: 2px; min-width: 96px; }

    /* ============ 3. 工具栏 / 分页 ============
       业务模板（company/charge/change/collection 等）做了两件影响布局的事：
       ① 引入 pagefront.css：把 .fixed-table-toolbar 变成 display:flex；
       ② 页面脚本把 .fixed-table-pagination insertBefore 移进工具栏（.columns-right 之前）。
       结果窄屏下分页块被挤成竖条。手机端处理：
       ① 工具栏允许换行，操作按钮与图标按钮自然排布；
       ② 分页块 order 排到最后、独占一整行，覆盖 pagefront 的 margin-left:auto/80px。 */
    .fixed-table-toolbar {
        padding: 0;
        flex-wrap: wrap;
    }
    .fixed-table-toolbar .bars,
    .fixed-table-toolbar .columns,
    .fixed-table-toolbar .search {
        width: auto;
        margin-bottom: 6px;
    }
    .fixed-table-toolbar .columns-right,
    .fixed-table-toolbar .columns {
        margin-left: auto !important;   /* 压过 bootstrap-table.min.css 的 .columns-right{margin-left:5px}，图标靠右 */
        width: auto;
        margin-bottom: 6px;
    }
    .fixed-table-toolbar .columns .btn,
    .fixed-table-toolbar .search .btn {
        min-height: 38px;
    }
    #toolbar { margin-bottom: 0; }
    #toolbar .btn { margin-bottom: 0; }

    /* 分页块：独占一整行；信息靠左、页码靠右同一行，放不下时自动换行 */
    .fixed-table-pagination {
        order: 99;
        width: 100% !important;
        margin-left: 0 !important;
        padding: 4px 0 8px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 12px;
    }
    .fixed-table-pagination .pagination-detail {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 12px;
        margin: 4px 0 0 !important;
    }
    /* 页码容器（div.pagination pull-right）：在 flex 里用 margin-left:auto 靠右 */
    .fixed-table-pagination div.pull-right.pagination,
    .fixed-table-pagination div.pagination {
        margin-left: auto !important;
        display: block;
    }
    .fixed-table-pagination .page-list {
        display: inline-flex;
        align-items: center;
        margin: 0;
    }
    .fixed-table-pagination .pagination-info { white-space: nowrap; }
    .fixed-table-pagination ul.pagination {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin: 6px 0 0 !important;
        justify-content: flex-start;
    }
    .fixed-table-pagination ul.pagination > li > a,
    .fixed-table-pagination ul.pagination > li > span {
        min-width: 38px;
        min-height: 38px;
        line-height: 36px;
        padding: 0 10px;
        text-align: center;
        border-radius: 4px;
    }

    /* ============ 4. 表格：卡片视图可读性 ============
       卡片视图每行只有 1 个 td（内含 .card-views），表格视图有多个 td。
       故竖排样式只用 :only-child 命中卡片行——这样用户切到"表格视图"时
       仍是正常横向表格（可左右滑动看列），不会被压成一竖条。 */
    .fixed-table-body {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .fixed-table-body tbody tr:has(td:only-child) {
        display: block;
        padding: 6px 0;
        border-bottom: 1px solid #e7eaec;
    }
    .fixed-table-body tbody tr td:only-child {
        display: block;
        width: 100% !important;
        border: none !important;
        padding: 6px 12px !important;
        font-size: 14px;
        line-height: 1.5;
        word-break: break-all;
    }
    /* 表格视图（用户手动切换）：保持横向表格，允许左右滑动；表头与单元格紧凑一些 */
    .fixed-table-body table { min-width: 720px; }
    .fixed-table-body tbody tr:not(:has(td:only-child)) td {
        padding: 8px 6px;
        font-size: 13px;
        white-space: nowrap;
    }
    .fixed-table-body thead th {
        padding: 8px 6px;
        font-size: 13px;
        white-space: nowrap;
    }
    .fixed-table-body .card-views .card-view {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border-bottom: 1px dashed #e7eaec;
        padding: 5px 0;
    }
    .fixed-table-body .card-views .card-view:last-child { border-bottom: none; }
    .fixed-table-body .card-view .card-view-title {
        color: #888;
        white-space: nowrap;
        margin-right: 10px;
        font-size: 14px;
    }
    .fixed-table-body .card-view .card-view-value {
        flex: 1;
        text-align: right;
        word-break: break-all;
    }
    /* 卡片里的操作按钮：换行展示、足够大 */
    .fixed-table-body .card-view .btn { margin: 2px 4px 2px 0; }
    /* 兜底：若某页表格未启用卡片视图，仍允许横向滑动查看 */
    .fixed-table-body table { min-width: 100%; }

    /* ============ 5. 弹窗：不超屏 ============ */
    .modal-dialog { width: auto !important; margin: 10px; }
    .modal-content { max-height: 88vh; overflow-y: auto; }
    .layui-layer { max-width: 96vw !important; }
    .layui-layer-iframe iframe { width: 100% !important; max-width: 100% !important; }
    .layui-layer-btn a { min-height: 38px; line-height: 38px; }
    .layui-layer-title { font-size: 15px; }

    /* ============ 6. 表单（新增/编辑弹层内容页）============ */
    .form-horizontal .form-group { margin-bottom: 10px; }
    .form-horizontal .control-label {
        text-align: left;
        padding-top: 8px;
        padding-bottom: 2px;
    }
    .form-horizontal .radio, .form-horizontal .checkbox { margin-top: 0; }

    /* ============ 7. 顶部多标签：横向滚动 ============ */
    .page-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .page-tabs a { display: inline-block; float: none; }

    /* ============ 8. 登录页：隐藏左侧介绍、表单全宽 ============ */
    body.signin .signinpanel {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        padding: 20px 16px;
        box-shadow: none;
    }
    body.signin .signinpanel .col-sm-7 { display: none; }
    body.signin .signinpanel .col-sm-5 {
        width: 100%;
        float: none;
        padding: 0;
    }
    body.signin .signinpanel input.form-control {
        height: 44px;
        margin-bottom: 12px;
        font-size: 16px;
    }
    body.signin .signinpanel .btn-success.btn-block {
        height: 44px;
        font-size: 16px;
    }
    body.signin .signup-footer { text-align: center; }
}

/* ============================================================
   9.（死代码已移除）
   注意：主框架 index.html / index-topnav.html 不加载本文件，
   顶栏「三杠」按钮的移动端样式在 ruoyi/css/ry-ui.css 的 @media (max-width:767px) 内，
   写在本文件里对真机顶栏无效。
   ============================================================ */

