/* ===== CSS Variables (Light Mode) ===== */
:root {
  --bg-body: #fcf9f5;
  --bg-sidebar: #f5efe9;
  --text-primary: #2d1f14;
  --text-secondary: #5a4a3a;
  --text-muted: #8a7a6a;
  --accent: #e25a3a;
  --accent-light: #f0d5c9;
  --border-light: #e8ddd0;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --sidebar-width: 280px;
}

/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-wrapper {
  display: flex;
  flex: 1;
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
}
.sidebar-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}
.sidebar-brand svg {
  color: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}
.sidebar-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.2rem;
}
.sidebar-nav {
  list-style: none;
  flex: 1;
}
.sidebar-nav li {
  margin-bottom: 0.6rem;
}
.sidebar-nav a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.sidebar-social {
  display: flex;
  gap: 1.2rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-light);
}
.sidebar-social a {
  color: var(--text-muted);
  font-size: 1.3rem;
  transition: color 0.2s, transform 0.2s;
  text-decoration: none;
}
.sidebar-social a:hover {
  color: var(--accent);
  transform: scale(1.1);
}
.sidebar-social svg {
  vertical-align: middle;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 3rem 4rem 2rem;
  max-width: 900px;
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 3rem;
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.page-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  border-left: 4px solid var(--accent);
  padding-left: 1.2rem;
  margin-top: 0.3rem;
}

/* ===== Timeline (首页) ===== */
.timeline-item {
  display: flex;
  gap: 1.8rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-date {
  flex: 0 0 100px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.3px;
  padding-top: 0.1rem;
}
.timeline-date svg {
  vertical-align: middle;
  margin-right: 2px;
}
.timeline-content {
  flex: 1;
}
.timeline-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.timeline-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}
.timeline-title a:hover {
  color: var(--accent);
}
.timeline-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.timeline-tags a {
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  padding: 0.1rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.timeline-tags a:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.read-more {
  display: inline-block;
  margin-top: 0.3rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.read-more:hover {
  text-decoration: underline;
}

/* ===== Pagination ===== */
.pagination-wrap {
  margin-top: 2.5rem;
  text-align: center;
}
.pagination-wrap a {
  display: inline-block;
  padding: 0.5rem 1.8rem;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
}
.pagination-wrap a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-body);
  padding: 1.2rem 0;
  text-align: center;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-inner a {
  color: var(--accent);
  text-decoration: none;
}
.footer-inner a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-wrapper {
    flex-direction: column;
  }
  .sidebar {
    position: relative;
    width: 100%;
    min-height: auto;
    padding: 1.5rem 1.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-brand {
    font-size: 1.4rem;
  }
  .sidebar-sub {
    display: none;
  }
  .sidebar-nav {
    display: flex;
    gap: 0.5rem 1.2rem;
    flex-wrap: wrap;
    flex: 0 0 100%;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.5rem;
  }
  .sidebar-nav li {
    margin-bottom: 0;
  }
  .sidebar-nav a {
    padding: 0.2rem 0;
    font-size: 0.9rem;
  }
  .sidebar-social {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: none;
    gap: 0.8rem;
  }
  .main-content {
    padding: 2rem 1.5rem;
  }
  .page-header h1 {
    font-size: 2rem;
  }
  .timeline-item {
    flex-direction: column;
    gap: 0.2rem;
    padding: 1.2rem 0;
  }
  .timeline-date {
    flex: 0 0 auto;
    font-size: 0.8rem;
  }
  .timeline-title {
    font-size: 1.15rem;
  }
}
@media (max-width: 480px) {
  .sidebar-brand {
    font-size: 1.2rem;
  }
  .main-content {
    padding: 1.5rem 1rem;
  }
}

/* ===== Tags Page ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2rem;
}
.tag-cloud-item {
  background: var(--bg-sidebar);
  padding: 0.3rem 1rem;
  border-radius: 30px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.tag-cloud-item:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.tag-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8em;
  margin-left: 0.2rem;
}
.tag-groups {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.tag-group-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 0.8rem;
}
.tag-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tag-post-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.tag-post-list li:last-child {
  border-bottom: none;
}
.tag-post-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.tag-post-list a:hover {
  color: var(--accent);
}
.tag-post-list .post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 1rem;
}

/* ===== Archive Page ===== */
.archive-year {
  margin-bottom: 2.5rem;
}
.archive-year-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
}
.archive-month {
  margin-bottom: 1.2rem;
}
.archive-month-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent);
}
.archive-post-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 1.2rem;
}
.archive-post-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.02);
}
.archive-post-list li:last-child {
  border-bottom: none;
}
.archive-post-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.archive-post-list a:hover {
  color: var(--accent);
}
.archive-post-list .post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 1rem;
}

