/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --layout-max-width: 960px;
    --layout-h-padding: 10px;
    --article-font-family: Georgia, "Times New Roman", Times, sans-serif;
    --article-font-size: 14px;
    --article-line-height: 1.8;
    --article-aux-font-size: 12px;
    --code-font-family: Consolas, Monaco, "Microsoft YaHei", "PingFang SC", "Courier New", monospace;
    --code-pad-y: 1em;
    --code-pad-x: 1em;
    --code-bg: #f5f2f0;
}

@font-face {
    font-family: "GeorgiaDigits";
    src: local("Georgia");
    unicode-range: U+0030-0039;
}

body {
    min-width: 300px;
    margin: 10px 0 10px 0;
    padding: 0 10px;
    background: #515459;
    color: #000;
    font-family: var(--article-font-family);
    font-size: 12px;
}

/* 全局统一容器 */
.page-container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    background-color: #777C7F;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
    border-radius: 6px;
    overflow: hidden;
}

a {
    border: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:link {
    color: #056905;
}

a:visited {
    color: #690;
}

a:hover {
    color: #cc3000;
    text-decoration: none;
}

a:active {
    color: #375719;
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #f60;
    outline-offset: 2px;
}

/* MathJax 数学公式样式 */
.MathJax,
.MathJax_PHTML,
.MathJax_CHTML,
.MathJax_SVG,
.MathJax_MathML {
    color: blue;
}

mjx-container[display="true"] {
    max-width: none;
    overflow: visible;
    will-change: transform;
}



/* 顶部导航条 */
.top-bar {
    background-color: transparent;
    color: #e5e8ec;
    margin: 0 var(--layout-h-padding);
    padding: 8px 6px;
    font-size: 11px;
}

.top-bar-container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 18px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slogan {
    color: #cad0d6;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: 6px;
    align-items: center;
}

.top-nav a {
    color: #f5f7fa;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.top-nav a:hover {
    color: #97bf0d;
    background-color: rgba(151, 191, 13, 0.12);
    transform: translateY(-1px);
}

.top-nav a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(151, 191, 13, 0.45);
}

.top-nav a.active {
    color: #97bf0d;
    background-color: rgba(151, 191, 13, 0.18);
}

/* 主头部区域 */
.main-header {
    background: linear-gradient(180deg, #4c5259 0%, #3c4148 100%);
    color: #fff;
    margin: 0 var(--layout-h-padding);
    padding: 16px 6px 14px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
}


.header-container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 18px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 移除未使用的品牌文字样式 */

.logo-img {
    width: 200px;
    /* height: 64px; */
    display: block;
}

.header-cat-nav {
    display: flex;
    gap: 24px;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    display: none;
    border: 1px solid #d0d0d0;
    background-color: #4c5259;
    color: #fff;
    width: 36px;
    height: 32px;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

/* 移除未使用的导航扩展样式 */

/* 分类导航 */
.category-nav {
    margin: 10px var(--layout-h-padding) 12px var(--layout-h-padding);
    padding: 10px 18px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #4c5259 0%, #3c4148 100%);
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
}

.cat-item {
    padding: 4px 8px;
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    transition: color 0.2s, transform 0.1s;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    text-align: center;
}

.cat-item:link,
.cat-item:visited {
    color: #fff;
}

.cat-item .icon-img {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
}

.cat-item .label {
    display: inline;
    font-size: 12px;
    color: #f5f7fa;
}

.cat-item:hover {
    text-decoration: none;
    color: #97bf0d;
    transform: translateY(-0.5px);
}

.cat-item:active {
    color: #97bf0d;
    text-decoration: underline;
}

.cat-item:hover .label {
    color: #eaeef2;
}

.cat-item.active {
    color: #e8ecef;
    text-decoration: none;
}

.cat-item.active .label {
    color: #ccd2d8;
}

.cat-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #cc3000;
}

.cat-item.active .label {
    color: #fff;
}

.post-meta .meta-categories a:link,
.post-meta .meta-categories a:visited,
.post-meta .meta-tags a:link,
.post-meta .meta-tags a:visited {
    color: #058c05;
}

.post-meta .meta-categories a:hover,
.post-meta .meta-tags a:hover {
    color: #cc3000;
}

/* 容器布局 */
/* 主内容区 - 作为白色背景容器 */
.main-content {
    max-width: var(--layout-max-width);
    margin: 6px var(--layout-h-padding) 6px;
    padding: 18px 6px 6px 18px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
    border: 1px solid #d5d9de;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.wrapper {
    flex: 1;
    min-width: 0;
    background-color: transparent;
    border-right: 1px dashed #d5d9df;
    padding: 0 12px 0 0;
}

/* 文章样式 */
.post {
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
    position: relative;
}

.post:last-child {
    margin-bottom: 0;
}

/* 文章头部组件 - 可复用 */
.post-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px 0;
    padding: 10px;
    /* border: 1px solid #e8e8e8; */
    border-radius: 4px;
    background-color: #f3eddc;
    --badge-height: 40px;
}

