
.main-img img{
    width: 100%;
    object-fit: cover;
    max-height:600px;
    
}
/** 标题样式保留不变 **/
.h-title{
    margin-top: 2rem;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    position: relative;
}
/* 修复：原样式有多余空格，::after 前不能有空格 */
.h-title::after{
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background-color: #3498db;
    margin: 0.5rem auto;
}

/* 新闻列表独立样式 - 命名空间隔离，不影响现有样式 */
.ecms-news-list {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    box-sizing: border-box;
}

/* 列表容器 - 优化：PC端也单列，且适配横向布局 */
.ecms-news-container {
    display: grid;
    grid-template-columns: 1fr; /* 始终单列，适配横向item布局 */
    gap: 20px;
    margin-bottom: 30px;
}

/* 单条新闻样式 - 核心优化：PC端默认横向布局 */
.ecms-news-item {
    display: flex;
    flex-direction: row; /* PC端默认横向（原移动端逻辑） */
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    align-items: center; /* 垂直居中，优化视觉效果 */
}

.ecms-news-item:hover {
    transform: translateY(-5px);
}

/* 新闻图片容器 - 优化PC端尺寸，适配横向布局 */
.ecms-news-img {
    width: 180px;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0; /* 防止图片被挤压 */
}

.ecms-news-img__inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block; /* 消除图片底部留白 */
}

.ecms-news-item:hover .ecms-news-img__inner {
    transform: scale(1.05);
}

/* 新闻内容区域 - 优化内边距和排版 */
.ecms-news-content {
    padding: 20px 15px;
    flex: 1; /* 占满剩余宽度 */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 内容垂直居中 */
}

.ecms-news-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    margin-top: 0; /* 消除默认margin */
}

.ecms-news-title a {
    color: #2c3e50;
    text-decoration: none;
}

.ecms-news-title a:hover {
    color: #3498db;
}

.ecms-news-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: none; /* 取消弹性占比，避免文字过多挤压 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 70px; /* 限制简介高度，优化排版 */
}

.ecms-news-time {
    font-size: 12px;
    color: #999;
    display: block; /* 独占一行 */
}

/* 无数据提示 - 优化居中效果 */
.ecms-news-empty {
    text-align: center;
    padding: 50px 0;
    color: #999;
    font-size: 16px;
    grid-column: 1 / -1; /* 跨列显示 */
}

/* 分页样式（保留，虽已去掉分页代码） */
.ecms-news-pagination {
    text-align: center;
    padding: 10px 0;
}

.ecms-page__btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background: #f8f8f8;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ecms-page__btn:hover {
    background: #3498db;
    color: #fff;
}

.ecms-page__btn.active {
    background: #3498db;
    color: #fff;
    cursor: default;
}

/* 响应式适配 - 仅调整小屏尺寸，PC端已默认横向 */
@media (max-width: 768px) {
    /* 平板端：图片尺寸缩小，保持横向 */
    .ecms-news-img {
        width: 120px;
        height: 120px;
    }

    .ecms-news-content {
        padding: 10px;
    }

    .ecms-news-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .ecms-news-desc {
        -webkit-line-clamp: 2;
        margin-bottom: 5px;
        max-height: 45px;
    }
}

@media (max-width: 480px) {
    /* 手机端：改为纵向布局，优化小屏体验 */
    .ecms-news-item {
        flex-direction: column;
    }

    .ecms-news-img {
        width: 100%;
        height: 150px;
    }

    .ecms-page__btn {
        padding: 6px 12px;
        margin: 0 3px;
        font-size: 12px;
    }
}