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

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

a {
text-decoration: none;
color: #FF0000;
transition: color 0.3s;
}

a:hover {
color: #cc0000;
}

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

/* 导航栏样式 */
header {
background-color: #FF0000;
padding: 15px 0;
position: sticky;
top: 0;
z-index: 1000;
}

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

.logo {
color: white;
font-size: 24px;
font-weight: bold;
}

.logo a {
color: white;
}

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

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

.nav-menu a {
color: white;
padding: 5px 10px;
border-radius: 3px;
}

.nav-menu a:hover {
background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
display: none;
color: white;
font-size: 24px;
cursor: pointer;
}

/* 内容区块通用样式 */
.section {
padding: 40px 0;
border-bottom: 1px solid #e0e0e0;
}

.section-title {
color: #FF0000;
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 2px solid #FF0000;
position: relative;
}

.section-title::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
width: 60px;
height: 2px;
background-color: #cc0000;
}

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

.latest-article {
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
transition: transform 0.3s, box-shadow 0.3s;
width: 100%;
/* 修复移动端溢出 */
overflow: hidden;
}

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

.latest-article h3 {
margin-bottom: 10px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

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

.article-meta {
color: #888;
font-size: 14px;
display: flex;
align-items: center;
}

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

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

.featured-article {
height: 250px;
background-size: cover;
background-position: center;
border-radius: 5px;
position: relative;
overflow: hidden;
display: flex;
align-items: flex-end;
transition: transform 0.3s;
}

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

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

.featured-article:hover::before {
opacity: 0.9;
}

.featured-content {
position: relative;
z-index: 1;
padding: 20px;
color: white;
width: 100%;
}

.featured-content h3 {
margin-bottom: 10px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

.featured-content p {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
width: 100%;
}

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

.popular-article {
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
transition: transform 0.3s, box-shadow 0.3s;
width: 100%;
/* 修复移动端溢出 */
overflow: hidden;
}

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

.popular-article h3 {
margin-bottom: 10px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

.popular-article p {
color: #666;
margin-bottom: 15px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
width: 100%;
}

.popular-meta {
display: flex;
justify-content: space-between;
color: #888;
font-size: 14px;
width: 100%;
}

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

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

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

/* 文字介绍样式 */
.intro {
background: white;
padding: 30px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 友情链接样式 */
.friend-links {
background: white;
padding: 30px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.friend-link {
padding: 5px 15px;
background: #f5f5f5;
border-radius: 20px;
color: #666;
transition: background 0.3s, color 0.3s;
}

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

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

footer a {
color: white;
}

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

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

.nav-menu {
position: fixed;
top: 70px;
left: -100%;
background: #FF0000;
width: 100%;
flex-direction: column;
padding: 20px;
transition: left 0.3s;
}

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

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

.menu-toggle {
display: block;
}

/* 修复移动端溢出问题 */
.latest-article,
.popular-article {
margin: 0 auto;
max-width: 100%;
}

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

@media (max-width: 768px) {
/* 平板和手机共用样式 */
.section {
padding: 30px 0;
}

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

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

/* 确保内容不溢出 */
.container {
padding: 0 10px;
}

.latest-article,
.popular-article {
padding: 15px;
}
}

@media (max-width: 500px) {
/* 手机样式 */
.featured-articles {
grid-template-columns: 1fr;
}

/* 进一步确保移动端不溢出 */
.latest-article h3,
.popular-article h3 {
font-size: 16px;
}

.latest-article p,
.popular-article p {
font-size: 14px;
}
}