/**
 * 描述：載入動畫效果
 * 作者：施睿皇 靜睿設計所 Jingrui Design
 * 創建日期：2025-03-27
 * 版本：2.0.0
 */


 :root {
    --bg-color-1: #ff86a4;
    --bg-color-2: var(--ast-global-color-1);
}

#loading-screen.hide {
    opacity: 0;
    pointer-events: none;
}

#loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
    background: linear-gradient(270deg, var(--bg-color-1), var(--bg-color-2));
    background-size: 400% 400%;
    -webkit-animation: loading_backgroundAn 30s ease infinite;
    animation: loading_backgroundAn 30s ease infinite;
}

@-webkit-keyframes loading_backgroundAn {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes loading_backgroundAn {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* 動畫容器 */
#loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* LOGO圖片 */
#loading-animation #logo {
    max-width: 230px;
}


/* 針對 logo 圖片預設先隱藏 */
#loading-animation #logo img {
    width: 100%;
    display: block;
    opacity: 0;
    animation: fadeInLogo 1s forwards ease-in-out;
    animation-delay: 0.5s; /* 可依需求調整延遲時間 */
}

@keyframes fadeInLogo {
    to {
        opacity: 1;
    }
}


@media (max-width: 768px) {
  #loading-animation #logo {
    max-width: 180px; /* 手機版 LOGO 縮小 */
  }
}

/* ==========================================
   文字模式與 SVG 動畫樣式 (Text Mode & SVG Animations)
   ========================================== */
#svg_title {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin-bottom: 20px;
}

#svg_title text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5px;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawText 4s ease forwards infinite alternate;
}

@keyframes drawText {
  0% {
    stroke-dashoffset: 400;
    fill: rgba(255, 255, 255, 0);
  }
  70% {
    fill: rgba(255, 255, 255, 0);
  }
  100% {
    stroke-dashoffset: 0;
    fill: rgba(255, 255, 255, 1);
  }
}

#svg_subTitle {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.1em;
  margin: 0 0 30px 0;
  text-align: center;
  opacity: 0.9;
}

#svg_subTitle p {
  margin: 5px 0 0 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* 循環旋轉圓環 */
#svg_line {
  position: relative;
}

.loading_shape {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-dasharray: 314; /* 2 * PI * 50 */
  stroke-dashoffset: 314;
  transform-origin: center;
  animation: rotateShape 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 為五個圓圈設定不同的旋轉與延遲，達成波浪旋轉效果 */
.loading_shape:nth-child(1) { animation-delay: 0.1s; opacity: 0.9; }
.loading_shape:nth-child(2) { animation-delay: 0.2s; opacity: 0.7; }
.loading_shape:nth-child(3) { animation-delay: 0.3s; opacity: 0.5; }
.loading_shape:nth-child(4) { animation-delay: 0.4s; opacity: 0.3; }
.loading_shape:nth-child(5) { animation-delay: 0.5s; opacity: 0.1; }

@keyframes rotateShape {
  0% {
    transform: rotate(0deg);
    stroke-dashoffset: 314;
  }
  50% {
    stroke-dashoffset: 100;
  }
  100% {
    transform: rotate(360deg);
    stroke-dashoffset: 314;
  }
}