/*
 * Notion Lite Blog — v3 大改版
 * 参考 makuraryu.ink: 全屏 hero + 视差淡出 + 毛玻璃卡片
 * 浅蓝治愈色系
 */

/* ─── CSS 变量 ─────────────────────────────────────── */
:root {
  /* 浅蓝治愈主色调 */
  --bg-main: #7aafc4;
  --bg-main-dark: #5d96ad;
  --bg-hero-text: rgba(255, 255, 255, 0.18);
  --hero-image-opacity: 0.38;
  --hero-image-filter: saturate(90%) contrast(102%) brightness(94%);
  --hero-image-overlay: linear-gradient(180deg, rgba(122, 175, 196, 0.28) 0%, rgba(93, 150, 173, 0.40) 100%);

  --card-bg: rgba(224, 238, 246, 0.34);
  --card-border: rgba(255, 255, 255, 0.14);
  --card-shadow: 0 10px 30px rgba(18, 44, 60, 0.08);
  --card-radius: 24px;

  --fg: #2c4a5a;
  --fg-secondary: rgba(44, 74, 90, 0.6);
  --fg-tertiary: rgba(44, 74, 90, 0.35);

  --accent: #3d8fb0;
  --accent-soft: rgba(61, 143, 176, 0.10);

  --tag-bg: rgba(61, 143, 176, 0.08);
  --tag-color: #3d8fb0;

  --nav-bg: rgba(255, 255, 255, 0.55);
  --nav-active: #2c6e8a;
  --nav-link-color: rgba(44, 74, 90, 0.76);
  --nav-link-hover-color: #234051;

  --code-bg: #f0f5f8;
  --code-border: #d4e3ec;

  --blockquote-border: #a0c4d4;
  --blockquote-bg: rgba(61, 143, 176, 0.04);
  --blockquote-hover-bg: rgba(61, 143, 176, 0.10);
  --toc-link-color: rgba(44, 74, 90, 0.56);
  --toc-link-hover-color: #2c6e8a;

  --font-serif: 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

.dark-mode {
  --bg-main: #152a36;
  --bg-main-dark: #0d1e28;
  --bg-hero-text: rgba(140, 190, 210, 0.08);
  --hero-image-opacity: 0.32;
  --hero-image-filter: saturate(82%) contrast(108%) brightness(82%);
  --hero-image-overlay: linear-gradient(180deg, rgba(21, 42, 54, 0.34) 0%, rgba(13, 30, 40, 0.56) 100%);

  --card-bg: rgba(16, 36, 48, 0.46);
  --card-border: rgba(132, 188, 214, 0.14);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);

  --fg: rgba(210, 230, 240, 0.92);
  --fg-secondary: rgba(170, 200, 215, 0.6);
  --fg-tertiary: rgba(140, 175, 195, 0.35);

  --accent: #6ec0de;
  --accent-soft: rgba(110, 192, 222, 0.10);

  --tag-bg: rgba(110, 192, 222, 0.10);
  --tag-color: #6ec0de;

  --nav-bg: rgba(15, 30, 40, 0.65);
  --nav-active: #8ad4f0;
  --nav-link-color: rgba(191, 221, 236, 0.78);
  --nav-link-hover-color: rgba(223, 241, 250, 0.96);

  --code-bg: rgba(8, 18, 26, 0.9);
  --code-border: rgba(50, 80, 100, 0.5);

  --blockquote-border: #4a8ca0;
  --blockquote-bg: rgba(110, 192, 222, 0.04);
  --blockquote-hover-bg: rgba(110, 192, 222, 0.12);
  --toc-link-color: rgba(161, 199, 217, 0.70);
  --toc-link-hover-color: #8ad4f0;
}

/* ─── 基础重置 ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  position: relative;
  isolation: isolate;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--fg);
  background: var(--bg-main);
  min-height: 100vh;
  transition: color 0.4s, background 0.4s;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s, opacity 0.25s;
}

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

::-webkit-scrollbar {
  width: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* ─── 导航栏（pill 浮动） ─────────────────────────── */
.site-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link {
  padding: 7px 18px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 540;
  color: var(--nav-link-color);
  transition: all 0.25s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--nav-link-hover-color);
  background: var(--accent-soft);
}

.nav-link.active {
  color: var(--nav-active);
  font-weight: 600;
}

.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--fg-secondary);
  transition: all 0.25s;
}

.dark-mode-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-moon {
  display: none;
}

.dark-mode .icon-sun {
  display: none;
}

.dark-mode .icon-moon {
  display: block;
}

