:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 网站所有页面共用同一套页头尺寸，正文容器宽度不会再影响导航位置。 */
body .site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fafafbed;
  border-bottom: 1px solid #e1e1e4;
  backdrop-filter: blur(14px);
}

.site-header .site-header-inner {
  width: min(1260px, calc(100% - 44px));
  height: 68px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
}

.site-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.site-brand small {
  display: block;
  margin-top: 1px;
  color: #74767e;
  font-size: 9px;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
}

.site-nav > a:not(.site-github) {
  position: relative;
  padding: 24px 0 23px;
}

.site-nav > a:not(.site-github):hover,
.site-nav > a.is-active:not(.site-github) {
  color: var(--brand, #625cf6);
}

.site-nav > a.is-active:not(.site-github)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--brand, #625cf6);
}

.site-github {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #171717;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.site-menu-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #171717;
  border-radius: 4px;
  background: #fff;
  display: none;
  place-items: center;
}

.site-mobile-menu {
  position: absolute;
  top: 68px;
  right: 12px;
  left: 12px;
  display: none;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dedfe3;
  background: #fff;
}

.site-mobile-menu.is-open { display: grid; }

/* Highlight.js 仅负责语法解析，颜色由网站统一控制。 */
.hljs { color: #d6deeb; }
.hljs-comment,
.hljs-quote { color: #7f8c98; font-style: italic; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link { color: #ff7b72; }
.hljs-string,
.hljs-doctag,
.hljs-regexp,
.hljs-template-tag,
.hljs-template-variable { color: #a5d6ff; }
.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-variable,
.hljs-variable.constant_ { color: #79c0ff; }
.hljs-title,
.hljs-title.class_,
.hljs-title.function_,
.hljs-type,
.hljs-built_in { color: #d2a8ff; }
.hljs-attr,
.hljs-attribute,
.hljs-property,
.hljs-params { color: #ffa657; }
.hljs-meta,
.hljs-meta .hljs-keyword { color: #8ddb8c; }
.hljs-addition { color: #aff5b4; background: #033a16; }
.hljs-deletion { color: #ffdcd7; background: #67060c; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
}

.mobile-menu { display: none; }
.mobile-menu.is-open { display: grid; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px #0003;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .desktop-nav { display: none !important; }
}

@media (max-width: 1000px) {
  .site-nav { display: none; }
  .site-menu-button { display: grid; }
}

@media (max-width: 700px) {
  .site-header .site-header-inner {
    width: min(100% - 28px, 1260px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
