.hdv2-kb {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hdv2-kb-hero {
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.95rem;
    padding: 1.4rem 1.5rem;
}

.hdv2-kb-hero__title {
    margin: 0 0 0.3rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
}

.hdv2-kb-hero__subtitle {
    margin: 0 0 1rem;
    color: var(--hdv2-cah-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hdv2-kb-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-bg);
    border-radius: 0.65rem;
    padding: 0.35rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hdv2-kb-search:focus-within {
    border-color: hsl(217.2 91.2% 59.8%);
    box-shadow: 0 0 0 3px hsl(217.2 91.2% 59.8% / 0.16);
}

.hdv2-kb-search__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--hdv2-cah-muted);
    width: 1.6rem;
    height: 1.6rem;
    flex-shrink: 0;
}

.hdv2-kb-search__icon svg {
    width: 15px;
    height: 15px;
}

.hdv2-kb-search__input {
    flex: 1;
    min-width: 0;
    height: 2.1rem;
    border: 0;
    background: transparent;
    color: var(--hdv2-cah-fg);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    padding: 0 0.3rem;
}

.hdv2-kb-search__input::placeholder {
    color: var(--hdv2-cah-muted);
}

.hdv2-kb-search__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 2.1rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 0.5rem;
    background: hsl(217.2 91.2% 59.8%);
    color: #fff;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.hdv2-kb-search__btn:hover {
    background: hsl(217.2 91.2% 53%);
}

.hdv2-kb-search__btn svg {
    width: 14px;
    height: 14px;
}

.hdv2-kb-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.hdv2-kb-section-title svg {
    width: 18px;
    height: 18px;
    color: var(--hdv2-cah-muted);
}

.hdv2-kb-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hdv2-kb-cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
}

.hdv2-kb-cat {
    position: relative;
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hdv2-kb-cat:hover {
    border-color: hsl(217.2 91.2% 59.8% / 0.4);
    background: var(--hdv2-cah-bg);
    transform: translateY(-1px);
}

.hdv2-kb-cat__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    text-decoration: none;
    color: transparent;
    overflow: hidden;
}

.hdv2-kb-cat > *:not(.hdv2-kb-cat__overlay):not(.hdv2-kb-cat__admin) {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.hdv2-kb-cat__icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.55rem;
    background: var(--hdv2-cah-accent);
    color: hsl(217.2 91.2% 59.8%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hdv2-kb-cat__icon svg {
    width: 18px;
    height: 18px;
}

.hdv2-kb-cat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.hdv2-kb-cat__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    line-height: 1.3;
    word-break: break-word;
    flex: 1;
}

.hdv2-kb-cat__count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 1.5rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: var(--hdv2-cah-accent);
    color: var(--hdv2-cah-muted);
    font-size: 0.72rem;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.hdv2-kb-cat__count strong {
    color: var(--hdv2-cah-fg);
    font-weight: 600;
}

.hdv2-kb-cat__desc {
    margin: 0;
    color: var(--hdv2-cah-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hdv2-kb-cat__admin {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.4rem;
    background: var(--hdv2-cah-bg);
    border: 1px solid var(--hdv2-cah-border);
    color: var(--hdv2-cah-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.7rem;
    z-index: 3;
}

.hdv2-kb-cat__admin:hover {
    color: var(--hdv2-cah-fg);
    background: var(--hdv2-cah-accent);
}

.hdv2-kb-subcats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.65rem;
}

.hdv2-kb-subcat {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.7rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hdv2-kb-subcat:hover {
    border-color: hsl(217.2 91.2% 59.8% / 0.4);
    background: var(--hdv2-cah-bg);
}

.hdv2-kb-subcat__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--hdv2-cah-accent);
    color: hsl(217.2 91.2% 59.8%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hdv2-kb-subcat__icon svg {
    width: 16px;
    height: 16px;
}

.hdv2-kb-subcat__info {
    flex: 1;
    min-width: 0;
}

.hdv2-kb-subcat__name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    line-height: 1.3;
}

.hdv2-kb-subcat__count {
    font-size: 0.75rem;
    color: var(--hdv2-cah-muted);
    margin-top: 0.15rem;
}

.hdv2-kb-articles-card {
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.85rem;
    overflow: hidden;
}

.hdv2-kb-articles {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hdv2-kb-article-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1.05rem;
    border-bottom: 1px solid var(--hdv2-cah-border);
    transition: background 0.12s ease;
}

.hdv2-kb-article-row:last-child {
    border-bottom: 0;
}

.hdv2-kb-article-row:hover {
    background: var(--hdv2-cah-accent);
}

.hdv2-kb-article-row__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-decoration: none;
    color: transparent;
    overflow: hidden;
}

.hdv2-kb-article-row > *:not(.hdv2-kb-article-row__overlay):not(.hdv2-kb-admin-edit) {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.hdv2-kb-article-row__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--hdv2-cah-accent);
    color: var(--hdv2-cah-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
}

.hdv2-kb-article-row:hover .hdv2-kb-article-row__icon {
    background: hsl(217.2 91.2% 59.8% / 0.12);
    color: hsl(217.2 91.2% 59.8%);
}

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

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

.hdv2-kb-article-row__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.hdv2-kb-article-row__excerpt {
    font-size: 0.8rem;
    color: var(--hdv2-cah-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hdv2-kb-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--hdv2-cah-muted);
}

.hdv2-kb-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--hdv2-cah-accent);
    color: var(--hdv2-cah-muted);
    margin-bottom: 0.5rem;
}

