:root {
  --boot-canvas: #f0f3f8;
  --boot-ink: #111827;
  --boot-muted: #6b7280;
  --boot-subtle: #9ca3af;
  --boot-hairline: #e5e7eb;
  --boot-track: #d1d5db;
  --boot-primary: #2563eb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--boot-canvas);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#app {
  width: 100%;
  height: 100%;
}

.app-boot {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: rgb(240 243 248 / 94%);
}

/** 壳内路由冷启动（/apps 等）：不叠一层跃迁 UI，避免与切换 Loading 双闪 */
.app-boot--shell-only {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.app-boot--shell-only .app-boot__runner {
  display: none;
}

.app-boot__center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(400px, calc(100vw - 48px));
}

.app-boot__icon-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid var(--boot-hairline);
  background: #fff;
  display: grid;
  place-items: center;
}

.app-boot__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--boot-primary);
  animation: boot-icon-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}

.app-boot__icon svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-boot__icon--teal {
  color: #0f766e;
}

.app-boot__icon--slate {
  color: #475569;
}

.app-boot__icon--orange {
  color: #ea580c;
}

.app-boot__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.app-boot__title {
  margin: 8px 0 0;
  color: var(--boot-ink);
  font-size: 18px;
  font-weight: 600;
  animation: boot-fade-up 0.45s ease 0.2s both;
}

.app-boot__subtitle {
  margin: 0;
  min-height: 20px;
  color: var(--boot-muted);
  font-size: 13px;
  animation: boot-fade-up 0.45s ease 0.28s both;
}

.app-boot__track {
  position: relative;
  width: 100%;
  height: 8px;
  margin-top: 20px;
  border-radius: 999px;
  background: var(--boot-track);
  overflow: visible;
}

.app-boot__fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--boot-primary);
  transition: width 0.45s ease-out;
  will-change: width;
}

.app-boot__runner {
  position: absolute;
  left: 0;
  bottom: 10px;
  width: 72px;
  height: 72px;
  background-image: url("/mascot/kewei-run-12-spritesheet.png");
  background-repeat: no-repeat;
  background-size: 1200% 100%;
  background-position: 0 0;
  pointer-events: none;
  will-change: transform, background-position;
  filter:
    drop-shadow(0 2px 6px rgb(0 0 0 / 30%))
    drop-shadow(0 0 1px rgb(0 0 0 / 38%));
}

.app-boot__runner.is-hidden {
  display: none;
}

.app-boot__brand {
  position: absolute;
  bottom: 32px;
  left: 50%;
  margin: 0;
  color: var(--boot-subtle);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transform: translateX(-50%);
}

@keyframes boot-icon-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes boot-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot__icon,
  .app-boot__title,
  .app-boot__subtitle,
  .app-boot__fill {
    animation: none !important;
    transition: none !important;
  }
}
