/* --------------------------------------------------------------------------
 Semt0 博客：日间浅蓝 · 夜间深紫（基于 zhangpl24.github.io 配置）
 -------------------------------------------------------------------------- */

@import url("https://cdn.jsdelivr.net/npm/webfont-lxgw-wenkai@1.0.0/style.min.css");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Newsreader:opsz,wght@6..72,400..700&display=swap");

/* 顶栏头像圆角 */
.md-header__button.md-logo {
  border-radius: 50%;
  overflow: hidden;
}

.md-header__button.md-logo img {
  border-radius: 50%;
}

/* --- 日间 default：浅蓝层次 ------------------------------------------------ */
[data-md-color-scheme="default"] {
  --zen-surface: #ffffff;
  --zen-surface-raised: #ffffff;
  --zen-surface-muted: #e2e8f0;
  --zen-border: rgba(20, 80, 120, 0.08);

  --zen-card-radius: 12px;
  --zen-card-bg: rgba(255, 255, 255, 0.86);
  --zen-card-bg-hover: rgba(255, 255, 255, 0.93);
  --zen-card-border: color-mix(in srgb, var(--md-typeset-a-color) 10%, rgba(15, 45, 70, 0.12));
  --zen-card-border-hover: color-mix(in srgb, var(--md-typeset-a-color) 36%, rgba(15, 45, 70, 0.14));
  --zen-card-shadow: 0 0.12rem 0.42rem rgba(10, 40, 70, 0.06);
  --zen-card-shadow-hover: 0 0.28rem 0.9rem rgba(10, 50, 85, 0.14);
  --zen-card-ring: color-mix(in srgb, var(--md-typeset-a-color) 45%, transparent);

  --md-default-bg-color: var(--zen-surface);
  --md-default-bg-color--light: #ffffff;
  --md-default-bg-color--lighter: var(--zen-surface-muted);
  --md-default-bg-color--lightest: #cbd5e1;

  --md-default-fg-color: rgba(15, 45, 70, 0.92);
  --md-default-fg-color--light: rgba(25, 60, 88, 0.72);
  --md-default-fg-color--lighter: rgba(30, 70, 100, 0.48);
  --md-default-fg-color--lightest: rgba(20, 65, 95, 0.14);

  --md-code-fg-color: #1a3a52;
  --md-code-bg-color: #e2e8f0;
  --md-code-bg-color--light: #f1f5f9;
  --md-code-bg-color--lighter: rgba(12, 90, 140, 0.08);

  --md-typeset-a-color: #0277bd;
  --md-typeset-mark-color: rgba(2, 136, 209, 0.15);
}

/* 日间模式：主内容背景保持纯白 */
[data-md-color-scheme="default"] .md-main::before {
  opacity: 0;
}

/* --- 夜间 slate：深紫相 + 可读链接 ---------------------------------------- */
[data-md-color-scheme="slate"] {
  --md-hue: 278;
}

[data-md-color-scheme="slate"][data-md-color-primary="deep-purple"] {
  --md-typeset-a-color: #c4a7ff;
}

[data-md-color-scheme="slate"][data-md-color-accent="purple"] {
  --md-accent-fg-color: #e879f9;
  --md-accent-fg-color--transparent: rgba(232, 121, 249, 0.18);
}

/* --- 夜间模式：导航栏和目录紫色高亮 ---------------------------------------- */
[data-md-color-scheme="slate"] .md-nav__link--active {
  color: #e879f9 !important;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-nav__link--active::before {
  background-color: #e879f9;
}

[data-md-color-scheme="slate"] .md-nav__item .md-nav__link--active {
  color: #e879f9 !important;
}

/* 目录当前项高亮 */
[data-md-color-scheme="slate"] .md-nav__link[href]:hover {
  color: #c4a7ff;
}

/* 侧边栏导航当前选中项 */
[data-md-color-scheme="slate"] .md-nav__link--active .md-nav__icon {
  color: #e879f9;
}

/* TOC 目录当前项 */
[data-md-color-scheme="slate"] .md-toc__link--active {
  color: #e879f9 !important;
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-toc__link--active::before {
  background-color: #e879f9;
}

/* 二级导航高亮 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link--active {
  color: #e879f9 !important;
}

/* 导航链接悬停效果 */
[data-md-color-scheme="slate"] .md-nav__link:hover {
  color: #c4a7ff;
}

.sakura-cursor-toggle {
  position: relative;
  margin-right: 0.02rem;
  color: var(--md-default-fg-color--light, #64748b);
  transition: color 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.sakura-cursor-toggle:hover {
  color: #f472b6;
  transform: translateY(-1px);
}

.sakura-cursor-toggle.is-active {
  color: #ec4899;
}

.sakura-cursor-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-md-color-scheme="slate"] .sakura-cursor-toggle {
  color: rgba(226, 232, 240, 0.72);
}

[data-md-color-scheme="slate"] .sakura-cursor-toggle:hover {
  color: #f9a8d4;
}

[data-md-color-scheme="slate"] .sakura-cursor-toggle.is-active {
  color: #f472b6;
}

/* --- 排版：标题衬线（拉丁由 Newsreader 渲染，中文回退到 Noto Sans SC）------ */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-family: "Newsreader", "LXGW WenKai", serif;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.md-typeset {
  font-size: 0.93rem;
  line-height: 1.72;
}

.md-typeset a:not(.md-button):not(.zen-post-card) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--md-typeset-a-color) 35%, transparent);
  text-underline-offset: 0.2em;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

.md-typeset a:not(.md-button):not(.zen-post-card):hover {
  text-decoration-color: var(--md-typeset-a-color);
}

/* --- 壳层：顶栏、侧栏、主栏 ------------------------------------------------ */
.md-header {
  box-shadow:
    0 0.05rem 0 var(--zen-border, rgba(0, 0, 0, 0.06)),
    0 0.15rem 0.6rem rgba(15, 50, 80, 0.06);
}

