@charset "UTF-8";

/* -------------------------------------------------------------------------- */
/* 设计变量 -- 被自定义组件（滚动条、动画等）和 article-prose.css 引用 */
/* -------------------------------------------------------------------------- */

:root {
  --accent-rgb: 37 99 235;
  --prose-border: rgb(231 229 228);
  --prose-table-border: var(--prose-border);
  --prose-th-bg: rgb(245 245 244);
  --text-primary: rgb(30 41 59);
}

html.dark {
  color-scheme: dark;
  --prose-border: rgb(51 65 85);
  --prose-th-bg: rgb(30 41 59);
  --text-primary: rgb(241 245 249);
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

html:not(.dark) {
  color-scheme: light;
}

/* -------------------------------------------------------------------------- */
/* 首页搜索弹层 — 自定义滚动条 */
/* -------------------------------------------------------------------------- */

.home-search-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgb(214 211 209 / 0.9) transparent;
}
.dark .home-search-scroll {
  scrollbar-color: rgb(71 85 105 / 0.85) transparent;
}
.home-search-scroll::-webkit-scrollbar {
  width: 6px;
}
.home-search-scroll::-webkit-scrollbar-thumb {
  border-radius: 9999px;
  background-color: rgb(214 211 209 / 0.95);
}
.dark .home-search-scroll::-webkit-scrollbar-thumb {
  background-color: rgb(71 85 105 / 0.9);
}

/* -------------------------------------------------------------------------- */
/* 首页签名行 — 打字光标闪烁动画 */
/* -------------------------------------------------------------------------- */

.home-tagline-caret {
  animation: home-tagline-caret-blink 0.9s steps(1, end) infinite;
}
.home-tagline-caret--off {
  opacity: 0;
  animation: none;
}
@keyframes home-tagline-caret-blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .home-tagline-caret {
    animation: none;
    opacity: 0;
  }
}

/* -------------------------------------------------------------------------- */
/* 文章侧栏目录 — 自定义滚动条 */
/* -------------------------------------------------------------------------- */

.article-toc-nav {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgb(148 163 184 / 0.38) transparent;
}
.dark .article-toc-nav {
  scrollbar-color: rgb(100 116 139 / 0.5) transparent;
}
.article-toc-nav::-webkit-scrollbar {
  width: 5px;
}
.article-toc-nav::-webkit-scrollbar-track {
  margin: 0.4rem 0;
  background: transparent;
}
.article-toc-nav::-webkit-scrollbar-thumb {
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgb(148 163 184 / 0.42);
}
.article-toc-nav::-webkit-scrollbar-thumb:hover {
  background-color: rgb(var(--accent-rgb) / 0.5);
}
.dark .article-toc-nav::-webkit-scrollbar-thumb {
  background-color: rgb(71 85 105 / 0.72);
}
.dark .article-toc-nav::-webkit-scrollbar-thumb:hover {
  background-color: rgb(96 165 250 / 0.55);
}
.article-toc-nav::-webkit-scrollbar-corner {
  background: transparent;
}

/* -------------------------------------------------------------------------- */
/* medium-zoom — z-index 覆盖 */
/* -------------------------------------------------------------------------- */

.medium-zoom-overlay { z-index: 999; }
.medium-zoom-image--opened { z-index: 1000; }
