/* miya · 开屏 · 圆环层叠 × 弹跳装饰 */

html.miya-splash-pending .phone {
  opacity: 0;
  visibility: hidden;
}

.miya-splash {
  --sp-ink: #3d3550;
  --sp-ink-soft: rgba(61, 53, 80, 0.58);
  --sp-accent: #ff8fab;
  --sp-accent-deep: #f06b96;
  --sp-violet: #b8a0ff;
  --sp-ring: rgba(255, 143, 171, 0.32);
  --sp-ring-soft: rgba(184, 160, 255, 0.24);
  --sp-ring-sky: rgba(140, 220, 255, 0.22);
  --sp-round: "Nunito", "DM Sans", "Noto Sans SC", sans-serif;
  --sp-display: "Nunito", "DM Sans", "Noto Sans SC", sans-serif;
  --sp-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sp-soft: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: 0;
  z-index: 9100;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.miya-splash:not([hidden]) {
  visibility: visible;
  pointer-events: auto;
}

.miya-splash.is-active { opacity: 1; }
.miya-splash.is-exit { opacity: 0; pointer-events: none; }
.miya-splash.is-done { display: none !important; }

.miya-splash.is-reveal *,
.miya-splash.is-exit * {
  animation-play-state: paused !important;
}

/* ── 背景层 ── */
.miya-splash__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 214, 232, 0.6) 0%, transparent 50%),
    radial-gradient(circle at 18% 78%, rgba(196, 236, 255, 0.45) 0%, transparent 42%),
    radial-gradient(circle at 82% 22%, rgba(228, 212, 255, 0.4) 0%, transparent 40%),
    linear-gradient(168deg, #fff8fb 0%, #f6efff 42%, #edf8ff 100%);
  transition: opacity 0.7s ease, transform 0.8s var(--sp-soft);
}

.miya-splash__mesh {
  position: absolute;
  inset: -22%;
  opacity: 0;
  background:
    conic-gradient(from 200deg at 50% 50%,
      rgba(255, 143, 171, 0.09),
      rgba(196, 236, 255, 0.14),
      rgba(184, 160, 255, 0.1),
      rgba(191, 245, 228, 0.08),
      rgba(255, 143, 171, 0.09));
  filter: blur(44px);
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.miya-splash.is-active .miya-splash__mesh {
  opacity: 0.45;
  animation: miya-sp-mesh-spin 16s linear infinite;
}

.miya-splash__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ── 多层圆环 ── */
.miya-splash__rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.miya-splash__orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -52%) scale(0.65);
  transition: opacity 0.7s var(--sp-soft), transform 0.85s var(--sp-soft);
  transition-delay: var(--or-delay, 0s);
}

.miya-splash__orbit--a {
  width: min(92vw, 380px);
  height: min(92vw, 380px);
  border: 1.5px solid var(--sp-ring);
  --or-delay: 0s;
}

.miya-splash__orbit--b {
  width: min(78vw, 320px);
  height: min(78vw, 320px);
  border: 1px dashed var(--sp-ring-soft);
  --or-delay: 0.08s;
}

.miya-splash__orbit--c {
  width: min(64vw, 260px);
  height: min(64vw, 260px);
  border: 1px solid var(--sp-ring-sky);
  --or-delay: 0.16s;
}

.miya-splash__orbit--d {
  width: min(50vw, 200px);
  height: min(50vw, 200px);
  border: 1.5px solid rgba(255, 143, 171, 0.18);
  --or-delay: 0.24s;
}

.miya-splash.is-active .miya-splash__orbit {
  opacity: 1;
  transform: translate(-50%, -52%) scale(1);
}

.miya-splash.is-pop .miya-splash__orbit--a { animation: miya-sp-orbit-breathe 2.4s ease-in-out infinite; }
.miya-splash.is-pop .miya-splash__orbit--b { animation: miya-sp-orbit-breathe-b 2.8s ease-in-out infinite; }
.miya-splash.is-pop .miya-splash__orbit--c { animation: miya-sp-orbit-breathe-c 3.2s ease-in-out infinite; }
.miya-splash.is-pop .miya-splash__orbit--d { animation: miya-sp-orbit-breathe-d 2.6s ease-in-out infinite; }

.miya-splash__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 143, 171, 0.25);
  opacity: 0;
  pointer-events: none;
}

.miya-splash__pulse--1 {
  width: min(56vw, 230px);
  height: min(56vw, 230px);
  margin: calc(min(56vw, 230px) / -2) 0 0 calc(min(56vw, 230px) / -2);
}

.miya-splash__pulse--2 {
  width: min(56vw, 230px);
  height: min(56vw, 230px);
  margin: calc(min(56vw, 230px) / -2) 0 0 calc(min(56vw, 230px) / -2);
  border-color: rgba(184, 160, 255, 0.22);
}

.miya-splash.is-pop .miya-splash__pulse {
  animation: miya-sp-pulse-out 2.8s ease-out infinite;
  animation-delay: var(--pu-delay, 0.6s);
}

.miya-splash__pulse--2 { --pu-delay: 1.1s; }

