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

:root {
--primary-color: #750075;
--primary-light: #a64ca6;
--text-color: #333;
--light-gray: #f5f5f5;
--medium-gray: #e0e0e0;
--white: #ffffff;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}

body {
color: var(--text-color);
line-height: 1.6;
background-color: var(--light-gray);
}

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

a:hover {
color: var(--primary-light);
}

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

/* 导航栏样式 */
header {
background-color: var(--primary-color);
color: var(--white);
padding: 15px 0;
position: sticky;
top: 0;
z-index: 100;
box-shadow: var(--shadow);
}

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

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

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

.nav-menu li {
margin-left: 25px;
}

.nav-menu a {
color: var(--white);
font-weight: 500;
}

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

.hamburger {
display: none;
flex-direction: column;
cursor: pointer;
}

.hamburger span {
width: 25px;
height: 3px;
background-color: var(--white);
margin: 2px 0;
transition: var(--transition);
}

/* 主要内容区域 - 恢复padding-top为正常值 */
main {
padding: 30px 0; /* 恢复正常值 */
}

.section {
background-color: var(--white);
border-radius: 8px;
padding: 25px;
margin-bottom: 30px;
box-shadow: var(--shadow);
}

/* 为最新文章section添加margin-top */
.latest-section {
margin-top: 30px; /* 增加导航栏与最新文章之间的间隔 */
}

.section-title {
color: var(--primary-color);
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-light);
font-size: 1.5rem;
}

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

.article-card {
transition: var(--transition);
padding: 15px;
border-radius: 6px;
border: 1px solid var(--medium-gray);
overflow: hidden; /* 防止内容溢出 */
}

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

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

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

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

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

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

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

.article-desc {
color: #555;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}

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

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

.featured-card:hover {
transform: scale(1.03);
box-shadow: var(--shadow);
}

.featured-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.featured-content {
position: absolute;
bottom: 0;
left: 0;
padding: 15px;
color: var(--white);
width: 100%;
}

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

.featured-desc {
display: none;
}

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

.popular-card {
display: flex;
flex-direction: column;
transition: var(--transition);
padding: 15px;
border-radius: 6px;
border: 1px solid var(--medium-gray);
overflow: hidden; /* 防止内容溢出 */
}

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

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

.popular-meta {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
color: #666;
font-size: 0.9rem;
}

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

.popular-meta span::before {
margin-right: 5px;
}

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

/* 文字介绍部分 */
.intro-section {
line-height: 1.8;
}

.intro-section p {
margin-bottom: 15px;
}

/* 友情链接 */
.links-section {
display: flex;
flex-wrap: wrap;
gap: 15px;
}

.links-section a {
padding: 8px 15px;
background-color: var(--light-gray);
border-radius: 4px;
transition: var(--transition);
}

.links-section a:hover {
background-color: var(--primary-color);
color: var(--white);
}

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

footer a {
color: var(--white);
}

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

.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: 20px 0;
}

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

.nav-menu li {
margin: 15px 0;
}

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

/* 在平板和手机上完全隐藏友情链接 */
.intro-section,
.links-container,
.copyright {
display: none;
}
}

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

/* 确保文章卡片在移动设备上不超出屏幕 */
.article-card,
.popular-card {
max-width: 100%;
margin: 0;
}



/* 移动端减少最新文章的上边距 */
.latest-section {
margin-top: 30px;
}
}

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

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

.popular-meta span {
margin-bottom: 5px;
}

/* 确保在移动设备上文章内容不溢出 */
.article-title,
.popular-title,
.featured-title {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}

.article-desc,
.popular-desc,
.featured-desc {
word-break: break-word;
}
}