/*!
Theme Name: Westlife
Theme URI: https://xifeng.net/wordpress-westlife-theme.html
Author: 西风
Author URI: https://xifeng.net.net
Description: A powerful and elegant WordPress theme
Version: 1.0.3
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/*--------------------------------------------------------------
>>> 1. General Styles
--------------------------------------------------------------*/
/* === 字体声明 === */
/* 引入 Google Fonts (BlueCDN加速) 版权字体*/

/* Roboto Condensed */
@import url('https://fonts.bluecdn.com/css2?family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');

/* Open Sans */
@import url('https://fonts.bluecdn.com/css2?family=Open+Sans:wght@400;700&display=swap');

/* Lato */
@import url('https://fonts.bluecdn.com/css2?family=Lato:wght@400;700&display=swap');

/* === Ubuntu - 用于页面所有英文内容 === */
@font-face {
  font-family: "Ubuntu";
  src: url("https://static.xifengcdn.com/fonts/Ubuntu-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-007F; /* 基础拉丁字符集 */
}

/* === Arvo - 用于bash命令和代码显示 === */
@font-face {
  font-family: "Arvo";
  src: url("https://static.xifengcdn.com/fonts/Arvo.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-007F; /* 基础拉丁字符集 */
}

/* === 思源宋体 - 用于中文内容显示 === */
@font-face {
  font-family: "Source Han Serif CN";
  src: url("https://static.xifengcdn.com/fonts/NotoSerifSC-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4E00-9FFF; /* 中文字符集 */
}

/* === 腾讯体 - 用于中文内容显示 === */
@font-face {
  font-family: "Tencent Sans";
  src: url("https://static.xifengcdn.com/fonts/TencentSans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4E00-9FFF; /* 中文字符集 */
}

/* === 腾讯体 - 英文字母/数字也能匹配 === */
@font-face {
  font-family: "Tencent Sans";
  src: url("https://static.xifengcdn.com/fonts/TencentSans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E; /* 基本拉丁字母、数字 */
}

/* === Kuaikan Shijie Ti - 用于中文内容 === */
@font-face {
  font-family: "KuaiKanShiJieTi";
  src: url("https://static.xifengcdn.com/fonts/KuaiKanShiJieTi.woff2") format("woff2"),
       url("https://static.xifengcdn.com/fonts/KuaiKanShiJieTi.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  /* 建议不写 unicode-range，避免部分中文不显示 */
}


/* 不覆盖已明确指定思源宋体的标题（示例类名，根据你主题中的实际类名可保留继承） */
.serif-title, .title-serif, [data-font="serif"] { font-family: inherit; }

/* 主题基础变量 */
:root {
  /* 主色系统 */
  --color-primary: #002fa7;
  --color-primary-rgb: 0, 47, 167;
  --color-secondary: #1e4ec8;
  --color-accent: #4b7be5;

  /* 文本颜色 */
  --color-text: #2c3e50;
  --color-text-light: #718096;
  --color-heading: #1a202c;

  /* 背景颜色 */
  --color-background: #ffffff;
  --color-background-light: #f7fafc;
  --color-card-background: #ffffff;
  --color-surface: #ffffff;

  /* 边框和分割线 */
  --color-border: #e2e8f0;
  --color-divider: rgba(0, 0, 0, 0.06);

  /* 状态颜色 */
  --color-hover: #3b82f6;
  --color-active: #1d4ed8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* 字体系统 */
  --font-primary: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif; /* 英文内容 */
  --font-chinese: "Microsoft YaHei", "PingFang SC", -apple-system,  "SimSun",
    sans-serif; /* 中文内容 */
  --font-code: "Arvo", Consolas, Monaco, monospace; /* 代码显示 */
  --font-content: "PingFang SC", -apple-system, "Microsoft YaHei", sans-serif; /* 正文内容 */

  /* 间距系统 */
  --spacing-unit: 6px;
  --container-width: 1280px;
  --container-padding: 10px;
}

/* 暗色模式变量 */
[data-theme="dark"] {
  /* 主色和强调色 */
  --color-primary: #002fa7; /* 保持主蓝色不变 */
  --color-primary-rgb: 0, 47, 167;
  --color-secondary: #4b7be5; /* 稍浅的蓝色作为次要色 */
  --color-accent: #1e4ec8; /* 深蓝色作为强调色 */

  /* 文本颜色系统 */
  --color-text: #e5e5e5; /* 主要文本颜色 - 更亮的灰色 */
  --color-text-light: #999999; /* 次要文本颜色 - 中等灰色 */
  --color-heading: #ffffff; /* 标题文本颜色 - 纯白色 */

  /* 背景颜色系统 */
  --color-background: #181818; /* 主背景色 - 纯黑 */
  --color-background-light: #1f1f1f; /* 次级背景色 - 深灰 */
  --color-card-background: #1a1a1a; /* 卡片背景色 - 稍亮的深灰 */
  --color-surface: #262626; /* 表面颜色 - 中灰 */

  /* 边框和分割线 */
  --color-border: #333333; /* 边框颜色 - 深灰 */
  --color-divider: rgba(255, 255, 255, 0.08); /* 分割线 - 半透明白 */

  /* 交互状态颜色 */
  --color-hover: #1e4ec8; /* 悬停状态 - 深蓝色 */
  --color-active: #002fa7; /* 激活状态 - 主蓝色 */

  /* 功能色 */
  --color-success: #002fa7; /* 成功状态 - 使用主蓝色 */
  --color-warning: #4b7be5; /* 警告状态 - 浅蓝色 */
  --color-error: #1e4ec8; /* 错误状态 - 深蓝色 */

  /* 阴影效果 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* 深色模式下的按钮和交互元素 */
[data-theme="dark"] .button,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .social-link {
  background: var(--color-background-light);
  border-color: var(--color-border);
}

[data-theme="dark"] .button:hover,
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .social-link:hover {
  background: var(--color-hover);
  border-color: var(--color-hover);
  color: #ffffff;
}

/* 深色模式下的文本选中效果 */
[data-theme="dark"] ::selection {
  background: var(--color-primary);
  color: #ffffff;
}

/* 深色模式下的文本选中效果 */
[data-theme="dark"] ::selection {
  background: #002fa7;
  color: #ffffff;
}

/* 深色模式下的卡片悬停效果 */
[data-theme="dark"] .post-card:hover {
  transform: translateY(-3px);
  background: #1f1f1f; /* 稍微亮一点的背景 */
  box-shadow: var(--shadow-lg);
}

/* 深色模式下的按钮和交互元素 */
[data-theme="dark"] .button,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .social-link {
  background: var(--color-background-light);
  border-color: var(--color-border);
}

[data-theme="dark"] .button:hover,
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .social-link:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 基础布局样式 */
body {
  font-family: var(--font-chinese);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  transition: background-color 0.3s, color 0.3s;
}

/* 链接样式 */
a {
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  text-decoration: none;
  color: var(--color-primary);
}

/* 英文专用内容 */
.en,
.english-text,
time,
.post-date,
.post-meta {
  font-family: var(--font-primary); /* Ubuntu 用于英文内容 */
}

/* 代码相关样式 */
pre,
code,
kbd,
samp,
.bash,
.wp-block-code,
.wp-block-preformatted {
  font-family: var(--font-code); /* Arvo 用于代码显示 */
}

/*--------------------------------------------------------------
  >>> 2. 框架 Layout
 --------------------------------------------------------------*/
/* 页面基础布局 */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 头部和底部全宽 */
.site-header,
.site-footer {
  width: 100%;
  flex-shrink: 0;
}

/* 主内容区域 */
.site-main {
  flex: 1;
  width: 100%;
  padding: 1rem 0;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
}

/* 头部内容和底部内容的包装器 */
.header-content {
  max-width: 1280px; /* 可以设置比内容区更宽的宽度 */
  margin: 0 auto;
  width: 100%;
}

.footer-content {
  margin: 0 auto;
  width: 100%;
}

/* 文章布局 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: calc(var(--spacing-unit) * 4);
}

/* 内容区过渡效果 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 改为固定2列 */
  gap: 1.8rem; /* 略微增加列间距 */
  padding: 0.5rem 0;
}

/* 响应式布局调整 */
@media (max-width: 992px) {
  .posts-grid {
    gap: 1.5rem; /* 平板设备稍微减小间距 */
  }
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr; /* 手机设备显示单列 */
    gap: 1.2rem;
  }
}

/* 自适应隐藏滚动条：保留滚动槽避免抖动，滚动/悬停时显示 */
/* 始终预留滚动槽，页面长短切换不抖动 */
html { scrollbar-gutter: stable both-edges; }

/* WebKit/Blink (Chrome/Edge/Safari) */
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;         /* 无轨道背景 */
}
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0);       /* 默认不可见 */
  border-radius: 4px;
  opacity: 0;
  transition: background-color .2s ease, opacity .2s ease;
}
/* 悬停页面或处于滚动交互时才显示 */
body:hover::-webkit-scrollbar-thumb,
body.scrolling::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary-rgb), .25);
  opacity: 1;
}
body:hover::-webkit-scrollbar-thumb:hover,
body.scrolling::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary-rgb), .35);
}
body.scrolling::-webkit-scrollbar-thumb:active {
  background: rgba(var(--color-primary-rgb), .45);
}

