/* 对话气泡框样式 — 用于多轮对话和坑点文章 */
.chat-bubble {
  --bubble-user-bg: linear-gradient(135deg, #6366f1, #8b5cf6);
  --bubble-user-txt: #fff;
  --bubble-ai-bg: rgba(99,102,241,0.07);
  --bubble-ai-border: rgba(99,102,241,0.15);
  --bubble-ai-txt: inherit;
  --bubble-radius: 18px;
  max-width: 580px;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.5rem 0;
}
[data-theme="light"] .chat-bubble {
  --bubble-ai-bg: rgba(99,102,241,0.05);
  --bubble-ai-border: rgba(99,102,241,0.12);
}
.chat-bubble .msg {
  padding: 0.7rem 1.1rem;
  border-radius: var(--bubble-radius);
  line-height: 1.65;
  font-size: 0.9rem;
  position: relative;
  max-width: 85%;
  animation: chatFadeIn 0.4s ease both;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-bubble .msg:hover {
  transform: translateY(-1px);
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-bubble .msg.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  color: var(--bubble-user-txt);
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 12px rgba(99,102,241,0.25);
  animation-delay: 0s;
}
.chat-bubble .msg.user:hover {
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.chat-bubble .msg.ai {
  align-self: flex-start;
  background: var(--bubble-ai-bg);
  border: 1px solid var(--bubble-ai-border);
  color: var(--bubble-ai-txt);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(8px);
  animation-delay: 0.15s;
}
.chat-bubble .msg.ai:hover {
  box-shadow: 0 2px 12px rgba(99,102,241,0.1);
}
.chat-bubble .msg .label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  opacity: 0.65;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.chat-bubble .msg.user .label {
  color: rgba(255,255,255,0.8);
}