[data-md-color-scheme="slate"] .md-header {
  box-shadow:
    0 0.05rem 0 rgba(200, 180, 255, 0.08),
    0 0.2rem 0.8rem rgba(0, 0, 0, 0.35);
}

.md-sidebar--primary {
  border-right: 1px solid var(--zen-border, var(--md-default-fg-color--lightest));
}

.md-nav__link--active {
  font-weight: 600;
}

.md-main {
  position: relative;
}

/* 轻噪点（不参与交互） */
.md-main::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 夜间：深紫灰背景 + 纸张纹理质感（参考 zhangpl24 风格） */
[data-md-color-scheme="slate"] {
  --md-hue: 278;
  /* 深紫灰色背景，亮度适中不刺眼 */
  --md-default-bg-color: hsla(var(--md-hue), 15%, 13%, 1);
  --md-default-bg-color--light: hsla(var(--md-hue), 15%, 16%, 1);
  --md-default-bg-color--lighter: hsla(var(--md-hue), 15%, 20%, 1);
  --md-default-bg-color--lightest: hsla(var(--md-hue), 15%, 25%, 0.35);
  /* 主内容区与侧边栏层次区分 */
  --zen-slate-main-bg: hsla(var(--md-hue), 14%, 15.5%, 1);
  --zen-slate-sidebar-bg: hsla(var(--md-hue), 16%, 11%, 1);
  --zen-slate-border: hsla(var(--md-hue), 18%, 22%, 0.35);

  --zen-card-radius: 12px;
  --zen-card-bg: hsla(var(--md-hue), 15%, 18%, 0.66);
  --zen-card-bg-hover: hsla(var(--md-hue), 15%, 22%, 0.68);
  --zen-card-border: hsla(var(--md-hue), 18%, 28%, 0.55);
  --zen-card-border-hover: hsla(var(--md-hue), 60%, 68%, 0.55);
  --zen-card-shadow: 0 0.22rem 0.7rem rgba(0, 0, 0, 0.28);
  --zen-card-shadow-hover: 0 0.38rem 1.05rem rgba(0, 0, 0, 0.45);
  --zen-card-ring: hsla(var(--md-hue), 60%, 70%, 0.6);
}

/* 优化主题切换性能：禁用颜色属性的过渡效果 */
.md-main,
.md-content,
.md-sidebar,
.md-sidebar__inner,
.md-nav,
.md-typeset,
body {
  transition: none !important;
}

[data-md-color-scheme="slate"] html {
  background-color: hsla(278, 15%, 13%, 1);
}

[data-md-color-scheme="slate"] body {
  background-color: hsla(278, 15%, 13%, 1) !important;
  background-image: none;
}

/* 首页背景统一，不区分主内容区和侧边栏 */
[data-md-color-scheme="slate"] .md-main .md-content,
[data-md-color-scheme="slate"] .md-sidebar--primary .md-sidebar__inner {
  background-color: transparent;
}

[data-md-color-scheme="slate"] .md-sidebar--primary {
  border-right-color: var(--zen-slate-border);
}

[data-md-color-scheme="slate"] .md-main::before {
  opacity: 0;
}

/* 减少动画偏好：主题切换时禁用过渡 */
@media (prefers-reduced-motion: reduce) {
  [data-md-color-scheme="slate"] body,
  [data-md-color-scheme="slate"] .md-main,
  [data-md-color-scheme="slate"] .md-content,
  [data-md-color-scheme="slate"] .home-section,
  [data-md-color-scheme="slate"] .nav-card,
  [data-md-color-scheme="slate"] .zen-post-card {
    transition: none !important;
  }
}

.md-content {
  position: relative;
  z-index: 1;
}

/* --- 组件：代码块、提示框、表格、引用 -------------------------------------- */
.md-typeset pre {
  border-radius: 0.45rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 0.1rem 0.35rem rgba(10, 40, 70, 0.06);
}

[data-md-color-scheme="slate"] .md-typeset pre {
  border-color: rgba(200, 180, 255, 0.12);
  box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.25);
}

.md-typeset .admonition {
  border-radius: 0.45rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 0.08rem 0.3rem rgba(10, 40, 70, 0.05);
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .md-typeset .admonition:hover {
    box-shadow: 0 0.2rem 0.55rem rgba(10, 40, 70, 0.1);
    transform: translateY(-1px);
  }

  [data-md-color-scheme="slate"] .md-typeset .admonition:hover {
    box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.35);
  }
}

.md-typeset blockquote {
  border-left-width: 0.22rem;
  border-radius: 0 0.35rem 0.35rem 0;
  background-color: var(--md-default-bg-color--lighter);
}

.md-typeset table:not([class]) {
  border-radius: 0.4rem;
  overflow: hidden;
  box-shadow: 0 0.06rem 0.25rem rgba(10, 40, 70, 0.06);
}

/* --- 文章列表卡片 ---------------------------------------------------------- */
.zen-post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 40rem;
}

