@charset "UTF-8";
/* ==========================================================================
   ComBox — 一个简洁的 Typecho 博客主题
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 字体声明（全部本地 woff2，无外部依赖）
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Ali PuHuiTi";
  src: url("../fonts/AliPuHuiTi_Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ioskeley Mono";
  src: url("../fonts/IoskeleyMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ioskeley Mono";
  src: url("../fonts/IoskeleyMono-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Ioskeley Mono";
  src: url("../fonts/IoskeleyMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ioskeley Mono";
  src: url("../fonts/IoskeleyMono-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. 设计令牌 · Light 配色
   -------------------------------------------------------------------------- */
:root {
  /* 静态令牌 */
  --font-sans: "Ali PuHuiTi", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "Ioskeley Mono", "Ali PuHuiTi", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --page-max: 1080px;
  --page-pad: 20px;
  --rail-w: 60px;
  --rail-gap: 40px;
  --content-w: 940px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Light */
  --background: #faf8f8;
  --foreground: #0c0a09;
  --card: #ffffff;
  --secondary: #f0efed;
  --panel: #f0efed;
  --content: #3f3d3a;
  --muted-foreground: #777169;
  --border: #e7e5e4;
  --hairline-strong: #d6d3d1;
  --primary: #292524;
  --primary-hover: #0c0a09;
  --primary-label: #ffffff;
  --link-wave: #777169;
  --link-underline: #c5c3bf;
  /* 正文链接 hover 波浪线：默认宽度 0（不可见），hover 展开到 18px 宽 */
  --wave-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 T20 3' fill='none' stroke='%23a8a29e' stroke-width='2'/%3E%3C/svg%3E");
  --sparkle: #a8a29e;
  --code-bg: #fbf1c7;
  --code-text: #504945;
  --inline-code-bg: #f0efed;
  --inline-code-border: #e7e5e4;
  --inline-code-text: #504945;
  --tooltip-bg: #151917;
  --shadow-sm: 0 2px 8px rgb(12 10 9 / 0.04);
  --shadow-md: 0 4px 16px rgb(12 10 9 / 0.06);
  --shadow-lg: 0 8px 32px rgb(12 10 9 / 0.08);
  --shadow-xl: 0 16px 48px rgb(12 10 9 / 0.1);

  /* 主题补充令牌（由设计稿推导） */
  --brand: #d00;
  --link: #777169;
  --float-bg: #151917;
  --float-fg: #ffffff;
  --input-bg: #ffffff;
  --mask: rgb(12 10 9 / 0.34);
  color-scheme: light;
}

