/**
 * 新闻页面样式
 * 适用于 news.php 和 article.php
 */

/* ========== 新闻列表页基础样式 (news.php) ========== */

/* 页面横幅 */
.page-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
}

.page-banner h1 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 600;
}

.page-banner p {
    font-size: 16px;
    opacity: 0.9;
}

/* 新闻分类标签 */
.news-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.news-tabs a {
    padding: 10px 25px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.news-tabs a:hover,
.news-tabs a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* 新闻列表 */
.news-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.news-list .item {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.news-list .item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-list .item .pic {
    width: 200px;
    flex-shrink: 0;
    overflow: hidden;
}

.news-list .item .pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-list .item:hover .pic img {
    transform: scale(1.08);
}

.news-list .item .text {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-list .item .text h3 {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.news-list .item .text h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-list .item .text h3 a:hover {
    color: #667eea;
}

.news-list .item .text p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list .item .text .info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
}

.news-list .item .text .info .read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.news-list .item .text .info .read-more:hover {
    color: #764ba2;
}

/* 无数据提示 */
.news-list .no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 新闻列表 - 移动端优化 */
@media (max-width: 992px) {
    .news-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .news-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .news-card {
        padding: 0;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .news-card .pic {
        height: 180px;
        overflow: hidden;
    }
    
    .news-card .pic img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .news-card .text {
        padding: 15px;
    }
    
    .news-card h3 {
        font-size: 16px;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .news-card .summary {
        font-size: 13px;
        line-height: 1.6;
        color: #666;
        margin-bottom: 8px;
    }
    
    .news-card .meta {
        font-size: 12px;
        color: #999;
    }
}

/* 分类导航 - 移动端优化 */
@media (max-width: 768px) {
    .news-categories {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    .news-categories a {
        flex-shrink: 0;
        padding: 8px 15px;
        font-size: 14px;
        border-radius: 20px;
        background: #f5f5f5;
        color: #333;
        text-decoration: none;
        white-space: nowrap;
    }
    
    .news-categories a.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
    }
}

/* 搜索栏 - 移动端优化 */
@media (max-width: 768px) {
    .news-search {
        flex-direction: column;
        gap: 10px;
    }
    
    .news-search input {
        width: 100%;
        font-size: 16px;
        padding: 10px 15px;
        min-height: 44px;
        border: 1px solid #ddd;
        border-radius: 6px;
    }
    
    .news-search button {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
        background: #667eea;
        color: #fff;
        border: none;
        border-radius: 6px;
        cursor: pointer;
    }
}

/* ========== 文章详情页 (article.php) ========== */

/* 文章标题 */
@media (max-width: 576px) {
    .article-title {
        font-size: 20px;
        line-height: 1.4;
        padding: 15px 0;
    }
    
    .article-meta {
        font-size: 12px;
        color: #999;
        margin-bottom: 20px;
    }
    
    .article-meta span {
        margin-right: 10px;
    }
}

/* 文章内容 - 移动端优化 */
@media (max-width: 768px) {
    .article-content {
        font-size: 16px; /* 移动端最佳阅读尺寸 */
        line-height: 1.8;
        color: #333;
    }
    
    .article-content h2 {
        font-size: 20px;
        margin: 25px 0 15px;
    }
    
    .article-content h3 {
        font-size: 18px;
        margin: 20px 0 12px;
    }
    
    .article-content p {
        margin-bottom: 15px;
    }
    
    .article-content img {
        max-width: 100% !important;
        height: auto !important;
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 13px;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 8px 10px;
        white-space: nowrap;
    }
    
    .article-content ul,
    .article-content ol {
        padding-left: 20px;
        margin-bottom: 15px;
    }
    
    .article-content blockquote {
        padding: 10px 15px;
        margin: 15px 0;
        border-left: 4px solid #667eea;
        background: #f9f9f9;
        font-size: 14px;
    }
}

/* 文章分页 - 移动端优化 */
@media (max-width: 576px) {
    .article-pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-pagination a {
        display: block;
        padding: 12px 15px;
        font-size: 14px;
        background: #f5f5f5;
        color: #333;
        text-decoration: none;
        border-radius: 6px;
        text-align: center;
    }
    
    .article-pagination .prev:before {
        content: "← ";
    }
    
    .article-pagination .next:after {
        content: " →";
    }
}

/* 相关文章 - 移动端优化 */
@media (max-width: 576px) {
    .related-articles {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .related-articles h3 {
        font-size: 18px;
        margin: 25px 0 15px;
    }
    
    .related-article-card {
        display: flex;
        gap: 10px;
        padding: 10px;
        border-bottom: 1px solid #eee;
    }
    
    .related-article-card .pic {
        width: 80px;
        height: 60px;
        flex-shrink: 0;
        overflow: hidden;
        border-radius: 4px;
    }
    
    .related-article-card .pic img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .related-article-card .text {
        flex: 1;
    }
    
    .related-article-card h4 {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 5px;
    }
    
    .related-article-card .date {
        font-size: 12px;
        color: #999;
    }
}

/* 评论区 - 移动端优化 */
@media (max-width: 576px) {
    .comments-section {
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid #eee;
    }
    
    .comments-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .comment-form textarea {
        width: 100%;
        font-size: 16px;
        padding: 10px;
        min-height: 100px;
        border: 1px solid #ddd;
        border-radius: 6px;
        resize: vertical;
    }
    
    .comment-form button {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
        background: #667eea;
        color: #fff;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        margin-top: 10px;
    }
    
    .comment-list {
        margin-top: 20px;
    }
    
    .comment-item {
        padding: 12px;
        margin-bottom: 10px;
        background: #f9f9f9;
        border-radius: 6px;
    }
    
    .comment-item .author {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 5px;
    }
    
    .comment-item .content {
        font-size: 14px;
        line-height: 1.6;
        color: #333;
    }
    
    .comment-item .date {
        font-size: 12px;
        color: #999;
        margin-top: 5px;
    }
}
