/* ------------------------------------
 * Nebula Typecho Theme
 * 现代化Typecho主题
 * --------------------------------- */

/* CSS变量 - 支持深色/浅色模式 */
:root {
  /* 浅色模式颜色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --accent-primary: #007bff;
  --accent-secondary: #6610f2;
  --border-color: #dee2e6;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-strong: rgba(0, 0, 0, 0.25);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  
  /* 动画时长 */
  --transition-fast: 0.2s;
  --transition-medium: 0.3s;
  --transition-slow: 0.5s;
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* 深色模式 */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #404040;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
  --accent-primary: #4dabf7;
  --accent-secondary: #845ef7;
  --border-color: #404040;
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-strong: rgba(0, 0, 0, 0.6);
}

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 全局过渡效果 - 用于深色模式切换 */
.theme-transition-enabled *, 
.theme-transition-enabled *::before, 
.theme-transition-enabled *::after {
  transition-property: background-color, border-color, color, box-shadow, opacity, transform;
  transition-duration: var(--transition-slow);
  transition-timing-function: ease;
}

/* 主题切换动画 */
.theme-changing {
  animation: theme-fade 0.5s ease;
}

@keyframes theme-fade {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color var(--transition-slow) ease,
              color var(--transition-slow) ease;
  overflow-x: hidden;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* 链接样式 */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all var(--transition-fast) ease;
  position: relative;
}

a:hover {
  color: var(--accent-secondary);
  transform: translateY(-1px);
}

a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--accent-primary);
  transition: width var(--transition-medium) ease;
}

a:hover::after {
  width: 100%;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

/* 表单元素 */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast) ease;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  transform: translateY(-1px);
}

button,
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-primary);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

button:hover,
.btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow-medium);
}

/* 代码块样式 */
pre, code {
  font-family: "Fira Code", "Courier New", monospace;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: var(--accent-secondary);
}

pre {
  padding: 1.5rem;
  overflow-x: auto;
  line-height: 1.5;
  border-left: 4px solid var(--accent-primary);
  margin: 1.5rem 0;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
}

/* 引用样式 */
blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);  
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  position: relative;
  box-shadow: 0 4px 15px var(--shadow-light);
}

blockquote::before {
  content: '"';
  font-size: 4rem;
  color: var(--accent-primary);
  position: absolute;
  top: -10px;
  left: 20px;
  opacity: 0.3;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow-x: auto;
  display: block;
  box-shadow: 0 4px 15px var(--shadow-light);
}

table th,
table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

table tr:hover {
  background: var(--bg-secondary);
}

/* --------------- 头部样式 --------------- */
#header {
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-medium) ease;
}

/* 阅读进度条 */
.reading-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.1s ease;
  z-index: 1001;
  box-shadow: 0 1px 5px var(--shadow-medium);
}

#header.scrolled {
  box-shadow: 0 4px 30px var(--shadow-medium);
}

.header-content {
  padding: 1rem 0;
}

/* Logo样式 */
#logo {
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--transition-medium) ease;
}

#logo:hover {
  transform: scale(1.05);
}

#logo img {
  max-height: 50px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast) ease;
}

#logo:hover img {
  transform: scale(1.1) rotate(5deg);
}

.description {
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.95rem;
}

/* 导航菜单 */
#nav-menu {
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* 移动菜单按钮 - 默认隐藏 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  box-shadow: 0 2px 10px var(--shadow-light);
  transition: all var(--transition-fast) ease;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active {
  background: var(--accent-primary);
  box-shadow: 0 4px 15px var(--shadow-medium);
}

.mobile-menu-toggle.active span {
  background: white;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

#nav-menu a {
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-fast) ease;
  position: relative;
  overflow: hidden;
}

#nav-menu a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  transition: left var(--transition-medium) ease;
  z-index: -1;
}

#nav-menu a:hover::before,
#nav-menu .current::before {
  left: 0;
}

#nav-menu a:hover,
#nav-menu .current {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow-medium);
}

#nav-menu a::after {
  display: none;
}

/* 主题切换按钮 */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--border-color);
  border-radius: 30px;
  cursor: pointer;
  transition: all var(--transition-medium) ease;
  margin-top: 1rem;
  overflow: hidden;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 50%;
  transition: all var(--transition-medium) cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 2px 5px var(--shadow-light);
  z-index: 2;
}

/* 主题图标 */
.theme-toggle .light-icon,
.theme-toggle .dark-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  transition: all var(--transition-medium) ease;
}

.theme-toggle .light-icon {
  right: 8px;
  color: var(--text-primary);
  opacity: 1;
}

