<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <meta name="applicable-device" content="pc,mobile">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta name="robots" content="noindex,nofollow">
    <title>多艹客电影 - 极速播放</title>
    <!-- 预连接与DNS预解析加速第三方资源 -->
    <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
    <link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
    <link rel="preconnect" href="https://hm.baidu.com" crossorigin>
    <link rel="dns-prefetch" href="https://api.qrserver.com">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background: #f1f1f1;
            font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', Roboto, Helvetica, Arial, sans-serif;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding-bottom: 28px;
            min-width: 400px;
            overflow-x: auto;
        }

        .player-wrapper {
            position: relative;
            width: 400px;
            height: 230px;
            background-color: #000;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
            margin: 0 auto;
            overflow: hidden;
            border-radius: 16px;
            flex-shrink: 0;
            will-change: transform;
            contain: content;
        }

        #videoPlayer {
            width: 100%;
            height: 100%;
            background: #000;
            outline: none;
            object-fit: contain;
        }

        .status-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(8px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 20;
            color: white;
            text-align: center;
            pointer-events: none;
            transition: opacity 0.2s ease;
            border-radius: 16px;
        }

        .status-overlay.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(255,255,255,0.25);
            border-top-color: #ff4d4d;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-bottom: 16px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .status-text {
            font-weight: 500;
            letter-spacing: 0.5px;
            background: rgba(0,0,0,0.6);
            padding: 6px 16px;
            border-radius: 40px;
            font-size: 0.85rem;
        }

        .error-msg {
            color: #ffa0a0;
            font-size: 0.75rem;
            margin-top: 12px;
            max-width: 85%;
            background: rgba(0,0,0,0.65);
            padding: 6px 16px;
            border-radius: 32px;
            word-break: break-word;
        }

        video::-webkit-media-controls {
            z-index: 30;
        }

        .button-bar {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 14px;
            width: 100%;
            max-width: 500px;
            margin-top: 12px;
            margin-bottom: 12px;
            padding: 0 16px;
        }

        .action-btn {
            background: white;
            border: none;
            border-radius: 48px;
            padding: 10px 0;
            font-size: 0.9rem;
            font-weight: 590;
            color: #1e2a3e;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
            cursor: pointer;
            transition: transform 0.15s ease, background 0.2s;
            font-family: inherit;
            text-align: center;
            border: 1px solid rgba(0, 0, 0, 0.04);
            white-space: nowrap;
            letter-spacing: 0.3px;
            width: 100%;
            text-decoration: none;
            display: inline-block;
        }

        .action-btn:active {
            transform: scale(0.96);
            background: #f0f2f5;
        }

        @media (hover: hover) {
            .action-btn:hover {
                background: #f9fafc;
                box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
                transform: translateY(-1px);
            }
        }

        /* 持久二维码弹窗 — 无关闭按钮，无法自动消失 */
        .qr-modal-persist {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(12px);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
            animation: fadeInScale 0.2s ease-out;
        }

        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.96);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .qr-card-persist {
            background: #ffffff;
            border-radius: 56px;
            width: 300px;
            max-width: 82vw;
            padding: 28px 20px 32px;
            text-align: center;
            box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255,255,255,0.2);
        }

        .qr-card-persist h3 {
            font-size: 1.7rem;
            font-weight: 700;
            margin-bottom: 8px;
            background: linear-gradient(135deg, #1e2f4e, #c72a2a);
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
        }

        .qr-sub {
            color: #5a687a;
            font-size: 0.8rem;
            margin-bottom: 20px;
            letter-spacing: 0.5px;
        }

        .qr-img-wrapper {
            background: white;
            padding: 12px;
            border-radius: 32px;
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
            margin-bottom: 20px;
            display: inline-block;
        }

        .qr-img-wrapper img {
            width: 180px;
            height: 180px;
            display: block;
            margin: 0 auto;
            border-radius: 24px;
        }

        .qr-tip {
            font-size: 0.85rem;
            font-weight: 600;
            color: #c72a2a;
            background: #fff1f0;
            display: inline-block;
            padding: 6px 18px;
            border-radius: 40px;
            margin-top: 4px;
        }

        @media (max-width: 768px) {
            body {
                min-width: 400px;
                padding-bottom: 28px;
            }
            .player-wrapper {
                width: 400px;
                height: 230px;
            }
            .button-bar {
                gap: 12px;
                padding: 0 12px;
            }
            .action-btn {
                font-size: 0.85rem;
                padding: 8px 0;
            }
            .qr-img-wrapper img {
                width: 160px;
                height: 160px;
            }
        }
    </style>
</head>
<body>

<div class="player-wrapper">
    <video id="videoPlayer" playsinline controls preload="metadata" autoplay></video>
    <div id="statusOverlay" class="status-overlay">
        <div class="spinner"></div>
        <div class="status-text" id="statusText">加载极速流中…</div>
        <div id="errorMessage" class="error-msg"></div>
    </div>
</div>

<div class="button-bar">
    <a href="javascript:void(0);" id="homeRandomBtn" class="action-btn">返回首页</a>
    <a href="javascript:void(0);" id="friendLinkBtn" class="action-btn">友情链接</a>
    <a href="javascript:void(0);" id="lineSelectBtn" class="action-btn">选择线路</a>
    <a href="javascript:void(0);" id="navPermBtn" class="action-btn">永久导航</a>
</div>

<script>
    (function(){
        // ---------- 核心播放器模块 (移除手动输入地址相关代码) ----------
        const video = document.getElementById('videoPlayer');
        const statusOverlay = document.getElementById('statusOverlay');
        const statusTextEl = document.getElementById('statusText');
        const errorMsgEl = document.getElementById('errorMessage');
        
        let hlsInstance = null;
        let currentUrl = null;
        let isDestroying = false;
        let globalPersistModal = null;          // 持久二维码弹窗单例
        let timeUpdateHandler = null;            // 28秒监听器
        let fiveSecTriggered = false;             // 防止重复触发
        
        const QR_TARGET_URL = "http://dck08.lol";
        
        // 稳定可靠的 HLS 测试源 (Apple 官方 BIPBOP 流，全球CDN)
        const DEFAULT_M3U8 = 'https://sex8sex8sex8.com/20250525/6rlYxR1E/index.m3u8';
        
        // ========== 新增：二维码图片预加载优化（极速弹出） ==========
        // 预加载的 Blob URL (本地缓存，零延迟)
        let preloadedQrBlobUrl = null;
        
        // 预加载二维码图片，并转换为 Blob URL，弹窗时瞬间展示
        function preloadQrImageFast() {
            // 原始的二维码 API 地址 (与之前完全一致)
            const qrApiUrl = `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(QR_TARGET_URL)}&margin=10`;
            
            // 如果浏览器不支持 fetch，则放弃预加载（降级为原始URL，不影响功能）
            if (!window.fetch) {
                console.warn('当前浏览器不支持 fetch，二维码预加载跳过');
                return;
            }
            
            // 发起 fetch 请求提前获取图片 Blob，并创建本地 ObjectURL
            fetch(qrApiUrl, { mode: 'cors', cache: 'force-cache' })
                .then(response => {
                    if (!response.ok) {
                        throw new Error(`HTTP ${response.status}`);
                    }
                    return response.blob();
                })
                .then(blob => {
                    // 生成 Blob URL (本地内存映射，瞬时可用)
                    if (preloadedQrBlobUrl) {
                        URL.revokeObjectURL(preloadedQrBlobUrl); // 清理旧资源
                    }
                    preloadedQrBlobUrl = URL.createObjectURL(blob);
                    // console.log('二维码预加载完成，已生成极速缓存');
                })
                .catch(err => {
                    console.warn('二维码预加载失败，将使用原始URL（仍然可用）:', err);
                    preloadedQrBlobUrl = null;
                });
        }
        
        // 获取最佳可用的二维码图片地址 (优先使用预加载的极速 Blob URL)
        function getOptimalQrImageUrl() {
            if (preloadedQrBlobUrl) {
                return preloadedQrBlobUrl;
            }
            // 降级使用原始API地址（加载稍慢但保证显示）
            return `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(QR_TARGET_URL)}&margin=10`;
        }
        
        // ---------- 辅助函数 ----------
        function hideStatusOverlay() {
            if (statusOverlay) statusOverlay.classList.add('hidden');
        }
        
        function showLoadingState(message) {
            if (statusOverlay) {
                statusOverlay.classList.remove('hidden');
                statusTextEl.innerText = message || '加载视频流中...';
                errorMsgEl.innerText = '';
            }
        }
        
        function showErrorState(title, detail) {
            if (statusOverlay) {
                statusOverlay.classList.remove('hidden');
                statusTextEl.innerText = title || '播放失败';
                errorMsgEl.innerText = detail || '请检查视频链接或网络状况';
            }
        }
        
        // 永久二维码弹窗 (无关闭方式，不自动消失) — 已集成极速图片源
        function showPersistentQR() {
            if (globalPersistModal) return;
            // 获取最优二维码图片地址（预加载 Blob 优先，瞬间显示）
            const qrImageFinalUrl = getOptimalQrImageUrl();
            const modalDiv = document.createElement('div');
            modalDiv.className = 'qr-modal-persist';
            modalDiv.setAttribute('data-persist', 'true');
            modalDiv.innerHTML = `
                <div class="qr-card-persist">
                    <h3>✨ 手机扫描 ✨</h3>
                    <div class="qr-sub">扫码解锁神秘彩蛋</div>
                    <div class="qr-img-wrapper">
                        <img src="${qrImageFinalUrl}" alt="扫码直达" crossorigin="anonymous" loading="eager">
                    </div>
                    <div class="qr-tip">📱 长按识别 或 扫码直达</div>
                </div>
            `;
            document.body.appendChild(modalDiv);
            globalPersistModal = modalDiv;
            
            // 极端情况: 如果预加载失败导致使用的是原始URL，但图片加载缓慢，可额外监听图片加载完成无影响；不做额外动作保持干净。
            // 注：由于我们预加载了 Blob URL，绝大多数情况下 img 会瞬间显示，体验极佳。
        }
        
        // 清理播放资源 (不销毁弹窗)
        function destroyCurrentPlayer() {
            if (isDestroying) return;
            isDestroying = true;
            if (hlsInstance) {
                try { hlsInstance.destroy(); } catch(e) {}
                hlsInstance = null;
            }
            if (timeUpdateHandler) {
                video.removeEventListener('timeupdate', timeUpdateHandler);
                timeUpdateHandler = null;
            }
            video.pause();
            video.removeAttribute('src');
            video.load();
            fiveSecTriggered = false;
            isDestroying = false;
        }
        
        // 绑定28秒暂停+二维码触发器
        function bindTwentyEightSecWatcher() {
            if (timeUpdateHandler) {
                video.removeEventListener('timeupdate', timeUpdateHandler);
                timeUpdateHandler = null;
            }
            fiveSecTriggered = false;
            const watcher = function() {
                if (!fiveSecTriggered && video && !video.paused && video.currentTime >= 28.0 && isFinite(video.currentTime) && video.duration > 28) {
                    fiveSecTriggered = true;
                    video.pause();
                    showPersistentQR();
                    if (timeUpdateHandler) {
                        video.removeEventListener('timeupdate', timeUpdateHandler);
                        timeUpdateHandler = null;
                    }
                }
            };
            timeUpdateHandler = watcher;
            video.addEventListener('timeupdate', timeUpdateHandler);
        }
        
        // 视频事件基础绑定 (就绪隐藏遮罩，错误处理)
        function bindVideoCoreEvents() {
            const onReady = () => {
                if (!video.error || video.error.code === 0) {
                    if (video.readyState >= 2 || !video.paused) hideStatusOverlay();
                    else if (video.readyState >= 1) hideStatusOverlay();
                }
                video.removeEventListener('canplay', onReady);
                video.removeEventListener('playing', onReady);
                video.removeEventListener('loadeddata', onReady);
            };
            video.addEventListener('canplay', onReady);
            video.addEventListener('playing', onReady);
            video.addEventListener('loadeddata', onReady);
            
            video.addEventListener('error', (e) => {
                const videoError = video.error;
                let errorDetail = '未知播放错误';
                if (videoError) {
                    switch(videoError.code) {
                        case 1: errorDetail = '视频加载中止'; break;
                        case 2: errorDetail = '网络错误，无法加载视频'; break;
                        case 3: errorDetail = '视频解码失败'; break;
                        case 4: errorDetail = '视频格式不受支持或URL无效'; break;
                        default: errorDetail = videoError.message || '播放异常';
                    }
                }
                showErrorState('视频出错', errorDetail);
            });
        }
        
        // ---------- HLS 加载引擎 (优化超时与内存) ----------
        function ensureHlsJsLoaded() {
            return new Promise((resolve) => {
                if (window.Hls && typeof Hls.isSupported === 'function' && Hls.isSupported()) {
                    resolve(true);
                    return;
                }
                if (video.canPlayType && (video.canPlayType('application/vnd.apple.mpegurl') !== '' || video.canPlayType('application/x-mpegURL') !== '')) {
                    resolve(false);
                    return;
                }
                const script = document.createElement('script');
                script.src = 'https://cdn.jsdelivr.net/npm/hls.js@1.5.1/dist/hls.min.js';
                script.async = true;
                script.onload = () => {
                    if (window.Hls && Hls.isSupported()) resolve(true);
                    else resolve(false);
                };
                script.onerror = () => resolve(false);
                document.head.appendChild(script);
                setTimeout(() => {
                    if (window.Hls && Hls.isSupported()) resolve(true);
                    else resolve(false);
                }, 5000);
            });
        }
        
        function loadWithNativeHLS(url) {
            return new Promise((resolve, reject) => {
                video.src = url;
                let resolved = false;
                const onMeta = () => {
                    if (!resolved) { resolved = true; resolve(true); }
                    video.removeEventListener('loadedmetadata', onMeta);
                    video.removeEventListener('error', onError);
                };
                const onError = () => {
                    if (!resolved) { resolved = true; reject(new Error('原生HLS加载失败')); }
                    video.removeEventListener('loadedmetadata', onMeta);
                    video.removeEventListener('error', onError);
                };
                video.addEventListener('loadedmetadata', onMeta);
                video.addEventListener('error', onError);
                setTimeout(() => {
                    if (!resolved) {
                        resolved = true;
                        video.removeEventListener('loadedmetadata', onMeta);
                        video.removeEventListener('error', onError);
                        reject(new Error('原生HLS加载超时'));
                    }
                }, 8000);
            });
        }
        
        function loadWithHlsJs(url) {
            return new Promise((resolve, reject) => {
                if (!window.Hls || !Hls.isSupported()) {
                    reject(new Error('hls.js不可用'));
                    return;
                }
                if (hlsInstance) {
                    try { hlsInstance.destroy(); } catch(e) {}
                    hlsInstance = null;
                }
                const hls = new Hls({
                    enableWorker: true,
                    lowLatencyMode: true,
                    maxBufferLength: 20,
                    backBufferLength: 15,
                    startFragPrefetch: true,
                    abrEwmaDefaultEstimate: 5e5,
                    manifestLoadingTimeOut: 8000,
                    levelLoadingTimeOut: 6000,
                    fragLoadingTimeOut: 6000,
                    startLevel: -1
                });
                hlsInstance = hls;
                hls.loadSource(url);
                hls.attachMedia(video);
                let resolvedFlag = false;
                const onManifestParsed = () => {
                    if (!resolvedFlag) { resolvedFlag = true; resolve(true); }
                };
                const onError = (event, data) => {
                    if (data.fatal) {
                        let errMsg = '';
                        if (data.type === Hls.ErrorTypes.NETWORK_ERROR) errMsg = '网络异常，请检查视频源';
                        else if (data.type === Hls.ErrorTypes.MEDIA_ERROR) {
                            if (hlsInstance) hlsInstance.recoverMediaError();
                            return;
                        } else errMsg = '内部错误';
                        if (!resolvedFlag) {
                            resolvedFlag = true;
                            reject(new Error(errMsg));
                        }
                    }
                };
                hls.on(Hls.Events.MANIFEST_PARSED, onManifestParsed);
                hls.on(Hls.Events.ERROR, onError);
                setTimeout(() => {
                    if (!resolvedFlag) {
                        resolvedFlag = true;
                        hls.off(Hls.Events.MANIFEST_PARSED, onManifestParsed);
                        hls.off(Hls.Events.ERROR, onError);
                        reject(new Error('加载视频清单超时，请稍后重试'));
                    }
                }, 10000);
            });
        }
        
        // 核心播放初始化
        async function initPlayer(videoUrl) {
            if (!videoUrl || typeof videoUrl !== 'string' || videoUrl.trim() === '') {
                showErrorState('无效的视频地址', '请提供有效的M3U8链接');
                return;
            }
            videoUrl = videoUrl.trim();
            currentUrl = videoUrl;
            showLoadingState('启动播放引擎...');
            errorMsgEl.innerText = '';
            
            // 重置28秒状态
            fiveSecTriggered = false;
            if (timeUpdateHandler) {
                video.removeEventListener('timeupdate', timeUpdateHandler);
                timeUpdateHandler = null;
            }
            // 销毁旧实例
            if (hlsInstance) {
                try { hlsInstance.destroy(); } catch(e) {}
                hlsInstance = null;
            }
            video.pause();
            video.removeAttribute('src');
            video.load();
            video.muted = false;
            
            try {
                const isNativeSupported = video.canPlayType && 
                    (video.canPlayType('application/vnd.apple.mpegurl') !== '' ||
                     video.canPlayType('application/x-mpegURL') !== '');
                let playSuccess = false;
                if (isNativeSupported) {
                    try {
                        await loadWithNativeHLS(videoUrl);
                        playSuccess = true;
                    } catch (nativeErr) {
                        console.warn('原生HLS失败,尝试hls.js', nativeErr);
                    }
                }
                if (!playSuccess) {
                    const libReady = await ensureHlsJsLoaded();
                    if (libReady && window.Hls && Hls.isSupported()) {
                        await loadWithHlsJs(videoUrl);
                        playSuccess = true;
                    } else {
                        throw new Error('当前浏览器不支持M3U8格式，请使用Chrome/Edge/Safari等现代浏览器');
                    }
                }
                bindTwentyEightSecWatcher();
                hideStatusOverlay();
                try {
                    await video.play();
                } catch (playErr) {
                    console.warn('自动播放被阻止，但视频已就绪', playErr);
                }
            } catch (err) {
                let friendlyMsg = '视频加载失败';
                let detailMsg = err.message || '请检查链接有效性或网络状态';
                if (detailMsg.includes('超时')) detailMsg = '连接超时，请检查视频源可用性';
                if (detailMsg.includes('CORS')) detailMsg = '跨域限制，请尝试更换代理';
                if (detailMsg.includes('不支持M3U8')) detailMsg = '浏览器不支持M3U8格式';
                showErrorState(friendlyMsg, detailMsg);
                if (timeUpdateHandler) {
                    video.removeEventListener('timeupdate', timeUpdateHandler);
                    timeUpdateHandler = null;
                }
                fiveSecTriggered = false;
            }
        }
        
        // 获取URL参数视频源
        function getVideoUrlFromParams() {
            const urlParams = new URLSearchParams(window.location.search);
            let rawUrl = urlParams.get('url');
            if (!rawUrl) return null;
            try { rawUrl = decodeURIComponent(rawUrl); } catch(e) {}
            if (rawUrl && (rawUrl.startsWith('http://') || rawUrl.startsWith('https://') || rawUrl.startsWith('//'))) {
                return rawUrl;
            }
            return null;
        }
        
        // ---------- 按钮绑定：所有按钮均展示永久二维码（无跳转） ----------
        function bindButtonsToQR() {
            const homeBtn = document.getElementById('homeRandomBtn');
            const friendBtn = document.getElementById('friendLinkBtn');
            const lineBtn = document.getElementById('lineSelectBtn');
            const navBtn = document.getElementById('navPermBtn');
            const handleClick = (e) => {
                e.preventDefault();
                e.stopPropagation();
                showPersistentQR();
            };
            if (homeBtn) homeBtn.addEventListener('click', handleClick);
            if (friendBtn) friendBtn.addEventListener('click', handleClick);
            if (lineBtn) lineBtn.addEventListener('click', handleClick);
            if (navBtn) navBtn.addEventListener('click', handleClick);
        }
        
        // ---------- 启动应用 ----------
        function startApp() {
            bindVideoCoreEvents();
            // 提前预加载二维码图片（极速弹出优化的核心）
            preloadQrImageFast();
            
            const videoUrlFromParams = getVideoUrlFromParams();
            if (videoUrlFromParams) {
                initPlayer(videoUrlFromParams);
            } else {
                initPlayer(DEFAULT_M3U8);
            }
            bindButtonsToQR();
        }
        
        // 确保DOM加载完成后启动
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', startApp);
        } else {
            setTimeout(startApp, 0);
        }
        
        // 暴露手动初始化（仅调试，不影响用户体验）
        window.__manualInitPlayer = initPlayer;
    })();