/* Dark — 跟随系统（无 JS / 脚本执行前，prefers-color-scheme 媒体查询自动适配） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --background: #181514;
    --foreground: #f5f5f4;
    --card: #231d18;
    --secondary: #292524;
    --panel: #171412;
    --content: #d6d3d1;
    --muted-foreground: #a8a29e;
    --border: #2a2624;
    --hairline-strong: #44403c;
    --primary: #f5f5f4;
    --primary-hover: #ffffff;
    --primary-label: #181514;
    --link-wave: #a88f6f;
    --sparkle: #f3eee7;
    --code-bg: #171412;
    --code-text: #d5c4a1;
    --inline-code-bg: #3b2e19;
    --inline-code-border: #55411f;
    --inline-code-text: #f0d9a5;
    --tooltip-bg: #151917;
    --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 16px 48px rgb(0 0 0 / 0.6);

    --brand: #ff4136;
    --link: #a88f6f;
    --float-bg: #f5f5f4;
    --float-fg: #181514;
    --input-bg: #1a1614;
    --mask: rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

/* Dark — 用户显式切换（localStorage 持久化） */
[data-theme="dark"] {
  --background: #181514;
  --foreground: #f5f5f4;
  --card: #231d18;
  --secondary: #292524;
  --panel: #171412;
  --content: #d6d3d1;
  --muted-foreground: #a8a29e;
  --border: #2a2624;
  --hairline-strong: #44403c;
  --primary: #f5f5f4;
  --primary-hover: #ffffff;
  --primary-label: #181514;
  --link-wave: #a88f6f;
  --link-underline: #44403c;
  --sparkle: #f3eee7;
  --code-bg: #171412;
  --code-text: #d5c4a1;
  --inline-code-bg: #3b2e19;
  --inline-code-border: #55411f;
  --inline-code-text: #f0d9a5;
  --tooltip-bg: #151917;
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 16px 48px rgb(0 0 0 / 0.6);

  --brand: #ff4136;
  --link: #a88f6f;
  --float-bg: #f5f5f4;
  --float-fg: #181514;
  --input-bg: #1a1614;
  --mask: rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.no-transition,
html.no-transition *,
html.no-transition *::before,
html.no-transition *::after {
  transition: none !important;
}

body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
table {
  border-collapse: collapse;
  width: 100%;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
}
:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection {
  background: var(--sparkle);
  color: var(--background);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   4. 通用工具类
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hairline {
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   5. 页面骨架：A 区（侧栏） + B 区（顶栏） + C 区（主体）
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* C 区：内容列 */
.shell__main {
  min-width: 0;
  padding-bottom: 40px;
}

@media (min-width: 901px) {
  .shell {
    padding-left: calc(var(--page-pad) + var(--rail-w) + var(--rail-gap));
  }
}

/* --- A 区：左侧固定工具栏 ------------------------------------------------ */
.rail {
  position: fixed;
  top: 0;
  left: max(var(--page-pad), calc(50% - var(--page-max) / 2 + var(--page-pad)));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: var(--rail-w);
  height: 100vh;
  padding: 80px 0 40px;
  pointer-events: none;
}
.rail > * {
  pointer-events: auto;
}
.rail__logo {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: transform 0.3s var(--ease);
}
.rail__logo:hover {
  transform: scale(1.08) rotate(-4deg);
}
.rail__logo img,
.rail__logo svg {
  width: 100%;
  height: 100%;
}
.rail__dock {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* 圆形/圆角方块按钮 */
.dock-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--foreground);
  background: var(--secondary);
  border-radius: 14px;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.dock-btn .icon {
  width: 21px;
  height: 21px;
}
.dock-btn:hover {
  background: var(--primary);
  color: var(--primary-label);
  transform: translateY(-2px);
}
.dock-btn__tip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translate(-6px, -50%);
  padding: 4px 9px;
  color: #fff;
  background: var(--tooltip-bg);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.dock-btn:hover .dock-btn__tip {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

/* 移动端：底部胶囊吸附条 */
.rail-mobile {
  display: none;
}

/* --- B 区：顶部工具栏 ---------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 70px;
  padding-top: 5px;
}
.site-header__actions {
  display: flex;
  align-items: center;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--muted-foreground);
  border-radius: 10px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn .icon {
  width: 23px;
  height: 23px;
}
.icon-btn:hover {
  color: var(--foreground);
  background: var(--secondary);
}
/* 浅色模式显示「月亮」（切到深色），深色模式显示「太阳」 */
.icon-btn__sun {
  display: none;
}
[data-theme="dark"] .icon-btn__sun {
  display: block;
}
[data-theme="dark"] .icon-btn__moon {
  display: none;
}
.site-header__actions .icon-btn:last-child {
  margin-right: -10px;
}

/* --------------------------------------------------------------------------
   6. 文章卡片（首页 / 分类页列表）
   -------------------------------------------------------------------------- */
.post-list {
  display: flex;
  flex-direction: column;
}
.page-head + .post-list {
  margin-top: 21px;
}
.post-card {
  position: relative;
  padding: 30px 0 28px;
}
.post-card:first-child {
  padding-top: 13px;
}
.post-card + .post-card {
  border-top: 1px solid var(--border);
}
.post-card__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.4;
}
.post-card__cat {
  transition: color 0.2s var(--ease);
}
.post-card__cat:hover {
  color: var(--foreground);
}
.post-card__sep {
  color: var(--border);
}
/* 「分类 · 日期」行：使用 baseline 对齐，确保分类名与日期在同一基线上。
   不再依赖 top 偏移做光学校正（不同设备字体渲染差异会导致错位）。 */
.post-card__date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.post-card__pin {
  margin-left: auto;
  padding: 2px 5px;
  color: #fff;
  background: var(--muted-foreground);
  font-size: 13px;
  line-height: 16px;
  border-radius: 6px;
}
.post-card__title {
  margin-bottom: 10px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-card__title a {
  transition: color 0.2s var(--ease);
}
.post-card__title a:hover {
  color: var(--link);
}
.post-card__excerpt {
  margin-bottom: 16px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 21px;
}
.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 26px;
}
.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 12px;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}
/* # 前缀由伪元素绘制（flex 子项，与文字之间沿用上面的 gap: 3px），
   字号 / 颜色继承 .tag-pill，与原先 <span>#</span> 渲染完全一致 */
.tag-pill::before {
  content: "#";
}
.tag-pill:hover {
  color: var(--foreground);
  border-color: var(--hairline-strong);
  background: var(--secondary);
}
.post-card__stats {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat .icon {
  width: 15px;
  height: 15px;
}
.stat__num {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   7. 分页
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 36px 0 40px;
}
.page-btn {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  color: var(--foreground);
  background: var(--secondary);
  border-radius: 12px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.page-btn .icon {
  width: 17px;
  height: 17px;
}
.page-btn:hover {
  background: var(--border);
  transform: translateY(-1px);
}
.page-btn.is-current {
  color: var(--primary-label);
  background: var(--primary);
  font-weight: 600;
}
.page-btn.is-current:hover {
  background: var(--primary-hover);
  transform: none;
}
.page-ellipsis {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 40px;
  color: var(--muted-foreground);
  font-size: 14px;
  letter-spacing: 0.1em;
  user-select: none;
}

/* --------------------------------------------------------------------------
   8. 页面 / 文章头部
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}
.breadcrumb a {
  transition: color 0.2s var(--ease);
}
.breadcrumb a:hover {
  color: var(--foreground);
}
.breadcrumb__sep {
  color: var(--hairline-strong);
}

.page-head {
  padding-top: 14px;
}
.page-head > .page-head__title {
  margin-top: 23px;
}
.page-head__title {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.page-head__title--sm {
  font-size: 20px;
}
.page-head__sub {
  display: flex;
  align-items: baseline;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.page-head__count {
  color: var(--muted-foreground);
  font-size: 14px;
}
/* 文章详情页大标题 */
.article__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 6px;
  padding-bottom: 26px;
  color: var(--muted-foreground);
  font-size: 13px;
}
.article-meta__date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   9. 正文排版（C 区内容）
   -------------------------------------------------------------------------- */
.entry--page {
  margin-top: 24px;
}
.entry {
  color: var(--content);
  font-size: 18px;
  line-height: 1.8;
  overflow-wrap: break-word;
}
.entry iframe {
  border-radius: var(--radius-md);
}
.entry > * + * {
  margin-top: 26px;
}
.entry > * + h2,
.entry > * + h3,
.entry > * + h4,
.entry > * + h5,
.entry > * + h6 {
  margin-top: 26px;
}
.entry h2,
.entry h3,
.entry h4,
.entry h5,
.entry h6 {
  color: var(--content);
  font-weight: 600;
  line-height: 1.45;
  scroll-margin-top: 90px;
}
.entry h2 {
  font-size: 30px;
}
.entry h3 {
  font-size: 28px;
}
.entry h4 {
  font-size: 24px;
}
.entry h5 {
  font-size: 20px;
}
.entry h6 {
  font-size: 18px;
}
/* 正文内链接：字色继承正文，默认淡色点线；hover 时点线消失，
   换成从左侧"画"出来的 SVG 波浪线（background-size 0 → 18px）。
   排除 .tag-pill，避免样式泄漏到标签胶囊（标签样式由 .tag-pill 统一负责） */
.entry a:not(.tag-pill) {
  position: relative;
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  padding-bottom: 4px;
  background-image: var(--wave-line);
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 0 6px;
  transition: background-size 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    color 0.2s var(--ease);
}
.entry a:not(.tag-pill):hover {
  text-decoration: none;
  background-size: 18px 6px;
  color: var(--link-wave);
}
@media (prefers-reduced-motion: reduce) {
  .entry a:not(.tag-pill) {
    transition: none;
  }
}
.entry strong,
.entry b {
  color: var(--foreground);
  font-weight: 600;
}
.entry ul,
.entry ol {
  padding-left: 26px;
}
.entry ul li,
.entry ol li {
  margin-top: 8px;
}
.entry ul {
  list-style: none;
}
.entry ul > li {
  position: relative;
}
.entry ul > li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 13px;
  width: 5px;
  height: 5px;
  background: var(--sparkle);
  border-radius: 50%;
}
.entry ol {
  list-style: decimal;
}
.entry ol > li::marker {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.entry blockquote {
  padding: 4px 0 4px 20px;
  color: var(--muted-foreground);
  border-left: 2px solid var(--hairline-strong);
}
/* 正文图片：仅圆角 */
.entry img {
  border-radius: var(--radius-md);
  max-width: 100%;
}
.entry figure {
  margin-top: 26px;
}
.entry figure img {
  border-radius: var(--radius-md);
  max-width: 100%;
}
.entry figcaption {
  margin-top: 10px;
  color: var(--muted-foreground);
  font-size: 13px;
  text-align: center;
}
.entry code {
  padding: 2px 6px;
  color: var(--inline-code-text);
  background: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  word-break: break-word;
}
.entry pre {
  position: relative; /* 代码窗口栏（.code-window-bar）的定位基准 */
  padding: 18px 20px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.7;
}
.entry pre code {
  padding: 0;
  color: var(--code-text);
  background: none;
  border: 0;
  font-size: 17px;
}
/* ===== 代码窗口栏（macOS 风格：红黄绿圆点 + 语言名 + 复制按钮）=====
   外层 .code-window 负责定位与圆角裁剪，内层 pre 只负责横向滚动，
   因此标题栏不会随代码左右滚动而移出视野 */
.code-window {
  position: relative;
  margin: 1.4em 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-window > pre {
  margin: 0;
  padding-top: 50px; /* 为标题栏留出空间（标题栏约 47px） */
}
.code-window-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--code-bg) 80%, var(--border));
  border-bottom: 1px solid var(--border);
}
.code-window-dots {
  display: inline-flex;
  gap: 7px;
}
.code-window-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.code-window-dots .r { background: #ff5f57; }
.code-window-dots .y { background: #febc2e; }
.code-window-dots .g { background: #28c840; }
.code-window-lang {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-foreground);
  margin-left: 6px;
  letter-spacing: 0.02em;
}
.code-copy-btn {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.code-copy-btn:hover {
  color: var(--content);
  border-color: var(--hairline-strong);
  background: var(--secondary);
}
.code-copy-btn.copied {
  color: #28c840;
  border-color: #28c840;
}
.entry table {
  font-size: 18px;
}
.entry th,
.entry td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.entry th {
  color: var(--foreground);
  background: var(--secondary);
  font-weight: 600;
  min-width: 100px;
}
.entry hr {
  margin: 34px 0;
}

/* 引用卡片（来源 / 版权信息） */
.cite-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 32px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  text-align: left;
}
.cite-card__avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
}
.cite-card__body {
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.cite-card__title {
  color: var(--content);
}
.cite-card__link {
  margin: 5px 0;
  font-family: var(--font-mono);
  font-size: 14px;
}
.cite-card__link a {
  word-break: break-all;
}
/* 复制按钮跟随网址内联排布（窄屏网址换行后按钮仍紧贴其后） */
.cite-card__link .copy-btn {
  display: inline-grid;
  vertical-align: -3px;
  margin-left: 0;
}
/* 引用卡片内的链接与正文链接样式解耦（同在 .entry 内会被继承，须显式重置）。
   设计稿中卡片内链接为 muted 灰、无下划线，hover 才浮出下划线 */
.entry .cite-card__link a,
.entry .cite-card__note a {
  color: var(--muted-foreground);
  text-decoration: none;
  text-underline-offset: 0;
  padding-bottom: 0;
  background-image: none;
  transition: color 0.2s var(--ease);
}
.entry .cite-card__link a:hover,
.entry .cite-card__note a:hover {
  color: var(--content);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted-foreground) 45%, transparent);
  text-underline-offset: 3px;
}
.cite-card__note {
  color: var(--muted-foreground);
  font-size: 12.5px;
}

/* 复制按钮 */
.copy-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted-foreground);
  border-radius: 6px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.copy-btn .icon {
  width: 15px;
  height: 15px;
}
.copy-btn:hover {
  color: var(--foreground);
  background: var(--secondary);
}
.copy-btn.is-done {
  color: var(--link);
}

