/* ===== 萌宠情绪系统 ===== */

/* 情绪容器 */
.mascot-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  user-select: none;
}

/* 萌宠主体 */
.mascot-body {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.mascot-container:hover .mascot-body {
  transform: scale(1.1);
}

/* 情绪表情定义 */
.mascot-body.mood-happy { animation: mascot-bounce 2s ease-in-out infinite; }
.mascot-body.mood-normal { animation: mascot-idle 3s ease-in-out infinite; }
.mascot-body.mood-tired { animation: mascot-tired 4s ease-in-out infinite; }
.mascot-body.mood-sick { animation: mascot-sick 3s ease-in-out infinite; }

/* 开心：上下弹跳 */
@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(-3deg); }
  75% { transform: translateY(-10px) rotate(3deg); }
}

/* 正常：轻微摇晃 */
@keyframes mascot-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

/* 疲惫：低频垂头 */
@keyframes mascot-tired {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  60% { transform: translateY(6px) rotate(-5deg); }
  80% { transform: translateY(4px) rotate(-3deg); }
}

/* 生病：轻微颤抖 */
@keyframes mascot-sick {
  0%, 100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-2px) translateY(1px); }
  75% { transform: translateX(2px) translateY(1px); }
}

/* 情绪气泡 */
.mascot-bubble {
  position: absolute;
  top: -10px;
  right: -10px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  white-space: nowrap;
}

/* 心情文字 */
.mascot-label {
  margin-top: 8px;
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* ===== 交互动画 ===== */

/* 抚摸动画：星星爆发 */
@keyframes heart-burst {
  0% { opacity: 1; transform: scale(1) translate(0, 0); }
  100% { opacity: 0; transform: scale(1.5) translate(var(--tx, 0), var(--ty, -30px)); }
}

.pet-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 24px;
  pointer-events: none;
  animation: heart-burst 0.8s ease-out forwards;
}

/* 喂食动画：食物飘落 */
@keyframes food-drop {
  0% { opacity: 1; transform: translate(0, -80px) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--tx, 0), 20px) rotate(360deg); }
}

.food-particle {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: 20px;
  pointer-events: none;
  animation: food-drop 0.7s ease-in forwards;
}

/* 开心特效：星星闪烁 */
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.sparkle {
  position: absolute;
  font-size: 16px;
  animation: sparkle 0.6s ease-in-out infinite;
  pointer-events: none;
}

/* ===== 情绪指示器 ===== */

.mood-indicator {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  transition: all 0.3s ease;
}

.mood-dot.active {
  background: #667eea;
  transform: scale(1.2);
}

/* 情绪进度条 */
.mood-bar {
  width: 100%;
  height: 6px;
  background: #f0f0f5;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.mood-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.3s ease;
}

.mood-bar-fill.happy { background: linear-gradient(90deg, #10b981, #34d399); }
.mood-bar-fill.normal { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mood-bar-fill.tired { background: linear-gradient(90deg, #ef4444, #f87171); }
.mood-bar-fill.sick { background: linear-gradient(90deg, #6b7280, #9ca3af); }

/* ===== 健康评分 ===== */

.health-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.health-score-badge .score-num {
  font-size: 18px;
  font-weight: 700;
}

/* ===== 萌宠场景卡片 ===== */

.mascot-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  text-align: center;
}

.mascot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mascot-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* ===== 抚摸效果 ===== */

.pet-petted::after {
  content: '❤️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  animation: heart-float 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes heart-float {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; transform: translate(-50%, -80%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}

/* 喂食特效 */
.pet-fed::after {
  content: '🍖';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  animation: feed-bounce 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes feed-bounce {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  60% { opacity: 1; transform: translate(-50%, -30%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, 50%) scale(0.8); }
}

/* ===== 情绪切换动画 ===== */

.mood-transition {
  animation: mood-switch 0.5s ease-in-out;
}

@keyframes mood-switch {
  0% { transform: scale(1); }
  50% { transform: scale(0.8); filter: blur(2px); }
  100% { transform: scale(1); filter: blur(0); }
}

/* ===== 飘浮装饰 ===== */

.mood-sparkles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.sparkle-1 { top: 10%; left: 5%; animation-delay: 0s; }
.sparkle-2 { top: 20%; right: 8%; animation-delay: 0.2s; }
.sparkle-3 { bottom: 30%; left: 3%; animation-delay: 0.4s; }
.sparkle-4 { bottom: 15%; right: 5%; animation-delay: 0.6s; }

/* ===== 首页心情卡片（独立模块） ===== */
.mood-card-body {
  padding: 4px 0;
}
.mood-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mood-card-emoji {
  font-size: 36px;
  line-height: 1;
}
.mood-card-info {
  flex: 1;
}
.mood-card-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.mood-card-bar {
  width: 100%;
  height: 6px;
  background: #f0f0f5;
  border-radius: 3px;
  overflow: hidden;
}
.mood-card-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.3s ease;
}
.mood-card-bar-fill.happy { background: linear-gradient(90deg, #10b981, #34d399); }
.mood-card-bar-fill.normal { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mood-card-bar-fill.tired { background: linear-gradient(90deg, #ef4444, #f87171); }
.mood-card-bar-fill.sick { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.mood-card-reasons {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8f8fc;
  border-radius: 8px;
}
.mood-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
.mood-card-btn {
  padding: 8px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.mood-card-btn:active {
  background: #f3f4f6;
  transform: scale(0.97);
}
