/* Pace full-page loading style (dark theme) */
body.pace-running #app {
  opacity: 0;
}

body.pace-done #app {
  animation: app-reveal 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pace {
  position: fixed;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 9999;
}

.pace::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #05070f;
  opacity: 1;
  z-index: 9997;
  transition: opacity 0.55s ease;
}

.pace::after {
  content: "正在加载...";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #d4dcff;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 14px rgba(131, 147, 255, 0.3);
  opacity: 1;
  z-index: 9998;
  transition: opacity 0.4s ease;
}

.pace .pace-progress {
  position: fixed;
  top: 0;
  right: 100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 16px rgba(111, 125, 255, 0.65);
  z-index: 9999;
  transition: opacity 0.32s ease;
}

.pace .pace-progress::after {
  content: "";
  position: absolute;
  right: 0;
  width: 72px;
  height: 100%;
  box-shadow: 0 0 14px rgba(140, 157, 255, 0.95);
  opacity: 0.95;
}

.pace .pace-activity {
  position: fixed;
  top: calc(50% - 34px);
  left: calc(50% - 12px);
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--primary-2);
  border-radius: 50%;
  animation: pace-spin 0.8s linear infinite;
  z-index: 9998;
  transition: opacity 0.4s ease;
}

.pace.pace-inactive {
  visibility: hidden;
  transition: visibility 0s linear 0.56s;
}

.pace.pace-inactive::before,
.pace.pace-inactive::after,
.pace.pace-inactive .pace-progress,
.pace.pace-inactive .pace-activity {
  opacity: 0;
}

@keyframes pace-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes app-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pace-running #app {
    opacity: 1;
  }

  body.pace-done #app {
    animation: none;
    opacity: 1;
  }

  .pace::before,
  .pace::after,
  .pace .pace-progress,
  .pace .pace-activity,
  .pace.pace-inactive {
    transition: none;
  }
}