/* 正文底部标签区 */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

/* 上下篇导航 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 30px;
}
.post-nav__item {
  padding: 16px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.post-nav__item:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.post-nav__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}
.post-nav__label .icon {
  width: 14px;
  height: 14px;
}
.post-nav__title {
  margin-top: 6px;
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav__item--next {
  text-align: right;
}
.post-nav__item--next .post-nav__label {
  justify-content: flex-end;
}
.post-nav__item.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

/* 点赞 & 分享 */
.engage-bar {
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.engage-bar__inner {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.engage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.engage-btn:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}
.engage-btn .icon {
  width: 16px;
  height: 16px;
}
.engage-btn--like.is-active,
.engage-btn--like:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.engage-btn--like.is-active .icon {
  fill: var(--brand);
}
.engage-btn--share.is-active {
  color: var(--content);
  border-color: var(--content);
}
.engage-btn__num {
  font-variant-numeric: tabular-nums;
  min-width: 1em;
}
.engage-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
/* 分享面板 */
.share-panel {
  margin-top: 16px;
  padding: 20px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.share-panel[hidden] {
  display: none;
}
.share-panel__tip {
  margin-bottom: 12px;
  color: var(--muted-foreground);
  font-size: 13px;
}
.share-panel__qr {
  display: inline-block;
  padding: 14px;
  background: #fff;
  border-radius: 8px;
}
.share-panel__qr img {
  display: block;
}
.share-panel__links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
}
.share-panel__links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--foreground);
  font-size: 13px;
  background: var(--secondary);
  transition: background 0.15s var(--ease);
}
.share-panel__links a:hover {
  background: var(--content);
  color: var(--primary-label);
}

