/* AI在线咨询助手 - 样式 */
.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 悬浮按钮 */
.ai-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8F5A 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.ai-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(255, 107, 53, 0.5);
}

.ai-chat-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.ai-chat-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #FF3B30;
    border-radius: 50%;
    font-size: 11px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 聊天窗口 */
.ai-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.ai-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 聊天窗口头部 */
.ai-chat-header {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8F5A 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.ai-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-chat-close svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* 消息区域 */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F7F8FA;
}

.ai-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

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

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ai-message.bot .ai-message-avatar {
    background: linear-gradient(135deg, #FF6B35, #FF8F5A);
    color: white;
}

.ai-message.user .ai-message-avatar {
    background: #E5E7EB;
    color: #6B7280;
}

.ai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.ai-message.bot .ai-message-content {
    background: white;
    color: #1F2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.ai-message.user .ai-message-content {
    background: linear-gradient(135deg, #FF6B35, #FF8F5A);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message-content p {
    margin: 0 0 8px;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message-content li {
    margin-bottom: 4px;
}

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

.quick-questions-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 8px;
}

.quick-questions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

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

.ai-chat-input {
    flex: 1;
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.ai-chat-input:focus {
    border-color: #FF6B35;
}

.ai-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #FF8F5A);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

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

.ai-chat-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

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

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #9CA3AF;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* 响应式 */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .ai-chat-btn {
        width: 52px;
        height: 52px;
    }
    
    .ai-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 68px;
        right: -8px;
    }
}
