/* ========== fund-tracker 移动端通用适配 ========== */

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ========== 小屏幕适配 ========== */
@media screen and (max-width: 768px) {
    
    /* 核心：允许页面滚动 */
    html, body {
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* layout 容器：取消 absolute 定位体系，改为普通流式布局 */
    .easyui-layout {
        position: static !important;
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* 所有 panel 强制垂直堆叠（关键修复） */
    .easyui-layout .layout-panel,
    .easyui-layout .layout-panel-north,
    .easyui-layout .layout-panel-center,
    .easyui-layout .layout-panel-south {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        float: none !important;
        clear: both !important;
    }
    
    /* 各区域高度 */
    .easyui-layout .layout-panel-north {
        height: auto !important;
    }
    
    .easyui-layout .layout-panel-center {
        height: auto !important;
        overflow: visible !important;
    }
    
    .easyui-layout .layout-panel-south {
        height: 350px !important;
        min-height: 350px !important;
    }
    
    /* datagrid 关键修复：横向滚动，纵向自然撑开 */
    .datagrid {
        height: auto !important;
        width: 100% !important;
    }
    
    .datagrid-wrap {
        height: auto !important;
        width: 100% !important;
    }
    
    /* datagrid 横向滚动提示 */
    .datagrid-view {
        height: auto !important;
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        /* 底部阴影提示可滚动 */
        background: linear-gradient(to right, white 95%, rgba(0,0,0,0.1) 100%);
    }
    
    /* view1（行号列）保持自然宽度，不要 100% */
    .datagrid-view1 {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* view2 最小宽度 = 所有列宽总和（约 766px） */
    .datagrid-view2 {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        min-width: 950px !important;  /* ← 原来是 766，改为 950 匹配所有列 */
        height: auto !important;
        margin-left: 0 !important;
    }
    
    .datagrid-body {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .datagrid-header {
        height: auto !important;
    }
    
    .datagrid-header-inner {
        height: auto !important;
    }
    
    /* 行高固定，EasyUI 需要精确计算 */
    .datagrid-row {
        height: 44px !important;
    }
    
    .datagrid-cell {
        font-size: 14px !important;
        padding: 10px 6px !important;
        white-space: nowrap !important;
        height: 44px !important;
        line-height: 24px !important;
    }
    
    /* 按钮放大（手指易点） */
    .l-btn {
        font-size: 16px !important;
        padding: 10px 18px !important;
        height: 46px !important;
        line-height: 26px !important;
        margin: 5px !important;
    }
    
    /* 状态栏 */
    .signal-panel {
        margin: 10px !important;
        padding: 15px !important;
    }
    
    .signal-panel td {
        display: block;
        width: 100% !important;
        padding: 8px 0 !important;
    }
    
    .status-label {
        font-size: 18px !important;
    }
    
    .current-hold,
    .next-suggest {
        font-size: 26px !important;
    }
    
    /* 隐藏 resize 手柄 */
    .layout-split-proxy-h,
    .layout-split-proxy-v,
    .layout-split-north,
    .layout-split-south {
        display: none !important;
    }
}

/* ========== 超小屏幕 ========== */
@media screen and (max-width: 375px) {
    .l-btn {
        font-size: 15px !important;
        padding: 8px 14px !important;
        height: 42px !important;
    }
    
    .datagrid-cell {
        font-size: 13px !important;
        padding: 6px 4px !important;
    }
    
    .status-label {
        font-size: 16px !important;
    }
    
    .current-hold,
    .next-suggest {
        font-size: 22px !important;
    }
}