/* ==========================================
   资源导入
   ========================================== */

/* 声明本地字体 */
@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito-VariableFont_wght.woff2") format("woff2-variations");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap; /* 避免阻塞 */
}
/* ==========================================
   CSS 自定义属性（变量）
   ========================================== */
:root {
  /* 颜色系统 */
  --color-text-primary: #2d3748; /* 主文字：深灰 */
  --color-text-secondary: #4a5568; /* 次要文字：中灰 */
  --color-text-tertiary: #718096; /* 辅助文字：浅灰 */
  --color-text-inverse: #ffffff; /* 反色文字：白色 */
  --color-accent: #0077be; /* 强调色 #2575fc 天青蓝：#87ceeb 海浪蓝：#0077be 宝石蓝：#0f52ba 克莱因蓝：#002fa7 普鲁士蓝：#003153 */
  --color-accent-hover: #0f52ba; /* 强调色悬停 #1c6ae4 */
  --color-highlight: #ffcc22; /* 高亮色：黄 */
  --color-highlightql: #20d5ec; /* 高亮色：浅蓝 */

  /* 背景色 */
  --color-bg-page: #f4f4f4;
  --color-bg-card: #ffffff;
  --color-bg-light: #f6f6f6; /* #f8f9fa; */
  --color-bg-lighter: #f3f3f3; /* #f3f4f5; */
  --color-bg-hover: #e9e9e9; /* #e9ecef; */

  /* 边框和阴影 */
  --color-border: #eee;
  --color-border-light: #ddd;
  --shadow-card:
    0 0 0 11px #f5f5f5, 0 0 0 13px #fff, 0 3px 15px 4px rgba(0, 0, 0, 0.5);

  /* 间距系统 */
  --spacing-xs: 0.3125rem; /* 5px */
  --spacing-sm: 0.625rem; /* 10px */
  --spacing-md: 1rem; /* 16px */
  --spacing-lg: 1.25rem; /* 20px */
  --spacing-xl: 1.875rem; /* 30px */
  --spacing-2xl: 2.5rem; /* 40px */
  --spacing-3xl: 3.125rem; /* 50px */

  /* 圆角 */
  --radius-xs: 0.3125rem; /* 5px */
  --radius-sm: 0.625rem; /* 10px */
  --radius-md: 1rem; /* 16px */
  --radius-lg: 1.25rem; /* 20px */

  /* 卡片纵向间距：视觉净距(24px) + 阴影外扩(13px × 2)；仅用于纵向 flex 容器 */
  --card-gap: 3.125rem; /* 50px */

  /* 容器 */
  --container-max-width: 1280px;
  --header-height: 135px;

  /* 字体 */
  --font-primary: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: "Nunito", sans-serif;
  --font-mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;

  /* Noto Sans SC 降到最后兜底，优先用系统字体 */
  --font-mono-cjk:
    -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  /* 过渡 */
  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s ease;

  /* 导航栏滚动缩放配置 */
  --header-anim-switch: 1;
  --header-height-expanded: 135px;
  --header-height-shrunk: 80px;
  --transition-duration: 0.2s;
  --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);

  /* 代码块 UI 变量 */
  --itxgo-code-bg-light: var(--color-bg-light);
  --itxgo-code-text-light: #24292f;
  --itxgo-border-light: #e9ecef;
  --itxgo-btn-text-light: #57606a;
  --itxgo-code-label-light: #6e7781;
  --itxgo-scrollbar-thumb-light: #afb8c1;

  /* 语法高亮颜色变量 - 浅色 */
  --token-comment: #6b7280;
  --token-punctuation: #374151;
  --token-property: #0284c7;
  --token-selector: #059669;
  --token-operator: #dc2626;
  --token-keyword: #7c3aed;
  --token-function: #2563eb;
  --token-variable: #ea580c;

  /* 默认应用浅色变量 */
  --itxgo-code-bg: var(--itxgo-code-bg-light);
  --itxgo-code-text: var(--itxgo-code-text-light);
  --itxgo-border: var(--itxgo-border-light);
  --itxgo-btn-text: var(--itxgo-btn-text-light);
  --itxgo-code-label: var(--itxgo-code-label-light);
  --itxgo-scrollbar-thumb: var(--itxgo-scrollbar-thumb-light);
}

/* ==========================================
   全局基础样式
   ========================================== */

body {
  font-family: var(--font-primary);
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-page);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-y: scroll;
}

/* 基础重置和选择器 */
* {
  box-sizing: border-box;
}

/* 链接 */
a {
  color: var(--color-accent);
  text-decoration: none;
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

/* 带 svg 图标的链接 inline-flex 稳定布局 */
a:has(svg) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.text-accent {
  color: var(--color-accent);
}

/* ==========================================
   用户主页链接
   ========================================== */
.author-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
  will-change: transform;
}
.author-link:hover {
  color: var(--color-accent);
}

/* ==========================================
   用户徽章微调 - index.php
   ========================================== */
.blogger-username > strong > svg {
  vertical-align: -0.15em;
}

/* ==========================================
   页面容器顶部微滑淡入动效
   ========================================== */
@keyframes blogEntry {
  from {
    opacity: 0.01;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   页面加载控制
   ========================================== */
/* 默认隐藏所有主要容器 */
.header-container,
.sidebar-container,
.article-container,
.footer-container {
  opacity: 0.01;
}

/* 页面加载完成后播放动画 */
body.page-loaded .header-container,
body.page-loaded .sidebar-container,
body.page-loaded .article-container,
body.page-loaded .footer-container {
  animation: blogEntry 0.52s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* 错落延迟（按 DOM 顺序自然递增） */
body.page-loaded .header-container {
  animation-delay: 0.05s;
}
body.page-loaded .sidebar-container {
  animation-delay: 0.1s;
}
body.page-loaded .article-container {
  animation-delay: 0.15s;
}
body.page-loaded .article-container + .article-container {
  animation-delay: 0.2s;
}
body.page-loaded .article-container + .article-container + .article-container {
  animation-delay: 0.25s;
}
body.page-loaded .footer-container {
  animation-delay: 0.3s;
}
/* ==========================================
   WebGL 动态背景画布
   ========================================== */
#gl-canvas {
  opacity: 0.01;
  transition: opacity 1200ms ease-in-out;
}

#gl-canvas.is-ready {
  opacity: 0.4;
}

/* ==========================================
   1. 通用卡片容器
   ========================================== */
.header-container,
.footer-container,
.sidebar-container,
.article-container {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);

  /* 核心修正：由 0 改为 1px，完美对齐因移除 border 产生的 1px 布局偏差 */
  padding: 1px;
  border: none; /* 移除原边框，完全改由伪元素在底层承载 */

  overflow-wrap: break-word;
  position: relative;
  box-shadow: none;
  transform: translateZ(0);
}

/* ==========================================
   2. 卡片容器六边形纹理背景
   ========================================== */
.header-container::before,
.footer-container::before,
.sidebar-container::before,
.article-container::before,
.user-dropdown::before,
.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-lg);
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http:%2F%2Fwww.w3.org%2F2000%2Fsvg' width='60' height='34.64'%3E%3Cg stroke='%23000' stroke-width='1.1' stroke-opacity='0.1'%3E%3Cline x1='30.0' y1='34.64' x2='10.0' y2='34.64'%2F%3E%3Cline x1='10.0' y1='34.64' x2='0.0' y2='17.32'%2F%3E%3Cline x1='0.0' y1='17.32' x2='10.0' y2='0.0'%2F%3E%3Cline x1='10.0' y1='0.0' x2='30.0' y2='0.0'%2F%3E%3Cline x1='70.0' y1='0.0' x2='60.0' y2='17.32'%2F%3E%3Cline x1='60.0' y1='17.32' x2='40.0' y2='17.32'%2F%3E%3Cline x1='40.0' y1='17.32' x2='30.0' y2='0.0'%2F%3E%3Cline x1='30.0' y1='34.64' x2='40.0' y2='17.32'%2F%3E%3Cline x1='60.0' y1='17.32' x2='70.0' y2='34.64'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  background-size: 60px 34.64px;
  background-repeat: repeat;
}