.post-date-badge {
    width: 40px;
    height: var(--badge-height);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: none;
}

.badge-day {
    background-color: #489620;
    color: #fff;
    font-family: Georgia, "Times New Roman", Times, sans-serif;
    font-size: 16px;
    font-weight: bold;
    line-height: 21px;
    text-align: center;
    height: 21px;
}

.badge-month {
    background-color: #BED53D;
    color: #fff;
    font-family: Georgia, "Times New Roman", Times, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    line-height: 19px;
    height: 19px;
}

/* 标题和元信息容器 */
.post-header-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: var(--badge-height);
    height: auto;
}

.post-title {
    font-size: 16px;
    margin: 0;
    line-height: 21px;
    font-weight: bold;
    color: #F60;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-title a:link,
.post-title a:visited {
    color: #F60;
    font-weight: bold;
    text-decoration: none;
}

.post-title a:hover {
    color: #f7800a;
    text-decoration: underline;
}

.post-meta {
    color: #999;
    font-size: var(--article-aux-font-size);
    margin: 0;
    line-height: 19px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 4px;
}

/* 文章内容区域 */
.post-body {
    clear: both;
}

/* 首页卡片中的标题样式 - 确保不会比 post-title 大 */
.post-content-wrapper .post-body h2 {
    font-size: 20px;
    color: #333;
    margin: 20px 0 5px 0;
    line-height: 1.35;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

/* 隐藏首页卡片中的锚点符号 */
.post-content-wrapper .post-body .section-anchor {
    display: none;
}

.post-content-wrapper .post-body h3 {
    font-size: 18px;
    color: #333;
    margin: 20px 0 5px 0;
    line-height: 1.35;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.post-content-wrapper .post-body h4 {
    font-size: 16px;
    color: #333;
    margin: 20px 0 5px 0;
    line-height: 1.35;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.post-content-wrapper .post-body h5 {
    font-size: 14px;
    color: inherit;
    margin: 20px 0 5px 0;
    line-height: 1.35;
    font-weight: 700;
}

.single-post-content h2 {
    font-size: 20px;
    line-height: 1.35;
    margin: 20px 0 5px 0;
    font-weight: 700;
    color: #333;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.single-post-content h3 {
    font-size: 18px;
    line-height: 1.35;
    margin: 20px 0 5px 0;
    font-weight: 700;
    color: #333;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.single-post-content h4 {
    font-size: 16px;
    line-height: 1.35;
    margin: 20px 0 5px 0;
    font-weight: 700;
    color: #333;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.single-post-content h5 {
    font-size: 14px;
    line-height: 1.35;
    margin: 20px 0 5px 0;
    font-weight: 700;
}

.post-content-wrapper .post-body .heading-size-xs {
    font-size: 100%;
}

.post-content-wrapper .post-body .heading-size-sm {
    font-size: 110%;
}

.post-content-wrapper .post-body .heading-size-md {
    font-size: 120%;
}

.post-content-wrapper .post-body .heading-size-lg {
    font-size: 140%;
}

.post-content-wrapper .post-body .heading-size-xl {
    font-size: 160%;
}

.post-content-wrapper .post-body .heading-space-tight,
.single-post-content .heading-space-tight {
    margin: 8px 0 4px 0;
}

.post-content-wrapper .post-body .heading-space-normal,
.single-post-content .heading-space-normal {
    margin: 12px 0 8px 0;
}

.post-content-wrapper .post-body .heading-space-loose,
.single-post-content .heading-space-loose {
    margin: 16px 0 12px 0;
}

.post-content-wrapper {
    overflow: visible;
}


.single-post-content pre,
.post pre {
    margin: 0.5em 0;
    background: var(--code-bg);
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    line-height: 1.5;
    font-size: var(--article-font-size);
    color: #000;
    font-family: var(--code-font-family);
}

.single-post-content pre:not([data-code-enhanced="true"]),
.post pre:not([data-code-enhanced="true"]) {
    padding: var(--code-pad-y) var(--code-pad-x);
}

.post-content a:link,
.post-content a:visited,
.single-post-content a:link,
.single-post-content a:visited {
    color: #058c05;
}

.post-content a:hover,
.single-post-content a:hover {
    color: #F60;
}

.code-block {
    --code-font-size: var(--article-font-size);
    --code-line-height: 1.5;
    position: relative;
    margin: 0.5em 0;
}

.code-body {
    background: var(--code-bg);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    padding: 0;
}

.code-scroll {
    overflow: auto;
    max-width: 100%;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    padding: 0;
}

.code-scroll:focus-visible,
.table-scroll:focus-visible {
    outline: 2px solid #f60;
    outline-offset: 2px;
}

.code-block pre {
    margin: 0;
    padding: var(--code-pad-y) var(--code-pad-x);
    border: none;
    border-radius: 0;
    overflow: visible;
    font-size: var(--code-font-size);
    line-height: var(--code-line-height);
    background: transparent;
    font-family: var(--code-font-family);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    color: #000;
    text-shadow: none;
    box-shadow: none;
}

.code-block code {
    display: block;
    background: none;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    tab-size: 4;
}

.code-copy-btn,
.notes-header-action {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7785' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2.25'/%3E%3Cpath d='M5 15.5V5a2 2 0 0 1 2-2h10.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    cursor: pointer;
    opacity: 1;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-image 0.18s ease;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.16);
}

.code-copy-btn:hover,
.notes-header-action:hover {
    background-color: rgba(244, 247, 252, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.code-copy-btn:active,
.notes-header-action:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
}

.code-copy-btn.copied {
    background-color: #33a06f;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4L19 6'/%3E%3C/svg%3E");
}

.code-copy-btn.copy-error {
    background-color: #d64545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.code-copy-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.code-block pre code.hljs,
.code-block pre code.language-plaintext {
    background: transparent;
    padding: 0;
}

.single-post-content pre code.hljs,
.single-post-content pre code.language-plaintext,
.post pre code.hljs,
.post pre code.language-plaintext {
    background: transparent;
    padding: 0;
}

/* Prism 1.30.0 default theme used by Scientific Spaces. */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #708090;
}

.token.punctuation {
    color: #999;
}

.token.namespace {
    opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #905;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #690;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #9a6e3a;
    background: transparent;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #07a;
}

.token.function,
.token.class-name {
    color: #dd4a68;
}

.token.regex,
.token.important,
.token.variable {
    color: #e90;
}

.token.important,
.token.bold {
    font-weight: 700;
}

.token.italic {
    font-style: italic;
}

.code-block pre.line-numbers {
    position: relative;
    padding: var(--code-pad-y) var(--code-pad-x) var(--code-pad-y) 3.8em;
    counter-reset: linenumber;
}

.code-block pre.line-numbers > code {
    position: relative;
    white-space: inherit;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: -3.8em;
    width: 3em;
    border-right: 1px solid #999;
    font-size: 100%;
    letter-spacing: -1px;
    user-select: none;
}

.line-numbers-rows > span {
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span::before {
    content: counter(linenumber);
    display: block;
    padding-right: 0.8em;
    color: #999;
    text-align: right;
}


.single-post-content code,
.post code {
    font-family: var(--code-font-family);
    font-size: var(--article-font-size);
    background-color: #f2f4f7;
    padding: 1px 4px;
    border-radius: 3px;
    color: #4b5563;
    border: 1px solid #e2e5e9;
}

.code-block code {
    color: inherit;
    background: transparent;
    padding: 0;
    border: 0;
    border-radius: 0;
    font-size: inherit;
}

.single-post-content table,
.post-content table {
    width: auto;
    margin: 18px auto;
    border-collapse: collapse;
    border-top: 1px solid blue;
    border-bottom: 1px solid blue;
    border-left: 0;
    border-right: 0;
    background: transparent;
    font-size: 14px;
    line-height: 1.3;
    color: blue;
    text-align: center;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    margin: 18px 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.post-content .table-scroll table {
    width: max-content;
    min-width: 0;
    max-width: none;
    margin: 0 auto;
}

.post-content .table-scroll th,
.post-content .table-scroll td {
    white-space: nowrap;
}

.single-post-content thead th,
.post-content thead th {
    background: transparent;
    color: blue;
    font-weight: 600;
    text-align: center;
    border: none;
    border-top: 0;
    border-left: 0;
    border-bottom: 1px solid blue;
    padding: 2px 8px;
}

.single-post-content tbody td,
.post-content tbody td {
    padding: 2px 8px;
    border: none;
    border-left: 0;
}

.single-post-content tbody tr:nth-child(even),
.post-content tbody tr:nth-child(even) {
    background: #fff;
}

.single-post-content tbody tr:hover,
.post-content tbody tr:hover {
    background: #f5f5f5;
}

.single-post-content caption,
.post-content caption {
    caption-side: top;
    padding-bottom: 8px;
    font-size: var(--article-aux-font-size);
    color: #7a8899;
    text-align: center;
}

.single-post-content table.latex-table,
.post-content table.latex-table {
    border-top: 1px solid blue;
    border-bottom: 1px solid blue;
    border-left: 0;
    border-right: 0;
    background: transparent;
    color: blue;
    font-size: var(--article-font-size);
    text-align: center;
}

.single-post-content table.latex-table thead th,
.post-content table.latex-table thead th {
    background: transparent;
    font-weight: 600;
    border: none;
    border-top: 0;
    border-left: 0;
    border-bottom: 1px solid blue;
    padding: 2px 8px;
    color: blue;
}

.single-post-content table.latex-table tbody td,
.post-content table.latex-table tbody td {
    border: none;
    border-left: 0;
    padding: 2px 8px;
    color: blue;
}

.single-post-content table.latex-table tbody tr:nth-child(even),
.post-content table.latex-table tbody tr:nth-child(even) {
    background: transparent;
}

.single-post-content table.latex-table tbody tr:hover,
.post-content table.latex-table tbody tr:hover {
    background: #f5f5f5;
}

.single-post-content table.latex-table caption,
.post-content table.latex-table caption {
    color: #7a8899;
    font-weight: 500;
}

.post-content {
    clear: both;
    color: rgba(0, 0, 0, 0.75);
    font-family: var(--article-font-family);
    font-size: var(--article-font-size);
    line-height: var(--article-line-height);
    margin-bottom: 8px;
    text-align: justify;
    overflow-wrap: anywhere;
}

.post-content p.contains-inline-math,
.post-content li.contains-inline-math {
    text-align: start;
    text-align-last: auto;
    word-spacing: normal;
}

.post-content mjx-container.inline-math-overflow {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0.5em 0;
    padding-bottom: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.post-content strong,
.single-post-content strong {
    font-weight: 700;
    color: #000;
}

.post-content blockquote,
.single-post-content blockquote {
    background: #f2f2f2;
    color: #333;
    font-family: inherit;
    font-size: inherit;
    border: 1px solid #ddd;
    margin: 0.5em 0 1em 0;
    padding: 10px 15px;
    line-height: inherit;
    font-style: normal;
    border-radius: 0;
    overflow: hidden;
}

.post-content blockquote p,
.single-post-content blockquote p {
    margin: 4px 0 10px;
    font-size: inherit;
    line-height: inherit;
}

.post-content blockquote p:last-child,
.single-post-content blockquote p:last-child {
    margin-bottom: 4px;
}

/* 引用（cite）样式，参考 reference_css.css 的格式 */
.post-content blockquote.cite,
.single-post-content blockquote.cite {
    font-size: inherit;
    color: #999;
    padding: 16px 16px;
    border: none;
    position: relative;
    background-color: white;
    overflow: hidden;
}

.post-content blockquote.cite:before,
.single-post-content blockquote.cite:before {
    content: "\201C";
    position: absolute;
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    background-image: url('icons/openquote.gif');
}

.post-content blockquote.cite:after,
.single-post-content blockquote.cite:after {
    content: "\201D";
    position: absolute;
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 25px;
    height: 25px;
    background-image: url('icons/closequote.gif');
}

.post-content p {
    margin-bottom: 10px;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: #333;
    margin: 20px 0 5px 0;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.post-content h2 {
    font-size: 20px;
    line-height: 1.35;
}

.post-content h3 {
    font-size: 18px;
    line-height: 1.35;
}

.post-content h4 {
    font-size: 16px;
    line-height: 1.35;
}

.post-content h5 {
    font-size: var(--article-font-size);
    line-height: 1.35;
    font-weight: 700;
}

.post-content ul,
.single-post-content ul {
    list-style: disc;
    margin-left: 20px;
    list-style-position: outside;
    margin-bottom: 10px;
}

.post-content ol,
.single-post-content ol {
    list-style: decimal;
    margin-left: 20px;
    list-style-position: outside;
    margin-bottom: 10px;
}

.post-content li,
.single-post-content li {
    margin-bottom: 2px;
    line-height: 1.65;
}

.post-content li:last-child,
.single-post-content li:last-child {
    margin-bottom: 0;
}

.post-content li > p:only-child,
.single-post-content li > p:only-child {
    margin-bottom: 0;
}

.post-content ol > li::marker,
.single-post-content ol > li::marker {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-variant-numeric: normal;
    font-feature-settings: normal;
}

.read-more {
    color: #97bf0d;
    font-size: var(--article-font-size);
}

.read-more:hover {
    text-decoration: underline;
}

.post-footer {
    clear: both;
    font-size: 10px;
    color: #999;
    line-height: 2;
}

.post-footer a {
    color: #4183c4;
    font-size: var(--article-aux-font-size);
}

.post-header .notes-header-action {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-image: none;
    color: #4183c4;
    font: 11px/1.6 var(--article-font-family);
    box-shadow: none;
    text-decoration: none;
    transform: none;
}

.post-header .notes-header-action:hover {
    color: #4183c4;
    background-color: transparent;
    box-shadow: none;
    text-decoration: underline;
    transform: none;
}

.post-header .notes-header-action:active {
    box-shadow: none;
    transform: none;
}

.notes-print-button {
    margin-left: auto;
}

.notes-edit-button {
    margin-left: 6px;
}

.notes-header-action:focus-visible {
    outline: 2px solid #6b7785;
    outline-offset: 3px;
}

/* 移除未使用的 action-link 样式 */

/* 单篇文章页面 */
.single-wrapper {
    align-items: stretch;
}

.single-main {
    background-color: #fff;
    padding: 22px 28px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #dadada;
}

/* 移除未使用的面包屑、工具栏与按钮样式 */

.single-post-content {
    font-family: var(--article-font-family);
    font-size: var(--article-font-size);
    color: rgba(0, 0, 0, 0.75);
    line-height: var(--article-line-height);
}

.single-post-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.post-section {
    margin-bottom: 28px;
}

.post-section h2 {
    font-size: 20px;
    color: #333;
    margin: 20px 0 5px 0;
    line-height: 1.35;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.post-content-wrapper .post-body h2::before,
.post-content-wrapper .post-body h3::before,
.post-content-wrapper .post-body h4::before,
.post-content-wrapper .post-body h5::before,
.single-post-content h2::before,
.single-post-content h3::before,
.single-post-content h4::before,
.single-post-content h5::before,
.post-content h3::before {
    content: "#";
    display: inline-block;
    color: #a0a0a0;
    margin-right: 6px;
}

/* 单页内容中的所有小标题统一使用黑色文本 */
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5 {
    color: inherit;
}

.section-anchor {
    font-size: 13px;
    color: #a0a0a0;
    margin-left: 4px;
}

.meta-divider {
    margin: 0 8px;
    color: #b7b7b7;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
}

/* 只有下一篇时，让它靠右显示 */
.post-nav .next-post:only-child {
    margin-left: auto;
}

.post-nav a {
    color: #4183c4;
}

.post-nav .prev-post,
.post-nav .next-post {
    color: #666;
}

.post-nav .prev-post::after {
    content: " \2039";
    /* ‹ */
    color: #a0a0a0;
}

.post-nav .next-post::after {
    content: " \203A";
    /* › */
    color: #a0a0a0;
}

@media (max-width: 768px) {
    .post-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .post-nav .prev-post,
    .post-nav .next-post {
        display: block;
    }

    .post-nav .next-post:only-child {
        margin-left: 0;
    }
}

.toc .toc-list {
    list-style: none;
    font-size: 12px;
    line-height: 1.7;
}

.toc .toc-list li {
    margin-bottom: 6px;
}

.toc .toc-list a {
    color: #4183c4;
}

/* 分页 */
.pagination {
    text-align: center;
    padding: 30px 0;
    margin: 25px 0;
    border-top: 1px dashed #e0e0e0;
}

.page-num {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 3px;
    border: 1px solid #d0d0d0;
    background-color: #fff;
    color: #666;
    font-size: 12px;
    transition: all 0.2s;
}

.page-num:hover {
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-color: #97bf0d;
}

.page-num.next {
    font-weight: bold;
}

/* 侧边栏 */
.sidebar {
    width: 33.333%;
    flex: 0 0 33.333%;
    flex-shrink: 0;
    font-family: var(--article-font-family);
    font-size: var(--article-font-size);
}

/* The article layout reserves slightly more width for long-form reading. */
.sidebar.single-sidebar {
    width: 30.5%;
    flex: 0 0 30.5%;
}

.sidebar-section {
    background-color: #fff;
    padding: 10px 11px;
    margin-bottom: 10px;
    border: 1px solid #d5d9de;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.sidebar-section h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e5e5;
    font-weight: 600;
}

/* 关于站长 */
.about {
    background: linear-gradient(to bottom, #e8f4fd 0%, #f0f7fc 100%);
    border-color: #c8dfe8;
}

.author-avatar {
    text-align: center;
    margin: 8px 0 10px;
}

.avatar-placeholder {
    width: 90px;
    height: 90px;
    margin: 0 auto;
    background: linear-gradient(135deg, #5c9ac4 0%, #4a7fa0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 2px 6px rgba(92, 154, 196, 0.25);
    border: 2px solid #fff;
}

.author-info {
    font-size: 12px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 8px;
    text-align: justify;
}

.author-links {
    list-style: none;
    font-size: 12px;
    line-height: 1.7;
}

.author-links li {
    margin-bottom: 2px;
    padding-left: 10px;
    position: relative;
}

.author-links li:before {
    content: "›";
    position: absolute;
    left: 0;
    color: #5c9ac4;
    font-size: 13px;
    line-height: 1.3;
}

.author-links a {
    color: #d9534f;
    font-size: 12px;
    transition: color 0.2s;
}

.author-links a:hover {
    color: #c9302c;
}

/* 搜索框 */
.search {
    background: linear-gradient(to bottom, #fffacd 0%, #fffef0 100%);
    border-color: #f0e68c;
}

.search-box {
    display: flex;
    margin-bottom: 8px;
}

.search-box input {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 2px 0 0 2px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #97bf0d;
    box-shadow: 0 0 0 1px rgba(109, 171, 60, 0.1);
}

.search-box button {
    padding: 5px 14px;
    background: linear-gradient(to bottom, #97bf0d 0%, #829c0c 100%);
    color: #fff;
    border: none;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.search-box button:hover {
    background: linear-gradient(to bottom, #829c0c 0%, #4e7b2a 100%);
}

.search-tip {
    font-size: 12px;
    color: #777;
    line-height: 1.6;
}

.search-results-heading {
    font-size: 14px;
    color: #2f4f87;
    margin-bottom: 12px;
    background: #eaf1ff;
    border-left: 3px solid #4d68c3;
    padding: 8px 12px;
    border-radius: 3px;
    line-height: 1.6;
}

/* 标签 */
.tags {
    background: linear-gradient(to bottom, #e8f9e8 0%, #f0faf0 100%);
    border-color: #c8e6c8;
}

.tag-cloud {
    text-align: justify;
    font-size: 0;
}

.tag-cloud::after {
    content: '';
    display: inline-block;
    width: 100%;
}

.tag-cloud a {
    display: inline-block;
    font-size: 12px;
    line-height: 1.8;
    padding: 0 2px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tag-cloud a:link,
.tag-cloud a:visited {
    color: #4a5c7a;
}

.tag-cloud a:hover,
.tag-cloud a.active {
    color: #cc3000;
}

/* 最新文章 */
.recent {
    background: linear-gradient(to bottom, #f0f8f0 0%, #f5faf5 100%);
    border-color: #d0e8d0;
}

.recent-posts {
    list-style: none;
}

.recent-posts li {
    margin-bottom: 8px;
    padding: 5px 0 5px 14px;
    position: relative;
    line-height: 1.6;
    border-bottom: 1px dashed #e5e5e5;
}

.recent-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.recent-posts li:before {
    content: "›";
    position: absolute;
    left: 0;
    color: #97bf0d;
    font-size: 12px;
    top: 5px;
}

.recent-posts a {
    font-size: 12px;
    color: #4183c4;
    display: block;
    transition: all 0.2s;
}

.recent-posts a:hover {
    color: #97bf0d;
    padding-left: 3px;
}

/* 页脚 */
.footer {
    background-color: transparent;
    color: #e5e8ec;
    margin: 0 var(--layout-h-padding);
    padding: 4px 6px;
    font-size: 11px;
    text-align: center;
    line-height: 1.6;
}

.footer p {
    margin: 2px 0;
}

.footer a {
    color: #f5f7fa;
}

.footer a:hover {
    color: #97bf0d;
    text-decoration: none;
}

/* 响应式设置 */

@media (max-width: 768px) {
    .main-header {
        padding: 12px 6px 10px;
    }

    .main-content {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .wrapper {
        padding: 0;
        border-right: none;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 100%;
    }

    .post-header {
        --badge-height: 44px;
        padding: 8px;
    }

    .top-bar-container {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .header-container {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        justify-content: space-between;
    }

    .category-nav {
        flex-wrap: wrap;
    }

    .cat-item {
        flex: 1 0 20%;
        font-size: 10px;
    }

    .notice-banners {
        flex-direction: column;
    }

    .participate-box {
        flex: 1;
    }

    .single-sidebar {
        width: 100%;
        flex: 0 0 100%;
    }

    .post {
        padding-left: 0;
    }

    .post-date-badge {
        width: 36px;
        height: var(--badge-height);
        font-size: 17px;
    }

    .post-title {
        font-size: 15px;
        white-space: normal;
    }

    .post-header-content {
        height: auto;
    }

    .logo-img {
        width: 200px;
    }

    .pagination {
        padding: 20px 0;
        margin: 18px 0;
    }

    .page-num {
        padding: 6px 10px;
        font-size: 12px;
    }

    .code-block {
        margin: 12px 0;
    }

    .code-body {
        padding: 0;
    }

    .code-block pre.line-numbers {
        padding: 9px 38px 9px 3.8em;
    }

    .code-copy-btn,
    .notes-header-action {
        top: 3px;
        right: 3px;
        width: 28px;
        height: 28px;
    }

    .table-scroll {
        margin: 14px 0;
        padding-bottom: 3px;
    }
}

/* 代码块样式 */
code {
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 2px;
    font-family: var(--code-font-family);
    font-size: 0.85em;
    color: #4b5563;
}

/* 图片样式 */
/* 文章内图片容器 - 参考 kexue.fm 样式 */
.single-post-content figure,
.post-content figure {
    margin: 20px auto;
    text-align: center;
    background-color: transparent;
    border: 1px solid #e5e5e5;
    padding: 4px;
    display: block;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}

/* 文章内图片 */
.single-post-content img,
.post-content img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: none;
}

/* 图片标题/说明文字 - 位于边框内底部 */
.single-post-content figcaption,
.post-content figcaption {
    margin-top: 4px;
    padding-top: 4px;
    font-size: var(--article-aux-font-size);
    color: #666;
    text-align: center;
    line-height: 1.6;
    font-style: normal;
    border-top: 1px solid #e8e8e8;
}

/* 图片在 figure 元素内的样式 */
.single-post-content figure img,
.post-content figure img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    border: none;
}

/* 移除未使用的图片 Lightbox 与动画样式 */

/* 响应式图片调整 */
@media (max-width: 768px) {
    .top-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-block;
        margin-left: auto;
    }

    .header-cat-nav {
        display: none;
    }
}

.single-post-content figure,
.post-content figure {
    max-width: 100%;
    padding: 3px;
}

.single-post-content img,
.post-content img {
    max-width: 100%;
}

.single-post-content figcaption,
.post-content figcaption {
    margin-top: 3px;
    padding-top: 3px;
}

/* 选中文本样式 */
::selection {
    background-color: #b3d4fc;
    color: #000;
}

/* 移动抽屉 */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 86vw;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #3c4148 0%, #2f343a 100%);
    color: #f0f2f5;
    box-shadow: -6px 0 12px rgba(0, 0, 0, 0.28);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1001;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer.open~.mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title {
    font-size: 14px;
    font-weight: 600;
}

.drawer-close {
    background: transparent;
    border: none;
    color: #f0f2f5;
    font-size: 22px;
    line-height: 1;
}

.drawer-content {
    padding: 10px;
    overflow-y: auto;
    height: calc(100vh - 49px);
    height: calc(100dvh - 49px);
}

.drawer-section {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.drawer-section h3 {
    font-size: 13px;
    color: #f0f2f5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.drawer-menu {
    list-style: none;
}

.drawer-menu li {
    margin-bottom: 6px;
}

.drawer-menu a {
    color: #e5e8ec;
    font-size: 13px;
}

.drawer-menu a:hover {
    color: #97bf0d;
}

.drawer-list {
    list-style: none;
}

.drawer-list li {
    margin-bottom: 6px;
    padding-left: 12px;
    position: relative;
}

.drawer-list li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: #97bf0d;
    font-size: 12px;
    top: 1px;
}

.drawer-list a {
    color: #e5e8ec;
    font-size: 13px;
}

.drawer-list a:hover {
    color: #cc3000;
}

.mobile-drawer .search-box input {
    background: rgba(255, 255, 255, 0.9);
}

.mobile-drawer .search-box button {
    background: linear-gradient(to bottom, #97bf0d 0%, #829c0c 100%);
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .single-sidebar {
        display: none;
    }
}
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@page {
    size: A4 portrait;
    margin: 14mm 13mm 16mm;
}

@media print {
    html,
    body {
        min-width: 0;
        margin: 0;
        padding: 0;
        background: #fff;
        color: #000;
        font-size: 10.5pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .page-container,
    .main-content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
    }

    .main-content {
        display: block;
    }

    .wrapper {
        width: 100%;
        padding: 0;
        border: 0;
    }

    .top-bar,
    .main-header,
    .sidebar,
    .mobile-drawer,
    .mobile-drawer-backdrop,
    .footer,
    .post-footer,
    .notes-header-action,
    .back-to-top,
    .code-copy-btn {
        display: none !important;
    }

    .post-header {
        margin-bottom: 7mm;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        break-inside: avoid;
    }

    .post-date-badge {
        display: none;
    }

    .post-header-content {
        min-height: 0;
    }

    .post-title {
        margin-bottom: 2mm;
        color: #111;
        font-size: 18pt;
        line-height: 1.3;
        white-space: normal;
    }

    .single-post-content {
        color: #222;
        font-size: 10.5pt;
        line-height: 1.65;
    }

    .post-section h2,
    .single-post-content h3,
    .single-post-content h4,
    .single-post-content h5 {
        break-after: avoid;
    }

    .single-post-content p,
    .single-post-content li {
        orphans: 3;
        widows: 3;
    }

    .single-post-content img,
    .single-post-content figure,
    .single-post-content table,
    .single-post-content pre,
    .single-post-content blockquote,
    mjx-container[display="true"] {
        max-width: 100%;
        break-inside: avoid;
    }

    .single-post-content figure {
        padding: 0;
        border: 0;
    }

    .table-scroll,
    .code-scroll,
    .code-body {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .post-content .table-scroll table {
        width: 100%;
        max-width: 100%;
        margin: 0;
        font-size: 9pt;
    }

    .post-content .table-scroll th,
    .post-content .table-scroll td {
        padding: 2px 5px;
        white-space: normal;
    }

    .code-body {
        padding: 8px 10px;
        border: 0;
        box-shadow: none;
    }

    .code-block code {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        font-size: 8.5pt;
    }

    a,
    a:visited {
        color: #075f07;
        text-decoration: underline;
    }
}
