/* ============================================================
   imlw-themes — 风格设计系统
   设计语言：通透、干净、大圆角、柔光阴影
   ============================================================ */

/* ---------- 本地字体 ---------- */
@font-face {
  font-family: 'Meddon';
  src: url('../fonts/meddon-latin.woff2') format('woff2'),
       url('../fonts/meddon-latin-ext.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- CSS 变量 ---------- */
:root {
  /* 背景色 */
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-input: #f5f6f8;
  --bg-hover: rgba(0, 0, 0, 0.04);

  /* 文字颜色 */
  --text-primary: #1a1a1a;
  --text-secondary: #595959;
  --text-tertiary: #8c8c8c;
  --text-inverse: #ffffff;
  --text-hero: #ffffff;
  --text-hero-sub: rgba(255, 255, 255, 0.75);

  /* 品牌色 */
  --accent: #0B4ECB;
  --accent-hover: #016fff;
  --accent-light: rgba(207, 10, 44, 0.08);

  /* 边框 */
  --border-color: #ebebeb;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-xs: 6px;

  /* 阴影 */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 28px rgba(0, 0, 0, 0.12);
  --shadow-nav: 0 1px 0 rgba(0, 0, 0, 0.06);
  --shadow-hero: 0 8px 32px rgba(0, 0, 0, 0.2);

  /* 间距 */
  --container-max: 1160px;
  --container-pad: 40px;
  --section-gap: 40px;
  --card-gap: 24px;

  /* 过渡 */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgb(238, 238, 238);
}

::-webkit-scrollbar-thumb {
  background: rgb(68, 142, 246);
  border-radius: 0;
}

/* 暗黑模式滚动条 */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #2a2a2a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #016fff;
}

/* 暗黑模式 */
[data-theme="dark"] {
  --bg-page: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-hero: linear-gradient(135deg, #0a0a14 0%, #0f1a2e 50%, #0a1628 100%);
  --bg-nav: rgba(13, 13, 13, 0.85);
  --bg-input: #2a2a2a;
  --bg-hover: rgba(255, 255, 255, 0.06);

  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.38);

  --accent: #0B4ECB;
  --accent-hover: #016fff;
  --accent-light: rgba(255, 45, 79, 0.12);

  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-nav: 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-hero: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 暗黑模式 body 背景 */
[data-theme="dark"] body {
  background: #0d0d0d;
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 1rem;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'HarmonyOS_Sans_SC', -apple-system, BlinkMacSystemFont,
    'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f8f5ff 0%, #ffffff 45%, #f0f7ff 100%);
  background-attachment: fixed;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

input, textarea, button {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* ---------- 布局容器 ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- 导航栏 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 1001;
  overflow: hidden;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #00d4ff);
  transition: width 0.1s linear;
}

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-radius 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  will-change: transform;
}

/* 向下滚动时头部变为胶囊（宽度=主体内容宽度 1280px） */
#header.header-scrolled {
  top: 1px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: var(--container-max);
  max-width: calc(100% - 32px);
  border-radius: 50px;
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: visible;
}

#header.header-scrolled .container {
  max-width: var(--container-max);
  padding: 0 var(--container-pad);
  width: 100%;
}

/* 内页（无 Hero）：导航栏始终半透明毛玻璃，全宽 */
body:not(.home) #header {
  top: 0;
  left: 0;
  right: 0;
  transform: none;
  width: auto;
  max-width: none;
  border-radius: 0;
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-nav);
  overflow: visible;
}

/* 文章页头部透明，hero 背景图透出来（含下滑状态） */
body.single #header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}
body.single #header .container {
  color: #fff;
}
/* 文章页下滑后恢复胶囊实色背景 */
body.single #header.header-scrolled {
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
body.single #header.header-scrolled .container {
  color: var(--text-primary);
}
/* 文章页去掉 main 顶部 padding，hero 直接顶到页面最顶部 */
body.single #main {
  padding-top: 0;
}

/* 独立页面（page）没有 hero，恢复顶部间距，避免内容贴住 fixed header */
body.page #main {
  padding-top: calc(60px + var(--section-gap));
}

/* 下滑后：内页也变胶囊（宽度=主体内容宽度 1280px） */
body:not(.home) #header.header-scrolled {
  top: 0px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: var(--container-max);
  max-width: calc(100% - 32px);
  border-radius: 50px;
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: visible;
}

body:not(.home) #header.header-scrolled .container {
  max-width: var(--container-max);
  padding: 0 var(--container-pad);
  width: 100%;
}

/* 深色模式下胶囊导航更凸显 */
[data-theme="dark"] #header.header-scrolled {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body:not(.home) #header.header-scrolled {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

#header #logo,
#header #nav-menu a,
#header .search-trigger,
#header .theme-toggle,
#header .back-to-top,
#header .menu-toggle {
  color: var(--text-primary);
  transition: color var(--transition);
}

/* 暗黑模式头部文字 */
[data-theme="dark"] #header #logo,
[data-theme="dark"] #header #nav-menu a,
[data-theme="dark"] #header .search-trigger,
[data-theme="dark"] #header .theme-toggle,
[data-theme="dark"] #header .back-to-top,
[data-theme="dark"] #header .menu-toggle {
  color: rgba(255, 255, 255, 0.9);
}

#header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: relative;
}

.site-name {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#nav-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

#logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
}

#logo:hover {
  color: var(--accent);
}

/* 悬停 tooltip */
#logo[data-description]:hover::after {
  content: attr(data-description);
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 100;
}

/* 全局统一 tooltip：所有带 title 的元素 hover 时显示自定义气泡 */
[title], [data-title] {
  position: relative;
}
[title]:hover::after, [data-title]:hover::after {
  content: attr(title);
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
[title]:hover::after, [data-title]:hover::after {
  opacity: 1;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 600;
  color: inherit;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="light"] .logo-dark {
  display: none;
}

/* 站标（favicon）+ 站点名称 模式下的小图标 */
.favicon-mark {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.favicon-img {
  height: 30px;
  width: auto;
}

[data-theme="dark"] .favicon-light {
  display: none;
}

[data-theme="light"] .favicon-dark {
  display: none;
}

.site-name .description {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

#nav-menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--border-radius-xs);
  font-size: 0.8rem;
  color: #1a1a1a;
  font-weight: normal;
  position: relative;
}

/* PC端隐藏移动端深浅切换按钮 */
#nav-menu .theme-toggle-mobile {
  display: none;
}

.nav-icon {
  font-size: 0.9375rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

#nav-menu a:hover {
  color: var(--accent);
  background: transparent;
}

#nav-menu > a.current {
  color: var(--accent);
  background: transparent;
  font-weight: 500;
  border-bottom: none;
  border-radius: 0;
}

