:root {
  /* 使用OKLCH色彩空间，中性色带有微妙暖色相 */
  /* 注意：同时提供 HEX 和 OKLCH 值以确保兼容性 */
  --bg: #f1f0eb;
  --bg-oklch: oklch(95% 0.01 85);
  --panel: #ece8df;
  --panel-oklch: oklch(93% 0.015 85);
  --panel-deep: #dfd6c6;
  --panel-deep-oklch: oklch(88% 0.02 85);
  --paper: #fcfbf8;
  --paper-oklch: oklch(98% 0.005 85);
  --ink: #202020;
  --ink-oklch: oklch(20% 0.02 85);
  --muted: #7d7a73;
  --muted-oklch: oklch(55% 0.015 85);
  --line: #d8d0c3;
  --line-oklch: oklch(85% 0.02 85);
  --accent: #95c394;
  --accent-oklch: oklch(75% 0.12 145);

  /* 阴影使用更自然的暖色调 */
  --shadow: 0 12px 28px rgba(40, 34, 25, 0.1);
  --shadow-elevated: 0 20px 40px rgba(40, 34, 25, 0.15);
  /* 网格线颜色 - 使用 rgba 确保跨浏览器兼容性 */
  --grid-line: rgba(180, 167, 146, 0.3);

  /* 间距系统 - 4px基数 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* 圆角系统 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 26px;
  --radius-full: 999px;

  /* 动效缓动 */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter: cubic-bezier(0, 0, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);

  /* 打印纸排版 */
  --paper-font-scale: 0.9375;
  --paper-padding-x: 44px;

  /* 字体加载策略 - 确保中文网字计划不受影响 */
  --font-display: swap;

  /* 主题变量 */
  --printer-cn-font-family: "";
  --printer-external-link-color: #ff6b35;
  --printer-post-category-color: #ff6b35;
  --printer-post-category-rgb: 255 107 53;
}

* {
  box-sizing: border-box;
}

/* ============================================
   动效系统 - 统一使用CSS变量缓动
   ============================================ */
html.theme-animating *,
html.theme-animating *::before,
html.theme-animating *::after {
  transition:
    background-color 250ms var(--ease-smooth),
    color 250ms var(--ease-smooth),
    border-color 250ms var(--ease-smooth),
    box-shadow 250ms var(--ease-smooth),
    background-image 250ms var(--ease-smooth),
    transform 250ms var(--ease-smooth);
}

/* 关键元素单独优化过渡 */
html.theme-animating .printer-top,
html.theme-animating .paper,
html.theme-animating .site-footer {
  transition:
    background-color 250ms var(--ease-smooth),
    border-color 250ms var(--ease-smooth),
    box-shadow 250ms var(--ease-smooth);
}

/* 按钮和交互元素更快响应 - 使用enter缓动 */
html.theme-animating .theme-toggle,
html.theme-animating .menu a,
html.theme-animating .header-search-btn {
  transition:
    background-color 180ms var(--ease-enter),
    border-color 180ms var(--ease-enter),
    box-shadow 180ms var(--ease-enter),
    transform 180ms var(--ease-enter);
}

@keyframes power-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

@keyframes power-pulse-dark {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background-color: var(--bg);
  /* 背景网格线 - 使用 SVG data URI 确保跨浏览器一致性 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cline x1='0' y1='0' x2='0' y2='18' stroke='%23b4a792' stroke-width='1' stroke-opacity='0.28'/%3E%3Cline x1='0' y1='0' x2='18' y2='0' stroke='%23b4a792' stroke-width='1' stroke-opacity='0.28'/%3E%3C/svg%3E");
  font-size: 15px;
  font-family: "Songti SC", "Noto Serif CJK SC", "STSong", "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: background-color 250ms var(--ease-smooth);
  /* 优化文本渲染 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 中文排版优化：启用 OpenType 特性 */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  /* 中英文混排自动间距 - 渐进增强 */
  -webkit-text-spacing-trim: space-all;
  text-spacing-trim: space-all;
}

