/* ========== 内容标题横线 ========== */
.post-body h1,
.post-body h2,
.markdown-body h1,
.markdown-body h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.post-body a {
    color: #225573;
}
.post-body a:hover {
    color: #333;
}
/* ========== 文章元信息 ========== */
.post-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.post-meta {
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-meta .fa {
    color: #333;
}

.post-meta span {
    color: #333;
}

/* ========== 查看历史链接 ========== */
.history-link {
    font-size: 12px;
    color: #225573;
    text-decoration: none;
    margin-left: 8px;
}

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

/* ========== 文章底部标签 ========== */
.post-footer-tags {
    margin-top: 30px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #999;
}

.post-footer-tags a {
    font-size: 12px;
    color: #555;
    background: #f5f5f5;
    padding: 3px 10px;
    text-decoration: none;
}

.post-footer-tags a:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

/* ========== 作者卡片 tab 切换 ========== */
#author-card .site-state-item {
    text-decoration: none;
    color: #333;
}
#author-card .site-state-item:hover,
#author-card .site-state-item:focus {
    text-decoration: none;
}
#author-card .site-state-item.active-tab {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 6px;
}
#author-card .site-state-item.active-tab:hover {
    text-decoration: underline;
}

/* ========== 侧边栏目录 TOC ========== */
.toc-sidebar {
    padding: 0;
}

.post-toc {
    font-size: 0.875em;
}

.post-toc .nav {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.post-toc .nav ol {
    list-style: none;
}

/* 干掉 Bootstrap nav 的方块背景和大 padding */
.post-toc .nav > li,
.post-toc .nav > li > a {
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.post-toc .nav > li > a:hover,
.post-toc .nav > li > a:focus {
    background: transparent;
}

.post-toc .nav a {
    transition: color 0.2s ease-in-out;
    text-decoration: none;
    color: #555;
}

.post-toc .nav a:hover {
    color: #225573;
}

.post-toc .nav-item {
    line-height: 1.8;
    font-size: 13px;
}
.post-toc .nav-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-toc .nav .nav-child .nav-level-2 {
    padding-left: 8px;
}
.post-toc .nav .nav-child .nav-level-3 {
    padding-left: 16px;
}

.post-toc .nav .nav-child {
    display: none;
    padding-left: 0;
}

.post-toc .nav .active > .nav-child {
    display: block;
}

.post-toc .nav .active-current > .nav-child {
    display: block;
}

.post-toc .nav .active-current > a {
    color: #225573;
}

/* ========== 底部留白 ========== */
.post-content-area {
    padding-bottom: 70px !important;
}

/* ========== 历史弹窗 ========== */
.history-wrapper {
    position: relative;
}

.history-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    background: #fafafa;
}

.history-modal-header a {
    color: #999;
    font-size: 18px;
    text-decoration: none;
    line-height: 1;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.history-table th, .history-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    text-align: left;
}

.history-table th {
    background: #fff;
    font-weight: normal;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 100px;
}

.nav-menu li a {
    color: #555;
    text-decoration: none;
}

/* ========== 代码块包装器 ========== */
.code-block-wrapper {
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 0;
}
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    background: #f6f6f6;
    font-size: 12px;
    font-weight: 500;
    color: #333;
}
.code-block-header .copy-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    padding: 2px 6px;
}
.code-block-header .copy-btn:hover {
    background: #ddd;
}
.code-block-wrapper pre {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.post-body.markdown-body pre,
.editormd-html-preview pre {
    position: relative;
    border-radius: 0;
}

.post-body pre span {
    font-size: 13px;
}

.post-body pre .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font-size: 13px;
    padding: 0;
    line-height: 28px;
    text-align: center;
}
.post-body pre .copy-btn:hover {
    background: #ddd;
}

/* ========== 回到顶部 ========== */
.back-to-top {
    box-sizing: border-box;
    font-size: 12px;
    color: #fff;
    bottom: -100px;
    padding: 2px 4px;
    transition: bottom 0.2s ease-in-out;
    background: #999;
    cursor: pointer;
    position: fixed;
    z-index: 30;
    right: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.back-to-top:hover {
    background: #888;
    color: #fff;
}

.back-to-top.back-to-top-on {
    bottom: 64px;
}


/* ========== 响应式 ========== */
@media (max-width: 991px) {
    .back-to-top {
        right: 24px;
        opacity: 0.8;
    }
}

