/* DeepSeek RAG Assistant - 聊天窗口样式 */

#dsra-chatbot-widget {
    position: fixed;
    z-index: 999999;
    width: 360px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* 位置控制 */
body[data-dsra-position="bottom-right"] #dsra-chatbot-widget {
    bottom: 20px;
    right: 20px;
}
body[data-dsra-position="bottom-left"] #dsra-chatbot-widget {
    bottom: 20px;
    left: 20px;
}

/* 折叠状态 */
#dsra-chatbot-widget.dsra-collapsed .dsra-chat-messages,
#dsra-chatbot-widget.dsra-collapsed .dsra-chat-input-area,
#dsra-chatbot-widget.dsra-collapsed .dsra-typing-indicator {
    display: none;
}
#dsra-chatbot-widget.dsra-collapsed {
    width: auto;
    min-width: 160px;
}

/* 聊天头部 */
.dsra-chat-header {
    background: linear-gradient(135deg, #1890ff, #096dd9);
    color: white;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.dsra-chat-title {
    font-weight: 600;
    font-size: 14px;
}
.dsra-chat-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background 0.2s;
}
.dsra-chat-toggle:hover {
    background: rgba(255,255,255,0.2);
}

/* 消息区域 */
.dsra-chat-messages {
    height: 380px;
    overflow-y: auto;
    padding: 12px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dsra-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.dsra-message.user {
    justify-content: flex-end;
}
.dsra-message-content {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}
.dsra-message.bot .dsra-message-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px 12px 12px 4px;
}
.dsra-message.user .dsra-message-content {
    background: #1890ff;
    color: white;
    border-radius: 12px 12px 4px 12px;
}

/* 输入区域 */
.dsra-chat-input-area {
    padding: 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}
.dsra-chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}
.dsra-chat-input:focus {
    border-color: #1890ff;
}
.dsra-chat-send {
    background: #1890ff;
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.dsra-chat-send:hover {
    background: #096dd9;
}

/* 打字指示器 */
.dsra-typing-indicator {
    padding: 8px 12px;
    display: flex;
    gap: 4px;
}
.dsra-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: dsra-bounce 1.4s infinite ease-in-out;
}
.dsra-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.dsra-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes dsra-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 深色主题 */
body[data-dsra-theme="dark"] #dsra-chatbot-widget {
    background: #2d2d2d;
}
body[data-dsra-theme="dark"] .dsra-chat-messages {
    background: #1e1e1e;
}
body[data-dsra-theme="dark"] .dsra-message.bot .dsra-message-content {
    background: #3d3d3d;
    color: #eee;
    border-color: #4d4d4d;
}
body[data-dsra-theme="dark"] .dsra-chat-input-area {
    background: #2d2d2d;
    border-color: #4d4d4d;
}
body[data-dsra-theme="dark"] .dsra-chat-input {
    background: #3d3d3d;
    border-color: #5d5d5d;
    color: #eee;
}