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

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

a {
text-decoration: none;
color: #0000C6;
transition: color 0.3s ease;
}

a:hover {
color: #00008B;
}

/* 容器样式 */
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}

/* 导航栏样式 */
.navbar {
background-color: #0000C6;
padding: 15px 0;
position: relative;
}

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

.logo {
color: white;
font-size: 1.5rem;
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;
}

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

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

.hamburger span {
height: 3px;
width: 25px;
background: white;
margin-bottom: 5px;
border-radius: 5px;
}

/* 文章卡片通用样式 */
.section {
padding: 40px 0;
}

.section-title {
font-size: 1.8rem;
margin-bottom: 30px;
color: #0000C6;
text-align: center;
}

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

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

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

.latest-article {
padding: 20px;
}

.latest-article h3 {
font-size: 1.2rem;
margin-bottom: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.latest-article p {
color: #666;
margin-bottom: 10px;
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;
background-size: cover;
background-position: center;
position: relative;
display: flex;
align-items: flex-end;
}

.featured-content {
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 15px;
width: 100%;
}

.featured-content h3 {
font-size: 1.1rem;
margin-bottom: 8px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.featured-content p {
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: 30px;
}

.popular-article {
padding: 20px;
}

.popular-article h3 {
font-size: 1.2rem;
margin-bottom: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.popular-article p {
color: #666;
margin-bottom: 10px;
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.9rem;
}

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

.popular-meta .views::before {
content: "👀 ";
}

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

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

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

.friend-link {
padding: 8px 15px;
background: #f0f0f0;
border-radius: 4px;
transition: background 0.3s ease;
}

.friend-link:hover {
background: #e0e0e0;
}

/* 底部样式 */
footer {
background: #0000C6;
color: white;
text-align: center;
padding: 20px 0;
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: absolute;
top: 100%;
left: 0;
width: 100%;
background: #0000C6;
flex-direction: column;
align-items: center;
padding: 20px 0;
clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
transition: clip-path 0.4s ease;
}

.nav-menu.active {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

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

.hamburger {
display: flex;
}

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

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

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

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