/* 通用样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

header {
    background-color: #333;
    color: #fff;
    text-align: center;
}

header .banner {
    background-image: url('../images/banner.jpg');
    background-size: cover;
    background-position: center;
    padding: 100px 0; /* 增加高度 */
}

header .banner h1 {
    margin: 0;
}

nav {
    background-color: #000; /* 纯黑色背景 */
    padding: 10px 0;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #555;
}

main {
    padding: 20px;
    max-width: 1000px; /* 设置内容宽度 */
    margin: 0 auto; /* 居中对齐 */
}

.recent-posts {
    background-color: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.recent-posts h2 {
    margin-top: 0;
}

.recent-posts article {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.recent-posts article img {
    max-width: 150px;
    margin-right: 20px;
    border-radius: 8px;
    transition: transform 0.3s; /* 添加动画效果 */
}

.recent-posts article img:hover {
    transform: scale(1.1); /* 鼠标悬停时放大图片 */
}

.recent-posts .post-content {
    flex: 1;
}

.recent-posts article h3 {
    margin: 0 0 10px 0;
}

.recent-posts .post-meta {
    font-size: 0.9em;
    color: #777;
}

.recent-posts article p {
    margin: 0 0 10px 0;
    max-height: 6em; /* 限制简介文字的高度 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 添加省略号 */
}

.recent-posts article a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.recent-posts article a:hover {
    text-decoration: underline;
}

.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination a {
    color: #333;
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.pagination a:hover {
    background-color: #ddd;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
}