#platform-initial-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: #fff;
  /* 显式声明中文字体：避免回退字体在不同渲染路径下解析不一致导致“字体切换感” */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'PingFang SC', 'Microsoft YaHei', 'Noto Sans', sans-serif;
}

#platform-initial-loading~#app {
  visibility: hidden;
}

/* 退出淡出：由 closeInitialLoading 添加 is-leaving 类触发，0.6s 后移除节点 */
#platform-initial-loading.is-leaving {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

/* 淡出期间放行应用内容，形成交叉过渡 */
#platform-initial-loading.is-leaving~#app {
  visibility: visible;
}

.initial-loading__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
      rgba(148, 163, 184, 0.15) 0%,
      transparent 50%);
}

.initial-loading__content {
  position: absolute;
  top: 45%;
  left: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 与源码一致：整个组合在视口垂直居中（justify-center） */
  transform: translate(-50%, -50%);
}

/* 图标切换舞台：宽幅容器 + 左右渐隐遮罩 */
.initial-loading__icon-window {
  position: relative;
  width: 280px;
  height: 120px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 25%, #000 75%, transparent);
}

.initial-loading__icon {
  position: absolute;
  top: 0;
  left: calc(50% - 28px);
  width: 56px;
  height: 56px;
  color: #40bb6b;
  filter: drop-shadow(0 6px 12px rgba(64, 187, 107, 0.5));
  stroke: currentColor;
  /* 与参考实现一致：lucide 图标 24 viewBox 下 strokeWidth 2.5 */
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  /* 翻转原点取图标底部下方 64px，对应参考实现 origin-bottom 的弧线 */
  transform-origin: 50% 120px;
  will-change: opacity, transform;
  animation:
    initial-icon-opacity 4s ease infinite,
    initial-icon-transform 4s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.initial-loading__icon.is-battery {
  animation-delay: 1s, 1s;
}

.initial-loading__icon.is-wind {
  animation-delay: 2s, 2s;
}

.initial-loading__icon.is-leaf {
  animation-delay: 3s, 3s;
}

/* 圆点传送带：从右向左穿行，两端渐隐；对应源码 -mt-6 mb-2，圆点中心位于图标中心下方 80px */
.initial-loading__dots {
  position: relative;
  width: 128px;
  height: 24px;
  margin: -24px 0 8px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent);
}

.initial-loading__dots i {
  position: absolute;
  top: calc(50% - 3px);
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #40bb6b;
  opacity: 0;
  transform: translateX(24px);
  will-change: opacity, transform;
  animation: initial-dot-conveyor 1.5s linear infinite;
  animation-fill-mode: backwards;
}

.initial-loading__dots i:nth-child(2) {
  animation-delay: 0.5s;
}

.initial-loading__dots i:nth-child(3) {
  animation-delay: 1s;
}

/* 标语：对应参考的两层嵌套 motion 元素——
   外层 wrapper 做一次性上浮入场，内层文字从 0s 起持续呼吸；
   文字中心位于圆点中心下方 28px */
.initial-loading__tagline-wrap {
  margin: 0;
  /* 常驻合成层：避免上浮结束后渲染路径切换（GPU 灰度抗锯齿 → ClearType）导致文字抖动/发虚 */
  will-change: transform, opacity;
  animation: initial-tagline-enter 1s ease-out both;
}

.initial-loading__tagline {
  margin: 0 0 0 4px;
  /* 钉死单一中文字体：间隔号"·"(U+00B7)属拉丁区，西文字体与中文字体的点形差异大，
     webfont 就绪触发字体重匹配时会造成“点突然变大”的抖动；固定后与汉字同源渲染，不再跳变 */
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4em;
  line-height: 16px;
  text-transform: uppercase;
  will-change: opacity;
  animation: initial-tagline-pulse 3s ease-in-out infinite;
}

/* 4s 一轮，每秒切换一个图标：0.5s 旋入 → 停留 0.5s → 0.5s 旋出（与下一个图标的旋入交叉） */
@keyframes initial-icon-opacity {
  0% {
    opacity: 0;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  12.5% {
    opacity: 1;
  }

  25% {
    opacity: 1;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  37.5% {
    opacity: 0;
  }

  37.51%,
  100% {
    opacity: 0;
  }
}

@keyframes initial-icon-transform {
  0% {
    transform: rotate(60deg) scale(0.8);
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  12.5% {
    transform: rotate(0) scale(1);
  }

  25% {
    transform: rotate(0) scale(1);
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  37.5% {
    transform: rotate(-60deg) scale(0.8);
  }

  37.51%,
  100% {
    transform: rotate(60deg) scale(0.8);
  }
}

/* 圆点从右向左穿行 48px，中段最亮 */
@keyframes initial-dot-conveyor {
  0% {
    transform: translateX(24px);
    opacity: 0;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    transform: translateX(-24px);
    opacity: 0;
  }
}

@keyframes initial-tagline-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes initial-tagline-pulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  .initial-loading__icon,
  .initial-loading__dots i,
  .initial-loading__tagline-wrap,
  .initial-loading__tagline {
    animation: none;
  }

  .initial-loading__icon {
    opacity: 0;
  }

  .initial-loading__icon.is-sun {
    opacity: 1;
  }

  .initial-loading__dots i {
    opacity: 0;
  }

  .initial-loading__tagline {
    opacity: 1;
  }
}
