/* ==========================================
   动画：滑动、弹出、庆祝动画
   ========================================== */

/* ---- 稀有度发光动画 ---- */
@keyframes ssrGlow {
  from { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), 0 0 16px rgba(255, 215, 0, 0.2); }
  to   { box-shadow: 0 0 16px rgba(255, 215, 0, 0.8), 0 0 32px rgba(255, 215, 0, 0.5); }
}

@keyframes legendRainbow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- 任务卡片回弹 ---- */
@keyframes cardSnapBack {
  0%   { transform: var(--card-drag-transform, translate(0, 0) rotate(0deg)); }
  60%  { transform: translate(0, 0) rotate(1deg); }
  80%  { transform: translate(0, 0) rotate(-0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* ---- 任务完成飞出 ---- */
@keyframes cardFlyUp {
  0%   { transform: translateY(0) rotate(var(--exit-rotate, -5deg)); opacity: 1; }
  100% { transform: translateY(-120vh) rotate(var(--exit-rotate, -15deg)); opacity: 0; }
}

@keyframes cardFlyLeft {
  0%   { transform: translateX(0) rotate(var(--exit-rotate, -5deg)); opacity: 1; }
  100% { transform: translateX(-120vw) rotate(-30deg); opacity: 0; }
}

/* ---- 卡片入场 ---- */
@keyframes cardEnter {
  from { transform: scale(0.85) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ---- 弹出动画 ---- */
@keyframes popIn {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  60%  { transform: scale(1.05) translateY(-4px); }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---- 星星爆炸 ---- */
@keyframes starBurst {
  0%   { transform: scale(0) rotate(0deg); opacity: 1; }
  50%  { transform: scale(1.4) rotate(180deg); opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

@keyframes starFloat {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.5); opacity: 0; }
}

/* ---- 庆祝彩纸 ---- */
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---- 抖动提示 ---- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-8px) rotate(-2deg); }
  40%  { transform: translateX(8px) rotate(2deg); }
  60%  { transform: translateX(-6px) rotate(-1deg); }
  80%  { transform: translateX(6px) rotate(1deg); }
}

/* ---- 脉冲 ---- */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%  { transform: scale(1.08); }
}

/* ---- 呼吸光效 ---- */
@keyframes breathe {
  0%, 100% { opacity: 0.8; }
  50%  { opacity: 1; }
}

/* ---- 进场动画类 ---- */
.anim-pop-in { animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anim-fade-in { animation: fadeIn var(--transition) forwards; }
.anim-slide-up { animation: slideUp var(--transition) forwards; }
.anim-shake { animation: shake 0.5s ease; }
.anim-pulse { animation: pulse 1.2s ease infinite; }
.anim-card-enter { animation: cardEnter 0.3s ease forwards; }

/* ---- 方向提示箭头 ---- */
.gesture-hint {
  position: absolute;
  font-size: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 100;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.gesture-hint.up {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.gesture-hint.left {
  top: 50%;
  left: 20%;
  transform: translateY(-50%);
}

/* 手势完成/跳过标签 */
.drag-label {
  position: absolute;
  top: 24px;
  padding: 6px 16px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-md);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 10;
}

.drag-label.complete {
  right: 20px;
  background: rgba(76, 175, 80, 0.9);
  color: #FFF;
  border: 2px solid #4CAF50;
}

.drag-label.skip {
  left: 20px;
  background: rgba(255, 82, 82, 0.9);
  color: #FFF;
  border: 2px solid #FF5252;
}

/* ---- 星星数字弹出 ---- */
.stars-popup {
  position: fixed;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 3000;
  animation: starFloat 1.2s ease forwards;
}

/* ---- 彩纸容器 ---- */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 2s ease forwards;
}

/* 页面切换 */
.view-enter {
  animation: slideDown 0.25s ease forwards;
}
