/* 移动端表格滚动修复和优化 */

/* 基础移动端表格容器 */
@media (max-width: 768px) {
    
    /* 表格容器优化 */
    .bootstrap-table .fixed-table-container {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* 表格主体滚动优化 */
    .bootstrap-table .fixed-table-container .fixed-table-body {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* iOS 动量滚动 */
        scrollbar-width: thin; /* Firefox 细滚动条 */
    }
    
    /* 自定义滚动条样式 */
    .bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar {
        height: 4px;
        width: 4px;
    }
    
    .bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    .bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    
    /* 表格单元格优化 */
    .bootstrap-table .fixed-table-container .table td,
    .bootstrap-table .fixed-table-container .table th {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 13px;
        min-width: 80px;
    }
    
    /* 表格头部固定 */
    .bootstrap-table .fixed-table-container .table thead th {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 10;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        font-size: 12px;
    }
    
    /* 表格行优化 */
    .bootstrap-table .fixed-table-container .table tbody tr {
        border-bottom: 1px solid #e9ecef;
        transition: background-color 0.2s ease;
    }
    
    .bootstrap-table .fixed-table-container .table tbody tr:hover {
        background-color: #f8f9fa;
    }
    
    /* 表格响应式包装器 */
    .table-responsive-mobile {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin: 10px 0;
    }
    
    .table-responsive-mobile::after {
        content: "→";
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: #6c757d;
        font-size: 18px;
        pointer-events: none;
        opacity: 0.6;
        animation: fadeInOut 2s infinite;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0.6; }
        50% { opacity: 0.2; }
    }
    
    /* 隐藏滚动提示当表格完全可见时 */
    .table-responsive-mobile.fully-visible::after {
        display: none;
    }
    
    /* 特定页面表格优化 - 移除负边距，改善移动端体验 */
    .user-earnings-table,
    .user-financial-table,
    .user-withdraw-table {
        margin: 15px 0;
        border-radius: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        background: white;
    }
    
    /* 修复双重类名冲突 */
    .table-responsive.table-responsive-mobile {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .user-earnings-table .table,
    .user-financial-table .table,
    .user-withdraw-table .table {
        margin-bottom: 0;
        min-width: 600px; /* 强制表格宽度确保滚动 */
        font-size: 12px;
    }
    
    .user-earnings-table .table th,
    .user-earnings-table .table td,
    .user-financial-table .table th,
    .user-financial-table .table td,
    .user-withdraw-table .table th,
    .user-withdraw-table .table td {
        white-space: nowrap;
    }
    
    /* 收益表格移动端优化 */
    .user-earnings-table .table th,
    .user-earnings-table .table td {
        padding: 8px 4px;
        font-size: 11px;
        text-align: center;
        vertical-align: middle;
    }
    
    /* 收益表格隐藏不重要的列 */
    .user-earnings-table .table th:nth-child(1),
    .user-earnings-table .table td:nth-child(1) {
        display: none; /* 隐藏ID列 */
    }
    
    .user-earnings-table .table th:nth-child(6),
    .user-earnings-table .table td:nth-child(6) {
        display: none; /* 隐藏注册列 */
    }
    
    .user-earnings-table .table th:nth-child(7),
    .user-earnings-table .table td:nth-child(7) {
        display: none; /* 隐藏总订单列 */
    }
    
    .user-earnings-table .table th:nth-child(8),
    .user-earnings-table .table td:nth-child(8) {
        display: none; /* 隐藏成功订单列 */
    }
    
    .user-earnings-table .table th:nth-child(9),
    .user-earnings-table .table td:nth-child(9) {
        display: none; /* 隐藏金额列 */
    }
    
    /* 文件名列优化 */
    .user-earnings-table .table th:nth-child(2),
    .user-earnings-table .table td:nth-child(2) {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
        text-align: left;
    }
    
    /* 走势图列优化 */
    .user-earnings-table .table th:nth-child(3),
    .user-earnings-table .table td:nth-child(3) {
        width: 60px;
        padding: 4px 2px;
    }
    
    /* 财务记录表格优化 */
    .user-financial-table .table th,
    .user-financial-table .table td {
        padding: 8px 4px;
        font-size: 11px;
        text-align: center;
        vertical-align: middle;
    }
    
    /* 财务记录隐藏不重要的列 */
    .user-financial-table .table th:nth-child(1),
    .user-financial-table .table td:nth-child(1) {
        display: none; /* 隐藏ID列 */
    }
    
    .user-financial-table .table th:nth-child(5),
    .user-financial-table .table td:nth-child(5) {
        display: none; /* 隐藏变更前列 */
    }
    
    .user-financial-table .table th:nth-child(6),
    .user-financial-table .table td:nth-child(6) {
        display: none; /* 隐藏变更后列 */
    }
    
    /* 原因和来源列优化 */
    .user-financial-table .table th:nth-child(2),
    .user-financial-table .table td:nth-child(2),
    .user-financial-table .table th:nth-child(3),
    .user-financial-table .table td:nth-child(3) {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
    }
    
    /* 变更金额列突出显示 */
    .user-financial-table .table th:nth-child(4),
    .user-financial-table .table td:nth-child(4) {
        font-weight: bold;
        min-width: 80px;
    }
    
    /* 提现记录表格优化 */
    .user-withdraw-table .table th,
    .user-withdraw-table .table td {
        padding: 8px 4px;
        font-size: 11px;
        text-align: center;
        vertical-align: middle;
    }
    
    /* 提现记录隐藏不重要的列 */
    .user-withdraw-table .table th:nth-child(1),
    .user-withdraw-table .table td:nth-child(1) {
        display: none; /* 隐藏ID列 */
    }
    
    .user-withdraw-table .table th:nth-child(2),
    .user-withdraw-table .table td:nth-child(2) {
        display: none; /* 隐藏结算货币列 */
    }
    
    .user-withdraw-table .table th:nth-child(5),
    .user-withdraw-table .table td:nth-child(5) {
        display: none; /* 隐藏结算账户列 */
    }
    
    .user-withdraw-table .table th:nth-child(6),
    .user-withdraw-table .table td:nth-child(6) {
        display: none; /* 隐藏账户姓名列 */
    }
    
    .user-withdraw-table .table th:nth-child(7),
    .user-withdraw-table .table td:nth-child(7) {
        display: none; /* 隐藏交易编号列 */
    }
    
    /* 提现金额列优化 */
    .user-withdraw-table .table th:nth-child(3),
    .user-withdraw-table .table td:nth-child(3) {
        font-weight: bold;
        color: #28a745;
        min-width: 80px;
    }
    
    /* 结算方式列优化 */
    .user-withdraw-table .table th:nth-child(4),
    .user-withdraw-table .table td:nth-child(4) {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
    }
    
    /* 状态列优化 */
    .user-withdraw-table .table th:nth-child(8),
    .user-withdraw-table .table td:nth-child(8) {
        min-width: 80px;
    }
    
    .user-withdraw-table .table td:nth-child(8) .label {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 3px;
        display: inline-block;
        min-width: 60px;
    }
    
    /* 时间列优化 */
    .user-earnings-table .table th:nth-child(11),
    .user-earnings-table .table td:nth-child(11),
    .user-financial-table .table th:nth-child(7),
    .user-financial-table .table td:nth-child(7),
    .user-withdraw-table .table th:nth-child(9),
    .user-withdraw-table .table td:nth-child(9) {
        font-size: 10px;
        white-space: nowrap;
        min-width: 80px;
    }
    
    /* 表单操作按钮区域优化 */
    .form-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }
    
    .form-action-link {
        display: inline-block;
        padding: 8px 16px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        color: #333 !important;
        text-decoration: none !important;
        font-size: 13px;
        transition: all 0.3s ease;
        cursor: pointer;
        white-space: nowrap;
    }
    
    .form-action-link:hover {
        background: #e9ecef;
        border-color: #adb5bd;
        color: #333 !important;
        text-decoration: none !important;
    }
    
    .form-action-link:active {
        background: #dee2e6;
        transform: translateY(1px);
    }
    
    /* 账户信息区域 */
    .account-info {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 10px;
    }
    
    .account-balance {
        font-weight: bold;
        color: #28a745;
        font-size: 14px;
    }
    
    .total-withdraw {
        color: #6c757d;
        font-size: 14px;
    }
    
    /* 数据表格列宽优化 */
    .table td:first-child,
    .table th:first-child {
        min-width: 100px;
        max-width: 150px;
    }
    
    .table td:last-child,
    .table th:last-child {
        min-width: 80px;
        max-width: 120px;
    }
    
    /* 文本溢出处理 */
    .table td {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    /* 数字列右对齐 */
    .table td.text-right,
    .table th.text-right {
        text-align: right;
    }
    
    /* 操作列固定宽度 */
    .table .actions-column {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
    }
    
    /* 表格工具栏优化 */
    .bootstrap-table .fixed-table-toolbar {
        padding: 10px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .bootstrap-table .fixed-table-toolbar .btn-group {
        margin-right: 5px;
    }
    
    .bootstrap-table .fixed-table-toolbar .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* 分页器移动端优化 */
    .bootstrap-table .fixed-table-pagination {
        padding: 10px;
    }
    
    .bootstrap-table .fixed-table-pagination .pagination {
        margin: 0;
        justify-content: center;
    }
    
    .bootstrap-table .fixed-table-pagination .pagination li a {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* 空状态优化 */
    .bootstrap-table .fixed-table-container .no-records-found {
        padding: 30px;
        text-align: center;
        color: #6c757d;
        font-size: 14px;
    }
    
    /* 加载状态优化 */
    .bootstrap-table .fixed-table-loading {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(2px);
    }
    
    /* 搜索框优化 */
    .bootstrap-table .fixed-table-toolbar .search input {
        border-radius: 20px;
        padding: 8px 15px;
        border: 1px solid #dee2e6;
        font-size: 14px;
    }
    
    /* 表格边框优化 */
    .bootstrap-table .fixed-table-container .table {
        border-collapse: separate;
        border-spacing: 0;
        border: none;
    }
    
    .bootstrap-table .fixed-table-container .table td,
    .bootstrap-table .fixed-table-container .table th {
        border-left: none;
        border-right: none;
        border-top: none;
    }
    
    .bootstrap-table .fixed-table-container .table tbody tr:last-child td {
        border-bottom: none;
    }
    
    /* 表格内容对齐优化 */
    .bootstrap-table .fixed-table-container .table td {
        vertical-align: middle;
    }
    
    /* 小屏幕进一步优化 */
    @media (max-width: 480px) {
        .bootstrap-table .fixed-table-container .table td,
        .bootstrap-table .fixed-table-container .table th {
            padding: 6px 8px;
            font-size: 12px;
            min-width: 60px;
        }
        
        .table-responsive-mobile {
            margin: 10px -15px;
        }
        
        .bootstrap-table .fixed-table-pagination .pagination li a {
            padding: 4px 8px;
            font-size: 11px;
        }
        
        /* 小屏幕表格进一步优化 */
        .user-earnings-table .table th,
        .user-earnings-table .table td,
        .user-financial-table .table th,
        .user-financial-table .table td,
        .user-withdraw-table .table th,
        .user-withdraw-table .table td {
            padding: 6px 2px;
            font-size: 10px;
        }
        
        /* 小屏幕表格容器优化 */
        .user-earnings-table,
        .user-financial-table,
        .user-withdraw-table {
            margin: 10px -5px;
        }
    }
    
    /* 表格滚动提示 */
    .table-responsive-mobile {
        position: relative;
    }
    
    .table-responsive-mobile::before {
        content: "← 左右滑动查看更多";
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 11px;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .table-responsive-mobile.show-scroll-hint::before {
        opacity: 1;
    }
    
    /* 表格数据为空时的提示 */
    .table tbody:empty::after {
        content: "暂无数据";
        display: block;
        text-align: center;
        color: #6c757d;
        font-size: 14px;
        padding: 40px 20px;
    }
    
    /* 加载状态优化 */
    .table-loading {
        position: relative;
    }
    
    .table-loading::after {
        content: "数据加载中...";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(255, 255, 255, 0.9);
        padding: 10px 20px;
        border-radius: 4px;
        font-size: 14px;
        color: #6c757d;
        z-index: 10;
    }
    
    /* 强制表格滚动修复 */
    .user-earnings-table,
    .user-financial-table,
    .user-withdraw-table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .user-earnings-table .table,
    .user-financial-table .table,
    .user-withdraw-table .table {
        width: auto !important;
        display: table !important;
    }
}

/* 桌面端保持原有样式 */
@media (min-width: 769px) {
    .table-responsive-mobile::after {
        display: none;
    }
}

/* 触摸友好的交互 */
@media (hover: none) and (pointer: coarse) {
    .bootstrap-table .fixed-table-container .table tbody tr:hover {
        background-color: transparent;
    }
    
    .bootstrap-table .fixed-table-container .table tbody tr:active {
        background-color: #f8f9fa;
    }
}