/*
  分类页面专用样式
  配色对齐首页 --electric-blue: #3E6AE1
*/

/* ====== Category Hero ====== */
.cat-hero {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    background: linear-gradient(135deg, #171A20 0%, #2a2e38 50%, #3E6AE1 100%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    isolation: isolate;
}
.cat-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
        rgba(23,26,32,.94) 0%,
        rgba(23,26,32,.80) 45%,
        rgba(62,106,225,.25) 100%
    );
}
.cat-hero-inner {
    position: relative; z-index: 2;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0 52px;
}
.cat-hero-eyebrow {
    color: #8eaaf0; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px;
}
.cat-hero-eyebrow::before {
    content: ""; display: inline-block; width: 32px; height: 2.5px;
    background: linear-gradient(90deg, #3E6AE1, #8eb5f5);
    vertical-align: middle; margin-right: 10px;
    border-radius: 2px;
}
.cat-hero h1 {
    color: #fff; font-size: clamp(32px, 4vw, 44px);
    font-weight: 800; line-height: 1.18; margin: 8px 0 0;
}
.cat-hero p {
    color: rgba(255,255,255,.78); font-size: 15px;
    line-height: 1.7; max-width: 600px; margin-top: 14px;
}
.breadcrumb {
    display: flex; gap: 8px; margin-top: 18px;
    font-size: 13px; color: rgba(255,255,255,.45); align-items: center;
}
.breadcrumb a { color: #a8c4fa; text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: #fff; }

/* 子分类标签 */
.cat-sub-tags {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px;
}
.cat-tag {
    display: inline-flex; align-items: center; padding: 7px 18px;
    border-radius: 8px; font-size: 13px; font-weight: 600;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    text-decoration: none; transition: all .25s ease;
}
.cat-tag:hover {
    background: rgba(62,106,225,.35);
    border-color: rgba(142,181,245,.55);
    color: #fff; transform: translateY(-1px);
}

/* ====== 两栏布局 ====== */
.cat-layout {
    display: flex; gap: 36px;
    max-width: 1200px; margin: 0 auto; padding: 48px 24px;
    align-items: flex-start;
}

/* ====== 左侧栏 ====== */
.cat-sidebar {
    width: 260px; flex-shrink: 0;
    position: sticky; top: 88px;
}
.cat-nav-title {
    font-size: 15px; font-weight: 700;
    color: #171A20;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 2.5px solid #3E6AE1;
}

/* 导航列表 */
.cat-nav-list {
    list-style: none; padding: 0; margin: 0 0 24px;
    display: flex; flex-direction: column; gap: 3px;
}

.cat-nav-list li a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 500;
    color: #393C41; text-decoration: none;
    transition: all .22s ease;
}
.cat-nav-list li a .radio-dot {
    width: 18px; height: 18px; flex-shrink: 0;
    border-radius: 50%; border: 2px solid #D0D1D2;
    transition: all .22s ease; position: relative;
}
.cat-nav-list li a:hover {
    background: #f0f4ff; color: #3E6AE1;
}
.cat-nav-list li a:hover .radio-dot {
    border-color: #3E6AE1;
}

/* 当前选中项 */
.cat-nav-list li.current-cat > a,
.cat-nav-list li.current-post > a,
.cat-nav-list li a.active {
    background: #3E6AE1;
    color: #fff; font-weight: 600;
    box-shadow: 0 4px 14px rgba(62,106,225,.28);
}
.cat-nav-list li.current-cat > a .radio-dot,
.cat-nav-list li.current-post > a .radio-dot,
.cat-nav-list li a.active .radio-dot {
    border-color: #fff;
    background: #fff;
    box-shadow: inset 0 0 0 3px #3E6AE1;
}

/* 文章数 badge */
.cat-count {
    font-size: 11px; background: #F4F4F4;
    padding: 2px 8px; border-radius: 999px;
    color: #5C5E62; margin-left: auto;
}
.cat-nav-list li.current-cat > a .cat-count,
.cat-nav-list li a.active .cat-count {
    background: rgba(255,255,255,.22); color: #fff;
}

.post-title-text {
    flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

/* ====== 分类树 ====== */
.cat-tree-list {
    gap: 0;
}
.cat-tree-item {
    border-radius: 10px;
    overflow: hidden;
}
.cat-tree-row {
    display: flex;
    align-items: center;
}
.cat-tree-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #393C41;
    text-decoration: none;
    transition: all .22s ease;
}
.cat-tree-link:hover {
    background: #f0f4ff;
    color: #3E6AE1;
}
.cat-tree-link:hover .radio-dot {
    border-color: #3E6AE1;
}

/* 展开/收起按钮 */
.cat-toggle-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    margin-right: 4px;
    cursor: pointer;
    color: #8e8e8e;
    font-size: 12px;
    line-height: 1;
    border-radius: 6px;
    transition: all .25s ease;
    flex-shrink: 0;
}
.cat-toggle-btn:hover {
    background: #f0f4ff;
    color: #3E6AE1;
}
.cat-toggle-btn.is-open {
    transform: rotate(180deg);
}

