/* === 繁簡切換器（浮動在 header 上方）=== */


/* 確保 header 是定位父層（不影響原有樣式） */

#header {
    position: relative;
}


/* === 防閃爍：頁面初始隱藏，JS 處理完才顯示 === */


/* 若 JS 失敗或 CDN 斷線，body.zh-fallback 會在 1.5 秒後強制顯示 */

body:not(.zh-ready):not(.zh-fallback) {
    visibility: hidden;
}

body.zh-ready,
body.zh-fallback {
    visibility: visible;
}

.zh-switcher-wrap {
    position: absolute;
    top: 10px;
    right: 120px;
    z-index: 100;
    pointer-events: none;
}

.zh-switcher {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    font-family: -apple-system, "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
}

.zh-switcher button {
    border: 0;
    background: transparent;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    transition: background .2s ease, color .2s ease;
    line-height: 1;
}

.zh-switcher button:hover:not(.active) {
    background: rgba(0, 0, 0, .04);
    color: #1a1a2e;
}

.zh-switcher button.active {
    background: linear-gradient(135deg, #59C3C3 0%, #84B1EA 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(89, 195, 195, .35);
}

@media (max-width: 768px) {
    .zh-switcher-wrap {
        right: 100px;
    }
    .zh-switcher button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}