/* 下划线：从图标左侧到文字右侧，不包含padding */
#nav-menu a.current::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* 暗黑模式导航高亮 */
[data-theme="dark"] #nav-menu > a:hover,
[data-theme="dark"] #nav-menu > a.current {
  color: var(--accent-hover);
}

[data-theme="dark"] #nav-menu > a.current::after {
  background: var(--accent-hover);
}

/* ---------- 分类下拉菜单 ---------- */
#nav-menu .nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
}

#nav-menu .dropdown-trigger {
  cursor: pointer;
}

#nav-menu .dropdown-arrow {
  font-size: 0.625rem;
  margin-left: 2px;
  transition: transform 0.3s ease;
}

#nav-menu .nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

#nav-menu .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 120px;
  width: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 997;
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: center;
}

#nav-menu .nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(1px);
}

#nav-menu .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  color: #1a1a1a;
  white-space: nowrap;
  transition: all 0.2s ease;
}

#nav-menu .dropdown-menu a:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

#nav-menu .dropdown-menu a.current {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

#header #nav-menu .dropdown-menu a.current,
#header #nav-menu .dropdown-menu a.current .nav-icon {
  color: #fff;
}

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

#nav-menu .dropdown-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 10px;
}

#nav-menu .dropdown-menu a:hover .dropdown-count {
  background: var(--accent);
  color: #fff;
}

/* 暗黑模式下拉菜单 */
[data-theme="dark"] #nav-menu .dropdown-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 移动端：下拉菜单改为展开式 */
@media (max-width: 768px) {
  #nav-menu .nav-dropdown {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    height: auto;
  }

  #nav-menu .dropdown-trigger {
    width: 100%;
    justify-content: flex-start;
  }

  #nav-menu .dropdown-arrow {
    margin-left: auto;
  }

  #nav-menu .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0 0 0 20px;
    background: transparent;
    display: none;
    flex-direction: column;
    border-radius: 0;
  }

  /* 移动端高亮项：无蓝色背景，文字蓝色 */
  #nav-menu .dropdown-menu a.current {
    background: transparent;
    color: var(--accent);
  }

  #header #nav-menu .dropdown-menu a.current .nav-icon {
    color: var(--accent);
  }

  #nav-menu .nav-dropdown:hover .dropdown-menu,
  #nav-menu .nav-dropdown.open .dropdown-menu {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  #nav-menu .nav-dropdown.open .dropdown-menu {
    display: block;
  }

  #nav-menu .nav-dropdown:hover .dropdown-arrow {
    transform: none;
  }

  #nav-menu .nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  #nav-menu .dropdown-menu {
    padding: 0.5rem 0 0.5rem 16px;
  }

  #nav-menu .dropdown-menu a,
  #nav-menu .dropdown-menu a.current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 0;
    margin: 0;
    font-size: 0.84375rem;
    color: #1a1a1a;
    position: relative;
    transition: color 0.25s, padding-left 0.25s;
  }

  #header #nav-menu .dropdown-menu a .nav-icon,
  #header #nav-menu .dropdown-menu a.current .nav-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #1a1a1a;
    font-size: 0.875rem;
  }

  #nav-menu .dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.25s;
  }

  #nav-menu .dropdown-menu a:hover,
  #nav-menu .dropdown-menu a.current {
    color: var(--accent) !important;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    font-weight: 500;
  }

  #nav-menu .dropdown-menu a::before {
    display: none;
  }

  #header #nav-menu .dropdown-menu a:hover .nav-icon,
  #header #nav-menu .dropdown-menu a.current .nav-icon {
    color: var(--accent);
  }
}

/* 暗黑模式导航文字 */
[data-theme="dark"] #nav-menu a {
  color: rgba(255, 255, 255, 0.85);
}

