/* ========== AI教练页 ========== */
.ai-head {
  display: flex; align-items: center; justify-content: space-between;
}
.ai-quota {
  font-size: 12px; color: var(--text-soft);
  background: #fff; padding: 5px 10px; border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.ai-quota b { color: var(--rose); }

/* 欢迎说明 */
.ai-intro {
  background: linear-gradient(135deg, #E8E0FF, #E0F2FF);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.ai-intro-emoji { font-size: 28px; }
.ai-intro-text { font-size: 13px; line-height: 1.8; color: var(--text); }

/* 工具按钮 */
.ai-tools {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.ai-tool {
  background: #fff;
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .15s;
}
.ai-tool:active { transform: scale(0.94); }
.at-emoji { font-size: 22px; margin-bottom: 4px; }
.at-name { font-size: 11px; font-weight: 600; color: var(--text); }
.at-price { font-size: 10px; color: var(--rose); margin-top: 2px; }

/* 聊天列表 */
.chat-list {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 14px;
  min-height: 300px;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}
.msg {
  display: flex; gap: 8px;
  margin-bottom: 14px;
  animation: fadeIn .25s;
}
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink:0;
  background: #F5F0EC;
}
.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.ai .msg-bubble {
  background: #F7F3EF;
  border-top-left-radius: 4px;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .msg-bubble {
  background: var(--gradient-rose);
  color: #fff;
  border-top-right-radius: 4px;
}
.msg.typing .msg-bubble::after {
  content: ' ● ● ●';
  animation: typingDots 1.2s infinite;
  color: var(--rose);
}
@keyframes typingDots {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* 建议问题 chips */
.chat-suggest {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.cs-chip {
  padding: 6px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
}
.cs-chip:active { background: #FFE4EC; border-color: var(--rose); }

/* 输入栏 */
.chat-input-bar {
  display: flex; gap: 8px;
  align-items: center;
  background: #fff;
  border-radius: 24px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-soft);
}
#chatInput {
  flex: 1;
  background: transparent;
  font-size: 14px;
}
.chat-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient-rose);
  color: #fff;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,107,157,0.35);
}
.chat-send:active { transform: scale(0.92); }

/* 话题包弹窗 */
.topic-modal { max-height: 80vh; }
.topic-list { margin-top: 12px; }
.topic-item {
  padding: 12px 14px;
  background: #F7F3EF;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
  display: flex; justify-content: space-between; align-items: center;
}
.topic-item .tp-copy {
  font-size: 11px; color: var(--rose); font-weight: 600;
  padding: 4px 10px; background: #FFE4EC; border-radius: 10px;
}

/* AI道具支付弹窗 */
.tool-pay-body {
  margin: 14px 0;
  text-align: center;
}
.tool-pay-emoji { font-size: 48px; margin-bottom: 8px; }
.tool-pay-name { font-size: 16px; font-weight: 600; }
.tool-pay-price {
  display: inline-block;
  margin-top: 8px;
  background: linear-gradient(135deg, #FFD66B, #FFB347);
  color: #5C3A0E;
  font-weight: 700;
  padding: 6px 16px; border-radius: 16px;
}
