/* ============================================================
   DualStar · 加载动画
   双子星 / DualStar · 星点轨道旋转
   ============================================================ */

.loading-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  overflow: hidden;
}

.loading-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 40%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 50% 70%, var(--highlight) 0%, transparent 50%);
  opacity: 0.4;
  pointer-events: none;
  animation: bgPulse 6s var(--ease-in-out) infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

/* —— 星点轨道 —— */
.orbit-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 56px;
}

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-deep);
  box-shadow:
    0 0 0 6px var(--accent-soft),
    0 0 24px 4px var(--accent);
  animation: corePulse 2.4s var(--ease-in-out) infinite;
}

@keyframes corePulse {
  0%, 100% { box-shadow: 0 0 0 6px var(--accent-soft), 0 0 24px 4px var(--accent); }
  50% { box-shadow: 0 0 0 10px var(--accent-soft), 0 0 40px 8px var(--accent); }
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  opacity: 0.6;
}

.orbit-ring.r1 {
  width: 80px;
  height: 80px;
  border-color: var(--accent);
  opacity: 0.4;
}

.orbit-ring.r2 {
  width: 140px;
  height: 140px;
  border-color: var(--highlight);
  opacity: 0.3;
  border-style: dashed;
}

.orbit-ring.r3 {
  width: 200px;
  height: 200px;
  border-color: var(--text-tertiary);
  opacity: 0.2;
}

/* 行星 */
.planet {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: -4px;
  margin-left: -4px;
}

.planet.p1 {
  background: var(--accent);
  animation: orbit1 3s linear infinite;
}

.planet.p2 {
  background: var(--highlight);
  width: 6px;
  height: 6px;
  margin-top: -3px;
  margin-left: -3px;
  animation: orbit2 5s linear infinite reverse;
}

.planet.p3 {
  background: var(--text-secondary);
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  margin-left: -2.5px;
  animation: orbit3 8s linear infinite;
}

@keyframes orbit1 {
  from { transform: rotate(0deg) translateX(40px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}
@keyframes orbit2 {
  from { transform: rotate(0deg) translateX(70px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(70px) rotate(-360deg); }
}
@keyframes orbit3 {
  from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

/* —— 文字 —— */
.loading-title {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: 12px;
  text-indent: 12px; /* 抵消末尾字距 */
  color: var(--text);
  margin-bottom: 8px;
  opacity: 0;
  animation: titleIn 1.2s var(--ease-out) 0.3s forwards;
}

.loading-subtitle {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 8px;
  text-indent: 8px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 48px;
  opacity: 0;
  animation: titleIn 1.2s var(--ease-out) 0.7s forwards;
}

@keyframes titleIn {
  from { opacity: 0; transform: translateY(12px); letter-spacing: 24px; }
  to   { opacity: 1; transform: translateY(0); letter-spacing: 12px; }
}

.loading-subtitle {
  animation-name: subIn;
}
@keyframes subIn {
  from { opacity: 0; transform: translateY(8px); letter-spacing: 16px; }
  to   { opacity: 0.7; transform: translateY(0); letter-spacing: 8px; }
}

/* —— 进度条 —— */
.loading-progress {
  width: 200px;
  height: 2px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}

.loading-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  border-radius: var(--r-full);
  transition: width 0.4s var(--ease-out);
}

.loading-percent {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
}

/* —— 淡出 —— */
.loading-view.fade-out {
  animation: loadingOut 0.6s var(--ease-in-out) forwards;
}

@keyframes loadingOut {
  to { opacity: 0; visibility: hidden; }
}

/* —— 装饰星点 —— */
.star-dot {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--text-tertiary);
  border-radius: 50%;
  opacity: 0;
  animation: starTwinkle 3s var(--ease-in-out) infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.6; }
}
