/* Shared site navigation. Deliberately scoped away from readers and dialogs. */
:root {
  --xq-motion-fast:120ms;
  --xq-motion-menu:180ms;
  --xq-motion-panel:220ms;
  --xq-ease-out:cubic-bezier(.2,.8,.2,1);
  --xq-ui-border:rgba(218,224,231,.12);
  --xq-ui-hover:rgba(218,224,231,.06);
  --xq-ui-selected:rgba(215,190,132,.12);
  --xunq-header-main-height:64px;
  --xunq-header-height:calc(64px + env(safe-area-inset-top,0px));
  --xunq-header-font:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
}
html body .xunq-site-header {
  box-sizing:border-box!important;
  position:fixed!important;
  inset:0 0 auto!important;
  z-index:200!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-bottom:1px solid var(--xq-ui-border)!important;
  border-radius:0!important;
  background:#111821!important;
  color:#eee5d2!important;
  box-shadow:0 3px 16px #0002!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  font:400 12px/1.4 var(--xunq-header-font)!important;
  letter-spacing:0!important;
  text-align:left!important;
  transform:none!important;
  overflow:visible!important;
  pointer-events:auto;
}
html body .xunq-site-header *,
html body .xunq-site-header *::before,
html body .xunq-site-header *::after { box-sizing:border-box; }
html body .xunq-site-header .xunq-header-main {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 80px minmax(0,max-content)!important;
  grid-template-rows:var(--xunq-header-main-height)!important;
  align-items:center!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
  height:calc(var(--xunq-header-main-height) + env(safe-area-inset-top,0px))!important;
  margin:0!important;
  padding:env(safe-area-inset-top,0px) max(24px,env(safe-area-inset-right,0px)) 0 max(24px,env(safe-area-inset-left,0px))!important;
}
html body .xunq-site-header .xunq-header-identity {
  display:flex!important;
  align-items:center!important;
  grid-column:1!important;
  grid-row:1!important;
  gap:8px!important;
  min-width:0!important;
  max-width:100%!important;
  height:44px!important;
  color:#eddfbc!important;
  font:600 16px/1.2 var(--xunq-header-font)!important;
}
html body .xunq-site-header .xunq-header-home {
  position:static!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 44px!important;
  gap:2px!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#eddfbc!important;
  box-shadow:none!important;
  text-decoration:none!important;
  transform:none!important;
  text-align:left!important;
  font:600 16px/1.2 var(--xunq-header-font)!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
}
html body .xunq-site-header .xunq-header-home:hover { background:var(--xq-ui-hover)!important; }
html body .xunq-site-header .xunq-header-arrow {
  display:block!important;
  flex:0 0 10px!important;
  width:10px!important;
  font:400 25px/1 var(--xunq-header-font)!important;
  color:#b4becb!important;
}
html body .xunq-site-header .xunq-header-mark {
  display:block!important;
  flex:0 0 24px!important;
  width:24px!important;
  height:24px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:6px!important;
  object-fit:contain;
}
html body .xunq-site-header .xunq-header-title {
  display:block!important;
  flex:0 1 auto!important;
  min-width:0!important;
  margin:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:inherit!important;
  font:inherit!important;
  letter-spacing:0!important;
}
html body .xunq-site-header .xunq-header-language {
  position:static!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  grid-column:2!important;
  grid-row:1!important;
  width:80px!important;
  min-width:80px!important;
  max-width:80px!important;
  height:44px!important;
  margin:0!important;
  padding:0!important;
}
html body .xunq-site-header .xunq-header-language .xunq-language-toggle {
  flex:0 0 80px!important;
  width:80px!important;
  min-width:80px!important;
  max-width:80px!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  padding:3px!important;
  gap:2px!important;
  border:1px solid var(--xq-ui-border)!important;
  border-radius:10px!important;
  background:#151f2a!important;
  box-shadow:none!important;
  font-family:var(--xunq-header-font)!important;
}
html body .xunq-site-header .xunq-header-language .xunq-language-toggle button {
  flex:1 1 0!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  border-radius:7px!important;
  font:600 12px/1 var(--xunq-header-font)!important;
}
html body .xunq-site-header .xunq-header-account,
html body .xunq-site-header .xunq-header-account :is(#memberAccountHost,[data-auth-account-host]) {
  position:static!important;
  inset:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  grid-column:3!important;
  grid-row:1!important;
  flex:1 1 auto!important;
  justify-self:stretch!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  margin:0!important;
  padding:0!important;
  gap:0!important;
}
/* Let short account names stay compact instead of reserving an empty column. */
html body .xunq-site-header .xunq-header-account {
  justify-self:end!important;
  width:max-content!important;
  max-width:180px!important;
}
html body .xunq-site-header .xunq-header-account .xunq-account-button {
  position:static!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  margin:0!important;
  padding:8px 12px!important;
  gap:8px!important;
  border:1px solid var(--xq-ui-border)!important;
  border-radius:999px!important;
  background:#151f2a!important;
  color:#f1e8d6!important;
  box-shadow:none!important;
  font:500 13px/1.2 var(--xunq-header-font)!important;
  letter-spacing:0!important;
  text-align:right!important;
}
html body .xunq-site-header .xunq-header-account .xunq-account-label {
  flex:1 1 auto!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  text-align:right!important;
  font:inherit!important;
}
html body .xunq-site-header .xunq-header-account .xunq-account-credit {
  display:block!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding-left:8px!important;
  color:#d9c58e!important;
  font:400 10px/1.2 var(--xunq-header-font)!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
}
html body .xunq-site-header .xunq-header-account .xunq-account-dot { display:none!important; }
html body .xunq-site-header .xunq-header-account .xunq-account-vip {
  display:inline-flex!important;
  flex:0 0 18px!important;
  align-items:center!important;
  justify-content:center!important;
  width:18px!important;
  min-width:18px!important;
  height:18px!important;
  margin:0!important;
  color:#e2c77f!important;
  font:700 8px/1 var(--xunq-header-font)!important;
  letter-spacing:0!important;
}
html body .xunq-site-header .xunq-header-account .xunq-account-vip svg { display:block; width:18px; height:18px; }
html body .xunq-site-header .xunq-header-account .xunq-account-vip[hidden] { display:none!important; }
html body .xunq-site-header .xunq-header-tools {
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:18px!important;
  width:100%!important;
  min-width:0!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 max(24px,env(safe-area-inset-right,0px)) 0 max(24px,env(safe-area-inset-left,0px))!important;
  border-top:1px solid #d5bb7620!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none;
  overscroll-behavior-x:contain;
  color:#b6c1cc!important;
}
html body .xunq-site-header .xunq-header-tools::-webkit-scrollbar { display:none; }
html body .xunq-site-header .xunq-header-tools[hidden],
html body .xunq-site-header .xunq-header-tools:empty { display:none!important; }
html body .xunq-site-header .xunq-header-tools .xunq-header-extra {
  position:static!important;
  grid-column:auto!important;
  grid-row:auto!important;
  flex:0 0 auto;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  letter-spacing:0!important;
}
html body .xunq-site-header .xunq-header-tools :is(nav,.header-nav,.site-nav,.account-tools) {
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:nowrap!important;
  width:auto!important;
  height:44px!important;
  gap:20px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
html body .xunq-site-header .xunq-header-tools :is(a,button,select,input) {
  min-height:36px!important;
  margin-block:0!important;
  padding:6px 9px!important;
  border:1px solid transparent!important;
  border-radius:7px!important;
  background:transparent!important;
  color:#bdc7d1!important;
  box-shadow:none!important;
  font:500 12px/1.2 var(--xunq-header-font)!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
  text-decoration:none!important;
}
html body .xunq-site-header .xunq-header-tools :is(input,select) {
  border-color:#48505a!important;
  background:#151f2a!important;
}
html body .xunq-site-header .xunq-header-tools :is(a,button):hover,
html body .xunq-site-header .xunq-header-tools :is([aria-current],.active) {
  color:#f0dba4!important;
  background:#d8bd7520!important;
}
html body .xunq-site-header .xunq-header-tools .privacy-note {
  display:block!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font:400 11px/1.4 var(--xunq-header-font)!important;
  color:#9daab8!important;
}
html body .xunq-site-header :is(a,button,input,select):focus-visible {
  outline:2px solid #f2d99f!important;
  outline-offset:2px!important;
}
html body .xunq-header-spacer {
  display:block;
  flex:0 0 auto;
  width:100%;
  height:var(--xunq-header-height);
  pointer-events:none;
}
/* Fixed canvas workspaces already offset themselves below the measured bar. */
html body:is(.xunq-header-page-kanyu,.xunq-header-page-xunqi,.xunq-header-page-beta,.xunq-header-page-zhenling-graph,.xunq-header-page-zhenling-galaxy) > .xunq-header-spacer { display:none; }
html body.xunq-header-page-kanyu { --mobile-top:var(--xunq-header-height); }
html body.xunq-header-page-kanyu:not(.fsPseudo) :is(#main,#side) { top:var(--xunq-header-height)!important; }
html body.xunq-header-page-kanyu #main:fullscreen,
html body.xunq-header-page-kanyu #main:-webkit-full-screen { top:0!important; }
html body.xunq-header-page-xunqi { --xq-top:var(--xunq-header-height); }
html body.xunq-header-page-xunqi #app { top:var(--xunq-header-height)!important; }
html body.xunq-header-page-xunqi:not(.xq-mobile) #uiSidebar {
  position:fixed!important;
  top:var(--xunq-header-height)!important;
  bottom:0!important;
  left:0!important;
  height:calc(100dvh - var(--xunq-header-height))!important;
}
html body.xunq-header-page-xunqi:not(.xq-mobile) #luopanBox { top:calc(var(--xunq-header-height) + 14px)!important; }
html body.xunq-header-page-xunqi:not(.xq-mobile) #skyBox { top:calc(var(--xunq-header-height) + 390px)!important; }
html body.xunq-header-page-xunqi:not(.xq-mobile) #modeBar { top:calc(var(--xunq-header-height) + 8px)!important; }
html body.xunq-header-page-xunqi:not(.xq-mobile) #extPanel { top:calc(var(--xunq-header-height) + 52px)!important; max-height:calc(100dvh - var(--xunq-header-height) - 64px)!important; }
html body.xunq-header-page-xunqi:not(.xq-mobile) #sidebarFoldBtn { top:calc(var(--xunq-header-height) + 10px)!important; }
html body.xunq-header-page-bushi .app { padding-top:0!important; }
html body.xunq-header-page-bushi .app .topbar { top:var(--xunq-header-height)!important; }
html body.xunq-header-page-bushi .app .seg { top:var(--xunq-header-height)!important; }
html body.xunq-header-page-bushi .app .tabs { top:calc(var(--xunq-header-height) + 56px)!important; }
html body.xunq-header-page-portal .mobile-nav { top:var(--xunq-header-height); max-height:calc(100dvh - var(--xunq-header-height)); }
/* Keep existing sticky content and direct scroll targets below the site bar. */
html body.xunq-header-page-ziwei .detail-panel { top:calc(var(--xunq-header-height) + 18px); }
html body.xunq-header-page-ziwei :is(#palaceDetail,#result,#inputPanel),
html body.xunq-header-page-mingshu :is(#homeShell,#result),
html body.xunq-header-page-mingshu #result > .tabpage {
  scroll-margin-top:calc(var(--xunq-header-height) + 12px);
}
html body.xunq-header-page-zhenling .filter-sidebar { top:calc(var(--xunq-header-height) + 12px); }
/* Beta uses the earlier 3D layout and its own <=900px bottom drawer. */
html body.xunq-header-page-beta #app { top:var(--xunq-header-height)!important; }
html body.xunq-header-page-beta #sidebarFoldBtn { top:calc(var(--xunq-header-height) + 10px)!important; }
html body.xunq-header-page-zhenling-graph { --header:var(--xunq-header-height); }
html body.xunq-header-page-zhenling-galaxy #detail { top:var(--xunq-header-height); max-height:calc(100dvh - var(--xunq-header-height)); }
html body.xunq-header-page-zhenling-galaxy .xunq-header-tools #count { color:#a9b5c4!important; font-size:11px!important; }
html body.xunq-header-page-zhenling-galaxy .xunq-header-tools :is(#sch,#flt) { width:170px!important; }
html body.ms-reader-open .xunq-site-header,
html body.ms-reader-open .xunq-header-spacer { display:none!important; }
@media (min-width:901px) {
  html body.xunq-header-page-beta #uiSidebar {
    position:fixed!important;
    top:var(--xunq-header-height)!important;
    bottom:0!important;
    left:0!important;
    width:336px!important;
    height:calc(100dvh - var(--xunq-header-height))!important;
  }
  html body.xunq-header-page-beta #app { left:336px; }
  html body.xunq-header-page-beta #modeBar { top:calc(var(--xunq-header-height) + 8px)!important; z-index:100!important; }
  html body.xunq-header-page-beta #luopanBox { top:calc(var(--xunq-header-height) + 14px)!important; }
  html body.xunq-header-page-beta #skyBox { top:calc(var(--xunq-header-height) + 390px)!important; }
  html body.xunq-header-page-beta #extPanel { top:calc(var(--xunq-header-height) + 52px)!important; max-height:calc(100dvh - var(--xunq-header-height) - 64px)!important; }
}
@media (max-width:900px) {
  html body.xunq-header-page-beta #luopanBox { top:calc(var(--xunq-header-height) + 8px)!important; }
  /* Before the 3D script moves this control into its drawer, the legacy
     278px content width plus padding/borders extends beyond a 320px screen. */
  html body.xunq-header-page-beta > .panel {
    box-sizing:border-box;
    width:min(312px,calc(100vw - 32px));
    max-width:calc(100vw - 32px);
  }
}
@media (min-width:641px) {
  html body.xunq-header-page-mingshu #result > .tabs { position:sticky; top:var(--xunq-header-height); }
  html body.xunq-header-page-mingshu #result > .tabpage { scroll-margin-top:calc(var(--xunq-header-height) + var(--xunq-mingshu-tabs-height,46px) + 12px); }
}
@media (min-width:801px) {
  html body.xunq-header-page-renti-app .workspace { grid-template-rows:minmax(530px,calc(100dvh - var(--xunq-header-height) - 170px)) 170px; }
}
@media (min-width:800px) {
  html body.xunq-header-page-bushi .app .tabs { top:calc(var(--xunq-header-height) + 62px)!important; }
}
@media (max-width:760px) {
  :root { --xunq-header-main-height:58px; --xunq-header-height:calc(58px + env(safe-area-inset-top,0px)); }
  html body .xunq-site-header .xunq-header-main {
    grid-template-columns:minmax(0,1fr) 70px minmax(0,max-content)!important;
    gap:8px!important;
    padding-inline:max(12px,env(safe-area-inset-left,0px)) max(12px,env(safe-area-inset-right,0px))!important;
  }
  html body .xunq-site-header .xunq-header-identity { gap:4px!important; font-size:14px!important; }
  html body .xunq-site-header .xunq-header-arrow { flex-basis:10px!important; width:10px!important; font-size:22px!important; }
  html body .xunq-site-header .xunq-header-mark { flex-basis:24px!important; width:24px!important; height:24px!important; }
  html body .xunq-site-header .xunq-header-language,
  html body .xunq-site-header .xunq-header-language .xunq-language-toggle { width:70px!important; min-width:70px!important; max-width:70px!important; flex-basis:70px!important; }
  html body .xunq-site-header .xunq-header-tools { padding-inline:max(12px,env(safe-area-inset-left,0px)) max(12px,env(safe-area-inset-right,0px))!important; gap:12px!important; }
  html body .xunq-site-header .xunq-header-tools :is(nav,.header-nav,.site-nav,.account-tools) { gap:10px!important; }
  html body .xunq-site-header .xunq-header-account .xunq-account-button { gap:5px!important; padding-inline:8px!important; font-size:12px!important; }
  html body .xunq-site-header .xunq-header-account { max-width:150px!important; }
  html body .xunq-site-header .xunq-header-account .xunq-account-credit { padding-left:5px!important; font-size:9px!important; }
  html body .xunq-site-header .xunq-header-account .xunq-account-dot { display:none!important; }
}
@media (max-width:380px) {
  html body .xunq-site-header .xunq-header-main { gap:6px!important; padding-inline:max(10px,env(safe-area-inset-left,0px)) max(10px,env(safe-area-inset-right,0px))!important; }
  html body .xunq-site-header .xunq-header-account { max-width:108px!important; }
}
/* The portal keeps one masthead row. Its existing navigation becomes a compact
   popover below 900px; opening it does not change the page's top offset. */
html body.xunq-header-page-portal .xunq-site-header .xunq-header-arrow { display:none!important; }
html body.xunq-header-page-portal .xunq-site-header .xunq-header-menu {
  display:none!important;
  position:static!important;
  align-items:center!important;
  justify-content:center!important;
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#e7dfcd!important;
  font:500 19px/1 var(--xunq-header-font)!important;
  cursor:pointer;
}
html body.xunq-header-page-portal .xunq-site-header .xunq-header-menu svg { display:block; width:20px; height:20px; }
html body.xunq-header-page-portal .xunq-site-header .xunq-header-menu:hover,
html body.xunq-header-page-portal .xunq-site-header .xunq-header-menu[aria-expanded="true"] { background:#d8bd7516!important; }

/* One appearance switch: both modes remain visible, the thumb marks the current one. */
html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle] {
  display:flex!important;align-items:center!important;justify-content:center!important;
  min-height:44px!important;height:44px!important;min-width:72px!important;
  padding:4px!important;margin:0!important;border:0!important;border-radius:10px!important;
  background:transparent!important;color:#c7cec9!important;line-height:1!important;
  touch-action:manipulation;cursor:pointer;
}
html body.xunq-header-page-portal .xunq-site-header .theme-toggle-track {
  position:relative;display:grid;grid-template-columns:1fr 1fr;align-items:center;justify-items:center;
  flex:0 0 64px;width:64px;height:32px;border:1px solid #b7c3c52b;border-radius:10px;background:#070e1680;
}
html body.xunq-header-page-portal .xunq-site-header .theme-toggle-track svg {
  position:relative;z-index:1;display:block;width:17px;height:17px;margin:0;pointer-events:none;color:#a9b5bf;
  transition:color var(--xq-motion-fast) ease;
}
html body.xunq-header-page-portal .xunq-site-header .theme-toggle-thumb {
  position:absolute;left:2px;top:2px;width:28px;height:26px;border-radius:7px;background:#dfc78a;
  transform:translateX(30px);transition:transform var(--xq-motion-menu) var(--xq-ease-out);
}
html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle][aria-checked=false] .theme-toggle-thumb {transform:translateX(0)}
html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle][aria-checked=true] .theme-toggle-moon,
html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle][aria-checked=false] .theme-toggle-sun {color:#202720}
html body.xunq-header-page-portal .xunq-site-header .theme-toggle-copy {display:none;font:500 14px/1.2 var(--xunq-header-font)!important;text-align:left}
html body.xunq-header-page-portal .xunq-site-header .theme-toggle-copy span {font:inherit}
html body.xunq-header-page-portal .xunq-site-header .theme-toggle-copy small {margin-left:9px;font:400 12px/1.2 var(--xunq-header-font);color:#a8b4ba}
html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle]:hover .theme-toggle-track {border-color:#dfc78a88}
@media(max-width:899px){
  html body.xunq-header-page-portal .xunq-site-header .theme-toggle-copy {display:block}
}
@media(min-width:900px){
  html[data-theme=light] body.xunq-header-page-portal .xunq-site-header .theme-toggle-track {background:#e7e5dc;border-color:#716a4c38}
  html[data-theme=light] body.xunq-header-page-portal .xunq-site-header .theme-toggle-track svg {color:#616a60}
  html[data-theme=light] body.xunq-header-page-portal .xunq-site-header [data-theme-toggle][aria-checked=false] .theme-toggle-sun {color:#292e24}
}
@media(prefers-reduced-motion:reduce){html body.xunq-header-page-portal .xunq-site-header .theme-toggle-track * {transition:none!important}}
@media(forced-colors:active){
  html body.xunq-header-page-portal .xunq-site-header .theme-toggle-track {border:1px solid ButtonText}
  html body.xunq-header-page-portal .xunq-site-header .theme-toggle-thumb {background:Highlight;forced-color-adjust:none}
  html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle][aria-checked=true] .theme-toggle-moon,
  html body.xunq-header-page-portal .xunq-site-header [data-theme-toggle][aria-checked=false] .theme-toggle-sun {color:HighlightText;forced-color-adjust:none}
}

@media (min-width:900px) {
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-main {
    grid-template-columns:auto minmax(0,1fr) 80px minmax(0,max-content)!important;
    gap:16px!important;
  }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-identity { max-width:180px!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-language { grid-column:3!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-account { grid-column:4!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools {
    position:static!important;
    grid-column:2!important;
    grid-row:1!important;
    display:flex!important;
    justify-content:flex-end!important;
    gap:16px!important;
    width:100%!important;
    height:44px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    overflow:visible!important;
  }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools .header-nav { gap:18px!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools .header-nav :is(a,button) { padding-inline:2px!important; white-space:nowrap!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools [data-theme-toggle] { flex:0 0 72px!important; width:72px!important; }
}
@media (max-width:899px) {
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-main {
    grid-template-columns:minmax(0,1fr) 70px minmax(0,max-content) 44px!important;
    gap:8px!important;
  }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-language,
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-language .xunq-language-toggle { width:70px!important; min-width:70px!important; max-width:70px!important; flex-basis:70px!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-account { max-width:min(138px,32vw)!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-menu { display:flex!important; grid-column:4!important; grid-row:1!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools {
    display:flex!important;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(-6px) scale(.98);
    transform-origin:top right;
    transition:opacity var(--xq-motion-menu) var(--xq-ease-out),transform var(--xq-motion-menu) var(--xq-ease-out),visibility 0s var(--xq-motion-menu);
    position:absolute!important;
    inset:calc(100% + 8px) max(12px,env(safe-area-inset-right,0px)) auto auto!important;
    z-index:1!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:8px!important;
    width:min(260px,calc(100vw - 24px))!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--xunq-header-height) - 24px)!important;
    padding:10px!important;
    border:1px solid var(--xq-ui-border)!important;
    border-radius:16px!important;
    background:#111821fa!important;
    box-shadow:0 14px 38px #0005!important;
    overflow:auto!important;
  }
  html body.xunq-header-page-portal .xunq-site-header[data-menu-open="true"] .xunq-header-tools { opacity:1; visibility:visible; pointer-events:auto; transform:none; transition-delay:0s; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools .header-nav {
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    height:auto!important;
    gap:2px!important;
  }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools .header-nav :is(a,button) {
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-height:44px!important;
    padding:10px 12px!important;
    font-size:14px!important;
    white-space:nowrap!important;
  }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-tools [data-theme-toggle] {
    width:100%!important;
    height:48px!important;
    min-height:48px!important;
    margin:0!important;
    padding:2px 12px!important;
    justify-content:space-between!important;
  }
}
@media (max-width:380px) {
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-main { gap:5px!important; }
  html body.xunq-header-page-portal .xunq-site-header .xunq-header-account { max-width:80px!important; }
}
html body .xunq-site-header :is(.xunq-account-button,.xunq-header-menu,.xunq-language-toggle button,.header-nav a,.header-nav button) {
  transition:background-color var(--xq-motion-fast) ease,color var(--xq-motion-fast) ease,border-color var(--xq-motion-fast) ease!important;
}
html body .xunq-site-header .xunq-header-account .xunq-account-button:hover { background:var(--xq-ui-hover)!important; }
html body .xunq-site-header :is(a,button):focus-visible { outline:2px solid #d7be84!important; outline-offset:3px!important; }
@media (prefers-reduced-motion:reduce) {
  html body .xunq-site-header *,html body .xunq-site-header *::before,html body .xunq-site-header *::after { transition:none!important; animation:none!important; }
}
/* The shared heading identifies each tool, so decorative product headings no
   longer push its first useful control down the page. Keep functional content. */
html body.xunq-header-page-mingshu #homeShell > .brand-hero,
html body.xunq-header-page-renti-app .workspace > .left-panel > .panel-section:first-child,
html body.xunq-header-page-bushi #scrQi > .hero,
html body.xunq-header-page-qimen .app > .page-heading,
html body:is(.xunq-header-page-xunqi,.xunq-header-page-beta) > .title,
html body:is(.xunq-header-page-xunqi,.xunq-header-page-beta) #uiSidebar > .title {
  display:none!important;
}
html body.xunq-header-page-mingshu #homeShell { padding-top:14px; }
html body.xunq-header-page-ziwei #mainContent > .hero > div:first-child > :is(.eyebrow,h1),
html body.xunq-header-page-zhenling-graph > .atlas-heading > :is(.eyebrow,h1),
html body.xunq-header-page-renti main > .intro > :is(.eyebrow,h1),
html body.xunq-header-page-zhenling .library-intro > div:first-child > :is(.eyebrow,h1),
html body.xunq-header-page-points-admin main > .heading > :is(.eyebrow,h1),
html body.xunq-header-page-portal .hero > .hero-copy > :is(.eyebrow,.hero-title) {
  display:none!important;
}
html body.xunq-header-page-ziwei #mainContent > .hero { padding-block:18px!important; min-height:0!important; }
html body.xunq-header-page-ziwei #mainContent > .hero > div:first-child > p:not(.eyebrow),
html body.xunq-header-page-renti main > .intro > .description,
html body.xunq-header-page-zhenling .library-intro > div:first-child > p:not(.eyebrow),
html body.xunq-header-page-points-admin main > .heading > p:not(.eyebrow),
html body.xunq-header-page-portal .hero > .hero-copy > .hero-description { margin-top:0!important; }
html body.xunq-header-page-zhenling .library-intro { padding-block:18px!important; }
html body.xunq-header-page-points-admin main > .heading { margin-bottom:20px!important; }
@media print {
  html body .xunq-site-header,
  html body .xunq-header-spacer { display:none!important; }
}

/* Shared shell contract: a predictable title menu, without cloning account controls. */
html body .xunq-site-header .xunq-tool-switch{display:flex;align-items:center;gap:6px;min-height:44px;max-width:100%;padding:0 4px;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;line-height:1.2;text-align:start;white-space:nowrap;cursor:pointer;box-shadow:none;letter-spacing:0}
html body .xunq-site-header .xunq-tool-switch:hover{background:var(--xq-ui-hover)}
html body .xunq-site-header .xunq-tool-switch:focus-visible{outline:2px solid var(--xq-ui-focus,#d8c28e);outline-offset:1px}
html body .xunq-site-header .xunq-tool-caption{min-width:0;overflow:hidden;text-overflow:ellipsis}
html body .xunq-site-header .xunq-tool-chevron{font:400 17px/1 system-ui;opacity:.65;transform:translateY(-2px)}
html body .xunq-site-header .xunq-tool-switcher{position:fixed;inset:auto auto auto max(12px,env(safe-area-inset-left));top:calc(var(--xunq-header-main-height) + env(safe-area-inset-top) + 8px);z-index:210;box-sizing:border-box;width:min(340px,calc(100vw - 24px));max-height:calc(100dvh - var(--xunq-header-main-height) - 32px);overflow:auto;padding:10px;border:1px solid #c5cbd529;border-radius:16px;background:#161e25;color:#e9ece8;box-shadow:0 12px 36px #0006;overscroll-behavior:contain;animation:xq-tool-menu-in var(--xq-motion-menu,180ms) ease-out}
html body .xunq-site-header .xunq-tool-switcher[hidden]{display:none!important}
html body .xunq-site-header .xunq-tool-library{display:flex;flex-direction:column;gap:3px;padding:12px;border-bottom:1px solid #c5cbd51f;text-decoration:none;color:#e3cc94;border-radius:9px}
html body .xunq-site-header .xunq-tool-library span{font-size:12px;color:#b0b9be}
html body .xunq-site-header .xunq-tool-group{margin:13px 12px 4px;font:500 11px/1.5 var(--xunq-header-font);color:#a5afb6}
html body .xunq-site-header .xunq-tool-link{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:8px 12px;box-sizing:border-box;color:inherit;text-decoration:none;border:0;border-radius:9px;font:500 14px/1.4 var(--xunq-header-font);background:transparent}
html body .xunq-site-header .xunq-tool-link small{font-size:11px;font-weight:400;color:#a8b4ba;text-align:end}
html body .xunq-site-header .xunq-tool-link[aria-current=page]{background:#d8c28e12;color:#e9d299}
html body .xunq-site-header :is(.xunq-tool-link,.xunq-tool-library):hover{background:#ffffff0b}
html body .xunq-site-header :is(.xunq-tool-link,.xunq-tool-library):focus-visible{outline:2px solid #d8c28e;outline-offset:-2px}
html[data-theme=light] body.xunq-header-page-portal .xunq-site-header{background:#f3f0e8!important;color:#292f2e!important;border-color:#48493926!important;box-shadow:0 3px 16px #0000000a!important}
html[data-theme=light] body.xunq-header-page-portal .xunq-site-header :is(.xunq-header-identity,.xunq-header-home){color:#57472e!important}
html[data-theme=light] body.xunq-header-page-portal .xunq-site-header .xunq-header-arrow{color:#777c73!important}
/* Keep portal navigation readable on the paper theme; mobile menus stay dark. */
@media(min-width:900px){
html[data-theme=light] body.xunq-header-page-portal .xunq-site-header .xunq-header-tools :is(a,button){color:#58645b!important}
html[data-theme=light] body.xunq-header-page-portal .xunq-site-header .xunq-header-tools :is(a,button):is(:hover,[aria-current],.active){color:#283b35!important;background:#4967490c!important}
}
html[data-theme=light] body.xunq-header-page-portal .xunq-site-header .xunq-header-menu{color:#58645b!important}
@keyframes xq-tool-menu-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media(max-width:480px){html body .xunq-site-header .xunq-header-identity{gap:3px}html body .xunq-site-header .xunq-tool-switch{gap:3px;font-size:14px}}
@media(prefers-reduced-motion:reduce){html body .xunq-site-header .xunq-tool-switcher{animation:none}}
@media(forced-colors:active){html body .xunq-site-header .xunq-tool-switcher{background:Canvas;color:CanvasText;border-color:CanvasText}html body .xunq-site-header .xunq-tool-link[aria-current=page]{border:1px solid Highlight}}

html body .xunq-site-header .xunq-tool-chevron{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex:0 0 20px;transform:none;opacity:1}html body .xunq-tool-chevron svg{display:block;width:20px;height:20px;transition:transform .2s}html body .xunq-tool-switch[aria-expanded="true"] .xunq-tool-chevron svg{transform:rotate(180deg)}