.theme-toggle .dark-icon {
  left: 8px;
  color: var(--bg-primary);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle::before {
  transform: translateX(30px);
  background: var(--accent-primary);
}

[data-theme="dark"] .theme-toggle .light-icon {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .dark-icon {
  opacity: 1;
}

.theme-toggle:hover {
  background: var(--accent-primary);
}

/* 搜索框 */
#search {
  position: relative;
  margin-top: 1rem;
}

#search .search-container {
  position: relative;
  display: flex;
  align-items: center;
}

#search input {
  padding-right: 3rem;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 2px solid transparent;
}

#search input:focus {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
}

#search button {
  position: absolute;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--accent-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast) ease;
}

#search button:hover {
  background: var(--accent-secondary);
  transform: scale(1.1);
}

/* --------------- 主内容区域 --------------- */
#main {
  padding: 2rem 0;
}

/* 主布局 */
.main-layout {
  display: flex;
  gap: 2%;
  align-items: flex-start;
}
.main-content {
  flex: 0 0 72%;
  min-width: 0;
}
#secondary {
  flex: 0 0 26%;
  min-width: 0;
}
@media (max-width: 991px) {
  .main-layout {
    flex-direction: column;
    gap: 0;
  }
  .main-content, #secondary {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100%;
  }
  
  /* 修复主内容区域在平板设备上的显示 */
  #main {
    padding: 1rem 0;
  }
  
  .post, .widget {
    margin-bottom: 1.5rem;
  }
  
  /* 移动端头部布局优化 */
  #header {
    padding: 0.5rem 0;
  }
  
  .header-content {
    padding: 0.5rem 0;
  }
  
  .site-name {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .header-tools {
    justify-content: center;
    margin-bottom: 1rem;
    gap: 1rem;
    position: relative;
  }
  
  .theme-toggle {
    margin-top: 0;
    width: 50px;
    height: 26px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-light);
  }
  
  .theme-toggle::before {
    width: 20px;
    height: 20px;
    top: 2px;
    left: 2px;
  }
  
  [data-theme="dark"] .theme-toggle::before {
    transform: translateX(24px);
  }
  
  .theme-toggle .light-icon,
  .theme-toggle .dark-icon {
    font-size: 12px;
  }
  
  .theme-toggle .light-icon {
    right: 6px;
  }
  
  .theme-toggle .dark-icon {
    left: 6px;
  }
  
  /* 移动端导航菜单 */
  .mobile-menu-toggle {
    display: flex;
  }
  
  #nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium) ease;
    transform: translateY(-20px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px var(--shadow-medium);
    padding: 2rem;
  }
  
  #nav-menu.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  #nav-menu a {
    width: 80%;
    max-width: 300px;
    text-align: center;
    margin: 0.5rem 0;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInMenuItems 0.5s ease forwards;
    animation-delay: calc(0.1s * var(--item-index, 0));
  }
  
  @keyframes fadeInMenuItems {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* 菜单打开时禁止页面滚动 */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* 区块统一样式 */
.post, .widget {
  border-radius: 1.2rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  margin-bottom: 2rem;
  padding: 2rem;
}
@media (max-width: 991px) {
  .post, .widget {
    padding: 1rem;
    margin-bottom: 1.2rem;
  }
}

/* 侧栏区块内容对齐 */
.widget {
  text-align: left;
}

/* 文章卡片 */
.post {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: all var(--transition-medium) ease;
  position: relative;
  overflow: hidden;
}

.post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-fast) ease;
}

.post:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-medium);
}

.post:hover::before {
  opacity: 1;
}

.post-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.post-title a {
  color: var(--text-primary);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--transition-fast) ease;
}

.post-title a::after {
  display: none;
}

.post-title a:hover {
  transform: none;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 文章元数据 */
.post-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.post-meta li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast) ease;
}

.post-meta li:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.post-meta li::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--accent-primary);
}

.post-meta li:first-child::before { content: "\f007"; } /* 作者图标 */
.post-meta li:nth-child(2)::before { content: "\f017"; } /* 时间图标 */
.post-meta li:nth-child(3)::before { content: "\f07b"; } /* 分类图标 */
.post-meta li:last-child::before { content: "\f075"; } /* 评论图标 */

.post-meta a {
  color: inherit;
  transition: color var(--transition-fast) ease;
}

.post-meta a::after {
  display: none;
}

.post-meta a:hover {
  color: var(--accent-primary);
}

/* 文章内容 */
.post-content {
  line-height: 1.7;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.post-content p {
  margin-bottom: 1.5rem;
}

/* 修复可能的内容溢出问题 */
.post-content img,
.post-content video,
.post-content iframe,
.post-content embed,
.post-content object {
  max-width: 100%;
  height: auto;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px var(--shadow-light);
  transition: all var(--transition-medium) ease;
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px var(--shadow-medium);
}

/* 标签样式 */
.tags {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.tags a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin: 0.25rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all var(--transition-fast) ease;
}

.tags a::after {
  display: none;
}

.tags a:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-1px);
}

