/* 新闻页面布局 */
.news-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* 新闻分类导航 */
.news-categories {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.news-categories::-webkit-scrollbar {
    height: 4px;
}

.news-categories::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.news-categories::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.news-categories a {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 10px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    white-space: nowrap;
}

.news-categories a:hover {
    color: #333;
    background: #f5f5f5;
}

.news-categories a.active {
    color: #fff;
    background: #4CAF50;
}

/* 搜索框 */
.news-search {
    margin: 20px 0;
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.search-btn {
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.search-btn:active {
    transform: translateY(0);
}

/* 新闻内容区 */
.news-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 热门新闻轮播 */
.news-featured {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.featured-slider {
    height: 100%;
    position: relative;
}

.featured-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.6s ease;
}

.featured-item.prev {
    transform: translateX(-100%);
    opacity: 0;
    z-index: 1;
}

.featured-item.active {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
}

.featured-item.next {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
}

.featured-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease 0.3s;
}

.featured-item.active .featured-info {
    transform: translateY(0);
    opacity: 1;
}

.featured-info h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    line-height: 1.4;
}

.featured-info p {
    margin: 0 0 15px 0;
    opacity: 0.9;
    line-height: 1.6;
}

.featured-info .date {
    opacity: 0.8;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-controls button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-controls button:hover {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(1.1);
}

.slider-controls button:active {
    transform: translateY(-50%) scale(1);
}

.slider-controls .prev {
    left: 20px;
}

.slider-controls .next {
    right: 20px;
}

/* 新闻列表 */
.news-list {
    padding: 20px;
}

.news-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s;
    animation: slideUp 0.6s ease both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item:last-child {
    border-bottom: none;
}

.news-image {
    overflow: hidden;
    border-radius: 8px;
    position: relative;
}

.news-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

.news-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

.news-item:hover .news-image::after {
    opacity: 1;
}

.news-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
    line-height: 1.4;
    transition: color 0.3s;
}

.news-item:hover .news-info h3 {
    color: #4CAF50;
}

.news-info .excerpt {
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    color: #999;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.news-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-tags .tag {
    font-size: 12px;
    padding: 4px 8px;
    background: #f5f5f5;
    color: #666;
    border-radius: 12px;
    transition: all 0.3s;
}

.news-tags .tag:hover {
    background: #4CAF50;
    color: #fff;
}

/* 侧边栏 */
.news-sidebar {
    align-self: start;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
    color: #333;
    font-size: 18px;
}

/* 热门标签 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.tag:hover,
.tag.active {
    background: #4CAF50;
    color: #fff;
    transform: translateY(-2px);
}

.tag:active {
    transform: translateY(0);
}

/* 热门文章 */
.popular-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-posts li {
    margin-bottom: 15px;
}

.popular-posts li:last-child {
    margin-bottom: 0;
}

.popular-posts a {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s;
}

.popular-posts a:hover {
    transform: translateX(5px);
}

.popular-posts img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.post-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
    transition: color 0.3s;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-info .views {
    font-size: 12px;
    color: #999;
}

.popular-posts a:hover h4 {
    color: #4CAF50;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination span {
    border: none;
    color: #999;
}

.pagination a.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.pagination a:hover:not(.active) {
    background: #f5f5f5;
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.pagination a:active:not(.active) {
    transform: translateY(0);
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 返回顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #45a049;
    transform: translateY(-5px);
}

.scroll-to-top:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .news-container {
        grid-template-columns: 1fr;
    }

    .news-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        position: static;
    }
}

@media (max-width: 768px) {
    .news-container {
        padding: 0 10px;
    }

    .news-featured {
        height: 300px;
    }

    .featured-info {
        padding: 20px;
    }

    .featured-info h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .featured-info p {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .news-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .news-image {
        margin-bottom: 0;
    }

    .news-image img {
        height: 200px;
    }

    .news-info h3 {
        font-size: 18px;
    }

    .news-meta {
        font-size: 12px;
        gap: 10px;
    }

    .slider-controls button {
        width: 36px;
        height: 36px;
    }

    .slider-controls .prev {
        left: 10px;
    }

    .slider-controls .next {
        right: 10px;
    }
}

@media (max-width: 576px) {
    .news-featured {
        height: 250px;
    }

    .featured-info h2 {
        font-size: 18px;
    }

    .featured-info p {
        display: none;
    }

    .news-image img {
        height: 180px;
    }

    .news-info h3 {
        font-size: 16px;
    }

    .news-info .excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .pagination {
        flex-wrap: wrap;
    }
} 