/* ==========================================
   增强版 - 更多炫酷动画和配色
   ========================================== */

/* === 更多颜色变量在:root中添加 === */
/* 在主CSS的:root中添加这些变量:
  --color-orange: #FF5722;
  --color-purple: #9C27B0;
  --color-green: #00FF88;
  --color-red: #FF0055;
  --color-blue: #2196F3;
  --color-hotpink: #FF1493;
  --color-electric: #7B68EE;
  --color-mint: #98FF98;
  --color-coral: #FF7F50;
*/

/* === 新增大幅度炫酷动画 === */

/* 1. 爆炸式放大动画 */
@keyframes explode-in {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(20deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* 2. 3D翻转动画 */
@keyframes flip-3d {
  0% {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
  }
  25% {
    transform: perspective(1000px) rotateY(180deg) rotateX(20deg);
  }
  50% {
    transform: perspective(1000px) rotateY(360deg) rotateX(0deg);
  }
  75% {
    transform: perspective(1000px) rotateY(540deg) rotateX(-20deg);
  }
  100% {
    transform: perspective(1000px) rotateY(720deg) rotateX(0deg);
  }
}

/* 3. 波浪扭曲动画 */
@keyframes wave-distort {
  0% {
    transform: skewX(0deg) translateX(0) scaleY(1);
  }
  25% {
    transform: skewX(15deg) translateX(20px) scaleY(1.1);
  }
  50% {
    transform: skewX(0deg) translateX(0) scaleY(1);
  }
  75% {
    transform: skewX(-15deg) translateX(-20px) scaleY(0.9);
  }
  100% {
    transform: skewX(0deg) translateX(0) scaleY(1);
  }
}

/* 4. 闪电震动动画 */
@keyframes lightning-shake {
  0%, 100% {
    transform: translate(0, 0);
    filter: brightness(1);
  }
  10% {
    transform: translate(-8px, -8px);
    filter: brightness(1.5);
  }
  20% {
    transform: translate(8px, 8px);
    filter: brightness(1);
  }
  30% {
    transform: translate(-6px, 6px);
    filter: brightness(1.8);
  }
  40% {
    transform: translate(6px, -6px);
    filter: brightness(1);
  }
  50% {
    transform: translate(-4px, -4px);
    filter: brightness(2);
  }
  60% {
    transform: translate(4px, 4px);
    filter: brightness(1);
  }
  70% {
    transform: translate(-2px, 2px);
    filter: brightness(1.5);
  }
  80% {
    transform: translate(2px, -2px);
    filter: brightness(1);
  }
  90% {
    transform: translate(-1px, -1px);
    filter: brightness(1.2);
  }
}

/* 5. 弹跳滚动动画 */
@keyframes bounce-roll {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  15% {
    transform: translateY(-60px) rotate(90deg) scale(1.1);
  }
  30% {
    transform: translateY(0) rotate(180deg) scale(1);
  }
  45% {
    transform: translateY(-40px) rotate(270deg) scale(1.05);
  }
  60% {
    transform: translateY(0) rotate(360deg) scale(1);
  }
  75% {
    transform: translateY(-20px) rotate(405deg) scale(1.02);
  }
  90% {
    transform: translateY(0) rotate(450deg) scale(1);
  }
  100% {
    transform: translateY(0) rotate(360deg) scale(1);
  }
}

/* 6. 彩虹脉冲动画 */
@keyframes rainbow-pulse {
  0% {
    background: #FF90E8;
    transform: scale(1);
    box-shadow: 0 0 20px #FF90E8;
  }
  20% {
    background: #00FFFF;
    transform: scale(1.1);
    box-shadow: 0 0 40px #00FFFF;
  }
  40% {
    background: #D4FF00;
    transform: scale(1.05);
    box-shadow: 0 0 40px #D4FF00;
  }
  60% {
    background: #B8FF9F;
    transform: scale(1.15);
    box-shadow: 0 0 60px #B8FF9F;
  }
  80% {
    background: #7B68EE;
    transform: scale(1.05);
    box-shadow: 0 0 40px #7B68EE;
  }
  100% {
    background: #FF90E8;
    transform: scale(1);
    box-shadow: 0 0 20px #FF90E8;
  }
}

/* 7. 螺旋上升动画 */
@keyframes spiral-up {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(40px, -60px) rotate(180deg) scale(1.2);
  }
  50% {
    transform: translate(0, -120px) rotate(360deg) scale(1);
  }
  75% {
    transform: translate(-40px, -60px) rotate(540deg) scale(1.2);
  }
  100% {
    transform: translate(0, 0) rotate(720deg) scale(1);
  }
}

/* === 应用动画到元素 === */
.animated-explode {
  animation: explode-in 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animated-flip {
  animation: flip-3d 3s ease-in-out infinite;
}

.animated-wave {
  animation: wave-distort 2s ease-in-out infinite;
}

.animated-lightning {
  animation: lightning-shake 0.5s ease-in-out infinite;
}

.animated-bounce-roll {
  animation: bounce-roll 3s ease-in-out infinite;
}

.animated-rainbow {
  animation: rainbow-pulse 4s ease-in-out infinite;
}

.animated-spiral {
  animation: spiral-up 4s ease-in-out infinite;
}

/* === 增强的装饰元素 === */
.decorative-badge {
  position: absolute;
  background: #FF5722;
  border: 3px solid black;
  padding: 8px 16px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
  transform: rotate(-12deg);
  z-index: 10;
  animation: float-smooth 3s ease-in-out infinite;
}

.decorative-sticker {
  position: absolute;
  width: 60px;
  height: 60px;
  background: #FF1493;
  border: 3px solid black;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 6px 6px 0px 0px rgba(0,0,0,1);
  animation: spin-bounce 4s ease-in-out infinite;
  z-index: 5;
}

.floating-icon {
  position: fixed;
  font-size: 40px;
  animation: spiral-up 8s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}

/* === 增强的登录注册页面 === */
.auth-container {
  animation: explode-in 0.6s ease-out;
}

.auth-container::after {
  content: '🍅';
  position: absolute;
  top: -40px;
  right: -40px;
  font-size: 80px;
  animation: bounce-roll 3s ease-in-out infinite;
}

.form-container input {
  transition: all 0.3s ease;
}

.form-container input:focus {
  transform: scale(1.02);
  animation: lightning-shake 0.3s ease-in-out;
}

/* === 增强的按钮效果 === */
.btn-primary,
.btn-secondary,
.btn-outline {
  position: relative;
  overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before,
.btn-outline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-outline:hover::before {
  width: 300px;
  height: 300px;
}

/* === 增强的计时器显示 === */
#timer {
  position: relative;
}

/* === 多彩边框效果 === */
.rainbow-border {
  border: 4px solid;
  border-image: linear-gradient(
    45deg,
    #FF90E8,
    #00FFFF,
    #D4FF00,
    #B8FF9F,
    #FF5722,
    #9C27B0
  ) 1;
  animation: border-dance 3s linear infinite;
}

@keyframes border-dance {
  0% {
    border-image-source: linear-gradient(45deg, #FF90E8, #00FFFF, #D4FF00);
  }
  33% {
    border-image-source: linear-gradient(45deg, #00FFFF, #D4FF00, #B8FF9F);
  }
  66% {
    border-image-source: linear-gradient(45deg, #D4FF00, #B8FF9F, #FF5722);
  }
  100% {
    border-image-source: linear-gradient(45deg, #B8FF9F, #FF5722, #FF90E8);
  }
}

/* === 霓虹发光效果 === */
.neon-glow {
  animation: neon-flicker 2s ease-in-out infinite;
}

@keyframes neon-flicker {
  0%, 100% {
    text-shadow:
      0 0 10px #00FFFF,
      0 0 20px #00FFFF,
      0 0 30px #00FFFF,
      0 0 40px #FF90E8;
  }
  50% {
    text-shadow:
      0 0 5px #00FFFF,
      0 0 10px #00FFFF,
      0 0 15px #FF90E8,
      0 0 20px #FF90E8;
  }
}

/* === 多层阴影效果 === */
.mega-shadow {
  box-shadow:
    4px 4px 0 #00FFFF,
    8px 8px 0 #FF90E8,
    12px 12px 0 #D4FF00,
    16px 16px 0 #B8FF9F,
    20px 20px 0 black;
}

.mega-shadow:hover {
  animation: shadow-shift 0.5s ease-in-out;
}

@keyframes shadow-shift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20px, 20px);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* === 粒子背景效果 === */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #00FFFF;
  border: 2px solid black;
  animation: particle-float 10s ease-in-out infinite;
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

/* === 彩色背景模式 === */
.auth-page-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    linear-gradient(135deg, #FF90E8 0%, transparent 50%),
    linear-gradient(45deg, #00FFFF 0%, transparent 50%),
    linear-gradient(225deg, #D4FF00 0%, transparent 50%),
    linear-gradient(315deg, #B8FF9F 0%, transparent 50%);
  animation: bg-shift 10s ease-in-out infinite;
}

@keyframes bg-shift {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
}

/* === 增强标签页效果 === */
.tab-item {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tab-item:hover {
  transform: translateY(-8px);
}

.tab-item.active {
  animation: tab-pulse 2s ease-in-out infinite;
}

@keyframes tab-pulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* === 图标动画 === */
.icon-spin {
  display: inline-block;
  animation: icon-continuous-spin 2s linear infinite;
}

@keyframes icon-continuous-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-bounce {
  display: inline-block;
  animation: icon-bounce-up 1s ease-in-out infinite;
}

@keyframes icon-bounce-up {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.icon-shake {
  display: inline-block;
  animation: icon-shake-x 0.5s ease-in-out infinite;
}

@keyframes icon-shake-x {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* === 增强的模态框 === */
.modal {
  backdrop-filter: blur(10px);
}

.modal-content {
  animation: modal-slide-up 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modal-slide-up {
  from {
    transform: translateY(100px) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* === 时间进度条动画 === */
.progress-bar {
  height: 12px;
  background: white;
  border: 3px solid black;
  position: relative;
  overflow: hidden;
  margin: 20px 0;
}

.progress-fill {
  height: 100%;
  background: #B8FF9F;
  border-right: 3px solid black;
  transition: width 1s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.3) 50%,
    transparent 100%
  );
  animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* === 增强的历史记录项 === */
.history-item {
  transition: all 0.3s ease;
}

.history-item:hover {
  transform: translateX(10px) scale(1.02);
  box-shadow:
    4px 4px 0 #00FFFF,
    8px 8px 0 #FF90E8;
}

/* === 增强的分类统计卡片 === */
.category-stat-item:nth-child(1) .category-name {
  background: #FF90E8;
}

.category-stat-item:nth-child(2) .category-name {
  background: #00FFFF;
}

.category-stat-item:nth-child(3) .category-name {
  background: #D4FF00;
}

.category-stat-item:nth-child(4) .category-name {
  background: #B8FF9F;
}

.category-stat-item:nth-child(5) .category-name {
  background: #FF5722;
}

.category-stat-item:nth-child(6) .category-name {
  background: #9C27B0;
}

/* === 增强的输入字段 === */
input:focus,
select:focus,
textarea:focus {
  animation: input-glow 1.5s ease-in-out infinite;
}

@keyframes input-glow {
  0%, 100% {
    box-shadow: 0 0 5px #00FFFF, 4px 4px 0px 0px rgba(0,0,0,1);
  }
  50% {
    box-shadow: 0 0 15px #FF90E8, 4px 4px 0px 0px rgba(0,0,0,1);
  }
}

/* === 加载动画 === */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #000;
  border-top-color: #FF90E8;
  border-right-color: #00FFFF;
  border-bottom-color: #D4FF00;
  border-left-color: #B8FF9F;
  border-radius: 50%;
  animation: spinner-rotate 1s linear infinite;
}

@keyframes spinner-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* === 成功/错误提示增强 === */
.toast.success {
  background: #B8FF9F !important;
  animation: toast-bounce 0.5s ease-out;
}

.toast.error {
  background: #FF0055 !important;
  animation: toast-shake 0.5s ease-out;
}

.toast.warning {
  background: #D4FF00 !important;
  animation: toast-wave 0.5s ease-out;
}

@keyframes toast-bounce {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(0) translateY(-20px);
  }
  50% {
    transform: translateX(0) translateY(-10px);
  }
  75% {
    transform: translateX(0) translateY(-5px);
  }
}

@keyframes toast-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

@keyframes toast-wave {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(0) rotate(-5deg);
  }
  75% {
    transform: translateX(0) rotate(5deg);
  }
}
