/* 新闻页面样式
   作者：张同学
   日期：2024年3月 */

/* ========== 页面头部 ========== */
.page-header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: #fff;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.page-title {
    font-size: 2.4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.page-desc {
    font-size: 1.4rem;
    opacity: 0.9;
}

/* ========== 新闻分类标签 ========== */
.news-tabs-section {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 50px;
    z-index: 100;
}

.news-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.news-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex-shrink: 0;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 1.3rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-item.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.tab-item:active {
    transform: scale(0.95);
}

/* ========== 新闻列表 ========== */
.news-list-section {
    padding: 20px 0;
    background: var(--bg-gray);
}

.news-card {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
}

.news-card:active {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.news-card a {
    display: flex;
    padding: 15px;
}

/* 置顶新闻特殊样式 */
.news-card.featured {
    margin-bottom: 20px;
}

.news-card.featured a {
    display: block;
}

.news-card.featured .news-image {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
}

.news-card.featured .news-title {
    font-size: 1.8rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* 普通新闻图片 */
.news-image {
    position: relative;
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    margin-right: 15px;
    overflow: hidden;
    border-radius: 5px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 3px 8px;
    background: var(--accent-color);
    color: #fff;
    font-size: 1.1rem;
    border-radius: 3px;
}

/* 新闻内容 */
.news-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    font-size: 1.3rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
    color: #999;
    margin-top: auto;
}

.news-category {
    padding: 2px 8px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 3px;
    font-size: 1.1rem;
}

.news-time {
    flex-shrink: 0;
}

.news-views {
    margin-left: auto;
}

/* ========== 新闻详情页 ========== */
.news-detail-header {
    padding: 20px;
    background: #fff;
}

.detail-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 15px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.3rem;
    color: #666;
}

.detail-meta span {
    display: flex;
    align-items: center;
}

.detail-cover {
    width: 100%;
    margin: 20px 0;
}

.detail-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.detail-content {
    padding: 20px;
    background: #fff;
}

.detail-content p {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 15px;
    text-align: justify;
}

.detail-content h3 {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 20px 0 10px;
}

.detail-content img {
    width: 100%;
    margin: 15px 0;
    border-radius: 5px;
}

.detail-content blockquote {
    padding: 15px;
    margin: 20px 0;
    background: var(--bg-gray);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    color: #666;
}

/* ========== 相关推荐 ========== */
.related-news {
    padding: 20px;
    background: #fff;
    margin-top: 10px;
}

.related-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--bg-gray);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.related-item:active {
    background: #e8e8e8;
}

.related-item-img {
    width: 60px;
    height: 60px;
    margin-right: 12px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-item-content {
    flex: 1;
}

.related-item-title {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-item-time {
    font-size: 1.2rem;
    color: #999;
}

/* ========== 加载更多 ========== */
.load-more {
    text-align: center;
    padding: 20px 0;
}

/* ========== 响应式设计 ========== */
@media (min-width: 480px) {
    .news-card a {
        padding: 20px;
    }
    
    .news-image {
        width: 120px;
        height: 90px;
    }
}

@media (min-width: 768px) {
    .news-card.featured .news-image {
        height: 250px;
    }
    
    .news-title {
        font-size: 1.6rem;
    }
    
    .detail-title {
        font-size: 2.5rem;
    }
    
    .detail-content p {
        font-size: 1.6rem;
        line-height: 1.9;
    }
}