/* 基础样式与颜色变量 */
: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; /* 统一过渡效果 */
}

* {
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);
}

/* 标签列表 */
.tags-section {
grid-column: 1 / -1;
background-color: var(--white);
border-radius: var(--border-radius);
padding: 1.5rem;
box-shadow: var(--box-shadow);
margin-bottom: 2rem;
}

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

.tags-container {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 0.8rem;
}

.tag {
display: block;
text-align: center;
padding: 0.6rem 0.5rem;
background-color: var(--light-green);
border-radius: 4px;
transition: var(--transition);
font-size: 0.9rem;
}

.tag:hover {
background-color: var(--secondary-color);
color: var(--white);
}

/* 文章列表 */
.articles-section {
background-color: var(--white);
border-radius: var(--border-radius);
padding: 1.5rem;
box-shadow: var(--box-shadow);
margin-bottom: 2rem;
}

.article-item {
display: flex;
padding: 1.2rem 0;
border-bottom: 1px solid #eee;
gap: 1.2rem;
}

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

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

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

.article-title {
font-size: 1.2rem;
margin-bottom: 0.8rem;
line-height: 1.4;
}

.article-desc {
color: var(--light-text);
font-size: 0.95rem;
margin-bottom: 0.8rem;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

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

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

.author::before {
content: "👤";
margin-right: 0.3rem;
}

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

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

/* 分页 */
.pagination {
display: flex;
justify-content: center;
margin-top: 2rem;
gap: 0.5rem;
}

.page-link {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: var(--light-green);
color: var(--text-color);
transition: var(--transition);
}

.page-link:hover, .page-link.active {
background-color: var(--primary-color);
color: var(--white);
}

/* 侧边栏 */
.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;
}

.tags-container {
grid-template-columns: repeat(4, 1fr);
}

.article-thumb {
width: 150px;
height: 100px;
}

/* 平板和手机导航折叠 */
.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) {
/* 平板和手机样式 */
.tags-container {
grid-template-columns: repeat(3, 1fr);
}

.article-item {
flex-direction: column;
gap: 0.8rem;
}

.article-thumb {
width: 100%;
height: 180px;
}

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

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

.tags-section, .articles-section, .sidebar-section {
padding: 1rem;
}

.section-title, .sidebar-title {
font-size: 1.3rem;
margin-bottom: 1rem;
}

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

.article-item {
padding: 1rem 0;
}

.article-thumb {
height: 160px;
}

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

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

.page-link {
width: 35px;
height: 35px;
font-size: 0.9rem;
}
}