/* 子分类列表 */
.cat-sub-list {
    list-style: none;
    padding: 0 0 6px 36px;
    margin: 0;
    display: none;
}
.cat-sub-list.is-open {
    display: block;
}
.cat-sub-item {
    margin: 2px 0;
}
.cat-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #5C5E62;
    text-decoration: none;
    transition: all .22s ease;
}
.cat-sub-link:hover {
    background: #f0f4ff;
    color: #3E6AE1;
}
.cat-sub-link:hover .radio-dot {
    border-color: #3E6AE1;
}

/* 当前选中项（复用原有 active 样式） */
.cat-tree-item.current-cat > .cat-tree-row .cat-tree-link.active,
.cat-sub-item.current-cat .cat-sub-link.active {
    background: #3E6AE1;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(62,106,225,.28);
}
.cat-tree-item.current-cat > .cat-tree-row .cat-tree-link.active .radio-dot,
.cat-sub-item.current-cat .cat-sub-link.active .radio-dot {
    border-color: #fff;
    background: #fff;
    box-shadow: inset 0 0 0 3px #3E6AE1;
}
.cat-tree-item.current-cat > .cat-tree-row .cat-tree-link.active .cat-count,
.cat-sub-item.current-cat .cat-sub-link.active .cat-count {
    background: rgba(255,255,255,.22);
    color: #fff;
}

