/* AI悬浮球样式 */
.floating-assistant {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6e8efb, #4a6cf7);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-assistant:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.assistant-icon {
    color: white;
    font-size: 24px;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.assistant-icon .fa-robot,
.assistant-icon .fa-times {
    position: absolute;
    transition: all 0.3s ease;
}

/* 设置自定义头像 */
.assistant-icon::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('/logo.jpg') no-repeat center center;
    background-size: cover;
    border-radius: 50%;
    z-index: 1;
}

/* 悬浮球激活状态 */
.floating-assistant.active .assistant-icon::before {
    opacity: 0.6; /* 激活状态下背景变暗，让X图标更明显 */
}

.floating-assistant.active .fa-robot {
    display: none;
}

.floating-assistant.active .fa-times {
    display: block;
    z-index: 2; /* 确保关闭图标在头像上方 */
}

/* 对话窗口样式 */
.assistant-container {
    position: fixed;
    right: 30px;
    bottom: 180px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.assistant-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 标题栏样式 */
.assistant-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #6e8efb, #4a6cf7);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assistant-title {
    font-weight: bold;
    font-size: 16px;
}

.assistant-close {
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.assistant-close:hover {
    transform: scale(1.2);
}

/* 消息区域样式 */
.assistant-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.assistant-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background-color: #4a6cf7;
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background-color: #38b2ac;
    color: white;
    margin-right: 0;
    margin-left: 10px;
}

/* 打字机效果样式 */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background-color: #333;
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 0.7s infinite;
}

/* 确保聊天消息有足够的内边距 */
.message-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 70%;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: #333333;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #e6e6e6;
    min-height: 20px;
}

.user-message .message-content {
    background-color: #dcf8ff;
    border: 1px solid #c5e4f3;
}

/* 输入区域样式 */
.assistant-input-area {
    padding: 15px;
    display: flex;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

#assistant-input {
    flex: 1;
    border: 1px solid #bbb;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
    transition: border 0.3s;
    background-color: #ffffff;
    color: #333333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#assistant-input:focus {
    border-color: #4a6cf7;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 5px rgba(74,108,247,0.3);
}

#assistant-send-btn {
    background-color: #4a6cf7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

#assistant-send-btn:hover {
    background-color: #3a57e8;
}

/* 响应式适配 */
@media (max-width: 480px) {
    .assistant-container {
        width: 90%;
        height: 70vh;
        right: 5%;
        bottom: 100px;
    }

    .floating-assistant {
        right: 20px;
        bottom: 30px;
    }
}

/* 滚动条样式优化 */
.assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.assistant-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.assistant-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 