/* --------------------------------------------------------------------------
   10. 归档页
   -------------------------------------------------------------------------- */
.archive-stats {
  padding: 14px 0 34px;
}
.archive-stats__label {
  display: block;
  margin-top: 36px;
  margin-bottom: 3px;
  color: var(--foreground);
  font-size: 13.5px;
}
.archive-stats__row {
  display: flex;
  align-items: baseline;
  gap: 17px;
}
.archive-stats__num {
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}
.archive-stats__note {
  color: var(--muted-foreground);
  font-size: 13.5px;
}
.archive-stats__motto {
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.archive-group {
  padding-top: 0;
}
.archive-group + .archive-group {
  padding-top: 46px;
}
.archive-group__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.archive-group__year {
  font-family: var(--font-mono);
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.archive-group__count {
  color: var(--muted-foreground);
  font-size: 13px;
}
.archive-list {
  display: flex;
  flex-direction: column;
}
.archive-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  gap: 6px;
  padding: 15px 0;
}
/* 设计稿中每行下方均有发丝线（含每组最后一行），行上方无线 */
.archive-list > li {
  border-bottom: 1px solid var(--border);
}
.archive-item__date {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.archive-item__title {
  color: var(--foreground);
  font-size: 18px;
  line-height: 25px;
  transition: color 0.2s var(--ease);
}
.archive-item:hover .archive-item__title {
  color: var(--link);
}

/* --------------------------------------------------------------------------
   11. 友链页
   -------------------------------------------------------------------------- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 31px;
}
.links-divider {
  margin: 40px 0 40px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.link-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.link-card__avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--secondary);
}
.link-card__avatar img,
.link-card__avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.link-card__body {
  display: block;
  min-width: 0;
}
.link-card__name {
  display: block;
  color: var(--foreground);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-card__desc {
  display: block;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 正文内嵌组件（地图可视化 / 图表） */
.embed-block {
  margin-top: 26px;
}
.embed-block__canvas {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 300px;
  padding: 40px 24px;
  color: var(--muted-foreground);
  background: var(--panel);
  border-radius: var(--radius-lg);
  text-align: center;
}
.embed-block__icon {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
}
.embed-block__hint {
  font-size: 13px;
}
.entry .embed-block__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  text-align: left;
}
.embed-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.embed-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.embed-legend__dot--a {
  background: #e2604f;
}
.embed-legend__dot--b {
  background: #48bfd4;
}
.embed-legend b {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-weight: 400;
}
.embed-block__source {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--hairline-strong);
}

/* 本站信息 */
.site-info {
  margin-top: 6px;
}
.site-info__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 18px;
  line-height: 2;
}
.site-info__label {
  color: var(--foreground);
  font-weight: 500;
}
.site-info__value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--link);
  font-family: var(--font-mono);
  font-size: 18px;
  word-break: break-all;
}
/* 本站信息行的链接是组件链接，不参与正文的「点线 → 波浪线」效果，
   保持设计稿的 --link 配色，hover 才浮出下划线 */
.entry .site-info__value a {
  text-decoration: none;
  text-underline-offset: 0;
  padding-bottom: 0;
  background-image: none;
}
.entry .site-info__value a:hover {
  background-size: 0 6px;
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  text-underline-offset: 3px;
}

/* 评论区 */
.comments {
  margin-top: 48px;
}

