/* AI����ҳ��ר����ʽ */
.ai-assistant-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ai-chat-interface {
    display: flex;
    height: 80vh;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    overflow: hidden;
    background-color: #fff;
}

.chat-sidebar {
    width: 260px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.new-chat-btn {
    background-color: #4a6cf7;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .new-chat-btn:hover {
        background-color: #3a5ce5;
    }

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.history-item {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

    .history-item:hover {
        background-color: #e9ecef;
    }

    .history-item.active {
        background-color: #e9ecef;
        font-weight: 500;
    }

.assistant-modes {
    padding: 15px;
    border-top: 1px solid #e9ecef;
}

.mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.mode-option {
    background-color: #f1f3f5;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

    .mode-option:hover {
        background-color: #e9ecef;
    }

    .mode-option.active {
        background-color: #4a6cf7;
        color: white;
    }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

    .message.user {
        align-self: flex-end;
        flex-direction: row-reverse;
    }

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background-color: #4a6cf7;
    color: white;
}

.message.user .message-avatar {
    background-color: #20c997;
    color: white;
}

.message-content {
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.message.assistant .message-content {
    border-top-left-radius: 4px;
}

.message.user .message-content {
    background-color: #4a6cf7;
    color: white;
    border-top-right-radius: 4px;
}

.message-content p {
    margin: 0 0 10px;
}

    .message-content p:last-child {
        margin-bottom: 0;
    }

.message-content ul, .message-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.chat-input {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .chat-input textarea {
        flex: 1;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 12px;
        resize: none;
        height: 50px;
        font-family: inherit;
        font-size: 15px;
        transition: border-color 0.2s;
    }

        .chat-input textarea:focus {
            outline: none;
            border-color: #4a6cf7;
        }

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #f8f9fa;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .action-btn:hover {
        background-color: #e9ecef;
    }

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #4a6cf7;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .send-btn:hover {
        background-color: #3a5ce5;
    }

.ai-capabilities {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.capability-card {
    flex: 1;
    min-width: 250px;
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

    .capability-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

.capability-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: #e9f3ff;
    color: #4a6cf7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.capability-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.capability-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #495057;
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

    .ai-assistant-header h1 {
        margin: 0;
        font-size: 28px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .ai-assistant-header h1 i {
            color: #4a6cf7;
        }

/* ��Ӧʽ��� */
@media (max-width: 768px) {
    .ai-chat-interface {
        flex-direction: column;
        height: auto;
        min-height: 80vh;
    }

    .chat-sidebar {
        width: 100%;
        height: 0;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

        .chat-sidebar.active {
            height: auto;
            padding-bottom: 15px;
        }

    .mobile-toggle {
        display: block;
    }

    .ai-capabilities {
        flex-direction: column;
    }

    .capability-card {
        min-width: auto;
    }
}

/* 加载动画样式 */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    padding: 8px 0;
}
.loading-dots span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 发送按钮禁用状态 */
.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 消息内容样式 */
.message-content p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}
.message-content p:last-child {
    margin-bottom: 0;
}
.message-content ul, .message-content ol {
    margin: 10px 0;
    padding-left: 20px;
}
.message-content li {
    margin: 5px 0;
    line-height: 1.6;
}
.message-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}
.message-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}
.message-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}
.message-content strong {
    font-weight: bold;
}
.message-content em {
    font-style: italic;
}