.miya-splash.is-reveal .miya-splash__orbit,
.miya-splash.is-reveal .miya-splash__pulse {
  opacity: 0;
  transform: translate(-50%, -52%) scale(1.12);
  transition-duration: 0.55s;
}

/* ── 泡泡 & 星尘 ── */
.miya-splash__bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.miya-splash__bubble {
  --b-size: 10px;
  --b-x: 50%;
  --b-delay: 0s;
  --b-dur: 5s;
  position: absolute;
  bottom: -16px;
  left: var(--b-x);
  width: var(--b-size);
  height: var(--b-size);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.6);
  opacity: 0;
}

.miya-splash.is-pop .miya-splash__bubble {
  animation: miya-sp-bubble-rise var(--b-dur) ease-in-out infinite;
  animation-delay: var(--b-delay);
}

.miya-splash__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.miya-splash__mote {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.3);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.28);
}

.miya-splash.is-pop .miya-splash__mote {
  animation:
    miya-sp-mote-in 0.65s var(--sp-bounce) forwards,
    miya-sp-mote-float var(--mt-dur, 3s) ease-in-out calc(var(--mt-delay, 0s) + 0.65s) infinite;
  animation-delay: var(--mt-delay, 0s), calc(var(--mt-delay, 0s) + 0.65s);
}

.miya-splash__trail-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 143, 171, 0.25), rgba(184, 160, 255, 0.2), transparent);
  opacity: 0;
  transform-origin: left center;
}

.miya-splash.is-pop .miya-splash__trail-line {
  animation: miya-sp-trail-draw 1s var(--sp-soft) forwards;
  animation-delay: var(--tl-delay, 0.35s);
}

/* ── 主舞台 ── */
.miya-splash__stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 48px) 24px calc(env(safe-area-inset-bottom, 0px) + 40px);
  transition: opacity 0.6s ease, transform 0.65s var(--sp-soft);
}

.miya-splash__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.miya-splash__sigil {
  position: relative;
  width: min(20vw, 76px);
  height: min(20vw, 76px);
  margin-bottom: 2px;
  opacity: 0;
  transform: scale(0.35) translateY(16px);
}

.miya-splash.is-pop .miya-splash__sigil {
  animation: miya-sp-sigil-in 0.75s var(--sp-bounce) 0.2s forwards, miya-sp-sigil-bob 2.4s ease-in-out 1s infinite;
}

.miya-splash__sigil-ring {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  border: 1px solid rgba(255, 143, 171, 0.28);
  opacity: 0;
  transform: scale(0.55);
}

.miya-splash.is-pop .miya-splash__sigil-ring {
  animation: miya-sp-ring-in 0.7s var(--sp-bounce) forwards;
  animation-delay: var(--sr-delay, 0.25s);
}

.miya-splash__sigil-ring--b {
  inset: -40%;
  border-color: rgba(184, 160, 255, 0.2);
  border-style: dashed;
  --sr-delay: 0.38s;
}

.miya-splash__sigil-core {
  position: absolute;
  inset: 20%;
  border-radius: 38% 38% 42% 42%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95) 0%, transparent 42%),
    linear-gradient(145deg, #ffb3cc 0%, #ff8fab 45%, #f06b96 100%);
  box-shadow: 0 8px 22px rgba(240, 107, 150, 0.24);
  opacity: 0;
  transform: scale(0.3);
}

.miya-splash.is-pop .miya-splash__sigil-core {
  animation: miya-sp-core-pop 0.75s var(--sp-bounce) 0.32s forwards;
}

.miya-splash__wordmark {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 1.2vw, 8px);
  margin: 0;
  font-family: var(--sp-display);
  font-size: clamp(50px, 14vw, 70px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--sp-ink);
}

.miya-splash__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) scale(0.65) rotate(-8deg);
  filter: blur(4px);
}

.miya-splash.is-pop .miya-splash__char {
  animation: miya-sp-char-pop 0.68s var(--sp-bounce) forwards;
  animation-delay: calc(0.55s + var(--d, 0) * 0.07s);
}

.miya-splash__wave-bar {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 24px;
  opacity: 0;
  transform: translateY(6px);
}

.miya-splash.is-pop .miya-splash__wave-bar {
  animation: miya-sp-fade-in 0.5s var(--sp-soft) 0.95s forwards;
}

.miya-splash__wave-bar span {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--sp-accent) 0%, var(--sp-violet) 100%);
  transform: scaleY(0.25);
  opacity: 0.45;
}

.miya-splash.is-pop .miya-splash__wave-bar span {
  animation: miya-sp-wave 0.85s ease-in-out infinite;
  animation-delay: calc(1s + var(--w, 0) * 0.06s);
}

.miya-splash__wave-bar span:nth-child(1) { height: 10px; --w: 0; }
.miya-splash__wave-bar span:nth-child(2) { height: 16px; --w: 1; }
.miya-splash__wave-bar span:nth-child(3) { height: 24px; --w: 2; }
.miya-splash__wave-bar span:nth-child(4) { height: 14px; --w: 3; }
.miya-splash__wave-bar span:nth-child(5) { height: 20px; --w: 4; }
.miya-splash__wave-bar span:nth-child(6) { height: 12px; --w: 5; }
.miya-splash__wave-bar span:nth-child(7) { height: 18px; --w: 6; }

