/* 基础样式和变量 */
:root {
--primary-color: #000079;
--text-color: #333;
--light-text: #fff;
--bg-color: #f5f5f5;
--card-bg: #fff;
--border-color: #ddd;
--hover-color: #0000a0;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}

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

body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
}

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

ul {
list-style: none;
}

.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}

/* 导航栏样式 - 修改部分 */
.navbar {
background-color: var(--primary-color);
color: var(--light-text);
position: sticky;
top: 0;
z-index: 1000;
box-shadow: var(--shadow);
display: flex;
justify-content: center;
}

.nav-container {
width: 100%;
max-width: 1200px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
}

.logo {
font-size: 1.5rem;
font-weight: bold;
transition: var(--transition);
}

.logo:hover {
transform: scale(1.05);
text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav-menu {
display: flex;
}

.nav-item {
margin-left: 25px;
position: relative;
}

.nav-link {
padding: 10px 15px;
transition: var(--transition);
position: relative;
display: inline-block;
overflow: hidden;
}

/* 新的悬停效果 */
.nav-link::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s ease;
}

.nav-link:hover::before {
left: 100%;
}

.nav-link::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background-color: #fff;
transition: width 0.3s ease;
}

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

.nav-link:hover {
color: #fff;
text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

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

/* 内容区域通用样式 */
section {
padding: 40px 0;
}

.section-title {
font-size: 1.8rem;
margin-bottom: 30px;
text-align: center;
color: var(--primary-color);
}

/* 最新文章样式 - 修改：移除作者信息 */
.articles-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 30px;
}

.article-card {
background: var(--card-bg);
border-radius: 5px;
padding: 20px;
box-shadow: var(--shadow);
transition: var(--transition);
overflow: hidden;
word-wrap: break-word;
}

.article-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-title {
font-size: 1.2rem;
margin-bottom: 10px;
white-space: normal;
word-wrap: break-word;
overflow: visible;
text-overflow: ellipsis;
}

.article-title a:hover {
color: var(--primary-color);
}

.article-meta {
display: flex;
font-size: 0.9rem;
color: #666;
margin-bottom: 10px;
}

.article-meta span {
margin-right: 15px;
}

.article-meta span::before {
font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
margin-right: 5px;
}

.date::before {
content: "📅";
}

.article-excerpt {
line-height: 1.5;
color: #555;
overflow: hidden;
}

/* 推荐文章样式 */
.featured-articles {
background-color: var(--card-bg);
padding: 40px 0;
}

.featured-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
}

.featured-card {
height: 250px;
background-size: cover;
background-position: center;
border-radius: 5px;
position: relative;
overflow: hidden;
transition: var(--transition);
}

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

.featured-content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(to top, rgba(0,0,121,0.8), transparent);
color: var(--light-text);
padding: 20px;
}

.featured-title {
font-size: 1.1rem;
margin-bottom: 10px;
white-space: normal;
word-wrap: break-word;
overflow: visible;
text-overflow: ellipsis;
}

.featured-title a:hover {
text-decoration: underline;
}

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

/* 热门文章样式 */
.popular-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 30px;
}

.popular-card {
display: flex;
background: var(--card-bg);
border-radius: 5px;
overflow: hidden;
box-shadow: var(--shadow);
transition: var(--transition);
}

.popular-card:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.popular-content {
padding: 15px;
flex: 1;
}

.popular-title {
font-size: 1.2rem;
margin-bottom: 10px;
white-space: normal;
word-wrap: break-word;
overflow: visible;
text-overflow: ellipsis;
}

.popular-title a:hover {
color: var(--primary-color);
}

.popular-meta {
display: flex;
font-size: 0.9rem;
color: #666;
margin-bottom: 10px;
gap: 20px;
}

.popular-meta span::before {
font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
margin-right: 5px;
}

.date::before {
content: "📅";
}

.views::before {
content: "👁";
}

.popular-excerpt {
color: #555;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

/* 文字介绍样式 */
.intro-section {
background-color: var(--card-bg);
padding: 40px 15px;
}

.intro-content {
max-width: 1120px;
margin: 0 auto;
font-size: 1.1rem;
line-height: 1.8;
color: #555;
}

/* 友情链接样式 */
.links-section {
padding: 30px 0;
}

.links-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
}

.link-item {
background-color: var(--card-bg);
padding: 8px 15px;
border-radius: 3px;
font-size: 0.9rem;
transition: var(--transition);
}

.link-item:hover {
background-color: var(--primary-color);
color: var(--light-text);
}

/* 底部样式 */
footer {
background-color: var(--primary-color);
color: var(--light-text);
text-align: center;
padding: 20px 0;
margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
.hamburger {
display: block;
}

.nav-menu {
position: fixed;
left: -100%;
top: 70px;
flex-direction: column;
background-color: var(--primary-color);
width: 100%;
text-align: center;
transition: var(--transition);
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
}

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

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

.articles-grid, .popular-grid {
grid-template-columns: 1fr;
}

.featured-grid {
grid-template-columns: repeat(2, 1fr);
}

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

@media (max-width: 768px) {
.popular-meta {
flex-direction: column;
gap: 5px; /* 移动端纵列显示时减少间隔 */
}
}

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