/**
 * 吉吉悬浮球样式 - 与小程序 jiji-fab.wxss 对应，使用全站设计变量
 */
@import "variables.css";

.jiji-movable-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.jiji-movable-view {
  width: 60px;
  height: 60px;
  pointer-events: auto;
  position: absolute;
  cursor: grab;
  touch-action: none;
  z-index: 10000;
  /* 扩大触摸感应区域，实际可点击区域比视觉大 */
  padding: 10px;
  margin: -10px;
}
.jiji-movable-view:active {
  cursor: grabbing;
}

.jiji-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}

.jiji-fab.before-entrance {
  opacity: 0;
  transform: translateY(-400px);
}

.jiji-fab.entrance-animation {
  animation: jiji-drop 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes jiji-drop {
  0% {
    opacity: 0;
    transform: translateY(-400px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  50% {
    transform: translateY(0) rotate(360deg);
  }
  70% {
    transform: translateY(-50px) rotate(380deg);
  }
  85% {
    transform: translateY(0) rotate(360deg);
  }
  95% {
    transform: translateY(-20px) rotate(368deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

.jiji-image-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.jiji-fab.entrance-done .jiji-image-el,
.jiji-fab.entrance-done .jiji-emoji {
  animation: flame-bounce 2s ease-in-out infinite, glow-pulse 2s ease-in-out infinite;
}

.jiji-emoji {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: transparent;
  border-radius: 50%;
}

@keyframes flame-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-4px) scale(1.05); }
  50% { transform: translateY(-2px) scale(1.02); }
  75% { transform: translateY(-3px) scale(1.03); }
}

@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 100, 50, 0.6)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 150, 80, 0.9)); }
}

.jiji-image-el.tapped,
.jiji-emoji.tapped {
  animation: tap-spin 0.6s ease-in-out !important;
}

@keyframes tap-spin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(0.9) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.jiji-image-el.long-press,
.jiji-emoji.long-press {
  animation: shake 0.3s ease-in-out 3 !important;
}

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

.jiji-bubble {
  position: absolute;
  top: -45px;
  right: 0;
  background: var(--gradient-primary-solid);
  padding: var(--gap-sm) 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  font-weight: 500;
  animation: bubble-pop 0.5s ease-out;
  pointer-events: none;
}

.jiji-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 15px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--primary-dark);
}

@keyframes bubble-pop {
  0% { opacity: 0; transform: translateY(-6px) scale(0.8); }
  50% { transform: translateY(0) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 菜单遮罩 */
.jiji-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.jiji-menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

.jiji-menu-container {
  position: absolute;
  right: 20px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.jiji-menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  padding: var(--gap-md) 0;
  width: 120px;
  border-radius: 25px;
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
  animation: menu-item-in 0.3s ease forwards;
}

.jiji-menu-overlay.show .jiji-menu-item {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.jiji-menu-item:active {
  background: var(--border-light);
  transform: scale(0.98);
}

@keyframes menu-item-in {
  0% { opacity: 0; transform: translateX(50px) scale(0.8); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
