:root {
--primary-color: #0080FF;
--secondary-color: #f8f9fa;
--text-color: #333;
--light-text: #666;
--border-color: #e0e0e0;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
--bg-light: #f5f5f5;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

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

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

a:hover {
color: #0059b3;
}

/* 导航栏样式 */
.navbar {
background-color: white;
box-shadow: var(--shadow);
position: sticky;
top: 0;
z-index: 1000;
}

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

.logo {
font-size: 24px;
font-weight: bold;
color: var(--primary-color);
}

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

.nav-item {
margin-left: 30px;
}

.nav-link {
color: var(--text-color);
font-weight: 500;
padding: 10px 0;
position: relative;
}

.nav-link:hover {
color: var(--primary-color);
}

.nav-link::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background-color: var(--primary-color);
transition: width 0.3s ease;
}

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

.hamburger {
display: none;
cursor: pointer;
font-size: 24px;
}

/* 面包屑导航 */
.breadcrumb {
max-width: 1200px;
margin: 20px auto 0;
padding: 0 20px;
}

.breadcrumb-list {
display: flex;
list-style: none;
background: white;
padding: 15px 20px;
border-radius: 8px;
box-shadow: var(--shadow);
flex-wrap: wrap; /* 允许换行 */
}

.breadcrumb-item {
font-size: 14px;
color: var(--light-text);
white-space: nowrap; /* 防止单个项内换行 */
}

.breadcrumb-item:not(:last-child)::after {
content: "›";
margin: 0 10px;
color: var(--light-text);
}

.breadcrumb-item:last-child {
color: var(--primary-color);
font-weight: 500;
}

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

/* 文章详情区域 */
.article-detail {
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: var(--shadow);
padding: 30px;
word-wrap: break-word; /* 允许长单词换行 */
overflow-wrap: break-word; /* 更现代的换行方式 */
}

.article-header {
display: flex;
margin-bottom: 20px;
align-items: flex-start;
}

.article-thumbnail {
width: 100px;
height: 100px;
border-radius: 6px;
overflow: hidden;
margin-right: 20px;
flex-shrink: 0;
}

.article-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}

.article-header-info {
flex: 1;
min-width: 0; /* 防止flex项目溢出 */
}

.article-title {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
line-height: 1.3;
word-break: break-word; /* 标题换行 */
}

.article-meta {
display: flex;
color: var(--light-text);
font-size: 14px;
flex-wrap: wrap; /* 允许元信息换行 */
}

.article-meta span {
margin-right: 20px;
display: flex;
align-items: center;
white-space: nowrap; /* 单个元信息项不换行 */
}

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

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

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

.article-summary {
background: var(--bg-light);
padding: 15px;
border-radius: 6px;
margin-bottom: 25px;
font-size: 15px;
line-height: 1.5;
word-break: break-word; /* 摘要换行 */
}

.article-content {
line-height: 1.8;
margin-bottom: 30px;
word-break: break-word; /* 内容换行 */
}

.article-content h2 {
font-size: 20px;
margin: 25px 0 15px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border-color);
word-break: break-word; /* 标题换行 */
}

.article-content p {
margin-bottom: 15px;
}

.article-content pre {
background: #f5f5f5;
padding: 15px;
border-radius: 6px;
overflow-x: auto; /* 代码块水平滚动 */
margin: 15px 0;
font-size: 14px;
line-height: 1.5;
}

.article-content code {
background: #f5f5f5;
padding: 2px 6px;
border-radius: 3px;
font-size: 14px;
}

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

.article-navigation {
display: flex;
justify-content: space-between;
border-top: 1px solid var(--border-color);
padding-top: 20px;
}

.nav-item {
flex: 1;
padding: 10px;
border-radius: 6px;
transition: background 0.3s ease;
min-width: 0; /* 防止flex项目溢出 */
}

.nav-item:hover {
background: var(--bg-light);
}

.nav-item.prev {
margin-right: 10px;
text-align: left;
}

.nav-item.next {
margin-left: 10px;
text-align: right;
}

.nav-label {
font-size: 14px;
color: var(--light-text);
margin-bottom: 5px;
}

.nav-title {
font-weight: 500;
line-height: 1.4;
word-break: break-word; /* 导航标题换行 */
}

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

.sidebar-section {
background: white;
border-radius: 8px;
padding: 20px;
box-shadow: var(--shadow);
word-wrap: break-word; /* 侧边栏内容换行 */
overflow-wrap: break-word;
}

.section-title {
font-size: 18px;
margin-bottom: 15px;
padding-bottom: 8px;
border-bottom: 2px solid var(--primary-color);
display: inline-block;
}

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

.sidebar-item {
padding: 10px 0;
border-bottom: 1px solid var(--border-color);
}

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

.sidebar-link {
color: var(--text-color);
transition: color 0.3s ease;
display: block;
font-size: 14px;
line-height: 1.4;
word-break: break-word; /* 侧边栏链接换行 */
}

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

/* 底部样式 */
footer {
background: #2c3e50;
color: white;
text-align: center;
padding: 20px 0;
margin-top: 50px;
}

footer a{
color: white;
}

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

.nav-menu {
position: fixed;
left: -100%;
top: 70px;
flex-direction: column;
background-color: white;
width: 100%;
text-align: center;
transition: 0.3s;
box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
z-index: 999;
}

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

.nav-item {
margin: 0;
border-bottom: 1px solid #f0f0f0;
}

.nav-link {
display: block;
padding: 15px;
}

.container {
grid-template-columns: 2fr 1fr;
}

.copyright {
display: none;
}

.breadcrumb-list {
flex-wrap: wrap;
}

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

@media (max-width: 768px) {
.container {
grid-template-columns: 1fr;
gap: 20px;
}

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

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

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

.article-meta span {
margin-bottom: 5px;
}

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

.nav-item {
margin: 5px 0;
}

.nav-item.prev, .nav-item.next {
text-align: center;
}
}