/* 触控板滑动增强样式 */

/* 为所有可滚动元素启用硬件加速和平滑滚动 */
[data-touchpad-enhanced] {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
}

/* 改善滚动条样式 */
[data-touchpad-enhanced]::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-touchpad-enhanced]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

[data-touchpad-enhanced]::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

[data-touchpad-enhanced]::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 特定容器的滚动优化 */
.checkBoxContainer {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.public-twolines__tree {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.select-dropdown .select-search-ul {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.chat-panel .panel-body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 表格滚动优化 */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 表格元素触控板滚动优化 */
table {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 表格容器滚动优化 */
.table-container,
.dataTables_wrapper {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overflow: auto;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 表格单元格内容滚动 */
td, th {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Layui 弹窗内容滚动优化 */
.layui-layer-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    [data-touchpad-enhanced] {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* 防止触控板滑动时的选择问题 */
[data-touchpad-enhanced] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

[data-touchpad-enhanced] * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 滚动动画效果 */
@keyframes smoothScroll {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(var(--scroll-distance, 0));
    }
}

/* 触控板滚动指示器 */
.touchpad-scroll-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.touchpad-scroll-indicator.active {
    opacity: 1;
}

/* Firefox 滚动条样式 */
[data-touchpad-enhanced] {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* IE/Edge 滚动条样式 */
[data-touchpad-enhanced] {
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* 优化常见组件的滚动行为 */
.nav-tabs-custom .tab-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.panel-body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 修复可能的滚动问题 */
.container-fluid,
.container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 触控板滑动时的视觉反馈 */
[data-touchpad-enhanced].scrolling {
    transition: transform 0.1s ease-out;
}

/* 特殊情况下的滚动优化 */
.modal-body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.dropdown-menu {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 确保表格内容可以正确滚动 */
.table-wrapper {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overflow: auto;
}

/* 侧边栏滚动优化 */
.sidebar {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 内容区域滚动优化 */
.content-wrapper {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 强制表格区域支持触控板滚动 */
table, 
table tbody,
table tbody tr,
table tbody tr td {
    touch-action: auto !important;
    -ms-touch-action: auto !important;
}

/* 确保表格容器支持双指滚动 */
.table-responsive,
.dataTables_wrapper,
.table-container {
    touch-action: auto !important;
    -ms-touch-action: auto !important;
    overscroll-behavior: auto;
    -webkit-overscroll-behavior: auto;
}

/* 针对Bootstrap表格的优化 */
.table {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    touch-action: auto !important;
}

/* 修复可能阻止触控板滚动的样式 */
.table-responsive table {
    min-width: 100%;
    touch-action: auto !important;
}
