/* =================================================================
   Knowledge Base List Page - 知识库列表页（行测级别）
   ================================================================= */

/* ==================== 文章编号样式 ==================== */
.title-num {
    display: inline-block;
    color: inherit;
    font-weight: 600;
    margin-right: 8px;
}

a.active .title-num {
    color: var(--primary-color);
}

/* ==================== 页面头部 ==================== */
.kbase-header {
    padding: 60px 0;
}

.kbase-header-content {
    text-align: center;
}

.kbase-header-title {
    font-size: 72px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    letter-spacing: -1px;
}

.kbase-header-title span {
    color: var(--primary-color);
}

.kbase-header-divider {
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.kbase-header-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0 0 28px 0;
    letter-spacing: 1px;
    white-space: pre-line;
}

.kbase-header-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header-tag {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.header-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 102, 255, 0.05);
}

/* ==================== 卡片列表 ==================== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==================== 卡片 ==================== */
.card {
    display: flex;
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card:nth-child(even) {
    flex-direction: row-reverse;
}

.card:nth-child(even) .card-body {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

/* 左侧封面 - 16:9比例 */
.card-cover {
    flex: 0 0 40%;
    position: relative;
    aspect-ratio: 16 / 9;
}

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

.card-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.card-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

/* 右侧内容 */
.card-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-left: 1px solid var(--border-color);
    overflow: hidden;
}

/* 选项卡 - 胶囊样式 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.tab.active {
    background: #2563EB;
    color: #fff;
}

/* 文章区域 */
.tab-panels {
    flex: 1;
    min-height: 0;
}

.panel {
    display: none;
    height: 100%;
}

.panel.active {
    display: block;
}

/* 文章网格 - 两列，最少4个位置 */
.articles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 100%;
}

.article {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 16px;
    border-radius: 0;
    transition: background 0.2s;
    cursor: pointer;
}

.article:hover {
    background: var(--bg-secondary);
}

.article-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.article:nth-child(1) .article-num { background: #FEF2F2; color: #EF4444; }
.article:nth-child(2) .article-num { background: #FFF7ED; color: #F97316; }
.article:nth-child(3) .article-num { background: #F0FDF4; color: #22C55E; }

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

.article-title {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.5;
    margin-bottom: 4px;
}

.article-title:hover {
    color: #2563EB;
}

.article-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 底部 */
.card-footer {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.more-link {
    font-size: 13px;
    color: #2563EB;
    text-decoration: none;
    font-weight: 500;
}

.more-link:hover {
    text-decoration: underline;
}

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

/* iPad端 */
@media (max-width: 1023px) {
    .kbase-header {
        padding: 48px 0;
    }
    
    .kbase-header-title {
        font-size: 56px;
    }
    
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* 手机端 */
@media (max-width: 767px) {
    .kbase-header {
        padding: 40px 0;
        margin-bottom: 32px;
    }
    
    .kbase-header-title {
        font-size: 40px;
    }
    
    .kbase-header-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .header-tag {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .module-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-title {
        font-size: 16px;
    }
}

/* 超小屏幕 */
@media (max-width: 479px) {
    .kbase-header-title {
        font-size: 32px;
    }
    
    .kbase-header-tags {
        gap: 8px;
    }
    
    .header-tag {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .card-body {
        padding: 14px 16px 16px;
    }
}