.miya-splash__tagline {
  margin: 0;
  font-family: var(--sp-round);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--sp-ink-soft);
  opacity: 0;
  transform: translateY(10px);
}

.miya-splash.is-pop .miya-splash__tagline {
  animation: miya-sp-tagline-in 0.6s var(--sp-bounce) 1.1s forwards;
}

.miya-splash__dots {
  display: flex;
  gap: 8px;
  height: 12px;
  margin-top: 2px;
}

.miya-splash__dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sp-accent), var(--sp-violet));
  opacity: 0;
  transform: translateY(8px) scale(0.5);
}

.miya-splash.is-pop .miya-splash__dots span {
  animation: miya-sp-dot-bounce 0.95s ease-in-out infinite;
  animation-delay: calc(1.25s + var(--dd, 0) * 0.1s);
  opacity: 1;
}

.miya-splash__dots span:nth-child(1) { --dd: 0; }
.miya-splash__dots span:nth-child(2) { --dd: 1; }
.miya-splash__dots span:nth-child(3) { --dd: 2; }

/* ── 跳过 ── */
.miya-splash__skip {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 16px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 143, 171, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--sp-ink-soft);
  font-family: var(--sp-round);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease 0.15s, transform 0.45s var(--sp-bounce) 0.15s, background 0.2s ease;
}

.miya-splash.is-active .miya-splash__skip {
  opacity: 1;
  transform: translateY(0);
}

.miya-splash__skip:active { background: rgba(255, 214, 232, 0.55); }

.miya-splash__skip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sp-accent);
}

/* ── 退场 & 主屏 ── */
.miya-splash.is-reveal .miya-splash__stage {
  opacity: 0;
  transform: translateY(-28px) scale(1.04);
}

.miya-splash.is-reveal .miya-splash__bg,
.miya-splash.is-reveal .miya-splash__mesh {
  opacity: 0;
  transform: scale(1.04);
}

body.miya-splash-active .phone {
  opacity: 0;
  visibility: visible;
  transform: scale(1.03);
  filter: blur(5px);
}

body.miya-splash-active.miya-splash-reveal .phone {
  opacity: 1;
  transform: scale(1);
  filter: none;
  transition: opacity 0.85s var(--sp-soft), transform 0.95s var(--sp-bounce), filter 0.65s ease;
}

/* ── 关键帧 ── */
@keyframes miya-sp-mesh-spin { to { transform: rotate(360deg); } }

@keyframes miya-sp-orbit-breathe {
  0%, 100% { transform: translate(-50%, -52%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.025); }
}

@keyframes miya-sp-orbit-breathe-b {
  0%, 100% { transform: translate(-50%, -52%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.03); }
}

@keyframes miya-sp-orbit-breathe-c {
  0%, 100% { transform: translate(-50%, -52%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.02); }
}

@keyframes miya-sp-orbit-breathe-d {
  0%, 100% { transform: translate(-50%, -52%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.035); }
}

@keyframes miya-sp-pulse-out {
  0% { opacity: 0.55; transform: scale(0.88); }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes miya-sp-bubble-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  15% { opacity: 0.6; }
  85% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(calc(-100vh - 24px)) scale(1); }
}

@keyframes miya-sp-mote-in {
  0% { opacity: 0; transform: scale(0.3); }
  100% { opacity: var(--mt-op, 0.75); transform: scale(1); }
}

@keyframes miya-sp-mote-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(var(--mt-x, 5px), var(--mt-y, -8px)); }
}

@keyframes miya-sp-trail-draw {
  0% { opacity: 0; transform: scaleX(0); }
  100% { opacity: 0.5; transform: scaleX(1); }
}

@keyframes miya-sp-sigil-in {
  0% { opacity: 0; transform: scale(0.35) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes miya-sp-sigil-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes miya-sp-ring-in {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes miya-sp-core-pop {
  0% { opacity: 0; transform: scale(0.3); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes miya-sp-char-pop {
  0% { opacity: 0; transform: translateY(28px) scale(0.65) rotate(-8deg); filter: blur(4px); }
  65% { opacity: 1; transform: translateY(-5px) scale(1.07) rotate(2deg); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); filter: blur(0); }
}

@keyframes miya-sp-fade-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes miya-sp-tagline-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes miya-sp-wave {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes miya-sp-dot-bounce {
  0%, 80%, 100% { transform: translateY(6px) scale(0.75); opacity: 0.4; }
  40% { transform: translateY(-5px) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .miya-splash, .miya-splash *, body.miya-splash-active .phone {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

html.is-low-end .miya-splash__mesh,
html.is-low-end .miya-splash__bubbles,
html.is-low-end .miya-splash__grain,
html.is-low-end .miya-splash__orbit--b,
html.is-low-end .miya-splash__orbit--d {
  display: none;
}
