/* 知识体系 · 列表页（科技简约风；颜色/圆角/阴影统一引用 design-tokens.css 令牌） */

.ks-index {
    min-height: 70vh;
    padding: 32px 24px 56px;
    box-sizing: border-box;
    color: var(--tech-text);
    /* 科技背景与 Element Plus 主色由 .ds-app 提供 */
}

.ks-index *,
.ks-index *::before,
.ks-index *::after {
    box-sizing: border-box;
}

/* ===== Hero：标题 + 三项统计 ===== */
.ks-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
    padding: 26px 28px;
    background: var(--tech-panel);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.ks-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tech-grad-line);
}

.ks-hero-main {
    min-width: 0;
}

.ks-hero-title {
    margin: 0;
    font-size: var(--font-3xl);
    font-weight: 700;
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.ks-hero-title::before {
    content: '';
    width: 5px;
    height: 26px;
    border-radius: calc(var(--radius-xs) / 2);
    background: var(--tech-grad-bar);
}

.ks-hero-sub {
    margin: var(--space-2) 0 0 17px;
    font-size: var(--font-md);
    color: var(--tech-text-2);
}

.ks-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.ks-stat {
    min-width: 96px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--tech-panel-2);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-md);
}

.ks-stat b {
    font-size: var(--font-2xl);
    font-weight: 700;
    line-height: 1.1;
    color: var(--tech-accent-strong);
    font-variant-numeric: tabular-nums;
}

.ks-stat span {
    font-size: var(--font-xs);
    color: var(--tech-text-2);
}

/* ===== 科目分组 ===== */
.ks-group {
    margin-bottom: var(--space-8);
}

.ks-group-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.ks-group-title {
    margin: 0;
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--tech-text);
}

.ks-group-count {
    font-size: var(--font-xs);
    color: var(--tech-text-2);
    background: var(--tech-panel-2);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
}

/* ===== 体系卡片 ===== */
.ks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.ks-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: 18px 20px;
    background: var(--tech-panel);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: inherit;
    text-decoration: none;
    transition: transform var(--dur-base) var(--ease),
        box-shadow var(--dur-base) var(--ease),
        border-color var(--dur-base) var(--ease);
}

.ks-card:hover {
    transform: translateY(var(--lift));
    border-color: var(--tech-accent-line);
    box-shadow: var(--shadow-hover);
}

.ks-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.ks-card-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.ks-card-name {
    margin: 0;
    max-width: 100%;
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--tech-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ks-level {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    color: #fff;
    background: var(--tech-vip-grad);
    box-shadow: var(--shadow-xs);
}

.ks-card-arrow {
    flex-shrink: 0;
    color: var(--tech-text-3);
    transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.ks-card:hover .ks-card-arrow {
    color: var(--tech-accent-strong);
    transform: translateX(3px);
}

.ks-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-xs);
    color: var(--tech-text-2);
}

.ks-meta-item b {
    font-weight: 700;
    color: var(--tech-accent-strong);
}

.ks-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: var(--radius-circle);
    background: var(--tech-text-3);
}

.ks-card-desc {
    margin: 0;
    font-size: var(--font-sm);
    line-height: 1.6;
    color: var(--tech-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .ks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ks-index {
        padding: 16px 14px 40px;
    }

    .ks-hero {
        padding: 20px 18px;
        flex-direction: column;
        align-items: stretch;
    }

    .ks-hero-title {
        font-size: var(--font-2xl);
    }

    .ks-hero-title::before {
        height: 22px;
    }

    .ks-hero-sub {
        font-size: var(--font-sm);
    }

    .ks-hero-stats {
        width: 100%;
    }

    .ks-stat {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
    }

    .ks-stat b {
        font-size: var(--font-xl);
    }

    .ks-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