/* 分页 */
.page-navigator {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.page-navigator li {
  margin: 0;
}

.page-navigator a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast) ease;
}

.page-navigator a::after {
  display: none;
}

.page-navigator a:hover,
.page-navigator .current a {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow-medium);
}

/* 归档标题 */
.archive-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  text-align: center;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.archive-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 3px;
}

/* --------------- 侧边栏 --------------- */
.widget {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: all var(--transition-medium) ease;
  position: relative;
  overflow: hidden;
}

.widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--shadow-medium);
}

.widget-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-title::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--accent-primary);
}

/* 侧边栏图标 */
.widget:nth-child(1) .widget-title::before { content: "\f15c"; } /* 最新文章 */
.widget:nth-child(2) .widget-title::before { content: "\f086"; } /* 最近回复 */
.widget:nth-child(3) .widget-title::before { content: "\f07b"; } /* 分类 */
.widget:nth-child(4) .widget-title::before { content: "\f187"; } /* 归档 */
.widget:nth-child(5) .widget-title::before { content: "\f0c9"; } /* 其它 */

.widget-list {
  list-style: none;
}

.widget-list li {
  margin: 0.75rem 0;
  line-height: 1.6;
}

.widget-list a {
  color: var(--text-secondary);
  padding: 0.5rem 0;
  display: block;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast) ease;
  padding-left: 1rem;
  position: relative;
}

.widget-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent-primary);
  border-radius: 3px;
  transition: height var(--transition-fast) ease;
}

.widget-list a:hover::before {
  height: 100%;
}

.widget-list a:hover {
  color: var(--accent-primary);
  background: var(--bg-secondary);
  transform: translateX(5px);
}

.widget-list a::after {
  display: none;
}

/* --------------- 评论区域 --------------- */
#comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.comment-list {
  list-style: none;
}

.comment-list li {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 4px solid var(--accent-primary);
  transition: all var(--transition-fast) ease;
  position: relative;
}

.comment-list li:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px var(--shadow-light);
}

.comment-list li.comment-level-odd {
  background: var(--bg-secondary);
}

.comment-list li.comment-level-even {
  background: var(--bg-primary);
}

.comment-list li.comment-by-author {
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(102, 16, 242, 0.1));
  border-left-color: var(--accent-secondary);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-author .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  padding: 2px;
}

.comment-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.comment-content {
  line-height: 1.6;
  color: var(--text-primary);
}

.comment-reply {
  text-align: right;
  margin-top: 1rem;
}

.comment-reply a {
  padding: 0.5rem 1rem;
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all var(--transition-fast) ease;
}

.comment-reply a::after {
  display: none;
}

.comment-reply a:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

/* 评论表单 */
.respond {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--radius-xl);
  margin-top: 2rem;
  border: 1px solid var(--border-color);
}

.respond h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

#comment-form {
  display: grid;
  gap: 1rem;
}

#comment-form p {
  margin: 0;
}

#comment-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

#comment-form .required::after {
  content: " *";
  color: #e74c3c;
}

#comment-form .submit {
  justify-self: start;
  background: var(--gradient-primary);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}

#comment-form .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow-medium);
}

/* --------------- 页脚 --------------- */
#footer {
  background: var(--bg-secondary);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

#footer a {
  color: var(--accent-primary);
}

/* --------------- 响应式设计 --------------- */
@media (max-width: 991px) {
  .container {
    padding: 0 1rem;
  }
  
  #header .container {
    text-align: center;
  }
  
  /* 确保回到顶部按钮在手机端正常显示 */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
  
  #nav-menu {
    justify-content: center;
    margin-top: 1.5rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .post {
    padding: 1.5rem;
  }
  
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }
  
  #nav-menu a {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .post {
    padding: 1rem;
  }
  
  .post-title {
    font-size: 1.3rem;
  }
  
  .widget {
    padding: 1rem;
  }
  
  .respond {
    padding: 1.5rem;
  }
}

/* --------------- 动画效果 --------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 页面加载动画 */
.posts-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 移动端优化修复 ===== */

/* 修复移动端头部滚动收缩效果 */
#header {
  transition: all 0.3s ease;
  transform: translateY(0);
}

#header.scrolled {
  transform: translateY(-10px);
  padding: 0.25rem 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] #header.scrolled {
  background: rgba(26, 26, 26, 0.95);
}