/* ─── 全屏 Hero（参考 makuraryu.ink） ─────────────── */
.hero-fullscreen {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg-text {
  position: fixed;
  font-family: var(--font-serif);
  color: var(--bg-hero-text);
  pointer-events: none;
  z-index: 1;
  user-select: none;
  transition: opacity 0.1s linear;
}

.hero-bg-text-watermark {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22vw;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1;
}

.hero-bg-text-headline {
  top: clamp(96px, 11vh, 152px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 1500px);
  text-align: left;
  white-space: normal;
  font-size: clamp(44px, 7.5vw, 116px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.26;
  color: rgba(44, 74, 90, 0.72);
  text-wrap: balance;
}

body:not(.has-hero-image).hero-text-headline .hero-bg-text-headline {
  color: rgba(44, 74, 90, 0.90);
}

body.has-hero-image.hero-text-headline .hero-bg-text-headline {
  color: rgba(44, 74, 90, 0.72);
}

.dark-mode .hero-bg-text-headline {
  color: rgba(170, 208, 224, 0.32);
}

.hero-bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: var(--hero-image-opacity);
  filter: var(--hero-image-filter);
  transform: scale(1.03);
}

.hero-bg-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-image-overlay);
}

/* 浅色模式：有背景图时保留大字、去掉浅蓝遮罩层 */
html:not(.dark-mode) body.has-hero-image .hero-bg-text {
  color: var(--bg-hero-text);
}

html:not(.dark-mode) body.has-hero-image .hero-bg-image {
  opacity: 1;
}

html:not(.dark-mode) body.has-hero-image .hero-bg-image::after {
  background: transparent;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  animation: hint-bounce 2s ease-in-out infinite;
}

.hero-scroll-hint svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.5);
}

@keyframes hint-bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ─── 主内容区（毛玻璃卡片，跟 makuraryu 一样浮在 hero 下方） ── */
.site-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  margin: -5vh auto 0;
  /* 让卡片覆盖到 hero 底部一点 */
  padding: 0 20px 60px;
}

.content-card {
  background: var(--card-bg);
  backdrop-filter: saturate(138%) blur(28px);
  -webkit-backdrop-filter: saturate(138%) blur(28px);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 48px 44px;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

/* 浅色 + 背景图：单独提升卡片内文字对比度，避免内容发灰难读 */
html:not(.dark-mode) body.has-hero-image .content-card {
  --fg: rgba(23, 49, 64, 0.98);
  --fg-secondary: rgba(23, 49, 64, 0.84);
  --fg-tertiary: rgba(23, 49, 64, 0.66);
  --toc-link-color: rgba(23, 49, 64, 0.72);
  --toc-link-hover-color: #1f5f7d;
}

/* ─── 页面标题区 ──────────────────────────────────── */
.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.page-subtitle {
  color: var(--fg-secondary);
  font-size: 0.92rem;
  margin-top: 8px;
}

/* ─── 首页 intro 卡片 ────────────────────────────── */
.intro-section {
  margin-bottom: 32px;
}

.intro-greeting {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--fg-secondary);
}

.intro-text {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  line-height: 1.8;
}

.intro-text a {
  color: var(--accent);
  border-bottom: 1px dashed var(--accent);
}

.intro-text a:hover {
  opacity: 0.7;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ─── 文章时间线（参考 makuraryu /archive） ────── */
.archive-list {
  margin-top: 12px;
}

.archive-year {
  margin-bottom: 28px;
}

.archive-year-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
  padding-left: 4px;
}

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

.archive-entry {
  position: relative;
  padding: 8px 4px 8px 16px;
  border-left: 2px solid var(--card-border);
  transition: all 0.3s ease;
}

.archive-entry:hover {
  border-left-color: var(--accent);
  padding-left: 20px;
}

.archive-entry-link {
  display: block;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg);
  transition: color 0.25s;
}

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

/* 时间和标签：默认隐藏，hover 显示 */
.archive-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.archive-entry:hover .archive-entry-meta {
  max-height: 40px;
  opacity: 1;
  margin-top: 4px;
}

.archive-entry-date {
  font-size: 0.78rem;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ─── 标签 ────────────────────────────────────────── */
.tag-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--tag-color);
  transition: all 0.2s;
}

.tag-badge:hover {
  background: var(--accent-soft);
}

/* 标签云 */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 24px;
  background: var(--accent-soft);
  border: 1px solid var(--card-border);
  font-size: 0.88rem;
  transition: all 0.25s;
}

.tag-cloud-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(61, 143, 176, 0.25);
}

.tag-cloud-item:hover .tag-cloud-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.tag-cloud-count {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.25s;
}