/* Firefox */
html { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html.scrolling { scrollbar-color: rgba(var(--color-primary-rgb), .25) transparent; }

/* 深色模式无需单独处理，颜色走 rgba + 主题变量 */

/** 优先级最高 放在最末尾：lazysizes 懒加载模糊淡入 **/
/* 加载前/加载中：模糊 + 淡入 */
.lazyload.lazy-load,
.lazyloading.lazy-load {
  background-color: var(--line);
  filter: blur(20px);
  opacity: .6;
  -webkit-mask: radial-gradient(circle at center, var(--white) 100%, transparent 100%);
  mask: radial-gradient(circle at center, var(--white) 100%, transparent 100%);
  transition: .5s ease-in-out opacity, .5s filter linear;
}
/* 加载完成：去模糊 + 完全不透明 */
.lazyloaded.lazy-load {
  filter: blur(0);
  opacity: 1;
}
/* 可选：进入视口的小幅上移动画 */
.lazyload:not(.lazyloaded) {
  transform: translateY(10px);
  transition-property: opacity, transform;
}
.lazyloaded {
  transform: translateY(0);
}

/*--------------------------------------------------------------
>>> 3. 个人介绍区域
--------------------------------------------------------------*/
/* 个人介绍区域布局 */
.intro-section {
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  border-radius: 8px;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05),
    /* 上方阴影 */ 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* 下方阴影 */
  padding: 1rem;
}

