/* variables.css */
/* ==========================================================================
   变量
   ========================================================================== */

:root {
  /* 主色：蓝色系 */
  --blue-0: #1e6ae0;
  --blue-1: #3d8bff;
  --blue-2: #66a3ff;
  --blue-3: #a3c7ff;
  --blue-4: #cfe2ff;
  --blue-5: #e9f2ff;
  --blue-6: #f5f9ff;

  --primary: var(--blue-1);
  --primary-deep: var(--blue-0);

  /* 中性色 */
  --bg: #eff2f6;
  --bg-soft: #e6ebf2;
  --wrap: #ffffff;
  --wrap-soft: #f7f9fc;
  --header-bg: rgba(255, 255, 255, 0.86);
  --border: #e2e8f0;
  --border-strong: #cdd6e3;

  --text: #2f3746;
  --text-strong: #161d29;
  --text-muted: #68738a;
  --text-faint: #97a1b3;

  --link: var(--blue-1);

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(23, 35, 61, 0.06);
  --shadow-card: 0 2px 12px rgba(23, 35, 61, 0.07);
  --shadow-card-hover: 0 10px 32px rgba(23, 35, 61, 0.14);
  --shadow-glow: 0 0 12px rgba(61, 139, 255, 0.45);
  --shadow-glow-soft: 0 0 20px rgba(61, 139, 255, 0.25);

  /* 尺寸 */
  --container: 1350px;
  --sidebar-width: 268px;
  --content-gap: 16px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --nav-height: 64px;

  /* 字体 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
    "SimSun", Georgia, serif;
  --font-sans: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas,
    "Courier New", monospace;

  /* 代码块配色（亮色） */
  --code-bg: #f6f8fb;
  --code-border: #e2e8f0;
  --code-text: #2f3746;
  --code-comment: #8b97a8;
  --code-keyword: #b34d8c;
  --code-string: #2c8a5c;
  --code-number: #b07023;
  --code-function: #2f6fed;
  --code-variable: #2f3746;
  --code-tag: #b34d8c;
  --code-attr: #b07023;
  --code-builtin: #1f7f8c;

  /* 过渡 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.16s;
  --t: 0.28s;

  /* 光标（scripts/make-fish-cursor.mjs 生成），热点对准箭头尖 / I 形中点 */
  --cursor-default: url("../images/cursor/default.png") 1 1, auto;
  --cursor-pointer: url("../images/cursor/pointer.png") 1 1, pointer;
  --cursor-text: url("../images/cursor/text.png") 8 16, text;

  color-scheme: light;
}

