/* 基础样式与颜色变量 */
:root {
--primary-color: #1b4332;
--secondary-color: #2d6a4f;
--accent-color: #40916c;
--light-color: #d8f3dc;
--text-color: #f8f9fa;
--background-color: #081c15;
--card-bg: #1b4332;
--hover-effect: brightness(115%);
--shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--background-color);
color: var(--text-color);
line-height: 1.6;
}

a {
text-decoration: none;
color: var(--light-color);
transition: color 0.3s;
}

a:hover {
color: #fff;
}

/* 导航栏样式 */
.navbar {
background-color: var(--primary-color);
padding: 1rem 5%;
box-shadow: var(--shadow);
position: relative;
}

.nav-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}

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

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

.nav-item {
margin-left: 1.5rem;
}

.hamburger {
display: none;
cursor: pointer;
font-size: 1.5rem;
}

/* 主要内容区域 */
.container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1rem;
}

.section {
margin-bottom: 3rem;
}

.section-title {
font-size: 1.5rem;
margin-bottom: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--accent-color);
}

/* 卡片通用样式 */
.card {
background-color: var(--card-bg);
border-radius: 8px;
overflow: hidden;
transition: transform 0.3s, box-shadow 0.3s;
box-shadow: var(--shadow);
}

.card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* 最新文章列表 */
.latest-articles {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
}

.latest-article {
padding: 1.5rem;
display: flex;
flex-direction: column;
height: 100%;
}

.latest-article h3 {
font-size: 1.2rem;
margin-bottom: 0.5rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: normal;
}

.article-meta {
color: var(--light-color);
font-size: 0.85rem;
margin-bottom: 0.8rem;
display: flex;
align-items: center;
}

.article-meta span {
margin-right: 1rem;
display: flex;
align-items: center;
}

.date::before {
content: "📅";
margin-right: 0.3rem;
font-style: normal;
}

.article-desc {
flex-grow: 1;
color: #b7e4c7;
}

/* 推荐文章图片列表 */
.featured-articles {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}

.featured-article {
height: 250px;
position: relative;
background-size: cover;
background-position: center;
transition: transform 0.3s ease;
}

.featured-article:hover {
transform: scale(1.03);
}

.featured-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
padding: 1.5rem 1rem 1rem;
color: white;
}

.featured-article h3 {
font-size: 1.1rem;
margin-bottom: 0.5rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: normal;
}

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

/* 热门文章列表 */
.popular-articles {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
}

.popular-article {
padding: 1.5rem;
}

.popular-article h3 {
font-size: 1.2rem;
margin-bottom: 0.8rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: normal;
}

.popular-meta {
display: flex;
justify-content: space-between;
margin-bottom: 0.8rem;
font-size: 0.85rem;
color: var(--light-color);
}

.popular-meta span {
display: flex;
align-items: center;
}

.popular-date::before {
content: "📅";
margin-right: 0.3rem;
font-style: normal;
}

.views::before {
content: "👀";
margin-right: 0.3rem;
font-style: normal;
}

.popular-desc {
color: #b7e4c7;
}

/* 文字介绍区块 */
.intro-section {
padding: 2rem;
line-height: 1.8;
}

/* 友情链接 */
.links-section {
padding: 1.5rem;
}

.links-container {
display: flex;
flex-wrap: wrap;
gap: 0.8rem;
}

.friend-link {
padding: 0.5rem 1rem;
background-color: var(--secondary-color);
border-radius: 4px;
font-size: 0.9rem;
transition: background-color 0.3s;
}

.friend-link:hover {
background-color: var(--accent-color);
}

/* 页脚样式 */
footer {
background-color: var(--primary-color);
text-align: center;
padding: 1.5rem;
margin-top: 2rem;
}

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

.hamburger {
display: block;
}

.nav-menu {
position: absolute;
left: -100%;
top: 70px;
flex-direction: column;
background-color: var(--primary-color);
width: 100%;
text-align: center;
transition: 0.3s;
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
padding: 1rem 0;
z-index: 999;
}

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

.nav-item {
margin: 1.5rem 0;
}

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

@media (max-width: 768px) {
.latest-articles,
.popular-articles {
grid-template-columns: 1fr;
}
}

@media (max-width: 500px) {
.featured-articles {
grid-template-columns: 1fr;
}

.popular-meta {
flex-direction: column;
gap: 0.5rem;
}
}