/* 三栏布局 */
.intro-columns {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
}

/* 栏目宽度比例 */
.intro-left {
  padding: 1.2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  flex: 0 0 30%;
  gap: 0.8rem;
}

.intro-center {
  flex: 1;
  border-radius: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 各栏基础样式 */
.intro-right {
  flex: 0 0 40%;
  padding: 1rem;
  background: var(--color-background-light);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

/* 左侧个人信息 */
.intro-basic {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.intro-avatar {
  width: 50px;
  height: 50px;
  position: relative;
  flex-shrink: 0;
}

.intro-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.intro-info {
  flex: 1;
  min-width: 0;
}

.intro-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.intro-slogan {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

/* 社交链接 */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem; /* 略微增加间距 */
  margin-top: auto;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; /* 增加点击区域 */
  height: 32px;
  color: var(--color-text-light);
  background: var(--color-background);
  border-radius: 50%;
  transition: all 0.25s ease;
  position: relative; /* 添加定位上下文 */

  /* 添加微弱阴影 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 添加悬停效果 */
.social-links a:hover {
  transform: translateY(-2px);
  color: #ffffff; /* 图标保持为白色 */
  background: var(--color-primary); /* 背景保持为主题蓝色 */
  box-shadow: 0 4px 8px rgba(0, 47, 167, 0.2); /* 添加蓝色阴影效果 */
}

/* 深色模式适配 */
[data-theme="dark"] .social-links a {
  background: var(--color-background-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 深色模式下的悬停效果 */
[data-theme="dark"] .social-links a:hover {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(0, 47, 167, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .social-links {
    gap: 0.5rem;
  }

  .social-links a {
    width: 28px;
    height: 28px;
  }
}

/* 统计区域 */
.stats-wrapper {
  position: relative;
  flex: 1;
  background: var(--color-background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0.8rem; /* 减少内边距 */
}

/* 数字统计 */
.total-stats {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: relative;
  z-index: 1;
  gap: 1rem; /* 减少项目间距 */
  margin-top: 2rem; /* 添加顶部外边距 */
}

.total-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem; /* 减少数字和标签间距 */
}

/* 响应式调整 */
@media (max-width: 768px) {
  .stats-wrapper {
    padding: 0.6rem; /* 移动端更小的内边距 */
  }

  .total-stats {
    gap: 0.3rem; /* 移动端更小的间距 */
  }

  .total-stat-item {
    gap: 0.2rem;
  }
}

.total-number {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--color-primary);
  font-family: "DM Sans", sans-serif;
  line-height: 1;
  transition: all 0.2s ease;
}

.total-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* 装饰图标 */
.stats-bg-icons {
  position: absolute;
  top: 0.2rem;
  left: 0.8rem;
  pointer-events: none;
  z-index: 0;
}

/* 装饰图标基础样式 */
.stats-bg-icons i {
  position: relative;
  display: inline-block;
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-right: 0.5rem;
  opacity: 0.3; /* 浅色模式下的透明度 */
}

/* 深色模式装饰图标适配 */
[data-theme="dark"] .stats-bg-icons i {
  color: #ffffff; /* 改用白色 */
  opacity: 0.08; /* 调整不透明度 */
}

/* 深色模式悬浮效果 */
[data-theme="dark"] .stats-wrapper:hover .stats-bg-icons i {
  opacity: 0.12; /* 悬浮时增加不透明度 */
  color: var(--color-primary); /* 悬浮时显示主题蓝色 */
}

/* 响应式调整 */
@media (max-width: 768px) {
  .stats-bg-icons {
    top: 1rem;
    left: 1rem;
    width: 60px;
    height: 60px;
  }

  .stats-bg-icons i:nth-child(1) {
    font-size: 1.8rem;
  }

  .stats-bg-icons i:nth-child(2) {
    font-size: 1.5rem;
    left: 20px;
  }

  .stats-bg-icons i:nth-child(3) {
    font-size: 1.2rem;
    left: 8px;
  }
}

/* 热力图区域 */
.stats-heatmap {
  width: 100%;
  background: var(--color-background);
  border-radius: 8px;
  padding: 0.2rem;
  margin-top: -1.5rem;
}

.activity-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  height: 20px;
}

.activity-day {
  position: relative;
  background: var(--color-background);
  border-radius: 2px;
  transition: transform 0.2s ease;
  cursor: pointer;
}

/* 热力图颜色级别 */
.activity-level-0 {
  background: var(--color-background-light);
}
.activity-level-1 {
  background: rgba(0, 47, 167, 0.2);
}
.activity-level-2 {
  background: rgba(0, 47, 167, 0.4);
}
.activity-level-3 {
  background: rgba(0, 47, 167, 0.6);
}
.activity-level-4 {
  background: rgba(0, 47, 167, 0.8);
}

/* 交互效果 */
.activity-day:hover {
  transform: scale(1.2);
  z-index: 1;
}

/* 响应式适配 */
@media (max-width: 992px) {
  .activity-grid {
    height: 15px;
    gap: 2px;
  }
}

@media (max-width: 768px) {
  .stats-heatmap {
    padding: 0.8rem;
  }

  .activity-grid {
    height: 12px;
    gap: 1px;
  }
}

/* 说说内容容器 */
.saying-content {
  position: relative;
  background: var(--color-background-light);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
}

/* 引号图标基础样式 */
.quote-icon {
  position: absolute;
  color: var(--color-primary);
  opacity: 0.2;
  z-index: 1;
}

/* 右引号 */
.quote-right {
  bottom: -0.7rem;
  right: 0.8rem;
  font-size: 4.5rem;
  transition: opacity 0.3s ease; /* 添加过渡效果 */
}

/* 引号悬浮效果 */
.saying-content:hover .quote-right {
  opacity: 0.35; /* 悬浮时提高不透明度 */
}

/* 深色模式适配 */
[data-theme="dark"] .saying-content:hover .quote-right {
  opacity: 0.65; /* 深色模式下悬浮时的不透明度 */
}

/* 说说文本内容 */
.saying-text {
  position: relative;
  flex: 1;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  z-index: 1;
}

/* 说说日期 */
.saying-date {
  position: relative; /* 确保日期在引号上层 */
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-text-light);
  font-size: 0.75rem;
  z-index: 1;
}

/* 交互效果 */
.social-links a:hover {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.1);
  transform: translateY(-2px);
}

.intro-avatar img:hover {
  transform: rotate(360deg);
}

.total-stat-item:hover .total-number {
  transform: translateY(-2px);
  color: var(--color-hover);
}

.activity-day:hover {
  transform: scale(1.2);
  z-index: 1;
}

/* 深色模式适配 */
[data-theme="dark"] {
  .intro-section {
    background: var(--color-background-light);
  }

  .intro-left,
  .intro-center,
  .intro-right {
    background: var(--color-background);
  }

  .social-links a {
    background: var(--color-background-light);
  }

  .activity-level-0 {
    background: var(--color-background-light);
  }

  .stats-bg-icons i {
    opacity: 0.05;
  }
}

/* 响应式布局 */
@media (max-width: 992px) {
  .intro-columns {
    flex-direction: column;
    gap: 1rem;
  }

  .intro-left,
  .intro-center,
  .intro-right {
    width: 100%;
  }

  .intro-center {
    order: -1;
  }

  .activity-grid {
    height: 15px;
    gap: 2px;
  }

  .total-number {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .intro-section {
    padding: 1rem;
  }

  .intro-left,
  .intro-center,
  .intro-right {
    padding: 1rem;
  }

  .activity-grid {
    height: 12px;
    gap: 1px;
  }

  .total-number {
    font-size: 1.3rem;
  }

  .total-label {
    font-size: 0.7rem;
  }

  .stats-bg-icons i {
    font-size: 5rem;
  }

  .saying-text {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }
}

/* 移动端重写（≤768px）：三栏纵向堆叠 + 字号/间距压缩 + 文本断行 */
@media (max-width: 768px) {
  /* 布局与容器 */
  .intro-section { padding: 12px; }
  .intro-columns { flex-direction: column; align-items: stretch; gap: 12px; }
  .intro-left, .intro-center, .intro-right {
    flex: 0 1 auto; width: 100%; padding: 12px; border-radius: 8px; min-width: 0;
  }

  /* 左侧个人信息 */
  .intro-basic { align-items: center; gap: 10px; }
  .intro-avatar { width: 44px; height: 44px; }
  .intro-name { font-size: 1rem; line-height: 1.3; }
  .intro-slogan {
    font-size: .85rem; line-height: 1.5;
    word-break: break-word; overflow-wrap: anywhere; hyphens: auto;
  }

  /* 社交链接（更紧凑，可换行） */
  .social-links { gap: 8px; margin-top: 6px; }
  .social-links a { width: 30px; height: 30px; }

  /* 统计区（收紧） */
  .stats-wrapper { padding: 10px; }
  .total-stats { gap: 8px; justify-content: space-between; margin-top: .5rem; }
  .total-stat-item { gap: .2rem; }
  .total-number { font-size: 1.4rem; }
  .total-label  { font-size: .7rem; letter-spacing: .02em; }

  /* 装饰图标（尺寸与透明度降低） */
  .stats-bg-icons { top: .5rem; left: .5rem; }
  .stats-bg-icons i { font-size: 1.2rem; opacity: .12; }

  /* 热力图（高度与列数降低，避免拥挤） */
  .stats-heatmap { padding: .6rem .8rem; margin-top: .5rem; }
  .activity-grid {
    grid-template-columns: repeat(24, minmax(0, 1fr));
    height: 12px; gap: 2px;
  }

  /* 说说（内边距与字号收紧） */
  .saying-content { padding: 16px 14px; }
  .saying-text { font-size: .9rem; line-height: 1.6; -webkit-line-clamp: 3; }
  .saying-date { font-size: .78rem; }
}

/* 极窄屏（≤420px）：进一步压缩尺寸，防止被顶开 */
@media (max-width: 420px) {
  .intro-avatar { width: 40px; height: 40px; }
  .social-links a { width: 28px; height: 28px; }
  .total-number { font-size: 1.25rem; }
  .total-label  { font-size: .66rem; }
  .activity-grid {
    grid-template-columns: repeat(20, minmax(0, 1fr));
    height: 10px; gap: 1px;
  }
  .saying-text { font-size: .85rem; -webkit-line-clamp: 2; }
}

/*--------------------------------------------------------------
>>> 4. 首页文章列表布局
--------------------------------------------------------------*/
/* 文章列表容器 */
.posts-wrapper {
  padding: var(--spacing-unit) 0;
}

/* 文章卡片基础样式 */
.post-card {
  background: var(--color-background);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 缩略图容器（16:9 等比） */
.post-thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  overflow: hidden;
}

/* 缩略图 */
.post-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-background-light);
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

/* 卡片悬停效果 */
.post-card:hover .post-thumbnail img {
  transform: scale(1.05);
}

/* 分类标签 */
.post-category {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
}

.post-category a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  color: #fff;
  background: var(--color-primary);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* 文章标题遮罩层样式 */
.post-thumbnail-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.3) 50%,
    rgba(0,0,0,0.7) 100%
  );
  padding: 1.2rem 1.2rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

/* 深色模式适配 */
[data-theme="dark"] .post-thumbnail-overlay {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.3) 30%,
    rgba(0,0,0,0.8) 100%
  );
}