/* 暗色 */
[data-theme="dark"] {
  --blue-0: #7ab8ff;
  --blue-1: #4a9eff;
  --blue-2: #3d8bff;
  --blue-3: #2f6ab8;
  --blue-4: rgba(74, 158, 255, 0.28);
  --blue-5: rgba(74, 158, 255, 0.14);
  --blue-6: rgba(74, 158, 255, 0.06);

  --primary: var(--blue-1);

  --bg: #1b1f26;
  --bg-soft: #161a20;
  --wrap: #232830;
  --wrap-soft: #272d36;
  --header-bg: rgba(27, 31, 38, 0.88);
  --border: #2f3742;
  --border-strong: #3d4754;

  --text: #9aa4b2;
  --text-strong: #e6ebf2;
  --text-muted: #7c8798;
  --text-faint: #5c6577;

  --link: var(--blue-1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-card-hover: 0 10px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 14px rgba(74, 158, 255, 0.5);
  --shadow-glow-soft: 0 0 24px rgba(74, 158, 255, 0.22);

  --code-bg: #1c2027;
  --code-border: #2c333d;
  --code-text: #c9d1d9;
  --code-comment: #6e7a8a;
  --code-keyword: #e07bb0;
  --code-string: #7ec699;
  --code-number: #e0a458;
  --code-function: #7ab8ff;
  --code-variable: #c9d1d9;
  --code-tag: #e07bb0;
  --code-attr: #e0a458;
  --code-builtin: #5ec8d8;

  color-scheme: dark;
}


/* icons.css */
/* ==========================================================================
   图标与光标
   ========================================================================== */

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- 自定义像素光标 ---------- */

html {
  cursor: var(--cursor-default);
}

a,
button,
[role="button"],
summary,
label,
.page-num,
.page-nav-text,
.post-card-link,
.menu-item,
.nav-item,
.tag-chip,
.tag-cloud-item,
.friend-card,
select {
  cursor: var(--cursor-pointer) !important;
}

input,
textarea,
[contenteditable="true"],
code,
kbd,
pre {
  cursor: var(--cursor-text) !important;
}

/* 关闭自定义光标的开关 */
[data-cursor="off"] {
  --cursor-default: auto;
  --cursor-pointer: pointer;
  --cursor-text: text;
}

/* 触摸设备不显示自定义光标 */
@media (hover: none) {
  html,
  a,
  button,
  input,
  textarea {
    cursor: auto !important;
  }
  input,
  textarea {
    cursor: text !important;
  }
}


/* base.css */
/* ==========================================================================
   重置与基础
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(61, 139, 255, 0.09), transparent 70%),
    radial-gradient(700px 480px at 92% 8%, rgba(90, 175, 255, 0.06), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(74, 158, 255, 0.13), transparent 70%),
    radial-gradient(760px 500px at 95% 4%, rgba(74, 158, 255, 0.07), transparent 70%);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-strong);
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: var(--primary-deep);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

input {
  font: inherit;
  color: inherit;
}

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 0.35em;
  font-size: 0.78em;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

::selection {
  background: rgba(61, 139, 255, 0.24);
  color: var(--text-strong);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
  background-clip: content-box;
}

/* 通用遮罩 */
[hidden] {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(12, 18, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay[hidden] {
  display: none;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--wrap);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: all var(--t) var(--ease);
}

.btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(61, 139, 255, 0.35);
}

.btn-primary:hover {
  color: #fff;
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  box-shadow: 0 6px 20px rgba(61, 139, 255, 0.45);
}

/* --------------------------------------------------------------------------
   首屏加载动画
   -------------------------------------------------------------------------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#loader.is-done {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease) 0.1s, visibility 0s linear 0.6s;
}

.loader-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  background: var(--wrap);
  transition: transform 0.75s var(--ease-out) 0.25s;
}

.loader-panel-left {
  left: 0;
  border-right: 1px solid var(--border);
}

.loader-panel-right {
  right: 0;
  border-left: 1px solid var(--border);
}

#loader.is-done .loader-panel-left {
  transform: translateX(-100%);
}

#loader.is-done .loader-panel-right {
  transform: translateX(100%);
}

.loader-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transition: opacity 0.3s var(--ease);
}

#loader.is-done .loader-center {
  opacity: 0;
}

.loader-ring {
  position: relative;
  width: 46px;
  height: 46px;
}

.loader-ring span {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: loader-spin 1.4s linear infinite;
}

.loader-ring span:nth-child(1) {
  border-top-color: var(--primary);
}

.loader-ring span:nth-child(2) {
  inset: 7px;
  border-right-color: var(--blue-3);
  animation-duration: 1.1s;
  animation-direction: reverse;
}

.loader-ring span:nth-child(3) {
  inset: 14px;
  border-bottom-color: var(--blue-4);
  animation-duration: 1.8s;
}

.loader-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

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

/* --------------------------------------------------------------------------
   点击粒子特效
   -------------------------------------------------------------------------- */

.click-particle {
  position: fixed;
  z-index: 9999;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.click-ring {
  position: fixed;
  z-index: 9999;
  width: 46px;
  height: 46px;
  border: 3px solid var(--blue-2);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   进场动画
   -------------------------------------------------------------------------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in-blur {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* 滚动进场：靠 IntersectionObserver 加 is-visible */
.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.is-visible {
  animation: fade-up 0.6s var(--ease-out) forwards;
}

@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}


/* layout.css */
/* ==========================================================================
   布局：顶栏 / banner / 内容区 / 侧边栏 / 页脚
   ========================================================================== */

/* ------------------------------ 顶栏 ------------------------------ */

#header-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  height: var(--nav-height);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: top var(--t) var(--ease), border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

#header-nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 16px rgba(20, 32, 54, 0.07);
}

[data-theme="dark"] #header-nav.is-scrolled {
  box-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}

#header-nav.is-hidden {
  top: calc(-1 * var(--nav-height) - 2px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.nav-item:hover {
  color: var(--primary);
  background: var(--blue-5);
}

.nav-item.is-active {
  color: var(--primary);
  background: var(--blue-5);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  transition: transform var(--t) var(--ease-out);
}

.nav-item:hover svg {
  transform: rotate(-8deg) scale(1.12);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.nav-icon-btn:hover {
  color: var(--primary);
  background: var(--blue-5);
  transform: translateY(-1px);
}

.nav-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* 主题按钮：三个图标按状态显示 */
#mode-toggle {
  position: relative;
}

#mode-toggle .mode-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transform: rotate(-40deg) scale(0.6);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease-out);
}

[data-mode="light"] #mode-toggle .icon-sun,
[data-mode="dark"] #mode-toggle .icon-moon,
[data-mode="auto"] #mode-toggle .icon-auto {
  opacity: 1;
  transform: none;
}

.menu-toggle {
  display: none;
}

/* ------------------------------ Banner ------------------------------ */

#header {
  position: relative;
  margin-top: var(--nav-height);
  height: 38vh;
  min-height: 340px;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-soft);
}

.header-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transform: scale(1.02);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 55%);
  mask-image: linear-gradient(to top, transparent 0%, #000 55%);
}

/* 图片下端的虚化：对下层图片做 backdrop 模糊，再用渐变蒙版限制范围 */
.header-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  -webkit-mask-image: linear-gradient(
    to top,
    #000 0%,
    rgba(0, 0, 0, 0.86) 16%,
    rgba(0, 0, 0, 0.5) 38%,
    rgba(0, 0, 0, 0.18) 56%,
    transparent 74%
  );
  mask-image: linear-gradient(
    to top,
    #000 0%,
    rgba(0, 0, 0, 0.86) 16%,
    rgba(0, 0, 0, 0.5) 38%,
    rgba(0, 0, 0, 0.18) 56%,
    transparent 74%
  );
}

.header-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(8, 14, 24, 0.42) 0%,
    rgba(8, 14, 24, 0.3) 45%,
    rgba(8, 14, 24, 0.1) 80%
  );
}

