@charset "UTF-8";

/* GitHub风格基础样式 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #24292e;
    background-color: #ffffff;
}

a {
    color: #0366d6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus {
    outline: none;
}

/* Header */
.site-header {
    background-color: #112e45;
    border-bottom: 1px solid #e1e4e8;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title {
    font-size: 21px;
    font-weight: 600;
    color: #a6bed6;
    text-decoration: none;
}

.site-title:hover {
    text-decoration: none;
    color: #a6bed6;
}

.site-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-link {
    color: #a6bed6;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    color: #24292e;
    background-color: #e1e4e8;
    text-decoration: none;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid #a6bed6;
    color: #a6bed6;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background-color: rgba(166, 190, 214, 0.1);
    border-color: #a6bed6;
}

.mobile-menu-icon {
    font-size: 20px;
    line-height: 1;
    display: block;
}

/* 移动端遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Page Content */
.page-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

@media (max-width: 1200px) {
    .page-content {
        padding: 24px 20px;
        gap: 24px;
    }
}

.content-wrapper {
    display: flex;
    flex-direction: row;
    gap: 32px;
    width: 100%;
    position: relative; /* 为按钮定位提供参考 */
    overflow: visible; /* 确保按钮不被隐藏 */
}

/* 确保 sidebar 在左侧，main-content 在右侧 */
.content-wrapper > .sidebar {
    order: 1;
}

.content-wrapper > .main-content {
    order: 2;
    flex: 1;
}

/* Sidebar - 左侧 */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden; /* 取消左右滑动功能 */
    transition: width 0.3s ease, margin 0.3s ease;
    align-self: flex-start;
}

/* 当 TOC 到达顶部时，sidebar 固定 */
.sidebar.toc-fixed {
    position: sticky;
    top: 80px;
}

/* Sidebar 切换按钮 */
.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -16px;
    width: 32px;
    height: 32px;
    border: 1px solid #e1e4e8;
    background-color: #ffffff;
    color: #586069;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 30; /* 提高层级，确保始终可见 */
    padding: 0;
    outline: none;
    font-weight: 300;
    pointer-events: auto; /* 确保始终可点击 */
}

.sidebar-toggle:hover {
    background-color: #f6f8fa;
    border-color: #d1d5da;
    color: #24292e;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle-icon {
    display: block;
    transition: transform 0.3s ease;
}