/* 侧边栏底部CTA */
.sidebar-cta-box {
    padding: 24px; border-radius: 12px;
    background: linear-gradient(145deg, #f0f4ff, #e8effe);
    border: 1px solid #d4e0f7;
}
.sidebar-cta-box h4 {
    margin: 0 0 14px; font-size: 15px;
    font-weight: 700; color: #171A20;
}
.btn-accent {
    display: block; width: 100%; padding: 13px;
    background: linear-gradient(135deg, #3E6AE1 0%, #5a85f0 100%);
    color: #fff; font-weight: 700; font-size: 14px;
    border-radius: 10px; text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(62,106,225,.30);
    transition: all .25s ease; border: none;
    cursor: pointer;
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(62,106,225,.40);
    color: #fff;
}

/* ====== 右侧内容区 ====== */
.cat-main { flex: 1; min-width: 0; }

/* 模式1: 单分类全文展示 */
.cat-full-post {
    padding: 32px 0;
    border-bottom: 1px solid #eee;
}
.cat-full-post:last-child { border-bottom: none; }
.full-post-title {
    font-size: 24px; font-weight: 700;
    color: #171A20; line-height: 1.35; margin: 0 0 10px;
}
.full-post-meta {
    display: flex; gap: 20px;
    font-size: 13px; color: #8E8E8E; margin-bottom: 20px;
}
.full-post-meta i { color: #3E6AE1; }
.full-post-content {
    font-size: 15px; line-height: 1.85;
    color: #393C41;
}
.full-post-content p { margin-bottom: 16px; }
.full-post-content h2,
.full-post-content h3,
.full-post-content h4 { color: #171A20; }
.full-post-content img { max-width: 100%; border-radius: 10px; }

/* 模式2/3: 分类简介 */
.cat-intro-section {
    margin-bottom: 32px; padding: 28px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(23,26,32,.06);
}
.cat-intro-section h2 {
    font-size: 18px; font-weight: 700;
    color: #171A20; margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2.5px solid #3E6AE1;
    display: inline-block;
}
.cat-intro-text {
    font-size: 14.5px; line-height: 1.8; color: #393C41;
}

/* 文章卡片列表 */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.cat-post-card {
    display: flex; gap: 24px; padding: 24px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(23,26,32,.05);
    transition: all .28s cubic-bezier(.25,.8,.25,1);
    text-decoration: none; color: inherit;
}
.cat-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(23,26,32,.10),
                0 4px 12px rgba(62,106,225,.08);
    border-color: #d4e0f7;
}
.cat-post-thumb {
    width: 220px; height: 150px; flex-shrink: 0;
    border-radius: 10px; overflow: hidden;
    background: linear-gradient(145deg, #eef2f9, #dde8f7);
}
.cat-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-post-body { flex: 1; display: flex; flex-direction: column; }
.cat-post-body h2 {
    margin: 0 0 8px; font-size: 17px; font-weight: 700;
    line-height: 1.4; color: #171A20; transition: color .2s;
}
.cat-post-body h2 a { color: inherit; text-decoration: none; }
.cat-post-card:hover h2 { color: #3E6AE1; }
.cat-post-excerpt {
    font-size: 13.5px; color: #5C5E62; line-height: 1.65; flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cat-post-meta {
    display: flex; gap: 18px; margin-top: 14px;
    font-size: 12.5px; color: #8E8E8E; align-items: center;
}
.cat-post-meta i { margin-right: 5px; color: #3E6AE1; }
.cat-read-more {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px; color: #3E6AE1;
    font-weight: 700; font-size: 13.5px; text-decoration: none;
    transition: all .2s ease;
}
.cat-read-more:hover { gap: 10px; }

/* 无结果 */
.no-results { text-align: center; padding: 80px 20px; }
.no-results h2 { color: #171A20; font-size: 26px; margin-bottom: 12px; }
.no-results p { color: #8E8E8E; }

/* 分页 */
.cat-pagination {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 40px; flex-wrap: wrap;
}
.cat-pagination a, .cat-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; height: 42px; padding: 0 14px;
    border-radius: 10px; font-size: 14px; font-weight: 600;
    border: 1.5px solid #eee;
    color: #393C41; text-decoration: none; transition: all .22s ease;
}
.cat-pagination a:hover {
    border-color: #3E6AE1;
    color: #3E6AE1; background: #f0f4ff;
}
.cat-pagination .current {
    background: linear-gradient(135deg, #3E6AE1 0%, #5a85f0 100%);
    color: #fff; border-color: transparent;
    box-shadow: 0 3px 10px rgba(62,106,225,.25);
}

/* ====== 响应式 ====== */
@media (max-width: 900px) {
    .cat-layout { flex-direction: column; padding: 32px 16px; }
    .cat-sidebar { width: 100%; position: static; }
    .cat-post-card { flex-direction: column; }
    .cat-post-thumb { width: 100%; height: 200px; }
    .cat-hero { min-height: 280px; }
    .cat-hero-inner { padding: 56px 16px 40px; }
}
@media (max-width: 640px) {
    .cat-hero { min-height: 240px; }
    .cat-hero h1 { font-size: 28px; }
    .post-grid { gap: 16px; }
    .cat-post-card { padding: 18px; }
    .full-post-title { font-size: 20px; }
    .cat-sub-tags { gap: 8px; }
    .cat-tag { padding: 6px 14px; font-size: 12px; }
}
