/* 栏目列表页面 - 左右布局设计 */

/* 主容器 */
.category-page-wrapper {
    background: var(--bg-light);
    min-height: 100vh;
    padding: 20px 0;
}

.category-page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

/* 左侧内容区域 */
.category-main-content {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* 面包屑导航 */
.category-breadcrumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px 30px;
    color: white;
}

.category-breadcrumb .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.category-breadcrumb .breadcrumb-item {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.category-breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-breadcrumb .breadcrumb-item a:hover {
    color: white;
}

.category-breadcrumb .breadcrumb-item.active {
    color: white;
    font-weight: 600;
}

.category-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(255, 255, 255, 0.7);
    margin: 0 10px;
    font-size: 16px;
    font-weight: bold;
}

/* 栏目标题 */
.category-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
}

.category-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.category-header-left {
    flex: 1;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.category-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* 栏目页公众号二维码样式 */
.category-header-wechat {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.category-header-wechat .wechat-text-wrapper {
    text-align: right;
}

.category-header-wechat .wechat-text-inline {
    color: var(--text-primary);
}

.category-header-wechat .wechat-title-inline {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--text-primary);
}

.category-header-wechat .wechat-title-inline i {
    font-size: 20px;
    color: #1aad19;
}

.category-header-wechat .wechat-desc-inline {
    font-size: 15px;
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.category-header-wechat .wechat-name-inline {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
}

.category-header-wechat .qr-code-inline {
    width: 130px;
    height: 130px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.category-header-wechat .qr-img-inline {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* 文章列表 */
.category-articles {
    padding: 0;
}

.article-item {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.article-item:hover {
    background: #f8f9fa;
}

.article-item:last-child {
    border-bottom: none;
}

/* 文章元信息 */
.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-date {
    color: var(--text-secondary);
    font-size: 13px;
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.article-category {
    color: var(--primary-color);
    font-size: 13px;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* 优化后的城市标签样式 - 使用CSS创建图标 */
.article-city {
    color: #10b981;
    font-size: 13px;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding-left: 20px; /* 为图标留出空间 */
}

.article-city:hover {
    background: rgba(16, 185, 129, 0.15);
    transform: translateY(-1px);
}

/* 使用CSS创建位置图标 */
.article-city::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* 文章标题 */
.article-title {
    margin-bottom: 12px;
}

.article-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: block;
}

.article-title a:hover {
    color: var(--primary-color);
}

/* 文章摘要 - 修复HTML标签显示问题，限制为两行 */
.article-summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 3.2em; /* 两行高度：1.6 * 2 = 3.2em */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制为两行 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
}

/* 文章标签 */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.article-tags .badge {
    background: #e2e8f0;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* 无文章提示 */
.no-articles {
    padding: 60px 30px;
    text-align: center;
    color: var(--text-secondary);
}

.no-articles p {
    font-size: 16px;
    margin: 0;
}

/* 分页 */
.category-pagination {
    padding: 30px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.category-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.category-pagination .pagination .page-item {
    display: inline-block;
    margin: 0;
    list-style: none;
}

.category-pagination .pagination .page-link {
    display: block;
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.category-pagination .pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

.category-pagination .pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
}

.category-pagination .pagination .page-item.active .page-link:hover {
    background: var(--primary-color);
    color: white;
}

.category-pagination .pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 右侧栏目导航 */
.category-sidebar {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

/* 侧边栏标题 */
.sidebar-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* 栏目导航列表 */
.category-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

.category-nav-item {
    border-bottom: 1px solid var(--border-color);
}

.category-nav-item:last-child {
    border-bottom: none;
}

.category-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.category-nav-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.category-nav-link.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.category-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.category-nav-name {
    font-size: 14px;
    font-weight: 500;
}

.category-nav-count {
    background: #e2e8f0;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

/* 子栏目 */
.category-sub-nav {
    background: #f8f9fa;
    padding-left: 20px;
}

.category-sub-nav .category-nav-link {
    padding: 10px 20px;
    font-size: 13px;
}

.category-sub-nav .category-nav-link.active {
    background: rgba(102, 126, 234, 0.15);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .category-page-container {
        grid-template-columns: 1fr 250px;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .category-page-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-sidebar {
        position: static;
        order: -1;
    }
    
    .category-breadcrumb {
        padding: 15px 20px;
    }
    
    .category-header {
        padding: 20px;
    }
    
    .category-header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .category-header-left {
        text-align: center;
    }
    
    .category-title {
        font-size: 22px;
    }
    
    .category-header-wechat {
        flex-direction: column;
        gap: 15px;
    }
    
    .category-header-wechat .wechat-text-wrapper {
        text-align: center;
    }
    
    .category-header-wechat .wechat-title-inline {
        justify-content: center;
        font-size: 16px;
    }
    
    .category-header-wechat .wechat-desc-inline {
        font-size: 14px;
    }
    
    .category-header-wechat .wechat-name-inline {
        font-size: 15px;
    }
    
    .category-header-wechat .qr-code-inline {
        width: 140px;
        height: 140px;
    }
    
    .article-item {
        padding: 20px;
    }
    
    .article-title a {
        font-size: 16px;
    }
    
    .article-summary {
        font-size: 13px;
        max-height: 2.6em; /* 移动端两行高度调整 */
        -webkit-line-clamp: 2;
    }
    
    .category-pagination {
        padding: 20px;
    }
    
    /* 移动端优化城市标签 */
    .article-meta {
        gap: 10px;
    }
    
    .article-date,
    .article-category,
    .article-city {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .article-city {
        padding-left: 18px;
    }
    
    .article-city::before {
        left: 5px;
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 20px;
    }
    
    .category-header-wechat .wechat-title-inline {
        font-size: 15px;
    }
    
    .category-header-wechat .wechat-desc-inline {
        font-size: 13px;
    }
    
    .category-header-wechat .wechat-name-inline {
        font-size: 14px;
    }
    
    .category-header-wechat .qr-code-inline {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 576px) {
    .category-page-wrapper {
        padding: 10px 0;
    }
    
    .category-page-container {
        padding: 0 15px;
    }
    
    .article-item {
        padding: 15px;
    }
    
    .article-meta {
        gap: 8px;
    }
    
    .article-date,
    .article-category,
    .article-city {
        font-size: 11px;
        padding: 2px 5px;
    }
    
    .article-city {
        padding-left: 16px;
    }
    
    .article-city::before {
        left: 4px;
        width: 5px;
        height: 5px;
    }
}