/* 重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 容器 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 头部导航 */
header {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

/* 主内容区 */
main {
    padding: 2rem 0;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    color: #222;
}

.featured-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 列表视图：今日焦点 */
.featured-posts.list-view {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.post-item {
    display: flex;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    align-items: flex-start;
}

.post-thumb {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    /* 防止图片被压缩 */
}

.post-body {
    flex: 1;
    min-width: 0;
    /* 允许文字换行 */
}

.post-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #222;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.6rem;
    line-height: 1.5;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
}
.no-data{
    text-align: center;
    padding-top: 2rem;
    font-size: 1.2rem;
    padding-bottom: 2rem;
}
/* 手机端优化：图片在上，文字在下 */
@media (max-width: 600px) {
    .post-item {
        flex-direction: column;
    }

    .post-thumb {
        width: 100%;
        height: 180px;
        border-radius: 6px;
    }
}

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.post-content {
    padding: 1rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
}

/* 热门推荐 */
.hot-recommend {
    margin-top: 2rem;
}

.hot-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.hot-item {
    min-width: 180px;
    background: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

/* 标签云 */
.tag-cloud {
    margin-top: 2rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    .active{
        background: #2575fc;
        color: white;
    }
}

.tag {
    background: #eef2f7;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* 页脚 */
footer {
    background: #222;
    color: #ddd;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.copyright {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
    display: flex;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin-top: 1.5rem;
    }

    .hot-list {
        flex-wrap: nowrap;
    }
}

.hero-banner {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-box form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
}

.search-box button {
    background: #fff;
    border: none;
    width: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .hero-banner {
        padding: 2.5rem 0;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .search-box form {
        width: 90%;
    }
}

.pagination-container {
    margin: 2rem 0;
    text-align: center;
}

.pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a {
    display: block;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    color: #2575fc;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.pagination .active a,
.pagination a:hover {
    background-color: #2575fc;
    color: white;
    border-color: #2575fc;
}

/* 手机端优化：缩小内边距，允许换行 */
@media (max-width: 600px) {
    .pagination a {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }

    /* 如果空间太小，可只保留“上一页/下一页” */
    .pagination li:not(.active):nth-child(n+4):not(:last-child) {
        display: none;
    }
}