/* ═══════════════════════════════════════════════════════
   militree 园丁精灵 — CSS 角色
   ═══════════════════════════════════════════════════════ */

.character-container {
  position: relative;
  width: 56px; height: 72px;
  flex-shrink: 0;
  margin-right: 2px;
  align-self: flex-end;
  user-select: none;
}

/* 身体 */
.character-body {
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #84b63c, #a8d960);
  border-radius: 50% 50% 40% 40%;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* 头 */
.character-head {
  position: absolute;
  bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 32px; height: 32px;
  background: #fef9c3;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* 眼睛 */
.character-eye {
  position: absolute;
  width: 4px; height: 4px;
  background: #1e293b;
  border-radius: 50%;
  top: 12px;
}
.character-eye.left { left: 9px; }
.character-eye.right { right: 9px; }

/* 微笑 */
.character-mouth {
  position: absolute;
  bottom: 7px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 4px;
  border-bottom: 2px solid #1e293b;
  border-radius: 0 0 50% 50%;
}

/* 帽子（小园丁草帽） */
.character-hat {
  position: absolute;
  bottom: 38px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 10px;
  background: #d4a574;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 -1px 2px rgba(0,0,0,.1);
}

/* ── 状态动画 ── */

/* idle: 轻微浮动 */
.character-idle .character-body {
  animation: charFloat 3s ease-in-out infinite;
}
@keyframes charFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}

/* happy: 弹跳 */
.character-happy .character-body {
  animation: charJump 0.4s ease 2;
}
.character-happy .character-mouth {
  width: 10px; height: 5px;
}
@keyframes charJump {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}

/* thinking: 歪头 */
.character-think .character-head {
  animation: charTilt 1.5s ease-in-out infinite alternate;
}
@keyframes charTilt {
  0%   { transform: translateX(-50%) rotate(-5deg); }
  100% { transform: translateX(-50%) rotate(5deg); }
}

/* 语音气泡 */
.character-speech {
  position: absolute;
  bottom: 78px; left: 50%; transform: translateX(-50%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: msgSlideIn 0.3s ease;
  pointer-events: none;
}
.character-speech::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: white;
}

/* 响应式 — 手机端缩小 */
@media (max-width: 768px) {
  .character-container {
    width: 44px; height: 58px;
  }
  .character-head { width: 26px; height: 26px; bottom: 22px; }
  .character-body { width: 28px; height: 28px; }
  .character-hat { width: 28px; height: 8px; bottom: 30px; }
  .character-eye { top: 10px; width: 3px; height: 3px; }
  .character-eye.left { left: 7px; }
  .character-eye.right { right: 7px; }
  .character-mouth { bottom: 6px; width: 6px; height: 3px; }
  .character-speech { bottom: 62px; font-size: 10px; }
}
