/* 始终预留滚动条空间 */
html {
    overflow-y: scroll;
}

/* 通用样式 */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    padding-top: 70px; /* 补偿固定导航栏的高度 */
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 20px;
}

/* 导航栏优化 */
.navbar {
    min-height: 50px;
    margin-bottom: 0;
    border: none;
}

.navbar-default {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    padding: 15px;
    font-size: 24px;
}

.navbar-toggle {
    margin-top: 8px;
    margin-bottom: 8px;
}

.navbar-collapse {
    border: none;
}

.view-all-link {
  display: inline-block;
  margin: 20px 0 50px;
  font-size: 15px;
  color: #777;
  text-decoration: none;
}

.view-all-link:hover {
  color: #333;
  text-decoration: underline;
}

/* 文章样式 */
.post-preview {
    margin-bottom: 40px;
}

.post-preview h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

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

.post-summary {
    margin: 20px 0;
}

.post-detail {
    margin-bottom: 60px;
}

.post-header {
    margin-bottom: 40px;
    text-align: center;
}

.post-title {
    font-size: 40px;
    margin-bottom: 15px;
    font-weight: 700;
}

.post-content {
    font-size: 18px;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 32px;
    margin: 40px 0 20px;
}

.post-content h3 {
    font-size: 26px;
    margin: 35px 0 18px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 4px;
}

.post-content pre {
    background-color: #f6f8fa;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    overflow: auto;
}

.post-content code {
    background-color: #f6f8fa;
    font-family: 'Menlo', 'Monaco', Consolas, monospace;
    font-size: 16px;
}

.post-content blockquote {
    border-left: 4px solid #ddd;
    margin: 20px 0;
    padding: 0 20px;
    color: #666;
}

.post-item {
    margin-bottom: 30px;
}

.post-item .post-title {
    font-size: 26px;
    margin-bottom: 8px;
}

.post-excerpt {
    color: #555;
    margin-top: 12px;
}

.post-divider {
    margin: 40px 0;
    border-color: #eee;
}

.MathJax_Display {
    overflow-x: auto;
    overflow-y: hidden;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
}

.post-content table th,
.post-content table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    font-size: 16px;
}

.post-content table thead th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
}

.post-content table tbody tr:nth-child(odd) {
    background-color: #fdfdfd;
}

.post-content table tbody tr:hover {
    background-color: #f2f2f2;
}

/* 默认对齐：当单元格没有设置 align 属性时，默认左对齐 */
.post-content table th:not([align]),
.post-content table td:not([align]) {
    text-align: left;
}

/* 居中 */
.post-content table th[align="center"],
.post-content table td[align="center"] {
    text-align: center;
}

/* 右对齐 */
.post-content table th[align="right"],
.post-content table td[align="right"] {
    text-align: right;
}

.post-content .mermaid {
  display: block;
  margin: 2em auto;
  text-align: center;
}


@media (max-width: 767px) {
    body {
        padding-top: 60px;
    }

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

    .post-content {
        font-size: 16px;
        line-height: 1.6;
    }

    .post-content h2 {
        font-size: 24px;
    }

    .navbar-nav {
        margin: 0;
    }

    .navbar-nav > li > a {
        padding: 10px 15px;
    }

    .navbar-collapse {
        background-color: #f8f8f8;
        border-top: 1px solid #e7e7e7;
    }
}

@media (max-width: 480px) {

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

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}
.home-profile { margin: 40px 0; }
.profile-avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
}
.profile-name { margin-top: 0; margin-bottom: 6px; }
.profile-tagline { color: #888; margin-bottom: 12px; }
.profile-bio { margin-bottom: 14px; }

.markdown-body p { margin: 0 0 12px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 12px 20px; }
.markdown-body code { background: #f6f8fa; padding: 0 4px; border-radius: 3px; }

.profile-socials { margin-top: 8px; }
.profile-socials .social-link { display: inline-block; margin-right: 10px; }
.profile-socials .social-icon { width: 22px; height: 22px; vertical-align: middle; }

.social-link {
  position: relative;
  display: inline-block;
  margin: 0 5px;
}

.social-qr {
  display: none;
  position: absolute;
  top: 120%; /* 图标下方 */
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  border: 1px solid #ddd;
  background: #fff;
  padding: 5px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 100;
}

/* 桌面端 hover 显示 */
@media (hover: hover) {
  .social-link:hover .social-qr {
    display: block;
  }
}

.site-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 14px;
  text-align: center;
}

.site-footer .separator {
  margin: 0 0.25;
}

.footer-legal {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  line-height: 1.6;
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: inherit;
  font-size: 14px;
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

.footer-legal a + a::before {
  margin: 0 6px 0 2px;
  opacity: 0.6;
}

.mps-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  object-fit: contain;
}

.site-footer .copyright { margin: 0; }
.site-footer .footer-links { margin: 10px 0; padding: 0; list-style: none; }
.site-footer .footer-links > li { display: inline-block; margin: 0 8px; }
.site-footer .icp { margin: 6px 0 0; }

@media (max-width: 767px) {
  .home-profile { margin: 24px 0; text-align: center; }
  .profile-avatar { width: 96px; height: 96px; }
  .profile-socials .social-link { margin-right: 8px; }
  .site-footer { font-size: 13px; }
}

@media (max-width: 480px) {
  .footer-legal {
    gap: 4px 8px;
    margin-top: 4px;
  }
  .footer-legal a {
    font-size: 13px;
  }
}