/* 触屏设备：按钮、链接等可点击元素触摸反馈 */
@media (hover: none) and (pointer: coarse), (max-width: 860px) {
    :root {
        --touch-highlight: rgba(37, 99, 235, 0.38);
        --touch-press-bg: rgba(37, 99, 235, 0.22);
        --touch-press-dark-bg: rgba(255, 255, 255, 0.18);
        --touch-sidebar-press: #2563eb;
        --touch-sidebar-active-press: #93c5fd;
    }

    a,
    button,
    [role="button"],
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    input[type="checkbox"],
    input[type="radio"],
    label[for],
    select,
    summary,
    .btn,
    .nav-link,
    .dropdown-item,
    .page-link,
    .list-group-item-action,
    .sidebar-menu li,
    .sidebar-assistant-btn,
    .tab-item,
    .customer-link,
    .ios-file-context-menu-item,
    .app-sidebar-float-toggle,
    .logout-btn,
    .close,
    .modal-header .btn-close {
        -webkit-tap-highlight-color: var(--touch-highlight);
        touch-action: manipulation;
    }

    button:not(:disabled):active,
    .btn:not(:disabled):active,
    input[type="button"]:active,
    input[type="submit"]:active,
    input[type="reset"]:active,
    button.touch-pressed:not(:disabled),
    .btn.touch-pressed:not(:disabled) {
        filter: brightness(0.86);
        transition: filter 0.05s ease;
    }

    a:active,
    a.touch-pressed {
        opacity: 0.72;
        transition: opacity 0.05s ease;
    }

    .nav-link:active,
    .nav-link.touch-pressed,
    .dropdown-item:active,
    .dropdown-item.touch-pressed,
    .page-link:active,
    .page-link.touch-pressed,
    .list-group-item-action:active,
    .list-group-item-action.touch-pressed {
        background-color: var(--touch-press-bg) !important;
        opacity: 1;
        filter: none;
    }

    .sidebar-menu li {
        transition: background-color 0.08s ease, box-shadow 0.08s ease, color 0.08s ease !important;
    }

    .sidebar-menu li:active,
    .sidebar-menu li.touch-pressed {
        background-color: var(--touch-sidebar-press) !important;
        color: #fff !important;
        box-shadow: inset 0 0 0 2px #93c5fd, inset 0 -8px 16px rgba(0, 0, 0, 0.12);
        filter: none;
        opacity: 1;
    }

    .sidebar-menu li a:active,
    .sidebar-menu li a.touch-pressed {
        color: inherit !important;
        opacity: 1;
        filter: none;
    }

    .sidebar-menu li.active:active,
    .sidebar-menu li.active.touch-pressed {
        background-color: var(--touch-sidebar-active-press) !important;
        color: #1e3a8a !important;
        box-shadow: inset 4px 0 0 #1d4ed8, inset 0 0 0 2px #3b82f6;
    }

    .sidebar-menu li.active:active a,
    .sidebar-menu li.active.touch-pressed a {
        color: #1e3a8a !important;
    }

    .sidebar-assistant-btn:active:not(:disabled),
    .sidebar-assistant-btn.touch-pressed:not(:disabled) {
        background-color: rgba(37, 99, 235, 0.28) !important;
        box-shadow: inset 0 0 0 2px rgba(147, 197, 253, 0.85);
        filter: none;
        opacity: 1;
    }

    .tab-item:active,
    .tab-item.touch-pressed {
        opacity: 0.72;
    }

    .customer-link:active,
    .customer-link.touch-pressed {
        background-color: var(--touch-press-bg) !important;
        filter: none;
        opacity: 1;
    }

    .ios-file-context-menu-item:active,
    .ios-file-context-menu-item.touch-pressed {
        background: #e8eef8 !important;
        filter: none;
        opacity: 1;
    }

    .ios-file-context-menu-item[data-ios-file-action="view"]:active,
    .ios-file-context-menu-item[data-ios-file-action="view"].touch-pressed,
    .ios-file-context-menu-item[data-ios-file-action="share"]:active,
    .ios-file-context-menu-item[data-ios-file-action="share"].touch-pressed {
        background: #f0faf4 !important;
        filter: none;
        opacity: 1;
    }

    .app-sidebar-float-toggle:active,
    .app-sidebar-float-toggle.touch-pressed {
        background: #1d4ed8 !important;
        color: #fff !important;
        border-color: #1e40af !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45), 2px 0 18px rgba(37, 99, 235, 0.55) !important;
        transform: scale(0.86);
        filter: none;
        opacity: 1;
        transition: transform 0.08s ease, background-color 0.08s ease, color 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
    }

    .app-sidebar-float-toggle:active .app-sidebar-float-icon,
    .app-sidebar-float-toggle.touch-pressed .app-sidebar-float-icon {
        color: #fff !important;
        transform: scale(1.08);
    }

    .logout-btn:active,
    .logout-btn.touch-pressed {
        filter: brightness(0.82);
        opacity: 1;
    }

    .navbar .user-info a:active,
    .navbar .user-info a.touch-pressed {
        opacity: 0.65;
    }
}
