/* 基础样式与颜色变量 */
:root {
--primary-color: #e6d4f7;
--secondary-color: #d0b8ea;
--accent-color: #8a4fbd;
--text-color: #333;
--light-text: #666;
--background: #f9f5ff;
--card-bg: #ffffff;
--shadow: 0 4px 8px rgba(138, 79, 189, 0.1);
--hover-shadow: 0 8px 16px rgba(138, 79, 189, 0.2);
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Helvetica Neue', Arial, sans-serif;
}

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

/* 导航栏样式 */
nav {
background-color: var(--primary-color);
box-shadow: var(--shadow);
position: relative;
}

.nav-container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
display: flex;
justify-content: space-between; /* Logo靠左，导航靠右 */
align-items: center;
}

.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--accent-color);
text-decoration: none;
}

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

.nav-links li {
margin-left: 2rem;
}

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

.nav-links a:hover {
color: var(--accent-color);
}

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

.hamburger span {
height: 3px;
width: 25px;
background: var(--accent-color);
margin-bottom: 4px;
border-radius: 5px;
transition: all 0.3s;
}

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

section {
margin-bottom: 3rem;
}

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

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

.article-card {
background: var(--card-bg);
border-radius: 8px;
padding: 1.5rem;
box-shadow: var(--shadow);
transition: all 0.3s ease;
cursor: pointer;
}

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

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

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

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

.article-meta::before {
content: "📅";
margin-right: 5px;
}

.article-desc {
color: var(--text-color);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}

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

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

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

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

.featured-bg {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
}

.featured-content {
position: absolute;
bottom: 0;
left: 0;
padding: 1rem;
z-index: 2;
color: white;
width: 100%;
}

.featured-title {
margin-bottom: 0.5rem;
font-weight: normal;
}

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

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

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

.popular-card {
background: var(--card-bg);
border-radius: 8px;
padding: 1.5rem;
box-shadow: var(--shadow);
transition: all 0.3s ease;
cursor: pointer;
}

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

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

.popular-title a {
color: var(--accent-color);
text-decoration: none;
}

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

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

.popular-date::before {
content: "📅";
margin-right: 5px;
}

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

.popular-views::before {
content: "👀";
margin-right: 5px;
}

.popular-desc {
color: var(--text-color);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

/* 文字介绍区域 */
.intro-section {
background: var(--card-bg);
border-radius: 8px;
padding: 2rem;
box-shadow: var(--shadow);
line-height: 1.8;
}

/* 友情链接区域 */
.friend-links {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}

.friend-links a {
color: var(--accent-color);
text-decoration: none;
padding: 0.5rem 1rem;
background: var(--primary-color);
border-radius: 20px;
font-size: 0.9rem;
transition: background 0.3s;
}

.friend-links a:hover {
background: var(--secondary-color);
}

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

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

/* 平板和手机导航折叠 */
.hamburger {
display: flex;
}

.nav-links {
position: absolute;
top: 100%;
left: 0;
width: 100%;
background: var(--primary-color);
flex-direction: column;
padding: 1rem 0;
box-shadow: var(--shadow);
transform: translateY(-10px);
opacity: 0;
visibility: hidden;
transition: all 0.3s;
z-index: 100;
}

.nav-links.active {
transform: translateY(0);
opacity: 1;
visibility: visible;
}

.nav-links li {
margin: 0;
padding: 0.8rem 5%;
width: 100%;
text-align: center;
}

/* 友情链接在平板视图下隐藏 */
.copyright,
.friend-links-section {
display: none;
}
}

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

/* 新增：移动端宽度500px以上时，推荐文章显示2列 */
@media (min-width: 500px) and (max-width: 768px) {
.featured-articles {
grid-template-columns: repeat(2, 1fr);
}
}

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

@media (max-width: 480px) {
/* 手机特定样式 */
.container {
padding: 0 0.5rem;
}

.article-card,
.popular-card {
padding: 1rem;
}

.featured-card {
height: 200px;
}

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

.popular-date {
margin-bottom: 0.5rem;
}
}