.hdv2-kb-empty__icon svg {
    width: 22px;
    height: 22px;
}

.hdv2-kb-empty__title {
    font-size: 0.95rem;
    color: var(--hdv2-cah-fg);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.hdv2-kb-empty__hint {
    font-size: 0.82rem;
}

.hdv2-kb-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    background: var(--hdv2-cah-accent);
    color: var(--hdv2-cah-fg);
    font-size: 0.82rem;
    border: 1px solid var(--hdv2-cah-border);
}

.hdv2-kb-tag-badge svg {
    width: 14px;
    height: 14px;
    color: var(--hdv2-cah-muted);
}

.hdv2-kb-tag-badge strong {
    font-weight: 600;
}

.hdv2-kb-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--hdv2-cah-muted);
    font-size: 0.82rem;
    text-decoration: none;
    width: max-content;
}

.hdv2-kb-back:hover {
    color: var(--hdv2-cah-fg);
}

.hdv2-kb-back svg {
    width: 14px;
    height: 14px;
}

.hdv2-kb-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--hdv2-cah-muted);
    font-size: 0.82rem;
}

.hdv2-kb-breadcrumb a {
    color: var(--hdv2-cah-muted);
    text-decoration: none;
}

.hdv2-kb-breadcrumb a:hover {
    color: var(--hdv2-cah-fg);
}

.hdv2-kb-breadcrumb__sep {
    color: var(--hdv2-cah-border);
}

.hdv2-kb-breadcrumb__current {
    color: var(--hdv2-cah-fg);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.hdv2-kb-article {
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hdv2-kb-article-head {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.hdv2-kb-article-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--hdv2-cah-fg);
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
}

.hdv2-kb-admin-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
    background: var(--hdv2-cah-accent);
    color: var(--hdv2-cah-muted);
    font-size: 0.7rem;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

.hdv2-kb-admin-edit:hover {
    color: var(--hdv2-cah-fg);
}

.hdv2-kb-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    color: var(--hdv2-cah-muted);
    font-size: 0.82rem;
}

.hdv2-kb-article-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hdv2-kb-article-meta__item svg {
    width: 14px;
    height: 14px;
    color: hsl(36 85% 52%);
}

.hdv2-kb-article-meta__spacer {
    flex: 1;
}

.hdv2-kb-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-bg);
    color: var(--hdv2-cah-fg);
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.hdv2-kb-print-btn:hover {
    background: var(--hdv2-cah-accent);
}

.hdv2-kb-print-btn svg {
    width: 13px;
    height: 13px;
}

.hdv2-kb-article-body {
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.9rem;
    padding: 1.5rem 1.6rem;
    color: var(--hdv2-cah-fg);
    font-size: 0.95rem;
    line-height: 1.75;
}

.hdv2-kb-article-body h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    margin: 1.5rem 0 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--hdv2-cah-border);
}

.hdv2-kb-article-body h2:first-child {
    margin-top: 0;
}

.hdv2-kb-article-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    margin: 1.25rem 0 0.5rem;
}

.hdv2-kb-article-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    margin: 1rem 0 0.4rem;
}

.hdv2-kb-article-body p {
    margin: 0 0 0.85rem;
    line-height: 1.75;
}

.hdv2-kb-article-body ul,
.hdv2-kb-article-body ol {
    margin: 0.5rem 0 1rem;
    padding-left: 1.4rem;
}

.hdv2-kb-article-body li {
    margin-bottom: 0.35rem;
    line-height: 1.7;
}

.hdv2-kb-article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.85em;
    padding: 0.12em 0.4em;
    background: var(--hdv2-cah-accent);
    border-radius: 0.3rem;
    color: var(--hdv2-cah-fg);
}