.header-inner {
  position: relative;
  z-index: 2;
  width: 92%;
  max-width: 1000px;
  text-align: center;
  padding: 0 20px;
}

.header-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1.45;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65), 0 0 2px rgba(0, 0, 0, 0.4);
  animation: fade-in-blur 1s var(--ease-out) 0.15s both;
}

.header-subtitle {
  margin: 14px 0 0;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  animation: fade-in-blur 1s var(--ease-out) 0.35s both;
}

.header-title-post {
  font-size: 30px;
  letter-spacing: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.header-scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  animation: scroll-hint 2s var(--ease) infinite;
}

.header-scroll-hint svg {
  width: 20px;
  height: 20px;
  transform: rotate(180deg);
}

@keyframes scroll-hint {
  0%, 100% {
    transform: translate(-50%, 0);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, 6px);
    opacity: 1;
  }
}

/* ------------------------------ 内容区 ------------------------------ */

#content {
  display: flex;
  align-items: flex-start;
  gap: var(--content-gap);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

#content.sidebar-right {
  flex-direction: row-reverse;
}

#content.sidebar-left {
  flex-direction: row;
}

#main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 0 40px;
}

/* 没有侧边栏的页面（关于页），正文占满 */
.no-sidebar #main {
  max-width: 100%;
}

/* ------------------------------ 侧边栏 ------------------------------ */

#sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  max-height: calc(100vh - var(--nav-height) - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar {
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 18px 20px;
  animation: fade-up 0.6s var(--ease-out) both;
}

[data-theme="dark"] .sidebar {
  border-color: transparent;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-avatar {
  position: relative;
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(140deg, var(--blue-1), var(--blue-3), transparent 70%);
  box-shadow: var(--shadow-glow-soft);
  transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease);
}

.sidebar-avatar:hover {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: var(--shadow-glow);
}

.sidebar-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
}

.sidebar-name {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
}

.sidebar-bio {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

.sidebar-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  margin: 18px 0 6px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: inherit;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-faint);
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.stat-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  margin: 16px 0 6px;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--primary);
  /* 关键：用 double border 做双层描边 */
  border: 4px double var(--blue-4);
  border-radius: 4px;
  background: transparent;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease),
    color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.menu-item:hover {
  border-color: var(--blue-2);
  background: var(--blue-6);
  box-shadow: 0 0 12px rgba(61, 139, 255, 0.16);
}

.menu-item.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--blue-5);
  box-shadow: var(--shadow-glow-soft);
}

.menu-item.is-active:hover {
  background: var(--primary-deep);
}

.menu-icon {
  display: flex;
  transition: transform var(--t) var(--ease-out);
}

.menu-icon svg {
  width: 16px;
  height: 16px;
}

.menu-item:hover .menu-icon {
  transform: rotate(90deg) scale(1.1);
}

.sidebar-views {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-faint);
}

.sidebar-views svg {
  width: 14px;
  height: 14px;
}

.views-value {
  color: var(--primary);
  font-weight: 700;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-faint);
  width: 100%;
}

/* ------------------------------ 页脚 ------------------------------ */

#footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--wrap);
}

[data-theme="dark"] #footer {
  background: transparent;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 26px 20px 32px;
  text-align: center;
}

.footer-line {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-line + .footer-line {
  margin-top: 6px;
}

.footer-meta {
  font-size: 12px;
  color: var(--text-faint);
}

.footer-dot {
  margin: 0 6px;
  opacity: 0.5;
}

.footer-line a {
  color: var(--text-muted);
}

.footer-line a:hover {
  color: var(--primary);
}

/* ------------------------------ 回到顶部 ------------------------------ */

#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--t) var(--ease);
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

#back-to-top:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

#back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------ 阅读进度 ------------------------------ */

#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  height: 2px;
  background: transparent;
  pointer-events: none;
}

#read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue-1), var(--blue-2));
  box-shadow: 0 0 8px rgba(61, 139, 255, 0.7);
  transition: width 0.1s linear;
}

/* ------------------------------ 移动端抽屉 ------------------------------ */

#drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 950;
  width: 290px;
  max-width: 84vw;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform 0.38s var(--ease-out);
  padding: 16px;
}

#drawer.is-open {
  transform: none;
}

#drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  border-radius: 50%;
  transition: all var(--t-fast) var(--ease);
}

#drawer-close:hover {
  color: var(--primary);
  background: var(--blue-5);
}

#drawer-close svg {
  width: 17px;
  height: 17px;
}

.sidebar-drawer {
  margin-top: 40px;
  box-shadow: none;
  border: 0;
  background: var(--wrap);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

/* 侧边栏收起 */
@media screen and (max-width: 959px) {
  #sidebar {
    display: none;
  }

  #content,
  #content.sidebar-right,
  #content.sidebar-left {
    flex-direction: column;
  }

  #main {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
  }

  .nav-inner {
    justify-content: flex-end;
  }

  .header-title {
    font-size: 34px;
    letter-spacing: 2px;
  }

  .header-title-post {
    font-size: 26px;
  }
}

