/* 特色横幅图片样式 */
.yuanma-banner {
    position: relative;
    width: 100%;
    height: 400px; /* 调整高度 */
    overflow: hidden;
    margin-bottom: 40px; /* 增加间距 */
}

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

.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.4); /* 半透明背景 */
    padding: 20px;
    border-radius: 10px;
}

.banner-text h1 {
    font-size: 3em; /* 调整字体大小 */
    margin: 0;
}

.banner-text p {
    font-size: 1.5em; /* 调整字体大小 */
    margin: 10px 0 0;
}

/* 分类菜单样式 */
.yuanma-menu {
    text-align: center;
    margin-bottom: 40px;
}

.yuanma-categories {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px; /* 增加间距 */
}

.yuanma-categories li {
    margin: 0;
}

.yuanma-category-button {
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    font-size: 1.2em; /* 调整字体大小 */
}

.yuanma-category-button i {
    margin-right: 10px;
}

.yuanma-category-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.yuanma-category-button.active {
    background-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 过滤选项样式 */
.yuanma-filters {
    text-align: center;
    margin-bottom: 20px;
}

.yuanma-filters label {
    font-size: 1.2em;
    margin-right: 10px;
}

.yuanma-filters select {
    padding: 5px 10px;
    font-size: 1em;
}

/* 文章卡片样式 */
.yuanma-posts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.yuanma-post-card {
    background: #fff;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex: 1 1 calc(33.333% - 40px);
    box-sizing: border-box;
    transition: box-shadow 0.3s, transform 0.3s;
    overflow: hidden;
    max-width: 300px;
    display: flex;
    flex-direction: column;
}

.yuanma-post-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-content h3 {
    margin: 0 0 10px;
    flex: 1;
}

.post-content p {
    color: #666;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* 限制描述文字显示三行 */
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
    align-self: flex-start;
}

.read-more:hover {
    color: #0056b3;
}

/* 加载动画样式 */
.loading-spinner {
    text-align: center;
    font-size: 1.5em;
    color: #007bff;
    margin-top: 20px;
}

/* 懒加载样式 */
.lazy-load {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yuanma-banner {
        height: 300px; /* 调整高度 */
    }

    .banner-text h1 {
        font-size: 2.5em; /* 调整字体大小 */
    }

    .banner-text p {
        font-size: 1.2em; /* 调整字体大小 */
    }

    .yuanma-post-card {
        flex: 1 1 calc(50% - 20px);
        max-width: 100%;
    }

    .post-thumbnail {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .yuanma-banner {
        height: 250px; /* 调整高度 */
    }

    .banner-text h1 {
        font-size: 2em; /* 调整字体大小 */
    }

    .banner-text p {
        font-size: 1em; /* 调整字体大小 */
    }

    .yuanma-post-card {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .post-thumbnail {
        height: 120px;
    }
}
