@import url("/assets/css/pages/lists_kbase.css");

.kb-swiper-wrapper {
    margin-bottom: 40px;
    position: relative;
}

.kb-swiper {
    overflow: hidden;
    border-radius: 16px;
    position: relative;
}

.kb-swiper .swiper-wrapper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 8px;
}

.kb-swiper .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

.kb-swiper .swiper-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .kb-swiper .swiper-slide {
        flex-basis: calc(50% - 8px);
    }
}

.kb-card {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
    color: #fff;
    display: block;
    text-decoration: none;
}

.kb-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.88;
}

.kb-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.45);
}

.kb-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15) 60%);
}

.kb-card .meta {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 18px;
    z-index: 1;
}

.kb-name {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.kb-info {
    font-size: 13px;
    opacity: 0.9;
    color: #fff;
}

.swiper-button-prev,
.swiper-button-next {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.swiper-button-prev {
    left: 12px;
}

.swiper-button-next {
    right: 12px;
}

.swiper-button-prev svg,
.swiper-button-next svg {
    display: block;
}

.swiper-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.6;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
    opacity: 1;
}

.section {
    padding: 26px 0 8px;
}

.section-hd {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
}

.section-sub {
    color: var(--text-tertiary);
    font-size: 13px;
}

.switch {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tab {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
}

.tab.active {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.subcat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .subcat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .subcat-grid {
        grid-template-columns: 1fr;
    }
}

.subcat-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.subcat-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.subcat-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcat-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.45);
}

.subcat-cover .badge {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    border-radius: 10px;
    padding: 2px 8px;
}

.subcat-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.subcat-title {
    margin: 0;
    font-weight: 700;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.article-list .article-title {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.article-list .article-title:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-views {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.empty {
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.subcat-ft {
    padding: 10px 14px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px dashed var(--border-color);
}

.more {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
}