/* 顶栏只留图标 */
@media screen and (max-width: 767px) {
  :root {
    --nav-height: 56px;
  }

  #content {
    padding: 0 14px;
  }

  #header {
    min-height: 280px;
    height: 34vh;
  }

  .header-title {
    font-size: 26px;
    letter-spacing: 1.5px;
    line-height: 1.5;
  }

  .header-subtitle {
    font-size: 13px;
    letter-spacing: 1px;
    margin-top: 10px;
  }

  .header-title-post {
    font-size: 21px;
  }

  .nav-inner {
    padding: 0 12px;
  }

  .footer-inner {
    padding: 22px 16px 28px;
  }

  #back-to-top {
    right: 14px;
    bottom: 16px;
    width: 38px;
    height: 38px;
  }
}

@media screen and (max-width: 479px) {
  .header-title {
    font-size: 21px;
    letter-spacing: 1px;
  }

  .header-title-post {
    font-size: 18px;
  }

  .header-scroll-hint {
    display: none;
  }

  .nav-icon-btn {
    width: 34px;
    height: 34px;
  }

  .footer-line {
    font-size: 12px;
  }
}


/* components.css */
/* ==========================================================================
   组件：卡片 / 分页 / 标签 / 归档 / 友链 / 搜索 / 灯箱 / 文章页
   ========================================================================== */

/* ------------------------------ 文章卡片 ------------------------------ */

.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  position: relative;
  display: flex;
  height: 232px;
  margin-bottom: 26px;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--t) var(--ease-out),
    box-shadow var(--t) var(--ease-out), border-color var(--t) var(--ease);
}

[data-theme="dark"] .post-card {
  border-color: transparent;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--blue-4);
}

.post-card-right {
  flex-direction: row-reverse;
}

/* 整卡可点：绝对定位的透明链接 */
.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.post-card-link:focus-visible {
  outline-offset: -3px;
}

/* 封面 */
.post-cover {
  position: relative;
  flex: 0 0 40%;
  width: 40%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-5), var(--blue-6));
  /* 封面和占位图标叠在同一格里：图加载成功就盖住图标，失败就露出来 */
  display: grid;
  place-items: center;
}

.post-cover img,
.cover-fallback {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.post-cover img {
  object-fit: cover;
  transition: transform 0.55s var(--ease-out);
  will-change: transform;
}

.post-card:hover .post-cover img {
  transform: scale(1.07);
}

/* 斜切边缘 —— 这是卡片的标志性细节 */
.post-card-left .post-cover {
  border-radius: var(--radius) 0 0 var(--radius);
  clip-path: polygon(0 0, 92% 0%, 100% 100%, 0% 100%);
}

.post-card-right .post-cover {
  border-radius: 0 var(--radius) var(--radius) 0;
  clip-path: polygon(0 0, 100% 0%, 100% 100%, 8% 100%);
}

.post-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-5), var(--blue-6));
}

.cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-3);
  opacity: 0.7;
}

.cover-fallback svg {
  width: 46px;
  height: 46px;
  stroke-width: 1.2;
}

/* 封面遮罩，让边界更柔和 */
.post-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 55%, rgba(10, 20, 40, 0.14));
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}

.post-card:hover .post-cover::after {
  opacity: 1;
}

/* 文字区 */
.post-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 24px 18px;
}

[data-theme="dark"] .post-body {
  background: var(--wrap);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.meta-item svg {
  width: 13px;
  height: 13px;
  opacity: 0.85;
}

.post-title {
  margin: 12px 0 9px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.4;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t-fast) var(--ease);
}

.post-card:hover .post-title {
  color: var(--primary-deep);
}

.post-excerpt {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}

/* 卡片入场（由 main.js 触发） */
.js-ready .post-card {
  opacity: 0;
  transform: translateY(16px);
}

.js-ready .post-card.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out),
    box-shadow var(--t) var(--ease-out), border-color var(--t) var(--ease);
  transition-delay: var(--stagger, 0ms);
}

/* ------------------------------ 标签 ------------------------------ */

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--primary);
  background: var(--blue-6);
  border: 1px solid var(--blue-5);
  border-radius: 6px;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}

a.tag-chip:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.tag-chip-cat {
  color: var(--text-muted);
  background: var(--bg-soft);
  border-color: var(--border);
}

.tag-chip-sm {
  padding: 1px 7px;
  font-size: 10.5px;
}

/* ------------------------------ 分页 ------------------------------ */

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 30px 0 8px;
  padding: 10px 22px;
  min-height: 58px;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .pagination {
  border-color: transparent;
}

.page-side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.page-side-end {
  justify-content: flex-end;
}

.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}

a.page-num:hover {
  color: var(--primary);
  background: var(--blue-5);
}

.page-num.is-current {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 12px rgba(61, 139, 255, 0.38);
}

.page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--text-faint);
  letter-spacing: 1px;
}

.page-nav-text {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}

.page-nav-text:hover {
  color: var(--primary);
}

/* ------------------------------ 侧边栏切换 ------------------------------ */

.side-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 38px;
  color: var(--text-faint);
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

[data-theme="dark"] .switch-btn {
  border-color: transparent;
}

.switch-btn svg {
  width: 18px;
  height: 18px;
}

.switch-btn:hover {
  color: var(--primary);
  border-color: var(--blue-3);
}

.switch-btn.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(61, 139, 255, 0.38);
}

.switch-btn.is-active:hover {
  color: #fff;
}