/* ---- 发表评论表单 ---- */
.comment-respond {
  margin: 32px 0;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* 回复模式：表单移入 li.comment-body 内，变为带边框卡片 */
.comment-respond.comment-replying {
  margin-top: 32px;
  margin-bottom: 32px;
  padding: 32px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.comment-respond__title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 500;
  line-height: 28px;
  color: var(--foreground);
}
#cancel-comment-reply-link {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}
#cancel-comment-reply-link:hover {
  color: var(--foreground);
}
/* 输入框样式 */
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 10px 14.4px;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s ease;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: 0;
  border-color: var(--hairline-strong);
}
.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--muted-foreground);
}
.comment-form textarea {
  min-height: 110px;
  margin-top: 12px;
  resize: vertical;
}
.comment-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 768px) {
  .comment-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* 验证码容器 */
.captcha {
  align-items: center;
  gap: 10px;
  border-radius: 12px;
}
.captcha__widget {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--content);
  font-size: 14px;
}
.captcha__spin {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #4a7fd4;
}
.captcha__spin .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.captcha__refresh {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted-foreground);
  border-radius: 50%;
  transition: color 0.2s var(--ease), transform 0.3s var(--ease);
}
.captcha__refresh:hover {
  color: var(--foreground);
  transform: rotate(90deg);
}
.comment-form__tip {
  display: none;
  margin: 10px 0 0;
  color: var(--link);
  font-size: 13px;
}
.comment-form-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.comment-form-submit .btn-primary {
  width: 100%;
}
@media (min-width: 768px) {
  .comment-form-submit .btn-primary {
    width: auto;
  }
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.55rem 1.4rem;
  color: var(--primary-label);
  background: var(--primary);
  border: 0;
  border-radius: 9999px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

/* ---- 评论列表 ---- */
.comments__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  color: var(--foreground);
}
.comments__count {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--muted-foreground);
}
.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.comment-inner {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-avatar {
  flex: none;
}
.comment-avatar img {
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
}
.comment-main {
  flex: 1;
  min-width: 0;
}
.comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9.6px;
  margin-bottom: 6.4px;
}
.comment-author {
  font-weight: 500;
  color: var(--foreground);
}
.comment-author a {
  color: inherit;
}
.comment-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
}
.comment-reply {
  margin-left: auto;
  font-size: 12px;
}
.comment-reply a {
  color: var(--foreground);
}
.comment-reply a:hover {
  color: var(--link);
}
.comment-content {
  font-size: 15px;
  line-height: 1.625;
  color: var(--content);
}
.comment-content p {
  margin: 0;
}
/* 嵌套子评论：左侧竖线 + 缩进 */
.comment-children {
  margin: 4px 0 0 16px;
  padding-left: 32px;
  border-left: 2px solid var(--border);
}

/* --------------------------------------------------------------------------
   13. 右侧浮动按钮（目录 / 回顶）
   -------------------------------------------------------------------------- */
