/* AI悬浮球助手样式文件
 * 企业级AI助手组件样式设计
 * 支持响应式布局和现代化UI设计
 */
.ai-assistant-container {
  position: fixed;
  bottom: 20%;
  right: 5vw;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ai-assistant-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #31aeff, rgba(49,174,255,0.8));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.ai-assistant-btn.dragging {
  box-shadow: 0 20px 50px rgba(16,185,129,0.4);
  transform: scale(1.05);
  cursor: grabbing;
}
.ai-assistant-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(16,185,129,0.3);
}
.ai-assistant-btn::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #31aeff, #059669);
  opacity: 0.2;
  animation: pulse 2s infinite;
}
.ai-assistant-btn .ai-icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.ai-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 95vw;
  max-width: 380px;
  height: 70vh;
  max-height: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 1px solid rgba(49,174,255,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}
.ai-chat-window.active {
  display: flex;
  animation: slideInUp 0.3s ease;
}
.ai-chat-header {
  background: linear-gradient(135deg, #31aeff, rgba(49,174,255,0.8));
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-chat-header .ai-chat-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-chat-header .ai-chat-title .ai-icon {
  width: 36px;
  height: 36px;
}
.ai-chat-header .ai-chat-title .ai-title-text {
  margin-left: 4px;
}
.ai-chat-header .ai-close-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}
.ai-chat-header .ai-close-btn:hover {
  background: rgba(255,255,255,0.2);
}
.ai-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-messages::-webkit-scrollbar {
  width: 6px;
}
.ai-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.ai-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.ai-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
}
.ai-message.user {
  align-self: flex-end;
  background: #31aeff;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-message.assistant {
  align-self: flex-start;
  background: #f8fafc;
  color: #334155;
  border: 1px solid rgba(49,174,255,0.2);
  border-bottom-left-radius: 4px;
}
.ai-input-area {
  padding: 16px 20px;
  border-top: 1px solid rgba(49,174,255,0.2);
  background: #fafafa;
}
.ai-input-area .ai-input-group {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ai-input-area .ai-textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid rgba(49,174,255,0.2);
  border-radius: 8px;
  resize: none;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.ai-input-area .ai-textarea:focus {
  outline: none;
  border-color: #31aeff;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.ai-input-area .ai-send-btn {
  background: #31aeff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  font-weight: 500;
}
.ai-input-area .ai-send-btn:hover:not(:disabled) {
  background: rgba(49,174,255,0.8);
}
.ai-input-area .ai-send-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid rgba(49,174,255,0.2);
  align-self: flex-start;
}
.ai-loading .ai-loading-dots {
  display: flex;
  gap: 4px;
}
.ai-loading .ai-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #31aeff;
  animation: bounce 1.4s infinite ease-in-out;
}
.ai-loading .ai-loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.ai-loading .ai-loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}
@media (max-width: 768px) {
  .ai-assistant-container {
    bottom: 15vh;
    right: 5vw;
  }
  .ai-assistant-btn.snap-right {
    right: 5vw;
  }
  .ai-chat-window {
    width: 80vw;
    height: 70vh;
    right: 5vw;
    left: 5vw;
    bottom: 80px;
  }
  .ai-assistant-btn {
    width: 12vw;
    height: 12vw;
    min-width: 50px;
    min-height: 50px;
  }
  .ai-assistant-btn .ai-icon {
    width: 6vw;
    height: 6vw;
  }
  .ai-messages {
    padding: 4vw;
    gap: 4vw;
  }
  .ai-input-area {
    padding: 4vw 5vw;
  }
  .ai-textarea {
    padding: 2.5vw 3vw;
    font-size: 3.5vw;
  }
  .ai-send-btn {
    padding: 2.5vw 4vw;
    font-size: 3.5vw;
  }
}
@media (prefers-color-scheme: dark) {
  .ai-chat-window {
    background: #1f2937;
    border-color: #374151;
  }
  .ai-message.assistant {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
  }
  .ai-input-area {
    background: #111827;
    border-color: #374151;
  }
  .ai-input-area .ai-textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
  }
  .ai-input-area .ai-textarea:focus {
    border-color: #31aeff;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  }
  .ai-loading {
    background: #374151;
    border-color: #4b5563;
  }
  .ai-loading .ai-loading-dots span {
    background: #9ca3af;
  }
  .ai-messages::-webkit-scrollbar-track {
    background: #374151;
  }
  .ai-messages::-webkit-scrollbar-thumb {
    background: #6b7280;
  }
}
@-moz-keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}
@-webkit-keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}
@-o-keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}
@-moz-keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@-webkit-keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@-o-keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@-moz-keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
@-webkit-keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
@-o-keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