.zen-post-card {
  display: block;
  padding: 1.15rem 1.35rem;
  border-radius: var(--zen-card-radius);
  text-decoration: none !important;
  color: inherit !important;
  background: var(--zen-card-bg);
  background-image: radial-gradient(
    120% 85% at 18% 12%,
    color-mix(in srgb, var(--md-typeset-a-color) 12%, transparent) 0%,
    transparent 62%
  );
  border: 1px solid var(--zen-card-border);
  box-shadow: var(--zen-card-shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    background 0.25s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.zen-post-card:hover {
  background: var(--zen-card-bg-hover);
  border-color: var(--zen-card-border-hover);
  box-shadow: var(--zen-card-shadow-hover);
}

.zen-post-card:focus-visible {
  outline: 2px solid var(--zen-card-ring);
  outline-offset: 3px;
}

.zen-post-card__title {
  display: block;
  font-family: "Newsreader", "LXGW WenKai", serif;
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--md-typeset-color, var(--md-default-fg-color));
  margin-bottom: 0.35rem;
}

.zen-post-card__meta {
  display: block;
  font-size: 0.82rem;
  color: var(--md-default-fg-color--light);
}

@media (prefers-reduced-motion: no-preference) {
  .zen-post-card:hover {
    transform: translateY(-3px);
  }
}

/* 首页扉页式导语 */
.zen-lead {
  font-size: 1.05rem;
  color: var(--md-default-fg-color--light);
  max-width: 42rem;
  padding: 0.75rem 0 0.25rem;
  margin: 0 0 1rem !important;
  border-left: 3px solid color-mix(in srgb, var(--md-typeset-a-color) 55%, transparent);
  padding-left: 1rem;
}

.zen-lead p {
  margin: 0.4em 0;
}

.zen-lead p:first-child {
  margin-top: 0;
}

.zen-lead p:last-child {
  margin-bottom: 0;
}

/* --- Instant 导航：主内容入场 ---------------------------------------------- */
@keyframes zen-content-enter {
  from {
    opacity: 0;
    transform: translateY(0.55rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

article.md-content__inner.zen-content-enter {
  animation: zen-content-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 文章标题淡入动画 */
@keyframes title-fade-in {
  from {
    opacity: 0;
    transform: translateY(-0.3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.md-typeset h1 {
  opacity: 0;
  animation: title-fade-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset h1 {
    opacity: 1;
    animation: none !important;
  }

  article.md-content__inner.zen-content-enter {
    animation: none !important;
  }
  article.md-content__inner.zen-content-enter {
    animation: none !important;
  }

  .md-typeset .admonition {
    transition: none;
  }

  .md-typeset .admonition:hover {
    transform: none;
  }

  .zen-post-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .zen-post-card:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
 以下是 Semt0 博客的自定义样式（保留原有功能）
 -------------------------------------------------------------------------- */

/* 全局性能优化 */
html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "LXGW WenKai",
    "Noto Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 400;
  /* 优化文字渲染 */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code,
pre,
kbd,
samp,
.md-typeset code,
.md-typeset pre code {
  font-family:
    "JetBrains Mono",
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-variant-ligatures: none;
}

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

/* 返回顶部按钮字体 */
button.md-top {
  font-family:
    "LXGW WenKai",
    "Noto Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  font-weight: 700;
}

/* Blog / Notes / Friends 页面正文字号调大 */
.md-typeset {
  font-size: 0.93rem;
  line-height: 1.75;
}

/* 页面日期标签 */
.page-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: -0.5rem 0 1.2rem;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light, #64748b);
}

.page-date svg {
  opacity: 0.6;
}

[data-md-color-scheme="slate"] .page-date {
  color: rgba(148, 163, 184, 0.85);
}

/* Admonition (tip/note/warning等) 块字号调回正常 */
.md-typeset .admonition {
  font-size: inherit;
}

.md-typeset .admonition p,
.md-typeset .admonition ul,
.md-typeset .admonition ol,
.md-typeset .admonition li {
  font-size: inherit;
}

.md-typeset .admonition-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.md-typeset .admonition.summary,
.md-typeset details.summary {
  font-size: 1rem;
  line-height: 1.75;
}

.md-typeset .admonition.summary .admonition-title,
.md-typeset details.summary summary {
  font-size: 0.95rem;
}

.md-typeset .admonition.summary pre,
.md-typeset details.summary pre {
  font-size: 0.9em;
}

.md-typeset .admonition.summary pre code,
.md-typeset details.summary pre code {
  white-space: pre-wrap;
}

/* 折叠类型的 Details 块 (???+ example/question 等) */
.md-typeset details {
  font-size: inherit;
}

.md-typeset details summary {
  font-size: 0.9rem;
  font-weight: 600;
}

.md-typeset details p,
.md-typeset details ul,
.md-typeset details ol,
.md-typeset details li {
  font-size: inherit;
}

/* 具体类型的 Details (example, question, info, warning 等) */
.md-typeset details.example,
.md-typeset details.question,
.md-typeset details.info,
.md-typeset details.warning,
.md-typeset details.danger,
.md-typeset details.success,
.md-typeset details.note {
  font-size: inherit;
}

.md-typeset details.example p,
.md-typeset details.question p,
.md-typeset details.info p,
.md-typeset details.warning p,
.md-typeset details.danger p,
.md-typeset details.success p,
.md-typeset details.note p {
  font-size: inherit;
}

/* 正文区数学公式与文字协调（KaTeX 默认 1.21em 会偏大） */
.md-typeset .katex { font-size: 1em; }
.md-typeset .katex-display { font-size: 1em; }

/* 主页整体：更满，减少上下左右留白 */
.md-main__inner {
  padding-top: 1.75rem;
  padding-bottom: 2rem;
  max-width: min(1720px, 99vw);
  margin-left: auto;
  margin-right: auto;
}

/* ===== 主页 Hero ===== */
.home-layout {
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
  max-width: 100%;
}

.home-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  min-width: 0;
  min-height: 80vh;
  max-width: 1040px;
  margin: 0 auto;
  padding-top: 9vh;
  padding-bottom: 21vh;
  box-sizing: border-box;
}

.home-intro {
  flex: 0 1 auto;
  max-width: 520px;
  min-width: 0;
  padding: 0 0 1.5rem 0;
  background: none;
  border: none;
  box-shadow: none;
}

/* 个人介绍：每个单词依次淡入 - 性能优化 */
@keyframes home-intro-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.home-hero .home-intro-word {
  opacity: 0;
  animation: home-intro-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  display: inline-block;
  /* GPU 加速 */
  will-change: opacity, transform;
  backface-visibility: hidden;
}

/* 动画完成后移除 will-change 以释放资源 */
.home-hero .home-intro-word[style*="animation-delay"] {
  animation-fill-mode: both;
}

.home-hero .home-avatar-wrap {
  opacity: 1;
  animation: none;
}

.home-title {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
}

.home-subtitle {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light, #64748b);
}

/* CodeTime 徽章 + 社交图标行 */
.home-social-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
  /* 初始完全隐藏，防止预加载闪烁 */
  opacity: 0;
  visibility: hidden;
  /* 动画由 JS 动态设置 animation-delay 后添加 */
  will-change: opacity, transform;
}

/* JS 添加此类后触发动画 */
.home-social-row.social-row-animate {
  visibility: visible;
  animation: home-intro-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.home-hero .home-codetime-badge {
  display: block;
  height: 20px;
}

.home-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--md-default-fg-color--light, #64748b);
  transition: color 0.18s, transform 0.18s;
}

.home-social-link:hover {
  color: #6366f1;
  transform: translateY(-1px);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.18s ease-out;
}

.home-button.primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #f9fafb;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.home-button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.5);
}

.home-button.ghost {
  background: transparent;
  color: inherit;
  border-color: rgba(148, 163, 184, 0.6);
}

.home-button.ghost:hover {
  background: rgba(148, 163, 184, 0.12);
}

/* 右侧大头像 - 加载优化 */
.home-avatar-wrap {
  flex: 0 0 auto;
  width: 220px;
  height: 220px;
  /* 防止加载期间布局偏移 */
  contain: layout style;
  border-radius: 999px;
  /* 使用页面背景色作为占位，避免蓝底露出 */
  background: #f3f4f6;
  overflow: hidden;
}

@media (min-width: 900px) {
  .home-avatar-wrap { width: 260px; height: 260px; }
}

.home-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  /* 平滑加载过渡效果 */
  opacity: 0;
  transition: opacity 0.25s ease;
  /* 确保图片在上层，背景在下层 */
  position: relative;
  z-index: 1;
  background: #f3f4f6;
}

/* 图片加载完成后显示 */
.home-avatar-img[src] {
  opacity: 1;
}

/* ===== 花瓣层 ===== */
.petals-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  contain: strict;
}

.sakura-cursor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.sakura-cursor-petal,
.sakura-cursor-bloom {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

.sakura-cursor-petal {
  width: 11px;
  height: 14px;
  opacity: 0;
  border-radius: 0;
  background-image: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95) 0 12%, rgba(255, 241, 242, 0.92) 24%, rgba(251, 207, 232, 0.9) 62%, rgba(244, 114, 182, 0.82) 100%);
  clip-path: polygon(
    50% 2%, 5% 35%, 4% 70%, 20% 90%,
    43% 100%, 50% 93%, 57% 100%,
    80% 90%, 96% 70%, 95% 35%
  );
  filter: blur(0.15px);
}

.sakura-cursor-petal.is-trail {
  animation: sakura-cursor-trail 1.05s cubic-bezier(0.2, 0.65, 0.2, 1) forwards;
}

.sakura-cursor-petal.is-burst {
  animation: sakura-cursor-burst 1.4s cubic-bezier(0.16, 0.72, 0.24, 1) forwards;
}

.sakura-cursor-bloom {
  width: 68px;
  height: 68px;
  margin-left: -34px;
  margin-top: -34px;
  opacity: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(253, 242, 248, 0.36) 0, rgba(251, 207, 232, 0.2) 42%, rgba(244, 114, 182, 0.08) 65%, rgba(244, 114, 182, 0) 100%);
  animation: sakura-cursor-bloom 0.9s ease-out forwards;
}

@keyframes sakura-cursor-trail {
  0% {
    opacity: 0.68;
    transform: translate3d(0, 0, 0) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--tx, 0px), var(--ty, -18px), 0) rotate(calc(var(--rotate, 0deg) + 24deg)) scale(calc(var(--scale, 1) * 0.72));
  }
}

