之前的方案(.onHover 和 .background tracking area)都不可靠: - .onHover 在 macOS 上行为不稳定 - .background() 里的 NSView 被 AVPlayerLayer 挡住收不到鼠标事件 新方案:用 NSEvent.addLocalMonitorForEvents 在应用层监听 mouseMoved 事件, 直接检测鼠标是否在窗口 frame 内,完全绕过 SwiftUI 的 hover 机制。 加上双层防抖(lastState + currentlyVisible 检查)避免重复设置。