/* ─── 文章详情页 ──────────────────────────────────── */
.post-header {
  text-align: center;
  margin-bottom: 36px;
}

.post-icon-hero {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
}

.post-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.post-date {
  font-size: 0.82rem;
  color: var(--fg-tertiary);
}

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-description {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── 文章内容 & 引用交互（参考 makuraryu） ────── */
.post-content {
  min-width: 0;
}

/* 引用hover效果：左边竖线变细 + 整体左移 + 文字对比度拉高 */
.post-content .notion-quote {
  position: relative;
  padding: 12px 16px 12px 20px;
  border-left: 3px solid var(--blockquote-border);
  background: var(--blockquote-bg);
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  transition: all 0.35s ease;
  color: var(--fg-secondary);
  font-style: normal;
  line-height: 1.85;
}

.post-content .notion-quote:hover {
  border-left-width: 2px;
  padding-left: 24px;
  transform: translateX(-4px);
  color: var(--fg);
  background: var(--blockquote-hover-bg);
}

.post-content .notion-quote .notion-quote-children {
  margin-top: 12px;
}

.post-content .notion-quote .notion-quote {
  margin: 12px 0 0;
  border-left-width: 2px;
}

.post-content .notion-quote .notion-text {
  color: inherit;
}

.post-content .notion-quote.quote-preview-hover {
  border-left-width: 2px;
  padding-left: 24px;
  transform: translateX(-4px);
  color: var(--fg);
  background: var(--blockquote-hover-bg);
}

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

.quote-compare-item {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.dark-mode .quote-compare-item {
  background: rgba(255, 255, 255, 0.03);
}

.quote-compare-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-tertiary);
  margin-bottom: 8px;
}

/* Image Zoom */
.zoomable-image {
  cursor: zoom-in;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.zoomable-image:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(5, 18, 30, 0.20);
}

body.image-zoom-open {
  overflow: hidden;
}