@keyframes sakura-cursor-burst {
  0% {
    opacity: 0.8;
    transform: translate3d(0, 0, 0) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
  }
  75% {
    opacity: 0.42;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotate(calc(var(--rotate, 0deg) + 85deg)) scale(calc(var(--scale, 1) * 0.58));
  }
}

@keyframes sakura-cursor-bloom {
  0% {
    opacity: 0.55;
    transform: scale(0.25);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

.petal {
  position: absolute;
  top: -30px;
  transform-origin: 30% 40%;
  will-change: transform, opacity;
  backface-visibility: hidden;
  contain: layout style;
  --drift: 0px;
  --swing: 15px;
  --petal-alpha: 0.7;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* 花瓣形状 A — 带缺口的经典樱花瓣 */
.petal--shape-a {
  border-radius: 0;
  clip-path: polygon(
    50% 0%, 3% 30%, 2% 65%, 15% 87%,
    40% 100%, 50% 90%, 60% 100%,
    85% 87%, 98% 65%, 97% 30%
  );
}

/* 花瓣形状 B — 更圆润的花瓣 */
.petal--shape-b {
  border-radius: 0;
  clip-path: polygon(
    50% 2%, 5% 35%, 4% 70%, 20% 90%,
    43% 100%, 50% 93%, 57% 100%,
    80% 90%, 96% 70%, 95% 35%
  );
}

/* 近景层：大、快、清晰 */
.petal--near {
  width: 14px;
  height: 18px;
  --petal-alpha: 0.88;
  z-index: 2;
}

/* 中景层：中等 */
.petal--mid {
  width: 9px;
  height: 13px;
  --petal-alpha: 0.6;
  z-index: 1;
}

/* 远景层：小、慢、淡 */
.petal--far {
  width: 5px;
  height: 8px;
  --petal-alpha: 0.35;
  z-index: 0;
}

/* 3D 翻转飘落 A — 前倾翻滚 */
@keyframes petal-3d-a {
  0% {
    transform: translate3d(0, -30px, 0)
               rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    opacity: 0;
  }
  6%  { opacity: var(--petal-alpha); }
  20% {
    transform: translate3d(var(--swing), 20vh, 0)
               rotateX(60deg) rotateY(25deg) rotateZ(72deg);
  }
  40% {
    transform: translate3d(calc(var(--drift) * 0.6 - var(--swing) * 0.7), 40vh, 0)
               rotateX(150deg) rotateY(70deg) rotateZ(144deg);
  }
  60% {
    transform: translate3d(calc(var(--drift) + var(--swing) * 0.5), 60vh, 0)
               rotateX(230deg) rotateY(110deg) rotateZ(216deg);
  }
  80% {
    transform: translate3d(calc(var(--drift) * 0.3 - var(--swing) * 0.3), 80vh, 0)
               rotateX(310deg) rotateY(155deg) rotateZ(288deg);
  }
  94% { opacity: calc(var(--petal-alpha) * 0.3); }
  100% {
    transform: translate3d(calc(var(--drift) * -0.1), calc(100vh + 30px), 0)
               rotateX(360deg) rotateY(180deg) rotateZ(360deg);
    opacity: 0;
  }
}

/* 3D 翻转飘落 B — 侧翻旋转 */
@keyframes petal-3d-b {
  0% {
    transform: translate3d(0, -30px, 0)
               rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    opacity: 0;
  }
  6%  { opacity: var(--petal-alpha); }
  25% {
    transform: translate3d(calc(var(--swing) * -0.8), 22vh, 0)
               rotateX(40deg) rotateY(80deg) rotateZ(65deg);
  }
  50% {
    transform: translate3d(calc(var(--drift) * 0.8 + var(--swing) * 0.6), 50vh, 0)
               rotateX(120deg) rotateY(180deg) rotateZ(150deg);
  }
  75% {
    transform: translate3d(calc(var(--drift) * 0.4 - var(--swing) * 0.5), 75vh, 0)
               rotateX(240deg) rotateY(270deg) rotateZ(250deg);
  }
  94% { opacity: calc(var(--petal-alpha) * 0.3); }
  100% {
    transform: translate3d(calc(var(--drift) * 0.15), calc(100vh + 30px), 0)
               rotateX(320deg) rotateY(360deg) rotateZ(340deg);
    opacity: 0;
  }
}

/* 低性能设备 / 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .petal {
    animation: none;
    display: none;
  }

  .sakura-cursor-layer {
    display: none;
  }
}

/* ===== 主页栏目 ===== */
.home-sections {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
}

.home-section {
  padding: 0.4rem 1.35rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-left-width: 4px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  writing-mode: horizontal-tb;
  min-width: 0;
  overflow-wrap: break-word;
  /* 优化过渡性能 - 只动画 transform 和 opacity */
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  opacity: 0;
  transform: translateY(20px);
  /* 初始状态优化 */
  will-change: transform, opacity;
  contain: layout style paint;
}

.home-section.home-section-visible {
  opacity: 1;
  transform: translateY(0);
  /* 动画完成后释放 will-change */
  will-change: auto;
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-section:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.home-section:nth-child(1) { border-left-color: #6366f1; }
.home-section:nth-child(2) { border-left-color: #0d9488; }
.home-section:nth-child(3) { border-left-color: #d97706; }
.home-section:nth-child(4) { border-left-color: #be185d; }

.home-section-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light, #64748b);
}

.home-section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.5rem;
  vertical-align: 0.2em;
  border-radius: 50%;
}

.home-section:nth-child(1) .home-section-title::before { background: #6366f1; }
.home-section:nth-child(2) .home-section-title::before { background: #0d9488; }
.home-section:nth-child(3) .home-section-title::before { background: #d97706; }
.home-section:nth-child(4) .home-section-title::before { background: #be185d; }

.home-section ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.home-section li + li { margin-top: 0.4rem; }
.home-section a { text-decoration: none; }
.home-section a:hover { text-decoration: underline; }

.home-tag {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(99, 102, 241, 0.2);
  color: var(--md-default-fg-color, inherit);
}

.home-list {
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Tech Stack 图标样式 */
.home-tech .home-tech-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.55rem;
  vertical-align: -0.15em;
  color: rgba(55, 65, 81, 0.9);
}

.home-tech .home-tech-icon svg { width: 100%; height: 100%; }

/* Links 栏目图标 */
.home-links .home-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.5rem;
  vertical-align: -0.2em;
}

.home-links .home-link-icon svg { width: 100%; height: 100%; }
.home-link-icon-github svg { color: var(--md-default-fg-color, #24292f); }

/* ===== Resume-style grid sections ===== */
.home-section.resume-section {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 2rem;
  align-items: start;
  padding: 1.8rem 0;
  border: none;
  border-left: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.home-section.resume-section:nth-child(n) {
  border-left-color: transparent;
  border-left-width: 0;
}

.resume-label {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  padding-top: 0;
  letter-spacing: 0;
  text-transform: none;
  color: var(--md-default-fg-color, #111827);
}

.resume-label::before { display: none; }

.resume-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.resume-card {
  position: relative;
  display: block;
  padding: 0.45rem 0.85rem;
  border-radius: var(--zen-card-radius);
  background: var(--zen-card-bg);
  background-image: radial-gradient(
    120% 85% at 18% 12%,
    color-mix(in srgb, var(--md-typeset-a-color) 12%, transparent) 0%,
    transparent 62%
  );
  border: 1px solid var(--zen-card-border);
  box-shadow: var(--zen-card-shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition:
    background 0.25s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.resume-card:hover {
  background: var(--zen-card-bg-hover);
  border-color: var(--zen-card-border-hover);
  box-shadow: var(--zen-card-shadow-hover);
  text-decoration: none;
}

.resume-card:focus-visible {
  outline: 2px solid var(--zen-card-ring);
  outline-offset: 3px;
}

.resume-card-body { position: relative; z-index: 1; }

.resume-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--md-default-fg-color, #111827);
}

.resume-card-sub {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--md-default-fg-color--light, #64748b);
}

.resume-card-meta {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light, #94a3b8);
}

.resume-card-date {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.resume-card-logo {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 110%;
  width: auto;
  max-width: 40%;
  object-fit: contain;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.resume-skill-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 0.75rem;
  align-items: baseline;
}

.resume-skill-cat {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--md-default-fg-color, #111827);
}

.resume-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resume-tag {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  font-size: 0.82rem;
  line-height: 1.4;
  border-radius: 6px;
  background: rgba(229, 231, 235, 0.65);
  color: var(--md-default-fg-color, #374151);
  border: 1px solid rgba(209, 213, 219, 0.5);
}

a.resume-tag {
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
}

a.resume-tag:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: #4f46e5;
  text-decoration: none;
}

/* ===== Friend list page ===== */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 0.75rem;
}

.friend-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--zen-card-radius);
  background: var(--zen-card-bg);
  background-image: radial-gradient(
    120% 85% at 18% 12%,
    color-mix(in srgb, var(--md-typeset-a-color) 12%, transparent) 0%,
    transparent 62%
  );
  border: 1px solid var(--zen-card-border);
  box-shadow: var(--zen-card-shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out,
              border-color 0.18s ease-out, background 0.18s ease-out;
}

.friend-card:hover {
  transform: translateY(-2px);
  background: var(--zen-card-bg-hover);
  border-color: var(--zen-card-border-hover);
  box-shadow: var(--zen-card-shadow-hover);
}

.friend-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.friend-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.friend-card-title a {
  text-decoration: none;
  color: inherit;
}

.friend-card-title a:focus-visible {
  outline: 2px solid var(--zen-card-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.friend-card-title a:hover {
  text-decoration: underline;
}

.friend-card-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--md-default-fg-color--light);
}

.friend-card-url {
  display: none;
}

/* ===== Waline 评论区 ===== */
#waline {
  --waline-font-size: 0.64rem;
  --waline-theme-color: #111827;
  --waline-active-color: #4f46e5;
  --waline-color: rgba(17, 24, 39, 0.92);
  --waline-bg-color: rgba(255, 255, 255, 0.96);
  --waline-bg-color-light: rgba(248, 250, 252, 0.95);
  --waline-bg-color-hover: rgba(241, 245, 249, 0.95);
  --waline-border-color: rgba(148, 163, 184, 0.24);
  --waline-disable-bg-color: rgba(241, 245, 249, 0.9);
  --waline-disable-color: rgba(148, 163, 184, 0.9);
  --waline-code-bg-color: rgba(241, 245, 249, 0.95);
  --waline-bq-color: rgba(226, 232, 240, 0.9);
  --waline-avatar-size: 1.95rem;
  --waline-avatar-radius: 50%;
  --waline-badge-color: rgba(148, 163, 184, 0.85);
  --waline-badge-font-size: 0.72rem;
  --waline-info-bg-color: rgba(241, 245, 249, 0.96);
  --waline-info-color: rgba(100, 116, 139, 0.92);
  --waline-info-font-size: 0.7rem;
  --waline-border: 1px solid var(--waline-border-color);
  --waline-box-shadow: none;
  max-width: 100%;
  margin: 1.2rem 0 0.72rem;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

#waline .wl-comment {
  align-items: flex-start;
  gap: 0.72rem;
  margin-bottom: 0.48rem;
}

#waline .wl-login-info {
  display: flex;
  flex: 0 0 56px;
  flex-direction: column;
  align-items: center;
  max-width: 56px;
  margin-top: 0;
}

#waline .wl-avatar {
  width: 1.95rem;
  height: 1.95rem;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
}

#waline .wl-cards .wl-user .wl-user-avatar {
  overflow: hidden;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
}

#waline .wl-avatar img,
#waline .wl-cards .wl-user .wl-user-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: scale(1.12);
  transform-origin: center;
}

#waline .wl-login-nick {
  margin-top: 0.16rem;
  font-size: 0.58rem;
  line-height: 1.25;
  text-align: center;
}

#waline .wl-panel {
  margin: 0 0 1rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
}

#waline .wl-header {
  padding: 0.08rem 0.32rem;
  border-bottom: 1px dashed rgba(203, 213, 225, 0.9);
}

#waline .wl-header-item label {
  min-width: 36px;
  padding: 0.44rem 0.32rem;
  font-size: 0.62rem;
  line-height: 1.3;
  color: rgba(71, 85, 105, 0.9);
}

#waline .wl-header-item input,
#waline .wl-header-item .wl-input {
  height: auto;
  padding: 0.5rem 0.15rem;
  font-size: 0.72rem;
  line-height: 1.4;
}

#waline .wl-editor {
  min-height: 120px;
  margin: 0.5rem 0.6rem 0.35rem;
  font-size: 0.72rem;
  border-radius: 8px;
}

#waline .wl-footer {
  margin: 0.14rem 0.48rem 0.44rem;
}

#waline .wl-btn {
  font-size: 0.68rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

#waline .wl-btn.primary {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

#waline .wl-btn.primary:hover {
  background: #1f2937;
  border-color: #1f2937;
}