/* 移动端响应式优化 */
@media (max-width: 991px) {
  /* 修复主题切换按钮位置 */
  .theme-toggle-container {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1002;
  }
  
  .theme-toggle {
    width: 45px;
    height: 24px;
    margin-top: 0;
    box-shadow: 0 2px 10px var(--shadow-medium);
    border: 1px solid var(--border-color);
  }
  
  .theme-toggle::before {
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
  }
  
  [data-theme="dark"] .theme-toggle::before {
    transform: translateX(21px);
  }
  
  /* 确保移动端菜单按钮显示正确 */
  .mobile-menu-toggle {
    display: flex !important;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1002;
    width: 45px;
    height: 45px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px var(--shadow-medium);
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  /* 确保三条横线显示 */
  .mobile-menu-toggle span {
    display: block !important;
    width: 20px;
    height: 2px;
    background: var(--text-primary) !important;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
  }
  
  /* 菜单激活状态 */
  .mobile-menu-toggle.active {
    background: var(--accent-primary);
  }
  
  .mobile-menu-toggle.active span {
    background: white !important;
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* 头部内容在移动端的调整 */
  .header-content {
    padding: 0.75rem 0;
  }
  
  .site-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  /* 滚动时头部进一步收缩 */
  #header.scrolled .header-content {
    padding: 0.5rem 0;
  }
  
  #header.scrolled .site-name {
    font-size: 1.3rem;
  }
}

/* 小屏幕设备优化 */
@media (max-width: 767px) {
  /* 滚动时头部隐藏效果 */
  #header {
    transform: translateY(0);
  }
  
  #header.scrolled {
    transform: translateY(-60px);
  }
  
  /* 确保固定按钮不受影响 */
  .theme-toggle-container,
  .mobile-menu-toggle {
    position: fixed !important;
  }
  
  /* 调整按钮间距 */
  .theme-toggle-container {
    top: 0.75rem;
    left: 0.75rem;
  }
  
  .mobile-menu-toggle {
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* 修复深色模式下的按钮显示 */
[data-theme="dark"] .mobile-menu-toggle {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .mobile-menu-toggle span {
  background: var(--text-primary) !important;
}

[data-theme="dark"] .theme-toggle {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

/* Footer 样式 */
.site-footer {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Footer Main */
.footer-main {
    padding: 3rem 0 2rem;
    position: relative;
}

.footer-section {
    margin-bottom: 2rem;
}

/* 网站信息区域 */
.about-section .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-logo .logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.footer-logo .logo-icon {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo .logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-description p {
    margin-bottom: 1rem;
}

.site-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stat-item i {
    color: var(--accent-primary);
    font-size: 0.8rem;
}

/* 社交链接 */
.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast) ease;
}

.social-link i {
    position: relative;
    z-index: 1;
    transition: all var(--transition-fast) ease;
}

.social-link::after {
    display: none;
}

.social-link:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 15px var(--shadow-medium);
    border-color: transparent;
    color: white;
}

.social-link:hover::before {
    opacity: 1;
}

/* Footer 标题 */
.footer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

.footer-title i {
    color: var(--accent-primary);
    font-size: 1rem;
}

/* Footer 链接 */
.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all var(--transition-fast) ease;
    border-radius: var(--radius-sm);
}

.footer-links a::after {
    display: none;
}

.footer-links a:hover {
    color: var(--accent-primary);
    background: rgba(0, 123, 255, 0.1);
    transform: translateX(5px);
    padding-left: 0.75rem;
}

.footer-links i {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
    color: var(--accent-primary);
}

/* 最新文章 */
.footer-recent-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-post-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.recent-post-link {
    display: block;
    text-decoration: none;
    transition: all var(--transition-fast) ease;
}

.recent-post-link::after {
    display: none;
}

.recent-post-link:hover {
    transform: translateX(5px);
}

.recent-post-title {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    transition: color var(--transition-fast) ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-post-link:hover .recent-post-title {
    color: var(--accent-primary);
}

.recent-post-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.recent-post-date i {
    font-size: 0.7rem;
    color: var(--accent-primary);
}

/* Footer Bottom */
.footer-bottom {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.copyright-text p {
    margin: 0;
}

.copyright-text a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast) ease;
}

.copyright-text a::after {
    display: none;
}

.copyright-text a:hover {
    color: var(--accent-secondary);
}

.power-by {
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Footer 工具 */
.footer-tools {
    display: flex;
    gap: 0.75rem;
}

/* 重复的返回顶部样式已移除，统一使用下方的样式定义 */

/* 阅读进度条 */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 1001;
    transition: width 0.1s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-3px);
}

.reading-progress-bar.active {
    opacity: 1;
    transform: translateY(0);
    transition: width 0.1s, opacity 0.3s, transform 0.3s;
}

/* 图片查看器 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-medium) ease;
}

.image-viewer.active {
    display: block;
    opacity: 1;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.image-viewer-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.viewer-controls {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.viewer-controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.viewer-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.viewer-prev, .viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.viewer-prev {
    left: 20px;
}

.viewer-next {
    right: 20px;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* 粒子背景 */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