/* ==========================================
   3. 伪元素独揽边框与三重重度阴影
   ========================================== */
.header-container::after,
.footer-container::after,
.sidebar-container::after,
.article-container::after {
  content: "";
  position: absolute;
  inset: 0; /* 完美对齐父元素外边缘 */
  z-index: -1;
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-sizing: border-box;

  /* 边框移至此处，与阴影同元素渲染，彻底干掉亚像素缩放缝隙 */
  border: 1px solid var(--color-border);

  /* 三层重度阴影，独立图层隔离重绘开销 */
  box-shadow:
    0 0 0 11px #f5f5f5,
    0 0 0 13px #fff,
    0 3px 15px 4px rgba(0, 0, 0, 0.5);

  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

/* ==========================================
   4. 卡片容器通用防溢出样式
   ========================================== */
.article-content,
.comment-content,
.sidebar-comments .comment-item,
.article-excerpt,
.article-list {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==========================================
   通用消息提醒样式
   ========================================== */
@keyframes notifFade {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  20% {
    transform: translateY(0);
    opacity: 1;
  }
  80% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}

.notification {
  position: fixed;
  top: 0;
  left: 40%;
  right: 40%;
  background: rgba(
    79,
    209,
    217,
    0.8
  ); /* 蓝：(0, 119, 190, 0.8)；青：(79, 209, 217, 0.8) */
  color: white;
  padding: 15px 20px;
  border-radius: 0 0 16px 16px;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  z-index: 9999;
  animation: notifFade 3s ease forwards;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   头部区域
   ========================================== */
.header-container {
  max-width: var(--container-max-width);
  margin: var(--spacing-2xl) auto var(--spacing-xl);
  width: calc(100% - 2 * var(--spacing-lg)); /* 与中部 .main-content 宽度对齐 */
  z-index: 1000;
}

header {
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  padding: 1em 1.6em;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.header-top,
.header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

/* 副标题区域 */
.header-bottom,
.placeholder-bottom,
#subtitle {
  min-height: 16px;
  align-items: center;
}

.placeholder-bottom {
  display: flex;
  justify-content: flex-start;
}

#subtitle {
  display: flex;
  margin: 0;
  padding: 0;
  transition:
    opacity var(--transition-normal),
    transform var(--transition-normal),
    max-width var(--transition-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.header-top h1 {
  margin: 0;
  font-size: 1.8em;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-text-primary);
}

.placeholder-top,
.placeholder-bottom {
  font-size: 1rem;
  color: var(--color-text-tertiary);
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.svg-icon-link {
  display: inline-flex;
}

.svg-icon-link svg {
  fill: var(--color-bg-lighter);
  transition: var(--transition-normal);
}

.svg-icon-link:hover svg {
  fill: var(--color-highlight);
}

/* 导航菜单 */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--spacing-sm);
  transform: translateY(-10px);
}

nav li {
  margin: 0;
  padding: 0;
}

/* 导航按钮（卡片式） */
nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 8px 13px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background-color: var(--color-bg-lighter);
  transition:
    color var(--transition-normal),
    background-color var(--transition-normal),
    border-color var(--transition-normal);
}

nav a:hover,
nav a.active {
  color: var(--color-text-primary);
  border-color: var(--color-highlight);
  background-color: var(--color-bg-card);
}

nav a.active {
  font-weight: 600;
}

nav a iconify-icon {
  font-size: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   导航栏滚动收缩样式 - 统一动画视觉开关版
   ========================================== */
.header-container {
  position: sticky;
  top: 13px; /* 标记 3 原12px */
  height: var(--header-height-expanded);
  min-height: unset;
  transition: height
    calc(var(--transition-duration) * var(--header-anim-switch))
    var(--transition-easing);
}

.header-container.shrunk {
  height: var(--header-height-shrunk);
}

/* 收缩态遮罩 */
.header-container.shrunk::before {
  content: "";
  position: absolute;
  inset: -15px 0;
  pointer-events: auto;
  z-index: -1;
}

/* ===== 行结构 ===== */
.header-bottom {
  transform: translateY(0);
  /* 时长乘以 1.2 比外层容器 height 动画慢 20%；按钮元素增加 0.02s 延迟，外层容器高度先开始变化 */
  transition: transform
    calc(var(--transition-duration) * 1.2 * var(--header-anim-switch))
    var(--transition-easing) 0.02s; /* 延迟 */
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
  pointer-events: auto;
}

.header-container.shrunk .header-bottom {
  transform: translateY(-54px); /* 标记 3 原55px */
  pointer-events: none;
}

/* ===== 占位元素 ===== */
.placeholder-top,
.placeholder-bottom {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity calc(var(--transition-duration) * 0.75 * var(--header-anim-switch))
      var(--transition-easing),
    transform calc(var(--transition-duration) * var(--header-anim-switch))
      var(--transition-easing);
  will-change: transform, opacity;
}

.header-container.shrunk .placeholder-top {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.header-container.shrunk .placeholder-bottom {
  opacity: 0;
  transform: translateY(-20px);
}

/* 导航按钮不动画 */
.header-bottom nav {
  transition: none;
}

/* ===== 交互修正 ===== */
.header-container.shrunk {
  pointer-events: none;
}

.header-container.shrunk nav,
.header-container.shrunk .user-menu-container,
.header-container.shrunk .user-menu-trigger {
  pointer-events: auto;
}

/* ==========================================
   主内容区域布局
   ========================================== */
.main-content {
  display: flex;
  gap: var(--spacing-3xl);
  width: calc(100% - 2 * var(--spacing-lg));
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--spacing-lg) 0;
  align-items: flex-start;
  min-height: 600px; /* 防止加载时容器坍塌 */
}

/* ==========================================
   左侧边栏
   ========================================== */
.sidebar-section-container {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  flex: 0 0 278px; /* 原始卡片宽度：308px - margin-right 30px */
  position: sticky;
  top: 143px; /* 标记2 向下拖动时左侧边栏顶部距离 */
  align-self: flex-start;
  height: fit-content;
}

.sidebar {
  padding: var(--spacing-md);
  margin-top: -8px; /* 补偿 h2 行高在文字上方产生的视觉空白 */
}

/* ==========================================
   文章段落索引样式
   ========================================== */

/* 段落外层容器 */
.toc-wrapper {
  width: 100%;
  max-width: 244px; /* 最大宽度限制 */
  max-height: 533px; /* 最大高度限制 */
  overflow-y: auto; /* 垂直方向溢出时显示滚动条 */
  margin: 0 auto;
  padding: var(--spacing-sm) 0 0; /* 使用CSS变量定义的上内边距 */
  -ms-overflow-style: none; /* IE/Edge隐藏滚动条 */
  scrollbar-width: none; /* Firefox隐藏滚动条 */
  position: relative; /* 相对定位，用于后续加提示图标 */
}

/* 隐藏Webkit浏览器（Chrome/Safari）的滚动条 */
.toc-wrapper::-webkit-scrollbar {
  display: none;
}

/* 段落项容器 */
.toc-item {
  margin-bottom: var(--spacing-xs);
  background-color: var(--color-bg-light);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-normal);
  overflow: hidden; /* 防止内容溢出 */
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

.toc-item:last-child {
  margin-bottom: 0;
}

.toc-item:hover {
  background-color: var(--color-bg-hover);
}

/* 段落链接 */
.toc-link {
  display: block;
  text-decoration: none;
  color: var(--color-text-secondary);
  padding: 10px var(--spacing-xs);
  font-size: 0.9em;
  font-weight: 500;
  transition: color var(--transition-normal);
}

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

.toc-link.active {
  background-color: var(--color-bg-hover);
  color: var(--color-accent);
  font-weight: 600;
}

/* 段落文本 */
.toc-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* h2 h3 标题 */
.toc-h2 .toc-link,
.toc-h3 .toc-link {
  position: relative;
  padding-left: 28px;
}

.toc-h2 .toc-link::before {
  content: "☰";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
}

/* 主标题（第一个 h2）使用 ❖ 图标 */
.toc-title.toc-h2 .toc-link::before {
  content: "❖";
}

.toc-h3 .toc-link::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
}

/* 右侧文章标题响应高亮动画 */
.article-content h2.heading-highlight,
.article-content h3.heading-highlight,
/* 评论内容响应高亮动画 */
.comment-content.comment-highlight {
  animation: subtleFocus 2s ease-out;
}

@keyframes subtleFocus {
  0% {
    opacity: 0.8;
    transform: translateX(0);
  }
  15% {
    transform: translateX(25px);
  }
  30% {
    transform: translateX(-5px);
  }
  45% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-2px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================
   侧边栏标题样式
   ========================================== */
.sidebar-section h2,
.sidebar-listicle h2 {
  position: relative;
  padding-bottom: 8px;
  margin: 0;
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ==========================================
   标题下划线公共样式
   ========================================== */
.sidebar-section h2::after,
.sidebar-listicle h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 120px;
  height: 5px;
}

/* 标题下划线 - 左侧边栏用绿色渐变 */
.sidebar-section h2::after {
  background: linear-gradient(to right, #dff187, transparent);
}

/* 标题下划线 - 右侧边栏用蓝色渐变 */
.sidebar-listicle h2::after {
  background: linear-gradient(to right, #96e3e8, transparent);
}

/* 列表通用样式 */
.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: var(--spacing-sm) 0 0;
}

.sidebar-section li {
  margin-bottom: var(--spacing-xs);
  padding: 10px var(--spacing-xs);
  background-color: var(--color-bg-light);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-normal);
  font-size: 0.95em;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* 取消最后一个列表项的下边距 */
.sidebar-section li:last-child {
  margin-bottom: 0;
}

.sidebar-section li:hover {
  background-color: var(--color-bg-hover);
}

.sidebar-section li a {
  text-decoration: none;
  color: inherit; /* 继承父级颜色 */
  display: block;
  font-size: 0.95em;
}

.sidebar-section li a:hover {
  color: var(--color-accent);
}

/* 最新评论小字样式 */
.sidebar-section li small {
  font-size: 0.85em;
  color: var(--color-text-tertiary);
  display: block;
}

.sidebar-section li small a {
  font-size: 0.85em;
  color: inherit; /* 使用继承来简化颜色管理 */
  display: inline;
}

.sidebar-section li small a:hover {
  color: var(--color-accent);
}

/* ==========================================
   博主/用户信息卡片样式
   ========================================== */
/* 头像 */
.blogger-avatar-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
  contain: layout;
}

.blogger-avatar {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  /* 如果不需要圆形头像，下面两行加注释 */
  border-radius: 50%;
  object-fit: cover;
}

/* 用户名 */
.blogger-username {
  margin: 7px 0 14px 0;
  text-align: center;
  line-height: 1.2;
}

/* 简介 */
.blogger-bio {
  margin: 0 0 12px 0;
  text-align: center;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* 统计信息 */
.blogger-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  width: 100%;
}

/* 单个统计项 */
.blogger-stat-item {
  position: relative;
  cursor: pointer;
  text-align: center;
  background-color: var(--color-bg-light);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-xs);
  transition: background-color var(--transition-normal);
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

.blogger-stat-item:hover {
  background-color: var(--color-bg-hover);
}

.blogger-stat-label a::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* 统计数值 */
.blogger-stat-value {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

/* 统计标签及链接 */
.blogger-stat-label {
  font-size: 0.9em;
  color: var(--color-text-secondary);
  margin-top: 0;
}

.blogger-stat-label a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}

.blogger-stat-label a:hover {
  color: var(--color-accent);
}

/* 无权限时的禁用状态 */
.blogger-stat-item .blogger-stat-disabled,
.blogger-stat-value.blogger-stat-disabled {
  color: var(--color-text-tertiary);
  cursor: not-allowed;
}

/* ==========================================
   标签云
   ========================================== */
.tags-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) 0 0;
  margin: 0;
  justify-content: center;
}