.float-tools {
  position: fixed;
  right: 32px;
  bottom: 40px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* 初始化前隐藏，防止闪烁 */
.float-tools:not(.is-ready) {
  opacity: 0;
  pointer-events: none;
}
/* 浮动按钮默认隐藏，由 JS 控制显隐 */
.float-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--float-fg);
  background: var(--float-bg);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  opacity: 0;
  pointer-events: none;
}
.float-btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}
.float-btn:hover {
  transform: translateY(-2px) scale(1.05);
}
.toc-panel {
  position: fixed;
  right: 88px;
  bottom: 40px;
  z-index: 61;
  width: 280px;
  max-height: min(60vh, 520px);
  padding: 18px 6px 18px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease),
    visibility 0.22s;
}
.toc-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.toc-panel__title {
  padding-right: 12px;
  margin-bottom: 10px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
}
.toc-panel__list {
  max-height: calc(min(60vh, 520px) - 70px);
  padding-right: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-panel__link {
  display: block;
  padding: 5px 10px;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.6;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.toc-panel__link:hover {
  color: var(--foreground);
  background: var(--secondary);
}
.toc-panel__link.is-active {
  color: var(--foreground);
  border-left-color: var(--foreground);
  background: var(--secondary);
}
.toc-panel__link--h3 {
  padding-left: 24px;
  font-size: 12.5px;
}
.toc-panel__link--h4 {
  padding-left: 36px;
  font-size: 12px;
}
.toc-panel__link--h5 {
  padding-left: 48px;
  font-size: 11.5px;
}
.toc-panel__link--h6 {
  padding-left: 60px;
  font-size: 11px;
}
.toc-panel__empty {
  padding: 6px 10px;
  color: var(--muted-foreground);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   14. 搜索浮层
   -------------------------------------------------------------------------- */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 12vh 20px 20px;
  background: var(--mask);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 0.22s var(--ease), visibility 0.22s;
}
.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.search-panel {
  width: 100%;
  max-width: min(560px, 100%);
  align-self: flex-start;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: translateY(-12px);
  transition: transform 0.22s var(--ease);
  overflow: hidden;
}
.search-overlay.is-open .search-panel {
  transform: none;
}
.search-panel__field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.search-panel__field .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--muted-foreground);
}
.search-panel__field input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}
.search-panel__field .icon-btn {
  flex-shrink: 0;
}
.search-panel__field input::placeholder {
  color: var(--muted-foreground);
}
.search-panel__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 0;
  color: var(--muted-foreground);
  font-size: 12.5px;
}
.kbd {
  padding: 1px 6px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.search-panel__list {
  max-height: 46vh;
  margin-top: 12px;
  overflow-y: auto;
}
.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color 0.18s var(--ease);
}
.search-hit:hover {
  background: var(--secondary);
}
.search-hit__title {
  color: var(--foreground);
  font-size: 14.5px;
  line-height: 1.6;
}
.search-hit__meta {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.search-hit mark {
  color: var(--link);
  background: none;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   15. 页脚
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 24px;
  padding: 26px 0 40px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.9;
  text-align: right;
}
.site-footer a {
  transition: color 0.2s var(--ease);
}
.site-footer a:hover {
  color: var(--foreground);
}
.site-footer__sep {
  color: var(--hairline-strong);
}

/* --------------------------------------------------------------------------
   16. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .float-tools {
    right: 18px;
  }
}

/* 平板 / 移动：收起左侧栏，改为顶栏 + 底部悬浮条 */
@media (max-width: 900px) {
  .rail {
    display: none;
  }
  .shell {
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
  }
  .site-header {
    height: 62px;
    justify-content: space-between;
  }
  .site-header__logo {
    display: block !important;
    width: 28px;
    height: 28px;
  }
  .shell__main {
    padding-bottom: 104px;
  }
  .rail-mobile {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 60;
    display: flex;
    gap: 6px;
    padding: 12px;
    transform: translateX(-50%);
    background: color-mix(in srgb, var(--card) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
  }
  .rail-mobile .dock-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .rail-mobile .dock-btn__tip {
    display: none;
  }
  .float-tools {
    right: 14px;
    bottom: 88px;
  }
  .float-btn {
    width: 38px;
    height: 38px;
  }
  .toc-panel {
    right: 14px;
    bottom: 136px;
    width: min(280px, calc(100vw - 28px));
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav__item--next {
    text-align: left;
  }
  .post-nav__item--next .post-nav__label {
    justify-content: flex-start;
  }
  .links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-footer {
    text-align: center;
  }
  .archive-item {
    grid-template-columns: 104px 1fr;
  }
}

@media (max-width: 640px) {
  /* 防止页面被撑爆：隐藏水平溢出 */
  html, body {
    overflow-x: hidden;
  }
  .shell {
    max-width: 100%;
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
  }
  .post-card {
    padding: 20px 0 26px;
  }
  .post-card__title {
    font-size: 22px;
  }
  .post-card__excerpt {
    font-size: 15px;
  }
  .page-head__title {
    font-size: 26px;
  }
  /* 手机版文章 h1 */
  .article__title {
    font-size: 30px;
    line-height: 1.125;
  }
  .entry {
    font-size: 18px;
    line-height: 1.8;
  }
  .entry h2 {
    font-size: 22px;
  }
  .entry h3 {
    font-size: 20px;
  }
  .entry h4 {
    font-size: 19px;
  }
  .entry h5,
  .entry h6 {
    font-size: 18px;
  }
  .entry pre {
    padding: 14px 12px;
    font-size: 17.5px;
  }
  .entry pre code {
    font-size: 17.5px;
  }
  .entry code {
    font-size: 17.5px;
  }
  /* 防止代码块撑破容器 */
  .code-window {
    max-width: 100%;
    overflow: hidden;
  }
  .code-window > pre {
    padding-top: 50px; /* 手机版也需要为标题栏留出空间 */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .archive-stats__num {
    font-size: 44px;
  }
  .archive-group__year {
    font-size: 24px;
  }
  .archive-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .links-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* 小屏嵌套评论缩进减半 */
  .comment-children {
    padding-left: 16px;
    margin-left: 8px;
  }
  .post-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .site-footer {
    font-size: 12px;
  }
  /* 表格手机版：缩小字号，允许横向滚动 */
  .entry table {
    font-size: 18px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* 引用卡片手机版：头像居中置顶，文字下方纵向排列 */
  .cite-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 24px 20px;
  }
  .cite-card__avatar {
    width: 56px;
    height: 56px;
  }
  .cite-card__body {
    width: 100%;
	line-height: 1.25;
  }
  .cite-card__link .copy-btn {
    justify-self: center;
  }
  .site-info__row {
    font-size: 16px;
  }
  .site-info__value {
    font-size: 16px;
  }
}

/* 顶栏 logo 仅在移动端出现 */
.site-header__logo {
  display: none;
}

/* 打印 */
@media print {
  .rail,
  .rail-mobile,
  .float-tools,
  .site-header,
  .comments,
  .search-overlay {
    display: none !important;
  }
  .shell {
    padding: 0;
  }
}

/* ==========================================================================
   ComBox 主题扩展（Typecho 版新增）
   ========================================================================== */

/* ---- 站点 LOGO 浅色 / 深色自动切换 ---- */
.combox-logo-dark {
  display: none;
}
[data-theme="dark"] .combox-logo-light {
  display: none;
}
[data-theme="dark"] .combox-logo-dark {
  display: block;
}

/* ---- 评论表单：验证码未启用时网站输入行 100% 宽度 ---- */
.comment-form-grid .url-full {
  grid-column: 1 / -1;
}

/* ---- 评论表单：已登录提示行 ---- */
.comment-form__user {
  margin: 0;
  font-size: 14px;
  color: var(--muted-foreground);
}
.comment-form__user a {
  color: var(--link);
}

/* ---- 评论验证码（XCaptcha 插件）容器适配 ---- */
.captcha input[type="text"],
.captcha input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--content);
  font-size: 14px;
  outline: 0;
}
.captcha img {
  height: 32px;
  border-radius: 6px;
}
.captcha .geetest_holder,
.captcha .altcha-widget {
  flex: 1;
  min-width: 0;
}
[data-theme="dark"] .geetest_holder.geetest_wind .geetest_radar_btn,
[data-theme="dark"] .geetest_holder.geetest_wind .geetest_success_btn{border:1px solid var(--border);border-radius:12px}
[data-theme="dark"] .geetest_holder.geetest_wind .geetest_radar_btn,[data-theme="dark"] .geetest_holder.geetest_wind .geetest_radar_btn:hover{background:var(--card)}
[data-theme="dark"] .geetest_holder.geetest_wind .geetest_radar_tip,[data-theme="dark"] .geetest_holder.geetest_wind .geetest_success_radar_tip{color:var(--foreground);}
[data-theme="dark"] .geetest_holder.geetest_wind.geetest_radar_click .geetest_radar_btn{background:var(--card)}
[data-theme="dark"] .geetest_holder.geetest_wind.geetest_radar_click_ready .geetest_radar_btn{background:var(--card)}
[data-theme="light"] .geetest_holder.geetest_wind .geetest_radar_btn,[data-theme="light"] .geetest_holder.geetest_wind .geetest_success_btn{border:1px solid var(--border);border-radius:12px}
.geetest_holder.geetest_wind .geetest_radar_btn,.geetest_holder.geetest_wind .geetest_success_btn{border:1px solid var(--border);border-radius:12px}
.geetest_holder.geetest_wind .geetest_offline{border-radius:10px}

/* ---- 评论分页 ---- */
.comments .page-navigator {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.comments .page-navigator li {
  list-style: none;
}
.comments .page-navigator a,
.comments .page-navigator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--content);
  font-size: 14px;
  text-decoration: none;
}
.comments .page-navigator .current span,
.comments .page-navigator .current a {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-label);
}