#particlesCanvas {
    width: 100%;
    height: 100%;
}

/* 页面加载动画 */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all var(--transition-slow) ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    text-align: center;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--accent-secondary);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: #28a745;
    animation-duration: 2s;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载状态 */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* 特殊效果 */
.glow {
  box-shadow: 0 0 20px var(--accent-primary);
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 成功/错误状态 */
.success {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border-color: #c3e6cb;
}

.error {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border-color: #f5c6cb;
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* 侧边栏卡片毛玻璃效果 */
.widget {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  color: var(--text-primary);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 32px rgba(0,0,0,0.10),
              inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  transition: all .5s cubic-bezier(0.4,0,0.2,1);
}

.widget:hover {
  background: rgba(255, 255, 255, 0.13);
  border: 1.5px solid rgba(255,255,255,0.18);
}

[data-theme="dark"] .widget {
  background: rgba(30, 32, 40, 0.32);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25),
              inset 0 1px 0 rgba(255,255,255,0.04);
}
[data-theme="dark"] .widget:hover {
  background: rgba(30, 32, 40, 0.45);
  border: 1.5px solid rgba(255,255,255,0.13);
}

/* 侧边栏标题发光/渐变 */
.widget-title {
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  text-fill-color: var(--text-primary) !important;
  text-shadow: 0 2px 8px rgba(77,171,247,0.10);
}

/* 侧边栏列表项悬浮高亮 */
.widget-list a:hover {
  background: rgba(255,255,255,0.10);
  color: var(--accent-primary);
  transform: translateX(6px);
}
[data-theme="dark"] .widget-list a:hover {
  background: rgba(77,171,247,0.10);
  color: #fff;
}

/* --------- 侧边栏卡片顶部彩条与内容间距修正 --------- */
.widget {
  margin-bottom: 2rem;
  padding-top: 0.5rem;
  box-sizing: border-box;
}
@media (max-width: 991px) {
  .widget {
    margin-bottom: 1.2rem;
    border-radius: 12px;
    padding-top: 0.3rem;
  }
}

.widget-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* --------- 侧边栏列表项hover错位修正 --------- */
.widget-list a {
  box-sizing: border-box;
  padding-right: 1rem;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.widget-list a:hover {
  padding-left: 1.5rem;
  transform: none;
}

/* --------- 侧边栏与主内容区对齐 --------- */
#secondary {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  box-sizing: border-box;
}
@media (max-width: 991px) {
  #secondary {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* --------- 主内容区卡片圆角/阴影/间距 --------- */
.post, .post-card, .single-post, .archive-post-item, .page, .single-page {
  margin-bottom: 2rem;
  border-radius: 18px;
  box-shadow: 0 8px 32px var(--shadow-light);
  overflow: hidden;
}
@media (max-width: 991px) {
  .post, .post-card, .single-post, .archive-post-item, .page, .single-page {
    border-radius: 12px;
    margin-bottom: 1.2rem;
  }
}

/* --------- 评论区卡片/输入框/按钮优化 --------- */
#comments, .respond {
  border-radius: 18px;
  box-shadow: 0 4px 20px var(--shadow-light);
  margin-bottom: 2rem;
  overflow: hidden;
}
@media (max-width: 991px) {
  #comments, .respond {
    border-radius: 12px;
    margin-bottom: 1.2rem;
  }
}
#comment-form input, #comment-form textarea, #comment-form select {
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow-light);
  border: 1.5px solid var(--border-color);
}
#comment-form input:focus, #comment-form textarea:focus, #comment-form select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(77,171,247,0.10);
}
#comment-form .submit {
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow-light);
}

/* --------- 目录浮动层错位修正 --------- */
.post-toc {
  z-index: 10;
  box-shadow: 0 4px 20px var(--shadow-light);
}
@media (max-width: 991px) {
  .post-toc {
    display: none !important;
  }
}

/* --------- 头部/页脚毛玻璃透明度适配 --------- */
#header, #footer, .site-footer {
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  background: rgba(255,255,255,0.85);
}
[data-theme="dark"] #header, [data-theme="dark"] #footer, [data-theme="dark"] .site-footer {
  background: rgba(30,32,40,0.85);
}

/* --------- 移动端圆角/阴影/顶部条适配 --------- */
@media (max-width: 767px) {
  .widget {
    border-radius: 8px;
    margin-bottom: 0.8rem;
    padding-top: 0.2rem;
  }
  .post, .post-card, .single-post, .archive-post-item, .page, .single-page {
    border-radius: 8px;
    margin-bottom: 0.8rem;
  }
  #comments, .respond {
    border-radius: 8px;
    margin-bottom: 0.8rem;
  }
}

