/* ---- Knowledge Base ---- */
.kb-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.kb-search {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    gap: var(--space-sm);
    max-width: 600px;
}

.kb-search:focus-within {
    border-color: var(--brand-purple);
}

.kb-search svg {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.kb-search input {
    flex: 1;
    font-size: var(--text-base);
    background: transparent;
}

.kb-search input::placeholder {
    color: var(--text-tertiary);
}

/* ---- Categories Grid ---- */
.kb-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.kb-category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.kb-category-card:hover {
    border-color: var(--brand-purple);
    box-shadow: var(--shadow-md);
}

.kb-category-card__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.kb-category-card__icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.kb-category-card__name {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.kb-category-card__desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.kb-category-card__count {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ---- Article List ---- */
.kb-articles {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.kb-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.kb-article-item:hover {
    border-color: var(--border-default);
    background: var(--bg-tertiary);
}

.kb-article-item__info {
    flex: 1;
    min-width: 0;
}

.kb-article-item__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.kb-article-item__meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.kb-article-item__arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.kb-article-item__arrow svg {
    width: 16px;
    height: 16px;
}

/* ---- Article Detail ---- */
.kb-article-detail {
    max-width: 800px;
}

.kb-article-detail__breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.kb-article-detail__breadcrumb a {
    color: var(--brand-purple);
    cursor: pointer;
}

.kb-article-detail__breadcrumb a:hover {
    text-decoration: underline;
}

.kb-article-detail__title {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.kb-article-detail__meta {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.kb-article-detail__content {
    font-size: var(--text-sm);
    line-height: 1.8;
    color: var(--text-primary);
}

.kb-article-detail__content h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: var(--space-xl) 0 var(--space-md) 0;
}

.kb-article-detail__content h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: var(--space-lg) 0 var(--space-sm) 0;
}

.kb-article-detail__content p {
    margin-bottom: var(--space-md);
}

.kb-article-detail__content ul,
.kb-article-detail__content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.kb-article-detail__content li {
    margin-bottom: var(--space-xs);
    list-style: disc;
}

.kb-article-detail__content ol li {
    list-style: decimal;
}

.kb-article-detail__content code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.kb-article-detail__content blockquote {
    border-left: 3px solid var(--brand-purple);
    padding-left: var(--space-md);
    margin: var(--space-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ---- Article Editor Modal ---- */
.article-editor__content {
    min-height: 200px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-input);
    overflow-y: auto;
    max-height: 400px;
}

.article-editor__content:focus {
    border-color: var(--brand-purple);
    outline: none;
}