/* 卡片悬停时加强遮罩 */
.post-card:hover .post-thumbnail-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.4) 50%,
    rgba(0,0,0,0.8) 100%
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* 标题样式（遮罩内两行） */
.post-thumbnail-overlay .post-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.post-thumbnail-overlay .post-title a {
  color: #fff;
  text-decoration: none;
  text-shadow: 0 2px 4px rgba(0,0,0,.3);
}

/* （可复用）文章标题 */
.post-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}
.post-title a {
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* 正文容器内边距（摘要的间距放到容器，不放到摘要自身） */
.post-card .post-content {
  padding: 1rem 1rem 0.6rem;
}

/* 文章摘要：严格两行，不露半行、不下沉 */
.post-excerpt {
  color: var(--color-text-light);
  font-size: 0.9rem;
  line-height: 1.6;   /* 固定行高 */
  margin: 0;
  padding: 0;         /* 间距由 .post-content 控制 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 3.2em;      /* 2 × 行高(1.6) */
}

/* 底部信息区域 */
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

/* 元信息 */
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-text-light);
  font-size: 0.85rem;
}
.post-meta > span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color .2s ease;
}
.post-meta > span:hover { color: var(--color-primary); }
.post-meta i {
  color: var(--color-text-light);
  transition: color .2s ease;
}
.post-meta > span:hover i { color: var(--color-primary); }