/* ------------------------------ 文章目录 ------------------------------ */

.toc-card {
  flex-shrink: 0;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 15px 13px 13px;
}

[data-theme="dark"] .toc-card {
  border-color: transparent;
}

.toc-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-strong);
}

.toc-head svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 44vh;
  overflow-y: auto;
  scrollbar-width: none;
}

.toc-list::-webkit-scrollbar {
  display: none;
}

.toc-item {
  margin: 1px 0;
}

.toc-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 7px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.toc-level-3 .toc-link {
  padding-left: 26px;
  font-size: 12px;
  color: var(--text-faint);
}

.toc-bar {
  flex-shrink: 0;
  width: 3px;
  height: 13px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.toc-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.toc-link:hover {
  color: var(--primary);
  background: var(--blue-6);
}

.toc-link.is-active {
  color: var(--primary);
  background: var(--blue-5);
  font-weight: 600;
}

.toc-link.is-active .toc-bar {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(61, 139, 255, 0.6);
}

/* ------------------------------ 页面标题 ------------------------------ */

.page-head {
  margin: 6px 0 26px;
  padding-left: 2px;
}

.page-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 27px;
  letter-spacing: 1px;
  color: var(--text-strong);
}

.page-title-mark {
  color: var(--primary);
  font-size: 30px;
  font-weight: 800;
}

.page-desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.5px;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.page-breadcrumb a {
  color: var(--text-muted);
}

.page-breadcrumb a:hover {
  color: var(--primary);
}

/* 标题下的小色条 */
.page-head::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue-1), transparent);
  box-shadow: 0 0 10px rgba(61, 139, 255, 0.5);
}

/* ------------------------------ 归档 ------------------------------ */

.archive {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-group {
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px 26px 12px;
  margin-bottom: 18px;
}

[data-theme="dark"] .archive-group {
  border-color: transparent;
}

.archive-year {
  display: flex;
  align-items: baseline;
  gap: 12px;
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.archive-year::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(61, 139, 255, 0.5);
  transition: width var(--t) var(--ease);
}

.archive-group:hover .archive-year::after {
  width: 90px;
}

.archive-year-num {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 2px;
}

.archive-year-count {
  font-size: 12px;
  color: var(--text-faint);
}

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

.archive-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0 9px 4px;
  border-radius: 6px;
  transition: background var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}

.archive-item::before {
  content: "";
  width: 5px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--blue-3);
  transition: all var(--t-fast) var(--ease);
}

.archive-item:hover::before {
  height: 20px;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(61, 139, 255, 0.6);
}

.archive-item:hover {
  background: var(--blue-6);
  padding-left: 10px;
}

.archive-date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  letter-spacing: 0.5px;
}

.archive-link {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-item:hover .archive-link {
  color: var(--primary);
}

.archive-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ------------------------------ 标签云 ------------------------------ */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .tag-cloud {
  border-color: transparent;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 14px;
  font-size: calc(12px + 7px * var(--w, 0.5));
  font-weight: 600;
  color: var(--primary);
  background: var(--blue-6);
  border: 1px solid var(--blue-5);
  border-radius: 8px;
  transition: all var(--t-fast) var(--ease);
}

.tag-cloud-item:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(61, 139, 255, 0.28);
}

.tag-cloud-count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.65;
}

/* ------------------------------ 友链 ------------------------------ */

.page-desc-dot {
  margin: 0 8px;
  opacity: 0.55;
}

.friend-welcome {
  color: var(--primary);
  letter-spacing: 0.5px;
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 19px;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: all var(--t) var(--ease-out);
}

[data-theme="dark"] .friend-card {
  border-color: transparent;
}

.friend-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-3);
  box-shadow: var(--shadow-card-hover);
}

.friend-avatar {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  border-radius: 13px;
  object-fit: cover;
  background: var(--bg-soft);
}

.friend-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c, var(--blue-1)), var(--blue-3));
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.friend-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-desc {
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-arrow {
  color: var(--text-faint);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all var(--t) var(--ease);
}

.friend-card:hover .friend-arrow {
  opacity: 1;
  transform: none;
  color: var(--primary);
}

.friend-arrow svg {
  width: 15px;
  height: 15px;
}

.friend-note {
  margin-top: 22px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--blue-6);
  border-left: 3px solid var(--blue-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.friend-note p {
  margin: 0;
}

.friend-note code {
  padding: 1px 6px;
  color: var(--primary);
  background: var(--wrap);
  border-radius: 4px;
}

/* ------------------------------ 搜索 ------------------------------ */

#search-panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
}

.search-box {
  width: 100%;
  max-width: 640px;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(8, 16, 30, 0.32);
  overflow: hidden;
  animation: fade-up 0.32s var(--ease-out) both;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap svg {
  width: 19px;
  height: 19px;
  color: var(--text-faint);
}

.search-input-wrap input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  font-size: 16px;
  color: var(--text-strong);
  background: transparent;
  border: 0;
  outline: none;
}

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

#search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text-faint);
  border-radius: 6px;
  transition: all var(--t-fast) var(--ease);
}

#search-close:hover {
  color: var(--primary);
  background: var(--blue-5);
}

#search-close svg {
  width: 15px;
  height: 15px;
}

