/* 聊天界面容器 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 18px;
    max-width: 70%;
}

.message-assistant {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.message-assistant .message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 18px;
    max-width: 85%;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.message-image {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.05);
}

.message-sources {
    margin-top: 15px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    font-size: 13px;
}

.source-item {
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.faq-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.message-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.action-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 聊天输入区 */
.chat-input-container {
    border-top: 1px solid #e5e7eb;
    padding: 20px;
    background: #fafafa;
}

.image-preview {
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#question-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    resize: none;
    max-height: 150px;
    font-family: inherit;
}

#question-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 消息时间戳 */
.message-timestamp {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 5px;
}