/* 搜索触发按钮 */
.search-trigger {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

.search-trigger:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

/* 展开式搜索面板 */
.header-search-panel {
  position: fixed;
  top: 62px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: var(--container-max);
  max-width: calc(100% - 32px);
  z-index: 998;
  max-height: 0;
  overflow: hidden;
  border-radius: 16px;
  transition: max-height 0.35s ease;
}

.header-search-panel.active {
  max-height: 600px;
}

/* 半透明遮罩 */
.search-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 997;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.header-search-panel.active ~ .search-mask,
.search-mask.active {
  visibility: visible;
  opacity: 1;
}

.search-panel-container {
  width: 100%;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.search-panel-inner {
  display: flex;
  gap: 30px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 25px var(--container-pad) 30px;
}

/* 左右两栏 */
.search-left {
  flex: 1;
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.search-right {
  flex: 1;
  width: 50%;
  flex-shrink: 0;
}

.search-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-section-title i {
  color: var(--accent);
  font-size: 0.875rem;
}

/* 关键词搜索 */
.search-form {
  display: flex;
  gap: 0;
}

.search-input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-submit {
  height: 42px;
  padding: 0 24px;
  border: none;
  border-radius: 0 8px 8px 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}

.search-submit:hover {
  background: var(--accent-hover);
}

/* 标签搜索（方块样式） */
.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* 只显示四行，多了裁切（单行约 28px + gap 8px） */
  max-height: 140px;
  overflow: hidden;
}

.search-tag {
  display: inline-block;
  padding: 5px 12px;
  color: #fff;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
}

.search-tag:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.search-tags-empty {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

/* 热门文章列表 */
.search-hot-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-hot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.search-hot-item:last-child {
  border-bottom: none;
}

.search-hot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-hot-rank.top {
  color: #fff;
  background: var(--accent);
  border-radius: 3px;
}

.search-hot-title {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}

.search-hot-title:hover {
  color: var(--accent);
}

.search-hot-views {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-hot-empty {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  padding: 20px 0;
  text-align: center;
}

/* 暗黑模式搜索面板 */
[data-theme="dark"] .search-panel-container {
  background: #1a1a1a;
}

[data-theme="dark"] .search-panel-inner {
  background: #1a1a1a;
}

/* 移动端搜索面板 */
@media (max-width: 768px) {
  /* 铺满宽度，和头部导航一致贴边 */
  .header-search-panel {
    top: 60px;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }
  .search-panel-container {
    margin: 0;
    padding: 12px 16px;
    border-radius: 0;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  }
  .search-panel-inner {
    flex-direction: column;
    padding: 12px 16px;
    gap: 0;
    align-items: center;
  }
  /* 手机端只保留关键词搜索，隐藏热门文章整块 */
  .search-right {
    display: none;
  }
  .search-left {
    width: 100%;
    flex: none;
  }
  /* 隐藏标签搜索块（.search-left 内关键词搜索之后的第二个 .search-section） */
  .search-left .search-section + .search-section {
    display: none;
  }
  /* 隐藏"关键词搜索"标题，输入框直接顶格 */
  .search-section-title {
    display: none;
  }
  .search-form {
    flex-direction: row;
    gap: 0;
    width: 100%;
  }
  .search-input {
    height: 40px;
    font-size: 0.875rem;
  }
  .search-submit {
    height: 40px;
    padding: 0 16px;
    white-space: nowrap;
    font-size: 0.875rem;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 暗黑模式切换按钮 */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
  margin-left: 8px;
  overflow: hidden;
}

.theme-toggle:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 三层叠：浅色显示圆+光芒，深色显示月牙 ---------- */
/* 中间圆：浅色显示，深色隐藏 */
[data-theme="light"] .icon-base {
  opacity: 1;
}

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

/* 光芒：浅色显示，深色隐藏，旋转过渡 */
[data-theme="light"] .icon-rays {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="dark"] .icon-rays {
  opacity: 0;
  transform: rotate(180deg);
}

/* 月牙：深色显示，浅色隐藏，淡入淡出 */
[data-theme="light"] .icon-moon {
  opacity: 0;
}

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

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

/* ---------- 节日红灯笼 ---------- */
.feng_custom_national_day {
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
  transform-origin: top center;
  z-index: 1988;
  pointer-events: none;
}

.feng_custom_lantern {
  --width: 128px;
  --line-length: 35px;
  --line-color: #830514;
  --cap-color: #ffea00;
  --body-color: #ff2b3f;
  --bone-color: #830514;
  position: absolute;
  transform-origin: center top;
  pointer-events: none;
}

.feng_custom_lantern .lantern_box {
  position: relative;
  width: var(--width);
  transform-origin: center top;
  animation: feng-custom-lantern-animation 3.5s ease-in-out infinite alternate;
}

.feng_custom_lantern .lantern_box * {
  position: absolute;
  box-sizing: content-box;
  left: 50%;
  transform: translateX(-50%);
}

.feng_custom_lantern .lantern_box .line {
  top: 0px;
  width: calc(var(--width) * 0.02);
  height: var(--line-length);
  background-color: var(--line-color);
  box-shadow: 0 0 calc(var(--width) * 0.1) var(--cap-color);
}

.feng_custom_lantern .lantern_box .ring {
  top: var(--line-length);
  width: calc(var(--width) * 0.15);
  height: calc(var(--width) * 0.15);
  border: calc(var(--width) * 0.02) solid var(--line-color);
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--width) * 0.1) var(--cap-color);
}

.feng_custom_lantern .lantern_box .cap,
.feng_custom_lantern .lantern_box .bottom_cap {
  top: calc(var(--line-length) + var(--width) * 0.06);
  width: calc(var(--width) * 0.35);
  height: calc(var(--width) * 0.15);
  background-color: var(--cap-color);
  border: calc(var(--width) * 0.015) solid var(--bone-color);
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--width) * 0.06) var(--cap-color);
  z-index: 2;
}

.feng_custom_lantern .lantern_box .body {
  top: calc(var(--line-length) + var(--width) * 0.13);
  width: var(--width);
  height: calc(var(--width) * 0.7);
  border: calc(var(--width) * 0.015) solid var(--bone-color);
  border-radius: 50%;
  background-color: var(--body-color);
  box-shadow:
    0 0 calc(var(--width) * 0.25) var(--cap-color),
    0 0 calc(var(--width) * 0.45) rgba(255, 234, 0, 0.5);
  z-index: 3;
}

.feng_custom_lantern .lantern_box .body .cadre {
  top: calc(var(--width) * -0.015);
  width: calc(var(--width) * 0.75);
  height: 100%;
  border: calc(var(--width) * 0.015) solid var(--bone-color);
  border-radius: 50%;
}

.feng_custom_lantern .lantern_box .body .cadre:nth-child(2) {
  width: calc(var(--width) * 0.3);
}

.feng_custom_lantern .lantern_box .body .text {
  top: 0px;
  width: 100%;
  color: var(--cap-color);
  text-align: center;
  font-size: calc(var(--width) * 0.38);
  line-height: calc(var(--width) * 0.7);
  font-weight: bold;
  text-shadow: 0 0 5px var(--bone-color);
}

.feng_custom_lantern .lantern_box .bottom_cap {
  top: calc(var(--line-length) + var(--width) * 0.75);
}

/* 流苏底座 + 10根线（每根单独飘动） */
.feng_custom_lantern .lantern_box .bottom {
  top: calc(var(--line-length) + var(--width) * 0.88);
  width: calc(var(--width) * 0.22);
  height: calc(var(--width) * 0.4);
  background: transparent;
  box-shadow: none;
  animation: none;
}

.feng_custom_lantern .lantern_box .bottom .bottom_bg {
  top: 0;
  width: 100%;
  height: calc(var(--width) * 0.12);
  background-color: var(--cap-color);
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--width) * 0.06) var(--cap-color);
  bottom: auto;
}

