/* ==== 页面整体 ==== */
body {
  font-family: "SF Pro Display", "Microsoft YaHei", sans-serif;
  background: linear-gradient(to bottom right, #c3ecff, #ffe29f);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

/* ==== 主容器 ==== */
.container {
  width: 95%;
  max-width: 420px;
  background: #fff;
  margin-top: 60px;
  border-radius: 25px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeIn 1s ease;
}

/* ==== 顶部栏 ==== */
.header {
  background: linear-gradient(135deg,#48dbfb,#1dd1a1);
  color: #fff;
  padding: 15px 0;
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ==== 聊天区域 ==== */
#chat-box {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #eef2f7;
  display: flex;
  flex-direction: column;
}

/* ==== 每条消息外层 ==== */
.message-wrapper {
  display: flex;
  align-items: flex-end;
  margin: 8px 0;
  animation: fadeInUp 0.4s ease;
}

/* ==== 融融头像 ==== */
.ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-right: 8px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  object-fit: cover;
}

/* ==== 聊天气泡 ==== */
.message {
  display: inline-block;
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 20px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

/* AI 消息 */
.ai {
  background: #fff;
  color: #333;
  align-self: flex-start;
  border-radius: 18px 18px 18px 5px;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.1);
}

/* 用户消息 */
.user {
  background: linear-gradient(135deg,#74b9ff,#0984e3);
  color: white;
  align-self: flex-end;
  border-radius: 18px 18px 5px 18px;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.1);
  margin-left: auto;
}

/* ==== 输入区 ==== */
.input-area {
  display: flex;
  border-top: 1px solid #ddd;
  background: #fff;
  padding: 10px;
  align-items: center;
}
.input-area input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 20px;
  background: #f1f1f1;
  font-size: 1rem;
  outline: none;
}
.input-area button {
  background: linear-gradient(135deg,#ff9f43,#ff6b6b);
  border: none;
  color: white;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}
.input-area button:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* ==== 动画 ==== */
/* @keyframes fadeIn {0%{opacity:0;transform:translateY(-20px);}100%{opacity:1;transform:translateY(0);}}
@keyframes fadeInUp {0%{opacity:0;transform:translateY(10px);}100%{opacity:1;transform:translateY(0);}} */

/* ==== 滚动条美化 ==== */
#chat-box::-webkit-scrollbar {width:5px;}
#chat-box::-webkit-scrollbar-thumb {background:#ccc;border-radius:10px;}

.typing {
  display: inline-block;
  font-size: 15px;
  color: #666;
  letter-spacing: 2px;
  animation: blink 1.4s infinite both;
}
@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}
.dot {
  animation: blink 1.4s infinite both;
}
.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}