/* ==========================================================================
   代码高亮（highlight.js · Gruvbox Light/Dark 自适应）
   浅色：奶油纸 #fbf1c7 / 深色：#171412（底色由 --code-bg 提供）
   ========================================================================== */
[data-theme="light"] .hljs {
  color: #504945;
}
[data-theme="light"] .hljs-comment,
[data-theme="light"] .hljs-quote {
  color: #928374;
  font-style: italic;
}
[data-theme="light"] .hljs-keyword,
[data-theme="light"] .hljs-selector-tag,
[data-theme="light"] .hljs-built_in,
[data-theme="light"] .hljs-name,
[data-theme="light"] .hljs-tag {
  color: #af3a3a;
}
[data-theme="light"] .hljs-string,
[data-theme="light"] .hljs-title,
[data-theme="light"] .hljs-section,
[data-theme="light"] .hljs-attribute,
[data-theme="light"] .hljs-literal,
[data-theme="light"] .hljs-template-tag,
[data-theme="light"] .hljs-template-variable,
[data-theme="light"] .hljs-type,
[data-theme="light"] .hljs-addition {
  color: #79740e;
}
[data-theme="light"] .hljs-number,
[data-theme="light"] .hljs-symbol,
[data-theme="light"] .hljs-bullet,
[data-theme="light"] .hljs-link,
[data-theme="light"] .hljs-meta,
[data-theme="light"] .hljs-selector-id,
[data-theme="light"] .hljs-selector-class {
  color: #b57614;
}
[data-theme="light"] .hljs-emphasis {
  font-style: italic;
}
[data-theme="light"] .hljs-strong {
  font-weight: 700;
}
[data-theme="light"] .hljs-attr,
[data-theme="light"] .hljs-variable,
[data-theme="light"] .hljs-property {
  color: #076678;
}
[data-theme="light"] .hljs-function .hljs-title,
[data-theme="light"] .hljs-title.function_ {
  color: #427b58;
}
[data-theme="light"] .hljs-params {
  color: #504945;
}

[data-theme="dark"] .hljs {
  color: #d5c4a1;
}
[data-theme="dark"] .hljs-comment,
[data-theme="dark"] .hljs-quote {
  color: #928374;
  font-style: italic;
}
[data-theme="dark"] .hljs-keyword,
[data-theme="dark"] .hljs-selector-tag,
[data-theme="dark"] .hljs-built_in,
[data-theme="dark"] .hljs-name,
[data-theme="dark"] .hljs-tag {
  color: #fb4934;
}
[data-theme="dark"] .hljs-string,
[data-theme="dark"] .hljs-title,
[data-theme="dark"] .hljs-section,
[data-theme="dark"] .hljs-attribute,
[data-theme="dark"] .hljs-literal,
[data-theme="dark"] .hljs-template-tag,
[data-theme="dark"] .hljs-template-variable,
[data-theme="dark"] .hljs-type,
[data-theme="dark"] .hljs-addition {
  color: #b8bb26;
}
[data-theme="dark"] .hljs-number,
[data-theme="dark"] .hljs-symbol,
[data-theme="dark"] .hljs-bullet,
[data-theme="dark"] .hljs-link,
[data-theme="dark"] .hljs-meta,
[data-theme="dark"] .hljs-selector-id,
[data-theme="dark"] .hljs-selector-class {
  color: #fabd2f;
}
[data-theme="dark"] .hljs-emphasis {
  font-style: italic;
}
[data-theme="dark"] .hljs-strong {
  font-weight: 700;
}
[data-theme="dark"] .hljs-attr,
[data-theme="dark"] .hljs-variable,
[data-theme="dark"] .hljs-property {
  color: #83a598;
}
[data-theme="dark"] .hljs-function .hljs-title,
[data-theme="dark"] .hljs-title.function_ {
  color: #8ec07c;
}
[data-theme="dark"] .hljs-params {
  color: #d5c4a1;
}

/* ==========================================================================
   图片灯箱（cblb）：多图循环、缩放、旋转、拖拽；零第三方依赖
   ========================================================================== */

/* 小图（≤200px）：保持行内显示 */
.entry img.cblb-inline {
  display: inline;
  vertical-align: middle;
}
.entry img.cblb-thumb {
  cursor: zoom-in;
}

.cblb {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(12, 10, 9, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.cblb.open {
  opacity: 1;
  visibility: visible;
}

.cblb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4.5rem 6rem;
  cursor: zoom-out; /* 点击图片外区域关闭 */
}
.cblb-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  cursor: default;
}
.cblb-img.cblb-zoomed {
  cursor: grab;
}
.cblb-img.cblb-grabbing {
  cursor: grabbing;
  transition: none;
}

