#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #E4FFF8 0%, #ffffff 100%);
  z-index: 99999;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
  overflow: hidden;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top, 0);
  box-sizing: border-box;
}

#splash-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-character {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 8%;
  min-height: 0;
  animation: splashFadeIn 1.1s cubic-bezier(0.23, 1, 0.32, 1) 0.3s both;
}

.splash-character img {
  width: auto;
  height: auto;
  max-width: 70vw;
  max-height: calc(100dvh - 180px);
  max-height: calc(100vh - 180px);
  object-fit: contain;
  animation: splashFloat 2.5s cubic-bezier(0.4, 0, 0.2, 1) 1.2s infinite;
}

.splash-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0 0;
  flex-shrink: 0;
}

.splash-app-icon {
  width: 47px;
  height: 47px;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.splash-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-app-name {
  font-size: 32px;
  font-weight: 700;
  color: #2088fd;
  letter-spacing: 2px;
  font-family: 'HarmonyOS Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
}

.splash-copyright {
  margin: 10px 0 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  font-size: 12px;
  color: #2088fd;
  font-weight: 400;
  letter-spacing: 0.5px;
  font-family: 'HarmonyOS Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  flex-shrink: 0;
}

@keyframes splashFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashFloat {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-4px) scale(1.015);
  }
  60% {
    transform: translateY(-4px) scale(1.015);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* 小屏手机（如 iPhone SE、小屏安卓） */
@media (max-width: 375px) {
  .splash-character {
    padding: 0 24px;
  }
  .splash-character img {
    max-width: 75vw;
    max-height: calc(100dvh - 160px);
    max-height: calc(100vh - 160px);
  }
  .splash-app-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .splash-app-name {
    font-size: 24px;
  }
  .splash-copyright {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    font-size: 11px;
  }
}

/* 中等屏手机 */
@media (min-width: 376px) and (max-width: 500px) {
  .splash-character img {
    max-width: 70vw;
    max-height: calc(100dvh - 170px);
    max-height: calc(100vh - 170px);
  }
  .splash-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .splash-app-name {
    font-size: 26px;
  }
}

/* 平板 */
@media (min-width: 768px) {
  .splash-character img {
    max-width: 500px;
    max-height: calc(100dvh - 200px);
    max-height: calc(100vh - 200px);
  }
  .splash-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
  .splash-app-name {
    font-size: 36px;
  }
}

/* 大屏桌面 */
@media (min-width: 1024px) {
  .splash-character img {
    max-width: 480px;
    max-height: calc(100dvh - 220px);
    max-height: calc(100vh - 220px);
  }
  .splash-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }
  .splash-app-name {
    font-size: 40px;
  }
}

/* 横屏模式 - 压缩底部，主要让角色图显示 */
@media (orientation: landscape) and (max-height: 500px) {
  .splash-character img {
    max-width: 40vw;
    max-height: calc(100dvh - 130px);
    max-height: calc(100vh - 130px);
  }
  .splash-app-icon {
    width: 36px;
    height: 36px;
  }
  .splash-app-name {
    font-size: 22px;
  }
  .splash-copyright {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    font-size: 10px;
  }
}
