﻿
/* list.css - 列表页样式 */
/* 二级列表布局 */
.list-container {
    display: flex;
    gap: 25px;
    margin: 30px 0 40px;
}

.main-content {
    flex: 7;
}

.sidebar {
    flex: 3;
}

/* 新闻列表样式 */
.news-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.news-list-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--gray);
    transition: all 0.3s;
}

    .news-list-item:hover {
        background-color: #f9f9f9;
    }

    .news-list-item:last-child {
        border-bottom: none;
    }

.news-image {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
    margin-right: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 40px;
}

    .news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.news-content {
    flex: 1;
}

    .news-content h3 {
        font-size: 18px;
        margin-bottom: 10px;
        color: var(--primary-dark);
        transition: all 0.3s;
    }

.news-list-item:hover h3 {
    color: var(--accent);
}

.news-meta {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 14px;
}

.news-category {
    background: var(--primary-light);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 10px;
}

.news-date {
    display: flex;
    align-items: center;
}

    .news-date i {
        margin-right: 5px;
        color: var(--accent);
        font-size: 12px;
    }

.news-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 侧边栏模块 */
.sidebar-module {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.module-header {
    padding: 15px 20px;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.module-list {
    padding: 15px 20px;
}

.module-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

    .module-item:last-child {
        border-bottom: none;
    }

    .module-item .index {
        width: 24px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        background: var(--primary-light);
        color: white;
        border-radius: 50%;
        margin-right: 12px;
        flex-shrink: 0;
        font-size: 13px;
    }

    .module-item:nth-child(-n+3) .index {
        background: var(--accent);
    }

    .module-item .title {
/*        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 1;
        color: var(--primary-dark);
        text-decoration: none;
        transition: all 0.3s;*/
        display: -webkit-box;
        -webkit-line-clamp: 1;  /*限制显示1行 */
        -webkit-box-orient: vertical;
        overflow: hidden;
        max-height: 2.8em;  /*两行高度 */
    }

        .module-item .title:hover {
            color: var(--accent);
        }

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding: 15px;
    flex-wrap: wrap;
}

    .pagination a {
        display: inline-block;
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        border-radius: 50%;
        margin: 0 5px;
        background: white;
        color: var(--primary);
        text-decoration: none;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        transition: all 0.3s;
        font-size: 16px;
    }

        .pagination a:hover,
        .pagination a.active {
            background: var(--primary);
            color: white;
        }

    .pagination .disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .pagination .page-info {
        display: flex;
        align-items: center;
        margin: 0 15px;
        color: var(--text-light);
        font-size: 14px;
    }

/* 加载动画 */
.loader {
    display: none;
    text-align: center;
    padding: 30px 0;
}

    .loader .spinner {
        width: 50px;
        height: 50px;
        border: 5px solid rgba(46, 125, 50, 0.2);
        border-top: 5px solid var(--primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 20px;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader p {
    color: var(--primary);
    font-weight: 500;
}

/* 底部图文列表 */
.related-news {
    margin: 40px 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.related-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

    .related-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }

    .related-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        display: block;
    }

.related-content {
    padding: 15px;
}

.related-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 50px;
}

.related-card .date {
    color: var(--text-light);
    font-size: 12px;
    display: flex;
    align-items: center;
}

    .related-card .date i {
        margin-right: 5px;
        color: var(--accent);
    }

/* 响应式设计 */
@media (max-width: 1200px) {
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .list-container {
        flex-direction: column;
    }

    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .news-list-item {
        flex-direction: column;
    }

    .news-image {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .pagination a {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 14px;
    }
}
@media (max-width: 992px) {
    .module-item .title {
        -webkit-line-clamp: 1; /* 移动端只显示一行 */
        max-height: 1.4em; /* 单行高度 */
    }
}