.search-results {
  max-height: min(54vh, 460px);
  overflow-y: auto;
  padding: 8px;
}

.search-hint {
  margin: 0;
  padding: 34px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease);
}

.search-item:hover,
.search-item.is-active {
  background: var(--blue-6);
}

.search-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.5;
}

.search-item.is-active .search-item-title {
  color: var(--primary);
}

.search-item-title mark {
  padding: 0 2px;
  color: var(--primary);
  background: rgba(61, 139, 255, 0.18);
  border-radius: 3px;
}

.search-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.search-item-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  font-size: 11.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  background: var(--wrap-soft);
}

.search-page {
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

[data-theme="dark"] .search-page {
  border-color: transparent;
}

.search-input-wrap-page {
  border-bottom: 1px solid var(--border);
}

.search-page .search-results {
  max-height: none;
  min-height: 320px;
}

/* ------------------------------ 灯箱 ------------------------------ */

#lightbox {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(6, 10, 18, 0.86);
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: background var(--t-fast) var(--ease);
}

#lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

#lightbox-close svg {
  width: 20px;
  height: 20px;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  text-align: center;
}

#lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: fade-up 0.3s var(--ease-out) both;
}

#lightbox-caption {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

#lightbox-caption:empty {
  display: none;
}

/* ------------------------------ 文章页 ------------------------------ */

.article {
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 34px 30px;
  margin-top: 8px;
}

[data-theme="dark"] .article {
  border-color: transparent;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-faint);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 22px;
}

.article-copyright {
  margin-top: 36px;
  padding: 16px 20px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-muted);
  background: var(--wrap-soft);
  border-left: 3px solid var(--blue-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-copyright p {
  margin: 0;
  word-break: break-all;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.article-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--t) var(--ease-out);
}

[data-theme="dark"] .article-nav-item {
  border-color: transparent;
}

a.article-nav-item:hover {
  border-color: var(--blue-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.article-nav-item.is-empty {
  background: transparent;
  border: 1px dashed var(--border);
  box-shadow: none;
}

.article-nav-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--text-faint);
}

.article-nav-label svg {
  width: 13px;
  height: 13px;
}

.article-nav-next {
  text-align: right;
}

.article-nav-next .article-nav-label {
  justify-content: flex-end;
}

.article-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

a.article-nav-item:hover .article-nav-title {
  color: var(--primary);
}

.article-back {
  margin: 26px 0 0;
  text-align: center;
}

.article-back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.article-back a:hover {
  color: var(--primary);
}

.article-back svg {
  width: 14px;
  height: 14px;
}

/* ------------------------------ 关于页 ------------------------------ */

.about {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.about-card {
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 20px;
  text-align: center;
}

[data-theme="dark"] .about-card {
  border-color: transparent;
}

.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  box-shadow: var(--shadow-glow-soft);
}

.about-name {
  margin: 14px 0 6px;
  font-size: 19px;
  color: var(--primary);
}

.about-tagline {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-faint);
}

.about-facts {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-facts li {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.about-facts li span:last-child {
  font-weight: 700;
  color: var(--primary);
}

.about-rss {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--blue-4);
  border-radius: 20px;
  transition: all var(--t) var(--ease);
}

.about-rss:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.about-rss svg {
  width: 15px;
  height: 15px;
}

.about-body {
  background: var(--wrap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 34px;
}

[data-theme="dark"] .about-body {
  border-color: transparent;
}

/* ------------------------------ 404 ------------------------------ */

.not-found {
  padding: 12vh 20px;
  text-align: center;
}

.not-found-code {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 88px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--blue-1), var(--blue-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.not-found-title {
  margin: 18px 0 10px;
  font-size: 22px;
}

.not-found-desc {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--text-muted);
}

.not-found-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--wrap);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-faint);
}

.empty-state code,
.about-body code {
  padding: 1px 6px;
  color: var(--primary);
  background: var(--blue-6);
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media screen and (max-width: 959px) {
  .about {
    grid-template-columns: 1fr;
  }

  .about-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 18px;
    text-align: left;
    align-items: center;
  }

  .about-avatar {
    grid-row: 1 / 4;
    width: 76px;
    height: 76px;
  }

  .about-name {
    margin: 0 0 2px;
  }

  .about-tagline {
    margin: 0 0 8px;
  }

  .about-facts {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
    margin: 12px 0 0;
    padding: 12px 0;
  }

  .about-facts li {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 12px;
  }

  .about-rss {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 12px;
  }

  .about-body {
    padding: 24px 22px;
  }
}

@media screen and (max-width: 767px) {
  .post-card,
  .post-card-right {
    flex-direction: column;
    height: auto;
    margin-bottom: 20px;
  }

  .post-cover,
  .post-card-left .post-cover,
  .post-card-right .post-cover {
    width: 100%;
    flex: none;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius) var(--radius) 0 0;
    clip-path: none;
  }

  .post-body {
    padding: 14px 16px 16px;
  }

  .post-meta {
    justify-content: flex-start;
    gap: 4px 12px;
    font-size: 11.5px;
  }

  .post-title {
    font-size: 18px;
    margin: 9px 0 7px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .post-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .article {
    padding: 20px 18px 22px;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav-item.is-empty {
    display: none;
  }

  .friend-grid {
    grid-template-columns: 1fr;
  }

  .archive-group {
    padding: 16px 16px 10px;
  }

  .archive-tags {
    display: none;
  }

  .archive-item {
    gap: 10px;
  }

  .tag-cloud {
    padding: 16px;
    gap: 8px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-title-mark {
    font-size: 24px;
  }

  #search-panel {
    padding: 8vh 12px 12px;
  }

  .search-results {
    max-height: 60vh;
  }

  .not-found-code {
    font-size: 64px;
  }

  .pagination {
    padding: 8px 12px;
    gap: 6px;
    min-height: 52px;
  }

  .page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    font-size: 13px;
  }

  .page-nav-text {
    font-size: 12px;
  }
}

