/* 基础样式与颜色变量 */
:root {
--primary-color: #2e7d32; /* 主绿色 */
--secondary-color: #4caf50; /* 次绿色 */
--light-green: #e8f5e9; /* 浅绿色背景 */
--text-color: #333; /* 主要文字颜色 */
--light-text: #666; /* 浅色文字 */
--white: #fff; /* 白色 */
--border-radius: 8px; /* 统一圆角 */
--box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 统一阴影 */
--transition: all 0.3s ease; /* 统一过渡效果 */
--gray-bg: #f5f5f5; /* 灰色背景 */
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: #f9f9f9;
}

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

a:hover {
color: var(--secondary-color);
}

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

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

.logo {
color: var(--white);
font-size: 1.5rem;
font-weight: bold;
}

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

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

.nav-link {
color: var(--white);
font-weight: 500;
}

.nav-link:hover {
color: #a5d6a7;
}

.hamburger {
display: none;
cursor: pointer;
flex-direction: column;
justify-content: space-around;
width: 30px;
height: 21px;
}

.hamburger span {
display: block;
height: 3px;
width: 100%;
background-color: var(--white);
border-radius: 3px;
transition: var(--transition);
}

/* 主内容区域 */
.container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1rem;
display: grid;
grid-template-columns: 3fr 1fr;
gap: 2rem;
}

/* 面包屑导航 */
.breadcrumb {
grid-column: 1 / -1;
margin-bottom: 1.5rem;
font-size: 0.9rem;
color: var(--light-text);
}

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

.breadcrumb span {
color: var(--light-text);
}

/* 文章详情 */
.article-detail {
background-color: var(--white);
border-radius: var(--border-radius);
padding: 1.5rem;
box-shadow: var(--box-shadow);
margin-bottom: 2rem;
}

.article-header {
display: flex;
margin-bottom: 1.5rem;
gap: 1.2rem;
}

.article-thumb {
flex-shrink: 0;
width: 100px;
height: 100px;
border-radius: var(--border-radius);
overflow: hidden;
background-color: #f0f0f0;
background-size: cover;
background-position: center;
}

.article-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}

.article-title {
font-size: 1.8rem;
font-weight: bold;
margin-bottom: 0.8rem;
line-height: 1.3;
color: var(--primary-color);
}

.article-meta {
display: flex;
font-size: 0.9rem;
color: var(--light-text);
gap: 1.2rem;
}

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

.date::before {
content: "📅";
margin-right: 0.3rem;
}

.views::before {
content: "👁️";
margin-right: 0.3rem;
}

/* 导读部分 */
.article-intro {
background-color: var(--gray-bg);
padding: 1.2rem;
border-radius: var(--border-radius);
margin-bottom: 1.5rem;
font-style: italic;
border-left: 4px solid var(--primary-color);
}

/* 文章内容 */
.article-content {
margin-bottom: 2rem;
line-height: 1.8;
}

.article-content img {
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
}

.article-content p {
margin-bottom: 1.2rem;
}

.article-content h2 {
font-size: 1.5rem;
margin: 1.5rem 0 1rem;
color: var(--primary-color);
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--light-green);
}

.article-content h3 {
font-size: 1.3rem;
margin: 1.3rem 0 0.8rem;
color: var(--secondary-color);
}

/* 文章导航 */
.article-navigation {
display: flex;
justify-content: space-between;
gap: 1rem;
}

.nav-prev, .nav-next {
flex: 1;
padding: 1rem;
background-color: var(--light-green);
border-radius: var(--border-radius);
transition: var(--transition);
}

.nav-prev:hover, .nav-next:hover {
background-color: var(--secondary-color);
color: var(--white);
}

.nav-label {
font-size: 0.9rem;
color: var(--light-text);
margin-bottom: 0.5rem;
}

.nav-title {
font-weight: 500;
}

/* 侧边栏 */
.sidebar {
display: flex;
flex-direction: column;
gap: 2rem;
}

.sidebar-section {
background-color: var(--white);
border-radius: var(--border-radius);
padding: 1.5rem;
box-shadow: var(--box-shadow);
}

.sidebar-title {
font-size: 1.2rem;
margin-bottom: 1.2rem;
color: var(--primary-color);
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--light-green);
}

.sidebar-list {
list-style: none;
}

.sidebar-item {
padding: 0.7rem 0;
border-bottom: 1px solid #eee;
}

.sidebar-item:last-child {
border-bottom: none;
}

.sidebar-link {
color: var(--text-color);
transition: var(--transition);
font-size: 0.95rem;
}

.sidebar-link:hover {
color: var(--primary-color);
padding-left: 5px;
}

/* 底部版权信息 */
footer {
background-color: var(--primary-color);
color: var(--white);
text-align: center;
padding: 1.5rem;
margin-top: 2rem;
}

footer a{
color: var(--white);
}

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

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

.nav-menu {
position: absolute;
top: 100%;
left: 0;
width: 100%;
background-color: var(--primary-color);
flex-direction: column;
padding: 1rem 0;
clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
transition: var(--transition);
z-index: 100;
}

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

.nav-item {
margin: 0;
text-align: center;
padding: 0.5rem 0;
}
}

@media (max-width: 768px) {
/* 平板和手机样式 */
.article-header {
flex-direction: column;
}

.article-thumb {
width: 100%;
height: 200px;
align-self: center;
}

.article-title {
font-size: 1.5rem;
}

.article-meta {
flex-direction: column;
gap: 0.4rem;
}

.article-navigation {
flex-direction: column;
}
}

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

.article-detail, .sidebar-section {
padding: 1rem;
}

.article-title {
font-size: 1.3rem;
}

.article-thumb {
height: 160px;
}

.article-content h2 {
font-size: 1.3rem;
}

.article-content h3 {
font-size: 1.1rem;
}

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