.feng_custom_lantern .lantern_box .bottom .lantern-tassel {
  top: calc(var(--width) * 0.08);
  width: 100%;
  height: calc(var(--width) * 0.3);
  display: flex;
  gap: 2px;
  justify-content: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.feng_custom_lantern .lantern_box .bottom .tassel-line {
  position: relative;
  left: auto;
  transform: none;
  width: 1.5px;
  height: 100%;
  background: linear-gradient(to bottom, var(--cap-color), #ffaa00);
  border: none;
  border-radius: 0 0 2px 2px;
  transform-origin: top center;
  animation: tasselLineSwing 3s ease-in-out infinite;
}

.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(1) { animation-delay: 0s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(2) { animation-delay: 0.1s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(3) { animation-delay: 0.2s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(4) { animation-delay: 0.3s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(5) { animation-delay: 0.4s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(6) { animation-delay: 0.5s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(7) { animation-delay: 0.6s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(8) { animation-delay: 0.7s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(9) { animation-delay: 0.8s; }
.feng_custom_lantern .lantern_box .bottom .tassel-line:nth-child(10) { animation-delay: 0.9s; }

@keyframes tasselLineSwing {
  0%, 100% { transform: rotate(-12deg); }
  25% { transform: rotate(5deg); }
  50% { transform: rotate(12deg); }
  75% { transform: rotate(-5deg); }
}

@keyframes feng-custom-lantern-animation {
  0% { transform: rotate(10deg) scale(1); }
  100% { transform: rotate(-10deg) scale(0.95); }
}

/* 移动端隐藏 */
@media (max-width: 768px) {
  .feng_custom_national_day {
    display: none;
  }
}

/* ---------- 欢迎浮动卡片 ---------- */
.welcome-card {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 98;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: var(--shadow-card-hover);
  max-width: 360px;
  transform-origin: bottom right;
  animation: welcomeExpand 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.welcome-card.closing {
  animation: welcomeCollapse 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.welcome-card.hidden {
  display: none;
}

@keyframes welcomeExpand {
  from {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes welcomeCollapse {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }
}

.welcome-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.welcome-close:hover {
  color: var(--text-primary);
}

.welcome-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.welcome-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}

.welcome-greeting {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.welcome-location {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .welcome-card {
    right: 16px;
    left: 16px;
    bottom: 80px;
    max-width: none;
  }
}

/* ---------- 主内容区 ---------- */
#main {
  padding: var(--section-gap) 0;
  padding-top: calc(60px + var(--section-gap));
  min-height: 60vh;
  flex: 1;
}

/* 首页第一屏抵消头部高度 */
.home #main {
  padding-top: 0;
}

.home .hero {
  margin-top: 0;
}

/* ---------- 文章详情 Hero ---------- */
.post-hero {
  position: relative;
  padding: 220px 0 40px;
  margin-top: -60px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.post-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.post-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
  color: #fff;
}
.post-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.post-hero-cat {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
}
.post-hero-cat a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}
.post-hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 20px;
  width: 100%;
  max-width: 600px;
}
.post-hero-divider::before,
.post-hero-divider::after {
  content: "";
  flex: 1;
  height: 1px;
}
.post-hero-divider::before {
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5));
}
.post-hero-divider::after {
  background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.5));
}
.post-hero-divider i {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}
.post-hero-excerpt {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 auto 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.post-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.9);
}
.post-hero-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  line-height: 1;
  box-sizing: border-box;
}
.post-hero-meta .font-size-toggle {
  padding: 0 10px;
}
.post-hero-meta .font-size-toggle .font-btn {
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
}
.post-hero-meta a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}
.post-hero-meta a:hover {
  color: #fff;
}
.font-size-toggle {
  display: inline-flex;
  gap: 4px;
}
.font-btn {
  width: 22px;
  height: 22px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.9) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}
.font-btn:hover {
  background: transparent !important;
  opacity: 0.7;
}
.post-body {
  padding-top: 40px;
}

@media (max-width: 768px) {
  .post-hero {
    padding: 80px 0 40px;
  }
  .post-hero-meta {
    gap: 12px;
    font-size: 0.8rem;
  }
}

/* 归档页标题 */
.archive-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--card-gap);
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

/* ---------- 文章卡片列表 ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

article.post {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition: all var(--transition);
  border: none;
}

article.post:hover {
  box-shadow: none;
  transform: none;
}

.post-title {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
}

.post-title a {
  color: var(--text-primary);
}

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.post-meta li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-meta a {
  color: var(--text-tertiary);
}

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

.post-content {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content p {
  margin-bottom: 12px;
}

.post-content img {
  border-radius: var(--border-radius-sm);
  margin: 16px 0;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--accent-light);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  color: var(--text-secondary);
}

.post-content code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: var(--border-radius-xs);
  font-size: 0.8125rem;
  font-family: inherit;
}

.post-content pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 20px;
  border-radius: var(--border-radius-sm);
  overflow-x: auto;
  margin: 16px 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* 标签 */
.tags {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.tags a {
  display: inline-block;
  padding: 4px 12px;
  margin: 0 6px 6px 0;
  background: var(--bg-input);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: all var(--transition);
}

.tags a:hover {
  background: var(--accent);
  color: #fff;
}

/* 上一篇/下一篇 */
.post-near {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  list-style: none;
}

.post-near li {
  flex: 1;
}

.post-near li:last-child {
  text-align: right;
}

.post-near a {
  color: var(--text-secondary);
}

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

/* ---------- 分页 ---------- */
.page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 32px;
}

.page-nav a,
.page-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.page-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.page-nav .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- 翻页（参考 thyuu.com 展开式） ---------- */
.page-navigator {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 48px 0;
  padding: 0;
}

.page-navigator li {
  margin: 0;
}

/* 数字页：小药丸，outline 透明外扩 2em，hover 时收回展开 */
.page-navigator li > a,
.page-navigator li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  height: 2.2em;
  padding: 0 0.3em;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  text-decoration: none;
  outline: 1px solid transparent;
  outline-offset: 2em;
  transition: outline-color 0.5s ease, outline-offset 0.5s ease, background 0.5s ease, color 0.5s ease;
  cursor: pointer;
  box-sizing: border-box;
}

