/* AI 助手悬浮组件样式 */
.ai-assistant-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 悬浮按钮 */
.ai-assistant-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.ai-assistant-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.ai-assistant-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* 对话窗口 */
.ai-assistant-dialog {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.ai-assistant-dialog.active {
    display: flex;
}

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

/* 对话窗口头部 */
.ai-assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-assistant-header-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-assistant-header-title svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.ai-assistant-header-actions {
    display: flex;
    gap: 8px;
}

.ai-assistant-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-assistant-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-assistant-header-btn svg {
    width: 14px;
    height: 14px;
    fill: white;
}

/* 对话消息区域 */
.ai-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ai-assistant-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.ai-assistant-message.user {
    align-items: flex-end;
}

.ai-assistant-message.assistant {
    align-items: flex-start;
}

.ai-assistant-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-assistant-message.user .ai-assistant-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-assistant-message.assistant .ai-assistant-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai-assistant-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

/* 欢迎消息 */
.ai-assistant-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ai-assistant-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-welcome-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.ai-assistant-welcome-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ai-assistant-welcome-text {
    font-size: 14px;
    color: #666;
}

/* 快捷问题 */
.ai-assistant-quick-questions {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: white;
}

.ai-assistant-quick-questions-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.ai-assistant-quick-question {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f0f4ff;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.ai-assistant-quick-question:hover {
    background: #e0e7ff;
    border-color: #667eea;
}

.ai-assistant-quick-question:last-child {
    margin-bottom: 0;
}

/* 输入区域 */
.ai-assistant-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-assistant-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-assistant-input:focus {
    border-color: #667eea;
}

.ai-assistant-input::placeholder {
    color: #999;
}

.ai-assistant-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-assistant-send-btn:hover {
    transform: scale(1.05);
}

.ai-assistant-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-assistant-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* 加载动画 */
.ai-assistant-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.ai-assistant-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite;
}

.ai-assistant-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-assistant-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* 思考过程 */
.ai-assistant-thinking {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    max-height: 100px;
    overflow-y: auto;
}

.ai-assistant-thinking-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 错误消息 */
.ai-assistant-error {
    background: #fff3f3;
    color: #dc3545;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

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

.ai-assistant-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

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