/* Sidebar 收起状态 */
.sidebar.collapsed {
    width: 0;
    margin-right: 0;
    overflow: visible; /* 确保按钮可见 */
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 收起时按钮仍然可见且可点击 */
.sidebar.collapsed .sidebar-toggle {
    right: -12px;
    background-color: #f6f8fa;
    border-color: #d1d5da;
    z-index: 30; /* 确保在最上层 */
    pointer-events: auto; /* 确保可点击 */
}

.sidebar.collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

/* Sidebar 内容动画 */
.sidebar-content {
    background-color: #f6f8fa;
    border: none;
    border-radius: 6px;
    padding: 20px;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateX(0);
    overflow-x: hidden; /* 取消内容左右滑动 */
    width: 100%;
}

/* Page 页面时，sidebar 正常滚动 */
.sidebar.page-mode {
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden; /* 取消左右滑动 */
}

.sidebar-section {
    margin-bottom: 24px;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                margin 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section:not(:first-child) {
    padding-top: 24px;
    border-top: 1px solid #e1e4e8;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                margin 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                border-top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Post 页面滚动时，隐藏除 author-section 和 TOC 外的其他 section */
.sidebar.scrolled .sidebar-section:not(.author-section):not(.post-toc) {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
    pointer-events: none;
}

/* 确保 author-section 和 TOC 始终可见 */
.sidebar.scrolled .sidebar-section.author-section,
.sidebar.scrolled .sidebar-section.post-toc {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    margin-bottom: 24px;
    pointer-events: auto;
}

.sidebar.scrolled .sidebar-section.post-toc {
    margin-top: 0;
    padding-top: 24px;
    border-top: 1px solid #e1e4e8; /* 保留分割线 */
}

/* 滚动时，TOC 保持 sticky 定位 */
.sidebar.scrolled .post-toc {
    position: sticky;
    top: 20px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #24292e;
    margin-bottom: 12px;
}

/* Author Section */
.author-section {
    text-align: center;
}

.author-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: block;
    border: 2px solid #e1e4e8;
}

.author-name {
    font-size: 18px;
    font-weight: 600;
    color: #24292e;
    margin-bottom: 8px;
}

.author-bio {
    font-size: 14px;
    color: #586069;
    margin: 0 0 16px;
    line-height: 1.5;
}

.author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.social-link {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    color: #586069;
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 3px;
    transition: all 0.2s;
}

.social-link:hover {
    color: #0366d6;
    border-color: #0366d6;
    text-decoration: none;
    background-color: #f1f8ff;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list > li {
    margin-bottom: 8px;
}

.category-link {
    display: block;
    padding: 4px 8px;
    color: #586069;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.2s;
}

.category-link:hover {
    color: #0366d6;
    background-color: #f1f8ff;
    text-decoration: none;
}

.category-count {
    color: #586069;
    font-size: 12px;
}

.category-children {
    list-style: none;
    padding-left: 16px;
    margin-top: 4px;
}

.category-children li {
    margin-bottom: 4px;
}

.category-children a {
    font-size: 13px;
    color: #586069;
}

.category-children a:hover {
    color: #0366d6;
}

/* Link List */
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-item {
    display: block;
    padding: 6px 8px;
    color: #586069;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.2s;
}

.link-item:hover {
    color: #0366d6;
    background-color: #f1f8ff;
    text-decoration: none;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
}

/* Post */
.post {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 32px;
}

.post-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e4e8;
}

.post-title {
    font-size: 32px;
    font-weight: 600;
    color: #24292e;
    margin: 0 0 8px;
    line-height: 1.25;
}

.post-meta {
    font-size: 14px;
    color: #586069;
}

.post-meta time {
    color: #586069;
}

.post-content {
    color: #24292e;
    line-height: 1.7;
}

/* Markdown Body - GitHub风格 */
.markdown-body {
    font-size: 16px;
    line-height: 1.7;
    word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #24292e;
}

.markdown-body h1 {
    font-size: 32px;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eaecef;
}

.markdown-body h2 {
    font-size: 24px;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eaecef;
}

.markdown-body h3 {
    font-size: 20px;
}

.markdown-body h4 {
    font-size: 16px;
}

.markdown-body h5 {
    font-size: 14px;
}

.markdown-body h6 {
    font-size: 12px;
    color: #586069;
}

.markdown-body p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
    margin-top: 0;
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-body li {
    margin-bottom: 0.25em;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.markdown-body pre code {
    display: inline;
    max-width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 16px 0;
}

.markdown-body table {
    border-spacing: 0;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-body table th {
    font-weight: 600;
    background-color: #f6f8fa;
}

.markdown-body table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

.markdown-body a {
    color: #0366d6;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* Home Page */
.home {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 32px;
}

.page-heading {
    font-size: 32px;
    font-weight: 600;
    color: #24292e;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e4e8;
}

.rss-link {
    float: right;
    padding: 4px 12px;
    font-size: 12px;
    color: #586069;
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
}

.rss-link:hover {
    color: #0366d6;
    border-color: #0366d6;
    background-color: #f1f8ff;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-item {
    padding: 24px 0;
    border-bottom: 1px solid #e1e4e8;
    /* height: 200px;  固定高度，长方形展示 */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

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

.post-item-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.post-link {
    color: #0e64b9;
    text-decoration: none;
    flex: 1;
}

.post-link:hover {
    text-decoration: underline;
}

/* 文章摘要包装器 - 用于文字和图片的左右布局，按黄金比例分割 */
.post-excerpt-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 8px;
}

.post-excerpt {
    color: #586069;
    font-size: 14px;
    line-height: 1.6;
    width: 61.8%; /* 黄金比例：文字部分占 61.8% */
    min-width: 0; /* 防止 flex 子元素溢出 */
    overflow: hidden; /* 超出部分隐藏 */
    display: -webkit-box;
    -webkit-line-clamp: 5; /* 最多显示 5 行 */
    line-clamp: 5; /* 标准属性 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    /* 重置内部元素样式，避免字体重复 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 重置 post-excerpt 内部所有元素的字体和样式，避免重复和冲突 */
.post-excerpt * {
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #586069 !important;
}

.post-excerpt p {
    margin: 0.5em 0 !important;
    padding: 0;
}

.post-excerpt p:first-child {
    margin-top: 0 !important;
}

.post-excerpt p:last-child {
    margin-bottom: 0 !important;
}

.post-excerpt ul,
.post-excerpt ol {
    margin: 0.5em 0 !important;
    padding-left: 1.5em !important;
}

.post-excerpt li {
    margin: 0.25em 0 !important;
    padding: 0;
}

/* 文章缩略图 - 黄金比例：图片部分占 38.2% */
.post-thumbnail {
    flex-shrink: 0;
    width: 38.2%; /* 黄金比例：图片部分占 38.2% */
    min-height: 150px; /* 最小高度 */
    max-height: 200px; /* 最大高度 */
    overflow: hidden;
    border-radius: 6px;
    background-color: #f6f8fa;
    aspect-ratio: 1; /* 保持正方形比例 */
}

.post-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-thumbnail-img:hover {
    transform: scale(1.05);
}

/* 如果没有图片，post-excerpt-wrapper 仍然保持正常布局 */
.post-excerpt-wrapper:not(:has(.post-thumbnail)) {
    display: block;
}

.post-excerpt-wrapper:not(:has(.post-thumbnail)) .post-excerpt {
    margin-top: 0;
    width: 100%;
    -webkit-line-clamp: 8; /* 没有图片时显示更多行 */
    line-clamp: 8; /* 标准属性 */
}

.post-excerpt code {
    background-color: rgba(27, 31, 35, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

/* 摘要中的标题保持正常大小，避免过于突兀 */
.post-excerpt h1,
.post-excerpt h2,
.post-excerpt h3,
.post-excerpt h4,
.post-excerpt h5,
.post-excerpt h6 {
    font-size: 14px !important;
    font-weight: 600;
    margin: 0.5em 0;
    line-height: 1.4;
    color: #586069 !important;
    border: none;
    padding: 0;
    font-family: inherit;
}

/* 重置摘要中的段落和其他元素 */
.post-excerpt p {
    margin: 0.5em 0;
    font-size: 14px;
    line-height: 1.6;
    color: #586069;
}

.post-excerpt p:first-child {
    margin-top: 0;
}

.post-excerpt p:last-child {
    margin-bottom: 0;
}

.post-excerpt strong,
.post-excerpt b {
    font-weight: 600;
    font-size: 14px;
}

.post-excerpt em,
.post-excerpt i {
    font-style: italic;
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e1e4e8;
}

.pagination-link {
    padding: 8px 16px;
    color: #0366d6;
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-link:hover {
    background-color: #f6f8fa;
    border-color: #0366d6;
    text-decoration: none;
}

.pagination-link.disabled {
    color: #586069;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Archives */
.archive-year {
    font-size: 24px;
    font-weight: 600;
    color: #24292e;
    margin: 32px 0 16px;
    padding-top: 24px;
    border-top: 1px solid #e1e4e8;
}

.archive-year:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.archive-item {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.archive-date {
    color: #586069;
    font-size: 14px;
    min-width: 100px;
}

.archive-link {
    color: #0e64b9;
    text-decoration: none;
}

.archive-link:hover {
    text-decoration: underline;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 80px 32px;
}

.error-title {
    font-size: 72px;
    font-weight: 600;
    color: #24292e;
    margin: 0 0 16px;
}

.error-message {
    font-size: 20px;
    color: #586069;
    margin: 0 0 24px;
}

.error-link {
    display: inline-block;
    padding: 8px 16px;
    color: #0366d6;
    border: 1px solid #0366d6;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.error-link:hover {
    background-color: #0366d6;
    color: #ffffff;
    text-decoration: none;
}

/* Comments */
.post-comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e1e4e8;
}

/* TOC */
.post-toc.hide {
    display: none;
}

.post-toc {
    display: block;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 50;
    align-self: flex-start;
    background-color: #f6f8fa;
    margin-top: 0;
    margin-bottom: 0;
}

/* TOC 滚动条样式优化 */
.post-toc::-webkit-scrollbar {
    width: 6px;
}

.post-toc::-webkit-scrollbar-track {
    background: transparent;
}

.post-toc::-webkit-scrollbar-thumb {
    background: #d1d5da;
    border-radius: 3px;
}

.post-toc::-webkit-scrollbar-thumb:hover {
    background: #a8b0b8;
}

.post-toc:not(.hide) {
    display: block;
}

.toc-content ul {
    list-style: none;
    padding-left: 16px;
    margin: 0;
}

.toc-content li {
    margin-bottom: 4px;
}

.toc-content a {
    font-size: 13px;
    color: #586069;
    display: block;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.toc-content a:hover {
    color: #0366d6;
    background-color: #f1f8ff;
    text-decoration: none;
}

/* Footer */
.site-footer {
    background-color: #f6f8fa;
    border-top: 1px solid #e1e4e8;
    padding: 24px 0;
    margin-top: 32px;
}

.footer-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.footer-wrapper p {
    margin: 0;
    color: #586069;
    font-size: 14px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e1e4e8;
    border-radius: 50%;
    color: #586069;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0;
    outline: none;
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: #ffffff;
    border-color: #d1d5da;
    color: #24292e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.back-to-top svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

/* Utility */
.hide {
    display: none;
}

/* 隐藏 SelectAllize 提示 */
.util-notify1 {
    display: none !important;
}

/* Responsive - 窄屏和移动端优化 */
@media (max-width: 1024px) {
    .page-content {
        flex-direction: column;
        padding: 24px 20px;
        gap: 0;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 0;
    }

    /* 移动端：sidebar 在上，main-content 在下 */
    .content-wrapper > .sidebar {
        order: 1;
        width: 100%;
        position: fixed;
        max-height: none;
        display: none; /* 默认隐藏，通过 mobile-open 类显示 */
    }

    .sidebar.mobile-open {
        display: block;
    }

    .content-wrapper > .main-content {
        order: 2;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-x: hidden; /* 取消左右滑动 */
    }

    .sidebar-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    .sidebar-section {
        margin-bottom: 0;
    }

    .sidebar-section:not(:first-child) {
        padding-top: 0;
        border-top: none;
        border-left: 1px solid #e1e4e8;
        padding-left: 20px;
    }

    .sidebar-section:first-child {
        grid-column: 1 / -1;
        border-bottom: 1px solid #e1e4e8;
        padding-bottom: 20px;
    }

    /* 移动端：TOC 不需要 sticky，正常显示 */
    .post-toc {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    /* 移动端：禁用滚动隐藏功能，所有 section 始终显示 */
    .sidebar.scrolled .sidebar-section:not(.author-section):not(.post-toc) {
        opacity: 1;
        transform: translateY(0);
        max-height: none;
        margin-bottom: 24px;
        padding-top: 24px;
        padding-bottom: 0;
        border-top: 1px solid #e1e4e8;
        pointer-events: auto;
    }

    .sidebar.scrolled .sidebar-section:not(:first-child):not(.author-section):not(.post-toc) {
        border-top: 1px solid #e1e4e8;
    }

    /* 移动端：显示菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 移动端：隐藏切换按钮 */
    .sidebar-toggle {
        display: none;
    }

    /* 移动端：sidebar 默认收起 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        background-color: #f6f8fa;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        margin: 0;
        padding: 0;
        padding-top: 60px; /* 为header留出空间，适当保留空隙 */
    }

    /* 移动端：sidebar 展开状态 */
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* 移动端：sidebar 内容样式调整 */
    .sidebar-content {
        display: block;
        grid-template-columns: none;
        gap: 0;
        padding: 20px;
        height: calc(100% - 60px); /* 减去顶部padding */
        overflow-y: auto;
        margin: 0;
        box-sizing: border-box;
    }

    .sidebar-section {
        margin-bottom: 24px;
    }

    .sidebar-section:not(:first-child) {
        padding-top: 24px;
        border-top: 1px solid #e1e4e8;
        border-left: none;
        padding-left: 0;
    }

    .sidebar-section:first-child {
        grid-column: auto;
        border-bottom: none;
        padding-bottom: 0;
    }

    /* 移动端 post 页面：只显示 author-section 和 TOC，隐藏其他 section */
    .sidebar.mobile-open.mobile-post .sidebar-section:not(.author-section):not(.post-toc) {
        display: none;
    }

    /* 移动端 post 页面：确保 author-section 和 TOC 显示 */
    .sidebar.mobile-open.mobile-post .sidebar-section.author-section,
    .sidebar.mobile-open.mobile-post .sidebar-section.post-toc {
        display: block;
    }

    /* 移动端 post 页面：调整 TOC 的样式 */
    .sidebar.mobile-open.mobile-post .sidebar-section.post-toc {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    /* 移动端 post 页面：调整 author-section 后的第一个可见 section 的样式 */
    .sidebar.mobile-open.mobile-post .sidebar-section.post-toc:not(:first-child) {
        padding-top: 24px;
        border-top: 1px solid #e1e4e8;
    }

    /* 移动端：调整回到顶部按钮位置 */
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 40px;
        height: 40px;
    }

    .post {
        padding: 24px;
    }

    .home {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .footer-wrapper {
        padding: 0 16px;
    }

    .header-wrapper {
        flex-direction: row;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .site-title {
        font-size: 18px;
        flex-shrink: 0;
    }

    .site-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
    }

    .nav-link {
        font-size: 13px;
        padding: 4px 8px;
        white-space: nowrap;
    }

    .page-content {
        padding: 16px 12px;
        gap: 0;
    }

    .content-wrapper {
        gap: 0;
        flex-direction: column;
    }

    /* 移动端：确保 sidebar 在上 */
    .content-wrapper > .sidebar {
        order: 1;
        display: none; /* 默认隐藏，通过 mobile-open 类显示 */
    }

    .sidebar.mobile-open {
        display: block;
    }

    .content-wrapper > .main-content {
        order: 2;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* 移动端：显示菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 移动端：隐藏切换按钮 */
    .sidebar-toggle {
        display: none;
    }

    /* 移动端：sidebar 使用固定定位，默认收起 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        background-color: #f6f8fa;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        margin: 0;
        padding: 0;
        padding-top: 60px; /* 为header留出空间，适当保留空隙 */
    }

    /* 移动端：sidebar 展开状态 */
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* 移动端：sidebar 内容样式调整 */
    .sidebar-content {
        height: calc(100% - 60px); /* 减去顶部padding */
    }

    /* 移动端：调整回到顶部按钮位置 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .post {
        padding: 16px;
        border-radius: 4px;
    }

    .post-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .post-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .home {
        padding: 16px;
        border-radius: 4px;
    }

    .page-heading {
        font-size: 24px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .sidebar-content {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    .sidebar-section:not(:first-child) {
        border-left: none;
        border-top: 1px solid #e1e4e8;
        padding-left: 0;
        padding-top: 16px;
        margin-top: 0;
    }

    .sidebar-section:first-child {
        padding-bottom: 16px;
    }

    .author-avatar {
        width: 100px;
        height: 100px;
    }

    .author-name {
        font-size: 16px;
    }

    .author-bio {
        font-size: 13px;
    }

    .post-item {
        padding: 16px 0;
        height: auto; /* 移动端取消固定高度 */
        min-height: 150px;
    }

    .post-item-title {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-size: 18px;
    }

    .post-meta {
        font-size: 13px;
        margin-left: auto; /* 确保日期靠右 */
        flex-shrink: 0; /* 防止日期被压缩 */
    }

    .post-excerpt-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .post-excerpt {
        font-size: 13px;
        width: 100%;
        -webkit-line-clamp: 4; /* 移动端显示 4 行 */
        line-clamp: 4; /* 标准属性 */
    }

    .post-excerpt * {
        font-size: 13px !important;
    }

    .post-thumbnail {
        width: 100%;
        min-height: 180px;
        max-height: 200px;
        aspect-ratio: 16/9; /* 移动端使用横向比例 */
        align-self: center;
    }

    .pagination {
        margin-top: 24px;
        padding-top: 16px;
        flex-direction: column;
        gap: 12px;
    }

    .pagination-link {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
    }

    .archive-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .archive-date {
        min-width: auto;
        font-size: 12px;
    }

    .markdown-body {
        font-size: 15px;
    }

    .markdown-body h1 {
        font-size: 24px;
    }

    .markdown-body h2 {
        font-size: 20px;
    }

    .markdown-body h3 {
        font-size: 18px;
    }

    .markdown-body pre {
        padding: 12px;
        font-size: 13px;
        overflow-x: auto;
    }

    .error-page {
        padding: 40px 16px;
    }

    .error-title {
        font-size: 48px;
    }

    .error-message {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .footer-wrapper {
        padding: 0 12px;
    }

    .header-wrapper {
        padding: 0 12px;
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .site-title {
        font-size: 16px;
        flex-shrink: 0;
    }

    .site-nav {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .nav-link {
        font-size: 12px;
        padding: 3px 6px;
        white-space: nowrap;
    }

    .page-content {
        padding: 12px 8px;
        gap: 0;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 0;
    }

    /* 小屏幕：确保 sidebar 在上 */
    .content-wrapper > .sidebar {
        order: 1;
        display: none; /* 默认隐藏，通过 mobile-open 类显示 */
    }

    .sidebar.mobile-open {
        display: block;
    }

    .content-wrapper > .main-content {
        order: 2;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* 小屏幕：显示菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        width: 32px;
        height: 32px;
    }

    /* 小屏幕：隐藏切换按钮 */
    .sidebar-toggle {
        display: none;
    }

    /* 小屏幕：sidebar 使用固定定位，默认收起 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        max-width: 80vw;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        background-color: #f6f8fa;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        margin: 0;
        padding: 0;
        padding-top: 60px; /* 为header留出空间，适当保留空隙 */
    }

    /* 小屏幕：sidebar 展开状态 */
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* 小屏幕：sidebar 内容样式调整 */
    .sidebar-content {
        height: calc(100% - 60px); /* 减去顶部padding */
    }

    /* 小屏幕：调整回到顶部按钮位置 */
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }

    .back-to-top svg {
        width: 14px;
        height: 14px;
    }

    .post {
        padding: 12px;
    }

    .post-title {
        font-size: 20px;
    }

    .home {
        padding: 12px;
    }

    .page-heading {
        font-size: 20px;
    }

    .sidebar-content {
        padding: 12px;
    }

    .author-avatar {
        width: 80px;
        height: 80px;
    }

    .post-item-title {
        font-size: 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .post-meta {
        margin-left: auto; /* 确保日期靠右 */
    }

    .post-thumbnail {
        height: 180px;
    }

    .markdown-body {
        font-size: 14px;
    }

    .markdown-body h1 {
        font-size: 20px;
    }

    .markdown-body h2 {
        font-size: 18px;
    }

    .markdown-body h3 {
        font-size: 16px;
    }
}