/* 标签 */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.post-tags a {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  color: var(--color-text-light);
  background: var(--color-background-light);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.post-tags a:hover {
  color: #fff;
  background: var(--color-primary);
  transform: translateY(-1px);
}

/* 深色模式适配 */
[data-theme="dark"] .post-card { background: var(--color-background); }
[data-theme="dark"] .post-tags a { background: var(--color-background-light); }

/* 响应式适配 */
@media (max-width: 768px) {
  .post-thumbnail-wrapper { height: 200px; } /* 移动端略低 */
  .post-card .post-content { padding: 1rem .9rem .6rem; }
  .post-excerpt {
    font-size: 0.88rem;
    line-height: 1.6;
    height: 3.2em;
    -webkit-line-clamp: 2;
  }
  .post-meta {
    font-size: 0.8rem;
    gap: 0.8rem;
  }
  .post-tags { gap: 0.4rem; }
}
/*--------------------------------------------------------------
>>> 5. 搜索结果页面样式
--------------------------------------------------------------*/
/* 搜索结果页面样式优化 */
.searchres-header {
  background: var(--color-background);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.searchres-info {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center; /* 内容居中 */
}

.searchres-title {
  display: flex;
  align-items: center;
  justify-content: center; /* 标题居中 */
  gap: 0.8rem;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.searchres-title i {
  color: var(--color-primary);
  font-size: 1.2rem;
}

.searchres-label {
  color: var(--color-text-light);
  font-weight: normal;
  font-size: 1.2rem;
}

.searchres-query {
  color: var(--color-primary);
  font-weight: 600;
}

.searchres-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.searchres-count strong {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.searchres-time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.searchres-time i {
  color: var(--color-primary);
}

/* 搜索结果页搜索框样式 */
.searchres-form {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.searchres-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.searchres-icon {
  position: absolute;
  left: 1rem;
  color: var(--color-text-light);
  pointer-events: none;
}

.searchres-field {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  transition: all 0.3s ease;
}

.searchres-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

/* 深色模式适配 */
[data-theme="dark"] .searchres-header {
  background: var(--color-background-light);
}

[data-theme="dark"] .searchres-field {
  background: var(--color-background);
  border-color: rgba(255, 255, 255, 0.1);
}

/* 响应式优化 */
@media (max-width: 768px) {
  .searchres-header {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .searchres-title {
    font-size: 1.2rem;
    flex-wrap: wrap;
  }

  .searchres-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .searchres-form {
    max-width: 100%;
  }

  .searchres-input-wrap {
    flex-direction: column;
  }

  .searchres-field {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}
/* 搜索结果列表 */
.search-results {
  display: grid;
  gap: 1.5rem;
}

.search-result-item {
  background: var(--color-background);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.search-result-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.entry-meta i {
  color: var(--color-primary);
}

/* 搜索结果摘要 */
.search-result-item .entry-summary {
  color: var(--color-text);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* 搜索关键词高亮 */
mark {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* 无搜索结果提示 */
.no-results {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-background);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.no-results h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.no-results p {
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

/* 深色模式适配 */
[data-theme="dark"] .search-header,
[data-theme="dark"] .search-result-item,
[data-theme="dark"] .no-results {
  background: var(--color-background-light);
}

[data-theme="dark"] .search-result-item:hover {
  background: #242424;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .search-header {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }

  .search-title {
    font-size: 1.25rem;
  }

  .search-result-item {
    padding: 1.25rem;
  }

  .search-result-item .entry-title {
    font-size: 1.1rem;
  }

  .entry-meta {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
}

/*--------------------------------------------------------------
>>> 6. 年度月度归档页面样式
--------------------------------------------------------------*/

.archive-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.archive-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--color-text);
}

.archive-title i {
  color: var(--color-primary);
}

.archive-count {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* 深色模式适配 */
[data-theme="dark"] .archive-header {
  border-color: var(--color-border);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .archive-header {
    margin-bottom: 2rem;
  }

  .archive-title {
    font-size: 1.5rem;
  }

  .archive-count {
    font-size: 0.9rem;
  }
}

/*--------------------------------------------------------------
>>> 7. 404页面样式
--------------------------------------------------------------*/
.error-404 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 300px);
  text-align: center;
  padding: 2rem 0;
}

.error-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
}

.error-icon {
  font-size: 5rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.error-title {
  font-size: 6rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin: 0 0 1rem;
  font-family: var(--font-heading);
}

.error-subtitle {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.error-text {
  color: var(--color-text-light);
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* 404页面搜索框样式 */
.error-search {
  margin: 2rem 0;
}

.error-search .search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

.error-search .search-field {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.95rem;
}

.error-search .search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
}

.error-search .search-submit i {
  font-size: 1rem;
}

/* 深色模式适配 */
[data-theme="dark"] .error-search .search-field {
  background: var(--color-background-light);
  border-color: rgba(255, 255, 255, 0.1);
}

.error-help {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.error-help a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 24px;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.error-help .home-link {
  background: var (--color-primary);
  color: #fff;
}

.error-help .back-link {
  background: var(--color-background-light);
  color: var(--color-text);
}

.error-help a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* 深色模式适配 */
[data-theme="dark"] .error-search .search-field {
  background: var(--color-background-light);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .error-icon {
    font-size: 4rem;
  }

  .error-title {
    font-size: 4rem;
  }

  .error-subtitle {
    font-size: 1.25rem;
  }

  .error-text {
    font-size: 1rem;
  }

  .error-help {
    flex-direction: column;
  }

  .error-help a {
    width: 100%;
    justify-content: center;
  }
}
/*--------------------------------------------------------------
>>> 8. 图片基础样式
--------------------------------------------------------------*/
/* 缩略图基础样式 */
.post-thumbnail {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--color-background-light);
}

/* 仅基础 wp-post-image 保持等比，不影响卡片裁切规则 */
.wp-post-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* 文章内容图片 */
.entry-content img,
.comment-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 缩略图基础样式（避免覆盖列表裁切规则） */
.wp-post-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* 深色模式适配 */
[data-theme="dark"] .post-thumbnail,
[data-theme="dark"] .entry-content img,
[data-theme="dark"] .comment-content img {
  background: var(--color-background);
}

/* 响应式优化 */
@media (max-width: 768px) {
  .post-thumbnail {
    margin-bottom: 1rem;
  }

  .entry-content img,
  .comment-content img {
    margin: 0.8rem 0;
  }
}

/*--------------------------------------------------------------
>>> 9. Cookie 同意弹窗
--------------------------------------------------------------*/
.cookie-consent {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--color-card-background);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 2px 2px 20px rgba(0,0,0,0.08), 0 6px 24px rgba(0,0,0,0.06);
  display: block;
  opacity: 0;
  transform: translate(-16px, 16px);
  transition: opacity .35s ease, transform .35s ease;
  z-index: 1000;
}

.cookie-consent.show {
  opacity: 1;
  transform: translate(0, 0);
}

.cookie-consent .cookie-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .25rem;
}
.cookie-consent .cookie-icon svg path { fill: var(--color-text-light); }

.cookie-consent .cookie-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  color: var(--color-heading);
}
.cookie-consent .cookie-text {
  font-size: .85rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 0 0 .75rem;
}

.cookie-consent .cookie-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.cookie-consent .cookie-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.cookie-consent .cookie-accept {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), .16);
}
.cookie-consent .cookie-accept:hover {
  background: var(--color-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.2);
}

.cookie-consent .cookie-decline {
  background: var(--color-background-light);
  color: var(--color-text);
  border-color: var(--color-border);
}
.cookie-consent .cookie-decline:hover {
  transform: translateY(-1px);
  background: rgba(var(--color-primary-rgb), .06);
}

/* 深色模式 */
[data-theme="dark"] .cookie-consent {
  background: var(--color-background);
  border-color: var(--color-border);
  box-shadow: 2px 2px 20px rgba(0,0,0,0.25);
}

/* 全局 Toast/Notice */
.toast-host {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 220px; max-width: 420px;
  background: var(--color-card-background);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  padding: 10px 12px; border-radius: 8px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast i { line-height: 1.2; margin-top: 2px; }
.toast .toast-body { flex: 1; font-size: 0.95rem; }
.toast .toast-close {
  border: 0; background: transparent; color: var(--color-text-light);
  cursor: pointer; padding: 0; line-height: 1;
}
.toast .toast-close:hover { color: var(--color-text); }

/* 类型强调（左侧细条 + 图标跟随） */
.toast { border-left-width: 3px; border-left-style: solid; }
.toast--info    { border-left-color: var(--color-accent); }
.toast--success { border-left-color: var(--color-success); }
.toast--warning { border-left-color: var(--color-warning); }
.toast--error   { border-left-color: var(--color-error); }

/* 暗色模式继承变量即可 */
[data-theme="dark"] .toast { background: var(--color-card-background); border-color: var(--color-border); }

