/* Keep the document canvas and header stable throughout native page navigation. */
html { background: #090d14; color-scheme: dark; scrollbar-gutter: stable; }
.language-switcher {
  position: fixed; display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  box-sizing: border-box; width: 104px; height: 40px; padding: 4px;
  border: 1px solid #334155; border-radius: 24px;
  background: #0a0b0d;
}
.language-switcher button {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 100%; height: 30px; min-width: 0; margin: 0;
  white-space: nowrap; letter-spacing: 0;
  border: 0; border-radius: 18px; background: transparent;
  color: #cbd5e1; cursor: pointer; font: 500 12px/1 system-ui, sans-serif;
}
.language-switcher button[aria-pressed="true"] { color: #0a0b0d; }
.language-switcher button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html[lang="zh-CN"] { font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
body:has([role="dialog"]) .language-switcher { top: 12px; }
/* Shared header geometry for the homepage and saved interactive pages. */
html body .site-header,
html body header.sticky {
  height: 82px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #090d14f5;
  border-bottom: 1px solid #26354880;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

html body .header-inner,
html body header.sticky > div {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  height: 100%;
  max-width: 1440px;
  padding: 0 174px 0 48px;
  margin-inline: auto;
}

html body .header-inner > .brand,
html body header.sticky > div > a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.7px;
}

html body header.sticky > div > a > span:first-child {
  width: 31px;
  height: 31px;
  display: block;
  background: #78daff;
  clip-path: polygon(57% 3%, 13% 57%, 43% 57%, 36% 97%, 88% 37%, 57% 37%);
}

html body header.sticky > div > a > span:first-child > span {
  display: none;
}

html body header.sticky > div > a > span:last-child {
  max-width: none;
  font: inherit;
  letter-spacing: inherit;
}

html body .desktop-nav,
html body header.sticky > div > nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

html body .desktop-nav a,
html body header.sticky > div > nav[aria-label] a {
  padding: 8px 13px;
  border-radius: 8px;
  color: #a6b6cb;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 400;
}

html body .desktop-nav a:hover,
html body .desktop-nav a[aria-current="page"],
html body header.sticky > div > nav[aria-label] a:hover,
html body header.sticky > div > nav[aria-label] a[aria-current="page"] {
  color: #ecf6ff;
  background: #1a263780;
}

html body .header-login,
html body header.sticky > div > div {
  margin-left: auto;
}

html body header.sticky > div > div > a[hidden] {
  display: none;
}

html body .language-switcher[data-language-switcher] {
  top: 20px;
  right: max(28px, calc((100vw - 1440px) / 2 + 28px));
  z-index: 120;
  padding: 4px;
  border-color: #314155;
  background: #101925;
  box-shadow: none;
}

html body .language-switcher button {
  padding: 0;
  font-size: 12px;
}

html body .language-switcher button[aria-pressed="true"] {
  background: #b2eaff;
}

@media (max-width: 1100px) {
  html body .desktop-nav,
  html body header.sticky > div > nav { gap: 0; }

  html body .desktop-nav a,
  html body header.sticky > div > nav[aria-label] a { padding-inline: 10px; }
}

@media (max-width: 980px) {
  html body .site-header,
  html body header.sticky { height: 72px; }

  html body .header-inner,
  html body header.sticky > div {
    padding: 0 138px 0 20px;
    gap: 14px;
  }

  html body .header-inner > .brand,
  html body header.sticky > div > a {
    gap: 8px;
    font-size: 19px;
  }

  html body .header-inner .brand-symbol,
  html body header.sticky > div > a > span:first-child {
    width: 26px;
    height: 26px;
    gap: 3px;
  }

  html body .desktop-nav,
  html body .header-login,
  html body header.sticky > div > nav,
  html body header.sticky > div > div > a { display: none; }

  html body .mobile-menu,
  html body header.sticky details {
    display: block;
    position: static;
    margin-left: auto;
  }

  html body .mobile-menu > summary,
  html body header.sticky details > summary {
    display: flex;
    align-items: center;
    gap: 5px;
    height: auto;
    padding: 12px 0;
    color: #b4c8dd;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;
    cursor: pointer;
    list-style: none;
  }

  html body .mobile-menu > summary .icon,
  html body header.sticky details > summary .icon {
    width: 17px;
    height: 17px;
  }

  html body .mobile-menu nav,
  html body header.sticky details > div {
    position: absolute;
    top: 78px;
    left: 12px;
    right: 12px;
    width: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    border: 1px solid #3a516c;
    border-radius: 14px;
    background: #111d2c;
    box-shadow: 0 20px 50px #0008;
  }

  html body .mobile-menu nav a,
  html body header.sticky details > div a {
    padding: 12px;
    color: #dbe8f6;
    font-size: 14px;
    line-height: 1.7;
    border-radius: 7px;
  }

  html body .language-switcher[data-language-switcher] {
    top: 15px;
    right: 14px;
  }
}

/* Keep a full menu hit target beside the language control on narrow phones. */
@media (max-width: 360px) {
  html body .mobile-menu > summary,
  html body header.sticky details > summary {
    font-size: 0;
    gap: 0;
    min-width: 32px;
    justify-content: center;
  }
  html body .mobile-menu > summary .icon,
  html body header.sticky details > summary .icon {
    width: 20px;
    height: 20px;
  }
}