#waline .wl-meta-head {
  align-items: baseline;
  padding: 0 0 0.42rem;
}

#waline .wl-count {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--md-default-fg-color, #111827);
}

#waline .wl-sort li {
  font-size: 0.62rem;
}

#waline .wl-sort li + li {
  margin-inline-start: 0.62rem;
}

#waline .wl-sort li.active {
  font-weight: 600;
}

#waline .wl-card-item {
  align-items: flex-start;
  padding: 0.66rem 0;
}

#waline .wl-card-item .wl-card-item {
  padding-top: 0.48rem;
  padding-bottom: 0;
}

#waline .wl-cards .wl-user {
  margin-inline-end: 0.5rem;
}

#waline .wl-cards .wl-user .wl-user-avatar {
  border-radius: 50%;
  box-shadow: none;
}

#waline .wl-card {
  width: auto;
  padding-bottom: 0.54rem;
  border-bottom: 1px dashed rgba(203, 213, 225, 0.92);
}

#waline .wl-card:first-child {
  margin-inline-start: 0.12rem;
}

#waline .wl-card .wl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.14rem 0.34rem;
  overflow: visible;
  line-height: 1.35;
}

#waline .wl-card .wl-head .wl-nick {
  margin-inline-end: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.96);
}

#waline .wl-card .wl-badge {
  margin-inline-end: 0;
  padding: 0.05rem 0.26rem;
  border-color: rgba(226, 232, 240, 0.95);
  color: rgba(100, 116, 139, 0.92);
  background: rgba(248, 250, 252, 0.92);
}

