/* 主题变量 */
:root {
  /* 浅色主题 */
  --bg-color: #fff;
  --text-color: #333;
  --text-muted: #666;
  --text-light: #ccc;
  --link-color: #4285f4;
  --border-color: #eee;
  --code-bg: #f8f9fa;
  --header-bg: #fff;
  --card-bg: #fff;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* 深色主题 */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --text-light: #999;
  --link-color: #64b5f6;
  --border-color: #333;
  --code-bg: #2d2d2d;
  --header-bg: #1a1a1a;
  --card-bg: #242424;
  --shadow: rgba(255, 255, 255, 0.1);
}

/* CSS Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 通用元素适配 - 确保所有新页面都能自动适配黑夜模式 */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  transition: color 0.3s ease;
}

p, li, td, th, span, div {
  color: inherit;
}

a {
  color: var(--link-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--link-color);
}

code {
  background: var(--code-bg);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

pre {
  background: var(--code-bg);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

blockquote {
  border-left-color: var(--border-color);
  color: var(--text-muted);
  transition: color 0.3s ease, border-color 0.3s ease;
}

table {
  border-color: var(--border-color);
}

th, td {
  border-color: var(--border-color);
  color: var(--text-color);
  transition: border-color 0.3s ease, color 0.3s ease;
}

hr {
  border-color: var(--border-color);
  transition: border-color 0.3s ease;
}

/* 确保首页和Blogs页面footer背景正确 */
body.homepage .footer,
body.blogs-page-layout .footer {
  background-color: var(--bg-color) !important;
}

/* 首页特殊布局 - 页脚在下方区域垂直居中 */
.homepage {
  min-height: 100vh;
  position: relative;
}

.homepage .footer {
  position: absolute;
  bottom: 40px; /* 距离底部40px，和文章页保持一致 */
  left: 0;
  right: 0;
  background: var(--bg-color) !important;
  padding: 35px 0;
  text-align: center;
  margin-top: 0;
  transition: background-color 0.3s ease;
}

/* Blogs页面布局 - 页脚位置与首页一致 */
.blogs-page-layout {
  min-height: 100vh;
  position: relative;
}

.blogs-page-layout .footer {
  position: absolute;
  bottom: 40px; /* 距离底部40px，与首页保持一致 */
  left: 0;
  right: 0;
  background: var(--bg-color) !important;
  transition: background-color 0.3s ease;
  padding: 35px 0;
  text-align: center;
  margin-top: 0;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Single Screen Layout - 一屏显示优化 */
.single-screen {
  max-height: 100vh;
  overflow: hidden;
}

.single-screen .header {
  padding: 10px 0 15px;
}

.single-screen .site-title {
  font-size: 18px;
  margin: 0 0 8px 0;
}

.single-screen .main {
  padding-bottom: 10px;
}

.single-screen .hero {
  margin-bottom: 15px;
}

.single-screen .hero-title {
  font-size: 20px;
  margin: 0 0 8px 0;
  line-height: 1.1;
}

.single-screen .hero-description {
  font-size: 14px;
  margin: 0 0 8px 0;
}

.single-screen .hero-bio {
  font-size: 13px;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.single-screen .posts-section {
  margin-bottom: 12px;
}

.single-screen .section-title {
  font-size: 15px;
  margin: 0 0 8px 0;
}

.single-screen .post-item {
  margin-bottom: 3px;
}

.single-screen .post-link {
  font-size: 13px;
  line-height: 1.2;
}

.single-screen .footer {
  padding: 10px 0;
  margin-top: 10px;
}

.single-screen .footer-text {
  margin: 0 0 3px 0;
  font-size: 12px;
}

/* Header */
.header {
  padding: 30px 0 40px;
  border-bottom: none;
  background-color: var(--header-bg);
  transition: background-color 0.3s ease;
}

.header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-title {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 18px 0;
  text-align: center;
}

.site-title a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav {
  text-align: center;
}

.nav-link {
  color: var(--link-color);
  text-decoration: none;
  margin: 0 15px;
  font-size: 16px;
  transition: color 0.3s ease;
}

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

/* 固定位置的主题切换按钮 */
.theme-toggle-fixed {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-muted);
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}

[data-theme="dark"] .theme-toggle-fixed {
  background: rgba(26, 26, 26, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.theme-toggle-fixed:hover {
  background-color: var(--border-color);
  border-color: var(--text-light);
  color: var(--text-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.theme-toggle-fixed:active {
  transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .theme-toggle-fixed {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }
}

.theme-toggle-icon {
  transition: all 0.3s ease;
}

/* 图标切换动画 */
.moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  transition: all 0.3s ease;
}

.sun-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0.8);
  transition: all 0.3s ease;
}

/* 深色主题时显示太阳图标 */
[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0.8);
}

[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  display: block !important;
}

/* Main Content */
.main {
  min-height: auto;
  padding-bottom: 15px;
}

/* Hero Section */
.hero {
  margin-bottom: 40px;
}

.hero-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 16px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.hero-description {
  font-size: 18px;
  color: var(--text-color);
  margin: 0 0 18px 0;
  font-weight: 500;
  transition: color 0.3s ease;
}

.hero-location,
.hero-bio {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
  transition: color 0.3s ease;
}

/* 个人介绍区域优化 */
.hero-bio {
  margin: 18px 0 0 0;
  max-width: 600px;
}

.hero-bio p {
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

.hero-link {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* Posts Section */
.posts-section {
  margin-bottom: 35px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 16px 0;
  transition: color 0.3s ease;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  margin-bottom: 10px;
  position: relative;
  padding-left: 16px; /* 为bullet点留出空间 */
  display: flex;
  align-items: baseline;
}

.post-item::before {
  content: "• ";
  color: #ccc;
  margin-right: 8px;
  position: absolute;
  left: 0;
  top: 0;
}

.post-date {
  color: var(--text-muted);
  font-size: 14px;
  margin-right: 12px;
  transition: color 0.3s ease;
  width: 110px; /* 增加宽度以容纳完整日期 */
  flex-shrink: 0; /* 防止压缩 */
  font-family: 'Courier New', monospace; /* 使用等宽字体 */
}

.post-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  position: relative;
  transition: color 0.3s ease;
}

.post-link:hover {
  text-decoration: none; /* 移除整个链接的下划线 */
}

.post-link:hover::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background-color: var(--link-color);
}

/* Article Styles */
.article {
  max-width: 100%;
}

.article-header {
  margin-bottom: 30px;
}

.article-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 15px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.article-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

.article-date {
  color: var(--text-muted);
  transition: color 0.3s ease;
  font-size: 14px;
  font-weight: normal;
}

.article-category-inline {
  color: var(--link-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.article-category-inline:hover {
  text-decoration: underline;
}

.meta-separator {
  color: var(--text-color);
  font-weight: bold;
  margin: 0 8px;
  font-size: 16px;
  transition: color 0.3s ease;
}

/* 文章底部标签样式 */
.article-tags-footer {
  margin: 30px 0 20px 0;
  padding: 15px 0;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.article-tag-footer {
  color: var(--link-color);
  text-decoration: none;
  margin-right: 15px;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
}

.article-tag-footer::before {
  content: '#';
  color: var(--text-color);
  transition: color 0.3s ease;
}

.article-tag-footer:hover {
  text-decoration: none;
}

.article-tag-footer:hover::after {
  content: '';
  position: absolute;
  left: 0.6em;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--link-color);
}

.article-content {
  color: var(--text-color);
  line-height: 1.7;
  font-size: 16px;
  transition: color 0.3s ease;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: var(--text-color);
  font-weight: 600;
  margin: 30px 0 15px 0;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.article-content h1 {
  font-size: 28px;
}

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

.article-content h3 {
  font-size: 20px;
}

.article-content p {
  margin: 0 0 16px 0;
}

.article-content a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content ul,
.article-content ol {
  padding-left: 20px;
  margin: 0 0 16px 0;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  margin: 20px 0;
  padding: 0 20px;
  border-left: 3px solid var(--border-color);
  color: var(--text-muted);
  font-style: italic;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.article-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Monaco', 'Consolas', sans-serif, monospace;
  font-size: 14px;
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.article-content pre {
  background: var(--code-bg);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 20px 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.article-content pre code {
  background: none;
  padding: 0;
  white-space: pre;
  word-wrap: normal;
}

/* 图片响应式处理 */
.article-content img,
.page-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 5px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.3s ease;
}

/* 照片画廊样式 */
.gallery {
  display: grid;
  gap: 15px;
  margin: 30px 0;
}

/* 旧的折叠功能样式已移除，现在使用新的Gallery路由系统 */

.gallery-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 0;
  display: block;
}

.gallery img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Gallery页面相册封面样式 - 单页面切换方案 */
.page[data-page-type="gallery"] .page-content h2 + p img[title],
body[data-gallery-page] .page-content h2 + p img[title] {
  width: 100%;
  max-width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow);
  margin: 0 auto;
  display: block;
}

.page[data-page-type="gallery"] .page-content h2 + p img[title]:hover,
body[data-gallery-page] .page-content h2 + p img[title]:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px var(--shadow);
}

/* Gallery页面的h2标题样式 */
.page[data-page-type="gallery"] .page-content h2,
body[data-gallery-page] .page-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 40px 0 15px 0;
  text-align: center;
}

/* 相册详情页面样式 */
.page[data-page-type="gallery"] .album-header,
body[data-gallery-page] .album-header {
  margin-top: -10px; /* 向上靠近页面标题 */
  margin-bottom: 40px;
  padding-bottom: 0px;
  border-bottom: none;
  text-align: left; /* 改为左对齐 */
}

.page[data-page-type="gallery"] .album-header h1,
body[data-gallery-page] .album-header h1 {
  display: block; /* 显示相册标题 */
  font-size: 48px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 15px 0;
  line-height: 1.1;
}

.page[data-page-type="gallery"] .album-header .album-description,
body[data-gallery-page] .album-header .album-description {
  font-size: 16px; /* 调小字体 */
  color: #999; /* 调成更浅的灰色，类似图2的效果 */
  margin: 0 0 30px 0; /* 保持与图片的距离 */
  font-weight: 400;
  line-height: 1.4;
  margin-top: -10px; /* 让描述更靠近标题 */
}

/* Gallery页面的h3描述样式 */
.page[data-page-type="gallery"] h3,
body[data-gallery-page] h3 {
  font-size: 16px;
  color: #999;
  font-weight: 400;
  line-height: 1.4;
  margin: -10px 0 30px 0; /* 让描述更靠近标题 */
}


.page[data-page-type="gallery"] .album-header p,
body[data-gallery-page] .album-header p {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

/* 相册内容图片网格 */
.page[data-page-type="gallery"] .album-content,
body[data-gallery-page] .album-content {
  margin-top: 30px;
}

.page[data-page-type="gallery"] .album-content.active,
body[data-gallery-page] .album-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.page[data-page-type="gallery"] .album-content .gallery-grid,
body[data-gallery-page] .album-content .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.page[data-page-type="gallery"] .album-content img,
body[data-gallery-page] .album-content img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 0;
  display: block;
}

.page[data-page-type="gallery"] .album-content img:hover,
body[data-gallery-page] .album-content img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 返回按钮 */
.back-to-albums {
  background: var(--link-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin: 0 auto 20px auto;
  display: block;
  transition: background 0.3s ease;
}

.back-to-albums:hover {
  background: var(--link-hover);
}

/* 相册详情页面时，取消网格布局 - 通过JavaScript动态添加class */
.page[data-page-type="gallery"] .page-content.album-view,
body[data-gallery-page] .page-content.album-view {
  display: block;
}

/* Gallery页面整体布局 - 重新设计 */
.page[data-page-type="gallery"] .page-content:not(.album-view),
body[data-gallery-page] .page-content:not(.album-view) {
  display: block; /* 先用普通布局 */
}

/* Gallery页面标题 */
.page[data-page-type="gallery"] .page-content:not(.album-view) > h1,
body[data-gallery-page] .page-content:not(.album-view) > h1 {
  text-align: center;
  margin-bottom: 20px;
}

/* Gallery页面描述段落 */
.page[data-page-type="gallery"] .page-content:not(.album-view) > p:first-of-type,
body[data-gallery-page] .page-content:not(.album-view) > p:first-of-type {
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-muted);
}

/* 相册网格容器 */
.page[data-page-type="gallery"] .albums-grid,
body[data-gallery-page] .albums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 30px; /* 水平间距30px，垂直间距增加为标题留空间 */
  row-gap: 70px; /* 行间距增加，为标题留出更多空间 */
  margin-top: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 每个相册项 */
.page[data-page-type="gallery"] .album-item,
body[data-gallery-page] .album-item {
  text-align: center;
  position: relative; /* 为绝对定位的标题提供相对定位容器 */
}

/* 相册标题 */
.page[data-page-type="gallery"] .album-item h2,
body[data-gallery-page] .album-item h2 {
  font-size: 20px; /* 调小字体 */
  font-weight: 300; /* 更细的字重 */
  color: var(--text-color);
  margin: 10px 0 0 0; /* 调整边距，放在图片下方 */
  text-align: left; /* 左对齐 */
  position: absolute; /* 绝对定位 */
  bottom: -45px; /* 位于图片下方，增加10px距离 */
  left: calc(50% - 110px); /* 居中位置减去图片宽度的一半，与图片左边对齐 */
  width: 220px; /* 与图片宽度一致 */
}

/* 相册封面 */
.page[data-page-type="gallery"] .album-item .album-cover,
body[data-gallery-page] .album-item .album-cover {
  margin: 0;
}

.page[data-page-type="gallery"] .album-item .album-cover img,
body[data-gallery-page] .album-item .album-cover img {
  width: 220px !important;
  height: 220px !important;
  max-width: none !important;
  object-fit: cover;
  border-radius: 0; /* 移除圆角 */
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow);
  margin: 0 auto;
  display: block;
}

.page[data-page-type="gallery"] .album-item .album-cover img:hover,
body[data-gallery-page] .album-item .album-cover img:hover {
  /* 多种悬浮效果组合 */
  transform: scale(1.05); /* 轻微放大 */
  box-shadow: 0 8px 25px var(--shadow); /* 加深阴影 */
  filter: brightness(1.1) contrast(1.05); /* 提高亮度和对比度 */
}

/* 响应式设计 */
@media (max-width: 768px) {
  /* Gallery页面响应式 */
  .page[data-page-type="gallery"] .albums-grid,
  body[data-gallery-page] .albums-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    row-gap: 70px; /* 移动端也保持行间距 */
  }
  
  .page[data-page-type="gallery"] .album-item .album-cover img,
  body[data-gallery-page] .album-item .album-cover img {
    width: 250px !important;
    height: 250px !important;
    border-radius: 0 !important; /* 确保移动端也没有圆角 */
  }
  
  .page[data-page-type="gallery"] .album-item h2,
  body[data-gallery-page] .album-item h2 {
    width: 250px; /* 移动端标题宽度匹配图片 */
    left: calc(50% - 125px); /* 移动端对齐：居中位置减去图片宽度的一半 */
  }
  
  .page[data-page-type="gallery"] .album-content .gallery-grid,
  body[data-gallery-page] .album-content .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .page[data-page-type="gallery"] .album-header h1,
  body[data-gallery-page] .album-header h1 {
    font-size: 28px;
  }
  
  .gallery-3,
  .gallery-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery img {
    height: 180px; /* 稍微减小移动端图片高度 */
  }
}

@media (max-width: 480px) {
  /* Gallery页面小屏幕响应式 */
  .page[data-page-type="gallery"] .albums-grid,
  body[data-gallery-page] .albums-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    row-gap: 50px; /* 小屏幕行间距稍小 */
  }
  
  .page[data-page-type="gallery"] .album-item .album-cover img,
  body[data-gallery-page] .album-item .album-cover img {
    width: 200px !important;
    height: 200px !important;
    border-radius: 0 !important; /* 确保小屏幕也没有圆角 */
  }
  
  .page[data-page-type="gallery"] .album-item h2,
  body[data-gallery-page] .album-item h2 {
    width: 200px; /* 小屏幕标题宽度匹配图片 */
    left: calc(50% - 100px); /* 小屏幕对齐：居中位置减去图片宽度的一半 */
  }
  
  .page[data-page-type="gallery"] .album-content .gallery-grid,
  body[data-gallery-page] .album-content .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .page[data-page-type="gallery"] .album-header h1,
  body[data-gallery-page] .album-header h1 {
    font-size: 24px;
  }
  
  /* 保持2列布局，只有在极小屏幕才变单列 */
  .gallery-3,
  .gallery-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery img {
    height: 150px; /* 进一步优化小屏幕图片高度 */
  }
}

