/* ============================================
   加载页面 - 原神风格 Loading Screen
   ============================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #06080e;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 760ms ease, visibility 0s linear 0s;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 760ms ease, visibility 0s linear 760ms;
}

/* 背景氛围光 */
.loading-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(180, 150, 100, 0.07) 0%, transparent 56%),
    radial-gradient(ellipse at 50% 52%, rgba(100, 160, 200, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #06080e 0%, #0a0d16 40%, #0d1118 100%);
}

/* 星空粒子容器 */
.loading-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 单个星星 */
.loading-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: starTwinkle var(--star-duration, 2.4s) ease-in-out infinite;
  animation-delay: var(--star-delay, 0s);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.8); }
}

/* 中央加载图标区域 */
.loading-icon-area {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* 原神风格加载环 */
.loading-ring {
  position: relative;
  width: 72px;
  height: 72px;
}

.loading-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(200, 170, 120, 0.12);
}

.loading-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(200, 170, 120, 0.65);
  border-right-color: rgba(200, 170, 120, 0.35);
  animation: ringRotate 1.6s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
}

@keyframes ringRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 中心光点 */
.loading-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 190, 140, 0.9), rgba(180, 140, 80, 0.3));
  box-shadow: 0 0 18px rgba(200, 160, 100, 0.5), 0 0 42px rgba(200, 160, 100, 0.18);
  animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.5); opacity: 1; }
}

/* 加载提示文字 */
.loading-tip {
  color: rgba(200, 180, 150, 0.72);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
  transition: opacity 500ms ease;
  user-select: none;
}

.loading-tip.is-fading {
  opacity: 0;
}

/* 底部进度条区域 */
.loading-progress-area {
  position: absolute;
  bottom: 18vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(320px, 64vw);
}

/* 进度百分比 */
.loading-percentage {
  color: rgba(200, 180, 150, 0.8);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* 进度条轨道 */
.loading-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

/* 进度条填充 */
.loading-fill {
  height: 100%;
  width: 0%;
  border-radius: 1px;
  background: linear-gradient(90deg,
    rgba(180, 140, 90, 0.7),
    rgba(210, 175, 120, 0.85),
    rgba(180, 140, 90, 0.7)
  );
  transition: width 320ms ease;
  position: relative;
}

/* 进度条光点 */
.loading-fill::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 200, 150, 0.95), rgba(200, 160, 100, 0.4));
  box-shadow: 0 0 10px rgba(210, 170, 120, 0.5), 0 0 24px rgba(210, 170, 120, 0.16);
}

/* 底部版权 */
.loading-footer {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  letter-spacing: 0.04em;
  user-select: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .loading-ring {
    width: 56px;
    height: 56px;
  }

  .loading-tip {
    font-size: 12px;
    max-width: 240px;
  }

  .loading-progress-area {
    bottom: 14vh;
    width: min(260px, 72vw);
  }

  .loading-percentage {
    font-size: 13px;
  }
}