:root {
    --primary-color: #0d6efd;
    --secondary-bg: #f8f9fa;
    --text-muted: #6c757d;
    --text-main: #2c3e50;
    --text-secondary: #5f6c7b;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
}

body {
    background-color: var(--secondary-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

/* 文章卡片样式 */
.blog-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.card-meta i {
    margin-right: 5px;
}

.card-title {
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: #212529;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 限制标题最多2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title:hover {
    color: var(--primary-color);
}

.card-text {
    color: #555;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 限制摘要最多3行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 侧边栏样式 */
.sidebar-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.category-list li {
    margin-bottom: 0.5rem;
    list-style: none;
}

.category-list a {
    text-decoration: none;
    color: #555;
    display: flex;
    justify-content: space-between;
    transition: color 0.2s;
}

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

.badge-count {
    background-color: #e9ecef;
    color: #555;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

.tag-cloud a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    background-color: #f1f3f5;
    color: #555;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tag-cloud a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* 分页样式 */
.pagination .page-link {
    border: none;
    color: #555;
    margin: 0 3px;
    border-radius: 8px !important;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
}


/* 主要内容区域 */
.main-content {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}

/* 文章头部 */
.article-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.article-meta span i {
    margin-right: 6px;
    color: var(--primary-color);
}

/* 文章内容排版 (Typography) */
.article-body {
    font-size: 1.05rem;
    color: #333;
}

.article-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.article-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #444;
}

.article-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    color: #555;
    border-radius: 0 8px 8px 0;
}

/* 代码块样式 */
.article-body pre {
    border-radius: 8px;
    margin: 1.5rem 0;
    background: #2d2d2d;
    /* Prism Tomorrow Theme BG */
}

.article-body code {
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 0.9em;
}

/* 行内代码 */
.article-body p code {
    background: #f0f0f0;
    color: #d63384;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* 标签区域 */
.article-tags {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.tag-pill {
    display: inline-block;
    padding: 6px 14px;
    background: #eef2ff;
    color: var(--primary-color);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 上一篇/下一篇导航 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-item-box {
    flex: 1;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: #555;
    transition: all 0.2s;
    position: relative;
}

.nav-item-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.1);
}

.nav-item-box.next {
    text-align: right;
    margin-left: 1rem;
}

.nav-item-box.prev {
    margin-right: 1rem;
}

.nav-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.nav-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    display: block;
}

.nav-item-box:hover .nav-title {
    color: var(--primary-color);
}

/* 右侧目录 (Sticky TOC) */
.toc-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    position: sticky;
    top: 100px;
    /* 距离顶部距离 */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.toc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-left: 10px;
    border-left: 3px solid var(--primary-color);
}

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

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    display: block;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--primary-color);
    background: #f0f7ff;
    font-weight: 500;
}

.toc-list .toc-h3 {
    padding-left: 25px;
    font-size: 0.85rem;
}