/**
 * AI建站助手 - 前端样式
 * Version: 2.0.1
 */

/* AI助手浮动按钮 */
.ai-assistant-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.ai-assistant-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* AI助手面板 */
.ai-assistant-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 9998;
    display: none;
    overflow: hidden;
}

.ai-assistant-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@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: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-assistant-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.ai-assistant-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* 聊天界面 */
.ai-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.ai-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

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

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

.ai-message.user .ai-message-avatar {
    background: #667eea;
    color: white;
}

.ai-message.assistant .ai-message-avatar {
    background: #28a745;
    color: white;
}

.ai-message-content {
    flex: 1;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.ai-message.user .ai-message-content {
    background: #667eea;
    color: white;
}

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

.ai-chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

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

.ai-chat-send {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* 快捷操作 */
.ai-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.ai-quick-action {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.ai-quick-action:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.ai-quick-action i {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
    color: #667eea;
}

/* 模板建议 */
.ai-template-suggestions {
    margin-top: 15px;
}

.ai-template-suggestions h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.ai-template-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ai-template-item:hover {
    background: #e9ecef;
}

.ai-template-preview {
    width: 40px;
    height: 30px;
    background: #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.ai-template-info {
    flex: 1;
}

.ai-template-name {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.ai-template-desc {
    font-size: 11px;
    color: #666;
}

/* 加载状态 */
.ai-loading-message {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 18px;
    font-size: 14px;
    color: #666;
}

.ai-loading-dots {
    margin-left: 10px;
}

.ai-loading-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #666;
    border-radius: 50%;
    margin: 0 1px;
    animation: loadingDots 1.4s infinite ease-in-out;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-assistant-panel {
        right: 15px;
        left: 15px;
        width: auto;
        bottom: 90px;
    }
    
    .ai-assistant-float-btn {
        right: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* 自定义滚动条 */
.ai-chat-messages::-webkit-scrollbar,
.ai-assistant-body::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track,
.ai-assistant-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb,
.ai-assistant-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover,
.ai-assistant-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
