/* ── AI 智能客服图标（与搜索/微信/在线客服对齐一列）── */
.ai-chat-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  font-size: 40px !important;
  transition: all .3s;
}
.ai-chat-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(99,102,241,0.5);
}

/* ── AI 聊天弹窗 ── */
.ai-chat-modal {
  display: none; position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center; padding: 16px;
}
.ai-chat-modal.open { display: flex; }

.ai-chat-dialog {
  background: #0a0e17; border: 1px solid #1e293b; border-radius: 16px;
  width: 100%; max-width: 420px; height: 560px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}

.ai-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #1e293b;
  background: #111827; flex-shrink: 0;
}
.ai-chat-header h3 { 
  font-size: 15px; font-weight: 600; color: #e2e8f0; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.ai-chat-header h3 .ai-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  display: inline-block; animation: aiPulse 2s infinite;
}
@keyframes aiPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ai-chat-files {
  display: none !important;
}

.ai-chat-close {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid #334155; background: transparent;
  color: #94a3b8; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.ai-chat-close:hover { border-color: #6366f1; color: #e2e8f0; }

.ai-chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}

.ai-chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 0.85rem; line-height: 1.7; word-break: break-word;
}
.ai-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border-bottom-right-radius: 4px;
}
.ai-chat-msg.ai {
  align-self: flex-start;
  background: #1a2332; color: #cbd5e1;
  border: 1px solid #1e293b; border-bottom-left-radius: 4px;
}
.ai-chat-msg.ai a {
  color: #818cf8; text-decoration: underline;
}
.ai-chat-msg.ai a:hover { color: #a5b4fc; }

.ai-chat-msg .ai-links {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #1e293b;
  font-size: 0.78rem;
}
.ai-chat-msg .ai-links a {
  display: block; padding: 3px 0; color: #818cf8; text-decoration: none;
}
.ai-chat-msg .ai-links a:hover { color: #a5b4fc; }

.ai-chat-typing {
  align-self: flex-start; padding: 10px 14px;
  background: #1a2332; border-radius: 12px; border-bottom-left-radius: 4px;
  color: #94a3b8; font-size: 0.85rem;
  display: flex; gap: 4px;
}
.ai-chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #6366f1;
  display: inline-block;
  animation: aiTyping 1.4s infinite;
}
.ai-chat-typing span:nth-child(2) { animation-delay: .2s; }
.ai-chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiTyping {
  0%,60%,100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.ai-chat-footer {
  padding: 12px 16px; border-top: 1px solid #1e293b;
  background: #111827; display: flex; gap: 8px; flex-shrink: 0;
}
.ai-chat-footer input {
  flex: 1; padding: 10px 14px; background: #0f172a;
  border: 1px solid #1e293b; border-radius: 8px;
  color: #e2e8f0; font-size: 0.85rem; outline: none;
  transition: border-color .2s;
}
.ai-chat-footer input:focus { border-color: #6366f1; }
.ai-chat-footer input::placeholder { color: #475569; }
.ai-chat-footer button {
  padding: 10px 16px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 8px; color: #fff; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.ai-chat-footer button:hover { opacity: 0.9; }
.ai-chat-footer button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .ai-chat-dialog {
    height: auto; max-height: 80vh; margin: auto 12px;
    border-radius: 14px;
  }
  .ai-chat-modal { padding: 12px; }
  .ai-chat-body { max-height: calc(80vh - 120px); }
  .ai-chat-msg { font-size: 0.8rem; max-width: 90%; }
}
