/**
 * 滚动条内部方案 - 确保滚动条始终可点击
 * 核心思路：让滚动条成为表格容器的一部分，而不是在外部
 */

/* 所有表格容器统一处理 */
.table-responsive {
    /* 为滚动条预留更大的内部空间 */
    padding-bottom: 30px !important;
    
    /* 确保内容不会被裁剪 */
    box-sizing: border-box !important;
    
    /* 关键：强制滚动条始终显示，不要auto */
    overflow-x: scroll !important;
    
    /* 确保整个容器（包括滚动条区域）都是可交互的 */
    position: relative !important;
    
    /* 防止内容被滚动条遮挡 */
    margin-bottom: 10px !important;
}

/* 表格内容区域 */
.table-responsive > table {
    /* 确保表格不会占用滚动条空间 */
    margin-bottom: 0 !important;
}

/* 自定义滚动条样式 - 使其更突出、更容易抓取 */
.table-responsive::-webkit-scrollbar {
    height: 20px !important;
    /* 滚动条在容器内部，不会溢出 */
    background: #f8f9fa !important;
    /* 强制显示 */
    display: block !important;
    -webkit-appearance: none !important;
}

.table-responsive::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #e9ecef 0%, #f8f9fa 100%) !important;
    border-radius: 10px !important;
    margin: 2px 6px !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05) !important;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #6c757d 0%, #5a6268 100%) !important;
    border-radius: 10px !important;
    border: 3px solid #f8f9fa !important;
    min-width: 60px !important;
    cursor: grab !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
    /* 关键：确保可以点击 */
    pointer-events: auto !important;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #495057 0%, #3d4349 100%) !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25) !important;
    border-width: 2px !important;
}

.table-responsive::-webkit-scrollbar-thumb:active {
    background: linear-gradient(to bottom, #343a40 0%, #23272b 100%) !important;
    cursor: grabbing !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3) !important;
}

/* Firefox 滚动条 */
.table-responsive {
    scrollbar-width: auto !important;
    scrollbar-color: #6c757d #f8f9fa !important;
}

/* 确保在任何情况下滚动条都可交互 */
.table-responsive::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-thumb {
    pointer-events: auto !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* 表格悬停时不影响滚动条 */
.table-responsive:hover {
    /* 保持滚动条可见 */
    overflow-x: scroll !important;
}

/* 确保滚动条区域始终可交互，即使鼠标离开表格内容 */
.table-responsive::-webkit-scrollbar-corner {
    background: #f8f9fa !important;
}

/* 移除任何可能隐藏滚动条的样式 */
.table-responsive:not(:hover)::-webkit-scrollbar {
    display: block !important;
    opacity: 1 !important;
}

.table-responsive:not(:hover)::-webkit-scrollbar-thumb {
    display: block !important;
    opacity: 1 !important;
}

/* 防止表格内容覆盖滚动条区域 */
.table-responsive::after {
    content: '';
    display: block;
    height: 0;
    clear: both;
}