.tag-item {
  text-align: center;
  padding: 10px var(--spacing-xs);
  background-color: var(--color-bg-light);
  color: var(--color-text-secondary);
  border-radius: var(--spacing-sm);
  font-size: 0.9em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    color var(--transition-normal),
    background-color var(--transition-normal);
  font-weight: 500;
  display: block;
}

.tag-item:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
  text-decoration: none;
}

/* ==========================================
   右侧文章列表区域
   ========================================== */
.article-container {
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* article.php 右侧列包裹：文章内容 + 评论纵向排列 */
.article-main-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: var(--card-gap);
}

.sidebar-listicle {
  margin-bottom: var(--spacing-sm);
  padding: 0 var(--spacing-md);
  margin-top: -8px; /* 补偿 h2 行高在文字上方产生的视觉空白 */
}

.sidebar-listicle h2 {
  margin-top: var(--spacing-md);
}

/* 文章项 */
.article-item {
  background-color: var(--color-bg-light);
  margin: 0 var(--spacing-md) var(--spacing-sm) var(--spacing-md);
  padding: var(--spacing-sm);
  border-radius: var(--radius-lg);
  transition: background-color var(--transition-normal);
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

.article-item:hover {
  background-color: var(--color-bg-hover);
}

.article-item h3 {
  margin-top: 0;
  color: var(--color-text-primary);

  /* 单行截断 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.article-item h3 svg {
  display: inline-block;
  vertical-align: -0.23em;
  margin-right: 6px;
}

.article-item h3 a {
  display: inline;
  text-decoration: none;
  color: var(--color-text-primary);
  vertical-align: baseline;
}

.article-item h3 a:hover {
  color: var(--color-accent);
}

.article-meta {
  font-size: 0.9em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-sm);
  text-decoration: none;
}

.article-meta svg {
  transform: translateY(2.5px);
}

.article-meta .edit-link a {
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color var(--transition-normal);
  display: inline; /* 排除在 a:has(svg) 之外 */
  vertical-align: baseline;
}

.article-meta .edit-link a:hover {
  color: var(--color-accent);
}

.article-excerpt {
  margin: var(--spacing-sm) 0 0;
  color: var(--color-text-secondary);

  /* 单行截断 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--color-text-tertiary);
}

.article-footer a {
  color: var(--color-text-tertiary);
  text-decoration: none;
}

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

/* ==========================================
   左侧栏 CSS 文本截断样式
   ========================================== */

/* 用户简介 - 单行截断 */
.user-bio-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

/* 热门文章链接容器 .sidebar-section li > a.popular-article-link {*/
.sidebar-section li > .popular-article-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: var(--spacing-xs);
}

/* 热门文章标题 - 单行截断 */
.popular-article-title {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

/* 热门文章计数 - 固定宽度 */
.popular-article-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.1em;
  white-space: nowrap;
}

/* 最新评论内容 - 单行截断 */
.sidebar-section li a.latest-comment-content {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 4px;
  vertical-align: top;
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}
.latest-comment-content-inner {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

/* 最新评论作者 - 单行截断 */
.latest-comment-author {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

/* 最新评论文章标题 - 单行截断 */
.sidebar-section li a.latest-comment-article {
  display: inline-block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 分页 */
.pagination {
  text-align: center;
  margin: var(--spacing-md) 0;
}

.pagination a {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 4px;
  text-decoration: none;
  border: 2px solid var(--color-bg-lighter);
  background-color: var(--color-bg-lighter);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition:
    color var(--transition-normal),
    background-color var(--transition-normal),
    border-color var(--transition-normal);
  min-width: 45.5px;
}

.pagination a.active,
.pagination a:hover:not(.active) {
  background-color: var(--color-bg-card);
  border-color: var(--color-highlight);
  color: var(--color-text-primary);
}

/* ==========================================
   底部
   ========================================== */
.footer-container {
  max-width: var(--container-max-width);
  margin: var(--spacing-xl) auto var(--spacing-2xl);
  height: 118px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: calc(100% - 2 * var(--spacing-lg)); /* 与中部 .main-content 宽度对齐 */
}

.footer-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: var(--spacing-md) 0;
  gap: var(--spacing-sm);
  padding: 0 var(--spacing-xl);
}

.footer-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9em;
  transition: color var(--transition-normal);
  font-weight: 500;
  white-space: nowrap;
}

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

.footer-copyright {
  text-align: center;
  font-size: 0.9em;
  color: var(--color-text-tertiary);
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

.footer-copyright a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-normal);
  font-weight: 500;
  display: inline;
  vertical-align: baseline;
}

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

/* ==========================================
   通用表单样式
   ========================================== */
form {
  background-color: var(--color-bg-card);
  padding: var(--spacing-sm) 0 0;
  border-radius: var(--radius-md);
  margin: var(--spacing-xs) auto;
  max-width: 100%;
}

form label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: bold;
  color: var(--color-text-primary);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
  width: 100%;
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  color: var(--color-text-primary);
  font-family: inherit; /* 继承 body 的字体 */
  font-size: 1em; /* 确保字号一致 */
}

