{"id":72,"date":"2026-05-21T17:59:24","date_gmt":"2026-05-21T09:59:24","guid":{"rendered":"https:\/\/www.eylink.xyz\/?p=72"},"modified":"2026-05-21T17:59:32","modified_gmt":"2026-05-21T09:59:32","slug":"72","status":"publish","type":"post","link":"https:\/\/www.eylink.xyz\/?p=72","title":{"rendered":"\u968f\u673a\u6570\u751f\u6210\u5668"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\">\n    <title>\u968f\u673a\u6570\u751f\u6210\u5668 &#8211; \u81ea\u5b9a\u4e49\u8303\u56f4\u4e0e\u4e2a\u6570<\/title>\n    <style>\n        * {\n            box-sizing: border-box;\n            font-family: system-ui, 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;\n        }\n\n        body {\n            background: linear-gradient(145deg, #f0f4fa 0%, #e6ecf4 100%);\n            min-height: 100vh;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            margin: 0;\n            padding: 20px;\n        }\n\n        \/* \u4e3b\u5361\u7247 *\/\n        .generator-card {\n            max-width: 750px;\n            width: 100%;\n            background: rgba(255,255,255,0.95);\n            backdrop-filter: blur(0px);\n            border-radius: 42px;\n            box-shadow: 0 20px 35px -12px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.05);\n            overflow: hidden;\n            transition: all 0.2s ease;\n            border: 1px solid rgba(255,255,255,0.5);\n        }\n\n        \/* \u5934\u90e8 *\/\n        .header {\n            background: #1a2a3f;\n            background: linear-gradient(135deg, #1e2f3e 0%, #0f1a24 100%);\n            padding: 28px 24px;\n            text-align: center;\n            color: white;\n        }\n\n        .header h1 {\n            margin: 0;\n            font-weight: 700;\n            font-size: 1.9rem;\n            letter-spacing: -0.3px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            gap: 12px;\n        }\n\n        .header h1 span {\n            background: #f4b942;\n            font-size: 1.8rem;\n            display: inline-block;\n            padding: 0 6px;\n            border-radius: 20px;\n        }\n\n        .sub {\n            opacity: 0.8;\n            font-size: 0.9rem;\n            margin-top: 8px;\n            font-weight: 400;\n        }\n\n        \/* \u4e3b\u4f53\u5185\u5bb9 *\/\n        .content {\n            padding: 28px 30px 32px;\n        }\n\n        \/* \u53c2\u6570\u533a\u57df \u7f51\u683c\u5e03\u5c40 *\/\n        .settings-grid {\n            display: flex;\n            flex-wrap: wrap;\n            gap: 24px;\n            margin-bottom: 28px;\n            background: #f9fafc;\n            padding: 20px 20px;\n            border-radius: 32px;\n            box-shadow: inset 0 1px 2px #00000008, 0 2px 6px rgba(0,0,0,0.02);\n        }\n\n        .input-group {\n            flex: 1;\n            min-width: 130px;\n        }\n\n        .input-group label {\n            display: flex;\n            align-items: center;\n            gap: 8px;\n            font-weight: 600;\n            color: #1f2e3a;\n            margin-bottom: 10px;\n            font-size: 0.9rem;\n        }\n\n        .input-group label i {\n            font-style: normal;\n            font-weight: 500;\n            font-size: 1.2rem;\n        }\n\n        .input-group input {\n            width: 100%;\n            padding: 12px 14px;\n            font-size: 1rem;\n            border: 2px solid #e2e8f0;\n            border-radius: 28px;\n            background: white;\n            transition: 0.2s;\n            font-weight: 500;\n            text-align: center;\n            outline: none;\n        }\n\n        .input-group input:focus {\n            border-color: #3b82f6;\n            box-shadow: 0 0 0 3px rgba(59,130,246,0.2);\n        }\n\n        \/* \u590d\u9009\u6846 \u4e0e \u9ad8\u7ea7\u9009\u9879 *\/\n        .option-area {\n            display: flex;\n            flex-wrap: wrap;\n            justify-content: space-between;\n            align-items: center;\n            margin-bottom: 28px;\n            background: #ffffff;\n            padding: 14px 20px;\n            border-radius: 60px;\n            box-shadow: 0 1px 3px rgba(0,0,0,0.05);\n            border: 1px solid #edf2f7;\n        }\n\n        .toggle-duplicate {\n            display: flex;\n            align-items: center;\n            gap: 12px;\n            cursor: pointer;\n            user-select: none;\n            font-weight: 500;\n            color: #1e293b;\n        }\n\n        .toggle-duplicate input {\n            width: 20px;\n            height: 20px;\n            cursor: pointer;\n            accent-color: #3b82f6;\n        }\n\n        .badge-info {\n            background: #eef2ff;\n            padding: 6px 14px;\n            border-radius: 40px;\n            font-size: 0.75rem;\n            color: #2563eb;\n            font-weight: 500;\n        }\n\n        \/* \u751f\u6210\u6309\u94ae *\/\n        .generate-btn {\n            width: 100%;\n            background: linear-gradient(105deg, #2c6e9e 0%, #1b4a6e 100%);\n            border: none;\n            padding: 16px 0;\n            font-size: 1.2rem;\n            font-weight: 700;\n            border-radius: 60px;\n            color: white;\n            cursor: pointer;\n            transition: 0.2s;\n            margin-bottom: 28px;\n            box-shadow: 0 8px 18px rgba(27,74,110,0.25);\n            letter-spacing: 1px;\n        }\n\n        .generate-btn:hover {\n            background: linear-gradient(105deg, #1f5a85 0%, #113a55 100%);\n            transform: scale(1.01);\n            box-shadow: 0 12px 22px rgba(0,0,0,0.2);\n        }\n\n        .generate-btn:active {\n            transform: scale(0.98);\n        }\n\n        \/* \u7ed3\u679c\u9762\u677f *\/\n        .result-panel {\n            background: #f8fafd;\n            border-radius: 32px;\n            padding: 6px 0 12px 0;\n            border: 1px solid #eef2f8;\n            overflow: hidden;\n        }\n\n        .result-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: baseline;\n            padding: 12px 22px 0 22px;\n            flex-wrap: wrap;\n        }\n\n        .result-header h3 {\n            margin: 0;\n            font-weight: 700;\n            color: #0c4a6e;\n            font-size: 1.25rem;\n        }\n\n        .clear-btn {\n            background: none;\n            border: 1px solid #cbd5e1;\n            padding: 5px 18px;\n            border-radius: 40px;\n            font-size: 0.8rem;\n            font-weight: 500;\n            color: #475569;\n            cursor: pointer;\n            transition: 0.2s;\n        }\n\n        .clear-btn:hover {\n            background: #fee2e2;\n            border-color: #f87171;\n            color: #b91c1c;\n        }\n\n        \/* \u6570\u5b57\u5c55\u793a\u533a *\/\n        .numbers-container {\n            background: #ffffff;\n            margin: 16px 20px 20px 20px;\n            border-radius: 28px;\n            padding: 20px 18px;\n            min-height: 220px;\n            max-height: 340px;\n            overflow-y: auto;\n            box-shadow: inset 0 1px 3px #0000000c, 0 1px 2px white;\n            border: 1px solid #eef2ff;\n        }\n\n        .stats-bar {\n            background: #eef3fc;\n            margin: 0 20px 18px 20px;\n            padding: 12px 18px;\n            border-radius: 28px;\n            display: flex;\n            flex-wrap: wrap;\n            justify-content: space-between;\n            gap: 8px;\n            font-size: 0.85rem;\n            font-weight: 500;\n            color: #1f3a4b;\n        }\n\n        .stat-item {\n            background: white;\n            padding: 4px 14px;\n            border-radius: 30px;\n            box-shadow: 0 1px 2px rgba(0,0,0,0.05);\n        }\n\n        .number-badge {\n            display: inline-block;\n            background: #eef2ff;\n            margin: 6px 8px;\n            padding: 8px 16px;\n            border-radius: 40px;\n            font-size: 1rem;\n            font-weight: 600;\n            font-family: 'JetBrains Mono', monospace, 'Courier New';\n            color: #0f2b3d;\n            transition: 0.1s;\n            box-shadow: 0 1px 2px rgba(0,0,0,0.05);\n            border: 1px solid #e0e7ff;\n        }\n\n        .empty-message {\n            text-align: center;\n            color: #94a3b8;\n            padding: 40px 0;\n            font-style: italic;\n            font-weight: 500;\n        }\n\n        footer {\n            font-size: 0.7rem;\n            text-align: center;\n            padding: 16px 20px 20px;\n            color: #6c7a8e;\n            border-top: 1px solid #eef2f8;\n            margin-top: 8px;\n        }\n    <\/style>\n<\/head>\n<body>\n<div class=\"generator-card\">\n    <div class=\"header\">\n        <h1>\n            \ud83c\udfb2 \u968f\u673a\u6570\u751f\u6210\u5668\n            <span>\u26a1<\/span>\n        <\/h1>\n        <div class=\"sub\">\u81ea\u5b9a\u4e49\u8303\u56f4 \u00b7 \u62bd\u53d6\u4e2a\u6570 \u00b7 \u667a\u80fd\u53bb\u91cd<\/div>\n    <\/div>\n    <div class=\"content\">\n        <!-- \u53c2\u6570\u8bbe\u7f6e\u533a -->\n        <div class=\"settings-grid\">\n            <div class=\"input-group\">\n                <label>\ud83d\udcc9 \u6700\u5c0f\u503c (Min)<\/label>\n                <input type=\"number\" id=\"minValue\" value=\"1\" step=\"1\">\n            <\/div>\n            <div class=\"input-group\">\n                <label>\ud83d\udcc8 \u6700\u5927\u503c (Max)<\/label>\n                <input type=\"number\" id=\"maxValue\" value=\"100\" step=\"1\">\n            <\/div>\n            <div class=\"input-group\">\n                <label>\ud83d\udd22 \u62bd\u53d6\u4e2a\u6570 (Count)<\/label>\n                <input type=\"number\" id=\"countValue\" value=\"5\" step=\"1\" min=\"1\">\n            <\/div>\n        <\/div>\n\n        <!-- \u9009\u9879\u533a -->\n        <div class=\"option-area\">\n            <label class=\"toggle-duplicate\">\n                <input type=\"checkbox\" id=\"allowDuplicate\"> \n                <span>\ud83d\udd01 \u5141\u8bb8\u91cd\u590d\u62bd\u53d6<\/span>\n            <\/label>\n            <div class=\"badge-info\">\ud83d\udca1 \u4e0d\u91cd\u590d\u65f6\u81ea\u52a8\u68c0\u6d4b\u8303\u56f4\u662f\u5426\u8db3\u591f<\/div>\n        <\/div>\n\n        <!-- \u751f\u6210\u6309\u94ae -->\n        <button class=\"generate-btn\" id=\"generateBtn\">\u2728 \u751f\u6210\u968f\u673a\u6570 \u2728<\/button>\n\n        <!-- \u7ed3\u679c\u663e\u793a\u533a\u57df -->\n        <div class=\"result-panel\">\n            <div class=\"result-header\">\n                <h3>\ud83d\udccb \u62bd\u53d6\u7ed3\u679c<\/h3>\n                <button class=\"clear-btn\" id=\"clearBtn\">\u6e05\u7a7a\u8bb0\u5f55<\/button>\n            <\/div>\n            <div class=\"stats-bar\" id=\"statsBar\">\n                <span class=\"stat-item\">\ud83d\udcca \u6682\u65e0\u6570\u636e<\/span>\n            <\/div>\n            <div class=\"numbers-container\" id=\"numbersContainer\">\n                <div class=\"empty-message\">\u26a1 \u70b9\u51fb\u4e0a\u65b9\u6309\u94ae\uff0c\u751f\u6210\u968f\u673a\u6570 \u26a1<\/div>\n            <\/div>\n        <\/div>\n        <footer>\n            \u2728 \u652f\u6301\u5927\u8303\u56f4\u62bd\u53d6 | \u4e0d\u91cd\u590d\u6a21\u5f0f\u81ea\u52a8\u89c4\u907f\u51b2\u7a81 | \u76f4\u89c2\u7edf\u8ba1\n        <\/footer>\n    <\/div>\n<\/div>\n\n<script>\n    (function(){\n        \/\/ DOM \u5143\u7d20\n        const minInput = document.getElementById('minValue');\n        const maxInput = document.getElementById('maxValue');\n        const countInput = document.getElementById('countValue');\n        const allowDuplicateCheck = document.getElementById('allowDuplicate');\n        const generateBtn = document.getElementById('generateBtn');\n        const clearBtn = document.getElementById('clearBtn');\n        const numbersContainer = document.getElementById('numbersContainer');\n        const statsBar = document.getElementById('statsBar');\n\n        \/\/ \u8f85\u52a9\u51fd\u6570: \u663e\u793a\u7ed3\u679c\u6838\u5fc3\u6e32\u67d3\n        function renderResults(randomArray, minVal, maxVal, count, allowDup) {\n            \/\/ \u6e05\u7a7a\u5bb9\u5668\n            numbersContainer.innerHTML = '';\n            \n            if (!randomArray || randomArray.length === 0) {\n                numbersContainer.innerHTML = '<div class=\"empty-message\">\u26a0\ufe0f \u6ca1\u6709\u751f\u6210\u4efb\u4f55\u6570\u5b57<\/div>';\n                updateStatsBar(null, allowDup);\n                return;\n            }\n\n            \/\/ \u521b\u5efa\u6570\u5b57\u6807\u7b7e\n            for (let num of randomArray) {\n                const span = document.createElement('span');\n                span.className = 'number-badge';\n                span.textContent = num;\n                numbersContainer.appendChild(span);\n            }\n\n            \/\/ \u7edf\u8ba1\u4fe1\u606f\u5c55\u793a\n            const total = randomArray.length;\n            const minRes = Math.min(...randomArray);\n            const maxRes = Math.max(...randomArray);\n            const sum = randomArray.reduce((acc, v) => acc + v, 0);\n            const avg = (sum \/ total).toFixed(2);\n            const uniqueCount = new Set(randomArray).size;\n            const isAllUnique = (uniqueCount === total);\n            \n            \/\/ \u66f4\u65b0\u7edf\u8ba1\u680f\n            let statsHtml = `\n                <span class=\"stat-item\">\ud83d\udcd0 \u603b\u6570: ${total}<\/span>\n                <span class=\"stat-item\">\ud83d\udcc9 \u6700\u5c0f: ${minRes}<\/span>\n                <span class=\"stat-item\">\ud83d\udcc8 \u6700\u5927: ${maxRes}<\/span>\n                <span class=\"stat-item\">\u2696\ufe0f \u5747\u503c: ${avg}<\/span>\n            `;\n            if (!allowDup) {\n                if (isAllUnique) {\n                    statsHtml += `<span class=\"stat-item\">\u2705 \u65e0\u91cd\u590d \u2713<\/span>`;\n                } else {\n                    statsHtml += `<span class=\"stat-item\">\u26a0\ufe0f \u5b58\u5728\u91cd\u590d(\u4f46\u5141\u8bb8\u91cd\u590d\u672a\u5f00?) \u903b\u8f91\u5f02\u5e38<\/span>`;\n                }\n            } else {\n                statsHtml += `<span class=\"stat-item\">\ud83d\udd04 \u5141\u8bb8\u91cd\u590d\u6a21\u5f0f<\/span>`;\n            }\n            statsBar.innerHTML = statsHtml;\n        }\n\n        function updateStatsBar(errorMessage, isAllowDupMode = false) {\n            if (errorMessage && typeof errorMessage === 'string') {\n                statsBar.innerHTML = `<span class=\"stat-item\">\u26a0\ufe0f ${errorMessage}<\/span>`;\n            } else if (!errorMessage) {\n                \/\/ \u65e0\u6570\u636e\u65f6\u663e\u793a\u7a7a\u767d\u6001\n                statsBar.innerHTML = `<span class=\"stat-item\">\ud83d\udcca \u6682\u65e0\u6570\u636e<\/span>`;\n            }\n        }\n\n        \/\/ \u6e05\u7a7a\u663e\u793a\uff08\u4fdd\u7559\u754c\u9762\u5e72\u51c0\uff09\n        function clearDisplay() {\n            numbersContainer.innerHTML = '<div class=\"empty-message\">\u2728 \u5df2\u6e05\u7a7a\uff0c\u70b9\u51fb\u751f\u6210\u83b7\u53d6\u65b0\u968f\u673a\u6570 \u2728<\/div>';\n            statsBar.innerHTML = `<span class=\"stat-item\">\ud83d\udcca \u6682\u65e0\u6570\u636e<\/span>`;\n        }\n\n        \/\/ \u6838\u5fc3\u751f\u6210\u903b\u8f91\n        function generateRandomNumbers() {\n            \/\/ 1. \u83b7\u53d6\u8f93\u5165\u5e76\u9a8c\u8bc1\n            let min = parseInt(minInput.value, 10);\n            let max = parseInt(maxInput.value, 10);\n            let count = parseInt(countInput.value, 10);\n            const allowDuplicate = allowDuplicateCheck.checked;\n\n            \/\/ \u8fb9\u754c\u60c5\u51b5\u6821\u9a8c\n            if (isNaN(min) || isNaN(max) || isNaN(count)) {\n                showTemporaryError(\"\u8bf7\u786e\u4fdd\u6240\u6709\u8f93\u5165\u6846\u90fd\u662f\u6709\u6548\u6570\u5b57\uff01\");\n                return;\n            }\n\n            if (min > max) {\n                showTemporaryError(`\u6700\u5c0f\u503c (${min}) \u4e0d\u80fd\u5927\u4e8e\u6700\u5927\u503c (${max})\uff0c\u8bf7\u8c03\u6574\u8303\u56f4\u3002`);\n                return;\n            }\n\n            if (count <= 0) {\n                showTemporaryError(`\u62bd\u53d6\u4e2a\u6570\u5fc5\u987b\u5927\u4e8e0\uff0c\u5f53\u524d\u8f93\u5165: ${count}`);\n                return;\n            }\n\n            \/\/ \u8303\u56f4\u8fc7\u5927\u6ea2\u51fa\u4fdd\u62a4 (JS \u6570\u5b57\u5b89\u5168\uff0c\u4f46\u662f range \u5927\u5c0f\u4e0d\u80fd\u592a\u79bb\u8c31, \u9650\u5236\u4e00\u4e0b\u6700\u591a 1000 \u4e07\u9632\u6b62\u5361\u6b7b)\n            const rangeSize = max - min + 1;\n            if (rangeSize > 10_000_000 && !allowDuplicate) {\n                const confirmContinue = confirm(`\u8303\u56f4\u8fc7\u5927 (\u5dee\u503c\u8fbe\u5230 ${rangeSize.toLocaleString()})\uff0c\u62bd\u53d6\u4e0d\u91cd\u590d\u6570\u5b57\u53ef\u80fd\u6d88\u8017\u8f83\u591a\u5185\u5b58\uff0c\u662f\u5426\u7ee7\u7eed\uff1f`);\n                if (!confirmContinue) return;\n            }\n            if (rangeSize <= 0) {\n                showTemporaryError(\"\u8303\u56f4\u65e0\u6548\uff0c\u8bf7\u68c0\u67e5\u6700\u5c0f\u6700\u5927\u503c\");\n                return;\n            }\n\n            \/\/ \u5982\u679c\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u5219\u68c0\u6d4b\u8303\u56f4\u662f\u5426\u8db3\u591f\n            if (!allowDuplicate) {\n                if (count > rangeSize) {\n                    showTemporaryError(`\u65e0\u6cd5\u62bd\u53d6 ${count} \u4e2a\u4e0d\u91cd\u590d\u7684\u6570\u5b57\uff01\u8303\u56f4 [${min}, ${max}] \u5185\u6700\u591a\u53ea\u6709 ${rangeSize} \u4e2a\u4e0d\u540c\u6574\u6570\u3002\u8bf7\u589e\u5927\u8303\u56f4\u6216\u5f00\u542f\u201c\u5141\u8bb8\u91cd\u590d\u201d\u3002`);\n                    return;\n                }\n            }\n\n            \/\/ \u751f\u6210\u968f\u673a\u6570\n            let resultNumbers = [];\n            try {\n                if (allowDuplicate) {\n                    \/\/ \u5141\u8bb8\u91cd\u590d: \u76f4\u63a5\u5faa\u73af\u751f\u6210\n                    for (let i = 0; i < count; i++) {\n                        const rand = Math.floor(Math.random() * (max - min + 1)) + min;\n                        resultNumbers.push(rand);\n                    }\n                } else {\n                    \/\/ \u4e0d\u91cd\u590d: \u91c7\u7528 Fisher-Yates \u90e8\u5206\u62bd\u6837 \/ \u6216\u8005\u4f7f\u7528 set \u4f46\u4e3a\u4e86\u6027\u80fd\u7528 while \u6216 \u73b0\u4ee3\u65b9\u6cd5\n                    \/\/ \u5f53 count \u76f8\u5bf9 rangeSize \u8f83\u5c0f\u65f6\uff0c\u91c7\u7528 set \u968f\u673a\u6dfb\u52a0\u6cd5\u6548\u7387\u9ad8\u4e14\u7b80\u6d01\n                    \/\/ \u5f53 count \u63a5\u8fd1 rangeSize \u65f6\uff0c\u751f\u6210\u5b8c\u6574\u6570\u7ec4\u518d\u6d17\u724c\u53d6\u524d count \u4e5f\u884c\uff0c\u4e3a\u4e86\u901a\u7528\u4f7f\u7528 Set\n                    if (count <= rangeSize \/ 2 || rangeSize < 50000) {\n                        \/\/ \u4f7f\u7528 Set \u53bb\u91cd\u751f\u6210 (\u9002\u5408\u4e2d\u5c0f\u89c4\u6a21)\n                        const randSet = new Set();\n                        while (randSet.size < count) {\n                            const rand = Math.floor(Math.random() * (max - min + 1)) + min;\n                            randSet.add(rand);\n                        }\n                        resultNumbers = Array.from(randSet);\n                        \/\/ \u968f\u673a\u6392\u5e8f\uff08Set \u63d2\u5165\u987a\u5e8f\u5e76\u975e\u968f\u673a\uff0c\u4e3a\u4fdd\u8bc1\u968f\u673a\u611f\u53ef\u6253\u4e71\uff09\n                        for (let i = resultNumbers.length - 1; i > 0; i--) {\n                            const j = Math.floor(Math.random() * (i + 1));\n                            [resultNumbers[i], resultNumbers[j]] = [resultNumbers[j], resultNumbers[i]];\n                        }\n                    } else {\n                        \/\/ \u5f53\u8303\u56f4\u8f83\u5c0f\u4e14\u9700\u8981\u62bd\u53d6\u5927\u91cf\u4e0d\u91cd\u590d\u65f6\uff0c\u751f\u6210\u6574\u4e2a\u6570\u7ec4\u5e76\u6d17\u724c (\u6027\u80fd\u66f4\u597d)\n                        const fullRange = Array.from({length: rangeSize}, (_, idx) => min + idx);\n                        \/\/ Fisher-Yates \u6d17\u724c\u53d6\u524d count\n                        for (let i = fullRange.length - 1; i > 0; i--) {\n                            const j = Math.floor(Math.random() * (i + 1));\n                            [fullRange[i], fullRange[j]] = [fullRange[j], fullRange[i]];\n                        }\n                        resultNumbers = fullRange.slice(0, count);\n                    }\n                }\n            } catch (err) {\n                console.error(err);\n                showTemporaryError(\"\u751f\u6210\u8fc7\u7a0b\u53d1\u751f\u5f02\u5e38\uff0c\u8bf7\u964d\u4f4e\u62bd\u53d6\u4e2a\u6570\u6216\u8303\u56f4\");\n                return;\n            }\n\n            \/\/ \u6700\u7ec8\u6821\u9a8c\u7ed3\u679c\u6570\u91cf (\u56e0\u53bb\u91cd\u53ef\u80fd\u5bfc\u81f4\u5c11\u6570\u91cf\uff1f\u4f46\u5bf9\u4e8e\u4e0d\u91cd\u590d\u6211\u4eec\u5df2\u7ecf\u4fdd\u8bc1 Set \u8fbe\u5230 count\uff0c\u4fdd\u9669\u68c0\u67e5)\n            if (!allowDuplicate && resultNumbers.length !== count) {\n                \/\/ \u7406\u8bba\u4e0a\u4e0d\u4f1a\u53d1\u751f\uff0c\u4f46\u4e07\u4e00\u5b58\u5728bug\u5c31\u91cd\u65b0\u8865\u507f\u5c1d\u8bd5\u4e00\u6b21\u7b80\u5355\u8865\u6551\uff08\u9632\u6b62count\u4e0eset\u957f\u5ea6\u4e0d\u4e00\u81f4\uff09\n                console.warn(\"\u957f\u5ea6\u4e0d\u4e00\u81f4, \u5c1d\u8bd5\u8865\u507f\");\n                const compensationSet = new Set(resultNumbers);\n                while (compensationSet.size < count) {\n                    const extra = Math.floor(Math.random() * (max - min + 1)) + min;\n                    compensationSet.add(extra);\n                }\n                resultNumbers = Array.from(compensationSet);\n                for (let i = resultNumbers.length - 1; i > 0; i--) {\n                    const j = Math.floor(Math.random() * (i + 1));\n                    [resultNumbers[i], resultNumbers[j]] = [resultNumbers[j], resultNumbers[i]];\n                }\n            }\n\n            \/\/ \u5c55\u793a\u7ed3\u679c\n            renderResults(resultNumbers, min, max, count, allowDuplicate);\n            \n            \/\/ \u989d\u5916\u6eda\u52a8\u52a8\u753b\uff08\u8ba9\u7ed3\u679c\u663e\u793a\u66f4\u53cb\u597d\uff09\n            const container = numbersContainer;\n            if (container.scrollHeight > container.clientHeight) {\n                container.scrollTop = 0;\n            }\n        }\n\n        \/\/ \u7b80\u6613\u9519\u8bef\u5f39\u7a97\u5c55\u793a\u98ce\u683c\uff08\u5728\u7edf\u8ba1\u680f\u77ed\u6682\u5c55\u793a\u9519\u8bef\uff0c\u4e0d\u6253\u6270\u4f53\u9a8c\uff09\n        let errorTimeout = null;\n        function showTemporaryError(message) {\n            \/\/ \u4fdd\u5b58\u4e4b\u524d\u7684\u7edf\u8ba1\u680f\u5185\u5bb9\uff08\u82e5\u539f\u672c\u662f\u6570\u636e\u5219\u6682\u5b58\uff0c\u4f46\u7b80\u5355\u5c55\u793a\u9519\u8bef3\u79d2\u540e\u6062\u590d\uff1f\u4e0d\u8fc7\u907f\u514d\u590d\u6742\uff0c\u76f4\u63a5\u663e\u793a\u9519\u8bef\u5e76\u5ef6\u8fdf\u6062\u590d\u6210\u201c\u4e0a\u6b21\u6570\u636e\u201d\u6709\u70b9\u9ebb\u70e6\uff0c\u8fd9\u91cc\u8c03\u7528clear\u663e\u793a\u9519\u8bef\u7136\u540e\u4e0d\u6e05\u9664\u6570\u5b57\u7ed3\u679c\uff1f\n            \/\/ \u6700\u597d\u4e0d\u6e05\u7a7a\u751f\u6210\u7ed3\u679c\uff0c\u4ec5\u5728statBar\u663e\u793a\u9519\u8bef\u5e76\u4e14\u9707\u52a8\u4e00\u4e0b\n            const originalStatsHTML = statsBar.innerHTML;\n            statsBar.innerHTML = `<span class=\"stat-item\" style=\"background:#fee2e2;color:#b91c1c;\">\u274c ${message}<\/span>`;\n            if (errorTimeout) clearTimeout(errorTimeout);\n            errorTimeout = setTimeout(() => {\n                \/\/ \u5982\u679c\u5f53\u524d\u6570\u5b57\u5bb9\u5668\u5185\u6709\u6570\u636e\u5219\u5c1d\u8bd5\u6062\u590d\u539f\u6709\u7684\u7edf\u8ba1\uff0c\u4f46\u6700\u597d\u8c03\u7528\u6839\u636e\u5df2\u6709\u6570\u5b57\u91cd\u5efa\u7edf\u8ba1\uff1f\u7b80\u5355\u5904\u7406\uff1a\u5982\u679c\u6709\u6570\u5b57\u5185\u5bb9\u5c31\u5c1d\u8bd5\u4fdd\u7559\u73b0\u573a\uff1f\u4e3a\u4e86\u4f53\u9a8c\uff0c\u5982\u679c\u5f53\u524dnumbersContainer\u5185\u4e0d\u662f\u7a7a\u6d88\u606f\uff0c\u53ef\u4ee5\u91cd\u65b0\u63d0\u53d6\u6570\u5b57\u5c55\u793a\uff1f\n                const hasNumbers = numbersContainer.querySelectorAll('.number-badge').length > 0;\n                if (hasNumbers) {\n                    \/\/ \u5c1d\u8bd5\u63d0\u53d6\u73b0\u6709\u6570\u5b57\u91cd\u65b0\u7edf\u8ba1\uff0c\u4fdd\u8bc1\u9519\u8bef\u540e\u4e0d\u4e22\u5931\u7edf\u8ba1\u4fe1\u606f\n                    const badges = numbersContainer.querySelectorAll('.number-badge');\n                    const existingNumbers = Array.from(badges).map(el => parseInt(el.textContent, 10)).filter(v => !isNaN(v));\n                    if (existingNumbers.length) {\n                        const allowDup = allowDuplicateCheck.checked;\n                        const minV = Math.min(...existingNumbers);\n                        const maxV = Math.max(...existingNumbers);\n                        const sumV = existingNumbers.reduce((a,b)=>a+b,0);\n                        const avgV = (sumV\/existingNumbers.length).toFixed(2);\n                        let statsHtml = `<span class=\"stat-item\">\ud83d\udcd0 \u603b\u6570: ${existingNumbers.length}<\/span>\n                                        <span class=\"stat-item\">\ud83d\udcc9 \u6700\u5c0f: ${minV}<\/span>\n                                        <span class=\"stat-item\">\ud83d\udcc8 \u6700\u5927: ${maxV}<\/span>\n                                        <span class=\"stat-item\">\u2696\ufe0f \u5747\u503c: ${avgV}<\/span>`;\n                        if (!allowDup && new Set(existingNumbers).size === existingNumbers.length) statsHtml += `<span class=\"stat-item\">\u2705 \u65e0\u91cd\u590d<\/span>`;\n                        statsBar.innerHTML = statsHtml;\n                    } else {\n                        statsBar.innerHTML = `<span class=\"stat-item\">\ud83d\udcca \u4e0a\u6b21\u7ed3\u679c\u5df2\u6e05<\/span>`;\n                    }\n                } else {\n                    statsBar.innerHTML = `<span class=\"stat-item\">\ud83d\udcca \u6682\u65e0\u6570\u636e<\/span>`;\n                }\n                errorTimeout = null;\n            }, 2200);\n        }\n\n        \/\/ \u76d1\u542c\u751f\u6210\u6309\u94ae\n        generateBtn.addEventListener('click', () => {\n            generateRandomNumbers();\n        });\n\n        \/\/ \u6e05\u7a7a\u6309\u94ae\u903b\u8f91\n        clearBtn.addEventListener('click', () => {\n            clearDisplay();\n            if (errorTimeout) {\n                clearTimeout(errorTimeout);\n                errorTimeout = null;\n            }\n        });\n\n        \/\/ \u9644\u52a0\u53cb\u597d\u63d0\u793a\uff1a\u5982\u679c\u6700\u5927\u503c\u6216\u6700\u5c0f\u503c\u53d8\u52a8\u65f6\uff0c\u5bf9\u4e8ecount\u5408\u7406\u6027\u53ef\u540e\u53f0\u9759\u6001\u68c0\u67e5\u4f46\u4e0d\u5f3a\u5236\u62a5\u9519\n        function validateRangeHint() {\n            const min = parseInt(minInput.value, 10);\n            const max = parseInt(maxInput.value, 10);\n            const count = parseInt(countInput.value, 10);\n            if (!isNaN(min) && !isNaN(max) && !isNaN(count) && !allowDuplicateCheck.checked) {\n                const rangeSize = max - min + 1;\n                if (count > rangeSize && rangeSize > 0) {\n                    statsBar.innerHTML = `<span class=\"stat-item\" style=\"background:#fff3cd;\">\u26a0\ufe0f \u63d0\u9192\uff1a\u5f53\u524d\u8303\u56f4\u6700\u591a\u62bd\u53d6 ${rangeSize} \u4e2a\u4e0d\u91cd\u590d\u6570\uff0c\u5f53\u524d count=${count}<\/span>`;\n                } else if (rangeSize > 0 && statsBar.innerHTML.includes(\"\u63d0\u9192\")) {\n                    \/\/ \u6062\u590d\u4f46\u4e0d\u662f\u5f3a\u5236\n                    if (numbersContainer.querySelectorAll('.number-badge').length === 0) {\n                        statsBar.innerHTML = `<span class=\"stat-item\">\ud83d\udcca \u8c03\u6574\u53c2\u6570\u540e\u53ef\u751f\u6210<\/span>`;\n                    }\n                }\n            }\n        }\n\n        minInput.addEventListener('input', validateRangeHint);\n        maxInput.addEventListener('input', validateRangeHint);\n        countInput.addEventListener('input', validateRangeHint);\n        allowDuplicateCheck.addEventListener('change', () => {\n            validateRangeHint();\n            \/\/ \u52fe\u9009\u5141\u8bb8\u91cd\u590d\u65f6\uff0c\u6e05\u9664\u53ef\u80fd\u7684\u4e0d\u91cd\u590d\u9650\u5236\u63d0\u793a\n            if (allowDuplicateCheck.checked) {\n                const hasNumbers = numbersContainer.querySelectorAll('.number-badge').length > 0;\n                if (!hasNumbers) {\n                    statsBar.innerHTML = `<span class=\"stat-item\">\ud83d\udcca \u5141\u8bb8\u91cd\u590d\u6a21\u5f0f\u5df2\u5f00\u542f<\/span>`;\n                } else {\n                    \/\/ \u4fdd\u7559\u539f\u6709\u6570\u5b57\u7edf\u8ba1\uff0c\u4e0d\u8986\u76d6\n                }\n            } else {\n                validateRangeHint();\n            }\n        });\n\n        \/\/ \u521d\u59cb\u5316\u4e00\u4e9b\u9ed8\u8ba4\u5c55\u793a\uff08\u4e0d\u505a\u81ea\u52a8\u751f\u6210\uff0c\u4f46\u4fdd\u7559\u53cb\u597d\u7684\u7a7a\u767d\u63d0\u793a\uff09\n        clearDisplay();\n\n        \/\/ \u5982\u679c\u7528\u6237\u76f4\u63a5\u6309\u56de\u8f66\u5feb\u6377\u952e\u53ef\u89e6\u53d1\u751f\u6210\uff08\u5bf9\u8f93\u5165\u6846\u7126\u70b9\u652f\u6301\uff09\n        const inputs = [minInput, maxInput, countInput];\n        inputs.forEach(inp => {\n            inp.addEventListener('keypress', (e) => {\n                if (e.key === 'Enter') {\n                    e.preventDefault();\n                    generateRandomNumbers();\n                }\n            });\n        });\n    })();\n<\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u673a\u6570\u751f\u6210\u5668 &#8211; \u81ea\u5b9a\u4e49\u8303\u56f4\u4e0e\u4e2a\u6570 \ud83c\udfb2 \u968f\u673a\u6570\u751f\u6210\u5668 \u26a1 \u81ea\u5b9a\u4e49\u8303\u56f4 \u00b7 \u62bd\u53d6\u4e2a\u6570 \u00b7 \u667a\u80fd\u53bb\u91cd \ud83d\udcc9 \u6700\u5c0f\u503c (Min) \ud83d\udcc8 \u6700\u5927\u503c (Max) \ud83d\udd22 \u62bd\u53d6\u4e2a\u6570 (Count) \ud83d\udd01 \u5141\u8bb8\u91cd\u590d\u62bd\u53d6 \ud83d\udca1 \u4e0d\u91cd\u590d\u65f6\u81ea\u52a8\u68c0\u6d4b\u8303\u56f4\u662f\u5426\u8db3\u591f \u2728 \u751f\u6210\u968f\u673a\u6570 \u2728 \ud83d\udccb \u62bd\u53d6\u7ed3\u679c \u6e05\u7a7a\u8bb0\u5f55 \ud83d\udcca \u6682\u65e0\u6570\u636e \u26a1 \u70b9\u51fb\u4e0a\u65b9\u6309\u94ae\uff0c\u751f\u6210\u968f\u673a\u6570 \u26a1 \u2728 \u652f\u6301\u5927\u8303\u56f4\u62bd\u53d6 | \u4e0d\u91cd\u590d\u6a21\u5f0f\u81ea\u52a8\u89c4\u907f\u51b2\u7a81 | \u76f4\u89c2\u7edf\u8ba1<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-daily"],"_links":{"self":[{"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":2,"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.eylink.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}