/* ===== Post Content (文章正文) ===== */
.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.3rem;
}
.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}
.post-content p {
  margin-bottom: 1rem;
}
.post-content a {
  color: var(--accent);
  text-decoration: none;
}
.post-content a:hover {
  text-decoration: underline;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.post-content blockquote {
  border-left: 4px solid var(--accent);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: var(--bg-sidebar);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}
.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

/* ===== 文章元信息 (日期、标签、作者) ===== */
.post-header .post-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.post-header .post-meta svg {
  vertical-align: middle;
  margin-right: 2px;
}
.post-header .post-meta .post-author {
  margin-left: 1rem;
}
.post-header .post-tags {
  margin-top: 0.3rem;
}
.post-header .post-tags svg {
  vertical-align: middle;
  margin-right: 4px;
  color: var(--accent);
}
.post-header .post-tag {
  display: inline-block;
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  padding: 0.1rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s;
  margin-right: 0.2rem;
}
.post-header .post-tag:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== 分享按钮 ===== */
.post-share {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
.post-share .share-label {
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: 0.8rem;
}
.post-share a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.3rem;
  margin-right: 0.8rem;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}
.post-share a:hover {
  color: var(--accent);
  transform: scale(1.1);
}
.post-share svg {
  vertical-align: middle;
}

/* ===== 上一篇 / 下一篇导航 ===== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  gap: 1rem;
  flex-wrap: wrap;
}
.post-navigation a {
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.8rem;
  background: var(--bg-sidebar);
  border-radius: 8px;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.post-navigation a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.post-navigation .nav-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.post-navigation .nav-title {
  display: block;
  font-weight: 500;
}
.post-navigation .prev-post {
  text-align: left;
}
.post-navigation .next-post {
  text-align: right;
}

/* ===== 评论占位 ===== */
.post-comments {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}
.comments-placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.comments-placeholder svg {
  vertical-align: middle;
  margin-right: 6px;
}

/* ===== 代码块高亮 (白天模式) ===== */
.post-content .highlight {
  position: relative;
  margin: 1.2rem 0;
  border-radius: 8px;
  overflow: auto;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  box-shadow: none;
}
.post-content .highlight pre {
  padding: 1rem 1.2rem;
  margin: 0;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1f2328;
  background: transparent;
  overflow-x: auto;
}
.post-content .highlight .k { color: #d73a49; font-weight: 600; }
.post-content .highlight .n { color: #1f2328; }
.post-content .highlight .s { color: #032f62; }
.post-content .highlight .c { color: #6a737d; font-style: italic; }
.post-content .highlight .p { color: #1f2328; }
.post-content .highlight .o { color: #d73a49; }
.post-content .highlight .nf { color: #6f42c1; }
.post-content .highlight .nc { color: #6f42c1; }
.post-content .highlight .nb { color: #6f42c1; }
.post-content .highlight .mi { color: #005cc5; }
.post-content .highlight .mf { color: #005cc5; }
.post-content .highlight .dl { color: #032f62; }
.post-content .highlight .nv { color: #1f2328; }
.post-content .highlight .vg { color: #1f2328; }
.post-content .highlight .vi { color: #1f2328; }
.post-content .highlight .kc { color: #d73a49; }
.post-content .highlight .kn { color: #d73a49; }
.post-content .highlight .kr { color: #d73a49; }
.post-content .highlight .kt { color: #6f42c1; }
.post-content .highlight .sr { color: #032f62; }
.post-content .highlight .gh { color: #1f2328; }
.post-content .highlight .gi { color: #22863a; }
.post-content .highlight .gd { color: #b31d28; }
.post-content .highlight .gu { color: #6f42c1; }
.post-content .highlight .lineno {
  display: inline-block;
  min-width: 2.2rem;
  padding-right: 1.2rem;
  color: #6a737d;
  text-align: right;
  user-select: none;
  border-right: 1px solid #d0d7de;
  margin-right: 0.8rem;
}
.post-content .highlight::after {
  content: "📋";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  background: rgba(0,0,0,0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #1f2328;
}
.post-content .highlight:hover::after {
  opacity: 1;
}
.post-content .highlight.copied::after {
  content: "✅";
  opacity: 1;
}
.post-content .highlight::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.post-content .highlight::-webkit-scrollbar-track {
  background: #f0f0f0;
}
.post-content .highlight::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 3px;
}
.post-content .highlight::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}
.post-content code {
  background: #e9ecef;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: #d63384;
  font-weight: 500;
}

/* ===== Floating TOC (悬浮目录) ===== */
.floating-toc {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.floating-toc * {
  pointer-events: auto;
}
.toc-toggle-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.toc-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.toc-toggle-btn.active {
  background: var(--text-muted);
}
.toc-toggle-label {
  display: inline;
}
.toc-panel {
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 1rem 1.2rem;
  max-width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toc-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}
.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.8rem;
}
.toc-header svg {
  vertical-align: middle;
  margin-right: 4px;
  color: var(--accent);
}
.toc-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.2rem;
}
.toc-close-btn:hover {
  color: var(--accent);
}
.toc-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.toc-content li {
  margin-bottom: 0.3rem;
}
.toc-content li ul {
  padding-left: 1.2rem;
  margin-top: 0.2rem;
}
.toc-link {
  display: block;
  padding: 0.2rem 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.toc-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.toc-link.active {
  background: var(--accent);
  color: #fff;
}

/* 移动端：调整悬浮目录位置和样式 */
@media (max-width: 768px) {
  .floating-toc {
    right: 10px;
    bottom: 20px;
    top: auto;
    transform: none;
  }
  .toc-toggle-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 30px;
  }
  .toc-toggle-label {
    display: none;
  }
  .toc-panel {
    max-width: 260px;
    max-height: 50vh;
    margin-top: 0.3rem;
    right: 0;
  }
}
@media (max-width: 480px) {
  .toc-panel {
    max-width: 220px;
    padding: 0.8rem;
  }
}

/* ===== 上一篇 / 下一篇导航（美化版） ===== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 2.5rem;
  padding-top: 1.8rem;
  border-top: 2px solid var(--border-light);
  flex-wrap: wrap;
}

.post-navigation a {
  flex: 1 1 40%;
  min-width: 160px;
  padding: 1rem 1.2rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  overflow: hidden;
}

/* 悬停效果 */
.post-navigation a:hover {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* 上一篇左对齐 */
.post-navigation .prev-post {
  text-align: left;
  padding-left: 1.8rem;
}

/* 下一篇右对齐 */
.post-navigation .next-post {
  text-align: right;
  padding-right: 1.8rem;
}

/* 标签（上/下） */
.post-navigation .nav-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  transition: color 0.3s;
}

.post-navigation a:hover .nav-label {
  color: var(--accent);
}

/* 文章标题 */
.post-navigation .nav-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color 0.3s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-navigation a:hover .nav-title {
  color: var(--accent);
}

/* 箭头（使用伪元素） */
.post-navigation .prev-post::before,
.post-navigation .next-post::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: color 0.3s, transform 0.3s;
}

.post-navigation .prev-post::before {
  content: "‹";
  left: 0.6rem;
}

.post-navigation .next-post::after {
  content: "›";
  right: 0.6rem;
}

.post-navigation a:hover::before,
.post-navigation a:hover::after {
  color: var(--accent);
  transform: translateY(-50%) scale(1.2);
}

/* 当只有一个链接时，让它居中或占满 */
.post-navigation a:only-child {
  flex: 1;
  text-align: center;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}
.post-navigation a:only-child::before,
.post-navigation a:only-child::after {
  display: none;
}

/* ===== 移动端适配 ===== */
@media (max-width: 600px) {
  .post-navigation {
    flex-direction: column;
    gap: 0.8rem;
  }
  .post-navigation a {
    flex: 1 1 auto;
    text-align: left;
    padding: 0.8rem 1rem 0.8rem 2rem;
  }
  .post-navigation .next-post {
    text-align: left;
    padding-right: 1rem;
  }
  .post-navigation .next-post::after {
    right: auto;
    left: 0.6rem;
    content: "‹";  /* 改成左箭头，保持方向统一 */
  }
  /* 如果只有一个链接，居中 */
  .post-navigation a:only-child {
    text-align: center;
    padding-left: 1.2rem;
  }
}