#waline .wl-card .wl-time {
  margin-inline-end: 0;
  font-size: 0.66rem;
  color: rgba(100, 116, 139, 0.9);
}

#waline .wl-card .wl-meta {
  margin-top: 0.14rem;
  line-height: 1.32;
}

#waline .wl-card .wl-meta > span {
  margin-inline-end: 0.18rem;
  margin-bottom: 0.12rem;
  padding: 0.04rem 0.22rem;
  border-radius: 0.22rem;
  background: rgba(241, 245, 249, 0.96);
  color: rgba(100, 116, 139, 0.9);
  font-size: 0.54rem;
}

#waline .wl-card .wl-comment-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  margin-top: 0.02rem;
}

#waline .wl-card .wl-like,
#waline .wl-card .wl-reply,
#waline .wl-card .wl-delete,
#waline .wl-card .wl-edit {
  color: rgba(75, 85, 99, 0.9);
}

#waline .wl-card .wl-like:hover,
#waline .wl-card .wl-reply:hover,
#waline .wl-card .wl-delete:hover,
#waline .wl-card .wl-edit:hover {
  color: #111827;
}

#waline .wl-card .wl-content {
  margin-bottom: 0;
  padding-top: 0.34rem;
  font-size: 0.7rem;
  line-height: 1.54;
  color: rgba(31, 41, 55, 0.96);
}