.cblb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.cblb-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.cblb-btn:active {
  transform: scale(0.94);
}
.cblb-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.cblb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.cblb-prev,
.cblb-next {
  position: absolute;
  top: calc(50% - 24px);
  width: 48px;
  height: 48px;
}
.cblb-prev {
  left: 1rem;
}
.cblb-next {
  right: 1rem;
}

.cblb-foot {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  max-width: min(92vw, 760px);
  pointer-events: none; /* 自身不挡 stage 点击关闭，仅子元素可交互 */
}
.cblb-foot > * {
  pointer-events: auto;
}
.cblb-caption {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  word-break: break-word;
}
.cblb-caption:empty {
  display: none;
}
.cblb-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem;
  border-radius: 9999px;
  background: rgba(28, 25, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.cblb-toolbar .cblb-btn {
  width: 40px;
  height: 40px;
  background: transparent;
}
.cblb-toolbar .cblb-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.cblb-counter {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  padding: 0 0.7rem 0 0.65rem;
  margin-left: 0.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.cblb.single .cblb-prev,
.cblb.single .cblb-next,
.cblb.single .cblb-counter {
  display: none;
}

@media (max-width: 640px) {
  .cblb-stage {
    padding: 3.5rem 0.6rem 7rem;
  }
  .cblb-close {
    top: 0.6rem;
    right: 0.6rem;
  }
  .cblb-prev,
  .cblb-next {
    width: 42px;
    height: 42px;
    top: calc(50% - 21px);
  }
  .cblb-prev {
    left: 0.4rem;
  }
  .cblb-next {
    right: 0.4rem;
  }
  .cblb-toolbar .cblb-btn {
    width: 38px;
    height: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cblb,
  .cblb-img {
    transition: none;
  }
}
@media print {
  .cblb {
    display: none !important;
  }
}

/* ==========================================================================
   404 错误页（便签纸风格）
   ========================================================================== */
.error-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  position: relative;
}

/* 便签纸容器（微旋转） */
.error-404__wrapper {
  transform: rotate(-1.5deg);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.error-404__wrapper:hover {
  transform: rotate(0deg);
}

/* 卡片主体 */
.error-404__card {
  position: relative;
  width: 280px;
  padding: 24px;
  padding-top: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) {
  .error-404__card {
    width: 340px;
    padding: 32px;
    padding-top: 40px;
  }
}

/* 顶部胶带装饰（一半贴在卡片上，一半贴在「墙」上） */
.error-404__tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 64px;
  height: 24px;
  background: var(--sparkle);
  opacity: 0.35;
  border-radius: 2px;
  z-index: 1;
}
.error-404__tape::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.3) 3px,
    rgba(255, 255, 255, 0.3) 6px
  );
}
@media (min-width: 768px) {
  .error-404__tape {
    top: -14px;
    width: 80px;
    height: 28px;
  }
}

/* 横线纸背景 */
.error-404__lines {
  position: absolute;
  top: 72px;
  left: 24px;
  right: 24px;
  pointer-events: none;
  opacity: 0.06;
}
.error-404__lines::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--foreground);
  box-shadow:
    0 24px 0 var(--foreground),
    0 48px 0 var(--foreground),
    0 72px 0 var(--foreground),
    0 96px 0 var(--foreground),
    0 120px 0 var(--foreground),
    0 144px 0 var(--foreground),
    0 168px 0 var(--foreground);
}
@media (min-width: 768px) {
  .error-404__lines {
    left: 32px;
    right: 32px;
  }
}

/* 卡片内容 */
.error-404__content {
  position: relative;
  z-index: 1;
}

/* 404 大字 */
.error-404__code {
  font-size: 48px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--foreground);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* 描述文字 */
.error-404__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted-foreground);
  margin: 0 0 24px;
  font-style: italic;
}
@media (min-width: 768px) {
  .error-404__desc {
    font-size: 16px;
  }
}

/* 分隔线 */
.error-404__divider {
  width: 48px;
  height: 1px;
  background: var(--sparkle);
  opacity: 0.45;
  margin: 24px 0;
}

/* 待办区域 */
.error-404__todo {
  margin: 24px 0;
}
.error-404__todo-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 12px;
}

/* 返回首页链接 */
.error-404__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--foreground);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s var(--ease);
}
.error-404__link:hover {
  color: var(--link);
}

/* 复选框样式 */
.error-404__checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--foreground);
  flex-shrink: 0;
}

/* 签名 */
.error-404__signature {
  font-size: 12px;
  color: var(--muted-foreground);
  font-style: italic;
  text-align: right;
  margin: 40px 0 0;
}

/* 主题切换按钮 */
.error-404__theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted-foreground);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.error-404__theme-toggle:hover {
  color: var(--foreground);
  background: var(--card);
}
.error-404__theme-toggle .icon {
  width: 20px;
  height: 20px;
}
/* 浅色模式显示月亮，深色模式显示太阳 */
.error-404__theme-toggle .icon--sun {
  display: none;
}
[data-theme="dark"] .error-404__theme-toggle .icon--moon {
  display: none;
}
[data-theme="dark"] .error-404__theme-toggle .icon--sun {
  display: block;
}

/* 手机版适配 */
@media (max-width: 640px) {
  .error-404__card {
    width: 260px;
    padding: 20px;
    padding-top: 32px;
  }
  .error-404__code {
    font-size: 40px;
  }
  .error-404__lines {
    top: 64px;
    left: 20px;
    right: 20px;
  }
  .error-404__lines::before {
    box-shadow:
      0 24px 0 var(--foreground),
      0 48px 0 var(--foreground),
      0 72px 0 var(--foreground),
      0 96px 0 var(--foreground),
      0 120px 0 var(--foreground);
  }
}