form textarea {
  height: 100px;
  resize: vertical;
}

form button {
  background-color: var(--color-accent);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: background-color var(--transition-normal);
}

form button:hover {
  background-color: var(--color-accent-hover);
}

/* 搜索表单 */
.search-form {
  padding: 0;
  margin: 0 0 8px 0; /* 搜索表单下边距偏移量 影响 博客标题 导航按钮 在容器中的间距 */
  display: flex;
  align-items: flex-start;
  width: 180px;
  box-sizing: border-box;
}

.search-form input[type="text"],
.search-form button[type="submit"] {
  height: 40px;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--color-bg-lighter);
  box-sizing: border-box;
  margin: 0;
  flex: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.search-form input[type="text"] {
  width: 130px;
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-size: 1em;
  outline: none;
}

.search-form button[type="submit"] {
  width: 50px;
  padding: 0;
  background-color: var(--color-bg-lighter);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  color: #ccc;
  font-size: 1.25rem;
}

::placeholder {
  color: var(--color-text-tertiary);
  font-size: 0.9em;
}

.search-form:hover input[type="text"],
.search-form:focus-within input[type="text"] {
  border-color: var(--color-highlight);
}

.search-form:hover button[type="submit"],
.search-form:focus-within button[type="submit"] {
  border-color: var(--color-highlight);
  background-color: var(--color-highlight);
  color: #333;
}

/* ==========================================
   文章详情页
   ========================================== */
.article-content {
  margin: 13px var(--spacing-lg) var(--spacing-xs);
  color: var(--color-text-primary);
}

/* ==========================================
   文章详情页 - 图片基础与骨架屏
   ========================================== */
.article-content img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: var(--spacing-sm) auto;
  border-radius: var(--radius-sm);
}

/* 骨架屏仅在图片未加载完成时激活，由 JS 控制 */
.article-content img.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: img-skeleton 1.4s ease infinite;
}

.article-content img:not([data-no-lightbox]) {
  cursor: zoom-in;
}

@keyframes img-skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 尊重用户减少动效的系统偏好 */
@media (prefers-reduced-motion: reduce) {
  .article-content img.loading {
    animation: none;
  }
  .lightbox-overlay,
  .lightbox-overlay img {
    transition: none;
  }
}

/* ==========================================
   文章详情页 - 图片全屏灯箱
   ========================================== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  cursor: zoom-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg, 24px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.lightbox-overlay.active {
  opacity: 1;
}
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
  transition: transform 0.22s ease;
  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

/* ==========================================
   文章作者信息卡片（头像 + 标题 + 元信息）
   ========================================== */
.article-author-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* 作者头像（左侧，占两行高度） */
.article-author-card .article-author-avatar {
  width: 55px;
  height: 55px;
  margin-top: 7px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0; /* 防止被压缩 */
}

/* 右侧信息容器 */
.article-header-info {
  flex: 1;
  min-width: 0; /* 防止内容溢出 */
}

/* 文章标题（右侧第一行） */
.article-header-info .article-title {
  margin: 5px 0 5px 0;
  line-height: 1.3;
}

/* 文章元信息（右侧第二行） */
.article-header-info .article-meta {
  font-size: 0.9em;
  line-height: 1.7;
}

/* ==========================================
   代码块 - 需置于 文章详情页 样式下
   ========================================== */

/* ===== 基础布局与容器 ===== */

/* 防止页面加载瞬间出现横向滚动条 */
.article-content pre {
  max-width: 100%;
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  visibility: hidden;
  opacity: 0;
  position: relative;
  z-index: 0;
}