@media screen and (max-width: 479px) {
  .post-excerpt {
    display: none;
  }

  .post-body {
    padding: 12px 14px 14px;
  }

  .archive-date {
    font-size: 11.5px;
  }

  .search-footer {
    display: none;
  }
}


/* markdown.css */
/* ==========================================================================
   文章正文排版
   ========================================================================== */

.markdown-body {
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.markdown-body > *:first-child {
  margin-top: 0;
}

.markdown-body > *:last-child {
  margin-bottom: 0;
}

/* ------------------------------ 标题 ------------------------------ */

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  position: relative;
  margin: 1.9em 0 0.75em;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-strong);
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.markdown-body h1 {
  font-size: 27px;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border);
}

.markdown-body h2 {
  font-size: 23px;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}

/* h2 前面的小竖条 */
.markdown-body h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.9em;
  margin-right: 10px;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--blue-1), var(--blue-3));
  box-shadow: 0 0 8px rgba(61, 139, 255, 0.55);
}

.markdown-body h3 {
  font-size: 19px;
}

.markdown-body h4 {
  font-size: 17px;
}

.markdown-body h5,
.markdown-body h6 {
  font-size: 15px;
  color: var(--text-muted);
}

/* 标题锚点 */
.markdown-body .header-anchor {
  position: absolute;
  left: -0.85em;
  width: 0.85em;
  opacity: 0;
  color: var(--blue-3);
  font-weight: 400;
  text-decoration: none;
  transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.markdown-body h1:hover .header-anchor,
.markdown-body h2:hover .header-anchor,
.markdown-body h3:hover .header-anchor,
.markdown-body h4:hover .header-anchor {
  opacity: 1;
}

.markdown-body .header-anchor:hover {
  color: var(--primary);
}

/* ------------------------------ 段落与行内 ------------------------------ */

.markdown-body p {
  margin: 0 0 1.1em;
}

.markdown-body a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--blue-4);
  transition: all var(--t-fast) var(--ease);
}

.markdown-body a:hover {
  color: var(--primary-deep);
  border-bottom-color: var(--primary);
  background: var(--blue-6);
}

.markdown-body strong {
  font-weight: 700;
  color: var(--text-strong);
}

.markdown-body em {
  font-style: italic;
}

.markdown-body del {
  color: var(--text-faint);
  text-decoration-color: var(--text-faint);
}

.markdown-body sup,
.markdown-body sub {
  font-size: 0.75em;
  line-height: 0;
}

/* 行内代码 */
.markdown-body code {
  padding: 0.15em 0.42em;
  font-size: 0.86em;
  color: var(--primary);
  background: var(--blue-6);
  border: 1px solid var(--blue-5);
  border-radius: 5px;
  white-space: break-spaces;
}

[data-theme="dark"] .markdown-body code {
  color: var(--blue-1);
  background: rgba(74, 158, 255, 0.1);
  border-color: rgba(74, 158, 255, 0.16);
}

/* ------------------------------ 列表 ------------------------------ */

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.6em;
}

.markdown-body li {
  margin: 0.35em 0;
}

/* 松散列表里 li 会被 p 包一层，把段落间距收掉，不然项与项之间空太大 */
.markdown-body li > p {
  margin: 0 0 0.35em;
}

.markdown-body li > p:last-child {
  margin-bottom: 0;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin: 0.35em 0;
}

.markdown-body ul {
  list-style: none;
}

.markdown-body ul > li {
  position: relative;
}

.markdown-body ul > li::before {
  content: "";
  position: absolute;
  left: -1.05em;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue-3);
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body ol > li::marker {
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* 任务列表 */
.markdown-body .task-list-item {
  list-style: none;
}

.markdown-body .task-list-item::before {
  display: none;
}

.markdown-body .task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0 8px 0 -1.5em;
  vertical-align: -2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--wrap);
  position: relative;
  cursor: default;
}

.markdown-body .task-list-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.markdown-body .task-list-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg);
}

.markdown-body .task-list-item input[type="checkbox"] + * {
  vertical-align: middle;
}

/* ------------------------------ 引用 ------------------------------ */