/* hover 数字页：描边显现、offset 收回、背景透明 */
.page-navigator li > a:hover {
  color: var(--accent);
  outline-color: color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 0;
  background: transparent;
}

/* 当前页：主题色实心 */
.page-navigator li.current > span,
.page-navigator li.current > a {
  color: #fff;
  background: var(--accent);
  outline: none;
  outline-offset: 0;
  cursor: default;
  pointer-events: none;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* 上一页/下一页：收起为圆形箭头图标，hover 展开为胶囊 */
.page-navigator li.prev > a,
.page-navigator li.next > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  min-width: 2.2em;
  max-width: 2.2em;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: transparent; /* 收起时文字透明 */
  outline: none;
  outline-offset: 0;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.5s ease, padding 0.5s ease, border-radius 0.5s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

/* FA 图标：收起时绝对定位居中，hover 时变 inline 在文字左侧 */
.page-navigator li.prev > a i,
.page-navigator li.next > a i {
  color: #fff;
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.page-navigator li.prev > a:hover,
.page-navigator li.next > a:hover {
  max-width: 10em;
  padding: 0 1.2em;
  border-radius: 999px;
  background: var(--accent-hover, var(--accent));
  color: #fff;
  outline: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.page-navigator li.prev > a:hover i,
.page-navigator li.next > a:hover i {
  position: static;
  margin-right: 0.4em;
  transform: scale(1.15);
}

/* 禁用态（第1页无上一页 / 末页无下一页）：灰色圆形箭头 */
.page-navigator li.prev > span,
.page-navigator li.next > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  width: 2.2em;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-card);
  color: transparent;
  opacity: 0.4;
  outline: none;
  outline-offset: 0;
  cursor: not-allowed;
  overflow: hidden;
}
.page-navigator li.prev > span::before {
  content: "\f104"; /* fa-angle-left */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--text-tertiary);
  font-size: 1.05rem;
}
.page-navigator li.next > span::before {
  content: "\f105"; /* fa-angle-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--text-tertiary);
  font-size: 1.05rem;
}

/* 省略号 … */
.page-navigator li.extend > span {
  background: transparent;
  outline: none;
  outline-offset: 0;
  color: var(--text-tertiary);
  font-family: ui-monospace, monospace;
  min-width: auto;
  padding: 0 0.2em;
}

/* 移动端缩小 */
@media (max-width: 768px) {
  .page-navigator {
    gap: 10px;
    margin: 32px 0;
  }
  .page-navigator li > a,
  .page-navigator li > span {
    min-width: 2em;
    height: 2em;
    font-size: 0.85rem;
    outline-offset: 1.2em;
  }
  .page-navigator li > a:hover {
    outline-offset: 0;
  }
}

/* ---------- 评论区 ---------- */
#comments {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

#comments h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.comment-list {
  margin-bottom: 24px;
}

.comment-body {
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.comment-reply {
  margin-left: 40px;
}

.respond {
  margin-top: 24px;
}

.respond h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

#comment-form p {
  margin-bottom: 16px;
}

#comment-form label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

#comment-form label.required::after {
  content: ' *';
  color: var(--accent);
}

#comment-form .text,
#comment-form .textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

#comment-form .text:focus,
#comment-form .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

#comment-form .textarea {
  min-height: 120px;
  resize: vertical;
}

#comment-form .submit {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

#comment-form .submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.cancel-comment-reply {
  margin-bottom: 12px;
}

/* ---------- 404 页面 ---------- */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.error-page p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-page form {
  max-width: 400px;
  margin: 0 auto;
}