.hdv2-kb-article-body pre {
    background: var(--hdv2-cah-accent);
    border: 1px solid var(--hdv2-cah-border);
    color: var(--hdv2-cah-fg);
    padding: 0.9rem 1rem;
    border-radius: 0.55rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.55;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.hdv2-kb-article-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.hdv2-kb-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.hdv2-kb-article-body a {
    color: hsl(217.2 91.2% 53%);
    text-decoration: none;
}

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

.hdv2-kb-article-body blockquote {
    border-left: 3px solid hsl(217.2 91.2% 59.8%);
    background: var(--hdv2-cah-accent);
    padding: 0.7rem 1rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--hdv2-cah-fg);
    font-style: normal;
}

.hdv2-kb-article-body strong,
.hdv2-kb-article-body b {
    color: var(--hdv2-cah-fg);
    font-weight: 600;
}

.hdv2-kb-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hdv2-cah-border);
}

.hdv2-kb-tags__label {
    font-size: 0.82rem;
    color: var(--hdv2-cah-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.hdv2-kb-tags__label svg {
    width: 13px;
    height: 13px;
}

.hdv2-kb-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    background: var(--hdv2-cah-accent);
    color: var(--hdv2-cah-fg);
    border: 1px solid var(--hdv2-cah-border);
    border-radius: 999px;
    font-size: 0.76rem;
    text-decoration: none;
}

.hdv2-kb-tag:hover {
    border-color: hsl(217.2 91.2% 59.8% / 0.45);
}

.hdv2-kb-rating {
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.85rem;
    padding: 1.25rem;
    text-align: center;
}

.hdv2-kb-rating__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    margin-bottom: 0.85rem;
}

.hdv2-kb-rating__buttons {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.hdv2-kb-rating-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.55rem;
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-bg);
    color: var(--hdv2-cah-fg);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hdv2-kb-rating-btn svg {
    width: 14px;
    height: 14px;
}

.hdv2-kb-rating-btn--yes:hover {
    border-color: hsl(142 50% 60%);
    color: hsl(142 71% 28%);
    background: hsl(142 70% 95%);
}

.hdv2-kb-rating-btn--no:hover {
    border-color: hsl(0 70% 70%);
    color: hsl(0 72% 38%);
    background: hsl(0 84% 96%);
}

[data-hdv2-theme="dark"] .hdv2-kb-rating-btn--yes:hover {
    background: hsl(142 40% 18%);
    color: hsl(142 70% 78%);
}

[data-hdv2-theme="dark"] .hdv2-kb-rating-btn--no:hover {
    background: hsl(0 35% 22%);
    color: hsl(0 90% 80%);
}

.hdv2-kb-rating__result {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: var(--hdv2-cah-muted);
}

.hdv2-kb-rating__result svg {
    width: 14px;
    height: 14px;
    color: hsl(36 85% 52%);
}

.hdv2-kb-success {
    border: 1px solid hsl(142 50% 80%);
    background: hsl(142 70% 95%);
    color: hsl(142 71% 28%);
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
}

[data-hdv2-theme="dark"] .hdv2-kb-success {
    background: hsl(142 40% 18%);
    border-color: hsl(142 35% 30%);
    color: hsl(142 70% 78%);
}

.hdv2-kb-success svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hdv2-kb-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
}

.hdv2-kb-related-card {
    border: 1px solid var(--hdv2-cah-border);
    background: var(--hdv2-cah-card);
    border-radius: 0.7rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hdv2-kb-related-card:hover {
    border-color: hsl(217.2 91.2% 59.8% / 0.4);
    background: var(--hdv2-cah-bg);
}

.hdv2-kb-related-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hdv2-cah-fg);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.hdv2-kb-related-card__title svg {
    width: 14px;
    height: 14px;
    color: var(--hdv2-cah-muted);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.hdv2-kb-related-card__excerpt {
    font-size: 0.78rem;
    color: var(--hdv2-cah-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media print {
    .hdv2-kb-back,
    .hdv2-kb-breadcrumb,
    .hdv2-kb-print-btn,
    .hdv2-kb-rating,
    .hdv2-kb-related-grid,
    .hdv2-kb-related,
    .hdv2-sidebar,
    .hdv2-cah-topbar {
        display: none !important;
    }
    .hdv2-kb-article-body {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}

@media (max-width: 640px) {
    .hdv2-kb-article-title {
        font-size: 1.3rem;
    }
    .hdv2-kb-article-body {
        padding: 1.1rem 1.1rem;
    }
    .hdv2-kb-rating-btn {
        flex: 1;
        justify-content: center;
    }
}
