/* 基础样式与变量定义 */
:root {
--dark-green: #1e3c32;
--medium-green: #2d4f43;
--light-green: #3c6154;
--accent-green: #4a7c65;
--text-light: #f1f8f5;
--text-gray: #c8d5d1;
--shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
--transition: all 0.3s ease;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
background-color: #f5f9f7;
color: #333;
line-height: 1.6;
}

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

/* 通用容器 */
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}

/* 导航栏样式 */
header {
background-color: var(--dark-green);
color: var(--text-light);
position: sticky;
top: 0;
z-index: 1000;
box-shadow: var(--shadow);
}

.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
}

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

.nav-menu {
display: flex;
list-style: none;
}

.nav-item {
margin-left: 30px;
}

.nav-link {
position: relative;
padding: 5px 0;
transition: var(--transition);
}

.nav-link::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background-color: var(--text-light);
transition: var(--transition);
}

.nav-link:hover::after {
width: 100%;
}

.hamburger {
display: none;
cursor: pointer;
background: none;
border: none;
color: var(--text-light);
font-size: 1.5rem;
}

/* 内容区块通用样式 */
.section {
padding: 40px 0;
background-color: white;
margin: 20px 0;
border-radius: 8px;
box-shadow: var(--shadow);
}

.section-title {
color: var(--dark-green);
text-align: center;
margin-bottom: 30px;
font-size: 1.8rem;
position: relative;
padding-bottom: 15px;
}

.section-title::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 3px;
background-color: var(--accent-green);
}

/* 最新文章列表 */
.latest-articles {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 30px;
padding: 0 20px; /* 添加与板块边框的边距 */
}

.article-card {
background: #fff;
border-radius: 8px;
overflow: hidden;
transition: var(--transition);
border: 1px solid #eaeaea;
padding: 15px; /* 添加内边距 */
}

.article-card:hover {
transform: translateY(-5px);
box-shadow: var(--shadow);
}

.article-content {
padding: 10px 0;
}

.article-title {
font-size: 1.2rem;
margin-bottom: 10px;
color: var(--dark-green);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.article-excerpt {
color: #666;
margin-bottom: 15px;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}

.article-meta {
display: flex;
align-items: center;
color: #888;
font-size: 0.9rem;
}

.article-date::before {
content: "📅";
margin-right: 5px;
}

/* 推荐文章图片列表 */
.featured-articles {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
padding: 0 20px; /* 添加与板块边框的边距 */
}

.featured-card {
height: 250px;
border-radius: 8px;
overflow: hidden;
position: relative;
background-size: cover;
background-position: center;
transition: var(--transition);
margin: 10px 0; /* 添加外边距 */
}

.featured-card:hover {
transform: scale(1.05);
}

.featured-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(30, 60, 50, 0.9));
padding: 20px;
color: var(--text-light);
}

.featured-title {
font-size: 1.1rem;
margin-bottom: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.featured-excerpt {
font-size: 0.9rem;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

/* 热门文章列表 */
.popular-articles {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 30px;
padding: 0 20px; /* 添加与板块边框的边距 */
}

.popular-card {
display: flex;
flex-direction: column;
background: #fff;
border-radius: 8px;
overflow: hidden;
transition: var(--transition);
border: 1px solid #eaeaea;
padding: 15px; /* 添加内边距 */
}

.popular-card:hover {
transform: translateY(-5px);
box-shadow: var(--shadow);
}

.popular-content {
padding: 10px 0;
}

.popular-title {
font-size: 1.2rem;
margin-bottom: 10px;
color: var(--dark-green);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.popular-excerpt {
color: #666;
margin-bottom: 15px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.popular-meta {
display: flex;
justify-content: space-between;
align-items: center;
color: #888;
font-size: 0.9rem;
}

.popular-date::before {
content: "📅";
margin-right: 5px;
}

.popular-views::before {
content: "👀";
margin-right: 5px;
}

/* 文字介绍部分 */
.intro-section {
padding: 40px;
background-color: var(--light-green);
color: var(--text-light);
border-radius: 8px;
text-align: center;
}

.intro-title {
font-size: 1.8rem;
margin-bottom: 20px;
}

.intro-text {
max-width: 800px;
margin: 0 auto;
font-size: 1.1rem;
line-height: 1.8;
}

/* 友情链接部分 */
.links-section {
padding: 30px 40px;
background-color: var(--light-green);
color: var(--text-light);
border-radius: 8px;
}

.links-grid {
display: flex;
flex-wrap: wrap;
gap: 15px;
justify-content: flex-start;
}

.link-item {
padding: 8px 15px;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 4px;
transition: var(--transition);
}

.link-item:hover {
background-color: rgba(255, 255, 255, 0.2);
}

/* 页脚样式 */
footer {
background-color: var(--dark-green);
color: var(--text-light);
text-align: center;
padding: 20px 0;
margin-top: 40px;
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
/* 平板样式 */
.featured-articles {
grid-template-columns: repeat(2, 1fr);
}

.nav-menu {
position: fixed;
left: -100%;
top: 70px;
flex-direction: column;
background-color: var(--dark-green);
width: 100%;
text-align: center;
transition: 0.3s;
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
padding: 20px 0;
}

.nav-menu.active {
left: 0;
}

.nav-item {
margin: 15px 0;
}

.hamburger {
display: block;
}

/* 平板视图下为文章列表添加更多边距 */
.latest-articles,
.popular-articles {
padding: 0 30px;
}

.featured-articles {
padding: 0 25px;
}

.intro-section,
.links-section,
.copyright{
display: none;
}
}

@media screen and (max-width: 768px) {
/* 平板和小屏手机样式 */
.latest-articles,
.popular-articles {
grid-template-columns: 1fr;
padding: 0 25px; /* 增加边距 */
}

.popular-meta {
flex-direction: column;
align-items: flex-start;
}

.popular-views {
margin-top: 5px;
}

/* 手机视图下为文章列表添加更多边距 */
.featured-articles {
padding: 0 20px;
}
}

@media screen and (max-width: 500px) {
/* 手机样式 */
.featured-articles {
grid-template-columns: 1fr;
padding: 0 15px; /* 增加边距 */
}

/* 手机视图下为文章列表添加更多边距 */
.latest-articles,
.popular-articles {
padding: 0 20px;
}
}