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

html {
  margin: 0;
  min-height: 100%;
  background: #eff6ff;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #eff6ff;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #000;
  -webkit-font-smoothing: antialiased;
}

.dl-bg {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #eff6ff;
}

.dl-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.dl-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.dl-orb--1 {
  width: 172px;
  height: 172px;
  right: -59px;
  bottom: 175px;
  background: linear-gradient(90deg, #53eafd 0%, #00d5be 100%);
  opacity: 0.4;
  filter: blur(49px);
}

.dl-orb--2 {
  width: 146px;
  height: 175px;
  left: -49px;
  top: calc(358px - env(safe-area-inset-top, 0px));
  background: linear-gradient(90deg, #a3b3ff 0%, #2b7fff 100%);
  opacity: 0.5;
  filter: blur(45px);
}

.dl-orb--3 {
  width: 200px;
  height: 200px;
  left: 120px;
  top: 125px;
  background: linear-gradient(90deg, #8ec5ff 0%, #00d3f3 100%);
  opacity: 0.6;
  filter: blur(77px);
}

.dl-orb {
  will-change: transform, opacity;
}

/* 暂时关闭光晕动画 */
/* .dl-orb--1 { animation: dl-orb-float-1 9s ease-in-out infinite alternate; } */
/* .dl-orb--2 { animation: dl-orb-float-2 12s ease-in-out -5s infinite alternate; } */
/* .dl-orb--3 { animation: dl-orb-float-3 14s ease-in-out -9s infinite alternate; } */

@keyframes dl-orb-float-1 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.65; }
  55% { transform: translate3d(-42vw, -28dvh, 0) scale(0.9); opacity: 0.55; }
  100% { transform: translate3d(-62vw, -62dvh, 0) scale(0.48); opacity: 0.24; }
}

@keyframes dl-orb-float-2 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.68; }
  52% { transform: translate3d(44vw, 23dvh, 0) scale(1.16); opacity: 0.72; }
  100% { transform: translate3d(65vw, -43dvh, 0) scale(0.5); opacity: 0.25; }
}

@keyframes dl-orb-float-3 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.75; }
  48% { transform: translate3d(-48vw, 28dvh, 0) scale(1.18); opacity: 0.8; }
  100% { transform: translate3d(24vw, -54dvh, 0) scale(0.5); opacity: 0.28; }
}

@media (prefers-reduced-motion: reduce) {
  .dl-orb {
    animation: none;
    will-change: auto;
  }
}

.dl-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.dl-app-icon {
  display: block;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.dl-app-icon:not([src]),
.dl-app-icon[src=""] {
  visibility: hidden;
}

.dl-app-name {
  margin: 0;
  min-height: 22px;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.dl-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 9999px;
  background: #0091ff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dl-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.dl-btn:active:not(:disabled) { opacity: 0.85; }

.dl-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.dl-toast.is-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
    background: #0f172a;
  }

  body,
  .dl-bg {
    background: #0f172a;
  }

  body {
    color: #f8fafc;
  }

  .dl-orb--1 { opacity: 0.3; }
  .dl-orb--2 { opacity: 0.35; }
  .dl-orb--3 { opacity: 0.4; }

  .dl-btn {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.36);
  }

  .dl-toast {
    background: rgba(15, 23, 42, 0.92);
  }
}
