/* AI Assistant Styles */
.ai-assistant-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1040;
    animation: fadeInUp 0.5s ease-out;
}

.ai-assistant-button button {
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    font-size: 16px;
    padding: 0;
}

.ai-assistant-button button i {
    font-size: 20px;
}

.ai-assistant-button button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0,0,0,0.15);
}

.ai-assistant-container {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
    z-index: 1050;
    display: none;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
}

.ai-assistant-container.show {
    display: flex;
}

.ai-assistant-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-assistant-header h5 {
    margin: 0;
    font-weight: 600;
}

.ai-assistant-header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.ai-assistant-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ai-message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

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

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message.user .ai-message-avatar {
    background: #6c5ce7;
    color: white;
}

.ai-message-content {
    max-width: 80%;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ai-message.user .ai-message-content {
    background: #6c5ce7;
    color: white;
}

.ai-message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
}

.ai-message.user .ai-message-time {
    text-align: right;
    color: rgba(255,255,255,0.8);
}

.ai-suggestions {
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

.ai-suggestions h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}

.ai-suggestion-chip {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-suggestion-chip:hover {
    background: #e0e0e0;
}

.ai-assistant-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: white;
    border-radius: 0 0 12px 12px;
}

.ai-assistant-input-group {
    display: flex;
    gap: 10px;
}

.ai-assistant-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 20px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.ai-assistant-input:focus {
    border-color: #6c5ce7;
}

.ai-assistant-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #6c5ce7;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-assistant-send:hover {
    background: #5f3dc4;
}

.ai-assistant-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ai-assistant-typing span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    display: inline-block;
    animation: typingAnimation 1.4s infinite;
}

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

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 预设问题分类样式 */
.ai-category-section {
    margin-bottom: 15px;
}

.ai-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 8px;
}

.ai-category-header:hover {
    background: #e9ecef;
}

.ai-category-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.ai-category-icon {
    font-size: 16px;
    color: #6c757d;
    transition: transform 0.2s;
}

.ai-category-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 12px;
}

.ai-suggestion-chip {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f8ff;
    border: 1px solid #e6f3ff;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #0066cc;
}

.ai-suggestion-chip:hover {
    background: #e6f3ff;
    border-color: #cce7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,102,204,0.1);
}

.ai-more-questions {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
}

.ai-more-questions:hover {
    background: #e9ecef;
    color: #495057;
}

/* 问题模态框样式 */
.ai-question-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1060;
    animation: fadeIn 0.2s ease-out;
}

.ai-question-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: slideInUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.ai-question-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-question-modal-header h5 {
    margin: 0;
    font-weight: 600;
    color: #495057;
}

.ai-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.ai-modal-close:hover {
    background: #f8f9fa;
}

.ai-question-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ai-question-item {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #f0f0f0;
}

.ai-question-item:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ai-question-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.ai-question-desc {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 连接状态样式 */
.ai-connection-status {
    position: absolute;
    top: 10px;
    right: 50px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.ai-connection-status.connected {
    background: #d4edda;
    color: #155724;
}

.ai-connection-status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.ai-connection-status.connecting {
    background: #fff3cd;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-assistant-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .ai-assistant-button {
        bottom: 20px;
        right: 20px;
    }
    
    .ai-assistant-header {
        border-radius: 0;
    }
    
    .ai-assistant-footer {
        border-radius: 0;
    }

    .ai-question-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }

    .ai-category-questions {
        margin-left: 0;
    }
}