/* --------- 归档/空状态/无内容对齐 --------- */
.no-posts-content, .empty-content {
  border-radius: 18px;
  box-shadow: 0 4px 20px var(--shadow-light);
  margin: 0 auto 2rem auto;
  max-width: 420px;
  padding: 2.5rem 1.5rem;
}
@media (max-width: 767px) {
  .no-posts-content, .empty-content {
    border-radius: 8px;
    padding: 1.2rem 0.5rem;
  }
}

/* --------- 其他细节 --------- */
.main-layout {
  align-items: flex-start;
}

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 头部增强样式 */
.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.theme-toggle-container {
    position: relative;
}

.theme-toggle {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border: none;
    border-radius: 26px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    overflow: hidden;
}

.theme-toggle i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: all var(--transition-fast) ease;
}

.light-icon {
    right: 6px;
    color: #ffa500;
}

.dark-icon {
    left: 6px;
    color: #4dabf7;
    opacity: 0;
}

[data-theme="dark"] .theme-toggle {
    background: var(--accent-primary);
}

[data-theme="dark"] .light-icon {
    opacity: 0;
}

[data-theme="dark"] .dark-icon {
    opacity: 1;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast) ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(24px);
}

/* 搜索框增强 */
.search-container {
    position: relative;
    max-width: 300px;
}

.search-input {
    padding-right: 3rem;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    transition: all var(--transition-fast) ease;
}

.search-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-btn {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

/* 搜索建议和结果预览 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px var(--shadow-medium);
    z-index: 1000;
    margin-top: 5px;
    display: none;
    padding: 10px 0;
}

.search-suggestions.active {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item:hover {
    background: var(--bg-secondary);
}

.suggestion-item.selected {
    background: var(--bg-secondary);
}

.suggestion-icon {
    color: var(--accent-primary);
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.suggestion-excerpt {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.suggestion-category {
    font-size: 11px;
    color: var(--accent-primary);
    background: rgba(77, 171, 247, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    white-space: nowrap;
}

.search-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.search-footer-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-footer-info i {
    color: var(--accent-primary);
}

.search-footer-action {
    color: var(--accent-primary);
    cursor: pointer;
}

.search-footer-action:hover {
    text-decoration: underline;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: var(--text-secondary);
}

.search-loading {
    padding: 15px;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 导航菜单增强 */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast) ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left var(--transition-medium) ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.current::before {
    left: 0;
}

.nav-link:hover,
.nav-link.current {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.nav-link::after {
    display: none;
}

.nav-link i {
    font-size: 0.9rem;
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    box-shadow: 0 2px 10px var(--shadow-light);
    transition: all var(--transition-fast) ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active {
    background: var(--accent-primary);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.mobile-menu-toggle.active span {
    background: white;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 菜单打开时的body样式 */
body.menu-open {
    overflow: hidden;
}

/* 移动端菜单动画 */
@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 返回顶部按钮 - 统一样式 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow-medium);
    transition: all var(--transition-fast) ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
    overflow: hidden;
}

.back-to-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast) ease;
    border-radius: 50%;
}

.back-to-top i {
    position: relative;
    z-index: 1;
    transition: all var(--transition-fast) ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px var(--shadow-medium);
    color: white;
}

.back-to-top:hover::before {
    opacity: 1;
}

.back-to-top.clicked {
    animation: backToTopBounce 0.6s ease;
}

@keyframes backToTopBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-10px) scale(1.1);
    }
    60% {
        transform: translateY(-5px) scale(1.05);
    }
}

/* Logo增强 */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.8rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast) ease;
}

.logo-link:hover .logo-img {
    transform: scale(1.1) rotate(5deg);
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 响应式 */
@media (max-width: 991px) {
    .header-tools {
        justify-content: center;
        margin: 1rem 0;
    }

    .search-container {
        max-width: 100%;
    }

    .main-nav {
        justify-content: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-medium) ease;
        transform: translateY(-20px);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 30px var(--shadow-medium);
    }
    
    .main-nav.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        animation: fadeInMenu 0.3s ease forwards;
    }

    .main-nav.show {
        display: flex;
    }

    .nav-link {
        margin: 0.5rem 0;
        width: 200px;
        justify-content: center;
    }
}

/* 主内容区域 */
.main-content {
    padding: 2rem 0;
}

.posts-container {
    display: grid;
    gap: 1rem;
}

/* 文章卡片样式 */
.post-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-medium) ease;
    position: relative;
    box-shadow: 0 4px 20px var(--shadow-light);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast) ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-medium);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* 文章头部 */
.post-header {
    position: relative;
}

.post-featured-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) ease;
}

.post-card:hover .post-featured-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast) ease;
}

.post-card:hover .image-overlay {
    opacity: 1;
}

.post-header-content {
    padding: 1.5rem;
}

