/* 字体定义 */
@font-face {
    font-family: 'SuCaiJiShiKangKangTi';
    src: url('/static/fonts/MapleMono-NF-CN-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SuCaiJiShiKangKangTi';
    src: url('/static/fonts/MapleMono-NF-CN-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'SuCaiJiShiKangKangTi';
    src: url('/static/fonts/MapleMono-NF-CN-Light.ttf') format('truetype');
    font-weight: lighter;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'SuCaiJiShiKangKangTi';
    src: url('/static/fonts/MapleMono-NF-CN-Medium.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

}

body {
    font-family:'MapleMono NF CN', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* ===== 布局样式 ===== */
header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

nav {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航容器样式 */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo 样式 */
.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
}

.logo a:hover {
    color: #007bff;
}

/* 导航菜单样式 - 与 index.html 一致 */
.nav-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-toggle {
    background: #007bff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.nav-toggle:hover {
    background: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.nav-expand {
    position: absolute;
    top: 100%;
    right: 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    min-width: 200px;
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    z-index: 1001;
}

.nav-expand.expanded {
    display: flex;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-expand a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-expand a:hover {
    background: #007bff;
    color: white;
}

/* 响应式设计 - 移动端也使用 + 菜单 */
@media (max-width: 768px) {
    .nav-menu {
        display: flex; /* 确保在移动端显示 + 菜单 */
    }

    /* 移动端调整导航菜单样式 */
    .nav-expand {
        position: fixed;
        top: 70px;
        right: 1rem;
        left: 1rem;
        min-width: auto;
        border-radius: 8px;
    }

    .nav-expand a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 60vh;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: #666;
    border-top: 1px solid #e9ecef;
    margin-top: 3rem;
}

/* ===== GitHub 风格警告框 ===== */
.admonition {
    margin: 1.5rem 0;
    border: 1px solid;
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.admonition-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.admonition-icon {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

.admonition-content {
    padding: 1rem;
}

/* 不同类型的警告框 */
.admonition.note {
    border-color: #0969da;
    background: #ddf4ff;
}

.admonition.note .admonition-header {
    background: #b6e3ff;
    color: #0969da;
}

.admonition.tip {
    border-color: #1a7f37;
    background: #dafbe1;
}

.admonition.tip .admonition-header {
    background: #aceebb;
    color: #1a7f37;
}

.admonition.important {
    border-color: #8250df;
    background: #fbefff;
}

.admonition.important .admonition-header {
    background: #e6d9fc;
    color: #8250df;
}

.admonition.warning {
    border-color: #9a6700;
    background: #fff8c5;
}

.admonition.warning .admonition-header {
    background: #fae17d;
    color: #9a6700;
}

.admonition.caution {
    border-color: #cf222e;
    background: #ffebe9;
}

.admonition.caution .admonition-header {
    background: #ffcecb;
    color: #cf222e;
}

/* ===== 增强的 Markdown 样式 ===== */
.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #24292f;
}

/* 代码块样式增强 */
.markdown-body pre {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    margin: 1rem 0;
}

.markdown-body code {
    background: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.85em;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

/* 表格样式增强 */
.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid #d0d7de;
    padding: 6px 13px;
    text-align: left;
}

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

.markdown-body tr:nth-child(even) {
    background: #f6f8fa;
}

/* 任务列表 */
.markdown-body .task-list-item {
    list-style-type: none;
    margin-left: -1.5em;
}

.markdown-body .task-list-item-checkbox {
    margin-right: 0.5em;
}

/* 强调样式 */
.markdown-body mark {
    background: #fff8c5;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

.markdown-body ins {
    background: #dafbe1;
    text-decoration: none;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

.markdown-body del {
    background: #ffebe9;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

/* 键盘按键样式 */
.markdown-body kbd {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-bottom-color: #afb8c1;
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 #afb8c1;
    color: #24292f;
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    padding: 0.25em 0.5em;
    white-space: nowrap;
}

/* 折叠内容 */
.markdown-body details {
    margin: 1rem 0;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 0.5rem 1rem;
}

.markdown-body summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.5rem 0;
}

.markdown-body details[open] summary {
    margin-bottom: 0.5rem;
}

/* ===== 文章详情页样式 ===== */
.post-header {
    margin-bottom: 2rem;
    text-align: center;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.post-meta {
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tags {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tag {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #495057;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.post-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* ===== 首页文章列表样式 ===== */
.posts-list h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #495057;
    font-size: 2rem;
}

.post-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-items: flex-start;
}

.post-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-content-main {
    flex: 1;
    min-width: 0;
}

.post-content-main h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    line-height: 1.3;
}

.post-content-main h2 a {
    color: #495057;
    text-decoration: none;
    transition: color 0.3s;
}

.post-content-main h2 a:hover {
    color: #007bff;
}

.post-meta-main {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
    align-items: center;
}

.post-meta-main time {
    font-weight: 500;
}

.category-main {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #495057;
}

.excerpt {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tags .tag {
    background: #f8f9fa;
    color: #6c757d;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    text-decoration: none;
}

/* 封面图片样式 */
.post-image {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

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

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

/* ===== 分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
}

.pagination-prev,
.pagination-next {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: #0056b3;
}

.pagination-prev[disabled],
.pagination-next[disabled] {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    color: #6c757d;
    font-weight: 500;
    padding: 0 1rem;
}

/* ===== 分类和标签页面样式 ===== */
.categories, .tags {
    max-width: 800px;
    margin: 0 auto;
}

.categories h1, .tags h1 {
    margin-bottom: 2rem;
    text-align: center;
    color: #495057;
}

.category-item, .tag-item {
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-header, .tag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    width: 100%;
    text-align: left;
}

.category-header:hover, .tag-header:hover {
    background: #e9ecef;
}

.category-header h2, .tag-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-count {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: normal;
}

.toggle-button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.toggle-button:hover {
    background: #0056b3;
}

.category-content, .tag-content {
    background: #fff;
    transition: all 0.3s ease;
}

.posts-under-category, .posts-with-tag {
    list-style: none;
    margin: 0;
    padding: 0;
}

.posts-under-category li, .posts-with-tag li {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.posts-under-category li:hover, .posts-with-tag li:hover {
    background: #f8f9fa;
}

.posts-under-category li:last-child, .posts-with-tag li:last-child {
    border-bottom: none;
}

.posts-under-category a, .posts-with-tag a {
    color: #495057;
    text-decoration: none;
    flex-grow: 1;
    font-weight: 500;
}

.posts-under-category a:hover, .posts-with-tag a:hover {
    color: #007bff;
}

.post-date-list {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* 动画效果 */
.category-content, .tag-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.category-content.expanded, .tag-content.expanded {
    max-height: 1000px;
    opacity: 1;
}

/* ===== 404页面样式 ===== */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-content h1 {
    font-size: 6rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.error-content h2 {
    font-size: 2rem;
    color: #495057;
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.home-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.home-link:hover {
    background: #0056b3;
}

/* ===== JavaScript 分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
}

.pagination-prev,
.pagination-next {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: #0056b3;
}

.pagination-prev.disabled,
.pagination-next.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    color: #6c757d;
    font-weight: 500;
    padding: 0 1rem;
}

/* 页码选择器 */
.page-select {
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 0.9rem;
}

.page-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 加载状态 */
#posts-container {
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* 响应式分页 */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .page-select {
        order: -1;
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .pagination-prev,
    .pagination-next {
        width: 100%;
        min-width: auto;
    }
}

/* 无文章提示 */
.no-posts {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 1.1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 2rem 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-summary {
        flex-direction: column-reverse;
        gap: 1rem;
        padding: 1.5rem;
    }

    .post-image {
        width: 100%;
        height: 200px;
    }

    .post-content-main h2 {
        font-size: 1.3rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .category-header, .tag-header {
        padding: 0.75rem 1rem;
    }

    .category-header h2, .tag-header h2 {
        font-size: 1.1rem;
    }

    .posts-under-category li, .posts-with-tag li {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .post-date-list {
        align-self: flex-end;
    }

    /* 移动端警告框调整 */
    .admonition-header {
        padding: 0.5rem 0.75rem;
    }

    .admonition-content {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .post-meta-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .post-summary {
        padding: 1rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }
}
.callout {
    margin: 1rem 0;
    padding: 1rem;
    border-left: 4px solid;
    border-radius: 4px;
}

.callout-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.callout.note {
    border-color: #0969da;
    background-color: #ddf4ff;
}

.callout.warning {
    border-color: #9a6700;
    background-color: #fff8c5;
}

.callout.tip {
    border-color: #1a7f37;
    background-color: #dafbe1;
}

.callout.important {
    border-color: #8250df;
    background-color: #fbefff;
}

.callout.caution {
    border-color: #cf222e;
    background-color: #ffebe9;
}