@charset "UTF-8";
.chat-button {
    position: absolute !important;
    top: 240px !important; /* 在导航栏下方，标题上方 */
    left: 50% !important; /* 基准位置居中 */
    width: 50px !important; 
    height: 40px !important;

    background-color: transparent !important; /* 透明背景 */
    box-shadow: none !important; /* 去掉阴影 */
    cursor: pointer !important;
   
    overflow: hidden !important;
    padding: 0 !important;
    
    /* 纯水平左右移动动画 */
    animation: moveLeftRight 16s ease-in-out infinite !important;
}

/* 纯水平左右移动动画 */
@keyframes moveLeftRight {
    0% { 
        transform: translateX(-50%); /* 居中起始位置 */
    }
    25% { 
        transform: translateX(-250px); /* 向左移动 */
    }
    50% { 
        transform: translateX(-50%); /* 回到中心 */
    }
    75% { 
        transform: translateX(250px); /* 向右移动 */
    }
    100% { 
        transform: translateX(-250%); /* 回到居中位置 */
    }
}

/* 确保图片填满按钮区域 */
.chat-button img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* 图片自适应填充 */
    border: none !important;
    border-radius: 0 !important;
}

.chat-button:hover {
    animation-play-state: paused !important; /* 鼠标悬停时暂停动画 */
  
}


/* 确保聊天按钮内的图片正确显示 */
.chat-button img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* 聊天窗口容器 */
.chat-container {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: 600px;
   max-width: 90%;
   height: 500px;
   background-color: #FFFFFF;
   border: 1px solid #666666;
   border-radius: 8px;
   box-shadow: 0 4px 12px rgba(0,0,0,0.15);
   z-index: 1001;
   display: flex;
   flex-direction: column;
   margin: auto;
   display: none;
}

.chat-container.maximized {
   width: 800px;
   height: 80vh;
}

/* 聊天头部 */
.chat-header {
   padding: 12px 16px;
   background-color: #f1f1f1;
   border-radius: 8px 8px 0 0;
   border-bottom: 1px solid #ddd;
   display: flex;
   justify-content: space-between;
   align-items: center;
   user-select: none;
}

.chat-header h4 {
   margin: 0;
   color: #333;
   font-size: 16px;
}

.chat-header-title {
   display: flex;
   align-items: center;
   gap: 10px;
}

.chat-header-controls {
   display: flex;
   gap: 12px;
}

/* 控制按钮 */
.control-button, .close-button {
   background: none;
   border: none;
   cursor: pointer;
   padding: 4px 8px;
   color: #666;
   font-size: 16px;
}

.control-button:hover, .close-button:hover {
   color: #333;
   background-color: #e0e0e0;
   border-radius: 4px;
}

/* 消息区域 */
.chat-messages {
   flex: 1;
   overflow-y: auto;
   padding: 16px;
   background-color: #ffffff;
}

/* 消息样式 */
.message {
   margin-bottom: 12px;
   padding: 8px 12px;
   border-radius: 4px;
   max-width: 85%;
   word-wrap: break-word;
   line-height: 1.4;
}

.message.user {
   background-color: #007BFF;
   color: white;
   margin-left: auto;
   text-align: right;
}

.message.system {
   background-color: #f8f9fa;
   color: #666;
   text-align: center;
   font-style: italic;
   max-width: 100%;
   margin: 8px auto;
}

.message.consultant {
   background-color: #e9ecef;
   color: #212529;
   margin-right: auto;
}

/* 输入区域 */
.chat-input {
   padding: 12px 16px;
   border-top: 1px solid #ddd;
   display: flex;
   gap: 8px;
   background-color: #f8f9fa;
   border-radius: 0 0 8px 8px;
}

.chat-input input {
   flex: 1;
   padding: 8px 12px;
   border: 1px solid #ddd;
   border-radius: 4px;
   outline: none;
   font-size: 14px;
   transition: border-color 0.2s;
}

.chat-input input:focus {
   border-color: #007BFF;
   box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.chat-input button {
   padding: 8px 16px;
   background-color: #007BFF;
   color: white;
   border: none;
   border-radius: 4px;
   cursor: pointer;
   font-size: 14px;
   transition: background-color 0.2s;
}

.chat-input button:hover {
   background-color: #0056b3;
}

.chat-input button:active {
   background-color: #004085;
}

/* 遮罩层 */
.overlay {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.5);
   z-index: 999;
   display: none;
}

@media (max-width: 768px) {
   .chat-container {
       width: 90%;
       height: 80vh;
   }
   
   .chat-button {
       width: 150px;
       font-size: 1em;
   }
   
   .message {
       max-width: 90%;
   }
}