.error-page .text {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ---------- 页脚 ---------- */
#footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 32px;
  margin-top: 60px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

#footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

.footer-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.footer-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

.footer-days {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 32px;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

.footer-rand-label {
  margin-bottom: 8px;
}

.footer-rand-post {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-rand-post:hover {
  color: var(--accent);
}

.footer-links {
  /* 友链预留 */
}

.footer-copyright {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---------- 返回顶部（头部圆形进度条） ---------- */
.back-to-top {
  position: relative;
  width: 0;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0;
  margin-right: 0;
}

.back-to-top.visible {
  width: 36px;
  opacity: 1;
  margin-right: 8px;
}

.back-to-top:hover {
  color: var(--accent);
}

/* 进度环 */
.back-to-top .progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.back-to-top .progress-bg {
  stroke: var(--border-color);
}

.back-to-top .progress-bar {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.1s linear;
}

/* 百分比文字 */
.back-to-top .progress-text {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  transition: opacity 0.2s;
}

/* 火箭图标 */
.back-to-top .rocket-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s;
}

/* 悬停时：隐藏百分比，显示火箭 */
.back-to-top:hover .progress-text {
  opacity: 0;
}

.back-to-top:hover .rocket-icon {
  opacity: 1;
  transform: translateY(0);
}

/* 移动端隐藏返回顶部 */
@media (max-width: 768px) {
  .back-to-top {
    display: none !important;
  }
}

/* 深色模式返回顶部按钮颜色 */
[data-theme="dark"] .back-to-top {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .back-to-top:hover {
  color: #016fff;
}

[data-theme="dark"] .back-to-top .progress-bg {
  stroke: rgba(255, 255, 255, 0.15);
}

/* ---------- 工具类 ---------- */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  :root {
    --container-pad: 16px;
    --section-gap: 24px;
    --card-gap: 16px;
  }

  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  html {
    font-size: 0.9375rem;
  }

  /* 导航 */
  #header .container {
    height: 54px;
    justify-content: space-between;
  }

  /* 移动端：所有页面 header 统一全宽 */
  #header {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 0;
  }

  #header .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 16px !important;
    box-sizing: border-box;
  }

  /* 移动端：下滑时不使用胶囊，恢复全宽样式 */
  #header.header-scrolled,
  body:not(.home) #header.header-scrolled {
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    width: auto;
    max-width: none;
    border-radius: 0;
    box-shadow: var(--shadow-nav);
  }

  #header.header-scrolled .container,
  body:not(.home) #header.header-scrolled .container {
    max-width: var(--container-max);
    padding: 0 var(--container-pad);
    width: 100%;
  }

  /* 移动端：左侧汉堡菜单 */
  .menu-toggle {
    display: flex;
    order: 1;
    width: 36px;
    height: 36px;
    padding: 0;
  }

  /* 移动端：搜索图标和汉堡对称 */
  .search-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 移动端：中间logo */
  .site-name,
  #header.header-scrolled .site-name {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: static;
    transform: none;
  }

  /* 移动端隐藏logo悬停tooltip */
  #logo[data-description]:hover::after {
    display: none;
  }

  /* 移动端：右侧搜索 */
  #header > .container > div:last-child {
    order: 3;
  }

  /* 移动端隐藏深浅模式切换 */
  .theme-toggle {
    display: none;
  }

  #nav-menu {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    transform: none;
    background: var(--bg-card);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    z-index: 998;
  }

  #nav-menu.open {
    display: flex;
  }

  #nav-menu a {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
  }

  /* 移动端高亮：左侧竖线，不用下划线 */
  #nav-menu a.current::after {
    display: none;
  }

  #nav-menu a.current {
    border-left: 3px solid var(--accent);
    background: var(--bg-hover);
    padding-left: 13px;
  }

  /* 移动端菜单中的深浅切换按钮 */
  #nav-menu .theme-toggle-mobile {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    border-radius: var(--border-radius-xs);
    transition: background var(--transition);
    position: relative;
  }

  #nav-menu .theme-toggle-mobile:hover {
    background: var(--bg-hover);
  }

  #nav-menu .theme-toggle-mobile svg {
    width: 18px;
    height: 18px;
    position: relative;
    flex-shrink: 0;
    display: inline-block;
  }

  /* 移动端深浅切换SVG显示逻辑 */
  #nav-menu .theme-toggle-mobile .icon-base {
    opacity: 1;
    position: absolute;
    left: 16px;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #nav-menu .theme-toggle-mobile .icon-rays {
    opacity: 1;
    transform: rotate(0deg);
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 16px;
  }

  #nav-menu .theme-toggle-mobile .icon-moon {
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 16px;
  }

  [data-theme="dark"] #nav-menu .theme-toggle-mobile .icon-base {
    opacity: 0;
  }

  [data-theme="dark"] #nav-menu .theme-toggle-mobile .icon-rays {
    opacity: 0;
    transform: rotate(180deg);
  }

  [data-theme="dark"] #nav-menu .theme-toggle-mobile .icon-moon {
    opacity: 1;
  }

  #nav-menu .theme-toggle-mobile span {
    margin-left: 28px;
  }

  .site-search {
    display: none;
  }

  /* 文章卡片 */
  article.post {
    padding: 20px;
  }

  .post-title {
    font-size: 1.125rem;
  }

  .post-meta {
    gap: 10px;
    font-size: 0.75rem;
  }

  /* 分页 */
  .page-nav a,
  .page-nav span {
    min-width: 36px;
    height: 36px;
    font-size: 0.8125rem;
  }

  /* 评论回复缩进 */
  .comment-reply {
    margin-left: 20px;
  }
}

/* ============================================================
   归档页面
   ============================================================ */
.archives-page {
  padding: 60px 0;
}