.post-categories {
    margin-bottom: 1rem;
}

.post-categories a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    margin-right: 0.5rem;
    transition: all var(--transition-fast) ease;
}

.post-categories a::after {
    display: none;
}

.post-categories a:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.post-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-fast) ease;
}

.post-title a::after {
    display: none;
}

.post-title a:hover {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* 文章元数据 */
.post-meta-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.meta-item i {
    color: var(--accent-primary);
    font-size: 0.8rem;
}

.author-meta {
    gap: 0.75rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    transition: all var(--transition-fast) ease;
}

.author-meta:hover .author-avatar {
    transform: scale(1.1);
    border-color: var(--accent-secondary);
}

.author-name {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast) ease;
}

.author-name::after {
    display: none;
}

.author-name:hover {
    color: var(--accent-primary);
}

.meta-item a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast) ease;
}

.meta-item a::after {
    display: none;
}

.meta-item a:hover {
    color: var(--accent-primary);
}

/* 文章列表样式 */
.post-list-content {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.list-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.list-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-content {
    flex: 1;
    min-width: 0;
}

.list-header {
    margin-bottom: 1rem;
}

.list-title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.list-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast) ease;
    display: block;
}

.list-title a::after {
    display: none;
}

.list-title a:hover {
    color: var(--accent-primary);
}

.list-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.list-meta a {
    color: inherit;
    text-decoration: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: inherit;
    background-clip: initial;
}

.list-meta a::after {
    display: none;
}

.list-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-tags {
    display: flex;
    gap: 0.25rem;
}

.list-tags a {
    padding: 0.2rem 0.4rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    text-decoration: none;
    transition: all var(--transition-fast) ease;
}

.list-tags a::after {
    display: none;
}

.list-tags a:hover {
    background: var(--accent-primary);
    color: white;
}

/* 阅读更多按钮 */
.read-more-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast) ease;
    position: relative;
    overflow: hidden;
}

.read-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-secondary);
    transition: left var(--transition-medium) ease;
    z-index: 0;
}

.read-more-btn span,
.read-more-btn i {
    position: relative;
    z-index: 2;
    color: white;
}

.read-more-btn::after {
    display: none;
}

.read-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.read-more-btn:hover::before {
    left: 0;
}

.read-more-btn:hover i {
    transform: translateX(3px);
}

/* 文章标签预览 */
.post-tags-preview {
    padding: 0 1.5rem 1rem;
}

.post-tags-preview a {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-decoration: none;
    margin: 0.25rem 0.5rem 0.25rem 0;
    transition: all var(--transition-fast) ease;
    border: 1px solid var(--border-color);
}

.post-tags-preview a::after {
    display: none;
}

.post-tags-preview a:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* 文章统计 */
.post-stats {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.75rem;
    opacity: 0;
    transition: all var(--transition-fast) ease;
}

.post-card:hover .post-stats {
    opacity: 1;
}

.post-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .post-stats .stat-item {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.post-stats .stat-item i {
    color: var(--accent-primary);
    font-size: 0.7rem;
}

/* 分页导航 */
.pagination-wrapper {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow-light);
    border: 1px solid var(--border-color);
}

.pagination-nav a,
.pagination-nav span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
    font-weight: 500;
}

.pagination-nav a::after {
    display: none;
}

.pagination-nav a:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--shadow-medium);
}

.pagination-nav .current {
    background: var(--accent-primary);
    color: white;
}

