/* AI宠物助手样式 */

/* 悬浮按钮 */
#doubaoFloatBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5A2B 0%, #6B4423 100%);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.4);
    z-index: 99999;
    user-select: none;
    transition: all 0.3s ease;
}

#doubaoFloatBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.5);
}

/* 聊天窗口 */
#chatWindow {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 99998;
    overflow: hidden;
    border: 1px solid #eee;
}

/* 聊天头部 */
.chat-header {
    padding: 16px;
    background: linear-gradient(135deg, #8B5A2B 0%, #6B4423 100%);
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-header::before {
    content: '🐾';
    font-size: 20px;
}

/* 聊天内容区 */
.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

/* 消息样式 */
.message {
    margin-bottom: 12px;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-msg {
    background: linear-gradient(135deg, #8B5A2B 0%, #6B4423 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ai-msg {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 加载动画 */
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.loading-dots span {
    animation: bounce 1.4s infinite ease-in-out both;
    font-weight: bold;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 输入区 */
.chat-input {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: white;
    gap: 10px;
}

#msgInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

#msgInput:focus {
    border-color: #8B5A2B;
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

#sendBtn {
    padding: 0 20px;
    background: linear-gradient(135deg, #8B5A2B 0%, #6B4423 100%);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#sendBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.3);
}

#sendBtn:active {
    transform: scale(0.95);
}

/* 滚动条样式 */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

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

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

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #doubaoFloatBtn {
        width: 56px;
        height: 56px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }
    
    #chatWindow {
        width: calc(100vw - 40px);
        height: 60vh;
        right: 20px;
        bottom: 90px;
        max-width: 380px;
    }
}

@media (max-width: 480px) {
    #chatWindow {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        border-radius: 16px;
    }
}