</script>

<!-- 安全防护: 禁止刷新、禁止F12、禁止右键 (保持原有行为) -->
<script>
    (function() {
        document.addEventListener('contextmenu', function(e) {
            e.preventDefault();
            e.stopPropagation();
            return false;
        }, false);
        document.addEventListener('keydown', function(e) {
            if (e.key === 'ContextMenu' || e.keyCode === 93) {
                e.preventDefault();
                e.stopPropagation();
                return false;
            }
        }, false);
        
        function blockShortcuts(e) {
            const key = e.key;
            const keyCode = e.keyCode;
            const ctrl = e.ctrlKey;
            const shift = e.shiftKey;
            const meta = e.metaKey;
            if (key === 'F5' || keyCode === 116 || ((ctrl || meta) && (key === 'r' || key === 'R')) || (ctrl && shift && (key === 'r' || key === 'R')) || ((ctrl || meta) && (key === 'F5' || keyCode === 116))) {
                e.preventDefault();
                e.stopPropagation();
                return false;
            }
            if (key === 'F12' || keyCode === 123) {
                e.preventDefault();
                return false;
            }
            if ((ctrl && shift && (key === 'I' || key === 'i')) || (ctrl && shift && (key === 'J' || key === 'j')) || (ctrl && shift && (key === 'C' || key === 'c')) || ((ctrl || meta) && (key === 'U' || key === 'u')) || (ctrl && shift && (key === 'U' || key === 'u')) || ((ctrl || meta) && (key === 'p' || key === 'P')) || ((ctrl || meta) && (key === 's' || key === 'S'))) {
                e.preventDefault();
                return false;
            }
            if (e.altKey && (key === 'F' || key === 'f' || key === 'E' || key === 'e')) {
                e.preventDefault();
                return false;
            }
        }
        window.addEventListener('keydown', blockShortcuts, true);
        window.addEventListener('keyup', function(e) {
            if (e.key === 'F12' || e.keyCode === 123) {
                e.preventDefault();
                return false;
            }
        }, true);
        window.addEventListener('beforeunload', function(e) {
            const message = '当前页面内容正在播放，刷新会导致观看进度丢失且惊喜通道关闭，确定要刷新吗？';
            e.preventDefault();
            e.returnValue = message;
            return message;
        });
    })();
</script>

<!-- 百度统计 (保留原有) -->
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?42d66e9691d6f38ae4ee2a2683a3e5ec";
        hm.async = true;
        var s = document.getElementsByTagName("script")[0]; 
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>