.markdown-body blockquote {
  margin: 1.3em 0;
  padding: 12px 20px;
  color: var(--text-muted);
  background: var(--wrap-soft);
  border-left: 3px solid var(--blue-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body blockquote p {
  margin: 0 0 0.65em;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body blockquote blockquote {
  margin: 0.55em 0 0;
  padding: 8px 16px;
  background: transparent;
  border-left-color: var(--blue-4);
}

.markdown-body blockquote blockquote blockquote {
  border-left-color: var(--blue-5);
}

/* ------------------------------ 代码块 ------------------------------ */

.markdown-body .code-wrap {
  position: relative;
  margin: 1.3em 0;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: var(--wrap-soft);
  border-bottom: 1px solid var(--code-border);
}

[data-theme="dark"] .code-header {
  background: rgba(255, 255, 255, 0.045);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 5px;
  transition: all var(--t-fast) var(--ease);
}

.code-copy:hover {
  color: var(--primary);
  background: var(--blue-5);
}

.code-copy.is-copied {
  color: #2ea36b;
}

.code-copy svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.markdown-body pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--code-text);
  background: transparent;
  tab-size: 2;
}

.markdown-body pre code {
  display: block;
  padding: 0;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  white-space: pre;
}

/* 独立代码块（没有包 header 时也好看） */
.markdown-body > pre.code-block {
  margin: 1.3em 0;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  background: var(--code-bg);
}

/* ------------------------------ 表格 ------------------------------ */

.markdown-body .table-wrap {
  margin: 1.3em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.markdown-body th,
.markdown-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.markdown-body th {
  font-weight: 700;
  color: var(--text-strong);
  background: var(--wrap-soft);
  white-space: nowrap;
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.markdown-body tbody tr {
  transition: background var(--t-fast) var(--ease);
}

.markdown-body tbody tr:hover {
  background: var(--blue-6);
}

/* 对齐（markdown-it 输出 style="text-align:center"） */
.markdown-body th[style*="center"],
.markdown-body td[style*="center"] {
  text-align: center;
}

/* ------------------------------ 图片 ------------------------------ */

.markdown-body .md-image {
  display: block;
  margin: 1.4em auto;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  background: transparent;
  cursor: var(--cursor-pointer);
}

.markdown-body .md-image:hover {
  background: transparent;
}

.markdown-body img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  /* 双击不选中、不拖拽，避免触发系统浮动工具 */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.markdown-body .md-image img {
  box-shadow: none;
  transition: opacity var(--t) var(--ease);
}

.markdown-body .md-image:hover img {
  opacity: 0.92;
}

/* ------------------------------ 分割线 ------------------------------ */

.markdown-body hr {
  height: 1px;
  margin: 2.2em 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ------------------------------ 脚注 ------------------------------ */

.markdown-body .footnotes-sep {
  margin: 2.4em 0 1.2em;
}

.markdown-body .footnotes {
  font-size: 13px;
  color: var(--text-muted);
}

.markdown-body .footnotes-list {
  padding-left: 1.3em;
}

.markdown-body .footnote-item::marker {
  color: var(--primary);
}

.markdown-body .footnote-backref {
  border-bottom: 0;
  font-size: 1.1em;
  text-decoration: none;
}

.markdown-body .footnote-ref a {
  padding: 0 3px;
  border-bottom: 0;
  font-weight: 700;
}

/* ------------------------------ 内嵌 HTML ------------------------------ */

.markdown-body details {
  margin: 1.2em 0;
  padding: 12px 18px;
  background: var(--wrap-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.markdown-body details[open] {
  padding-bottom: 16px;
}

.markdown-body summary {
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  outline: none;
  user-select: none;
}

.markdown-body summary::marker {
  color: var(--primary);
}

.markdown-body kbd {
  margin: 0 1px;
}

/* ------------------------------ 中文标点微调 ------------------------------ */

.markdown-body p,
.markdown-body li {
  text-align: justify;
  text-justify: inter-ideograph;
}

@media screen and (max-width: 767px) {
  .markdown-body {
    font-size: 15px;
    line-height: 1.85;
  }

  .markdown-body h1 {
    font-size: 22px;
  }

  .markdown-body h2 {
    font-size: 19px;
  }

  .markdown-body h3 {
    font-size: 17px;
  }

  .markdown-body pre {
    font-size: 12.5px;
    padding: 14px;
  }

  .markdown-body table {
    font-size: 13px;
  }

  .markdown-body th,
  .markdown-body td {
    padding: 7px 10px;
  }
}


/* highlight.css */
/* ==========================================================================
   代码高亮（highlight.js 类名 → 主题变量）
   ========================================================================== */

.hljs-comment,
.hljs-quote {
  color: var(--code-comment);
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-doctag,
.hljs-formula {
  color: var(--code-keyword);
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: var(--code-string);
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: var(--code-number);
}

.hljs-title,
.hljs-title.class_,
.hljs-title.function_,
.hljs-section,
.hljs-name {
  color: var(--code-function);
  font-weight: 600;
}

.hljs-attr,
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-params {
  color: var(--code-attr);
}

.hljs-built_in,
.hljs-class .hljs-title,
.hljs-params .hljs-built_in {
  color: var(--code-builtin);
}

.hljs-meta,
.hljs-meta .hljs-keyword {
  color: var(--code-comment);
}

.hljs-tag {
  color: var(--code-tag);
}

.hljs-subst {
  color: var(--code-variable);
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

.hljs-deletion {
  color: #d95c5c;
  background: rgba(217, 92, 92, 0.1);
}

.hljs-addition {
  color: var(--code-string);
  background: rgba(46, 163, 107, 0.1);
}

/* 选中代码时的背景 */
.markdown-body pre ::selection {
  background: rgba(61, 139, 255, 0.3);
}