#waline .wl-card .wl-content p {
  margin: 0.1rem 0 0.24rem;
}

#waline .wl-card .wl-quote {
  margin-top: 0.44rem;
  padding-left: 0.34rem;
  border-inline-start: 1px dashed rgba(203, 213, 225, 0.9);
}

#waline .wl-power {
  font-size: 0.54rem;
  opacity: 0.45;
}

/* 评论区数学公式缩小。
   已发布评论由 Waline 服务端预渲染，可能输出 KaTeX 或 MathJax。 */
#waline .wl-content .katex {
  font-size: 0.82em !important;
}

#waline .wl-content .katex-display,
#waline .wl-content p.wl-tex {
  margin: 0.35rem 0 !important;
  font-size: inherit !important;
  line-height: 1.4 !important;
}

#waline .wl-content .katex-display > .katex {
  font-size: 0.72em !important;
}

#waline .wl-content mjx-container,
#waline .wl-content .MathJax,
#waline .wl-content .MathJax_Display {
  font-size: 82% !important;
}

#waline .wl-content mjx-container[display="true"],
#waline .wl-content .MathJax_Display {
  margin: 0.35rem 0 !important;
  font-size: 72% !important;
  line-height: 1.4 !important;
}

/* 当前首页评论里的公式实际被渲染成 SVG，且自带 width="100%"，会被拉满整行。 */
#waline .wl-content svg[role="img"][viewBox] {
  display: block;
  width: min(6rem, 100%) !important;
  height: auto !important;
  margin: 0.35rem auto !important;
}

/* 隐藏订阅按钮 */
#waline .wl-action[title="subscribe"],
#waline .wl-action .wl-rss,
#waline a[href*="feed"] {
  display: none !important;
}

/* 夜间模式：文字颜色 */
[data-md-color-scheme="slate"] .md-typeset,
[data-md-color-scheme="slate"] .md-nav__link,
[data-md-color-scheme="slate"] .md-nav--secondary {
  color: #e2e8f0 !important;
}