.archives-header {
  margin-bottom: 50px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.archives-title {
  font-size: 2.625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.archives-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.archives-stats {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.archives-stats .stats-num {
  color: var(--accent);
  font-weight: 700;
}

/* 年份分组 */
.archive-year {
  margin-bottom: 40px;
}

.year-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.year-count {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

/* 文章列表 */
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.archive-item:hover {
  background: var(--bg-hover);
  padding-left: 10px;
  padding-right: 10px;
  margin-left: -10px;
  margin-right: -10px;
  border-radius: 8px;
}

.archive-date {
  flex-shrink: 0;
  width: 60px;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-family: inherit;
}

.archive-title {
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-title:hover {
  color: var(--accent);
}

.archive-comments {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* 深色模式 */
[data-theme="dark"] .archive-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* 移动端 */
@media (max-width: 768px) {
  .archives-page {
    padding: 40px 0;
  }

  .archives-title {
    font-size: 2rem;
  }

  .archives-desc {
    font-size: 0.875rem;
  }

  .year-title {
    font-size: 1.625rem;
  }

  .archive-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .archive-date {
    width: auto;
  }

  .archive-title {
    order: 3;
    width: 100%;
    white-space: normal;
  }

  .archive-comments {
    margin-left: auto;
  }
}

/* ============================================================
   归档页（/archives/）三列瀑布流 + 月份卡片
   ============================================================ */
.archive-page {
  /* 底部间距与其他页一致，由 #main 的 padding-bottom 控制 */
}

/* 上下布局容器 */
.archive-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 顶部区域（左对齐） */
.archive-sidebar {
  flex: none;
  width: 100%;
  text-align: left;
}

.archive-page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  letter-spacing: 1px;
  line-height: 1.3;
}

.archive-page-title .archive-num {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 500;
  color: #1a1a1a;
  vertical-align: super;
  margin-left: 4px;
  opacity: 0.7;
}

.archive-page-desc {
  font-size: 1rem;
  color: #333333;
  line-height: 1.7;
  margin: 0 0 20px;
}

/* 年份导航（横向标签，上方横线隔开） */
.archive-year-nav {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.archive-year-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.archive-year-list li {
  position: static;
  padding: 0;
  font-size: 0.875rem;
}

/* 隐藏时间线竖线和圆点 */
.archive-year-list li::before,
.archive-year-list .nav-dot {
  display: none;
}

.archive-year-list li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.archive-year-list li a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* 当前年份高亮 */
.archive-year-list li.current a {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

.archive-year-list li a .year-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.archive-year-list li a:hover .year-count,
.archive-year-list li.current a .year-count {
  color: rgba(255, 255, 255, 0.8);
}

.archive-year-list li a:hover .year-count,
.archive-year-list li.current a .year-count {
  color: rgba(255, 255, 255, 0.8);
}

/* 内容区 */
.archive-content {
  flex: none;
  width: 100%;
}

/* 按年/月分组的文章流 */
.archive-stream {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-color);
}

/* 年份分组（默认页使用，底部横线隔开） */
.archive-year-group {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.archive-year-group:last-child {
  border-bottom: none;
}

/* 年份标题行（篇数上标，与顶部标题一致） */
.archive-year-header {
  margin-bottom: 14px;
}

.archive-year-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.archive-year-stats {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  vertical-align: super;
  margin-left: 4px;
}

/* 月份分组（选中年份后使用，底部横线隔开） */
.archive-month-group {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.archive-month-group:last-child {
  border-bottom: none;
}

/* 月份标题行（篇数上标，与顶部标题一致） */
.archive-month-header {
  margin-bottom: 14px;
}

.archive-month-label {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.archive-month-stats {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  vertical-align: super;
  margin-left: 4px;
}

/* 默认页统一列表（不分组） */
.archive-flat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.archive-flat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.5;
}

.archive-flat-item:last-child {
  border-bottom: none;
}

.archive-flat-item time {
  flex: 0 0 48px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  font-family: monospace;
}

.archive-flat-item .archive-post-title {
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.archive-flat-item .archive-post-title:hover {
  color: var(--accent);
}

.archive-flat-item .archive-comments {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* 月份分组内的文章列表（横线隔开） */
.archive-post-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1em;
  display: flex;
  flex-direction: column;
}

.archive-post-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.5;
}

.archive-post-item time {
  flex: 0 0 60px;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  font-weight: 400;
  white-space: nowrap;
}

.archive-post-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
}

.archive-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.archive-post-item:hover .archive-post-thumb img {
  transform: scale(1.05);
}

.archive-post-item .archive-post-title {
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.archive-post-item .archive-post-title-text {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}

.archive-post-item .archive-post-title-text::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.archive-post-item .archive-post-title:hover {
  color: var(--accent);
}

.archive-post-item .archive-post-title:hover .archive-post-title-text::after {
  width: 100%;
}

.archive-post-item .archive-comments {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* 响应式 */
@media (max-width: 640px) {
  .archive-page-title {
    font-size: 1.375rem;
  }
  .archive-page-desc {
    font-size: 0.85rem;
  }
  .archive-month-label {
    font-size: 1rem;
  }
  .archive-month-group {
    padding: 16px 0;
  }
  .archive-flat-item {
    padding: 12px 0;
    gap: 10px;
  }
  .archive-flat-item time {
    flex: 0 0 40px;
    font-size: 0.75rem;
  }
  .archive-flat-item .archive-post-title {
    font-size: 0.85rem;
  }
  .archive-flat-item .archive-comments {
    font-size: 0.75rem;
  }
  .archive-post-item time {
    flex: 0 0 32px;
    font-size: 0.75rem;
  }
  .archive-post-item .archive-post-title {
    font-size: 0.85rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
  }
}

/* ============================================================
   非首页字号统一（首页除外）— 全站文字统一 rem
   ============================================================ */
html {
  font-size: 1rem;
}

body {
  font-size: 1rem;
}

/* 非首页：文章标题 / meta / 摘要统一 */
body:not(.home) .post-title {
  font-size: 1.85rem;
}

body:not(.home) .post-meta {
  font-size: 0.9rem;
}

body:not(.home) .post-content {
  font-size: 1rem;
}

/* 非首页移动端标题缩小 */
@media (max-width: 768px) {
  body:not(.home) .post-title {
    font-size: 1.5rem;
  }
}

/* ============================================================
   文章详情页 — 下蓝色短装饰线
   ============================================================ */
.post-meta {
  position: relative;
  margin-bottom: 1.875rem;
  padding-bottom: 0.9375rem;
  border-bottom: 1px solid var(--border-color);
}

.post-meta::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.5rem;
  height: 0.1875rem;
  background: var(--accent);
}

/* 文章标题与正文颜色 */
.post-title {
  color: #1a1a1a;
  font-weight: 700;
}

.post-content {
  color: #333333;
}

[data-theme="dark"] .post-content {
  color: #d0d0d0;
}

[data-theme="dark"] .post-title {
  color: #f0f0f0;
}

/* 暗黑模式：归档页/分类页标题描述与关于页一致 */
[data-theme="dark"] .archive-page-title,
[data-theme="dark"] .archive-page-title .archive-num {
  color: #f0f0f0;
}

[data-theme="dark"] .archive-page-desc {
  color: #d0d0d0;
}

[data-theme="dark"] .category-title,
[data-theme="dark"] .category-title .cat-count {
  color: #f0f0f0;
}

[data-theme="dark"] .category-desc {
  color: #d0d0d0;
}

/* meta 行 + 字体调节按钮 */
.post-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  margin-bottom: 1.875rem;
  padding-bottom: 0.9375rem;
}

.post-meta-bar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0.125rem;
  background: linear-gradient(to right, var(--accent) var(--blue-width, 2.5rem), var(--border-color) var(--blue-width, 2.5rem));
}

.post-meta-bar .post-meta {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
  flex: 1;
}

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

/* 字体调节按钮 */
.font-size-toggle {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.font-btn {
  width: 1.875rem;
  height: 1.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--border-radius-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  padding: 0;
}

/* 左右按钮有外框，中间默认按钮无外框 */
.font-btn:not(.font-reset) {
  border-color: var(--border-color);
}

.font-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.font-btn.active {
  color: var(--accent);
}

/* 正文字体调节状态（参照 itlaoli：默认16px，步进1px） */
body:not(.home) .post-content.font-sm { font-size: 0.9375rem; }
body:not(.home) .post-content.font-md { font-size: 1rem; }
body:not(.home) .post-content.font-lg { font-size: 1.0625rem; }

@media (max-width: 768px) {
  .post-meta-bar {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ============================================================
   分类/标签/搜索列表页 — 三栏布局
   ============================================================ */
#post-list .list-card article.post {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 1.5rem 0;
  margin: 0;
  border-bottom: 1px solid var(--border-color);
  transform: none;
}

#post-list .list-card article.post:hover {
  box-shadow: none;
  transform: none;
}

#post-list .list-post {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  position: relative;
}

/* 左栏日期 */
#post-list .list-date {
  flex-shrink: 0;
  width: 6rem;
  text-align: left;
  padding-right: 1.5rem;
  margin-right: 0.5rem;
}

#post-list .list-post {
  position: relative;
}

/* 竖线贯穿整个文章高度 */
#post-list .list-post::before {
  content: '';
  position: absolute;
  left: 7.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-color);
}

#post-list .list-date .day {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  transition: color 0.2s ease;
}

#post-list .list-date .day::before {
  content: '·';
  margin-right: 0.25rem;
  color: var(--text-tertiary);
  font-weight: 400;
  transition: color 0.2s ease;
}

