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

:root {
--primary-color: #42B9F1;
--primary-dark: #2A8BC7;
--primary-light: #7ED2FF;
--text-color: #333;
--light-text: #f5f5f5;
--bg-color: #f9f9f9;
--card-bg: #fff;
--shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
--shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
--transition: all 0.3s ease;
}

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

a {
text-decoration: none;
color: inherit;
transition: var(--transition);
}

/* 导航栏样式 */
.header {
background: var(--card-bg);
box-shadow: var(--shadow);
position: sticky;
top: 0;
z-index: 1000;
padding: 0 5%;
}

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

.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--primary-color);
display: flex;
align-items: center;
}

.logo a {
display: flex;
align-items: center;
}

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

.nav-item {
margin-left: 2rem;
position: relative;
}

.nav-link {
padding: 0.5rem 0;
position: relative;
color: var(--text-color);
font-weight: 500;
overflow: hidden;
}

/* 导航悬停特效 */
.nav-link::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: var(--primary-color);
transition: var(--transition);
}

.nav-link:hover::before {
width: 100%;
}

.nav-link::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, transparent 30%, rgba(66, 185, 241, 0.1) 50%, transparent 70%);
transform: translateX(-100%);
transition: transform 0.6s ease;
}

.nav-link:hover::after {
transform: translateX(100%);
}

.hamburger {
display: none;
cursor: pointer;
background: none;
border: none;
width: 30px;
height: 24px;
position: relative;
}

.hamburger span {
display: block;
position: absolute;
height: 3px;
width: 100%;
background: var(--primary-color);
border-radius: 3px;
opacity: 1;
left: 0;
transform: rotate(0deg);
transition: var(--transition);
}

.hamburger span:nth-child(1) {
top: 0;
}

.hamburger span:nth-child(2) {
top: 10px;
}

.hamburger span:nth-child(3) {
top: 20px;
}

.hamburger.active span:nth-child(1) {
top: 10px;
transform: rotate(135deg);
}

.hamburger.active span:nth-child(2) {
opacity: 0;
left: -30px;
}

.hamburger.active span:nth-child(3) {
top: 10px;
transform: rotate(-135deg);
}

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

.section {
margin-bottom: 3rem;
}

.section-title {
font-size: 1.5rem;
margin-bottom: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--primary-color);
color: var(--primary-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: var(--transition);
display: flex;
flex-direction: column;
height: 100%;
position: relative;
overflow: hidden;
}

.article-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
transform: scaleX(0);
transform-origin: left;
transition: transform 0.4s ease;
}

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

.article-card:hover::before {
transform: scaleX(1);
}

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

.article-title a:hover {
color: var(--primary-color);
}

.article-meta {
display: flex;
align-items: center;
margin-bottom: 1rem;
font-size: 0.9rem;
color: #666;
}

.article-meta span {
margin-right: 1rem;
display: flex;
align-items: center;
}

.article-meta span::before {
margin-right: 0.3rem;
}

.time::before {
content: '🕒';
}

.article-description {
color: #555;
flex-grow: 1;
}

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

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

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

.featured-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
transition: transform 0.5s ease;
}

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

.featured-overlay {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 1.5rem;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
color: var(--light-text);
transform: translateY(20px);
opacity: 0;
transition: var(--transition);
}

.featured-card:hover .featured-overlay {
transform: translateY(0);
opacity: 1;
}

.featured-title {
font-size: 1.1rem;
margin-bottom: 0.5rem;
line-height: 1.3;
}

.featured-title a:hover {
color: var(--primary-light);
}

.featured-description {
display: none;
}

/* 热门文章样式 */
.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: var(--transition);
display: flex;
flex-direction: column;
position: relative;
overflow: hidden;
}

.popular-card::after {
content: '';
position: absolute;
top: 0;
right: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 40px 40px 0;
border-color: transparent var(--primary-color) transparent transparent;
transition: var(--transition);
}

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

.popular-card:hover::after {
border-width: 0 50px 50px 0;
}

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

.popular-title a:hover {
color: var(--primary-color);
}

.popular-meta {
display: flex;
justify-content: space-between;
margin-bottom: 1rem;
font-size: 0.9rem;
color: #666;
}

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

.popular-meta span::before {
margin-right: 0.3rem;
}

.views::before {
content: '👁️';
}

.popular-description {
color: #555;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

/* 文字介绍样式 */
.intro {
background: var(--card-bg);
border-radius: 8px;
padding: 2rem;
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
}

.intro::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, rgba(66, 185, 241, 0.05) 0%, rgba(66, 185, 241, 0.1) 100%);
z-index: 0;
}

.intro-content {
position: relative;
z-index: 1;
}

.intro-title {
font-size: 1.5rem;
margin-bottom: 1rem;
color: var(--primary-color);
}

.intro-text {
line-height: 1.7;
color: #555;
}

/* 友情链接样式 */
.links-section {
background: var(--card-bg);
border-radius: 8px;
padding: 1.5rem;
box-shadow: var(--shadow);
}

.links-container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}

.link-item {
padding: 0.5rem 1rem;
background: rgba(66, 185, 241, 0.1);
border-radius: 4px;
transition: var(--transition);
border: 1px solid transparent;
}

.link-item:hover {
background: rgba(66, 185, 241, 0.2);
border-color: var(--primary-color);
transform: translateY(-2px);
}

/* 底部样式 */
.footer {
background: var(--card-bg);
padding: 1.5rem 5%;
text-align: center;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
margin-top: 3rem;
}

.copyright {
color: #666;
}

.copyright a {
color: var(--primary-color);
}

.copyright a:hover {
text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1024px) {
.logo {
font-size: 1.2rem;
}

.nav-menu {
position: fixed;
top: 70px;
right: -100%;
flex-direction: column;
background: var(--card-bg);
width: 80%;
max-width: 300px;
height: calc(100vh - 70px);
transition: var(--transition);
box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
padding: 2rem;
z-index: 999;
}

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

.nav-item {
margin: 0 0 1.5rem 0;
}

.hamburger {
display: block;
}

.latest-articles,
.popular-articles {
grid-template-columns: 1fr;
}

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

.intro {
display: none;
}

.links-section {
display: none;
}

.copy {
display: none;
}
}

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

.popular-meta {
flex-direction: column;
gap: 0.5rem;
}
}

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