/* 容器 */
#intro-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* 强制隐藏滚动条（备用） */
body.intro-playing {
  overflow: hidden;
}

/* 背景粒子效果 */
#intro-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  animation: particleFloat 5s ease-in-out infinite;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

.char-group {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 25vmin;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 
    0 0 5px rgba(255, 255, 255, 0.6),
    0 0 10px rgba(255, 255, 255, 0.4);
}

/* 移动端字体大小调整 */
@media (max-width: 768px) {
  .char-group {
    font-size: 60vmin;
  }
}

/* 偏旁样式 */
.radical {
  position: fixed;
  top: 50%;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-shadow: 
    0 0 3px rgba(255, 255, 255, 0.5),
    0 0 6px rgba(255, 255, 255, 0.3);
}

/* 飞入方向 */
.radical.left   { transform: translate(-150vw, 50%) scale(0.8); }
.radical.right  { transform: translate(150vw, 50%) scale(0.8); }
.radical.top    { transform: translate(50%, -150vh) scale(0.8); }
.radical.bottom { transform: translate(50%, 150vh) scale(0.8); }

/* 激活后飞向中心 */
.radical.animate-in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  text-shadow: 
    0 0 5px rgba(255, 255, 255, 0.6),
    0 0 10px rgba(255, 255, 255, 0.4);
}

/* 偏旁绕圈动画 */
.radical.orbit-left {
  animation: orbitLeft 1s ease-in-out forwards;
  transform-origin: 50vw 50vh;
}

.radical.orbit-right {
  animation: orbitRight 1s ease-in-out forwards;
  transform-origin: 50vw 50vh;
}

/* 偏旁绕圈动画 - 变体2（更快） */
.radical.orbit-left-fast {
  animation: orbitLeftFast 0.8s ease-in-out forwards;
  transform-origin: 50vw 50vh;
}

.radical.orbit-right-fast {
  animation: orbitRightFast 0.8s ease-in-out forwards;
  transform-origin: 50vw 50vh;
}

/* 偏旁绕圈动画 - 变体3（不同半径） */
.radical.orbit-left-large {
  animation: orbitLeft 1.2s ease-in-out forwards;
  transform: translate(-50%, -50%) scale(1.5);
}

.radical.orbit-right-large {
  animation: orbitRight 1.2s ease-in-out forwards;
  transform: translate(-50%, -50%) scale(1.5);
}

/* 偏旁消失动画 */
.radical.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

/* 绕圈关键帧 - 变体1 */
@keyframes orbitLeft {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes orbitRight {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

/* 绕圈关键帧 - 变体2（更快） */
@keyframes orbitLeftFast {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(720deg);
  }
}

@keyframes orbitRightFast {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-720deg);
  }
}



/* 偏旁消失关键帧 */
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
}

/* 合成字 */
.combined {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease-out;
  text-shadow: 
    0 0 5px rgba(255, 255, 255, 0.5),
    0 0 10px rgba(255, 255, 255, 0.3),
    0 0 15px rgba(255, 255, 255, 0.2);
}

.combined.show {
  opacity: 1;
  transform: scale(1.2);
  text-shadow: 
    0 0 5px rgba(255, 255, 255, 0.6),
    0 0 10px rgba(255, 255, 255, 0.4);
  animation: glowPulse 0.5s ease-in-out infinite;
}

/* 合成字发光脉冲动画 */
@keyframes glowPulse {
  0%, 100% {
    text-shadow: 
      0 0 5px rgba(255, 255, 255, 0.6),
      0 0 10px rgba(255, 255, 255, 0.4);
  }
  50% {
    text-shadow: 
      0 0 8px rgba(255, 255, 255, 0.7),
      0 0 15px rgba(255, 255, 255, 0.5);
  }
}



/* 飞出关键帧 */
@keyframes flyOutUp { 
  0% {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.5);
    text-shadow: 
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6),
      0 0 90px rgba(255, 255, 255, 0.4);
  }
  100% {
    transform: translateY(-200vh) scale(2);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutDown { 
  0% {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.5);
    text-shadow: 
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6),
      0 0 90px rgba(255, 255, 255, 0.4);
  }
  100% {
    transform: translateY(200vh) scale(2);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutLeft { 
  0% {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.5);
    text-shadow: 
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6),
      0 0 90px rgba(255, 255, 255, 0.4);
  }
  100% {
    transform: translateX(-200vw) scale(2);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutRight { 
  0% {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.5);
    text-shadow: 
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6),
      0 0 90px rgba(255, 255, 255, 0.4);
  }
  100% {
    transform: translateX(200vw) scale(2);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutDiagonal { 
  0% {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.5);
    text-shadow: 
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6),
      0 0 90px rgba(255, 255, 255, 0.4);
  }
  100% {
    transform: translate(100vw, -100vh) scale(2);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutRotate { 
  0% {
    opacity: 1;
    transform: scale(1.2) rotate(0deg);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.8;
    transform: scale(2) rotate(180deg);
    text-shadow: 
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6),
      0 0 90px rgba(255, 255, 255, 0.4);
  }
  100% {
    transform: scale(3) rotate(720deg);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutZoom { 
  0% {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  30% {
    opacity: 1;
    transform: scale(3);
    text-shadow: 
      0 0 50px rgba(255, 255, 255, 1),
      0 0 100px rgba(255, 255, 255, 0.8),
      0 0 150px rgba(255, 255, 255, 0.6);
  }
  100% {
    transform: scale(5);
    opacity: 0;
    text-shadow: 
      0 0 80px rgba(255, 255, 255, 0.6),
      0 0 160px rgba(255, 255, 255, 0.4),
      0 0 240px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutBounce { 
  0% {
    opacity: 1;
    transform: scale(1.2) translateY(0);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  25% {
    opacity: 0.9;
    transform: scale(1.3) translateY(-30px);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.5) translateY(0);
  }
  75% {
    opacity: 0.6;
    transform: scale(1.8) translateY(-20px);
  }
  100% {
    transform: scale(2) translateY(-200vh);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

@keyframes flyOutSpiral { 
  0% {
    opacity: 1;
    transform: scale(1.2) rotate(0deg) translate(0, 0);
    text-shadow: 
      0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  25% {
    opacity: 0.9;
    transform: scale(1.5) rotate(90deg) translate(20px, -20px);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.8) rotate(180deg) translate(-20px, 20px);
  }
  75% {
    opacity: 0.6;
    transform: scale(2.2) rotate(270deg) translate(20px, 20px);
  }
  100% {
    transform: scale(3) rotate(720deg) translate(100vw, -100vh);
    opacity: 0;
    text-shadow: 
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(255, 255, 255, 0.4),
      0 0 120px rgba(255, 255, 255, 0.2);
  }
}

/* 工具类 */
.hidden { display: none !important; }