.article-content pre > code {
  display: block;
  width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 初始化完成后的淡入动画 */
@keyframes itxgo-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.article-content pre.itxgo-initialized {
  visibility: visible;
  animation: itxgo-fade-in 0.4s ease-out forwards;
}

/* 代码块容器 */
.article-content pre.itxgo-code-block {
  position: relative;
  background: var(--itxgo-code-bg);
  color: var(--itxgo-code-text);
  font-family: Cascadia Code;
  font-size: 14px;
  line-height: 1.4286;
  padding: 40px 16px 12px;
  border-radius: var(--radius-md);
  margin: 1rem 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease-out,
    background-color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 使用变量边框，确保深色模式下正确 */
  border: 1px solid var(--itxgo-border);
}

.article-content pre.itxgo-code-block > code {
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  tab-size: 2;
}

/* ===== Prism.js 语法高亮 ===== */
.article-content pre.itxgo-code-block .token.comment,
.article-content pre.itxgo-code-block .token.prolog,
.article-content pre.itxgo-code-block .token.doctype,
.article-content pre.itxgo-code-block .token.cdata {
  color: var(--token-comment);
  font-style: italic;
}

.article-content pre.itxgo-code-block .token.punctuation {
  color: var(--token-punctuation);
}

.article-content pre.itxgo-code-block .token.property,
.article-content pre.itxgo-code-block .token.tag,
.article-content pre.itxgo-code-block .token.boolean,
.article-content pre.itxgo-code-block .token.number,
.article-content pre.itxgo-code-block .token.constant,
.article-content pre.itxgo-code-block .token.symbol,
.article-content pre.itxgo-code-block .token.deleted {
  color: var(--token-property);
}

.article-content pre.itxgo-code-block .token.selector,
.article-content pre.itxgo-code-block .token.attr-name,
.article-content pre.itxgo-code-block .token.string,
.article-content pre.itxgo-code-block .token.char,
.article-content pre.itxgo-code-block .token.builtin,
.article-content pre.itxgo-code-block .token.inserted {
  color: var(--token-selector);
}

.article-content pre.itxgo-code-block .token.operator,
.article-content pre.itxgo-code-block .token.entity,
.article-content pre.itxgo-code-block .token.url,
.article-content pre.itxgo-code-block .language-css .token.string,
.article-content pre.itxgo-code-block .style .token.string {
  color: var(--token-operator);
}

.article-content pre.itxgo-code-block .token.atrule,
.article-content pre.itxgo-code-block .token.attr-value,
.article-content pre.itxgo-code-block .token.keyword {
  color: var(--token-keyword);
}

.article-content pre.itxgo-code-block .token.function,
.article-content pre.itxgo-code-block .token.class-name {
  color: var(--token-function);
}

.article-content pre.itxgo-code-block .token.regex,
.article-content pre.itxgo-code-block .token.important,
.article-content pre.itxgo-code-block .token.variable {
  color: var(--token-variable);
}

/* ===== 交互组件 (Toolbar, 展开/折叠, 滚动条) ===== */

/* 展开/折叠状态 */
.article-content pre.itxgo-expanded {
  overflow: auto;
  max-height: none;
}

.article-content pre.itxgo-collapsed {
  overflow: hidden;
  cursor: pointer;
}

.article-content pre.itxgo-collapsed::after {
  content: "︾";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--itxgo-code-bg) 70%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  color: var(--itxgo-code-label);
  font-size: 18px;
  font-weight: normal;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  pointer-events: none;
  border-radius: 6px;
}

/* 工具栏 */
.article-content pre .itxgo-code-tools {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  padding: 0 16px;
  background: var(--itxgo-code-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px 6px 0 0;
  transition: background-color 0.3s ease;
  z-index: 10;
  cursor: default;
}

.article-content pre .itxgo-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.article-content pre .itxgo-code-label {
  font-family: Cascadia Code;
  font-size: 12px;
  font-weight: 600;
  color: var(--itxgo-code-label);
  letter-spacing: 0.5px;
  user-select: none;
  text-transform: uppercase;
  transition: color 0.3s ease;
  cursor: default;
}

.article-content pre .itxgo-code-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 按钮样式 */
.article-content pre .itxgo-code-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--itxgo-btn-text);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0 4px 4px;
  border-radius: 6px;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
  user-select: none;
  font-family: Cascadia Code;
  font-weight: 500;
  height: 28px;
}

.article-content pre .itxgo-code-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.article-content pre .itxgo-copy .copy-icon {
  flex-shrink: 0;
  stroke-width: 2;
}
.article-content pre .itxgo-copy .copy-text {
  font-size: 12px;
}

.article-content pre .itxgo-toggle {
  width: 28px;
  min-width: 28px;
  padding: 0;
  justify-content: center;
  font-size: 12px;
}

/* 右下角折叠按钮 */
.article-content pre .itxgo-collapse-corner-btn {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 20;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--itxgo-code-label);
  cursor: pointer;
}

.article-content pre.itxgo-expanded .itxgo-collapse-corner-btn {
  display: block;
}
.article-content pre .itxgo-collapse-corner-btn:hover {
  opacity: 1;
}

/* 滚动条 */
.article-content pre.itxgo-code-block::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.article-content pre.itxgo-code-block::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 6px;
}
.article-content pre.itxgo-code-block::-webkit-scrollbar-thumb {
  background: var(--itxgo-scrollbar-thumb);
  border-radius: 4px;
}
.article-content pre.itxgo-code-block::-webkit-scrollbar-thumb:hover {
  background: color-mix(
    in srgb,
    var(--itxgo-scrollbar-thumb) 80%,
    var(--itxgo-code-text)
  );
}

/* 重置代码块内部元素样式 */
.article-content pre.itxgo-code-block code,
.article-content pre.itxgo-code-block code * {
  background: transparent;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
}

/* 行内代码 */
.article-content code:not(pre > code) {
  font-family: Cascadia Code;
  background-color: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
  margin: 0 1px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  transition: background-color 0.2s ease;
}

.article-content code:not(pre > code):hover {
  background-color: rgba(88, 166, 255, 0.15);
}

/* ==========================================
   有序列表
   ========================================== */
/* 圆形标签样式 */
ol {
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
}
/* 只在顶层ol重置计数器 */
ol:not(ol ol) {
  counter-reset: list-counter;
}
ol > li {
  counter-increment: list-counter;
  margin: 8px 0;
  padding-left: 25px;
  position: relative;
  line-height: 1.1;
}
ol > li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  background: var(--color-text-secondary);
  color: white;
  border-radius: 50%; /* 圆形 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
}

/* 控制嵌套在有序列表内的无序列表缩进 标记3 */
ol ul {
  padding-left: 16px; /* 修改这个值来控制嵌套缩进距离 */
}

/* ==========================================
   引用块
   ========================================== */

blockquote {
  position: relative;
  margin: 10px 0;
  padding: 10px 20px;
  border: 1.5px solid var(--color-highlight);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-light);
  color: var(--color-text-primary);
}

blockquote::before {
  content: "";
  position: absolute;
  padding: 0 3px;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 24px;
  background-color: var(--color-highlight);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctext x='-7' y='34' font-size='36' font-family='serif' fill='white'%3E%E2%80%9C%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: var(--radius-sm) 0 var(--radius-sm) 0;
}

blockquote::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--color-highlight);
  border-bottom: 2px solid var(--color-highlight);
  border-radius: 0 0 var(--radius-xs) 0;
  opacity: 0.4;
}

/* ==========================================
   表格
   ========================================== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fefefe;
  box-shadow: 0 0 0 1px #ddd;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

th {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e5e5;
  background: #f6f6f6;
  color: #333;
  font-weight: 600;
  text-align: center;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e5e5;
  border-right: 1px solid #e5e5e5;
  text-align: center;
}

td:last-child {
  border-right: none;
}

tbody tr:hover {
  background: #f6f6f6;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* 四个角单独设置圆角 */
thead tr:first-child th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}
thead tr:first-child th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}
tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-sm);
}
tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--radius-sm) 0;
}

/* ==========================================
   分割线
   ========================================== */

hr {
  border: none;
  height: 1px;
  background-color: #ddd;
  margin: 1.5em 0;
  transition: background-color 0.3s;
}

/* ==========================================
   评论区
   ========================================== */
.comment-section {
  margin-top: 30px;
}

.comment {
  background-color: var(--color-bg-light);
  padding: 8px 12px;
  margin: var(--spacing-sm) 0 0;
  border-radius: 12px;
  transition: background-color var(--transition-normal);
}

.comment:hover {
  background-color: var(--color-bg-hover);
}

