:root {
  --tap-lock-cursor: pointer;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

.app {
  width: 100vw;
  height: 100vh;
  position: relative;
  touch-action: manipulation;
  cursor: var(--tap-lock-cursor);
  user-select: none;
}

/* Background crossfade */
.bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
  opacity: 0;
  transition: opacity 420ms ease;
}

.bg-img.visible {
  opacity: 1;
}

/* Hints */
.hint-img {
  position: absolute;
  left: 50%;
  bottom: 1vh;
  transform: translateX(-50%);
  max-width: 128vw;
  max-height: 118vh;
  width: auto;
  height: auto;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.hint-img.visible {
  opacity: 1;
}

/* Center stage layers（与 scenes/scene4-end.css · 5pld 区域一致） */
.center-stage,
.tips-stage {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}

.center-stage.visible,
.tips-stage.visible {
  opacity: 1;
}

.center-stage.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.hidden {
  opacity: 0 !important;
}

.stage-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 78vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  opacity: 0;
  transition: opacity 240ms ease, transform 120ms ease, filter 120ms ease;
  pointer-events: none;
}

.stage-img.visible {
  opacity: 1;
  pointer-events: auto;
}

.pld0 {
  z-index: 2;
}

.pldBg {
  z-index: 1;
  top: 45%;
}

.words-img {
  opacity: 1;
  max-width: 78vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
  pointer-events: auto;
}

.tips-img {
  /* 两张 tips 图都绝对居中，避免文档流导致 tips2跑出画面 */
  opacity: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 92vw;
  max-height: 70vh;
  width: auto;
  height: auto;
}

/* 0pld_words：与 5pld_words / .end-words-reveal 一致 */
.words-reveal {
  z-index: 3;
  transform-origin: right center;
  opacity: 1;
  position: absolute;
  left: 50%;
  top: 45%;
  pointer-events: none;
  transform: translate(-50%, -50%) scaleX(0);
  transition: transform 3200ms ease, filter 120ms ease;
}

.words-reveal.hidden {
  opacity: 0;
  pointer-events: none;
}

.words-reveal.visible {
  transform: translate(-50%, -50%) scaleX(1);
  pointer-events: auto;
  cursor: pointer;
}


/* Flash overlay（高于 .page-frame 150） */
.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 300;
}

.flash.on {
  animation: flashPulse 650ms ease-out;
}

@keyframes flashPulse {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 0.95;
  }
  45% {
    opacity: 0.18;
  }
  100% {
    opacity: 0;
  }
}

/* ========== AI 智能体入口：仅首页 body.sz-page--home（勿在其他页复用该类）========== */
@keyframes agent-page-entry-rim {
  0%,
  100% {
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.22))
      drop-shadow(0 0 0.5px rgba(255, 248, 220, 0.95))
      drop-shadow(0 0 1px rgba(212, 175, 55, 0.88))
      drop-shadow(0 0 2px rgba(184, 134, 11, 0.45))
      drop-shadow(0 0 3px rgba(139, 105, 20, 0.22));
  }
  50% {
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.22))
      drop-shadow(0 0 0.5px rgba(255, 252, 235, 1))
      drop-shadow(0 0 1px rgba(230, 194, 90, 0.95))
      drop-shadow(0 0 2px rgba(180, 140, 40, 0.52))
      drop-shadow(0 0 3px rgba(120, 90, 25, 0.26));
  }
}

body.sz-page--home .agent-page-entry {
  position: fixed;
  z-index: 400;
  right: 15vw;
  top: 24vh;
  line-height: 0;
  border-radius: 12px;
  outline: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

body.sz-page--home .agent-page-entry.agent-page-entry--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.sz-page--home .agent-page-entry img {
  display: block;
  max-width: min(36vw, 380px);
  width: auto;
  height: auto;
  object-fit: contain;
  animation: agent-page-entry-rim 3.8s ease-in-out infinite;
}

body.sz-page--home .agent-page-entry:hover img,
body.sz-page--home .agent-page-entry:focus-visible img {
  animation: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.22))
    drop-shadow(0 0 0.5px rgba(255, 252, 240, 1))
    drop-shadow(0 0 1px rgba(237, 201, 105, 0.98))
    drop-shadow(0 0 2px rgba(198, 156, 55, 0.58))
    drop-shadow(0 0 3px rgba(150, 115, 35, 0.3));
}

@media (prefers-reduced-motion: reduce) {
  body.sz-page--home .agent-page-entry img {
    animation: none;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.22))
      drop-shadow(0 0 0.5px rgba(255, 248, 220, 0.95))
      drop-shadow(0 0 1px rgba(212, 175, 55, 0.9))
      drop-shadow(0 0 2px rgba(184, 134, 11, 0.48))
      drop-shadow(0 0 3px rgba(139, 105, 20, 0.24));
  }
}

