/* ==========================================================================
   3. Anime Scenery Background, Ethereal Emerald Brooch Dissolve & Layout
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
}

.anime-bg-wrapper {
  position: fixed;
  inset: -3%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  animation: bgBreathe 24s ease-in-out infinite alternate;
}

@keyframes bgBreathe {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.04) translate(-1%, -0.8%); }
  100% { transform: scale(1.02) translate(1%, 0.6%); }
}

.anime-bg-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 电脑端默认背景图（读取 --bg-desktop-url，可在 css/variables.css 或 js/config.js 中修改） */
.anime-bg-photo {
  position: absolute;
  inset: 0;
  background-image: var(--bg-desktop-url, url("../assets/bg_pc.png"));
  background-size: cover;
  background-position: center 35%;
  opacity: 0.45;
  mix-blend-mode: lighten;
  filter: blur(3px);
}

/* 手机端/竖屏设备独立背景图（屏幕宽度 <= 768px 或竖屏时自动切换为 --bg-mobile-url） */
@media (max-width: 768px), (orientation: portrait) {
  .anime-bg-photo {
    background-image: var(--bg-mobile-url, url("../assets/bg_m.png"));
    background-position: center center;
  }
}

.anime-bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(12, 10, 28, 0.10) 0%, rgba(7, 8, 18, 0.58) 100%),
    linear-gradient(180deg, rgba(8, 9, 20, 0.30) 0%, transparent 35%, transparent 65%, rgba(7, 8, 18, 0.55) 100%);
}

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ==========================================================================
   自动播放二次元入场过渡动画（带薇尔莉特祖母绿胸针细腻渐出光晕）
   ========================================================================== */
.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.shutter-panel {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #171329 0%, #06070e 100%);
  transition: transform 1.25s cubic-bezier(0.77, 0, 0.175, 1), opacity 1.1s ease;
  z-index: 1;
}

.shutter-top {
  clip-path: polygon(0 0, 100% 0, 100% 53%, 0 47%);
}

.shutter-bottom {
  clip-path: polygon(0 47%, 100% 53%, 100% 100%, 0 100%);
}

.kessoku-slash {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scaleX(0.2) rotate(-5deg);
  transition: opacity 0.45s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-gate.slash-active .kessoku-slash {
  opacity: 1;
  transform: scaleX(1.1) rotate(-5deg);
}

.intro-gate.opening .kessoku-slash {
  opacity: 0;
  transform: scaleX(1.35) rotate(-5deg);
  transition: opacity 0.75s ease, transform 0.85s ease;
}

.intro-gate.opening .shutter-top {
  transform: translateY(-104%) skewY(-2deg);
  opacity: 0.2;
}

.intro-gate.opening .shutter-bottom {
  transform: translateY(104%) skewY(-2deg);
  opacity: 0.2;
}

.intro-gate.closed {
  visibility: hidden;
}

/* 薇尔莉特祖母绿胸针徽章：凝结浮现 -> 翡翠流光扩散 -> 柔焦羽化渐出 (Ethereal Fade-Out) */
.intro-crest {
  position: relative;
  z-index: 5;
  width: 124px;
  height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: broochAppear 0.9s var(--ethereal-ease) forwards;
  will-change: transform, opacity, filter;
}

/* 胸针外围的双层扩散光环 (Emerald & Gold Ripple Halo) */
.brooch-halo,
.brooch-halo-outer {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.brooch-halo {
  background: radial-gradient(
    circle,
    rgba(86, 240, 216, 0.48) 0%,
    rgba(226, 190, 107, 0.25) 45%,
    transparent 72%
  );
  filter: blur(8px);
}

.brooch-halo-outer {
  inset: -18px;
  border: 1px solid rgba(244, 213, 141, 0.45);
  box-shadow: 0 0 28px rgba(86, 240, 216, 0.38), inset 0 0 18px rgba(244, 213, 141, 0.25);
}

/* 阶段 1：宝石苏醒发光 */
.intro-gate.slash-active .brooch-halo {
  opacity: 1;
  transform: scale(1.15);
  transition: opacity 0.6s ease, transform 0.8s var(--ethereal-ease);
}

.intro-gate.slash-active .brooch-halo-outer {
  opacity: 0.85;
  transform: scale(1.08) rotate(25deg);
  transition: opacity 0.6s ease, transform 1.1s var(--ethereal-ease);
}

/* 阶段 2：宝石柔焦渐出（长达 1.45 秒的丝滑羽化消散：微幅上浮 + 翡翠高光晕开 + 高斯柔焦 + 透明度缓缓归零） */
.intro-gate.opening .intro-crest {
  animation: broochEtherealFadeOut 1.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-gate.opening .brooch-halo {
  opacity: 0;
  transform: scale(2.4);
  transition: opacity 1.35s ease, transform 1.45s var(--ethereal-ease);
}

.intro-gate.opening .brooch-halo-outer {
  opacity: 0;
  transform: scale(2.1) rotate(65deg);
  transition: opacity 1.25s ease, transform 1.45s var(--ethereal-ease);
}

@keyframes broochAppear {
  0% {
    transform: scale(0.68) translateY(10px);
    opacity: 0;
    filter: blur(10px) brightness(1.5);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0px) brightness(1);
  }
}

@keyframes broochEtherealFadeOut {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0px) brightness(1.05) drop-shadow(0 0 24px rgba(86, 240, 216, 0.6));
  }
  35% {
    transform: scale(1.08) translateY(-6px);
    opacity: 0.82;
    filter: blur(2px) brightness(1.35) drop-shadow(0 0 38px rgba(86, 240, 216, 0.85));
  }
  75% {
    transform: scale(1.18) translateY(-14px);
    opacity: 0.28;
    filter: blur(10px) brightness(1.6) drop-shadow(0 0 48px rgba(244, 213, 141, 0.65));
  }
  100% {
    transform: scale(1.26) translateY(-20px);
    opacity: 0;
    filter: blur(18px) brightness(1.8) drop-shadow(0 0 60px rgba(86, 240, 216, 0));
  }
}

.minimal-stage {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px;
}

.title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circle-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 760px;
}

@media (max-width: 640px) {
  .minimal-stage {
    gap: 30px;
  }
  .circle-dock {
    gap: 14px;
  }
}
