<?xml version="1.0" encoding="utf-8"?>
<root><![CDATA[<div id="attackevasive_1" class="popupmenu_option" style="padding: 20px;"><div id="puzzle-container"></div><form id="puzzle-form" action="https://www.x163.com.cn/plugin.php?id=comiis_weixin&mod=wxlogin&inajax=1" method="post" style="display:none;"><input type="hidden" name="puzzle_result" id="puzzle_result" value=""><input type="hidden" name="secqsubmit" value="1"></form><script>
                    var puzzleContainer = document.getElementById("puzzle-container");
                    var puzzleHtml = createPuzzleVerify(196);
                    puzzleContainer.innerHTML = puzzleHtml;
                    
                    function createPuzzleVerify(targetPos) {
                        return `
                            <div class="puzzle-box">
                                <div class="puzzle-header">
                                    <div class="puzzle-title">安全验证</div>
                                    <div class="puzzle-subtitle">拖动滑块将拼图块放入缺口</div>
                                </div>
                                <div class="puzzle-canvas-container">
                                    <canvas id="puzzleCanvas" width="300" height="150"></canvas>
                                    <canvas id="puzzleBlockCanvas" width="50" height="50" style="position: absolute; left: 0; top: 50px; pointer-events: none;"></canvas>
                                </div>
                                <div class="puzzle-slider-container">
                                    <div class="puzzle-slider-bg" id="puzzleSliderBg"></div>
                                    <div class="puzzle-slider-progress" id="puzzleSliderProgress"></div>
                                    <div class="puzzle-slider-text" id="puzzleSliderText">▶ 拖动滑块完成拼图</div>
                                    <div class="puzzle-slider-btn" id="puzzleSliderBtn" onmousedown="startDrag(event)" ontouchstart="startDrag(event)">▶</div>
                                </div>
                                <div class="puzzle-footer">
                                    <span class="puzzle-tip">验证成功后自动跳转</span>
                                </div>
                            </div>
                        `;
                    }
                    
                    // 初始化画布
                    setTimeout(function() {
                        initCanvas(196);
                    }, 100);
                    
                    function initCanvas(targetX) {
                        const canvas = document.getElementById("puzzleCanvas");
                        const blockCanvas = document.getElementById("puzzleBlockCanvas");
                        const ctx = canvas.getContext("2d");
                        const blockCtx = blockCanvas.getContext("2d");
                        
                        // 创建渐变背景
                        const gradient = ctx.createLinearGradient(0, 0, 300, 150);
                        gradient.addColorStop(0, "#667eea");
                        gradient.addColorStop(0.5, "#764ba2");
                        gradient.addColorStop(1, "#9f7aea");
                        
                        // 绘制背景图
                        ctx.fillStyle = gradient;
                        ctx.fillRect(0, 0, 300, 150);
                        
                        // ========== 随机位置的装饰图案 ==========
                        ctx.fillStyle = "rgba(255, 255, 255, 0.2)";
                        
                        // 第一个圆 - 随机位置
                        let x1 = Math.random() * 250 + 25; // 25-275
                        let y1 = Math.random() * 120 + 15; // 15-135
                        ctx.beginPath();
                        ctx.arc(x1, y1, 15, 0, Math.PI * 2);
                        ctx.fill();
                        
                        // 第二个圆 - 随机位置
                        let x2 = Math.random() * 250 + 25;
                        let y2 = Math.random() * 120 + 15;
                        ctx.beginPath();
                        ctx.arc(x2, y2, 25, 0, Math.PI * 2);
                        ctx.fill();
                        
                        // 第三个圆 - 随机位置
                        let x3 = Math.random() * 250 + 25;
                        let y3 = Math.random() * 120 + 15;
                        ctx.beginPath();
                        ctx.arc(x3, y3, 20, 0, Math.PI * 2);
                        ctx.fill();
                        
                        ctx.fillStyle = "rgba(255, 255, 255, 0.3)";
                        ctx.font = "bold 40px Arial";
                        ctx.fillText("◈", 180, 60);
                        
                        // 绘制缺口
                        ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
                        ctx.beginPath();
                        ctx.arc(targetX, 75, 25, 0, Math.PI * 2);
                        ctx.fill();
                        
                        // 绘制缺口边框
                        ctx.strokeStyle = "#fff";
                        ctx.lineWidth = 2;
                        ctx.setLineDash([5, 3]);
                        ctx.beginPath();
                        ctx.arc(targetX, 75, 25, 0, Math.PI * 2);
                        ctx.stroke();
                        ctx.setLineDash([]);
                        
                        // 绘制拼图块
                        blockCtx.fillStyle = "#764ba2";
                        blockCtx.shadowColor = "rgba(0, 0, 0, 0.3)";
                        blockCtx.shadowBlur = 10;
                        blockCtx.beginPath();
                        blockCtx.arc(25, 25, 23, 0, Math.PI * 2);
                        blockCtx.fill();
                        
                        // 绘制拼图块上的图案
                        blockCtx.fillStyle = "rgba(255, 255, 255, 0.3)";
                        blockCtx.shadowBlur = 0;
                        blockCtx.font = "bold 30px Arial";
                        blockCtx.fillText("☻", 9, 32);
                        
                        // 绘制拼图块边框
                        blockCtx.strokeStyle = "#fff";
                        blockCtx.lineWidth = 2;
                        blockCtx.beginPath();
                        blockCtx.arc(25, 25, 23, 0, Math.PI * 2);
                        blockCtx.stroke();
                    }

                    var isDragging = false;
                    var startX = 0;
                    var currentX = 0;
                    var slideBtn = document.getElementById("puzzleSliderBtn");
                    var slideProgress = document.getElementById("puzzleSliderProgress");
                    var slideText = document.getElementById("puzzleSliderText");
                    var blockCanvas = document.getElementById("puzzleBlockCanvas");
                    var maxDrag = 250;

                    function startDrag(e) {
                        e.preventDefault();
                        isDragging = true;
                        startX = e.type === "mousedown" ? e.clientX : e.touches[0].clientX;
                        
                        document.addEventListener("mousemove", onDrag);
                        document.addEventListener("touchmove", onDrag);
                        document.addEventListener("mouseup", stopDrag);
                        document.addEventListener("touchend", stopDrag);
                    }

                    function onDrag(e) {
                        if (!isDragging) return;
                        e.preventDefault();
                        
                        var clientX = e.type === "mousemove" ? e.clientX : e.touches[0].clientX;
                        var diffX = clientX - startX;
                        currentX = Math.min(Math.max(0, diffX), maxDrag);
                        
                        slideBtn.style.left = currentX + "px";
                        slideProgress.style.width = currentX + "px";
                        
                        if (blockCanvas) {
                            blockCanvas.style.left = currentX + "px";
                        }
                        
                        var currentBlockX = currentX;
                        var targetBlockX = targetPosition - 25;
                        var distance = Math.abs(currentBlockX - targetBlockX);
                        
                        // 只有当拼图块准确对准缺口时才验证成功
                        if (distance <= 5 && currentBlockX >= targetBlockX - 3 && currentBlockX <= targetBlockX + 3) {
                            verifySuccess();
                        }
                    }

                    function stopDrag() {
                        if (!isDragging) return;
                        
                        var currentBlockX = currentX;
                        var targetBlockX = targetPosition - 25;
                        var distance = Math.abs(currentBlockX - targetBlockX);
                        
                        // 如果没对准缺口，复位
                        if (distance > 5) {
                            slideBtn.style.left = "2px";
                            slideProgress.style.width = "0";
                            if (blockCanvas) {
                                blockCanvas.style.left = "0";
                            }
                            slideText.innerHTML = "▶ 拖动滑块完成拼图";
                            slideText.style.color = "#666";
                        }
                        
                        isDragging = false;
                        document.removeEventListener("mousemove", onDrag);
                        document.removeEventListener("touchmove", onDrag);
                        document.removeEventListener("mouseup", stopDrag);
                        document.removeEventListener("touchend", stopDrag);
                    }

                    function verifySuccess() {
                        // 防止重复验证
                        if (window.verified) return;
                        window.verified = true;
                        
                        var targetBlockX = targetPosition - 25;
                        
                        // 锁定滑块在目标位置
                        slideBtn.style.left = targetBlockX + "px";
                        slideProgress.style.width = targetBlockX + "px";
                        
                        if (blockCanvas) {
                            blockCanvas.style.left = targetBlockX + "px";
                            blockCanvas.style.border = "3px solid #4CAF50";
                            blockCanvas.style.borderRadius = "50%";
                        }
                        
                        slideText.innerHTML = "✓ 验证成功";
                        slideText.style.color = "#4CAF50";
                        
                        // 设置验证结果并提交
                        document.getElementById("puzzle_result").value = "success";
                        setTimeout(function() {
                            document.getElementById("puzzle-form").submit();
                        }, 500);
                    }

                    // 触摸设备优化
                    window.addEventListener("touchmove", function(e) {
                        if (isDragging) {
                            e.preventDefault();
                        }
                    }, { passive: false });
                </script>]]></root>