/* 一级回复样式 */
.comment.reply-level-1 {
  background-color: var(--color-bg-light);
  margin: 8px 0 0;
  padding: 8px var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.comment.reply-level-1:hover {
  background-color: var(--color-bg-hover);
}

.comment.reply-level-1 .comment-content {
  margin-top: var(--spacing-sm);
  color: var(--color-text-secondary);
  font-size: 1em;
}

.comment.reply-level-1 .reply-indicator {
  font-size: 1em;
  color: var(--color-text-tertiary);
  margin-right: var(--spacing-xs);
}

.comment:not(.reply-level-1) .reply-indicator {
  font-size: 0.9em;
}

.reply-indicator .reply-target {
  color: var(--color-accent);
  font-weight: 600;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 2px; /* 原 var(--spacing-xs) */
  flex-wrap: wrap;
}

.comment-author {
  font-weight: bold;
  color: var(--color-text-primary);
  font-size: 1em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 文章详情页面 评论楼主 / 楼层标签 */
.comment-floor-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: normal;
  vertical-align: 0.5px;
  line-height: 1.6;
}
.floor-host {
  background: var(--color-accent);
  color: #fff;
}
.floor-reply {
  background: var(--color-bg-lighter);
  border-radius: 6px;
  color: var(--color-text-tertiary);
}

.comment-actions {
  flex-shrink: 0;
}

.comment-content {
  margin-top: var(--spacing-sm);
  color: var(--color-text-secondary);
}

.comment-date {
  font-size: 0.85em;
  color: var(--color-text-tertiary);
  margin-top: 0; /* 原 6px */
}

/* 评论按钮 */
.reply-btn,
.toggle-replies-btn {
  display: inline-block;
  padding: 3px 8px;
  margin: 0 4px;
  text-decoration: none;
  border: 2px solid var(--color-bg-lighter);
  background-color: var(--color-bg-lighter);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast);
  cursor: pointer;
  font-size: 0.85em;
}

.reply-btn:hover,
.toggle-replies-btn:hover {
  background-color: var(--color-bg-card);
  border-color: var(--color-highlight);
  color: var(--color-text-primary);
}

.toggle-replies-btn {
  margin: 8px 0 0;
}

.cancel-reply {
  background-color: var(--color-text-tertiary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  margin-left: var(--spacing-sm);
  transition: background-color var(--transition-normal);
}

.cancel-reply:hover {
  background-color: var(--color-text-secondary);
}

.comment-form {
  margin-top: 0;
}

.comment-form input,
.comment-form textarea {
  font-size: 0.9375rem;
  font-family: inherit;
}

/* 评论输入框获得焦点样式 */
.comment-form textarea:focus {
  border: 2px solid var(--color-highlight); /* 高亮边框 */
  outline: none; /* 移除浏览器默认的聚焦轮廓 */
}

/* 回复容器和连接线 */
.comment-container {
  position: relative;
  margin: 0;
  padding: 0;
}

.replies {
  position: relative;
  margin: var(--spacing-sm) 0 0 var(--spacing-sm);
  padding-left: 14px;
}

.replies::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    #ffcc2200,
    var(--color-highlight) 20%,
    var(--color-highlight) 80%,
    #ffcc2200
  );
  pointer-events: none;
}

/* 文章评论计数 数字气泡样式 */
.icon-badge {
  position: relative;
  display: inline-block;
  font-size: 1.5rem;
}

.badge {
  position: absolute;
  top: 2px;
  right: -2px;
  background-color: var(--color-highlight);
  color: white;
  border-radius: 50%;
  width: 19px;
  height: 19px;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid white;
  font-weight: bold;
}

/* 评论展开按钮样式 */
.toggle-main-comments-btn {
  width: 100%; /* 按钮宽度占满父容器 */
  padding: 11.3px 0; /* 上下内边距11.3px */
  border-radius: var(--radius-sm); /* 10像素圆角 */
  cursor: pointer; /* 鼠标悬停时显示手型指针 */
  color: var(--color-text-secondary); /* 中灰色文字颜色 */
  margin-bottom: -6px; /* 建议使用设计系统的变量 */
  background: var(--color-bg-light); /* 默认背景色 */
  font-size: 0.95em;
  border: none; /* 去除浏览器默认的灰色边框 */
}

/* 评论展开按钮 数字气泡样式 */
.circled-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-highlight);
  border: 1px solid var(--color-highlight);
  font-size: 0.95em;
  color: var(--color-text-inverse);
}

/* ==========================================
   评论头像样式
   ========================================== */
.comment-avatar {
  width: 42px;
  height: 42px;
  margin-top: 6px;
  border-radius: 50%;
  vertical-align: middle;
  object-fit: cover;
  flex-shrink: 0;
}

.reply-level-1 .comment-avatar {
  width: 38px;
  height: 38px;
  margin-top: 4px; /* 回复评论字号更小，行高更矮，减小偏移 */
}

/* ========== Comment Header Wrap ========== */
.comment-header-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: var(--spacing-xs);
}

.comment-header-info {
  flex: 1;
  min-width: 0;
}

/* ==========================================
   提示信息
   ========================================== */
.alert {
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-align: center;
}

.alert-success {
  color: #2d5a2d;
  background-color: #e6f4e6;
  border-color: #c3e6c3;
}

.alert-error {
  color: #8b3a3a;
  background-color: #f8d7da;
  border-color: #f1b0b7;
}

/* ==========================================
   滚动控制按钮
   ========================================== */
.scroll-control {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 50px;
  z-index: 999;
}

.scroll-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: none; /* JS 动态控制显示 */
  color: #bbb;
  font-size: 1.2em;
  border-radius: 30%;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   模态框样式
   ========================================== */
/* 模态框容器 */
.modal {
  display: none; /* JS 切换为 display:flex 时生效 */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  animation: fadeIn var(--transition-normal);
  align-items: center; /* display:flex 时居中内容 */
  justify-content: center;
}

/* 模态框内容 */
.modal-content {
  background-color: rgba(255, 255, 255, 1);
  z-index: 0;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: none;
  overflow-wrap: break-word;
  transform: translateZ(0);

  /* === 模态框特有样式 === */
  width: 90%;
  max-width: 353px;
  position: relative;
  margin: auto;
  padding: var(--spacing-lg) 30px;
  animation: slideDown var(--transition-normal);
}

/* 伪元素独揽边框与三重重度阴影 */
.modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  box-shadow:
    0 0 0 11px #f5f5f5,
    0 0 0 13px #fff,
    0 3px 15px 4px rgba(0, 0, 0, 0.5);

  will-change: transform; /* 提升独立合成层，优化渲染性能 */
}

/* 模态框标题样式 */
.modal-content h2 {
  text-align: center;
  margin: 0 0 var(--spacing-lg);
}

/* 关闭按钮 */
.modal-close {
  position: absolute;
  right: var(--spacing-lg);
  top: var(--spacing-sm);
  color: var(--color-text-tertiary);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-normal);
  user-select: none;
  z-index: 1;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--color-text-primary);
}

/* 表单样式 */
.modal-content form {
  padding: 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  background-color: transparent;
  max-width: none;
}

.modal-content form input[type="text"],
.modal-content form input[type="email"],
.modal-content form input[type="password"],
.modal-content form textarea,
.modal-content form select {
  margin-bottom: 12px;
  font-size: 1.0625rem;
  border: 2px solid #ccc;
}

/* 模态框表单行布局 (统一前后台间距) */
.modal-content .form-row {
  display: flex;
  gap: 1em;
  margin-bottom: 1em;
}
.modal-content .form-row input[type="text"],
.modal-content .form-row input[type="email"],
.modal-content .form-row input[type="password"],
.modal-content .form-row select,
.modal-content .form-row textarea {
  flex: 1;
  margin: 0; /* 覆盖上方的 margin-bottom: 12px，交由父容器控制间距 */
}

.modal-content form input[type="text"]:focus,
.modal-content form input[type="email"]:focus,
.modal-content form input[type="password"]:focus,
.modal-content form textarea:focus,
.modal-content form select:focus {
  outline: none;
  border-color: var(--color-highlight);
}

.modal-content form button {
  width: 100%;
  margin-top: 0;
}

