/* 知识库页面样式 */

/* ==================== 知识库 Explorer 布局 ==================== */

.knowledge-page.explorer-layout {
    display: flex;
    gap: 24px;
}

.knowledge-sidebar {
    width: 260px;
    min-width: 220px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.knowledge-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.sidebar-item {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
}

.sidebar-item i {
    width: 18px;
    text-align: center;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.knowledge-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 知识库列表页 ==================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.knowledge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.knowledge-item {
    padding: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.knowledge-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.knowledge-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.knowledge-item h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.knowledge-item-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-standard,
.badge-premium,
.badge-enterprise {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-standard {
    background: #dbeafe;
    color: #1e40af;
}

.badge-premium {
    background: #fef3c7;
    color: #92400e;
}

.badge-enterprise {
    background: #f3e8ff;
    color: #6b21a8;
}

.knowledge-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.knowledge-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-tertiary);
}

.knowledge-meta {
    display: flex;
    gap: 16px;
}

.knowledge-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 知识库详情页 ==================== */

.knowledge-detail-page {
    max-width: 900px;
    margin: 0 auto;
}

.detail-container {
    padding: 32px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.detail-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-meta-item i {
    color: var(--primary-color);
}

.detail-summary {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
}

.detail-summary h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.detail-summary p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.detail-content {
    margin-top: 32px;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-primary);
}

.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5,
.detail-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-content h1 { font-size: 28px; }
.detail-content h2 { font-size: 24px; }
.detail-content h3 { font-size: 20px; }
.detail-content h4 { font-size: 18px; }

.detail-content p {
    margin-bottom: 16px;
    line-height: 1.9;
}

.detail-content ul,
.detail-content ol {
    margin-bottom: 16px;
    padding-left: 28px;
}

.detail-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.detail-content code {
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.detail-content pre {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 16px;
}

.detail-content blockquote {
    margin: 16px 0;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    color: var(--text-secondary);
}

.detail-keywords {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.detail-keywords h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.keyword-tag {
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.detail-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .knowledge-page.explorer-layout {
        flex-direction: column;
    }

    .knowledge-sidebar {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .knowledge-detail-page {
        padding: 0;
    }

    .detail-container {
        padding: 20px;
        border-radius: 0;
    }

    .detail-title {
        font-size: 22px;
    }

    .detail-meta {
        gap: 12px;
        font-size: 13px;
    }

    .detail-content {
        font-size: 15px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .knowledge-item {
        padding: 16px;
    }

    .knowledge-item h3 {
        font-size: 16px;
    }

    .detail-container {
        padding: 16px;
    }

    .detail-title {
        font-size: 20px;
    }

    .detail-content h1 { font-size: 24px; }
    .detail-content h2 { font-size: 20px; }
    .detail-content h3 { font-size: 18px; }
    .detail-content h4 { font-size: 16px; }
}
