/* 智能客服样式 */
.knowledge-base-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0B2F9F, #1E40AF);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(11, 47, 159, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    flex-direction: column;
}

.knowledge-base-btn.hidden {
    display: none;
}

.knowledge-base-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(11, 47, 159, 0.5);
}

.knowledge-base-btn img {
    width: 32px;
    height: 32px;
}

.knowledge-base-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 360px;
    height: 480px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.knowledge-base-panel.active {
    display: flex;
}

.knowledge-base-panel.maximized {
    width: 50vw;
    height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
}

.knowledge-base-panel.maximized .knowledge-base-body {
    flex: 1;
    overflow-y: auto;
}

.knowledge-base-panel.maximized .knowledge-base-footer {
    border-top: 1px solid #e5e7eb;
}

.knowledge-base-header {
    background: linear-gradient(135deg, #0B2F9F, #1E40AF);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.knowledge-base-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.knowledge-base-header .header-actions {
    display: flex;
    gap: 12px;
}

.header-action {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.header-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

.knowledge-base-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}
.knowledge-base-body pre{
    margin: 4px 0px 0px;
    padding: 8px;
    white-space: pre-wrap;
    background: none;
    border: none;
}

.welcome-message {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 12px 12px 12px 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.quick-questions {
    margin-bottom: 20px;
}

.quick-question {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.quick-question:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.new-chat {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0B2F9F;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.new-chat:hover {
    background: #1E40AF;
}

.new-chat svg {
    width: 16px;
    height: 16px;
}

.knowledge-base-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.knowledge-base-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.knowledge-base-input:focus {
    border-color: #0B2F9F;
}

.knowledge-base-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0B2F9F;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.knowledge-base-send:hover {
    background: #1E40AF;
}

.knowledge-base-send svg {
    width: 16px;
    height: 16px;
}

/* 滚动条样式 */
.knowledge-base-body::-webkit-scrollbar {
    width: 6px;
}

.knowledge-base-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.knowledge-base-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.knowledge-base-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}