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

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面头部 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    color: #1a73e8;
    font-size: 24px;
    font-weight: 700;
}

.logo a {
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: #1a73e8;
    color: #fff;
}

/* 面包屑导航 */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin: 0 8px;
    color: #6c757d;
}

.breadcrumb a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb li:last-child span {
    color: #6c757d;
}

/* 主要内容区域 */
.main-content {
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* 文章内容 */
.article-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.article-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-meta a {
    color: #1a73e8;
    text-decoration: none;
}

.article-meta a:hover {
    text-decoration: underline;
}

/* 文章正文 */
.article-body {
    font-size: 16px;
    line-height: 1.8;
}

.article-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    border-left: 4px solid #1a73e8;
}

.article-body h2 {
    font-size: 26px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a73e8;
}

.article-body h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 25px 0 15px 0;
    position: relative;
}

.article-body h3::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #1a73e8;
    border-radius: 2px;
}

.article-body p {
    margin-bottom: 18px;
    text-align: justify;
}

.article-body strong {
    font-weight: 600;
    color: #1a1a1a;
}

/* 文章标签 */
.article-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.tags-label {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 5px 5px 0;
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 15px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #1a73e8;
    color: #fff;
}

/* 上下篇文章导航 */
.article-nav {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.nav-item {
    margin-bottom: 15px;
}

.nav-label {
    font-weight: 600;
    color: #666;
    margin-right: 8px;
}

.nav-item a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.nav-item a:hover {
    text-decoration: underline;
}

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

.widget {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a73e8;
}

/* 文章目录 */
.toc {
    position: sticky;
    top: 120px;
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    color: #333;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.toc a:hover,
.toc a.active {
    background-color: #1a73e8;
    color: #fff;
}

/* 相关文章和热门文章 */
.related-list,
.popular-list {
    list-style: none;
}

.related-list li,
.popular-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.related-list li:last-child,
.popular-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.related-list a,
.popular-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.related-list a:hover,
.popular-list a:hover {
    color: #1a73e8;
}

/* 页面底部 */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

.footer-bottom a {
    color: #3498db;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 26px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .breadcrumb ol {
        flex-wrap: wrap;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .toc {
        position: static;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 22px;
    }
    
    .article-body {
        font-size: 15px;
    }
    
    .article-body h2 {
        font-size: 22px;
    }
    
    .article-body h3 {
        font-size: 18px;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 打印样式 */
@media print {
    .site-header,
    .breadcrumb,
    .sidebar,
    .site-footer,
    .article-nav {
        display: none;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .article-content {
        box-shadow: none;
        padding: 0;
    }
    
    body {
        background-color: #fff;
    }
}