:root {
--primary-color: #5B5B5B;
--secondary-color: #7A7A7A;
--background-color: #F5F5F5;
--text-color: #333333;
--light-gray: #E0E0E0;
--hover-color: #4A4A4A;
--card-shadow: 0 4px 8px rgba(0,0,0,0.1);
--transition: all 0.3s ease;
}

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

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

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

/* 导航栏样式 */
header {
background-color: var(--primary-color);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
}

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

.logo a {
color: white;
text-decoration: none;
}

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

.nav-menu li {
margin-left: 1.5rem;
position: relative;
}

/* 修改PC导航栏悬停特效 */
.nav-menu a {
color: white;
text-decoration: none;
transition: var(--transition);
padding: 0.5rem 0;
position: relative;
}

/* 新的导航栏悬停效果 */
.nav-menu a::before {
content: '';
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
transform: scaleX(0);
transition: all 0.3s ease-in-out;
}

.nav-menu a:hover::before {
visibility: visible;
transform: scaleX(1);
}

.nav-menu a:hover {
color: var(--light-gray);
}

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

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

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

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

.article-card {
background: white;
border-radius: 8px;
overflow: hidden;
transition: var(--transition);
box-shadow: var(--card-shadow);
}

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

.article-content {
padding: 1.5rem;
}

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

.article-title a {
color: var(--primary-color);
text-decoration: none;
transition: var(--transition);
}

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

.article-meta {
color: var(--secondary-color);
font-size: 0.9rem;
margin-bottom: 1rem;
display: flex;
align-items: center;
}

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

/* 使用Emoji图标替换原来的SVG图标 */
.date::before {
content: "📅 ";
margin-right: 0.3rem;
}

.article-description {
color: var(--secondary-color);
line-height: 1.6;
}

/* 推荐文章样式 */
.featured-articles {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1.5rem;
}

.featured-article {
position: relative;
height: 250px;
border-radius: 8px;
overflow: hidden;
transition: var(--transition);
box-shadow: var(--card-shadow);
}

.featured-article:hover {
transform: scale(1.03);
box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.featured-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
z-index: 1;
}

.featured-overlay {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 1.5rem;
background: linear-gradient(transparent, rgba(0,0,0,0.8));
color: white;
z-index: 2;
}

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

.featured-title a {
color: white;
text-decoration: none;
}

.featured-description {
font-size: 0.9rem;
opacity: 0.9;
}

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

.popular-article {
background: white;
border-radius: 8px;
overflow: hidden;
transition: var(--transition);
box-shadow: var(--card-shadow);
display: flex;
max-width: 100%;
}

.popular-article:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.popular-content {
padding: 1.5rem;
flex: 1;
width: 100%;
box-sizing: border-box;
}

.popular-meta {
display: flex;
color: var(--secondary-color);
font-size: 0.9rem;
margin-bottom: 1rem;
}

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

/* 使用Emoji图标替换原来的SVG图标 */
.views::before {
content: "👁️ ";
margin-right: 0.3rem;
}

/* 介绍区域样式 */
.intro-section {
background: white;
padding: 2.5rem;
border-radius: 8px;
box-shadow: var(--card-shadow);
line-height: 1.8;
}

.intro-section p {
margin-bottom: 1rem;
}

/* 友情链接样式 */
.links-section {
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: var(--card-shadow);
}

.links-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}

.link-item a {
color: var(--primary-color);
text-decoration: none;
transition: var(--transition);
display: block;
padding: 0.5rem;
border-radius: 4px;
border: 1px solid var(--light-gray);
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.link-item a:hover {
background-color: var(--primary-color);
color: white;
}

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

footer a {
color: white;
text-decoration: none;
}

/* 响应式设计 */
@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: 0.3s;
box-shadow: 0 10px 15px rgba(0,0,0,0.1);
padding: 1rem 0;
}

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

.nav-menu li {
margin: 1.5rem 0;
}

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

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

.links-grid {
grid-template-columns: repeat(3, 1fr);
}

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

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

.popular-meta {
flex-direction: column;
}

.popular-meta span {
margin-bottom: 0.5rem;
}

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

/* 确保热门文章在移动设备上正确显示 */
.popular-article {
flex-direction: column;
}

.popular-content {
padding: 1rem; /* 在小屏幕上减少内边距 */
}

.article-description {
word-wrap: break-word; /* 确保长单词可以换行 */
overflow-wrap: break-word;
}
}

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

.links-grid {
grid-template-columns: 1fr;
}
}