.pagination-nav .prev,
.pagination-nav .next {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.pagination-nav .prev:hover,
.pagination-nav .next:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* 无文章状态 */
.no-posts {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.no-posts-content {
    text-align: center;
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    max-width: 400px;
}

.no-posts-content i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.no-posts-content h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-posts-content p {
    color: var(--text-secondary);
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 991px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .posts-container {
        gap: 0.75rem;
    }
    
    .post-card {
        border-radius: var(--radius-lg);
    }
    
    .post-meta-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .post-meta {
        gap: 0.75rem;
    }
    
    .post-stats {
        position: static;
        opacity: 1;
        padding: 0 1.5rem 1rem;
        justify-content: center;
    }
    
    /* 文章列表响应式样式 */
    .post-list-content {
        padding: 1rem;
    }
    
    .list-title {
        font-size: 1.1rem;
    }
    
    .list-excerpt {
        -webkit-line-clamp: 2;
        margin-bottom: 0.75rem;
    }
    
    /* 修复手机端布局问题 */
    .container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    #header .row {
        display: flex;
        flex-wrap: wrap;
    }
    
    .site-name, .header-tools {
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    #nav-menu {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .post-header-content {
        padding: 1rem;
    }
    
    .post-meta-wrapper {
        padding: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    
    .meta-item {
        font-size: 0.8rem;
    }
    
    .post-title {
        font-size: 1.3rem;
    }
    
    .read-more-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* 手机端文章列表优化 - 垂直卡片布局 */
    .posts-container {
        padding: 0;
        gap: 0.75rem;
    }
    
    .post-card {
        margin-bottom: 0;
        border-radius: var(--radius-md);
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid var(--border-color);
        overflow: hidden;
        background: var(--bg-primary);
        transition: all var(--transition-fast) ease;
    }
    
    .post-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    }
    
    .post-list-content {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }
    
    .list-thumbnail {
        width: 100%;
        height: 140px;
        margin: 0;
        border-radius: 0;
        flex-shrink: 0;
        overflow: hidden;
    }
    
    .list-thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
        transition: transform var(--transition-medium) ease;
    }
    
    .post-card:hover .list-thumbnail img {
        transform: scale(1.05);
    }
    
    .thumbnail-placeholder {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-secondary);
        border-radius: 0;
    }
    
    .thumbnail-placeholder i {
        font-size: 2rem;
        color: var(--text-muted);
    }
    
    .list-content {
        flex: 1;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
    }
    
    .list-header {
        margin-bottom: 0.5rem;
    }
    
    .list-title {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }
    
    .list-title a {
        color: var(--text-primary);
        text-decoration: none;
    }
    
    .list-title a:hover {
        color: var(--accent-primary);
    }
    
    .list-meta {
        font-size: 0.8rem;
        margin-bottom: 0;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .list-excerpt {
        font-size: 0.85rem;
        line-height: 1.4;
        color: var(--text-secondary);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.5rem;
        flex: 1;
    }
    
    .list-footer {
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
        margin-top: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.75rem;
        color: var(--text-secondary);
    }
    
    .list-footer .action-item {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .list-footer i {
        font-size: 0.7rem;
        color: var(--accent-primary);
    }
    
    .pagination-nav {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-nav a,
    .pagination-nav span {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    /* 手机端容器和布局优化 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 手机端头部优化 */
    #header {
        padding: 0.75rem 0;
    }
    
    .site-name {
        margin-bottom: 0.75rem;
    }
    
    .header-tools {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .search-container {
        width: 100%;
        max-width: 280px;
    }
    
    .search-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem 3rem 0.75rem 1rem;
    }
    
    /* 手机端文章内容优化 */
    .post {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-lg);
    }
    
    .post-title {
        font-size: 1.3rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .post-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .post-content p {
        margin-bottom: 1rem;
    }
    
    .post-content h1,
    .post-content h2,
    .post-content h3,
    .post-content h4,
    .post-content h5,
    .post-content h6 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }
    
    .post-content h1 { font-size: 1.5rem; }
    .post-content h2 { font-size: 1.3rem; }
    .post-content h3 { font-size: 1.2rem; }
    .post-content h4 { font-size: 1.1rem; }
    .post-content h5 { font-size: 1rem; }
    .post-content h6 { font-size: 0.95rem; }
    
    /* 手机端代码块优化 */
    pre {
        font-size: 0.85rem;
        padding: 1rem;
        overflow-x: auto;
        border-radius: var(--radius-md);
    }
    
    code {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* 手机端表格优化 */
    table {
        font-size: 0.9rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* 手机端侧边栏优化 */
    .widget {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-lg);
    }
    
    .widget-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* 手机端按钮和表单优化 */
    .btn,
    button {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        min-height: 44px; /* 符合触摸标准 */
    }
    
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
    
    textarea {
        min-height: 120px;
        resize: vertical;
    }
    
    /* 手机端返回顶部按钮 */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
    
    /* 修复搜索框 */
    #search {
        width: 100%;
    }
    
    /* 修复页脚布局 */
    .footer-section {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .post-featured-image {
        height: 150px;
    }
    
    .no-posts-content {
        padding: 2rem;
    }
    
    .no-posts-content i {
        font-size: 3rem;
    }
    
    /* 修复超小屏幕设备的布局 */
    .post, .widget {
        padding: 0.8rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
    }
    
    .post-title {
        font-size: 1.2rem;
    }
    
    .post-excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }
    
    .post-meta {
        font-size: 0.75rem;
    }
    
    .widget-title {
        font-size: 1rem;
    }
    
    /* 修复评论区域 */
    .comment-list li {
        padding: 0.8rem;
    }
    
    .comment-author {
        font-size: 0.9rem;
    }
    
    .comment-content {
        font-size: 0.85rem;
    }
    
    /* 修复表单元素 */
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    button, .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* 文章卡片动画增强 */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: cardEnter 0.6s ease forwards;
}

.post-card:nth-child(even) {
    animation-delay: 0.1s;
}

.post-card:nth-child(3n) {
    animation-delay: 0.2s;
}

/* 加载状态 */
.posts-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.posts-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
