/* ==========================================
   新闻科普列表页样式
   ========================================== */

/* ===== 内容布局 ===== */
.news-content-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.news-main-content {
    flex: 1;
    min-width: 0;
}

.news-sidebar { 
    width: 300px;
    flex-shrink: 0;
}

/* ===== 侧边栏区块 ===== */
.sidebar-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-light);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

/* ===== 热门新闻列表 ===== */
.hot-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-news-item {
    margin-bottom: 16px;
    position: relative;
}

.hot-news-item:last-child {
    margin-bottom: 0;
}

.hot-news-item a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-size: 14px;
    line-height: 1.5;
}

.hot-news-item a:hover {
    color: var(--primary-color);
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.hot-news-list li:nth-child(1) .hot-rank,
.hot-news-list li:nth-child(2) .hot-rank,
.hot-news-list li:nth-child(3) .hot-rank {
    background: var(--primary-color);
    color: #fff;
}

.hot-title {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 分类列表 ===== */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 12px;
}

.category-list li:last-child {
    margin-bottom: 0;
}

.category-list a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all var(--transition-fast);
    font-size: 15px;
    border: 1px solid var(--border-color);
}

.category-list a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ===== 置顶焦点文章 ===== */
.news-featured {
    padding: 40px 0 0;
}

.featured-card {
    display: flex;
    gap: 40px;
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    text-decoration: none;
    color: inherit;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.featured-img {
    position: relative;
    flex-shrink: 0;
    width: 480px;
    min-height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-lighter), var(--bg-gray));
}

.featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.featured-card:hover .featured-img img {
    transform: scale(1.05);
}

.featured-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--accent-color);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.featured-body {
    padding: 32px 32px 32px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-light);
}

.featured-meta time {
    font-family: 'Georgia', serif;
}

.featured-body h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 14px;
    transition: color var(--transition-fast);
}

.featured-card:hover .featured-body h2 {
    color: var(--primary-color);
}

.featured-body > p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-read-more {
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 600;
    transition: letter-spacing var(--transition-fast);
}

.featured-card:hover .featured-read-more {
    letter-spacing: 2px;
}

/* ===== 分类筛选栏 ===== */
.news-list-section {
    padding: 40px 0 60px;
}

.news-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.news-filter-bar .filter-btn {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 24px;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.news-filter-bar .filter-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.news-filter-bar .filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ===== 文章条形列表 ===== */
.news-list {
    display: flex;
    flex-direction: column;
}

.news-item {
    display: flex;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
    animation: fadeInUp 0.4s ease both;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: var(--bg-light);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 8px;
}

/* 列表项缩略图 */
.news-item-img {
    flex-shrink: 0;
    width: 220px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-lighter), var(--bg-gray));
}

.news-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.news-item:hover .news-item-img img {
    transform: scale(1.08);
}

/* 列表项文字区 */
.news-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.news-item-meta time {
    font-family: 'Georgia', serif;
}

/* 分类标签 */
.news-cat-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.news-cat-tag.cat-health {
    background: rgba(0, 179, 134, 0.1);
    color: #008f6b;
}

.news-cat-tag.cat-science {
    background: rgba(44, 111, 187, 0.1);
    color: #2c6fbb;
}

.news-cat-tag.cat-hospital {
    background: rgba(255, 122, 69, 0.1);
    color: #e06530;
}

/* 阅读量 */
.news-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-views svg {
    opacity: 0.6;
}

/* 文章标题 */
.news-item-body h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 10px;
    transition: color var(--transition-fast);
}

.news-item-body h3 a {
    text-decoration: none;
    color: inherit;
}

.news-item:hover .news-item-body h3 a {
    color: var(--primary-color);
}

/* 文章摘要 */
.news-item-body > p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 无结果提示 ===== */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.news-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.news-empty strong {
    display: block;
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.news-empty p {
    font-size: 15px;
}

/* ===== 分页 ===== */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 30px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.page-ellipsis {
    color: var(--text-light);
    padding: 0 4px;
    user-select: none;
}

.page-next {
    font-weight: 500;
}

/* ===== ThinkPHP 默认分页样式 ===== */
.news-pagination ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-pagination li {
    display: inline;
}

.news-pagination li a,
.news-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.news-pagination li a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.news-pagination li.active span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.news-pagination li.disabled span {
    color: var(--text-light);
    border-color: var(--border-color);
    background: var(--bg-light);
    cursor: not-allowed;
}

/* ===== 健康贴士横幅 ===== */
.news-tips-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    padding: 60px 0;
}

.news-tips-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.news-tips-text h2 {
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.news-tips-text h2 span {
    color: var(--primary-light);
}

.news-tips-text p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 440px;
}

.news-tips-action {
    text-align: center;
    flex-shrink: 0;
}

.news-tips-action .qr-code {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.news-tips-action p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    margin-top: 12px;
}

/* ===== 列表项隐藏动画 ===== */
.news-item.hiding {
    animation: fadeOutDown 0.3s ease both;
}

.news-item.hidden {
    display: none;
}

/* ===== 动画关键帧 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .featured-card {
        flex-direction: column;
        gap: 0;
    }

    .featured-img {
        width: 100%;
        min-height: 220px;
    }

    .featured-body {
        padding: 24px;
    }
    
    .news-content-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    
    .news-sidebar {
        width: 100%;
    }
    
    .sidebar-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        gap: 14px;
        padding: 20px 0;
    }

    .news-item:hover {
        margin: 0 -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .news-item-img {
        width: 100%;
        height: 180px;
    }

    .news-item-body h3 {
        font-size: 17px;
    }

    .news-tips-inner {
        flex-direction: column;
        text-align: center;
    }

    .news-tips-text p {
        margin: 0 auto;
    }

    .featured-body h2 {
        font-size: 21px;
    }
    
    .news-pagination {
        gap: 6px;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .news-filter-bar .filter-btn {
        padding: 6px 16px;
        font-size: 14px;
    }

    .news-views {
        display: none;
    }
    
    .hot-news-item a {
        font-size: 13px;
    }
    
    .hot-rank {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .category-list a {
        padding: 8px 12px;
        font-size: 14px;
    }
}