.image-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 3vw;
  background: rgba(8, 20, 30, 0.74);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.image-zoom-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.image-zoom-media {
  max-width: min(94vw, 1440px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.image-zoom-caption {
  position: absolute;
  left: 50%;
  bottom: 2.5vh;
  transform: translateX(-50%);
  max-width: min(92vw, 900px);
  text-align: center;
  color: rgba(234, 245, 252, 0.9);
  font-size: 0.86rem;
  line-height: 1.55;
}

.image-zoom-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(12, 26, 38, 0.6);
  color: rgba(235, 248, 255, 0.96);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.image-zoom-close:hover {
  background: rgba(22, 42, 62, 0.85);
}

.dark-mode .image-zoom-overlay {
  background: rgba(3, 10, 16, 0.84);
}

/* LaTeX (KaTeX) */
.katex {
  color: inherit;
}

.notion-inline-equation {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  vertical-align: baseline;
}

.notion-equation-block {
  margin: 16px 0;
  overflow-x: auto;
}

.notion-equation {
  display: block;
  min-width: fit-content;
  text-align: center;
  padding: 6px 0;
}

.notion-equation .katex-display {
  margin: 0.5em 0;
}

/* TOC 侧边栏 */
.post-content-wrapper {
  display: flex;
  gap: 40px;
}

.post-toc-sidebar {
  display: none;
  position: sticky;
  top: 90px;
  align-self: flex-start;
  width: 200px;
  flex-shrink: 0;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

@media (min-width: 1100px) {
  .site-content {
    max-width: 1060px;
  }

  .content-card {
    padding: 48px 56px;
  }

  .post-toc-sidebar {
    display: block;
  }
}

.toc-header {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--toc-link-color);
  margin-bottom: 12px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: block;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: var(--toc-link-color);
  border-left: 2px solid var(--card-border);
  transition: all 0.2s;
  line-height: 1.5;
}

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

.toc-level-2 {
  padding-left: 24px;
}

.toc-level-3 {
  padding-left: 36px;
  font-size: 0.76rem;
}

/* 文章底部 */
.post-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.88rem;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

/* ─── 关于页 ──────────────────────────────────────── */
.about-page .about-intro {
  text-align: center;
  margin-bottom: 32px;
}

.about-avatar {
  display: block;
  width: 88px;
  height: 88px;
  margin: 8px auto 14px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--card-border);
  box-shadow: 0 8px 24px rgba(22, 72, 96, 0.12);
}

.dark-mode .about-avatar {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.about-name {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-bio {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

.about-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.about-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 参考 makuraryu: 鼠标移上去会"弹跳"上去 */
.about-social-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(61, 143, 176, 0.3);
}

.about-section {
  margin-top: 36px;
}

.about-notion-content {
  color: var(--fg);
}

.about-notion-content>*:first-child {
  margin-top: 0;
}

.about-notion-content>*:last-child {
  margin-bottom: 0;
}

.about-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}

.about-section p {
  color: var(--fg-secondary);
  line-height: 1.8;
  font-size: 0.92rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.about-stat-card {
  text-align: center;
  padding: 16px 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--card-border);
  transition: all 0.25s;
}

.about-stat-card:hover {
  transform: translateY(-2px);
}

.about-stat-value {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.about-stat-label {
  font-size: 0.78rem;
  color: var(--fg-tertiary);
  margin-top: 2px;
}

/* ─── 代码块 ─────────────────────────────────────── */
.notion-code-wrapper {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--code-border);
  margin: 16px 0;
}

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

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 0.73rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.code-copy-btn:hover {
  color: var(--fg);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.code-copy-btn.copied {
  color: #16a34a;
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

.dark-mode .code-copy-btn {
  color: rgba(220, 236, 245, 0.82);
  border-color: rgba(122, 166, 188, 0.50);
  background: rgba(12, 26, 38, 0.28);
}

.dark-mode .code-copy-btn:hover {
  color: rgba(235, 246, 252, 0.95);
  border-color: rgba(138, 191, 219, 0.72);
  background: rgba(30, 66, 88, 0.38);
}

.code-copy-btn svg {
  flex-shrink: 0;
}

/* ─── 页脚 ────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 32px 20px 40px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.site-footer p {
  font-size: 0.82rem;
  line-height: 1.8;
}

.site-footer .footer-line {
  margin: 0;
  white-space: nowrap;
}

.site-footer .footer-item,
.site-footer .footer-sep {
  display: inline;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.2s;
}

.site-footer a:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* 浅色模式下页脚提高对比度，避免与背景图融在一起 */
html:not(.dark-mode) .site-footer {
  color: rgba(31, 61, 78, 0.90);
}

html:not(.dark-mode) body.has-hero-image .site-footer .footer-line {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(44, 74, 90, 0.12);
  box-shadow: 0 4px 18px rgba(20, 44, 58, 0.12);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}

html:not(.dark-mode) .site-footer a {
  color: #2c6e8a;
  font-weight: 600;
}

html:not(.dark-mode) .site-footer a:hover {
  color: #1f546b;
}

/* ─── 淡入动画 ────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 404 页面 ─────────────────────────────────────── */
.not-found-page {
  text-align: center;
  padding: 12px 4px 4px;
}

.not-found-code {
  font-family: var(--font-serif);
  font-size: clamp(72px, 18vw, 156px);
  font-weight: 700;
  line-height: 0.9;
  color: var(--accent);
  opacity: 0.36;
}

.not-found-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.8vw, 46px);
  margin-top: 6px;
  color: var(--fg);
}

.not-found-desc {
  margin: 14px auto 0;
  max-width: 560px;
  color: var(--fg-secondary);
  line-height: 1.8;
}

.not-found-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.not-found-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
}

.not-found-btn.is-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.not-found-tip {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--fg-tertiary);
}

/* ─── 响应式 ──────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    top: 12px;
    left: 8px;
    right: 8px;
    transform: none;
  }

  .header-inner {
    justify-content: center;
    padding: 4px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-content {
    padding: 0 12px 40px;
    margin-top: -3vh;
  }

  .content-card {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .hero-bg-text-watermark {
    font-size: 30vw;
  }

  .hero-bg-text-headline {
    top: 104px;
    width: 92vw;
    font-size: clamp(32px, 9.8vw, 58px);
    line-height: 1.32;
  }

  .hero-bg-image {
    background-position: center 30%;
    opacity: calc(var(--hero-image-opacity) + 0.08);
  }

  .post-title {
    font-size: 1.5rem;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .post-content-wrapper {
    flex-direction: column;
  }

  .quote-compare {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer .footer-line {
    display: inline-block;
    white-space: normal;
    text-align: center;
    line-height: 1.55;
  }

  body:not(.has-hero-image) .site-footer .footer-line {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .site-footer .footer-item {
    display: block;
  }

  .site-footer .footer-sep {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-bg-text-watermark {
    font-size: 38vw;
  }

  .hero-bg-text-headline {
    top: 94px;
    width: 94vw;
    font-size: clamp(28px, 10.8vw, 46px);
    line-height: 1.34;
  }

  .content-card {
    padding: 24px 16px;
    border-radius: 16px;
  }
}
