:root {
--primary-color: #5B5B5B;
--secondary-color: #7A7A7A;
--background-color: #F5F5F5;
--text-color: #333333;
--light-gray: #E0E0E0;
--hover-color: #4A4A4A;
--card-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: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--background-color);
overflow-x: hidden; /* 防止水平滚动 */
}

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

/* 导航栏样式 */
header {
background-color: var(--primary-color);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

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

.logo a {
color: white;
text-decoration: none;
}

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

.nav-menu li {
margin-left: 1.5rem;
position: relative;
}

.nav-menu a {
color: white;
text-decoration: none;
transition: var(--transition);
padding: 0.5rem 0;
position: relative;
}

.nav-menu a::before {
content: '';
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
transform: scaleX(0);
transition: all 0.3s ease-in-out;
}

.nav-menu a:hover::before {
visibility: visible;
transform: scaleX(1);
}

.nav-menu a:hover {
color: var(--light-gray);
}

.hamburger {
display: none;
cursor: pointer;
font-size: 1.5rem;
}

/* 面包屑导航 - 修复换行问题 */
.breadcrumb {
padding: 1rem 0;
margin-bottom: 1.5rem;
display: flex;
flex-wrap: wrap;
align-items: center;
}

.breadcrumb a {
color: var(--primary-color);
text-decoration: none;
transition: var(--transition);
white-space: nowrap;
}

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

.breadcrumb span {
color: var(--secondary-color);
margin: 0 0.5rem;
white-space: nowrap;
}

/* 主内容区布局 */
.main-content {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 2rem;
margin-bottom: 2rem;
}

/* 分类标签区域 - 修复换行问题 */
.category-tags {
background: white;
padding: 1.5rem;
border-radius: 8px;
box-shadow: var(--card-shadow);
margin-bottom: 2rem;
width: 100%;
overflow: hidden;
}

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

.tag-item {
text-align: center;
}

.tag-item a {
display: block;
padding: 0.5rem;
background-color: var(--light-gray);
color: var(--primary-color);
text-decoration: none;
border-radius: 4px;
transition: var(--transition);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 0.9rem;
}

.tag-item a:hover {
background-color: var(--primary-color);
color: white;
}

/* 文章列表区域 - 修复换行问题 */
.article-list {
background: white;
padding: 1.5rem;
border-radius: 8px;
box-shadow: var(--card-shadow);
width: 100%;
overflow: hidden;
}

.article-item {
display: flex;
padding: 1.5rem 0;
border-bottom: 1px solid var(--light-gray);
transition: var(--transition);
width: 100%;
}

.article-item:hover {
background-color: rgba(0,0,0,0.02);
padding-left: 0.5rem;
padding-right: 0.5rem;
}

.article-thumbnail {
width: 150px;
height: 100px;
object-fit: cover;
border-radius: 4px;
margin-right: 1.5rem;
flex-shrink: 0;
}

.article-info {
flex: 1;
min-width: 0; /* 允许内容收缩 */
}

.article-title {
margin-bottom: 0.5rem;
word-wrap: break-word;
overflow-wrap: break-word;
}

.article-title a {
color: var(--primary-color);
text-decoration: none;
font-size: 1.2rem;
transition: var(--transition);
word-break: break-word;
}

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

.article-meta {
display: flex;
color: var(--secondary-color);
font-size: 0.9rem;
margin-bottom: 0.8rem;
flex-wrap: wrap;
}

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

/* 使用Emoji图标 */
.author::before {
content: "👤 ";
margin-right: 0.3rem;
}

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

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

.article-description {
color: var(--secondary-color);
line-height: 1.6;
word-wrap: break-word;
overflow-wrap: break-word;
}

/* 分页控件 - 修复换行问题 */
.pagination {
display: flex;
justify-content: center;
margin-top: 2rem;
flex-wrap: wrap;
gap: 0.25rem;
}

.pagination a {
display: inline-block;
padding: 0.5rem 1rem;
background-color: white;
color: var(--primary-color);
text-decoration: none;
border: 1px solid var(--light-gray);
border-radius: 4px;
transition: var(--transition);
white-space: nowrap;
}

.pagination a:hover, .pagination a.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}

/* 侧边栏样式 - 修复换行问题 */
.sidebar {
display: flex;
flex-direction: column;
gap: 2rem;
}

.sidebar-section {
background: white;
padding: 1.5rem;
border-radius: 8px;
box-shadow: var(--card-shadow);
width: 100%;
overflow: hidden;
}

.sidebar-title {
font-size: 1.2rem;
color: var(--primary-color);
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--light-gray);
word-wrap: break-word;
}

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

.sidebar-list li {
padding: 0.8rem 0;
border-bottom: 1px solid var(--light-gray);
}

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

.sidebar-list a {
color: var(--text-color);
text-decoration: none;
transition: var(--transition);
display: block;
line-height: 1.5;
word-wrap: break-word;
overflow-wrap: break-word;
}

.sidebar-list a:hover {
color: var(--primary-color);
padding-left: 0.3rem;
}

/* 页脚样式 */
footer {
background-color: var(--primary-color);
color: white;
text-align: center;
padding: 1.5rem 0;
margin-top: 3rem;
}

footer a {
color: white;
text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 1024px) {
.hamburger {
display: block;
}

.nav-menu {
position: fixed;
left: -100%;
top: 70px;
flex-direction: column;
background-color: var(--primary-color);
width: 100%;
text-align: center;
transition: 0.3s;
box-shadow: 0 10px 15px rgba(0,0,0,0.1);
padding: 1rem 0;
}

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

.nav-menu li {
margin: 1.5rem 0;
}

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

.copyright {
display: none;
}
}

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

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

.article-thumbnail {
width: 100%;
height: 200px;
margin-right: 0;
margin-bottom: 1rem;
}

.article-meta {
flex-wrap: wrap;
}
}

@media (max-width: 500px) {
.tags-grid {
grid-template-columns: repeat(2, 1fr);
}

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

.article-meta span {
margin-bottom: 0.5rem;
}

.pagination a {
padding: 0.4rem 0.8rem;
font-size: 0.9rem;
}
}