/* 基础样式设置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #272727;
color: #e0e0e0;
line-height: 1.6;
padding: 0;
margin: 0;
}

a {
color: #4dabf7;
text-decoration: none;
transition: color 0.3s ease;
}

a:hover {
color: #339af0;
}

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

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

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

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

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

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

.nav-links a {
color: #e0e0e0;
font-weight: 500;
}

.nav-links a:hover {
color: #4dabf7;
}

.hamburger {
display: none;
cursor: pointer;
background: none;
border: none;
color: #e0e0e0;
font-size: 1.5rem;
}

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

.section-title {
font-size: 1.8rem;
margin-bottom: 25px;
color: #f8f9fa;
position: relative;
padding-bottom: 10px;
}

.section-title::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 50px;
height: 3px;
background-color: #4dabf7;
}

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

.article-card {
background-color: #323232;
border-radius: 8px;
padding: 20px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
}

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

.article-title {
font-size: 1.3rem;
margin-bottom: 10px;
line-height: 1.4;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

.article-meta {
color: #a0a0a0;
font-size: 0.85rem;
margin-bottom: 15px;
display: flex;
align-items: center;
flex-wrap: wrap;
}

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

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

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

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

/* 推荐文章样式 */
.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: transform 0.3s ease;
}

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

.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: 20px;
width: 100%;
}

.featured-title {
font-size: 1.2rem;
color: #fff;
margin-bottom: 10px;
line-height: 1.4;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

.featured-desc {
color: #e0e0e0;
font-size: 0.9rem;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.4;
}

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

.popular-card {
background-color: #323232;
border-radius: 8px;
padding: 20px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
}

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

.popular-title {
font-size: 1.2rem;
margin-bottom: 15px;
line-height: 1.4;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

.popular-meta {
display: flex;
justify-content: space-between;
color: #a0a0a0;
font-size: 0.85rem;
margin-bottom: 15px;
flex-wrap: wrap;
}

.popular-meta-item {
display: flex;
align-items: center;
white-space: nowrap;
}

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

.views::before {
content: '👀';
}

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

/* 文字介绍样式 */
.intro-text {
background-color: #323232;
border-radius: 8px;
padding: 30px;
line-height: 1.8;
}

/* 友情链接样式 */
.friend-links {
background-color: #323232;
border-radius: 8px;
padding: 20px;
}

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

.links-list a {
background-color: #3d3d3d;
padding: 8px 15px;
border-radius: 4px;
font-size: 0.9rem;
transition: background-color 0.3s ease;
}

.links-list a:hover {
background-color: #4dabf7;
color: #fff;
}

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

footer a {
color: #a0a0a0;
}

/* 媒体查询 - 平板设备 */
@media (max-width: 1024px) {
.latest-articles,
.popular-articles {
grid-template-columns: 1fr;
}

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

.nav-links {
display: none;
flex-direction: column;
position: absolute;
top: 100%;
left: 0;
width: 100%;
background-color: #333;
padding: 15px 0;
}

.nav-links.active {
display: flex;
}

.nav-links li {
margin: 10px 0;
text-align: center;
}

.hamburger {
display: block;
}

.popular-meta {
flex-direction: column;
gap: 5px;
}

/* 优化文章卡片在平板上的显示 */
.article-card,
.popular-card {
padding: 15px;
}

.article-title,
.popular-title {
font-size: 1.2rem;
}

.article-desc,
.popular-desc {
-webkit-line-clamp: 3;
}

/* 完全隐藏友情链接板块 */
.section-title,
.intro-text,
.friend-links-section,
.copyright {
display: none !important;
}
}

/* 媒体查询 - 手机设备 */
@media (max-width: 500px) {
.featured-articles {
grid-template-columns: 1fr;
}

/* 修复最新文章和热门文章板块的溢出问题 */
.latest-articles,
.popular-articles {
width: 100%;
overflow: hidden;
gap: 15px;
}

.article-card,
.popular-card {
width: 100%;
margin: 0;
box-sizing: border-box;
padding: 12px;
}

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

/* 优化移动设备上的标题显示 */
.article-title,
.popular-title {
font-size: 1.1rem;
-webkit-line-clamp: 2;
line-height: 1.3;
}

.article-meta {
font-size: 0.8rem;
}

.article-desc,
.popular-desc {
font-size: 0.9rem;
-webkit-line-clamp: 3;
line-height: 1.4;
}

/* 调整推荐文章卡片高度 */
.featured-card {
height: 200px;
}

.featured-content {
padding: 15px;
}

.featured-title {
font-size: 1.1rem;
}

.featured-desc {
font-size: 0.85rem;
}

/* 调整区块标题 */
.section-title {
font-size: 1.5rem;
margin-bottom: 20px;
}
}