@media (max-width: 360px) {
  /* 只有在极小屏幕（如老式手机）才使用单列 */
  .gallery-2,
  .gallery-3,
  .gallery-4 {
    grid-template-columns: 1fr;
  }
  
  .gallery img {
    height: 200px;
  }
}

/* 表格响应式处理 */
.article-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

.article-content table th,
.article-content table td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
  color: var(--text-color);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.article-content table th {
  background-color: var(--code-bg);
  font-weight: 600;
  transition: background-color 0.3s ease;
}

/* 长链接处理 */
.article-content a {
  word-break: break-word;
}

/* 代码高亮样式已移至 highlight.css 文件 */

/* Article Navigation */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.article-nav-link {
  color: var(--link-color);
  transition: color 0.3s ease;
  text-decoration: none;
  max-width: 45%;
}

.article-nav-link:hover {
  text-decoration: underline;
}

.article-nav-next {
  text-align: right;
  margin-left: auto;
}

.article-nav-caption {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.article-nav-title {
  display: block;
  font-weight: 500;
}

/* 文章目录样式 */
.post-container {
  position: relative;
}

.article {
  /* 保持原有文章宽度不变 */
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  min-width: 0; /* 确保flex子元素可以收缩 */
  overflow-wrap: break-word; /* 处理长单词 */
}

.toc-sidebar {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(420px, -50%); /* 840px/2 = 420px，紧贴article+padding的右边界 */
  width: 240px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 1000;
}

.toc-container {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-left: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 16px 16px 20px;
  box-shadow: 0 2px 12px var(--shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.toc-header {
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: block;
  padding: 6px 0;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 0;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 400;
}

.toc-link:hover {
  color: var(--text-muted);
}

.toc-link.active {
  color: var(--text-color);
  font-weight: 600;
}

.toc-link.active::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--link-color);
  border-radius: 1.5px;
}

/* 不同级别标题的缩进 - 更精细的层级 */
.toc-level-1 { padding-left: 0px; }
.toc-level-2 { padding-left: 12px; }
.toc-level-3 { padding-left: 24px; font-size: 12px; }
.toc-level-4 { padding-left: 36px; font-size: 12px; }
.toc-level-5 { padding-left: 48px; font-size: 12px; }
.toc-level-6 { padding-left: 60px; font-size: 12px; }

/* 活跃状态的字体重量覆盖 */
.toc-level-1.active { font-weight: 700; }
.toc-level-2.active { font-weight: 600; }
.toc-level-3.active { font-weight: 600; }
.toc-level-4.active { font-weight: 600; }
.toc-level-5.active { font-weight: 600; }
.toc-level-6.active { font-weight: 600; }

/* 只在宽屏上显示固定目录 */
@media (max-width: 1400px) {
  .toc-sidebar {
    display: none;
  }
}

/* 针对超宽屏幕优化目录位置 */
@media (min-width: 1600px) {
  .toc-sidebar {
    transform: translate(420px, -50%); /* 保持紧贴边界 */
  }
}

/* Footer */
.footer {
  padding: 35px 0;
  text-align: center;
  margin-top: 60px;
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

.footer-text {
  color: var(--text-muted);
  margin: 0 0 10px 0;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-link {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-emoji {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .header {
    padding: 20px 0 25px;
  }
  
  .site-title {
    font-size: 18px;
    margin-bottom: 15px;
  }
  
  .nav-link {
    margin: 0 8px;
    font-size: 14px;
  }
  
  .hero {
    margin-bottom: 25px;
  }
  
  .hero-title {
    font-size: 24px;
    margin-bottom: 12px;
  }
  
  .hero-description {
    font-size: 15px;
    margin-bottom: 12px;
  }
  
  .hero-bio {
    font-size: 14px;
    margin: 15px 0 10px 0;
    max-width: 100%;
  }
  
  .hero-bio p {
    font-size: 14px;
    margin: 0 0 10px 0;
    line-height: 1.5;
  }
  
  .posts-section {
    margin-bottom: 20px;
  }
  
  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .post-item {
    margin-bottom: 8px;
    padding: 4px 0;
    padding-left: 16px; /* 保持为bullet点留出空间 */
    line-height: 1.4; /* 设置行高 */
  }
  
  .post-item::before {
    top: 50% !important; /* 垂直居中 */
    transform: translateY(-50%) !important; /* 精确居中 */
    line-height: 1 !important; /* 重置bullet点的行高 */
  }
  
  .post-date {
    margin-right: 8px; /* 保持日期和标题之间的间距 */
    font-size: 13px;
  }
  
  .post-link {
    font-size: 14px;
  }
  
  .footer {
    padding: 20px 0;
    margin-top: 20px;
  }
  
  /* Single Screen mobile optimization */
  .single-screen .header {
    padding: 8px 0 12px;
  }
  
  .single-screen .site-title {
    font-size: 16px;
    margin: 0 0 6px 0;
  }
  
  .single-screen .nav-link {
    margin: 0 6px;
    font-size: 12px;
  }
  
  .single-screen .hero {
    margin-bottom: 12px;
  }
  
  .single-screen .hero-title {
    font-size: 18px;
    margin: 0 0 6px 0;
  }
  
  .single-screen .hero-description {
    font-size: 13px;
    margin: 0 0 6px 0;
  }
  
  .single-screen .hero-bio {
    font-size: 12px;
    margin: 0 0 5px 0;
  }
  
  .single-screen .posts-section {
    margin-bottom: 10px;
  }
  
  .single-screen .section-title {
    font-size: 14px;
    margin: 0 0 6px 0;
  }
  
  .single-screen .post-item {
    margin-bottom: 2px;
  }
  
  .single-screen .post-link {
    font-size: 12px;
  }
  
  .single-screen .footer {
    padding: 8px 0;
    margin-top: 8px;
  }
  
  .single-screen .footer-text {
    font-size: 11px;
  }
  
  .article-title {
    font-size: 28px;
  }
  
  .article-nav {
    flex-direction: column;
    gap: 20px;
  }
  
  .article-nav-link {
    max-width: 100%;
  }
  
  .article-nav-next {
    text-align: right;
  }
  
  /* 移动端内容溢出处理 */
  .article-content pre {
    padding: 10px;
    font-size: 13px;
    margin: 15px -10px; /* 负边距让代码块可以使用更多空间 */
  }
  
  /* 移动端代码高亮优化 */
  .article-content .highlight {
    margin: 15px -10px;
    border-radius: 0;
    box-shadow: none;
  }
  
  /* 移动端Copy按钮 */
  .article-content .highlight::after {
    opacity: 1; /* 移动端始终显示 */
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .article-content .highlight .gutter {
    padding: 8px 6px;
    width: 30px;
  }
  
  .article-content .highlight .gutter pre {
    font-size: 12px;
  }
  
  .article-content .highlight .code {
    padding: 8px 12px;
  }
  
  .article-content .highlight .code pre {
    font-size: 13px;
  }
  
  .article-content img,
  .page-content img {
    margin: 15px auto;
    max-width: calc(100% + 20px); /* 允许图片使用padding空间 */
    margin-left: -10px;
    margin-right: -10px;
  }
  
  .article-content table {
    font-size: 14px;
    margin: 15px -10px;
  }
  
  .article-content table th,
  .article-content table td {
    padding: 6px 8px;
  }
  
  /* 移动端目录样式 */
  .toc-sidebar {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-height: none;
    margin-bottom: 20px;
    order: -1;
  }
  
  .toc-container {
    background: #f8f9fa;
    backdrop-filter: none;
    border: 1px solid #e9ecef;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 15px 0 20px;
  }
  
  .hero {
    margin-bottom: 20px;
  }
  
  .hero-title {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .hero-description {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .hero-bio {
    font-size: 13px;
    margin: 12px 0 8px 0;
  }
  
  .hero-bio p {
    font-size: 13px;
    margin: 0 0 8px 0;
    line-height: 1.4;
  }
  
  .posts-section {
    margin-bottom: 15px;
  }
  
  .section-title {
    font-size: 15px;
    margin-bottom: 10px;
  }
  
  .post-item {
    margin-bottom: 5px;
  }
  
  .post-link {
    font-size: 13px;
  }
  
  /* Ultra compact for small screens */
  .single-screen .header {
    padding: 6px 0 10px;
  }
  
  .single-screen .site-title {
    font-size: 15px;
    margin: 0 0 5px 0;
  }
  
  .single-screen .nav-link {
    margin: 0 5px;
    font-size: 11px;
  }
  
  .single-screen .hero {
    margin-bottom: 8px;
  }
  
  .single-screen .hero-title {
    font-size: 16px;
    margin: 0 0 5px 0;
  }
  
  .single-screen .hero-description {
    font-size: 12px;
    margin: 0 0 5px 0;
  }
  
  .single-screen .hero-bio {
    font-size: 11px;
    margin: 0 0 4px 0;
    line-height: 1.2;
  }
  
  .single-screen .posts-section {
    margin-bottom: 8px;
  }
  
  .single-screen .section-title {
    font-size: 13px;
    margin: 0 0 5px 0;
  }
  
  .single-screen .post-item {
    margin-bottom: 2px;
  }
  
  .single-screen .post-link {
    font-size: 11px;
    line-height: 1.1;
  }
  
  .single-screen .footer {
    padding: 6px 0;
    margin-top: 6px;
  }
  
  .single-screen .footer-text {
    font-size: 10px;
    margin: 0 0 2px 0;
  }
  
  .article-title {
    font-size: 22px;
  }
  
  .footer {
    padding: 15px 0;
    margin-top: 15px;
  }
  
      .footer-text {
      font-size: 12px;
    }
  }
  
  /* Ultra short screens (landscape phones) */
  @media (max-height: 600px) {
    .single-screen .header {
      padding: 5px 0 8px;
    }
    
    .single-screen .site-title {
      font-size: 14px;
      margin: 0 0 4px 0;
    }
    
    .single-screen .nav-link {
      margin: 0 4px;
      font-size: 10px;
    }
    
    .single-screen .hero {
      margin-bottom: 6px;
    }
    
    .single-screen .hero-title {
      font-size: 15px;
      margin: 0 0 4px 0;
    }
    
    .single-screen .hero-description {
      font-size: 11px;
      margin: 0 0 4px 0;
    }
    
    .single-screen .posts-section {
      margin-bottom: 6px;
    }
    
    .single-screen .section-title {
      font-size: 12px;
      margin: 0 0 4px 0;
    }
    
    .single-screen .post-item {
      margin-bottom: 1px;
    }
    
    .single-screen .post-link {
      font-size: 10px;
      line-height: 1.0;
    }
    
    .single-screen .footer {
      padding: 4px 0;
      margin-top: 4px;
    }
    
    .single-screen .footer-text {
      font-size: 9px;
      margin: 0 0 1px 0;
    }
  }
  
  /* Extremely short screens */
  @media (max-height: 500px) {
    .single-screen .header {
      padding: 3px 0 5px;
    }
    
    .single-screen .site-title {
      font-size: 13px;
      margin: 0 0 3px 0;
    }
    
    .single-screen .nav-link {
      margin: 0 3px;
      font-size: 9px;
    }
    
    .single-screen .hero {
      margin-bottom: 4px;
    }
    
    .single-screen .hero-title {
      font-size: 14px;
      margin: 0 0 3px 0;
    }
    
    .single-screen .hero-description {
      font-size: 10px;
      margin: 0 0 3px 0;
    }
    
    .single-screen .posts-section {
      margin-bottom: 4px;
    }
    
    .single-screen .section-title {
      font-size: 11px;
      margin: 0 0 3px 0;
    }
    
    .single-screen .post-item {
      margin-bottom: 1px;
    }
    
    .single-screen .post-link {
      font-size: 9px;
      line-height: 1.0;
    }
    
    .single-screen .footer {
      padding: 3px 0;
      margin-top: 3px;
    }
    
    .single-screen .footer-text {
      font-size: 8px;
      margin: 0;
    }
  }  

/* Blogs Page Styles */
.blogs-page {
  max-width: 100%;
}

.blogs-page .page-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 40px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

/* 简洁列表样式 */
.posts-simple-list {
  max-width: 100%;
}

.simple-post-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 8px 0;
}

.simple-post-date {
  color: var(--text-muted);
  font-size: 14px;
  width: 100px;
  flex-shrink: 0;
  margin-right: 20px;
  font-family: 'Monaco', 'Consolas', monospace;
  transition: color 0.3s ease;
  display: inline !important; /* 强制内联显示 */
}

.simple-post-content {
  display: inline !important; /* 强制内联显示 */
  flex: 1;
}

.simple-post-categories {
  margin-right: 8px;
}

.simple-post-category {
  color: var(--link-color);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.simple-post-category:hover {
  text-decoration: underline;
}

.simple-post-separator {
  color: var(--text-light);
  margin-right: 8px;
  font-size: 14px;
  transition: color 0.3s ease;
}

.simple-post-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  transition: color 0.3s ease;
  display: inline !important; /* 强制内联显示 */
}

.simple-post-link:hover {
  text-decoration: underline;
}

/* 分页样式 */
.pagination {
  margin-top: 40px; /* 减少上边距，因为不需要为分页信息预留空间 */
  padding-top: 20px;
  margin-bottom: 120px;
}

.pagination-info {
  display: none; /* 隐藏分页信息，节省空间 */
}

.pagination-nav {
  display: flex;
  justify-content: center; /* 居中显示页码按钮 */
  align-items: center;
  min-height: 40px;
  margin-top: -10px; /* 向上移动，占据原分页信息的位置 */
}

/* Previous/Next按钮样式已移除，现在只使用页码按钮 */

.pagination-numbers {
  display: flex;
  gap: 8px;
  justify-content: center; /* 居中显示页码按钮 */
  flex-wrap: wrap; /* 允许页码按钮换行 */
}

.pagination-number {
  /* 基础样式，JavaScript会覆盖这些 */
  color: var(--link-color);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
}

.pagination-number:hover {
  background-color: var(--border-color);
  text-decoration: none;
}

/* 当前页样式 - 蓝色背景，白色文字 */
.pagination-number.pagination-current {
  background-color: var(--link-color) !important;
  color: var(--bg-color) !important;
  border: none !important;
  cursor: default !important;
}

/* 禁用状态的按钮也应该是蓝色（当前页） */
.pagination-number:disabled {
  background-color: var(--link-color) !important;
  color: var(--bg-color) !important;
  border: none !important;
  cursor: default !important;
}

/* 当前页悬停时显示禁止光标（红圈） */
.pagination-number.pagination-current:hover,
.pagination-number:disabled:hover {
  cursor: not-allowed !important;
}

/* 非当前页的悬停效果 */
.pagination-number:not(:disabled):hover {
  background-color: var(--border-color) !important;
  color: var(--link-color);
  text-decoration: none;
}

/* 确保非当前页的基础样式 */
.pagination-number:not(.pagination-current):not(:disabled) {
  background-color: var(--bg-color);
  color: var(--link-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

/* 省略号样式 */
.pagination-ellipsis {
  display: inline-block;
  padding: 6px 8px;
  margin: 0 2px;
  color: var(--text-muted);
  font-size: 14px;
  user-select: none;
  cursor: default;
  transition: color 0.3s ease;
}

/* 响应式适配 - Blogs页面 */
@media (max-width: 768px) {
  .simple-post-item {
    flex-direction: row !important; /* 保持水平布局 */
    align-items: baseline !important;
    margin-bottom: 12px;
    padding: 8px 0;
  }
  
  .simple-post-date {
    width: auto;
    min-width: 80px;
    margin-right: 8px !important; /* 保持右边距 */
    margin-bottom: 0 !important; /* 移除底边距 */
    font-size: 13px;
  }
  
  .simple-post-link {
    font-size: 15px;
  }

  /* Archive 页面移动端适配 */
  .archive-post-item {
    margin-bottom: 12px;
    padding: 8px 0;
  }
  
  .archive-post-date {
    width: auto;
    min-width: 70px;
    font-size: 13px;
    margin-right: 8px;
  }
  
  .archive-post-link {
    font-size: 15px;
    line-height: 1.4;
  }
  
  /* 移动端分页样式 */
  .pagination {
    margin-top: 30px; /* 进一步减少移动端上边距 */
    padding-top: 15px;
    margin-bottom: 120px; /* 优化底部边距 */
  }
  
  .pagination-nav {
    justify-content: center; /* 移动端也居中显示 */
  }
  
  .pagination-numbers {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  /* Previous/Next按钮样式已移除 */
}

@media (max-width: 480px) {
  .blogs-page .page-title {
    font-size: 28px;
    margin: 0 0 30px 0;
  }
  
  .simple-post-date {
    font-size: 12px;
  }
  
  .simple-post-link {
    font-size: 14px;
  }

  /* Archive 页面超小屏幕适配 */
  .archive-post-date {
    font-size: 12px;
  }
  
  .archive-post-link {
    font-size: 14px;
  }
  
  /* 超小屏幕的分页调整 */
  .pagination {
    margin-top: 25px; /* 进一步减少超小屏幕上边距 */
    padding-top: 10px;
    margin-bottom: 130px; /* 适度的底部空间 */
  }
  
  .pagination-number {
    font-size: 12px !important;
    padding: 8px 12px !important;
    margin: 2px !important;
  }
}

/* 针对极小高度屏幕（如开发者工具打开时）的特殊处理 */
@media (max-height: 700px) {
  /* 中等高度屏幕：页脚改为固定定位，避免覆盖 */
  .blogs-page-layout .footer,
  .homepage .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 15px 0; /* 减少页脚高度 */
  }
  
  .pagination {
    margin-top: 25px; /* 减少上边距 */
    padding-top: 10px;
    margin-bottom: 70px; /* 为固定页脚留出更少空间 */
  }
}

@media (max-height: 500px) {
  /* 极小高度：进一步优化布局 */
  .pagination {
    margin-top: 20px; /* 最小化上边距 */
    padding-top: 8px;
    margin-bottom: 75px; /* 优化底部边距 */
  }
  
  .pagination-nav {
    gap: 8px !important;
  }
  
  .pagination-number {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  
  .blogs-page-layout .footer,
  .homepage .footer {
    padding: 15px 0;
  }
}

/* Archive Page Styles */
.archive {
  max-width: 100%;
}

.archive-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 15px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.archive-description {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 40px 0;
  transition: color 0.3s ease;
}

.archive-year {
  margin-bottom: 40px;
}

.archive-year-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.archive-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-post-item {
  margin-bottom: 15px;
  display: flex;
  align-items: baseline;
}

.archive-post-date {
  color: var(--text-muted);
  font-size: 14px;
  width: 80px;
  flex-shrink: 0;
  margin-right: 20px;
  transition: color 0.3s ease;
  display: inline !important; /* 强制内联显示 */
}

.archive-post-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
  display: inline !important; /* 强制内联显示 */
  flex: 1;
}

.archive-post-link:hover {
  text-decoration: underline;
}

/* Tag Page Styles */
.tag-page {
  max-width: 100%;
}

.tag-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 30px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.tag-post-list {
  padding: 0;
  margin: 0;
}

.tag-post-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 8px 0;
}

.tag-post-date {
  color: var(--text-muted);
  font-size: 14px;
  min-width: 100px;
  margin-right: 20px;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.tag-post-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  flex: 1;
  transition: color 0.3s ease;
}

.tag-post-link:hover {
  text-decoration: underline;
}

/* Category Page Styles */
.category-page {
  max-width: 100%;
}

.category-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 30px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.category-post-list {
  padding: 0;
  margin: 0;
}

.category-post-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 8px 0;
}

.category-post-date {
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.3s ease;
  min-width: 100px;
  margin-right: 20px;
  flex-shrink: 0;
}

.category-post-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  flex: 1;
  transition: color 0.3s ease;
}

.category-post-link:hover {
  text-decoration: underline;
}

/* Page Styles */
.page {
  max-width: 100%;
}

.page-header {
  margin-bottom: 30px;
}

.page-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 15px 0;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.page-content {
  color: var(--text-color);
  line-height: 1.7;
  font-size: 16px;
  transition: color 0.3s ease;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
  color: var(--text-color);
  font-weight: 600;
  margin: 30px 0 15px 0;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.page-content h1 {
  font-size: 28px;
}

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

.page-content h3 {
  font-size: 20px;
}

.page-content p {
  margin: 0 0 16px 0;
}

.page-content a {
  color: var(--link-color);
  transition: color 0.3s ease;
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

.page-content ul,
.page-content ol {
  padding-left: 20px;
  margin: 0 0 16px 0;
}

.page-content li {
  margin-bottom: 8px;
}

.page-content blockquote {
  margin: 20px 0;
  padding: 0 20px;
  border-left: 3px solid var(--border-color);
  color: var(--text-muted);
  font-style: italic;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.page-content code {
  background: var(--code-bg);
  color: var(--text-color);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-content pre {
  background: var(--code-bg);
  color: var(--text-color);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 20px 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-content pre code {
  background: none;
  padding: 0;
} 

/* Edge兼容性 - 强制显示分页元素 */
#pagination {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pagination-nav {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#pagination-numbers {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  justify-content: center !important; /* 强制居中显示 */
  flex-wrap: wrap !important; /* 强制允许换行 */
}

/* Previous/Next按钮ID选择器已移除 */

.pagination-number {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--bg-color) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--link-color) !important;
  padding: 6px 12px !important;
  margin: 0 2px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
}

.pagination-number.pagination-current {
  background: var(--link-color) !important;
  color: var(--bg-color) !important;
}

#prev-btn:disabled,
#next-btn:disabled {
  background: #f5f5f5 !important;
  color: #ccc !important;
  cursor: not-allowed !important;
} 

/* 针对10条以内记录的滚动条优化 */
.blogs-page-layout {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden; /* 防止水平滚动条 */
}

/* 当记录数量较少时的特殊优化 */
@media (min-height: 800px) {
  /* 正常桌面屏幕：减少不必要的边距 */
  .pagination {
    margin-top: 35px;
    padding-top: 18px;
    margin-bottom: 90px; /* 标准底部边距 */
  }
}

@media (min-height: 900px) {
  /* 大屏幕：进一步减少边距 */
  .pagination {
    margin-top: 35px;
    padding-top: 15px;
    margin-bottom: 70px; /* 减少底部边距 */
  }
  
  .blogs-page-layout .footer,
  .homepage .footer {
    position: absolute; /* 恢复绝对定位 */
    bottom: 40px;
  }
}

@media (min-height: 1000px) {
  /* 超大屏幕：最小边距 */
  .pagination {
    margin-top: 40px;
    padding-top: 20px;
    margin-bottom: 50px; /* 最小化底部边距 */
  }
}

/* 页面内容高度控制 */
.blogs-page .container {
  min-height: calc(100vh - 200px); /* 为页脚预留空间 */
}

/* 隐藏不必要的滚动条 */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* 基于屏幕高度的动态优化 - 避免不必要的滚动条 */
@media (min-height: 600px) and (max-height: 799px) {
  /* 中等高度屏幕的平衡设置 */
  .pagination {
    margin-top: 30px;
    padding-top: 15px;
    margin-bottom: 100px; /* 平衡的底部边距 */
  }
}

@media (min-height: 1200px) {
  /* 超高屏幕：最优化设置，确保10条记录无滚动条 */
  .pagination {
    margin-top: 45px;
    padding-top: 25px;
    margin-bottom: 40px; /* 最优化底部边距 */
  }
  
  .blogs-page-layout .footer,
  .homepage .footer {
    bottom: 60px;
  }
} 