.page-post {
  font-size: 14px;
  line-height: 2;
  word-break: break-all;
}
.page-post .title {
  font-size: 18px;
  font-weight: bold;
  color: #666666;
}
.page-post .subtitle {
  font-size: 12px;
  color: #767676;
}
.page-post .post > * {
  margin: 18px 0;
}
.page-post .post > iframe {
  margin: 0;
  width: 100%;
}
/* 正文不允许 h1,视觉上一律降级为 h2(1 个 #);h2 起 # 个数 = 层级 */
.page-post .post h1,
.page-post .post h2,
.page-post .post h3,
.page-post .post h4,
.page-post .post h5,
.page-post .post h6 {
  position: relative;
  cursor: pointer;
}
.page-post .post h1,
.page-post .post h2 {
  font-weight: normal;
  font-size: 17px;
}
.page-post .post h3,
.page-post .post h4,
.page-post .post h5,
.page-post .post h6 {
  font-size: 15px;
  font-weight: bold;
}
.page-post .post h1::before,
.page-post .post h2::before,
.page-post .post h3::before,
.page-post .post h4::before,
.page-post .post h5::before,
.page-post .post h6::before {
  top: 0;
  font-weight: bold;
  padding-right: 6px;
}
.page-post .post h1::before { content: '#'; }
.page-post .post h2::before { content: '##'; }
.page-post .post h3::before { content: '###'; }
.page-post .post h4::before { content: '####'; }
.page-post .post h5::before { content: '#####'; }
.page-post .post h6::before { content: '######'; }
.page-post blockquote {
  border-left: 3px solid #333333;
  background-color: #f7f7f7;
  padding: 9px 9px 9px 15px;
}

.page-post a {
  color: #000000;
  margin: 0 2px;
  border-bottom: 1px solid #000000;
}
.page-post strong,
.page-post b {
  color: #000000;
}
.page-post .post ul {
  margin-left: 16px;
}
.page-post .post ol {
  margin-left: 23px;
}
.page-post ul > li {
  list-style: disc;
}
.page-post ol > li {
  list-style: decimal;
}
.page-post li > *{
  margin: 6px 0;
}
.page-post img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  height: auto;
  box-shadow: 0 0 5px #e0e0e0;
}
.page-post img[role='button'] {
  cursor: zoom-in;
}
.page-post img[alt='line'] {
  display: inline-block;
  vertical-align: middle;
  background-color: transparent;
  box-shadow: none;
  margin: 0 4px;
  line-height: 1;
}
.page-post pre {
  font-size: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 2px;
  max-height: 610px;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  line-height: 1.6;
}
.page-post code {
  font-size: 13px;
  background-color: #eeeeee;
  word-break: break-all;
  padding: 3px 5px;
  margin: 0 4px;
  border-radius: 5px;
  color: #4d4d4c;
}
.page-post pre code {
  font-size: 13px;
  background-color: transparent !important;
  word-break: keep-all;
  padding: 0;
  margin: 0;
  border-radius: unset;
  color: inherit;
}
.page-post hr {
  border: none;
  height: 3px;
  background-color: #eeeeee;
}
.page-post table {
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid #dddddd;
}
.page-post tr {
  border-bottom: 1px solid #dddddd;
}
.page-post th {
  font-weight: bold;
}
.page-post th,
.page-post td {
  padding: 5px 10px;
  text-align: left;
}
.page-post table tr:nth-child(even) {
  background-color: #f9f9f9;
}
/* 优化表格水平滚动 */
.page-post .table-container {
  overflow-x: auto; /* 明确设置水平滚动 */
  overflow-y: hidden; /* 隐藏垂直滚动条（如果不需要） */
  margin: 14px 0;
  border: 1px solid #dddddd;
  -webkit-overflow-scrolling: touch; /* 提升移动端滚动体验 */
}

/* 确保表格有足够的最小宽度以容纳内容 */
.page-post table {
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid #dddddd;
  table-layout: auto; /* 自动列宽，根据内容调整 */
}

/* 确保单元格内容不会过度挤压 */
.page-post th,
.page-post td {
  padding: 8px 12px; /* 增加内边距，提升可读性 */
  text-align: left;
  white-space: nowrap; /* 防止内容换行，保持列宽稳定 */
  vertical-align: top; /* 顶部对齐，使内容更整齐 */
}

.page-post .table-container table {
  margin: 0;
  border: 0;
}
.page-post .table-container table tbody tr:last-child {
  border-bottom: 0;
}
@media screen and (max-width: 560px) {
  .page-post {
    font-size: 13px;
  }
  .page-post pre code {
    font-size: 12px;
  }
  .page-post .post > * {
    margin: 15px 0;
  }
}

/* Figure样式 - 使用相对单位 */
.page-post figure {
  margin: 1.5em 0;
  text-align: center;
}

.page-post figcaption {
  font-size: 0.85em;
  color: #767676;
  margin-top: 0.6em;
  line-height: 1.4;
}

.dark .page-post figcaption {
  color: #aaa;
}

/* 目录 TOC:右下角悬浮按钮 + 弹出面板,与深色模式/回到顶部同风格,不占正文流 */
.post-toc {
  position: fixed;
  z-index: 99;
  right: 16px;
  bottom: 112px; /* 深色模式 64 + 按钮 32 + 间距 16 */
  margin: 0;
  width: 32px;
}
/* 触发按钮(summary 伪装成 .footer-btn 样式) */
.post-toc summary {
  width: 32px;
  height: 32px;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  color: #ffffff;
  font-size: 15px;
  user-select: none;
}
.post-toc summary::-webkit-details-marker {
  display: none;
}
.post-toc summary::before {
  content: '☰';
  line-height: 1;
}
/* 展开时触发按钮高亮 */
.post-toc[open] summary {
  background-color: rgba(0, 0, 0, 0.6);
}
/* 弹出目录面板:从按钮向上展开,悬浮于内容之上不占位 */
.post-toc nav {
  position: absolute;
  right: 0;
  bottom: 40px;
  width: 240px;
  max-width: 72vw;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  line-height: 1.6;
}
.post-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-toc li {
  margin: 3px 0;
}
.post-toc li a {
  color: inherit;
  border-bottom: none;
  margin: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-toc li a:hover {
  text-decoration: underline;
}
.post-toc .toc-lv2 { padding-left: 0; font-weight: bold; }
.post-toc .toc-lv3 { padding-left: 14px; }
.post-toc .toc-lv4 { padding-left: 28px; }

.dark .post-toc summary {
  background-color: rgba(255, 255, 255, 0.4);
  color: #0d1117;
}
.dark .post-toc[open] summary {
  background-color: rgba(255, 255, 255, 0.6);
}
.dark .post-toc nav {
  background-color: #161b22;
  border-color: #3b434b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* 中英对照页的英文译行:降视觉权重,正文以中文为主 */
.page-post .en {
  display: block;
  font-size: 0.86em;
  color: #767676;
  line-height: 1.6;
}
.dark .page-post .en {
  color: #8b949e;
}