#post-list .list-post:hover .list-date .day {
  color: var(--accent);
}

#post-list .list-post:hover .list-date .day::before {
  color: var(--accent);
  font-weight: 700;
}

#post-list .list-date .ym {
  display: block;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}

#post-list .list-date .date-full {
  display: none;
}

#post-list .list-post:hover .list-date .ym {
  color: var(--accent);
}

/* 中栏 */
#post-list .list-main {
  flex: 1;
  min-width: 0;
  padding-left: 1.5rem;
  padding-right: 16rem;
  position: relative;
}

#post-list .list-main .post-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#post-list .list-main .post-title a {
  color: var(--text-primary);
  transition: color 0.2s ease;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s ease, color 0.2s ease;
  padding-bottom: 2px;
}

#post-list .list-main .post-title a:hover,
#post-list .list-post:hover .list-main .post-title a {
  color: var(--accent);
  background-size: 100% 2px;
}

#post-list .list-main .post-content {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#post-list .list-main .post-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0;
  padding: 0;
  border: none;
  position: static;
}

#post-list .list-main .post-meta::after {
  display: none;
}

#post-list .list-main .post-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#post-list .list-main .post-meta span + span::before {
  content: '/';
  margin-right: 0.75rem;
  color: var(--border-color);
}

#post-list .list-card .list-main .post-meta a,
#post-list .list-card .list-main .post-meta span {
  color: var(--text-tertiary);
  text-decoration: none;
  border: none;
}

#post-list .list-main .post-meta a:hover {
  color: var(--accent);
}

/* 右栏缩略图 */
#post-list .list-thumb {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 15rem;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

#post-list .list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

#post-list .list-thumb:hover img {
  transform: scale(1.05);
}

/* 列表页顶部标题区 */
#post-list .list-card {
  background: transparent;
  border: none;
  box-shadow: none;
}

.list-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none;
}

#post-list .list-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

#post-list .list-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

#post-list .list-description {
  font-size: 1rem;
  color: #1a1a1a;
  line-height: 1.8;
}

/* 深色模式：分类页标题描述与关于页一致 */
[data-theme="dark"] #post-list .list-title {
  color: #f0f0f0;
}

[data-theme="dark"] #post-list .list-description {
  color: #d0d0d0;
}

#post-list .archive-title {
  display: none;
}

/* ---------- 分类页上下布局 ---------- */
.category-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 顶部区域 */
.category-header {
  text-align: left;
}

.category-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  letter-spacing: 1px;
  line-height: 1.3;
}

.category-title .cat-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: #1a1a1a;
  vertical-align: super;
  margin-left: 4px;
  opacity: 0.7;
}

.category-desc {
  font-size: 1rem;
  color: #333333;
  line-height: 1.7;
  margin: 0 0 20px;
}

/* 分类导航（横向标签，上方横线隔开） */
.category-nav-horizontal {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.category-tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.category-tag-list li {
  font-size: 0.875rem;
}

.category-tag-list li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-tag-list li a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.category-tag-list li.current a {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

.category-tag-list li a .cat-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.category-tag-list li a:hover .cat-count,
.category-tag-list li.current a .cat-count {
  color: rgba(255, 255, 255, 0.8);
}

/* 内容区 */
.category-content {
  width: 100%;
  border-top: 1px solid var(--border-color);
}

/* 分类页文章卡片：之间横线分隔 + 间距 */
.category-content .list-post {
  padding: 28px 0;
  border-bottom: 1px solid var(--border-color);
}

/* 分类页翻页居中 */
.category-page .page-navigator {
  justify-content: center;
  margin-top: 32px;
}

/* 移动端三栏变单列 */
@media (max-width: 768px) {
  #post-list .list-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

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

  #post-list .list-main .post-title {
    font-size: 1.25rem;
  }

  #post-list .list-post {
    flex-direction: column;
    gap: 0.75rem;
  }

  #post-list .list-post::before {
    display: none;
  }

  #post-list .list-date {
    width: auto;
    padding-right: 0;
    margin-right: 0;
  }

  #post-list .list-date .day {
    display: none;
  }

  #post-list .list-date .day::before {
    content: '';
    margin: 0;
  }

  #post-list .list-date .ym {
    display: none;
  }

  #post-list .list-date .date-full {
    display: block;
    font-size: 0.9rem;
    color: var(--text-tertiary);
  }

  #post-list .list-card article.post {
    padding: 1rem 0;
  }

  #post-list .list-main {
    padding-left: 0;
    padding-right: 0;
  }

  #post-list .list-thumb {
    position: static;
    width: 100%;
    height: auto;
    margin: 0.75rem 0;
  }

  #post-list .list-thumb img {
    height: 12rem;
  }

  #post-list .list-main .post-meta span + span::before {
    display: none;
  }
}

/* ============================================================
   非首页全站统一字体大小和颜色
   ============================================================ */
body:not(.home) {
  font-size: 1rem;
  color: var(--text-primary);
}

body:not(.home) .post-title {
  font-size: 1.5rem;
  color: var(--text-primary);
}

body:not(.home) .post-content {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.8;
}

body:not(.home) .post-meta,
body:not(.home) .post-meta-bar {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

body:not(.home) .post-meta a,
body:not(.home) .post-meta-bar a {
  color: var(--text-tertiary);
}

body:not(.home) .post-meta a:hover,
body:not(.home) .post-meta-bar a:hover {
  color: var(--accent);
}

/* 手机端（不含平板）文章详页：隐藏分类和字体调节，标题同列表页 */
@media (max-width: 640px) {
  body.single .post-meta .meta-category {
    display: none;
  }

  body.single .font-size-toggle {
    display: none;
  }

  body.single .post-title {
    font-size: 1.4rem;
  }
}
