/* ============================================
   GOUP 小豆包 AI 学习助手样式
   移动端优先 (375px 基准)
   ============================================ */

/* ─── 悬浮按钮 ─── */
.doubao-fab {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  border: none;
  box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: doubaoFloat 2s ease-in-out infinite;
}
.doubao-fab:active {
  transform: scale(0.9);
}
.doubao-fab.hidden {
  display: none;
}

@keyframes doubaoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ─── 聊天面板 ─── */
.doubao-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: #fff;
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: doubaoSlideUp 0.3s ease;
  max-width: 600px;
  margin: 0 auto;
}

@keyframes doubaoSlideUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* ─── 面板头部 ─── */
.doubao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border-bottom: 1px solid #FFE082;
  flex-shrink: 0;
}
.doubao-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.doubao-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FF9800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.doubao-name {
  font-size: 16px;
  font-weight: 700;
  color: #5D4037;
}
.doubao-status {
  font-size: 11px;
  color: #8D6E63;
}
.doubao-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── 消息列表 ─── */
.doubao-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* ─── 单条消息 ─── */
.doubao-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.doubao-msg-bot {
  align-self: flex-start;
}
.doubao-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.doubao-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
}
.doubao-msg-bot .doubao-msg-avatar {
  background: #FFF3E0;
}
.doubao-msg-user .doubao-msg-avatar {
  background: #E3F2FD;
}

.doubao-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.doubao-msg-bot .doubao-msg-bubble {
  background: #F5F5F5;
  color: #333;
  border-top-left-radius: 4px;
}
.doubao-msg-user .doubao-msg-bubble {
  background: linear-gradient(135deg, #FFD700, #FFB300);
  color: #333;
  border-top-right-radius: 4px;
}

/* ─── 打字指示器 ─── */
.doubao-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.doubao-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  animation: typingBounce 1.4s ease-in-out infinite;
}
.doubao-typing span:nth-child(2) { animation-delay: 0.2s; }
.doubao-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── 快捷提问 ─── */
.doubao-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.doubao-quick-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #FFE082;
  background: #FFFDE7;
  color: #5D4037;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.doubao-quick-btn:active {
  background: #FFE082;
}

/* ─── 输入区 ─── */
.doubao-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.doubao-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 15px;
  outline: none;
  background: #F5F5F5;
  transition: border-color 0.2s;
}
.doubao-input:focus {
  border-color: #FFD700;
}
.doubao-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #FFD700, #FF9800);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.doubao-send:active {
  transform: scale(0.9);
}
.doubao-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ─── 锁定状态提示 ─── */
.doubao-locked-banner {
  background: #FFF3E0;
  padding: 8px 16px;
  font-size: 13px;
  color: #E65100;
  text-align: center;
  border-bottom: 1px solid #FFE082;
  flex-shrink: 0;
}
