/* 基础样式重置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Arial', sans-serif;
}

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

/* 导航栏样式 */
.navbar {
background-color: #6a0dad;
padding: 15px 5%;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 10px rgba(106, 13, 173, 0.3);
}

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

.logo {
color: white;
font-size: 1.5rem;
font-weight: bold;
text-decoration: none;
}

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

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

.nav-link {
color: white;
text-decoration: none;
font-size: 1rem;
transition: color 0.3s;
}

.nav-link:hover {
color: #d8bfd8;
}

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

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

.section {
margin-bottom: 50px;
}

.section-title {
color: #6a0dad;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #d8bfd8;
font-weight: normal;
}

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

.article-card {
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 3px 10px rgba(106, 13, 173, 0.1);
transition: transform 0.3s;
}

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

.article-content {
padding: 20px;
}

.article-title {
font-size: 1.2rem;
margin-bottom: 10px;
font-weight: normal;
}

.article-title a {
color: #6a0dad;
text-decoration: none;
}

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

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

.article-meta {
color: #888;
font-size: 0.9rem;
}

.article-meta::before {
content: "📅 ";
}

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

.featured-article {
height: 250px;
border-radius: 8px;
overflow: hidden;
position: relative;
background-size: cover;
background-position: center;
box-shadow: 0 3px 10px rgba(106, 13, 173, 0.2);
transition: all 0.3s ease;
}

.featured-article:hover {
transform: scale(1.03);
box-shadow: 0 5px 15px rgba(106, 13, 173, 0.4);
}

.featured-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(106, 13, 173, 0.8));
padding: 20px;
color: white;
}

.featured-title {
font-size: 1.1rem;
margin-bottom: 8px;
font-weight: normal;
}

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

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

.popular-article {
background: white;
border-radius: 8px;
padding: 20px;
box-shadow: 0 3px 10px rgba(106, 13, 173, 0.1);
transition: all 0.3s ease;
overflow: hidden;
position: relative;
}

.popular-article:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(106, 13, 173, 0.2);
}

.popular-article:hover::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, #8a2be2, #6a0dad);
}

.popular-title {
font-size: 1.1rem;
margin-bottom: 10px;
font-weight: normal;
}

.popular-title a {
color: #6a0dad;
text-decoration: none;
}

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

.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;
color: #888;
font-size: 0.85rem;
padding-top: 10px;
border-top: 1px solid #eee;
}

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

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

/* 文字介绍部分 */
.intro-section {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 3px 10px rgba(106, 13, 173, 0.1);
line-height: 1.8;
}

/* 友情链接部分 */
.friend-links {
background: white;
padding: 20px 30px;
border-radius: 8px;
box-shadow: 0 3px 10px rgba(106, 13, 173, 0.1);
}

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

.friend-link {
color: #6a0dad;
text-decoration: none;
font-size: 0.9rem;
padding: 5px 10px;
border: 1px solid #d8bfd8;
border-radius: 4px;
transition: all 0.2s;
}

.friend-link:hover {
background-color: #6a0dad;
color: white;
}

/* 页脚样式 */
footer {
background-color: #6a0dad;
color: white;
text-align: center;
padding: 20px;
margin-top: 50px;
}

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

/* 文本溢出处理 */
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

/* 响应式设计 */
@media (max-width: 1024px) {
/* 平板样式 */
.featured-articles {
grid-template-columns: repeat(2, 1fr);
}
			
			/* 导航栏响应式 */
.nav-menu {
position: fixed;
left: -100%;
top: 70px;
flex-direction: column;
background-color: #6a0dad;
width: 100%;
text-align: center;
transition: 0.3s;
box-shadow: 0 10px 15px rgba(106, 13, 173, 0.2);
padding: 20px 0;
}

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

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

.hamburger {
display: block;
}
}

@media (max-width: 768px) {
/* 内容响应式 */
.latest-articles,
.popular-articles {
grid-template-columns: 1fr;
}

/* 热门文章元数据在手机视图下纵列显示 */
.popular-meta {
flex-direction: column;
gap: 8px;
}

/* 平板和手机隐藏友情链接 */
.copyright,
.friend-links {
display: none;
}
}

/* 新增：屏幕宽度大于500px时推荐文章每行显示2篇 */
@media (min-width: 501px) and (max-width: 1023px) {
.featured-articles {
grid-template-columns: repeat(2, 1fr);
}
}

/* 手机视图下推荐文章每行1篇 */
@media (max-width: 500px) {
.featured-articles {
grid-template-columns: 1fr;
}
}