/* 切换提示 */
.modal-switch {
  text-align: center;
  margin: var(--spacing-md) 0 var(--spacing-xs);
  font-size: 0.9em;
  color: var(--color-text-secondary);
}

.modal-switch a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-normal);
}

.modal-switch a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* 原消息提示
.modal-message {
  text-align: center;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  padding: 6px 0;
  display: none;
}

.modal-message:not(:empty) {
  display: block;
}
 */

/* 动画关键帧 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ==========================================
   用户个人中心 (user.php) 专属样式
   ========================================== */
/* 页面布局 */
.user-page-layout {
  display: block;
  margin: 0 auto;
  padding: var(--spacing-lg) 0;
  min-height: auto;
}
.user-card-inner {
  padding: var(--spacing-md);
}

/* 头部：头像 + 用户名/简介 + 操作按钮 */
.user-card-header {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: var(--spacing-md);
  align-items: center;
  margin-bottom: var(--spacing-md);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
.user-card-avatar-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
}
.user-card-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.user-card-name {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-card-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
}
.user-card-bio {
  grid-column: 2 / 4;
  grid-row: 2;
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.92em;
  line-height: 1.5;
}
.user-card-bio--empty {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* 操作按钮样式 (用于卡片头部的编辑/发私信按钮) */
.btn-profile-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9em;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background-color: var(--color-bg-light);
  color: var(--color-text-secondary);
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}
.btn-profile-action > svg {
  flex-shrink: 0;
}
.btn-profile-action:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.btn-profile-msg {
  background-color: var(--color-accent);
  color: #fff;
}
.btn-profile-msg:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
}

/* 用户头像图片 */
.profile-avatar-img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
/* 用户头像编辑图标托盘 */
.avatar-action-icon {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  font-size: 14px;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
/* 用户头像编辑图标字符微调 */
.avatar-icon-symbol {
  display: inline-block;
  transform: translate(0px, 0px);
}

/* 统计数据：五列 */
.user-card-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}
.user-card-stat-item {
  position: relative;
  overflow: hidden;
  text-align: center;
  background-color: var(--color-bg-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-xs);
  border: 2px solid transparent;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease;
}
.user-card-stat-item:hover {
  background-color: var(--color-bg-hover);
}
.stat-bg-icon {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 46px;
  height: 46px;
  color: var(--color-text-tertiary);
  opacity: 0;
  pointer-events: none;
  transform: rotate(0deg) scale(0.55) translate(6px, -6px);
  transition:
    opacity 0.26s ease,
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.user-card-stat-item:hover .stat-bg-icon,
.user-card-stat-tab.active .stat-bg-icon {
  opacity: 0.14;
  transform: rotate(-45deg) scale(1.08) translate(0, 0);
}
.user-card-stat-tab {
  cursor: pointer;
}
.user-card-stat-tab.active {
  border-color: var(--color-highlight);
  background-color: var(--color-bg-card);
}
.user-card-stat-disabled {
  cursor: not-allowed !important;
}
.user-card-stat-tab.active .user-card-stat-value,
.user-card-stat-tab.active .user-card-stat-label {
  color: var(--color-accent);
}
.user-card-stat-value {
  display: block;
  font-weight: 600;
  font-size: 1.1em;
  color: var(--color-text-primary);
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}
.user-card-stat-label {
  display: block;
  font-size: 0.85em;
  color: var(--color-text-secondary);
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}

/* Tab 区域及加载动画 */
.user-tab-loading {
  min-height: 132px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 60px 20px;
}
.user-tab-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-highlight);
  animation: tabLoadingBounce 1s ease-in-out infinite;
}
.user-tab-loading span:nth-child(2) {
  animation-delay: 0.15s;
}
.user-tab-loading span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes tabLoadingBounce {
  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.user-tab-loading.hidden {
  display: none;
}

/* Tab 列表项统一样式 */
.profile-list-item {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-light);
  transition: background-color var(--transition-normal);
}
.profile-list-item:last-child {
  margin-bottom: 0;
}
.profile-list-item:hover {
  background-color: var(--color-bg-hover);
}
.item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.95em;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text-primary);
  overflow: hidden;
}
.item-title a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}
.item-title a:hover {
  color: var(--color-accent);
}
.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 0.85em;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
.meta-item a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}
.meta-item a:hover {
  color: var(--color-accent);
}
.tab-icon {
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  vertical-align: middle;
}
.tab-icon--pinned {
  color: var(--color-accent);
}
.user-tab-body .pagination {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* 私信弹窗特有样式 (字数统计) */
.msg-textarea-wrap {
  position: relative;
  margin-bottom: 12px;
}
.msg-textarea-wrap textarea {
  margin-bottom: 0;
  padding-bottom: 26px;
  resize: none;
}
.msg-char-count {
  position: absolute;
  right: 10px;
  bottom: 12px;
  font-size: 0.78em;
  color: var(--color-text-tertiary);
  pointer-events: none;
  background: var(--color-bg-card);
  padding: 0 2px;
}

/* ==========================================
   点赞按钮样式
   ========================================== */
.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  padding: 0 5px;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  color: var(--color-text-tertiary);
  vertical-align: 0;
}

/* 微调SVG位置 */
.like-btn svg {
  transform: translateY(2px);
}

.like-btn:hover {
  transform: scale(1.2);
  color: var(--color-highlight);
}

.like-btn.liked {
  color: var(--color-highlight);
  font-weight: bold;
}

.like-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* ==========================================
   用户下拉菜单交互样式
   ========================================== */

/* 用户菜单容器 + 扩大悬停区域 */
.user-menu-container {
  position: relative;
}

.user-menu-container::before {
  content: "";
  position: absolute;
  inset: 0 0 -30px 0;
  pointer-events: auto;
}

/* 触发按钮和下拉项通用样式 */
.user-menu-trigger,
.user-dropdown-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-lighter);
  transition:
    color var(--transition-normal),
    background-color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
  cursor: pointer;
}

/* 悬停效果 & 激活状态 - 合并父按钮和下拉项 */
.user-menu-trigger:hover,
.user-menu-container:hover .user-menu-trigger,
.user-dropdown-item:hover,
.user-dropdown-item.active { 
  color: var(--color-text-primary);
  border-color: var(--color-highlight);
  background-color: var(--color-bg-card);
}

/* 覆盖全局 nav a.active 带来的加粗效果，保持与 hover 完全一致 */
.user-menu-trigger.active,
.user-dropdown-item.active {
  font-weight: 500;
}

.user-menu-trigger:hover,
.user-menu-container:hover .user-menu-trigger {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 下拉菜单容器 */
.user-dropdown {
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 100%;
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  border: none;

  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    pointer-events 0s 0.3s;
}

/* 伪元素独揽边框与三重重度阴影（隐藏态） */
.user-dropdown::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-md);
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  box-shadow:
    0 0 0 11px transparent,
    0 0 0 13px transparent,
    0 3px 15px 4px transparent;

  will-change: transform; /* 提升独立合成层，优化渲染性能 */
  transition: box-shadow 0.3s ease;
}

/* 容器悬停时显示下拉菜单 */
.user-menu-container:hover .user-dropdown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

/* 容器悬停时，::after 亮出三重重度阴影 */
.user-menu-container:hover .user-dropdown::after {
  box-shadow:
    0 0 0 11px #f5f5f5,
    0 0 0 13px #fff,
    0 3px 15px 4px rgba(0, 0, 0, 0.5);
}

/* SVG 图标 */
.user-dropdown-item svg {
  flex-shrink: 0;
}

