
/* 玉米AI客服聊天样式 */
#yumi-ai-chat-container {
    position: fixed;
    bottom: 200px;
    right: 20px;
    z-index: 9999;
}

/* 聊天按钮样式 - 科幻风格圆形设计 */
#yumi-ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 165, 0, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
}

#yumi-ai-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 35px rgba(255, 165, 0, 0.7);
}

/* 玉米图标样式 */
.yumi-icon {
    position: relative;
    width: 40px;
    height: 40px;
}

.yumi-icon span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    z-index: 2;
}

/* 玉米形状装饰 */
.yumi-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 25px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50% 50% 30% 30%;
}

.yumi-icon::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* 聊天窗口样式 */
#yumi-ai-chat-window {
    width: 350px;
    max-width: 90vw;
    height: 500px; /* 设置固定高度，确保有足够空间显示所有内容 */
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.chat-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

#yumi-ai-close-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.chat-messages {
    flex: 1;
    min-height: 0; /* 允许flex子元素缩小到内容高度以下 */
    max-height: 400px; /* 设置最大高度，确保滚动条可见 */
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden; /* 禁止水平滚动条 */
    background-color: #f9f9f9;
    /* 添加自定义滚动条样式 */
    scroll-behavior: smooth;
    position: relative; /* 确保定位正确 */
    word-break: break-word; /* 确保整个容器内的文本都能换行 */
}

/* Webkit浏览器滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FFC107 0%, #FF8C00 100%);
}

/* Firefox滚动条样式 */
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #FFA500 #f1f1f1;
}

.chat-input {
    display: flex;
    border-top: 1px solid #eee;
}

#yumi-ai-user-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 14px;
}

#yumi-ai-send-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-weight: bold;
}

/* 消息气泡样式 */
.message {
    margin-bottom: 15px;
    max-width: 80%;
    overflow: hidden; /* 防止内容溢出 */
    word-break: break-word; /* 确保消息块内的文本都能换行 */
}

.bot-message {
    margin-right: auto;
}

.user-message {
    margin-left: auto;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    display: inline-block;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    white-space: pre-wrap; /* 保留空格和换行 */
    line-height: 1.5; /* 增加行高，提高可读性 */
}

/* 优化分点内容的显示 */
.message-content br {
    line-height: 1.8; /* 分点之间的间距 */
}

/* 优化超链接样式 */
.message-content a {
    color: #0066cc; /* 蓝色超链接 */
    text-decoration: underline;
    word-break: break-all; /* 确保长链接能够换行 */
}

.message-content a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.bot-message .message-content {
    background-color: #e9e9eb;
    border-top-left-radius: 5px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    border-top-right-radius: 5px;
}