/* ===== 网站地图页样式（/sitemap） =====
   版心与首页 / 分类页保持完全一致：max-width 1080 + border-box + 左右 16px 内边距，
   保证从任意页面跳转过来时内容区宽度不变，不出现横向抖动。 */
.sm-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    box-sizing: border-box;
}

/* ---- 标题区 ---- */
.sm-hero {
    position: relative;
    padding: 24px 24px 20px;
    border: 1px solid var(--theme-border, #eee);
    border-radius: 12px;
    background: var(--theme-card, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* 顶部主题色细装饰条 */
.sm-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--theme-primary, #ff6b6b), var(--theme-primary-light, #ff8e53));
}

.sm-hero h1 {
    position: relative;
    display: inline-block;
    margin: 0 0 10px;
    padding-bottom: 8px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--theme-text, #222);
}

/* 标题下划线：与分类页标题同款 */
.sm-hero h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 36px;
    height: 3px;
    border-radius: 2px;
    background: var(--theme-primary, #ff6b6b);
}

.sm-hero-desc {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--theme-text-secondary, #999);
}

.sm-stats {
    margin: 0;
    font-size: 13px;
    color: var(--theme-text-secondary, #666);
}

.sm-stats b {
    margin: 0 2px;
    font-size: 17px;
    font-weight: 600;
    color: var(--theme-primary, #ff6b6b);
}

/* ---- 区块通用 ---- */
.sm-stage {
    margin-top: 16px;
    padding: 18px 20px 20px;
    border: 1px solid var(--theme-border, #eee);
    border-radius: 12px;
    background: var(--theme-card, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.sm-stage-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--theme-text, #222);
}

.sm-stage-title::before {
    content: "";
    display: block;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--theme-primary, #ff6b6b);
}

/* ---- 栏目卡片：大屏四列、平板两列、手机单列 ---- */
.sm-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.sm-nav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--theme-border, #eee);
    border-radius: 10px;
    background: var(--theme-background, #fff);
    color: var(--theme-text, #222);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sm-nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--theme-primary, #ff6b6b);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.sm-nav-card:focus-visible {
    outline: 2px solid var(--theme-primary, #ff6b6b);
    outline-offset: 2px;
}

.sm-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--theme-primary, #ff6b6b);
    color: #fff;
}

.sm-nav-icon svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.sm-nav-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sm-nav-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text, #222);
}

.sm-nav-text em {
    font-size: 12px;
    font-style: normal;
    line-height: 1.5;
    color: var(--theme-text-secondary, #999);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 分类网格：大屏三列、平板两列、手机一列 ---- */
.sm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sm-cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--theme-border, #eee);
    border-radius: 8px;
    background: var(--theme-background, #fff);
    color: var(--theme-text, #222);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.6;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    /* 分类较多时降低离屏项渲染开销 */
    content-visibility: auto;
    contain-intrinsic-size: auto 44px;
}

.sm-cat:hover {
    border-color: var(--theme-primary, #ff6b6b);
    background: var(--theme-card, #fff);
    transform: translateX(2px);
}

.sm-cat-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-cat-count {
    flex: 0 0 auto;
    min-width: 28px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--theme-surface, #f5f6f7);
    color: var(--theme-text-secondary, #999);
    font-size: 12px;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sm-cat:hover .sm-cat-count {
    background: var(--theme-primary, #ff6b6b);
    color: #fff;
}

.sm-more {
    margin-top: 14px;
    text-align: center;
}

.sm-more a {
    font-size: 13px;
    color: var(--theme-primary, #ff6b6b);
    text-decoration: none;
}

.sm-more a:hover {
    text-decoration: underline;
}

.sm-empty {
    padding: 28px 0;
    text-align: center;
    font-size: 13px;
    color: var(--theme-text-secondary, #999);
}

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

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

@media (max-width: 640px) {
    .sm-page {
        padding: 12px 12px 32px;
    }

    .sm-hero {
        padding: 20px 16px 16px;
    }

    .sm-hero h1 {
        font-size: 20px;
    }

    .sm-stage {
        padding: 16px 14px 16px;
    }

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

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