/* 代码块 & 数学公式 */
[data-md-color-scheme="slate"] pre,
[data-md-color-scheme="slate"] code {
  background-color: rgba(168, 85, 247, 0.08) !important;
  color: #f5f3ff !important;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

[data-md-color-scheme="slate"] .arithmatex,
[data-md-color-scheme="slate"] .katex-display,
[data-md-color-scheme="slate"] .katex {
  color: #ffffff !important;
}

[data-md-color-scheme="slate"] .home-title { color: #ffffff; }
[data-md-color-scheme="slate"] .home-subtitle { color: rgba(229, 231, 235, 0.9); }
[data-md-color-scheme="slate"] .home-section-title { color: rgba(209, 213, 219, 0.9); }

[data-md-color-scheme="slate"] .home-social-link { color: rgba(209, 213, 219, 0.8); }
[data-md-color-scheme="slate"] .home-social-link:hover { color: #a5b4fc; }

[data-md-color-scheme="slate"] .home-section {
  background: hsla(278, 15%, 20%, 0.25);
  border-color: hsla(278, 18%, 28%, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

[data-md-color-scheme="slate"] .home-section:hover {
  background: hsla(278, 15%, 22%, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

[data-md-color-scheme="slate"] .home-section.resume-section {
  background: none;
  border-color: transparent;
  box-shadow: none;
}

[data-md-color-scheme="slate"] .home-tech .home-tech-icon { color: rgba(226, 232, 240, 0.95); }
[data-md-color-scheme="slate"] .home-link-icon-github svg { color: #e6edf3; }

/* 夜间：Resume sections */
[data-md-color-scheme="slate"] .resume-card-title { color: #f1f5f9; }
[data-md-color-scheme="slate"] .resume-card-date { color: hsla(278, 20%, 70%, 0.8); }

[data-md-color-scheme="slate"] .resume-tag {
  background: hsla(278, 15%, 22%, 0.6);
  border-color: hsla(278, 18%, 30%, 0.5);
  color: #e2e8f0;
}

[data-md-color-scheme="slate"] a.resume-tag:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.5);
  color: #a5b4fc;
}

/* 夜间：Friend cards */
[data-md-color-scheme="slate"] .friend-card-url { color: hsla(278, 20%, 80%, 0.9); }

/* 夜间：Waline 评论区 */
[data-md-color-scheme="slate"] #waline {
  --waline-white: #0b1120;
  --waline-light-grey: rgba(148, 163, 184, 0.82);
  --waline-dark-grey: rgba(226, 232, 240, 0.9);
  --waline-color: rgba(226, 232, 240, 0.94);
  --waline-bg-color: rgba(11, 15, 26, 0.82);
  --waline-bg-color-light: rgba(30, 41, 59, 0.38);
  --waline-bg-color-hover: rgba(51, 65, 85, 0.34);
  --waline-border-color: rgba(71, 85, 105, 0.42);
  --waline-disable-bg-color: rgba(51, 65, 85, 0.38);
  --waline-disable-color: rgba(100, 116, 139, 0.8);
  --waline-code-bg-color: rgba(76, 29, 149, 0.08);
  --waline-bq-color: rgba(51, 65, 85, 0.7);
  --waline-theme-color: #e2e8f0;
  --waline-active-color: #c4b5fd;
  --waline-info-bg-color: rgba(51, 65, 85, 0.55);
  --waline-info-color: rgba(203, 213, 225, 0.82);
  --waline-badge-color: rgba(129, 140, 248, 0.56);
  --waline-box-shadow: none;
}

[data-md-color-scheme="slate"] #waline .wl-panel {
  border-color: rgba(71, 85, 105, 0.45);
  background: rgba(11, 15, 26, 0.76);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

[data-md-color-scheme="slate"] #waline .wl-header {
  border-bottom-color: rgba(71, 85, 105, 0.45);
}

[data-md-color-scheme="slate"] #waline .wl-card {
  border-bottom-color: rgba(71, 85, 105, 0.56);
}

[data-md-color-scheme="slate"] #waline .wl-card .wl-head .wl-nick {
  color: rgba(248, 250, 252, 0.96);
}

[data-md-color-scheme="slate"] #waline .wl-card .wl-badge {
  border-color: rgba(129, 140, 248, 0.3);
  background: rgba(49, 46, 129, 0.22);
  color: rgba(224, 231, 255, 0.92);
}

[data-md-color-scheme="slate"] #waline .wl-card .wl-like,
[data-md-color-scheme="slate"] #waline .wl-card .wl-reply,
[data-md-color-scheme="slate"] #waline .wl-card .wl-delete,
[data-md-color-scheme="slate"] #waline .wl-card .wl-edit {
  color: rgba(226, 232, 240, 0.84);
}

[data-md-color-scheme="slate"] #waline .wl-card .wl-like:hover,
[data-md-color-scheme="slate"] #waline .wl-card .wl-reply:hover,
[data-md-color-scheme="slate"] #waline .wl-card .wl-delete:hover,
[data-md-color-scheme="slate"] #waline .wl-card .wl-edit:hover {
  color: #c4b5fd;
}

/* ===== Recent Updates 紧凑卡片 ===== */
.recent-updates .resume-content {
  gap: 0.4rem;
}

.recent-updates .resume-card {
  display: flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
}

.recent-updates .resume-card-body {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
}

.recent-updates .resume-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-updates .resume-card-sub {
  font-size: 0.78rem;
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.recent-updates .resume-card-date {
  margin: 0;
  margin-left: auto;
  font-size: 0.75rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .home-hero {
    flex-direction: column-reverse;
    align-items: center;
    gap: 1.5rem;
  }

  .home-avatar-wrap { width: 160px; height: 160px; }
  .home-title { font-size: 1.65rem; }
  .home-actions { flex-direction: column; align-items: stretch; }
  .home-button { width: 100%; }

  .home-section.resume-section {
    grid-template-columns: 1fr;
    gap: 0.4rem 0;
  }

  .resume-skill-row {
    grid-template-columns: 1fr;
    gap: 0.25rem 0;
  }
}

/* --------------------------------------------------------------------------
   时间线样式
   -------------------------------------------------------------------------- */

/* 时间线容器 */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem 0;
  padding-left: 1.5rem;
}

/* 竖线 */
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--md-typeset-a-color), transparent);
}

/* 时间线项目 */
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

/* 时间点 */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--md-typeset-a-color);
  border: 2px solid var(--md-default-bg-color);
  box-sizing: border-box;
}

/* 日期标签 */
.timeline-date {
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.2rem;
  font-family: "JetBrains Mono", monospace;
}

/* 内容标题链接 */
.timeline-content a {
  font-weight: 500;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.4;
}

/* 分类标签 */
.timeline-category {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--md-default-bg-color--lighter);
  color: var(--md-default-fg-color--light);
}

/* 夜间模式适配 */
[data-md-color-scheme="slate"] .timeline::before {
  background: linear-gradient(to bottom, hsla(278, 60%, 65%, 0.6), transparent);
}

[data-md-color-scheme="slate"] .timeline-item::before {
  background: hsla(278, 60%, 65%, 0.8);
  border-color: hsla(278, 15%, 13%, 1);
}

[data-md-color-scheme="slate"] .timeline-date {
  color: hsla(278, 20%, 70%, 0.8);
}

[data-md-color-scheme="slate"] .timeline-category {
  background: hsla(278, 15%, 20%, 0.5);
  color: hsla(278, 20%, 75%, 0.85);
}

/* 响应式 */
@media (max-width: 768px) {
  .timeline {
    padding-left: 1rem;
  }

  .timeline-item {
    padding-left: 1rem;
  }

  .timeline-item::before {
    left: -1rem;
    width: 8px;
    height: 8px;
  }

  .timeline-content a {
    font-size: 0.95rem;
  }
}
