/* ==========================================================================
   译拍即合 Yipact — Apple-Inspired Motion & Micro-Interactions
   ========================================================================== */

/* Toast Enter & Exit */
@keyframes toastEnter {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastExit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* Modal Backdrop & Sheet Spring Scale */
@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSpringIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Subtle Hero Stagger Entrance */
@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Telegram-Inspired Message Bubble Entrance */
@keyframes bubbleInLeft {
  0% {
    opacity: 0;
    transform: translate(-10px, 8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes bubbleInRight {
  0% {
    opacity: 0;
    transform: translate(10px, 8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

/* Annotation Card / Original Text Smooth Unfold */
@keyframes cardUnfold {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Floating "问问 AI" Pill Pop */
@keyframes pillPop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Shimmer Skeleton for Translating Messages */
@keyframes shimmerWave {
  0% {
    background-position: -220% 0;
  }
  100% {
    background-position: 220% 0;
  }
}

.shimmer-bar {
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    rgba(66, 133, 244, 0.08) 0%,
    rgba(66, 133, 244, 0.18) 38%,
    rgba(52, 168, 83, 0.14) 55%,
    rgba(66, 133, 244, 0.08) 100%
  );
  background-size: 240% 100%;
  animation: shimmerWave 1.8s var(--ease-smooth) infinite;
}

/* Waiting Room: Google 4-Color Concentric Breathing + Orbital Motion */
@keyframes orbitRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes orbitRotateReverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes ringBreath {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.42;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.85;
  }
}

@keyframes corePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 26px rgba(66, 133, 244, 0.18), 0 0 0 0 rgba(66, 133, 244, 0.18);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 12px 32px rgba(66, 133, 244, 0.24), 0 0 0 10px rgba(66, 133, 244, 0);
  }
}

/* Subtle Dot Bounce for Thinking / Waiting */
@keyframes dotBounce {
  0%,
  80%,
  100% {
    transform: translateY(0) scale(0.85);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px) scale(1);
    opacity: 1;
  }
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  animation: dotBounce 1.2s ease-in-out infinite;
}

.typing-dots i:nth-child(1) {
  background: var(--g-blue);
  animation-delay: 0ms;
}

.typing-dots i:nth-child(2) {
  background: var(--g-red);
  animation-delay: 140ms;
}

.typing-dots i:nth-child(3) {
  background: var(--g-yellow);
  animation-delay: 280ms;
}

.typing-dots i:nth-child(4) {
  background: var(--g-green);
  animation-delay: 420ms;
}

/* Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(66, 133, 244, 0.22);
  border-top-color: var(--g-blue);
  animation: spin 0.72s linear infinite;
  flex-shrink: 0;
}

/* Copy Check Pop */
@keyframes checkPop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
