/**
 * ============================================
 * ComputerHub — 悬浮机器人动画
 * ============================================
 */

/* 机器人容器 */
.ch-robot-wrapper {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ch-robot-wrapper:hover {
  transform: scale(1.08);
}

.ch-robot-wrapper:active {
  transform: scale(0.95);
}

/* 光晕 */
.ch-robot-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.25) 0%, rgba(124, 58, 237, 0.12) 50%, transparent 70%);
  animation: robotGlow 3s ease-in-out infinite;
}

@keyframes robotGlow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* 机器人主体 SVG */
.ch-robot-svg {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 4px 20px rgba(0, 212, 255, 0.35));
  animation: robotFloat 3s ease-in-out infinite;
}

@keyframes robotFloat {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-8px); }
  50% { transform: translateY(-3px); }
  75% { transform: translateY(-10px); }
}

/* 眨眼动画 */
.ch-robot-eye-left,
.ch-robot-eye-right {
  animation: robotBlink 4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes robotBlink {
  0%, 45%, 55%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.05); }
}

/* 嘴巴动画 */
.ch-robot-mouth {
  animation: robotMouth 4s ease-in-out infinite;
}

@keyframes robotMouth {
  0%, 45%, 55%, 100% { ry: 6; }
  50% { ry: 2; }
}

/* 手臂挥手 */
.ch-robot-arm-left {
  animation: robotWaveLeft 2s ease-in-out infinite;
  transform-origin: 30px 36px;
}

@keyframes robotWaveLeft {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-12deg); }
  60% { transform: rotate(5deg); }
}

.ch-robot-arm-right {
  animation: robotWaveRight 2.5s ease-in-out infinite;
  transform-origin: 42px 36px;
}

@keyframes robotWaveRight {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(15deg); }
  65% { transform: rotate(-5deg); }
}

/* 天线脉冲 */
.ch-robot-antenna-dot {
  animation: antennaPulse 2s ease-in-out infinite;
}

@keyframes antennaPulse {
  0%, 100% { opacity: 0.7; r: 3; }
  50% { opacity: 1; r: 4.5; }
}

/* 通知气泡 */
.ch-robot-bubble {
  position: absolute;
  top: -50px;
  right: -10px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
  animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 2;
}

.ch-robot-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--accent-purple);
}

@keyframes bubblePop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.ch-robot-bubble.hide {
  animation: bubbleHide 0.3s ease-in forwards;
}

@keyframes bubbleHide {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.5); opacity: 0; }
}

/* 响应式 — 小屏幕缩小机器人 */
@media (max-width: 640px) {
  .ch-robot-wrapper {
    bottom: 16px;
    right: 16px;
  }
  .ch-robot-svg {
    width: 56px;
    height: 56px;
  }
  .ch-robot-glow {
    width: 90px;
    height: 90px;
  }
  .ch-robot-bubble {
    font-size: 11px;
    padding: 6px 10px;
    top: -42px;
    right: -15px;
  }
}
