/* 全站搜尋（Ctrl + /）：側欄搜尋按鈕與搜尋視窗，由 site.php 全站載入 */
/*****************************************************************************/
        /* =========================
   Wiki Sidebar - Search Bar
   ========================= */

        .wiki-searchbar {
            padding: 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            background: rgba(0, 0, 0, 0.25);
        }

        .wiki-search-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 8px;

            border: 1px solid rgba(251, 183, 80, 0.22);
            background: linear-gradient(to bottom, rgba(43, 34, 24, 0.92), rgba(17, 13, 10, 0.92));

            color: #ddd;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: left;
        }

        .wiki-search-btn i {
            width: 22px;
            text-align: center;
            color: var(--primary-gold, #fbb750);
            opacity: 0.9;
        }

        .wiki-search-btn span {
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.3px;
        }

        .wiki-search-btn em {
            margin-left: auto;
            font-style: normal;
            font-size: 12px;
            color: rgba(255, 255, 255, 0.55);
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.35);
            padding: 3px 8px;
            border-radius: 6px;
        }

        .wiki-search-btn:hover {
            border-color: rgba(251, 183, 80, 0.35);
            background: linear-gradient(to bottom, rgba(55, 43, 30, 0.95), rgba(17, 13, 10, 0.95));
            color: #fff;
            transform: translateY(-1px);
        }

        .wiki-search-btn:active {
            transform: translateY(0);
            opacity: 0.95;
        }


        /* =========================
   Search Modal (Overlay)
   ========================= */

        body.wiki-modal-open {
            overflow: hidden;
        }

        .wiki-search-modal {
            position: fixed;
            inset: 0;
            z-index: 9999;
            display: none;
        }

        .wiki-search-modal.is-open {
            display: block;
        }

        .wiki-search-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(2px);
        }

        .wiki-search-panel {
            position: relative;
            width: min(820px, calc(100vw - 28px));
            max-height: min(78vh, 720px);

            margin: 8vh auto 0;
            border-radius: 12px;

            background: rgba(15, 15, 15, 0.95);
            border: 1px solid rgba(251, 183, 80, 0.22);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);

            overflow: hidden;
            animation: wikiModalIn 0.18s ease-out;
        }

        @keyframes wikiModalIn {
            from {
                transform: translateY(-10px);
                opacity: 0.3;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .wiki-search-head {
            display: flex;
            align-items: center;
            justify-content: space-between;

            padding: 14px 16px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);

            background: linear-gradient(to bottom, rgba(43, 34, 24, 0.9), rgba(17, 13, 10, 0.9));
        }

        .wiki-search-title {
            display: flex;
            align-items: center;
            gap: 10px;

            color: var(--primary-gold, #fbb750);
            font-weight: 800;
            letter-spacing: 0.4px;
            font-size: 15px;
        }

        .wiki-search-title i {
            opacity: 0.95;
        }

        .wiki-search-close {
            width: 36px;
            height: 36px;
            border-radius: 8px;

            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.25);

            color: rgba(255, 255, 255, 0.8);
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .wiki-search-close:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            border-color: rgba(251, 183, 80, 0.22);
        }


        /* =========================
   Search Input
   ========================= */

        .wiki-search-input-wrap {
            display: flex;
            align-items: center;
            gap: 10px;

            padding: 14px 16px 8px;
        }

        .wiki-search-input-wrap>i {
            color: rgba(251, 183, 80, 0.9);
            opacity: 0.9;
        }

        .wiki-search-input {
            flex: 1;
            height: 44px;
            padding: 0 12px;

            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.4);

            color: #fff;
            outline: none;
            font-size: 14px;
        }

        .wiki-search-input::placeholder {
            color: rgba(255, 255, 255, 0.45);
        }

        .wiki-search-input:focus {
            border-color: rgba(251, 183, 80, 0.35);
            box-shadow: 0 0 0 3px rgba(251, 183, 80, 0.12);
        }

        .wiki-search-clear {
            width: 44px;
            height: 44px;
            border-radius: 10px;

            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.28);

            color: rgba(255, 255, 255, 0.75);
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .wiki-search-clear:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            border-color: rgba(251, 183, 80, 0.22);
        }

        .wiki-search-hint {
            padding: 0 16px 12px;
            color: rgba(255, 255, 255, 0.55);
            font-size: 12px;
            line-height: 1.6;
        }

        .wiki-search-hint .kbd {
            display: inline-block;
            padding: 1px 7px;
            margin: 0 2px;
            border-radius: 6px;

            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.3);
            color: rgba(255, 255, 255, 0.8);
            font-weight: 700;
        }


        /* =========================
   Results
   ========================= */

        .wiki-search-results {
            padding: 0 10px 12px;
            overflow: auto;
            max-height: calc(min(72vh, 640px) - 150px);
        }

        .wiki-search-item {
            display: flex;
            align-items: center;
            gap: 12px;

            padding: 12px 12px;
            margin: 8px 6px;

            text-decoration: none;
            border-radius: 10px;

            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(0, 0, 0, 0.28);

            color: #ddd;
            transition: all 0.15s ease;
        }

        .wiki-search-item i {
            width: 24px;
            text-align: center;
            color: rgba(251, 183, 80, 0.9);
        }

        .wiki-search-item:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(251, 183, 80, 0.22);
            transform: translateY(-1px);
            color: #fff;
        }

        .wiki-search-item-text {
            flex: 1;
            min-width: 0;
        }

        .wiki-search-item-title {
            font-size: 14px;
            font-weight: 800;
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .wiki-search-item-sub {
            margin-top: 3px;
            font-size: 12px;
            color: rgba(255, 255, 255, 0.55);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .wiki-search-item-desc {
            margin-top: 4px;
            font-size: 12px;
            color: rgba(251, 183, 80, 0.7);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .wiki-search-go {
            color: rgba(255, 255, 255, 0.55);
            transition: all 0.15s ease;
        }

        .wiki-search-item:hover .wiki-search-go {
            color: var(--primary-gold, #fbb750);
        }

        .wiki-search-empty {
            margin: 10px 6px;
            padding: 16px 14px;
            border-radius: 10px;

            border: 1px dashed rgba(255, 255, 255, 0.14);
            background: rgba(0, 0, 0, 0.25);

            color: rgba(255, 255, 255, 0.75);
            font-size: 13px;
            line-height: 1.6;
        }

        .wiki-mark {
            background: rgba(251, 183, 80, 0.22);
            color: #fff;
            padding: 1px 4px;
            border-radius: 4px;
        }

        /* ========= 最近 / 熱門搜尋 ========= */
        .wiki-sec {
            margin: 10px 6px 16px;
        }

        .wiki-sec-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
            color: rgba(255, 255, 255, 0.85);
            font-size: 13px;
            font-weight: 700;
        }

        .wiki-sec-head i {
            margin-right: 5px;
            color: #fbb750;
        }

        .wiki-sec-clear {
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.45);
            font-size: 12px;
            cursor: pointer;
            padding: 2px 6px;
        }

        .wiki-sec-clear:hover {
            color: #ff8a80;
        }

        .wiki-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .wiki-chip {
            display: inline-flex;
            align-items: center;
            padding: 6px 14px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.85);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .wiki-chip:hover {
            border-color: #fbb750;
            background: rgba(251, 183, 80, 0.14);
            color: #fff;
        }

        .wiki-chip.chip-hot {
            border-color: rgba(255, 138, 128, 0.3);
        }

        .wiki-chip.chip-hot::before {
            content: "\f06d"; /* fa-fire */
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            font-size: 11px;
            margin-right: 5px;
            color: #ff8a65;
        }


        /* =========================
   Mobile friendly
   ========================= */
        @media (max-width: 768px) {
            .wiki-searchbar {
                padding: 10px 0 12px;
                border-bottom: none;
                background: transparent;
            }

            .wiki-search-btn {
                border-radius: 10px;
                padding: 12px 12px;
            }

            .wiki-search-panel {
                margin: 10vh auto 0;
                max-height: 78vh;
            }

            .wiki-search-results {
                max-height: calc(78vh - 160px);
            }

            /* 手機不一定有鍵盤，提示淡化 */
            .wiki-search-btn em {
                display: none;
            }
        }