{"id":101,"date":"2025-08-28T21:27:26","date_gmt":"2025-08-28T13:27:26","guid":{"rendered":"http:\/\/wuchai.net\/plugins\/?page_id=101"},"modified":"2026-05-27T12:03:27","modified_gmt":"2026-05-27T04:03:27","slug":"homepage","status":"publish","type":"page","link":"http:\/\/wuchai.net\/plugins\/","title":{"rendered":"\u9996\u9875"},"content":{"rendered":"\r\n<style>\r\n    \/* \u6807\u9898\u9690\u85cf\u5df2\u7531 PHP wp_head \u5904\u7406\uff0c\u6b64\u5904\u4e0d\u518d\u91cd\u590d *\/\r\n\r\n    \/* \u4e3b\u5bb9\u5668 *\/\r\n    #wuchai-cat-wrapper-6a346e9421cf2 {\r\n        width: 100%;\r\n        margin: 0 auto;\r\n        font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\r\n        color: #333;\r\n        box-sizing: border-box;\r\n    }\r\n\r\n    #wuchai-cat-wrapper-6a346e9421cf2 * {\r\n        box-sizing: border-box;\r\n    }\r\n\r\n    \/* \u5206\u7c7b\u9875\u6807\u9898\u548c\u63cf\u8ff0\u6837\u5f0f (\u4ec5\u5728\u5f52\u6863\u9875\u663e\u793a) *\/\r\n    .wuchai-category-header {\r\n        margin-bottom: 30px;\r\n        padding: 20px;\r\n        background: #fff;\r\n        border-radius: 8px;\r\n        box-shadow: 0 2px 10px rgba(0,0,0,0.05);\r\n        border: 1px solid #eee;\r\n    }\r\n\r\n    .wuchai-category-title {\r\n        margin: 0 0 15px 0;\r\n        font-size: 28px;\r\n        color: #333;\r\n        font-weight: 700;\r\n    }\r\n\r\n    .wuchai-category-description {\r\n        font-size: 16px;\r\n        line-height: 1.6;\r\n        color: #666;\r\n        margin: 0;\r\n    }\r\n\r\n    \/* \u5168\u90e8\u5206\u7c7b\u6309\u94ae\u6837\u5f0f *\/\r\n    .wuchai-cat-item.all-categories {\r\n        background: #f0f7ff;\r\n        border: 2px solid #007cba;\r\n        font-weight: 600;\r\n        color: #007cba;\r\n    }\r\n\r\n    .wuchai-cat-item.all-categories:hover {\r\n        background: #e0efff;\r\n    }\r\n\r\n    .wuchai-cat-item.all-categories.active {\r\n        background: #007cba;\r\n        color: #fff;\r\n    }\r\n\r\n    .wuchai-cat-wrap {\r\n        background: #fff;\r\n        border-radius: 8px;\r\n        padding: 25px;\r\n        margin-bottom: 30px;\r\n        box-shadow: 0 2px 10px rgba(0,0,0,0.05);\r\n        border: 1px solid #eee;\r\n    }\r\n\r\n    .wuchai-search-bar {\r\n        margin-bottom: 25px;\r\n        position: relative;\r\n    }\r\n\r\n    .wuchai-search-input {\r\n        width: 100%;\r\n        padding: 14px 20px;\r\n        border: 2px solid #f0f0f0;\r\n        border-radius: 50px;\r\n        font-size: 16px;\r\n        outline: none;\r\n        transition: all 0.3s ease;\r\n        background: #fafafa;\r\n    }\r\n\r\n    .wuchai-search-input:focus {\r\n        border-color: #007cba;\r\n        background: #fff;\r\n        box-shadow: 0 0 0 4px rgba(0,124,186,0.1);\r\n    }\r\n\r\n   \r\n   .wuchai-cat-breadcrumb {\r\n    margin-bottom: 20px;\r\n    padding-bottom: 15px;\r\n    \/* border-bottom: 1px dashed #e0e0e0; *\/ \/* \u6ce8\u91ca\u6389\u6216\u5220\u9664\u8fd9\u4e00\u884c *\/\r\n    font-size: 14px;\r\n    color: #666;\r\n    min-height: 20px;\r\n    display: none; \/* \u6216\u8005\u76f4\u63a5\u9690\u85cf\u6574\u4e2a\u5bb9\u5668 *\/\r\n}\r\n\r\n\r\n    .wuchai-cat-breadcrumb a {\r\n        color: #007cba;\r\n        text-decoration: none;\r\n        cursor: pointer;\r\n        font-weight: 500;\r\n    }\r\n\r\n    .wuchai-cat-breadcrumb a:hover {\r\n        text-decoration: underline;\r\n    }\r\n\r\n    .wuchai-cat-breadcrumb span {\r\n        color: #ccc;\r\n        margin: 0 8px;\r\n    }\r\n\r\n    \r\n    \r\n    .wuchai-cat-level { \r\n    display: flex; \r\n    flex-wrap: wrap; \/* \u5fc5\u987b\uff1a\u5141\u8bb8\u6362\u884c *\/\r\n    gap: 10px; \r\n    margin-top: 15px; \r\n    overflow-x: visible; \/* \u5fc5\u987b\uff1a\u7981\u6b62\u6eda\u52a8\u6761 *\/\r\n    width: 100%; \/* \u5fc5\u987b\uff1a\u5360\u6ee1\u5bb9\u5668 *\/\r\n}\r\n\r\n\r\n    \r\n  \r\n  .wuchai-cat-item { \r\n    padding: 8px 15px; \r\n    background: #f5f5f5; \r\n    border-radius: 20px; \r\n    cursor: pointer; \r\n    transition: all 0.3s; \r\n    font-size: 14px; \r\n    white-space: nowrap; \/* \u4fdd\u6301\u6587\u5b57\u5728\u4e00\u884c\uff0c\u4f46\u6574\u4f53\u6309\u94ae\u4f1a\u6362\u884c *\/\r\n    flex-shrink: 0; \r\n    \/* \u68c0\u67e5\u8fd9\u91cc\u662f\u5426\u6709 max-width \u6216 min-width \u9650\u5236\uff0c\u5982\u679c\u6709\u8bf7\u5220\u9664 *\/\r\n}\r\n\r\n\r\n    .wuchai-cat-item:hover {\r\n        background: #e6f0ff;\r\n        color: #007cba;\r\n        transform: translateY(-1px);\r\n    }\r\n\r\n    .wuchai-cat-item.active {\r\n        background: #007cba;\r\n        color: #fff;\r\n        box-shadow: 0 2px 5px rgba(0,124,186,0.3);\r\n    }\r\n\r\n    .wuchai-cat-item.has-child::after {\r\n        content: \"\u25be\";\r\n        font-size: 10px;\r\n        margin-left: 6px;\r\n        opacity: 0.7;\r\n    }\r\n\r\n    \/* \u6587\u7ae0\u7f51\u683c\u5e03\u5c40 *\/\r\n    .wuchai-posts-grid {\r\n        display: grid;\r\n        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\r\n        gap: 25px;\r\n        margin-top: 10px;\r\n    }\r\n\r\n    .wuchai-post-card {\r\n        background: #fff;\r\n        border-radius: 12px;\r\n        overflow: hidden;\r\n        box-shadow: 0 4px 12px rgba(0,0,0,0.08);\r\n        transition: transform 0.3s ease, box-shadow 0.3s ease;\r\n        display: flex;\r\n        flex-direction: column;\r\n        height: 100%;\r\n        border: 1px solid #f0f0f0;\r\n    }\r\n\r\n    .wuchai-post-card:hover {\r\n        transform: translateY(-5px);\r\n        box-shadow: 0 8px 20px rgba(0,0,0,0.12);\r\n    }\r\n\r\n    .wuchai-post-thumb {\r\n        height: 200px;\r\n        background: #f9f9f9;\r\n        position: relative;\r\n        overflow: hidden;\r\n        display: block;\r\n    }\r\n\r\n    .wuchai-post-thumb img {\r\n        width: 100%;\r\n        height: 100%;\r\n        object-fit: cover;\r\n        transition: transform 0.5s ease;\r\n    }\r\n\r\n    .wuchai-post-card:hover .wuchai-post-thumb img {\r\n        transform: scale(1.08);\r\n    }\r\n\r\n    .wuchai-post-thumb .no-img {\r\n        display: flex;\r\n        align-items: center;\r\n        justify-content: center;\r\n        height: 100%;\r\n        color: #bbb;\r\n        font-size: 14px;\r\n        background: #f5f5f5;\r\n    }\r\n\r\n    .wuchai-post-info {\r\n        padding: 20px;\r\n        flex: 1;\r\n        display: flex;\r\n        flex-direction: column;\r\n    }\r\n\r\n    .wuchai-post-title {\r\n        font-size: 18px;\r\n        font-weight: 700;\r\n        margin-bottom: 12px;\r\n        line-height: 1.4;\r\n    }\r\n\r\n    .wuchai-post-title a {\r\n        color: #222;\r\n        text-decoration: none;\r\n        transition: color 0.2s;\r\n    }\r\n\r\n    .wuchai-post-title a:hover {\r\n        color: #007cba;\r\n    }\r\n\r\n    \/* \u6587\u7ae0\u5143\u6570\u636e\u6837\u5f0f *\/\r\n    .wuchai-post-meta {\r\n        margin-top: auto;\r\n        padding-top: 15px;\r\n        border-top: 1px solid #f0f0f0;\r\n        display: flex;\r\n        justify-content: space-between;\r\n        align-items: center;\r\n        font-size: 13px;\r\n        color: #888;\r\n        flex-wrap: wrap;\r\n        gap: 10px;\r\n    }\r\n\r\n    .wuchai-post-date {\r\n        margin-right: auto;\r\n    }\r\n\r\n    .wuchai-post-author {\r\n        display: flex;\r\n        align-items: center;\r\n        text-decoration: none;\r\n        color: #666;\r\n        transition: color 0.2s;\r\n    }\r\n\r\n    .wuchai-post-author:hover {\r\n        color: #007cba;\r\n    }\r\n\r\n    .wuchai-post-author i, .wuchai-post-views i {\r\n        margin-right: 4px;\r\n        font-style: normal;\r\n    }\r\n\r\n    .wuchai-post-views {\r\n        display: flex;\r\n        align-items: center;\r\n    }\r\n    \r\n    .wuchai-post-views span, .wuchai-post-views i {\r\n        font-size: 13px;\r\n        color: #888;\r\n    }\r\n\r\n    .wuchai-empty {\r\n        grid-column: 1\/-1;\r\n        text-align: center;\r\n        padding: 60px 20px;\r\n        background: #fff;\r\n        border-radius: 12px;\r\n        color: #666;\r\n        border: 1px dashed #ddd;\r\n    }\r\n\r\n    \/* \u79fb\u52a8\u7aef\u9002\u914d *\/\r\n    @media (max-width: 768px) {\r\n        .wuchai-posts-grid {\r\n            grid-template-columns: 1fr;\r\n        }\r\n        \r\n        .wuchai-cat-level {\r\n            overflow-x: auto;\r\n            flex-wrap: nowrap;\r\n            padding-bottom: 15px;\r\n            -webkit-overflow-scrolling: touch;\r\n            margin-left: -25px;\r\n            margin-right: -25px;\r\n            padding-left: 25px;\r\n            padding-right: 25px;\r\n        }\r\n        \r\n        .wuchai-cat-item {\r\n            flex-shrink: 0;\r\n        }\r\n    }\r\n    \r\n    \/* \u5206\u7c7b\u9875\u9876\u90e8\u5bfc\u822a\u9002\u914d *\/\r\n    .archive.category #wuchai-cat-wrapper-6a346e9421cf2 .wuchai-cat-wrap {\r\n        padding: 15px;\r\n        margin-bottom: 15px;\r\n    }\r\n\r\n    \/* \u5f52\u6863\u9875\u4e13\u7528\u6837\u5f0f *\/\r\n    .wuchai-archive-nav-wrapper { \r\n        width: 100%; \r\n        margin-bottom: 30px; \r\n        clear: both; \r\n        position: relative; \r\n        z-index: 10; \r\n    }\r\n    \r\n    .wuchai-archive-nav-wrapper #wuchai-cat-wrapper-6a346e9421cf2 { \r\n        max-width: 100% !important; \r\n        width: 100% !important; \r\n        margin: 0 !important; \r\n        padding: 0 !important; \r\n    }\r\n    \r\n        \/* \u5f52\u6863\u6a21\u5f0f\u4e0b\u9690\u85cf\u641c\u7d22\u6846\u548c\u6587\u7ae0\u5217\u8868 *\/\r\n    .wuchai-archive-nav-wrapper .wuchai-search-bar,\r\n    .wuchai-archive-nav-wrapper .wuchai-posts-grid {\r\n        display: none !important;\r\n    }\r\n    \r\n    .wuchai-archive-nav-wrapper .wuchai-cat-wrap {\r\n        margin-bottom: 0;\r\n        box-shadow: none;\r\n        border-bottom: 1px solid #eee;\r\n        border-radius: 0;\r\n        background: transparent;\r\n        border-left: none;\r\n        border-right: none;\r\n        border-top: none;\r\n        padding: 15px;\r\n        \r\n        \/* \u7535\u8111\u7aef\u4fdd\u6301\u5c45\u4e2d\u4e14\u9650\u5236\u6700\u5927\u5bbd\u5ea6 *\/\r\n        max-width: 820px; \r\n        margin: 0 auto;\r\n        width: 100%; \/* \u786e\u4fdd\u57fa\u7840\u5bbd\u5ea6\u5360\u6ee1 *\/\r\n        box-sizing: border-box; \/* \u786e\u4fdd padding \u4e0d\u6491\u5927\u5bbd\u5ea6 *\/\r\n    }\r\n\r\n    \/* \ud83d\udc47 \u65b0\u589e\uff1a\u5c0f\u5c4f\u8bbe\u5907\u81ea\u9002\u5e94\u4fee\u590d \ud83d\udc47 *\/\r\n    @media (max-width: 820px) {\r\n        .wuchai-archive-nav-wrapper .wuchai-cat-wrap {\r\n            max-width: 100% !important; \/* \u5c0f\u5c4f\u4e0b\u53d6\u6d88 820px \u9650\u5236\uff0c\u5360\u6ee1\u5c4f\u5e55 *\/\r\n            padding: 10px !important;   \/* \u9002\u5f53\u51cf\u5c0f\u5185\u8fb9\u8ddd *\/\r\n        }\r\n        \r\n        \/* \u786e\u4fdd\u5185\u90e8\u5bfc\u822a\u6761\u4e5f\u5141\u8bb8\u6362\u884c\uff0c\u4e0d\u51fa\u73b0\u6eda\u52a8\u6761 *\/\r\n        .wuchai-archive-nav-wrapper .wuchai-cat-level {\r\n            flex-wrap: wrap !important;\r\n            overflow-x: visible !important;\r\n            justify-content: center; \/* \u53ef\u9009\uff1a\u8ba9\u6309\u94ae\u5c45\u4e2d\u5bf9\u9f50 *\/\r\n        }\r\n    }\r\n\r\n    \r\n    @media (max-width: 768px) {\r\n    .wuchai-cat-level {\r\n        gap: 8px; \/* \u51cf\u5c0f\u95f4\u8ddd *\/\r\n    }\r\n    .wuchai-cat-item {\r\n        padding: 6px 12px; \/* \u51cf\u5c0f\u5185\u8fb9\u8ddd *\/\r\n        font-size: 13px; \/* \u7a0d\u5fae\u51cf\u5c0f\u5b57\u4f53 *\/\r\n    }\r\n}\r\n\r\n\/* \u5f3a\u5236\u4fee\u590d\u6eda\u52a8\u6761\u95ee\u9898 *\/\r\n.wuchai-cat-wrap .wuchai-cat-level {\r\n    flex-wrap: wrap !important;\r\n    overflow-x: visible !important;\r\n    display: flex !important;\r\n}\r\n\r\n\r\n\/* \u72ec\u7acb\u9875\u9762\u5bb9\u5668\u81ea\u9002\u5e94\u4fee\u590d *\/\r\nbody.wuchai-cat-full-page .wuchai-full-container {\r\n    width: 100% !important;\r\n    max-width: 100% !important;\r\n    margin: 0px !important;\r\n    padding-left: 50px !important; \/* \u53ef\u9009\uff1a\u4fdd\u7559\u5de6\u53f3\u95f4\u8ddd *\/\r\n    padding-right: 50px !important;\r\n    box-sizing: border-box !important;\r\n}\r\n\r\n\/* \u786e\u4fdd\u5185\u90e8\u5185\u5bb9\u4e0d\u6ea2\u51fa *\/\r\n.wuchai-cat-wrap, .wuchai-posts-grid {\r\n    max-width: 100%;\r\n    overflow: hidden; \/* \u9632\u6b62\u5185\u5bb9\u6491\u7834\u5bb9\u5668 *\/\r\n}\r\n\r\n\r\n   \r\n\r\n    \r\n<\/style>\r\n\r\n<div id=\"wuchai-cat-wrapper-6a346e9421cf2\">\r\n    \r\n    \r\n    <div class=\"wuchai-cat-wrap\">\r\n        <!-- \u641c\u7d22\u6846\uff1a\u4ec5\u5728\u975e\u5f52\u6863\u6a21\u5f0f\u663e\u793a -->\r\n                <div class=\"wuchai-search-bar\">\r\n            <input type=\"text\" class=\"wuchai-search-input\" placeholder=\"\ud83d\udd0d \u8f93\u5165\u5173\u952e\u8bcd\u641c\u7d22\u6587\u7ae0...\">\r\n        <\/div>\r\n                \r\n        <div class=\"wuchai-cat-breadcrumb\">\r\n            <!-- \u9762\u5305\u5c51\u52a8\u6001\u751f\u6210 -->\r\n        <\/div>\r\n        \r\n        <div class=\"wuchai-cat-level\">\r\n            <div class=\"wuchai-cat-item\" style=\"opacity: 0.5; cursor: default;\">\u6b63\u5728\u52a0\u8f7d\u5206\u7c7b...<\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <!-- \u6587\u7ae0\u5217\u8868\uff1a\u4ec5\u5728\u975e\u5f52\u6863\u6a21\u5f0f\u663e\u793a -->\r\n        <div class=\"wuchai-posts-grid\" id=\"wuchai-posts-container\">\r\n        <div class=\"wuchai-empty\">\u6b63\u5728\u52a0\u8f7d\u6587\u7ae0...<\/div>\r\n    <\/div>\r\n    <\/div>\r\n\r\n<script>\r\n(function($) {\r\n    var wuchai_ajax_url = 'http:\/\/wuchai.net\/plugins\/wp-admin\/admin-ajax.php';\r\n    var wrapperId = '#wuchai-cat-wrapper-6a346e9421cf2';\r\n    var phpArchiveCatId = 0;\r\n    var isArchiveMode = false;\r\n    var archiveNavMode = 'root';\r\n    var allCatsLink = 'http:\/\/wuchai.net\/plugins\/categories'; \r\n    \r\n    function getUrlParam(name) {\r\n        var reg = new RegExp(\"(^|&)\" + name + \"=([^&]*)(&|$)\");\r\n        var r = window.location.search.substr(1).match(reg);\r\n        if (r != null) return decodeURIComponent(r); return null;\r\n    }\r\n\r\n    function updateUrl(catId) {\r\n        if (isArchiveMode) return; \r\n        \r\n        var newUrl = window.location.protocol + \"\/\/\" + window.location.host + window.location.pathname;\r\n        if (catId > 0) {\r\n            newUrl += '?cat=' + catId;\r\n        }\r\n        window.history.pushState({path: newUrl}, '', newUrl);\r\n    }\r\n    \r\n    $(document).ready(function() {\r\n        let currentCatId = 0;\r\n        let currentPath = [{id: 0, name: '\u5168\u90e8\u5206\u7c7b'}];\r\n        let searchKey = '';\r\n        let searchTimer;\r\n\r\n        const urlCatId = getUrlParam('cat');\r\n        \r\n        if (phpArchiveCatId > 0) {\r\n            currentCatId = phpArchiveCatId;\r\n        } else if (urlCatId) {\r\n            currentCatId = parseInt(urlCatId);\r\n        }\r\n        \r\n        \/\/ \u521d\u59cb\u52a0\u8f7d\u5206\u7c7b\r\n        \/\/ \u5982\u679c\u662f\u5f52\u6863\u9875\u4e14\u6a21\u5f0f\u662f current_child\uff0c\u4e14\u5f53\u524d\u6709\u5206\u7c7bID\uff0c\u5219\u4ece\u5f53\u524d\u5206\u7c7b\u5f00\u59cb\u52a0\u8f7d\u5b50\u5206\u7c7b\r\n        \/\/ \u5426\u5219\u4ece\u6839\u8282\u70b9\u52a0\u8f7d\r\n        let initialParentId = 0;\r\n        if (isArchiveMode && archiveNavMode === 'current_child' && currentCatId > 0) {\r\n             \/\/ \u5728\u5f52\u6863\u9875\uff0c\u5982\u679c\u6a21\u5f0f\u662f\u663e\u793a\u5b50\u5206\u7c7b\uff0c\u6211\u4eec\u9700\u8981\u5148\u52a0\u8f7d\u5f53\u524d\u5206\u7c7b\u7684\u4fe1\u606f\uff0c\u7136\u540e\u52a0\u8f7d\u5176\u5b50\u5206\u7c7b\r\n             \/\/ \u4f46\u4e3a\u4e86\u7b80\u5316\uff0c\u6211\u4eec\u76f4\u63a5\u8bf7\u6c42\u5f53\u524d\u5206\u7c7b\u7684\u5b50\u5206\u7c7b\r\n             \/\/ \u6ce8\u610f\uff1aloadCategories \u51fd\u6570\u5185\u90e8\u903b\u8f91\u9700\u8981\u9002\u914d\r\n             loadCategories(currentCatId, true); \/\/ true \u8868\u793a\u8fd9\u662f\u7b2c\u4e00\u5c42\uff0c\u4e0d\u9700\u8981\u9762\u5305\u5c51\u56de\u9000\u903b\u8f91\u7b49\u590d\u6742\u5904\u7406\uff0c\u6216\u8005\u76f4\u63a5 loadCategories(0) \u4f46\u4f20\u5165 mode\r\n        } else {\r\n             loadCategories(0);\r\n        }\r\n        \r\n        if (!isArchiveMode) {\r\n            loadPosts(currentCatId);\r\n        } else {\r\n            $(wrapperId + ' #wuchai-posts-container').remove();\r\n        }\r\n\r\n        $(wrapperId).on('input', '.wuchai-search-input', function() {\r\n            if (isArchiveMode) return;\r\n            searchKey = $(this).val().trim();\r\n            clearTimeout(searchTimer);\r\n            searchTimer = setTimeout(() => loadPosts(currentCatId), 400);\r\n        });\r\n\r\n        $(wrapperId).on('click', '.wuchai-cat-item', function() {\r\n            if ($(this).hasClass('loading')) return;\r\n            \r\n            const catId = parseInt($(this).data('id'));\r\n            const catName = $(this).data('name');\r\n            const hasChild = $(this).data('has-child');\r\n            const catLink = $(this).data('link'); \r\n\r\n            if (isArchiveMode) {\r\n                if (catId === 0) {\r\n                    window.location.href = allCatsLink;\r\n                } else {\r\n                    if (catLink) {\r\n                        window.location.href = catLink;\r\n                    }\r\n                }\r\n            } else {\r\n                $(wrapperId + ' .wuchai-cat-item').removeClass('active');\r\n                $(this).addClass('active');\r\n                currentCatId = catId;\r\n\r\n                updateUrl(catId);\r\n\r\n                if (hasChild) {\r\n                    const pathIndex = currentPath.findIndex(item => item.id === catId);\r\n                    if (pathIndex !== -1) {\r\n                        currentPath = currentPath.slice(0, pathIndex + 1);\r\n                    } else {\r\n                        currentPath.push({id: catId, name: catName});\r\n                    }\r\n                    loadCategories(catId);\r\n                }\r\n                \r\n                loadPosts(catId);\r\n            }\r\n        });\r\n\r\n        $(wrapperId).on('click', '.wuchai-bread-link', function(e) {\r\n            e.preventDefault();\r\n            const catId = parseInt($(this).data('id'));\r\n            \r\n            if (isArchiveMode) {\r\n                window.location.href = $(this).attr('href');\r\n            } else {\r\n                currentCatId = catId;\r\n                const pathIndex = currentPath.findIndex(item => item.id === catId);\r\n                if(pathIndex !== -1) {\r\n                    currentPath = currentPath.slice(0, pathIndex + 1);\r\n                    updateUrl(catId);\r\n                    loadCategories(catId);\r\n                    loadPosts(catId);\r\n                    $(wrapperId + ' .wuchai-cat-item[data-id=\"'+catId+'\"]').addClass('active');\r\n                }\r\n            }\r\n        });\r\n\r\n        function loadCategories(parentId, isInitialArchiveLoad = false) {\r\n            renderBreadcrumb();\r\n            const $catLevel = $(wrapperId + ' .wuchai-cat-level');\r\n            \r\n            if ($catLevel.children().length === 0 || isInitialArchiveLoad) {\r\n                 $catLevel.html('<div class=\"wuchai-cat-item loading\">\u52a0\u8f7d\u4e2d...<\/div>');\r\n            }\r\n\r\n            \/\/ \u786e\u5b9a\u8bf7\u6c42\u6a21\u5f0f\r\n            let requestMode = 'root';\r\n            let requestCurrentCatId = 0;\r\n            \r\n            if (isArchiveMode && archiveNavMode === 'current_child') {\r\n                requestMode = 'current_child';\r\n                \/\/ \u5982\u679c\u662f\u521d\u59cb\u52a0\u8f7d\u5f52\u6863\u9875\uff0c\u4e14\u5f53\u524d\u6709\u5206\u7c7bID\uff0c\u6211\u4eec\u60f3\u663e\u793a\u8fd9\u4e2a\u5206\u7c7b\u7684\u5b50\u5206\u7c7b\r\n                if (isInitialArchiveLoad && phpArchiveCatId > 0) {\r\n                     parentId = phpArchiveCatId; \/\/ \u5f3a\u5236\u7236ID\u4e3a\u5f53\u524d\u5f52\u6863\u5206\u7c7b\r\n                } else if (!isInitialArchiveLoad) {\r\n                     \/\/ \u6b63\u5e38\u70b9\u51fb\u4ea4\u4e92\uff0cparentId \u5df2\u7ecf\u662f\u70b9\u51fb\u7684\u90a3\u4e2a\u5206\u7c7bID\r\n                }\r\n            }\r\n\r\n            $.ajax({\r\n                url: wuchai_ajax_url,\r\n                type: 'POST',\r\n                data: {\r\n                    action: 'wuchai_get_child_cats', \r\n                    parent_id: parentId,\r\n                    mode: requestMode,\r\n                    current_cat_id: phpArchiveCatId \/\/ \u4f20\u9012\u5f53\u524d\u5f52\u6863\u9875ID\u4f9b\u540e\u7aef\u53c2\u8003\r\n                },\r\n                success: function(res) {\r\n                    $catLevel.empty();\r\n                    \r\n                    \/\/ \u53ea\u6709\u5728\u6839\u8282\u70b9\u6216\u8005\u975e\u5f52\u6863\u9875\u7684\u6839\u8282\u70b9\u624d\u663e\u793a\u201c\u5168\u90e8\u5206\u7c7b\u201d\u6309\u94ae\r\n                    \/\/ \u5728\u5f52\u6863\u9875\u7684 current_child \u6a21\u5f0f\u4e0b\uff0c\u901a\u5e38\u4e0d\u663e\u793a\u201c\u5168\u90e8\u5206\u7c7b\u201d\uff0c\u6216\u8005\u663e\u793a\u201c\u8fd4\u56de\u4e0a\u4e00\u7ea7\u201d\r\n                    if (parentId === 0 && !(isArchiveMode && archiveNavMode === 'current_child')) {\r\n                        const allActiveClass = (currentCatId === 0) ? 'active' : '';\r\n                        const linkAttr = `data-link=\"${allCatsLink}\"`;\r\n                        \r\n                        $catLevel.append(`\r\n                            <div class=\"wuchai-cat-item all-categories ${allActiveClass}\" \r\n                                 data-id=\"0\" data-name=\"\u5168\u90e8\u5206\u7c7b\" data-has-child=\"0\" ${linkAttr}>\r\n                                \u5168\u90e8\u5206\u7c7b\r\n                            <\/div>\r\n                        `);\r\n                    }\r\n                    \r\n                    \/\/ \u5982\u679c\u5728\u5f52\u6863\u9875\u4e14\u662f current_child \u6a21\u5f0f\uff0c\u4e14 parentId \u662f\u5f53\u524d\u5f52\u6863\u5206\u7c7b\uff0c\u53ef\u4ee5\u52a0\u4e00\u4e2a\u201c\u8fd4\u56de\u6839\u76ee\u5f55\u201d\u6216\u7c7b\u4f3c\u6309\u94ae\uff1f\r\n                    \/\/ \u6682\u65f6\u4fdd\u6301\u7b80\u6d01\uff0c\u53ea\u663e\u793a\u5b50\u5206\u7c7b\r\n                    \r\n                    if (res.success && res.data.length > 0) {\r\n                        res.data.forEach(cat => {\r\n                            const hasChildAttr = cat.has_child ? 'data-has-child=\"1\"' : '';\r\n                            const activeClass = (cat.id === currentCatId) ? 'active' : '';\r\n                            $catLevel.append(`\r\n                                <div class=\"wuchai-cat-item ${activeClass} ${cat.has_child ? 'has-child' : ''}\" \r\n                                     data-id=\"${cat.id}\" data-name=\"${cat.name}\" data-link=\"${cat.link}\" ${hasChildAttr}>\r\n                                    ${cat.name}\r\n                                <\/div>\r\n                            `);\r\n                        });\r\n                    } else {\r\n                        if (parentId !== 0) {\r\n                             $catLevel.html('<div style=\"color:#999; font-size:14px; padding:5px;\">\u6b64\u5206\u7c7b\u4e0b\u6682\u65e0\u5b50\u5206\u7c7b<\/div>');\r\n                        } else {\r\n                             $catLevel.html('<div style=\"color:#999; font-size:14px; padding:5px;\">\u6682\u65e0\u5206\u7c7b<\/div>');\r\n                        }\r\n                    }\r\n                },\r\n                error: function(err) {\r\n                    console.error('Category Load Error:', err);\r\n                    $catLevel.html('<div style=\"color:red;\">\u52a0\u8f7d\u5206\u7c7b\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5<\/div>');\r\n                }\r\n            });\r\n        }\r\n\r\n        function renderBreadcrumb() {\r\n            const $breadcrumb = $(wrapperId + ' .wuchai-cat-breadcrumb');\r\n            let html = '';\r\n            \r\n            if (isArchiveMode && archiveNavMode === 'current_child' && phpArchiveCatId > 0) {\r\n                 \/\/ \u5728\u5f52\u6863\u9875\u5b50\u5206\u7c7b\u6a21\u5f0f\u4e0b\uff0c\u9762\u5305\u5c51\u53ef\u80fd\u53ea\u9700\u8981\u663e\u793a\u5f53\u524d\u7236\u5206\u7c7b\r\n                 \/\/ \u8fd9\u91cc\u7b80\u5316\u5904\u7406\uff0c\u6682\u4e0d\u663e\u793a\u590d\u6742\u9762\u5305\u5c51\uff0c\u6216\u8005\u663e\u793a \"\u5f53\u524d\u4f4d\u7f6e: XXX \u7684\u5b50\u5206\u7c7b\"\r\n                 html = '<strong>\u5b50\u5206\u7c7b\u5bfc\u822a<\/strong>';\r\n            } else {\r\n                if (currentPath.length === 0) {\r\n                     html = '<strong>\u5168\u90e8\u5206\u7c7b<\/strong>';\r\n                } else {\r\n                    currentPath.forEach((item, index) => {\r\n                        if (index > 0) html += '<span>\u203a<\/span>';\r\n                        if (index === currentPath.length - 1) {\r\n                            html += `<strong>${item.name}<\/strong>`;\r\n                        } else {\r\n                            let link = '';\r\n                            if (isArchiveMode) {\r\n                                 if (item.id === 0) link = allCatsLink;\r\n                                 else link = $(wrapperId + ` .wuchai-cat-item[data-id=\"${item.id}\"]`).data('link') || '#';\r\n                            } else {\r\n                                 link = 'javascript:void(0)';\r\n                            }\r\n                            html += `<a class=\"wuchai-bread-link\" href=\"${link}\" data-id=\"${item.id}\">${item.name}<\/a>`;\r\n                        }\r\n                    });\r\n                }\r\n            }\r\n            $breadcrumb.html(html);\r\n        }\r\n\r\n        function loadPosts(catId) {\r\n            if (isArchiveMode) return;\r\n            \r\n            const $postContainer = $(wrapperId + ' #wuchai-posts-container');\r\n            $postContainer.html('<div class=\"wuchai-empty\">\u6b63\u5728\u4e3a\u60a8\u7b5b\u9009\u6587\u7ae0...<\/div>');\r\n\r\n            $.ajax({\r\n                url: wuchai_ajax_url,\r\n                type: 'POST',\r\n                data: {action: 'wuchai_get_posts', cat_id: catId, search: searchKey},\r\n                success: function(res) {\r\n                    if (res.success && res.data.length) {\r\n                        renderPosts(res.data);\r\n                    } else {\r\n                        $postContainer.html('<div class=\"wuchai-empty\">\ud83d\ude15 \u6ca1\u6709\u627e\u5230\u76f8\u5173\u6587\u7ae0<\/div>');\r\n                    }\r\n                },\r\n                error: function(err) {\r\n                    console.error('Post Load Error:', err);\r\n                    $postContainer.html('<div class=\"wuchai-empty\" style=\"color:red;\">\u52a0\u8f7d\u6587\u7ae0\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5<\/div>');\r\n                }\r\n            });\r\n        }\r\n\r\n        function renderPosts(posts) {\r\n            const $postContainer = $(wrapperId + ' #wuchai-posts-container');\r\n            $postContainer.empty();\r\n            posts.forEach(post => {\r\n                const thumbHtml = post.thumb \r\n                    ? `<img src=\"${post.thumb}\" alt=\"${post.title}\">` \r\n                    : '<div class=\"no-img\">\u6682\u65e0\u5c01\u9762\u56fe<\/div>';\r\n                \r\n                const authorHtml = post.author_link \r\n                    ? `<a href=\"${post.author_link}\" class=\"wuchai-post-author\" title=\"\u67e5\u770b ${post.author_name} \u7684\u6587\u7ae0\"><i class=\"fa fa-user\"><\/i> ${post.author_name}<\/a>`\r\n                    : `<span class=\"wuchai-post-author\"><i class=\"fa fa-user\"><\/i> ${post.author_name}<\/span>`;\r\n\r\n                const viewsHtml = post.views_html \r\n                    ? `<span class=\"wuchai-post-views\">${post.views_html}<\/span>`\r\n                    : '';\r\n                \r\n                const dateHtml = post.date ? `<span class=\"wuchai-post-date\"><i class=\"fa fa-calendar\"><\/i> ${post.date}<\/span>` : '';\r\n\r\n                $postContainer.append(`\r\n                    <article class=\"wuchai-post-card\">\r\n                        <a href=\"${post.link}\" class=\"wuchai-post-thumb\" title=\"\u70b9\u51fb\u67e5\u770b\u5168\u6587\">${thumbHtml}<\/a>\r\n                        <div class=\"wuchai-post-info\">\r\n                            <h2 class=\"wuchai-post-title\"><a href=\"${post.link}\">${post.title}<\/a><\/h2>\r\n                            <div class=\"wuchai-post-meta\">\r\n                                ${dateHtml}\r\n                                ${authorHtml}\r\n                                ${viewsHtml}\r\n                            <\/div>\r\n                        <\/div>\r\n                    <\/article>\r\n                `);\r\n            });\r\n        }\r\n    });\r\n})(jQuery);\r\n<\/script>\r\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-templates\/fenlei-page-template.php","meta":[],"acf":[],"_links":{"self":[{"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/pages\/101"}],"collection":[{"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":3,"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/pages\/101\/revisions"}],"predecessor-version":[{"id":190,"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/pages\/101\/revisions\/190"}],"wp:attachment":[{"href":"http:\/\/wuchai.net\/plugins\/wp-json\/wp\/v2\/media?parent=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}