html.printer-cn-font.printer-cn-scope-article article,
html.printer-cn-font.printer-cn-scope-article article * {
  font-family: var(--printer-cn-font-family), "Songti SC", "Noto Serif CJK SC", "STSong", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html.printer-cn-font.printer-cn-scope-paper .paper,
html.printer-cn-font.printer-cn-scope-paper .paper * {
  font-family: var(--printer-cn-font-family), "Songti SC", "Noto Serif CJK SC", "STSong", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html.printer-cn-font.printer-cn-scope-all body,
html.printer-cn-font.printer-cn-scope-all body * {
  font-family: var(--printer-cn-font-family), "Songti SC", "Noto Serif CJK SC", "STSong", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 使用间距系统 */
.site-wrap {
  max-width: 940px;
  margin: var(--space-7) auto var(--space-8);
  padding: 0 var(--space-4);
}

.printer-top {
  background: linear-gradient(180deg, #f5f0e6 0%, #ebe5d8 50%, #e0d8c8 100%);
  border: 1px solid #d4c8b0;
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-md) var(--radius-md);
  padding: var(--space-5) var(--space-6) var(--space-5);
  box-shadow:
    /* 顶部高光 */
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    /* 外阴影 */
    0 20px 40px rgba(40, 34, 25, 0.12),
    0 8px 16px rgba(40, 34, 25, 0.08);
  position: relative;
  z-index: 2;
  /* 使用 translate3d 启用 GPU 加速，减少闪烁 */
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
  /* 微交互：悬停时轻微上浮 - 使用更短的过渡时间减少闪烁 */
  transition: box-shadow 200ms var(--ease-smooth);
}

/* 底部阴影层 */
.printer-top::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -10px;
  height: 12px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: linear-gradient(to bottom, #c4b8a0, #d4c8b0);
  box-shadow:
    0 4px 8px rgba(40, 34, 25, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  z-index: -1;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 拟物化Logo底座 */
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8e0d0 0%, #d4c8b0 100%);
  position: relative;
  flex-shrink: 0;
  box-shadow:
    /* 外阴影 - 营造悬浮感 */
    0 8px 20px rgba(40, 34, 25, 0.15),
    0 4px 8px rgba(40, 34, 25, 0.1),
    /* 内阴影 - 凹陷效果 */
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo内部圆形 */
.brand-mark::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3a3a3a 0%, #2a2a2a 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #e8e0d0 0%, #d4c8b0 100%);
  box-shadow:
    0 8px 20px rgba(40, 34, 25, 0.15),
    0 4px 8px rgba(40, 34, 25, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.08);
  padding: 6px;
}

.brand-logo img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 中心指示灯 */
.brand-mark::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffb347 0%, #e6953a 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(16px, 2.5vw, 20px);
  letter-spacing: 0.25em;
  font-weight: 600;
  background: linear-gradient(135deg, var(--ink) 0%, #5a5448 100%);
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.power {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.power-text-off {
  display: none;
}

html.dark .power-text-on {
  display: none;
}

html.dark .power-text-off {
  display: inline;
}

.power-dot {
  width: 11px;
  height: 11px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: power-pulse 2.4s ease-in-out infinite;
  /* 使用 opacity 动画代替 box-shadow 动画，性能更好 */
  box-shadow: 0 0 10px rgba(134, 188, 142, 0.6);
  will-change: opacity;
}

html.dark .power-dot {
  background: #ff4d4f;
  box-shadow: 0 0 10px rgba(255, 77, 79, 0.85);
}

.menu-row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 3D拟物化菜单按钮 */
.menu a {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5f0e6 0%, #e8e0d0 100%);
  color: #4a453d;
  /* 3D立体阴影 */
  box-shadow:
    /* 顶部高光 */
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    /* 底部阴影 */
    0 6px 0 #c9bfa8,
    0 8px 8px rgba(40, 34, 25, 0.15),
    0 12px 16px rgba(40, 34, 25, 0.1);
  /* 微交互 */
  transition: transform 150ms var(--ease-enter), box-shadow 150ms var(--ease-enter);
  position: relative;
  border: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  /* GPU 加速优化 */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* 悬停效果 - 轻微上浮 */
.menu a:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 0 #c9bfa8,
    0 10px 12px rgba(40, 34, 25, 0.18),
    0 16px 20px rgba(40, 34, 25, 0.12);
}

/* 点击效果 - 按下凹陷 */
.menu a:active {
  transform: translate3d(0, 4px, 0);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 2px 0 #c9bfa8,
    0 3px 4px rgba(40, 34, 25, 0.1);
}

/* 当前选中状态 */
.menu a.current {
  background: linear-gradient(180deg, #e8e0d0 0%, #ddd5c0 100%);
  color: #3a3530;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.08),
    0 3px 0 #b8ad94,
    0 4px 6px rgba(40, 34, 25, 0.1);
  transform: translateY(3px);
}

.ctrls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-search input[type="search"] {
  width: 0;
  padding: 7px 0;
  opacity: 0;
  pointer-events: none;
  border: 1px solid #d7cfbe;
  border-radius: var(--radius-full);
  background: rgba(253, 251, 246, 0.75);
  font-size: 12px;
  color: inherit;
  outline: none;
  transition: width 250ms var(--ease-enter), padding 250ms var(--ease-enter), opacity 200ms var(--ease-smooth);
}

.header-search.open input[type="search"] {
  width: 140px;
  padding: 7px 10px;
  opacity: 1;
  pointer-events: auto;
}

.header-search input[type="search"]::placeholder {
  color: rgba(125, 122, 115, 0.9);
}

/* 拟物化旋钮按钮 - 搜索 */
.header-search-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #f5f0e6 0%, #e0d6c4 100%);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* 防止溢出 */
  overflow: hidden;
  /* 3D立体效果 */
  box-shadow:
    /* 顶部高光 */
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    /* 底部阴影 */
    0 5px 0 #c4b8a0,
    0 6px 8px rgba(40, 34, 25, 0.2),
    0 10px 16px rgba(40, 34, 25, 0.12);
  transition: transform 150ms var(--ease-enter), box-shadow 150ms var(--ease-enter);
  position: relative;
  /* GPU 加速优化 */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* 旋钮内部凹陷 */
.header-search-btn::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8e0d0 0%, #f0ebe0 100%);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.5);
}

.header-search-btn svg {
  width: 16px;
  height: 16px;
  fill: #7a7265;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

.header-search-btn:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 7px 0 #c4b8a0,
    0 8px 12px rgba(40, 34, 25, 0.22),
    0 14px 20px rgba(40, 34, 25, 0.15);
}

.header-search-btn:active {
  transform: translate3d(0, 3px, 0);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.12),
    0 2px 0 #c4b8a0,
    0 3px 5px rgba(40, 34, 25, 0.1);
}

html.dark .header-search input[type="search"] {
  background: rgba(16, 26, 40, 0.7);
  border-color: #2b3f5f;
  color: #dce6f5;
}

html.dark .header-search input[type="search"]::placeholder {
  color: rgba(129, 146, 168, 0.95);
}

html.dark .header-search-btn {
  border-color: #355174;
  background: radial-gradient(circle at 35% 35%, #24374e 0, #1b2c44 45%, #162336 100%);
  color: #cfe3ff;
  box-shadow: inset -1px -2px 3px rgba(0, 0, 0, 0.35);
}

/* 语言切换器 - 拟物化风格 */
.lang {
  font-size: 11px;
  font-weight: 600;
  color: #8d877d;
  display: flex;
  gap: 3px;
  padding: 3px;
  background: linear-gradient(145deg, #e8e0d0 0%, #d4c8b0 100%);
  border-radius: 20px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.5);
}

.lang span {
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease-enter),
    color 200ms var(--ease-enter),
    box-shadow 200ms var(--ease-enter);
  letter-spacing: 0.05em;
}

.lang span:not(.current):hover {
  background: rgba(255, 255, 255, 0.3);
}

.lang .current {
  background: linear-gradient(145deg, #f5f0e6 0%, #e8e0d0 100%);
  color: #e37d65;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 拟物化旋钮按钮 - 主题切换 */
.theme-toggle {
  border: none;
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f5f0e6 0%, #e0d6c4 100%);
  position: relative;
  cursor: pointer;
  /* 防止溢出 */
  overflow: hidden;
  /* 3D立体效果 */
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 5px 0 #c4b8a0,
    0 6px 8px rgba(40, 34, 25, 0.2),
    0 10px 16px rgba(40, 34, 25, 0.12);
  transition: transform 150ms var(--ease-enter), box-shadow 150ms var(--ease-enter);
  /* GPU 加速优化 */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* 旋钮内部凹陷 */
.theme-toggle::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8e0d0 0%, #f0ebe0 100%);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 指针 */
.theme-toggle::after {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, #e37d65 0%, #d46a4f 100%);
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%) rotate(20deg);
  transform-origin: center 16px;
  transition: transform 300ms var(--ease-smooth);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.theme-toggle:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 7px 0 #c4b8a0,
    0 8px 12px rgba(40, 34, 25, 0.22),
    0 14px 20px rgba(40, 34, 25, 0.15);
}

.theme-toggle:active {
  transform: translate3d(0, 3px, 0);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.12),
    0 2px 0 #c4b8a0,
    0 3px 5px rgba(40, 34, 25, 0.1);
}

html.dark .theme-toggle::after {
  transform: translateX(-50%) rotate(160deg);
}

html.dark {
  /* 暗黑模式：中性灰黑（去蓝），保持明度阶梯与拟物质感 */
  --bg: #0f0f0f;
  --bg-oklch: oklch(12% 0.005 250);
  --panel: #1a1a1c;
  --panel-oklch: oklch(18% 0.006 250);
  --panel-deep: #262628;
  --panel-deep-oklch: oklch(24% 0.008 250);
  --paper: #19191a;
  --paper-oklch: oklch(17% 0.006 250);
  --ink: #dfe0e1;
  --ink-oklch: oklch(88% 0.005 250);
  --muted: #8f939a;
  --muted-oklch: oklch(65% 0.008 250);
  --line: #353639;
  --line-oklch: oklch(32% 0.008 250);
  --accent: #2fdc7b;
  --accent-oklch: oklch(75% 0.2 155);

  /* 阴影和网格线 */
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  --shadow-elevated: 0 24px 48px rgba(0, 0, 0, 0.7);
  --grid-line: rgba(140, 140, 145, 0.32);
}

/* 暗黑模式背景网格 */
html.dark body {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cline x1='0' y1='0' x2='0' y2='18' stroke='%238c8c91' stroke-width='1' stroke-opacity='0.34'/%3E%3Cline x1='0' y1='0' x2='18' y2='0' stroke='%238c8c91' stroke-width='1' stroke-opacity='0.34'/%3E%3C/svg%3E");
}

/* ============================================
   自定义背景图支持
   ============================================ */

/* 当使用自定义背景图时，禁用默认背景网格 */
body[style*="background-image"] {
  background-image: var(--printer-custom-bg-url) !important;
}

/* 确保自定义背景图时，遮罩层正常工作 */
body[style*="background-image"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(241, 240, 235, 0.3);
  pointer-events: none;
  z-index: -1;
}

/* 黑暗模式下的遮罩 */
html.dark body[style*="background-image"]::before {
  background: rgba(15, 15, 15, var(--printer-custom-bg-dark-overlay, 0.65));
}

/* 自定义背景图时的纸张区域增强可读性 */
body[style*="background-image"] .paper {
  background: rgba(252, 251, 248, 0.95);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

body[style*="background-image"] .paper::before {
  opacity: 0.15;
}

html.dark body[style*="background-image"] .paper {
  background: rgba(25, 25, 26, 0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

html.dark body[style*="background-image"] .paper::before {
  opacity: 0.1;
}

html.dark .printer-top::after {
  background: linear-gradient(to bottom, #121213, #262628);
}

html.dark .printer-top {
  background: linear-gradient(to bottom, #1d1d1f 0%, #171819 100%);
  border-color: #343437;
  box-shadow:
    0 0 0 1px rgba(95, 95, 100, 0.12),
    0 18px 36px rgba(0, 0, 0, 0.62);
}

html.dark .brand-mark {
  background: #2d2e30;
  box-shadow: inset 0 0 0 1px rgba(140, 140, 145, 0.24);
}

html.dark .brand-logo {
  background: #272729;
  border-color: #3d3d40;
}

html.dark .menu a,
html.dark .meta-tags a,
html.dark .meta-tags span,
html.dark .page-navigator a,
html.dark .page-navigator span,
html.dark #comment-form input,
html.dark #comment-form textarea {
  background: linear-gradient(to bottom, #202022 0%, #1b1b1d 100%);
  border-color: #434447;
  color: #e8e8e9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(20, 40, 67, 0.18);
}

html.dark .menu a.current,
html.dark .page-navigator .current a {
  background: linear-gradient(to bottom, #2b2c2e 0%, #252527 100%);
  border-color: #a9afbb;
  color: #f3f3f4;
  box-shadow:
    0 0 0 1px rgba(165, 170, 180, 0.55),
    0 0 14px rgba(140, 145, 155, 0.35);
}

html.dark .menu a:hover {
  border-color: #878b93;
  color: #f1f2f3;
}

html.dark #comment-form button {
  background: linear-gradient(to bottom, #323336 0%, #28282a 100%);
  border-color: #878b93;
  color: #f4f4f4;
}

html.dark .theme-toggle {
  border-color: #525357;
  background: radial-gradient(circle at 35% 35%, #37383b 0, #2e2f31 45%, #252527 100%);
  box-shadow:
    inset -1px -2px 3px rgba(0, 0, 0, 0.4),
    0 0 10px rgba(120, 125, 135, 0.25);
}

html.dark .theme-toggle::after {
  background: #bbbdc1;
}

html.dark .power-dot {
  box-shadow: 0 0 10px rgba(47, 220, 123, 0.9);
}

html.dark .lang .current {
  color: #ff8a6d;
}

html.dark .paper {
  border-color: var(--line);
}

html.dark .paper::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='30'%3E%3Cline x1='0' y1='0' x2='1' y2='0' stroke='%238c8c91' stroke-width='1' stroke-opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.2;
}

/* 打印口进纸容器 */
.printer-paper-wrap {
  position: relative;
  width: calc(100% - 26px);
  margin: -10px auto 0;
  z-index: 1;
  clip-path: inset(0 -24px -9999px -24px);
}

.paper-top-occlusion {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to bottom, #c4b8a0 0%, #c4b8a0 55%, transparent 100%);
}

html.dark .paper-top-occlusion {
  background: linear-gradient(to bottom, #121213 0%, #121213 55%, transparent 100%);
}

.paper {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: var(--space-2) solid var(--panel-deep);
  box-shadow: var(--shadow);
  padding: var(--space-6) var(--paper-padding-x) var(--space-7);
  margin: 0;
  width: 100%;
  min-height: 560px;
  font-size: calc(1rem * var(--paper-font-scale));
  transition: box-shadow 300ms var(--ease-smooth);
  transform-origin: top center;
  will-change: transform;
  /* 中文排版优化 */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-spacing-trim: space-all;
}

/* 撕纸边缘：顶部用纯 CSS gradient 模拟撕裂锯齿
   currentColor 跟随 color:var(--paper)，深浅模式自动换色，无需额外覆盖 */
.paper::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
  pointer-events: none;
  color: var(--paper);
  background-image:
    linear-gradient(135deg, transparent 33.33%, currentColor 33.33% 66.67%, transparent 66.67%),
    linear-gradient(225deg, transparent 33.33%, currentColor 33.33% 66.67%, transparent 66.67%);
  background-repeat: repeat;
  background-size: 12px 6px;
}

/* 撕纸边缘：底部（独立 DOM 元素，因 .paper 的 ::before/::after 已被横线与顶部撕纸占用）
   绝对定位贴在纸面底边外侧，与顶部 ::after 对称；锯齿方向镜像：315°/45° 让纸向下撕开
   选择器用 .paper > 提升特异性，覆盖第 957 行 .paper>* 强加的 position:relative */
.paper > .paper-edge-bottom {
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 0;
  pointer-events: none;
  color: var(--paper);
  background-image:
    linear-gradient(315deg, transparent 33.33%, currentColor 33.33% 66.67%, transparent 66.67%),
    linear-gradient(45deg, transparent 33.33%, currentColor 33.33% 66.67%, transparent 66.67%);
  background-repeat: repeat;
  background-size: 12px 6px;
}

.paper:hover {
  box-shadow: var(--shadow-elevated);
}

/* 纸张横线效果 - 使用 SVG 确保跨浏览器一致性 */
.paper::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='30'%3E%3Cline x1='0' y1='0' x2='1' y2='0' stroke='%23000000' stroke-width='1' stroke-opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.25;
}

.paper>* {
  position: relative;
  z-index: 1;
}

.paper-title {
  margin: 0 0 8px;
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.paper>h2.paper-title {
  font-size: clamp(18px, 2.8vw, 24px);
  letter-spacing: 0.08em;
  background: none;
  -webkit-text-fill-color: var(--ink);
}

.paper-subtitle {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.paper-meta {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) 0 var(--space-3);
  margin-bottom: var(--space-6);
}

.meta-group+.meta-group {
  margin-top: var(--space-4);
}

.meta-label {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.meta-label-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.meta-label-icon svg {
  width: 100%;
  height: 100%;
  fill: #c1baaf;
}

html.dark .meta-label-icon svg {
  fill: #72767e;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meta-tags a {
  font-size: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--panel);
  padding: var(--space-1) var(--space-3);
  font-weight: 500;
  transition:
    background-color 0.2s var(--ease-enter),
    border-color 0.2s var(--ease-enter),
    color 0.2s var(--ease-enter),
    transform 0.2s var(--ease-enter);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.meta-tags a:hover {
  background: var(--panel-deep);
  border-color: var(--muted);
  transform: translateY(-1px);
}


.meta-tags span {
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-full);
  background: var(--paper);
  padding: var(--space-1) var(--space-3);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.post-item {
  border-top: 1px solid var(--line);
  padding: var(--space-6) var(--space-5);
  margin: 0 calc(-1 * var(--space-5));
  transition: background-color 0.2s var(--ease-smooth);
}

.post-item:first-child {
  border-top: 0;
  padding-top: var(--space-3);
}

.post-item:hover {
  background-color: var(--panel);
}

html.dark .post-item:hover {
  background-color: var(--panel);
}

.post-date {
  margin: 0 0 var(--space-2);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}

.post-meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}

.post-meta-label {
  display: inline-block;
  margin-right: 6px;
  letter-spacing: 0.08em;
}

.post-meta-category .post-meta-label {
  display: none;
}

.post-meta-value {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-meta-value a {
  color: var(--printer-post-category-color);
  display: inline-flex;
  align-items: center;
  border: 1px solid rgb(var(--printer-post-category-rgb) / 0.6);
  border-radius: 20px;
  background: linear-gradient(145deg, rgb(var(--printer-post-category-rgb) / 0.08) 0%, rgb(var(--printer-post-category-rgb) / 0.04) 100%);
  padding: 5px 14px;
  line-height: 1.2;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition:
    background-color 0.2s var(--ease-enter),
    border-color 0.2s var(--ease-enter),
    color 0.2s var(--ease-enter),
    transform 0.2s var(--ease-enter),
    box-shadow 0.2s var(--ease-enter);
}

.post-meta-value a:hover {
  background: linear-gradient(145deg, rgb(var(--printer-post-category-rgb) / 0.15) 0%, rgb(var(--printer-post-category-rgb) / 0.08) 100%);
  border-color: rgb(var(--printer-post-category-rgb) / 0.8);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgb(var(--printer-post-category-rgb) / 0.15);
}

html.dark .post-meta-value a {
  border-color: rgb(var(--printer-post-category-rgb) / 0.7);
  background: rgb(var(--printer-post-category-rgb) / 0.08);
  color: var(--printer-post-category-color);
}

.post-title {
  margin: var(--space-1) 0 0;
  font-size: clamp(17px, 2.3vw, 20px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.post-title a {
  display: inline-block;
  transition: color 0.25s var(--ease-enter);
  position: relative;
}

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

html.dark .post-title a::after {
  background: linear-gradient(90deg, var(--accent), #c4a35a);
}

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

.post-title a:hover::after {
  width: 100%;
  background: var(--line);
  opacity: 1;
}

html.dark .post-title a:hover {
  color: #f0f6ff;
}

html.dark .post-title a:hover::after {
  background: linear-gradient(90deg, var(--accent), #c4a35a);
}

/* 首页文章摘要（灰色，次要内容） */
.post-excerpt {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* 中文排版优化 */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "palt" 0;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* 文章详情页正文（黑色，主要内容） */
.post-content {
  margin: var(--space-5) 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* 中文排版优化 */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "palt" 0;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* 文章详情页普通链接 */
.post-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
}

.post-content a:hover {
  text-decoration-color: var(--muted);
}

/* 中英文混排自动间距：在英文和数字前后添加微小间距 */
.post-excerpt :where(p, li, td, th, blockquote),
.post-content :where(p, li, td, th, blockquote) {
  /* 使用 text-spacing-trim 控制标点间距 */
  text-spacing-trim: space-all;
}

/* 针对英文单词、数字、代码的间距优化 */
.post-excerpt :where(p, li, td, th, blockquote) > *:is(code, em, strong, a),
.post-excerpt :where(p, li, td, th, blockquote)::before,
.post-excerpt :where(p, li, td, th, blockquote)::after,
.post-content :where(p, li, td, th, blockquote) > *:is(code, em, strong, a),
.post-content :where(p, li, td, th, blockquote)::before,
.post-content :where(p, li, td, th, blockquote)::after {
  text-spacing-trim: normal;
}

.post-excerpt blockquote,
.post-content blockquote {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--accent);
  background: var(--panel);
}

html.dark .post-excerpt blockquote,
html.dark .post-content blockquote {
  border-left-color: var(--accent);
  background: var(--panel);
}

.post-excerpt blockquote> :first-child,
.post-content blockquote> :first-child {
  margin-top: 0;
}

.post-excerpt blockquote> :last-child,
.post-content blockquote> :last-child {
  margin-bottom: 0;
}

.post-excerpt :not(pre)>code,
.post-content :not(pre)>code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid rgba(255, 107, 53, 0.28);
  background: rgba(255, 107, 53, 0.08);
  color: #a63f19;
}

html.dark .post-excerpt :not(pre)>code,
html.dark .post-content :not(pre)>code {
  border-color: rgba(255, 138, 109, 0.35);
  background: rgba(255, 138, 109, 0.12);
  color: #ffd2c6;
}

.post-excerpt pre,
.post-content pre {
  max-width: 100%;
  overflow: auto;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}

.post-excerpt pre code,
.post-content pre code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(32, 32, 32, 0.92);
}

html.dark .post-excerpt pre,
html.dark .post-content pre {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

html.dark .post-excerpt pre code,
html.dark .post-content pre code {
  color: rgba(214, 222, 234, 0.92);
}

.post-excerpt table,
.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 14px;
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.01);
}

.post-excerpt th,
.post-excerpt td,
.post-content th,
.post-content td {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.post-excerpt thead th,
.post-content thead th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 700;
}

.post-excerpt tbody tr:nth-child(even) td,
.post-content tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.018);
}

html.dark .post-excerpt table,
html.dark .post-content table {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

html.dark .post-excerpt th,
html.dark .post-excerpt td,
html.dark .post-content th,
html.dark .post-content td {
  border-color: rgba(255, 255, 255, 0.1);
}

html.dark .post-excerpt thead th,
html.dark .post-content thead th {
  background: rgba(255, 255, 255, 0.05);
}

html.dark .post-excerpt tbody tr:nth-child(even) td,
html.dark .post-content tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.post-excerpt iframe,
.post-excerpt video,
.post-excerpt embed,
.post-content iframe,
.post-content video,
.post-content embed {
  max-width: 100%;
}

.post-nav {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.post-nav-item {
  font-size: 13px;
  color: var(--muted);
}

.post-nav-label {
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-nav-link a {
  display: inline-block;
  max-width: 100%;
  color: inherit;
}

.post-nav-prev .post-nav-link a::before {
  content: "← ";
}

.post-nav-next .post-nav-link a::after {
  content: " →";
}

.post-nav-link a:hover {
  color: #e37d65;
}

/* ============================================
   页脚 - 垂直卡片式布局
   ============================================ */
.site-footer {
  margin-top: 48px;
  padding-bottom: 32px;
  position: relative;
}

/* 页脚卡片 */
.site-footer-card {
  background: linear-gradient(145deg, var(--panel) 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 24px rgba(40, 34, 25, 0.08);
  text-align: center;
}

/* 社交链接 */
.site-footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--panel) 0%, var(--panel-deep) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 4px 0 var(--line),
    0 6px 8px rgba(40, 34, 25, 0.15);
  transition:
    color 0.2s var(--ease-enter),
    transform 0.2s var(--ease-enter),
    box-shadow 0.2s var(--ease-enter);
  color: var(--muted);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 6px 0 #c4b8a0,
    0 8px 12px rgba(40, 34, 25, 0.2);
  color: #5a5448;
}

.social-link:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.1),
    0 2px 0 #c4b8a0,
    0 3px 5px rgba(40, 34, 25, 0.1);
}

.social-link:hover,
.social-link:focus,
.social-link:focus-visible,
.social-link:active,
.social-link:visited {
  border-radius: 50%;
}

/* 分隔装饰 */
.site-footer-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.divider-line {
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.divider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(149, 195, 148, 0.5);
}

/* 版权信息 */
.site-footer-copyright {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

/* 访问统计 */
.site-footer-stats {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

/* 技术标识 */
.site-footer-powered {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer-powered a {
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
  transition: color 0.2s ease;
}

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

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #f5f0e6 0%, #e0d6c4 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 4px 0 #c4b8a0,
    0 8px 16px rgba(40, 34, 25, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 防止溢出和优化动画 */
  overflow: hidden;
  will-change: transform, opacity, box-shadow;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s var(--ease-enter), visibility 0.3s var(--ease-enter), transform 0.3s var(--ease-enter), box-shadow 0.3s var(--ease-enter);
  z-index: 100;
}

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

.back-to-top svg {
  width: 24px;
  height: 24px;
  fill: #7a7265;
  transition: transform 0.2s ease;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 6px 0 #c4b8a0,
    0 10px 20px rgba(40, 34, 25, 0.25);
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.1),
    0 2px 0 #c4b8a0,
    0 4px 8px rgba(40, 34, 25, 0.15);
}

.not-found-hint {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.not-found-search {
  margin: 12px 0 20px;
}

.not-found-search-label {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.not-found-search-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.not-found-search-bar input[type="search"] {
  flex: 1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px 12px;
  font-size: 13px;
  color: inherit;
  outline: none;
}

.not-found-search-submit {
  width: 44px;
  border: 1px solid #d4cab8;
  border-radius: 8px;
  background: linear-gradient(to bottom, #eee5d8 0%, #e4dacc 100%);
  color: #2e2a24;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.not-found-search-submit svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

html.dark .not-found-search-bar input[type="search"] {
  background: linear-gradient(to bottom, #202022 0%, #1b1b1d 100%);
  border-color: #434447;
  color: #e8e8e9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(20, 40, 67, 0.18);
}

html.dark .not-found-search-submit {
  background: linear-gradient(to bottom, #323336 0%, #28282a 100%);
  border-color: #878b93;
  color: #f4f4f4;
}

html.dark .site-footer {
  border-top-color: rgba(140, 140, 145, 0.22);
}

/* 页脚卡片 - 暗黑模式 */
html.dark .site-footer-card {
  background: linear-gradient(145deg, #1a2940 0%, #131c2e 100%);
  border-color: #434447;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

/* 社交链接 - 暗黑模式 */
html.dark .social-link {
  background: linear-gradient(145deg, #3d3d40 0%, #2c2c2e 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    0 4px 0 #212123,
    0 6px 8px rgba(0, 0, 0, 0.3);
  color: #a3a6ab;
}

html.dark .social-link:hover {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    0 6px 0 #212123,
    0 8px 12px rgba(0, 0, 0, 0.4);
  color: #cacbce;
}

html.dark .social-link:active {
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.3),
    0 2px 0 #212123,
    0 3px 5px rgba(0, 0, 0, 0.2);
}

/* 分隔装饰 - 暗黑模式 */
html.dark .divider-line {
  background: linear-gradient(90deg, transparent, #434447, transparent);
}

html.dark .divider-dot {
  background: #7ab8a0;
  box-shadow: 0 0 8px rgba(122, 184, 160, 0.4);
}

/* 返回顶部按钮 - 暗黑模式 */
html.dark .back-to-top {
  background: linear-gradient(145deg, #3d3d40 0%, #2c2c2e 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    0 4px 0 #212123,
    0 8px 16px rgba(0, 0, 0, 0.35);
}

html.dark .back-to-top svg {
  fill: #a3a6ab;
}

html.dark .back-to-top:hover {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    0 6px 0 #212123,
    0 10px 20px rgba(0, 0, 0, 0.45);
}

html.dark .back-to-top:hover svg {
  fill: #cacbce;
}

html.dark .back-to-top:active {
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.3),
    0 2px 0 #212123,
    0 4px 8px rgba(0, 0, 0, 0.25);
}

.comments-area {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.comments-title {
  margin: 0 0 14px;
  font-size: 21px;
}

.comment-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.comment-item {
  border-top: 1px dashed var(--line);
  padding: 12px 0;
}

.comment-item:first-child {
  border-top: 0;
}

.comment-meta {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.comment-dot {
  margin: 0 6px;
}

.comment-content {
  font-size: 14px;
  line-height: 1.75;
  color: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 嵌套子评论：缩进 + 左侧引导线，体现对话层级 */
.comment-children {
  list-style: none;
  margin: 10px 0 0 20px;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
}

/* 首条子评论去掉顶部分隔线，避免与父评论底边重叠 */
.comment-children > .comment-item:first-child {
  border-top: 0;
  padding-top: 6px;
}

/* 博主回复高亮：微弱底色 + 「博主」徽章 */
.comment-by-author {
  background: rgba(149, 195, 148, 0.08);
  border-radius: var(--radius-sm);
  padding-left: 10px;
  padding-right: 10px;
}

.comment-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--accent);
  background: rgba(149, 195, 148, 0.15);
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

/* 深色模式下博主高亮适配 */
html.dark .comment-by-author {
  background: rgba(47, 220, 123, 0.06);
}

html.dark .comment-badge {
  color: var(--accent);
  background: rgba(47, 220, 123, 0.12);
}

.respond-title {
  margin: 18px 0 10px;
  font-size: 18px;
}

.respond-group {
  margin-bottom: 12px;
}

.respond-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

html.dark .respond-label {
  color: var(--muted);
}

.respond-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

#comment-form input,
#comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 9px 10px;
  font-size: 13px;
  color: #3f3a33;
  outline: none;
  transition: border-color 0.2s ease;
}

#comment-form input:focus,
#comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(149, 195, 148, 0.2);
}

html.dark #comment-form input:focus,
html.dark #comment-form textarea:focus {
  border-color: #878b93;
  box-shadow: 0 0 0 3px rgba(120, 125, 135, 0.2);
}

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

#comment-form button {
  margin-top: 6px;
  border: 1px solid #d4cab8;
  border-radius: 6px;
  background: linear-gradient(to bottom, #eee5d8 0%, #e4dacc 100%);
  color: #2e2a24;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

#comment-form button:hover {
  background: linear-gradient(to bottom, #e4dacc 0%, #d8cdba 100%);
  border-color: #c7beac;
}

.respond-login,
.respond-closed {
  font-size: 13px;
  color: #6a6358;
}

.page-navigator {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-navigator li {
  display: inline-flex;
}

.page-navigator a,
.page-navigator span {
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #dfd7ca;
  background: #f7f3ea;
  color: #6a6358;
}

.page-navigator .current a {
  background: #e9dfcf;
  border-color: #d4c8b6;
  color: #3f3a33;
}

article .post-excerpt a[href^="http"],
article .post-content a[href^="http"] {
  color: var(--printer-external-link-color);
}

article .post-excerpt p,
article .post-content p {
  margin: 0 0 1em;
}

article .post-excerpt img,
article .post-content img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   中文排版优化：中英文混排自动间距
   ============================================
   在中文和英文/数字之间自动添加微小间距
   使用渐进增强策略：基础样式 + 高级特性
*/

/* 基础排版优化 - 所有浏览器支持 */
.paper,
.post-excerpt,
.post-content,
.comment-content {
  /* 启用 East Asian 字体特性 */
  font-variant-east-asian: proportional-width;
}

/* 渐进增强：自动处理中西文间距（Chrome 121+ 支持） */
@supports (text-autospace: ideograph-alpha) {
  .paper,
  .post-excerpt,
  .post-content,
  .comment-content {
    text-autospace: ideograph-alpha ideograph-numeric;
  }
}

/* 回退方案：为所有浏览器提供基础间距 */
.paper :where(p, li, td, th) > *:is(code, em, strong, a),
.post-excerpt :where(p, li, td, th) > *:is(code, em, strong, a),
.comment-content :where(p, li, td, th) > *:is(code, em, strong, a) {
  margin: 0 0.05em;
}

/* 行内代码块前后间距 */
.paper :not(pre) > code,
.post-excerpt :not(pre) > code,
.comment-content :not(pre) > code {
  margin: 0 0.15em;
}

/* 标点符号优化 */
.paper,
.post-excerpt {
  /* 标点挤压 */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "palt" 0, "pwid" 0;
}

/* 渐进增强：行首行尾标点处理（Safari 支持较好） */
@supports (hanging-punctuation: allow-end) {
  .paper,
  .post-excerpt {
    hanging-punctuation: allow-end last;
  }
}

@media (max-width: 920px) {
  :root {
    --paper-padding-x: 32px;
  }

  .printer-paper-wrap {
    width: 100%;
  }

  .paper {
    padding: 26px var(--paper-padding-x) 40px;
  }

  .paper-title {
    font-size: 30px;
  }

  .paper>h2.paper-title {
    font-size: 20px;
  }

  .post-title {
    font-size: 20px;
  }
}

/* ============================================
   移动端适配优化 (Mobile-First Adaptation)
   ============================================ */

/* 小屏手机优化 (375px以下) */
@media (max-width: 375px) {
  .site-wrap {
    margin-top: 16px;
    padding: 0 8px;
  }

  .printer-top {
    padding: 14px 12px 12px;
    border-radius: 20px 20px 10px 10px;
  }

  .brand-mark,
  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-logo img {
    width: 32px;
    height: 32px;
  }

  .brand-text h1 {
    font-size: 16px;
    letter-spacing: 0.2em;
  }

  .brand-text p {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  /* 隐藏电源指示器节省空间 */
  .power {
    display: none;
  }

  .menu {
    gap: 8px;
  }

  .menu a {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 8px;
  }

  .ctrls {
    gap: 8px;
  }

  .header-search-btn,
  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .header-search-btn::before {
    width: 32px;
    height: 32px;
  }

  .theme-toggle::before {
    width: 32px;
    height: 32px;
  }

  .lang {
    font-size: 11px;
  }

  .lang span {
    padding: 5px 10px;
  }
}

/* 标准移动端 (376px - 767px) */
@media (min-width: 376px) and (max-width: 767px) {
  .site-wrap {
    margin-top: 20px;
    padding: 0 12px;
  }

  .printer-top {
    padding: 16px 16px 12px;
    border-radius: 24px 24px 12px 12px;
  }

  .brand-mark,
  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-logo img {
    width: 36px;
    height: 36px;
  }

  .brand-text h1 {
    font-size: 18px;
    letter-spacing: 0.24em;
  }

  .power {
    transform: scale(0.9);
  }

  .menu {
    gap: 10px;
  }

  .menu a {
    padding: 10px 16px;
    font-size: 13px;
  }

  .ctrls {
    gap: 10px;
  }

  .header-search-btn,
  .theme-toggle {
    width: 42px;
    height: 42px;
  }
}

/* 通用移动端样式 (767px以下) */
@media (max-width: 767px) {
  /* 暗黑模式移动端优化 */
  html.dark .brand-mark,
  html.dark .brand-logo {
    background: radial-gradient(circle at 35% 35%, #3d3d40 0, #2a2a2c 55%, #222224 100%);
    box-shadow:
      0 12px 22px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  html.dark .menu {
    border-bottom-color: rgba(140, 140, 145, 0.22);
  }

  html.dark .menu a {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 0 0 1px rgba(20, 40, 67, 0.18),
      0 14px 24px rgba(0, 0, 0, 0.45);
  }

  html.dark .theme-toggle {
    box-shadow:
      inset -2px -3px 6px rgba(0, 0, 0, 0.45),
      0 14px 24px rgba(0, 0, 0, 0.5);
  }

  .top-row {
    align-items: center;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark::before {
    width: 36px;
    height: 36px;
  }

  .brand-mark::after {
    width: 12px;
    height: 12px;
  }

  /* 菜单和控制按钮垂直堆叠 */
  .menu-row {
    margin-top: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .menu {
    justify-content: center;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(180, 167, 146, 0.35);
  }

  .menu a {
    border-radius: 10px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.7),
      0 5px 0 rgba(180, 167, 146, 0.25),
      0 8px 16px rgba(40, 34, 25, 0.08);
  }

  .menu a.current {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.65),
      0 3px 0 rgba(180, 167, 146, 0.18),
      0 8px 16px rgba(40, 34, 25, 0.06);
  }

  /* 点击效果优化 */
  .menu a:active {
    transform: translateY(3px);
    box-shadow:
      inset 0 2px 4px rgba(0, 0, 0, 0.1),
      0 2px 0 rgba(180, 167, 146, 0.2);
  }

  .ctrls {
    width: 100%;
    justify-content: center;
    gap: 16px;
  }

  /* 搜索框移动端优化 */
  .header-search {
    flex: 1;
    max-width: 200px;
  }

  .header-search.open input[type="search"] {
    width: 100%;
    max-width: 160px;
    padding: 10px 14px;
    font-size: 16px; /* 防止iOS缩放 */
  }

  .header-search-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    /* 确保移动端也有溢出隐藏 */
    overflow: hidden;
  }

  .header-search-btn::before {
    width: 36px;
    height: 36px;
  }

  /* 主题切换按钮优化 */
  .theme-toggle {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .theme-toggle::before {
    width: 36px;
    height: 36px;
  }

  .theme-toggle::after {
    width: 3px;
    height: 10px;
    top: 7px;
    transform-origin: center 14px;
  }

  /* 语言切换器优化 */
  .lang {
    font-size: 12px;
  }

  .lang span {
    padding: 6px 12px;
  }

  /* 纸张区域优化 */
  :root {
    --paper-padding-x: 24px;
  }

  .printer-paper-wrap {
    width: calc(100% - 16px);
  }

  .paper {
    padding: 24px var(--paper-padding-x) 32px;
  }

  .paper-title {
    font-size: 24px;
    line-height: 1.2;
  }

  .paper > h2.paper-title {
    font-size: 18px;
  }

  .paper-subtitle {
    font-size: 13px;
    margin-bottom: 16px;
  }

  /* 文章列表优化 */
  .post-item {
    padding: 20px 0;
    margin: 0;
  }

  .post-date {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .post-title {
    font-size: 17px;
    line-height: 1.4;
  }

  .post-excerpt {
    font-size: 14px;
    line-height: 1.7;
    margin-top: 8px;
  }

  /* 元信息区域优化 */
  .paper-meta {
    padding: 12px 0 10px;
    margin-bottom: 20px;
  }

  .meta-label {
    font-size: 11px;
  }

  .meta-tags {
    gap: 6px;
  }

  .meta-tags a,
  .meta-tags span {
    font-size: 11px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 分页导航优化 */
  .page-navigator {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
  }

  .page-navigator a,
  .page-navigator span {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
  }

  /* 评论区域优化 */
  .comments-area {
    margin-top: 24px;
    padding-top: 16px;
  }

  .comments-title {
    font-size: 18px;
  }

  .comment-item {
    padding: 16px 0;
  }

  .comment-meta {
    font-size: 11px;
  }

  .comment-content {
    font-size: 14px;
    line-height: 1.7;
  }

  /* 移动端：减小嵌套缩进，避免多层回复溢出窄屏 */
  .comment-children {
    margin-left: 12px;
    padding-left: 10px;
  }

  /* 评论表单优化 */
  .respond-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #comment-form input,
  #comment-form textarea {
    padding: 12px 14px;
    font-size: 16px; /* 防止iOS缩放 */
  }

  #comment-form button {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
  }

  /* 页脚优化 - 移动端 */
  .site-footer {
    margin-top: 32px;
    padding-bottom: 24px;
  }

  .site-footer-card {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }

  .site-footer-social {
    gap: 12px;
    margin-bottom: 20px;
  }

  .social-link {
    width: 44px;
    height: 44px;
  }

  .social-link svg {
    width: 20px;
    height: 20px;
  }

  .site-footer-divider {
    margin-bottom: 20px;
  }

  .divider-line {
    max-width: 60px;
  }

  .site-footer-copyright {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .site-footer-stats {
    font-size: 11px;
    margin-bottom: 12px;
  }

  .site-footer-powered {
    font-size: 10px;
  }

  /* 返回顶部按钮 - 移动端 */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    /* 确保移动端也有溢出隐藏 */
    overflow: hidden;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }

  /* 阅读进度条优化 */
  #reading-progress {
    height: 4px;
  }

  /* 触摸反馈优化 */
  .menu a,
  .header-search-btn,
  .theme-toggle,
  .page-navigator a,
  #comment-form button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* 禁用悬停效果（触摸设备） */
  .menu a:hover,
  .header-search-btn:hover,
  .theme-toggle:hover,
  .post-title a:hover {
    transform: none;
  }

  /* 启用active状态 */
  .menu a:active,
  .header-search-btn:active,
  .theme-toggle:active {
    transform: translateY(2px);
  }
}

/* ============================================
   横屏移动端优化 (Landscape)
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
  .site-wrap {
    margin-top: 16px;
  }

  .printer-top {
    padding: 14px 20px 12px;
  }

  /* 横屏时菜单和控制按钮水平排列 */
  .menu-row {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .menu {
    flex: 1;
    justify-content: flex-start;
    border-bottom: none;
    padding-bottom: 0;
  }

  .ctrls {
    width: auto;
    justify-content: flex-end;
  }

  /* 减小Logo尺寸 */
  .brand-mark,
  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-logo img {
    width: 32px;
    height: 32px;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  /* 隐藏电源指示器节省空间 */
  .power {
    display: none;
  }
}

/* ============================================
   平板适配 (768px - 1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .site-wrap {
    margin-top: 36px;
    padding: 0 20px;
  }

  .printer-top {
    padding: 20px 24px 16px;
  }

  .printer-paper-wrap {
    width: calc(100% - 20px);
  }

  .paper {
    padding: 28px var(--paper-padding-x) 40px;
  }

  .menu a {
    padding: 11px 20px;
    font-size: 14px;
  }

  .post-title {
    font-size: 19px;
  }

  /* 平板横屏优化 */
  @media (orientation: landscape) {
    .menu-row {
      gap: 20px;
    }

    .ctrls {
      gap: 14px;
    }
  }
}

/* ============================================
   触摸设备通用优化
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* 所有触摸设备禁用悬停效果 */
  .paper:hover,
  .menu a:hover,
  .header-search-btn:hover,
  .theme-toggle:hover,
  .post-title a:hover,
  .meta-tags a:hover,
  .page-navigator a:hover {
    transform: none;
    box-shadow: none;
  }

  /* 恢复默认阴影 */
  .printer-top {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      0 20px 40px rgba(40, 34, 25, 0.12),
      0 8px 16px rgba(40, 34, 25, 0.08);
  }

  .menu a {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      0 6px 0 #c9bfa8,
      0 8px 8px rgba(40, 34, 25, 0.15),
      0 12px 16px rgba(40, 34, 25, 0.1);
  }

  .header-search-btn,
  .theme-toggle {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.7),
      0 5px 0 #c4b8a0,
      0 6px 8px rgba(40, 34, 25, 0.2),
      0 10px 16px rgba(40, 34, 25, 0.12);
    /* 确保触摸设备上也有溢出隐藏 */
    overflow: hidden;
  }

  /* 优化触摸反馈 */
  .menu a:active,
  .header-search-btn:active,
  .theme-toggle:active,
  .page-navigator a:active {
    transform: translateY(3px) scale(0.98);
    transition-duration: 100ms;
  }

  /* 禁用悬停效果时保持基础样式 */
  .theme-toggle:hover {
    transform: none;
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.7),
      0 5px 0 #c4b8a0,
      0 6px 8px rgba(40, 34, 25, 0.2),
      0 10px 16px rgba(40, 34, 25, 0.12);
  }

  /* 增大触摸目标 */
  .menu a,
  .header-search-btn,
  .theme-toggle,
  .page-navigator a,
  .meta-tags a {
    min-height: 44px;
    min-width: 44px;
  }

  /* 防止触摸时的文字选择 */
  .menu a,
  .header-search-btn,
  .theme-toggle {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ============================================
   减少动画偏好支持
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .power-dot {
    animation: none;
    box-shadow: 0 0 8px rgba(134, 188, 142, 0.6);
  }

  html.dark .power-dot {
    box-shadow: 0 0 8px rgba(255, 77, 79, 0.6);
  }
}

/* ============================================
   空状态和加载状态
   ============================================ */

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--panel) 25%,
    var(--paper) 50%,
    var(--panel) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 var(--space-2);
}

.empty-state-desc {
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* 访问统计加载状态 */
.stats-loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
}

.stats-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   阅读进度条
   ============================================ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* ============================================
   暗黑模式呼吸灯动画覆盖
   ============================================ */
html.dark .power-dot {
  animation: power-pulse-dark 2.4s ease-in-out infinite;
}

/* ============================================
   无障碍：链接和按钮键盘焦点可见性
   ============================================
   使用 :focus 作为回退，:focus-visible 作为渐进增强
   确保在不支持 focus-visible 的浏览器中也能看到焦点
*/

/* 基础焦点样式 - 所有浏览器支持 */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 为大多数元素添加圆角焦点轮廓 */
a:focus:not(.theme-toggle):not(.header-search-btn):not(.social-link),
button:focus:not(.theme-toggle):not(.header-search-btn):not(.social-link),
input:focus,
textarea:focus,
select:focus {
  border-radius: var(--radius-sm);
}

/* 圆形按钮焦点样式统一交给下方 :focus-visible 规则
   此处不再为 :focus（含鼠标点击）单独设 outline，避免浏览器对 outline
   不跟随 border-radius 而画出突兀的方框。鼠标点击时的 outline 由
   下方 :focus:not(:focus-visible) { outline: none } 清除。 */

/* 现代浏览器使用 focus-visible（仅在键盘导航时显示） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  transition: outline-offset 150ms var(--ease-enter);
}

/* 为大多数元素添加圆角焦点轮廓 */
a:focus-visible:not(.theme-toggle):not(.header-search-btn):not(.back-to-top):not(.social-link),
button:focus-visible:not(.theme-toggle):not(.header-search-btn):not(.back-to-top):not(.social-link),
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-radius: var(--radius-sm);
}

/* 圆形按钮保持圆形焦点轮廓 */
.theme-toggle:focus-visible,
.header-search-btn:focus-visible,
.back-to-top:focus-visible,
.social-link:focus-visible {
  border-radius: 50%;
  outline-offset: 2px;
}

/* 鼠标点击时不显示焦点轮廓（现代浏览器） */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* 按钮焦点增强 */
button:focus-visible:not(.theme-toggle):not(.header-search-btn):not(.back-to-top),
.menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(149, 195, 148, 0.3);
}

/* 圆形按钮焦点增强 - 保持圆形轮廓 */
.theme-toggle:focus-visible,
.header-search-btn:focus-visible,
.back-to-top:focus-visible,
.social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(149, 195, 148, 0.3);
  border-radius: 50%;
}

/* 支持 OKLCH 的浏览器使用更精确的焦点阴影 */
@supports (color: oklch(0% 0 0)) {
  button:focus-visible,
  .menu a:focus-visible,
  .header-search-btn:focus-visible,
  .theme-toggle:focus-visible,
  .back-to-top:focus-visible,
  .social-link:focus-visible {
    box-shadow: 0 0 0 4px oklch(75% 0.12 145 / 0.3);
  }
}

/* ============================================
   进纸过渡：由 js/printer-nav.js 统一驱动
   整页 View Transition 已关闭，避免与打印口动画冲突
   ============================================ */