/* 通用样式 - 所有top类共用 */
[class^="top"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  color: white;
  font-size: 0.8em;
  text-decoration: none;
  border-radius: 50%;
  margin: 0 4px 0 2px;
  line-height: 1.4em; /* 与高度一致 */
  padding-bottom: 1.4px; /* 微调,根据实际效果调整 */
  transform: translateY(-1px);
}

/* 单独样式 - 背景色不同 */
.top1 {
  background-color: var(--color-highlight); /* 黄色 */
}

.top2 {
  background-color: var(--color-highlightql); /* 浅蓝 */
}

.top3 {
  background-color: var(--color-text-tertiary); /* 浅灰 */
}

/* ==========================================
   未读消息数字动画
   ========================================== */
.unread-count.has-unread {
  animation: blink 1.5s ease-in-out infinite;
  display: inline-block;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
    color: var(--color-text-primary);
  }
  50% {
    opacity: 0.3;
    color: var(--color-text-primary);
  }
}

/* ==========================================
   用户按钮海浪样式
   ========================================== */
.stat-card.clickable {
  position: relative;
  overflow: hidden;
}

.stat-card.clickable::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath fill='%2300A8FF' fill-opacity='0.4' d='M0,64 C150,100 350,0 600,64 C850,128 1050,32 1200,64 L1200,120 L0,120 Z'/%3E%3C/svg%3E")
    repeat-x;
  background-size: 50% 100%;
  animation: wave-flow 16s linear forwards; /* 16秒完成一次完整波浪移动 */
  opacity: 0.2;
  z-index: 1;
}

.stat-card.clickable::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath fill='%2300C9FF' fill-opacity='0.6' d='M0,80 C200,120 400,40 600,80 C800,120 1000,40 1200,80 L1200,120 L0,120 Z'/%3E%3C/svg%3E")
    repeat-x;
  background-size: 50% 100%;
  animation: wave-flow 16s linear forwards reverse; /* 反向动画，同样是16秒 */
  opacity: 0.2;
  z-index: 2;
}

@keyframes wave-flow {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* === 分隔符 === */

/* ==========================================
   响应式布局：平板端 (max-width: 1152px)
   ========================================== */
@media (max-width: 1152px) {
  /* ---- 1. 主页面布局骨架 ---- */
  .main-content {
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) 0;
  }

  .sidebar-section-container {
    display: none;
  }

  .article-container,
  .article-main-wrapper {
    width: 100%;
  }

  /* ---- 2. 导航栏基本模块 ---- */
  #subtitle,
  .placeholder-bottom,
  .scroll-control {
    display: none;
  }

  .header-bottom,
  nav {
    width: 100%;
  }

  nav ul {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    transform: translateY(-10px);
  }

  /* ---- 3. 导航栏特殊状态（收缩态） ---- */
  .header-container.shrunk {
    header {
      padding-top: 16px;
    }
    .header-top h1 {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s ease;
    }
  }

  /* ---- 4. 页脚模块 ---- */
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ==========================================
   响应式布局：手机端 (max-width: 768px)
   ========================================== */
@media (max-width: 768px) {
  /* ---- 1. 主体布局骨架 ---- */
  .header-container,
  .main-content,
  .footer-container {
    width: calc(100% - (var(--spacing-md) * 2));
  }

  /* ---- 2. 导航栏：容器高度 ---- */
  .header-container {
    max-height: 108px; /* 展开高度 */
  }
  .header-container.shrunk {
    max-height: 68px; /* 收缩高度 */
  }

  /* ---- 3. 导航栏：内部模块 ---- */
  .placeholder-top {
    display: none;
  }

  /* 第一行：标题物理绝对居中修正 + 字号收缩 */
  .header-top {
    justify-content: center;
    h1 {
      margin: 0 auto;
      font-size: 1.5em;
      text-align: center;
    }
  }

  header {
    padding-inline: var(--spacing-md);
    padding-top: 8px;
    transition: padding-top
      calc(var(--transition-duration) * 1.2 * var(--header-anim-switch))
      var(--transition-easing) 0.02s;
  }
  .header-container.shrunk header {
    padding-top: 22px; /* 单行按钮顶部距离 */
  }

  nav ul li:first-child {
    display: none;
  }
  nav ul li a {
    padding-inline: 6px;
    font-size: 0.92em;
    white-space: nowrap;
    svg {
      display: none;
    }
  }

  /* ---- 4. 字号缩放 ---- */
  /* 4.1 各模块小节标题：文章内容/文章列表/文章评论/发表评论/回复评论等 */
  .sidebar-section h2,
  .sidebar-listicle h2 {
    font-size: 1.15em; /* 1.15em; */
  }
  /* 4.2 文章详情页主标题 */
  .article-header-info .article-title {
    font-size: 1.15em; /* 1.3em; */
    line-height: 1.2; /* 1.4; */
  }
  /* 4.3 首页文章列表卡片标题 */
  .article-item h3 {
    font-size: 1.05em; /* 1.05em; */
  }
  /* 4.4 文章正文 Markdown 渲染标题 */
  .article-content h1 {
    font-size: 1.15em;
  } /* 1.5em; */
  .article-content h2 {
    font-size: 1.1em;
  } /* 1.3em; */
  .article-content h3 {
    font-size: 1.05em;
  } /* 1.15em; */
  .article-content h4,
  .article-content h5,
  .article-content h6 {
    font-size: 1.05em;
  } /* 1.05em; */
  /* 4.5 登录/注册模态框标题 */
  .modal-content h2 {
    font-size: 1.15em; /* 1.3em; */
  }

  /* ---- 5. 代码块 ---- */
  .article-content pre.itxgo-code-block {
    font-size: 13px;
    padding: 36px 12px 10px;
    margin: 0.8rem 0px;
    border-radius: var(--radius-sm);
  }
  .article-content pre .itxgo-code-tools {
    height: 34px;
    padding: 0 12px;
  }
  .article-content pre .itxgo-code-btn {
    padding: 3px 8px;
    font-size: 11px;
    height: 26px;
  }
  .article-content pre .itxgo-toggle {
    width: auto;
    min-width: auto;
    padding: 0 8px;
    justify-content: center;
    font-size: 12px;
    white-space: nowrap;
  }
  .article-content pre .itxgo-code-label {
    font-size: 11px;
  }

  /* ---- 6. 页脚 ---- */
  .footer-links {
    display: none;
  }
  .footer-extra {
    display: none;
  }
  .footer-container {
    height: auto;
    min-height: unset;
    padding-block: var(--spacing-xs);
  }
}

/* ==========================================
   WebGL 降级背景
   ========================================== */
body.no-webgl-bg {
  background: linear-gradient(
    135deg,
    #e8f7f9 0%,
    #f0fbf4 35%,
    #fdfff0 65%,
    #e8f7f9 100%
  );
  background-size: 200% 200%;
}

@media (prefers-reduced-motion: no-preference) {
  body.no-webgl-bg {
    animation: bg-shift 20s ease-in-out infinite alternate;
  }
}

@keyframes bg-shift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* ==========================================
   浅色/深色 主题切换按钮
   ========================================== */
.header-top h1 {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.theme-toggle-btn {
  position: absolute;
  top: 18px;
  right: -24px;
  transform: translateY(-50%);
  font-size: 1.4rem;
  cursor: pointer;
  user-select: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  line-height: 1;
}

#themeToggleAuto {
  color: var(--color-text-tertiary);
}

#themeToggleLight {
  color: var(--color-highlight);
}

#themeToggleDark {
  color: var(--color-highlightql);
}

.theme-toggle-btn:hover {
  transform: translateY(-50%) scale(1.15);
}
