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

:root {
--primary-color: #d32f2f;
--primary-dark: #b71c1c;
--primary-light: #ff6659;
--text-color: #333;
--text-light: #777;
--background: #f9f9f9;
--card-bg: #ffffff;
--border-color: #e0e0e0;
}

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

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

a:hover {
color: var(--primary-dark);
}

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

/* 导航栏样式 */
header {
background-color: var(--primary-color);
color: white;
padding: 15px 0;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 10px 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;
}

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

.nav-menu li {
margin-left: 25px;
}

.nav-menu a {
color: white;
font-weight: 500;
}

.nav-menu a:hover {
color: rgba(255, 255, 255, 0.8);
}

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

/* 面包屑导航 */
.breadcrumb {
padding: 15px 0;
font-size: 0.9rem;
color: var(--text-light);
}

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

.breadcrumb span {
margin: 0 5px;
}

/* 主内容区布局 */
.main-content {
display: grid;
grid-template-columns: 3fr 1fr;
gap: 30px;
margin: 30px 0;
}

/* 标签列表 - 修复宽度问题 */
.tag-list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 10px;
margin-bottom: 30px;
width: 100%;
}

.tag-item {
background-color: rgba(211, 47, 47, 0.1);
padding: 10px;
text-align: center;
border-radius: 3px;
transition: background-color 0.3s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.tag-item:hover {
background-color: rgba(211, 47, 47, 0.2);
}

/* 文章列表 - 修复宽度问题 */
.article-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
width: 100%;
}

.article-item {
background-color: var(--card-bg);
border-radius: 5px;
overflow: hidden;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
width: 100%;
}

.article-item:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-thumbnail {
height: 180px;
background-size: cover;
background-position: center;
width: 100%;
}

.article-info {
padding: 15px;
flex-grow: 1;
display: flex;
flex-direction: column;
width: 100%;
}

.article-title {
font-size: 1.1rem;
margin-bottom: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

.article-meta {
color: var(--text-light);
font-size: 0.85rem;
margin-bottom: 10px;
display: flex;
flex-wrap: wrap;
width: 100%;
}

.meta-item {
display: flex;
align-items: center;
margin-right: 15px;
white-space: nowrap;
}

.author::before {
content: "👤";
margin-right: 5px;
}

.date::before {
content: "📅";
margin-right: 5px;
}

.views::before {
content: "👁️";
margin-right: 5px;
}

.article-description {
color: var(--text-light);
font-size: 0.9rem;
margin-top: 10px;
flex-grow: 1;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
width: 100%;
}

/* 侧边栏 */
.sidebar {
display: flex;
flex-direction: column;
gap: 30px;
width: 100%;
}

.sidebar-section {
background-color: var(--card-bg);
border-radius: 5px;
padding: 20px;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
width: 100%;
}

.sidebar-title {
font-size: 1.2rem;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-light);
color: var(--primary-dark);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

.sidebar-list {
list-style: none;
width: 100%;
}

.sidebar-list li {
padding: 8px 0;
border-bottom: 1px solid var(--border-color);
width: 100%;
}

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

.sidebar-list a {
color: var(--text-color);
transition: color 0.3s ease;
white-space: normal;
overflow: hidden;
text-overflow: unset;
display: block;
width: 100%;
}

.sidebar-list a:hover {
color: var(--primary-color);
}

/* 分页 - 修复宽度问题 */
.pagination {
display: flex;
justify-content: center;
margin: 40px 0 20px;
flex-wrap: wrap;
width: 100%;
}

.pagination a {
text-decoration: none;
color: inherit;
}

.page-btn {
padding: 8px 15px;
margin: 5px;
background-color: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 3px;
cursor: pointer;
transition: all 0.3s ease;
white-space: nowrap;
display: inline-block;
}

.page-btn:hover {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}

.page-btn.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}

/* 页脚样式 */
footer {
background-color: var(--primary-dark);
color: white;
text-align: center;
padding: 20px 0;
margin-top: 50px;
}

footer a {
color: white;
}

footer a:hover {
color: #ffff00;
}

/* 响应式设计 */
@media (max-width: 1024px) {
.tag-list {
grid-template-columns: repeat(4, 1fr);
}

.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: 20px 0;
}

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

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

.copyright {
display: none;
}
}

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

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

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

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

.meta-item {
margin-bottom: 5px;
}
}

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

.article-list {
grid-template-columns: 1fr;
}

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

.meta-item {
margin-bottom: 5px;
}

.pagination {
justify-content: center;
}

.page-btn {
padding: 6px 10px;
font-size: 0.9rem;
}
}