/* Keep NewAPI's original navigation, including its native scroll animation.
 * Administrative version/update controls belong in the console. */
header.pointer-events-none nav > [class*="system-brand"] > button[aria-haspopup="dialog"] {
  display: none;
}

header.pointer-events-none nav > [class*="system-brand"] img {
  border-radius: 0;
}

/* Reserve the host scrollbar space before the homepage reports its height. */
html:has(header.pointer-events-none a[href="/"][aria-current="page"]) {
  scrollbar-gutter: stable;
}

/* Match the homepage's restrained indigo/teal atmosphere on the model catalog. */
body:has(header.pointer-events-none a[href="/pricing"][aria-current="page"]) {
  --agentdock-catalog-base: #f8fafc;
  --agentdock-catalog-indigo: rgba(99, 102, 241, 0.065);
  --agentdock-catalog-teal: rgba(13, 148, 136, 0.045);
  --agentdock-catalog-grid: rgba(99, 102, 241, 0.018);
}
.dark body:has(header.pointer-events-none a[href="/pricing"][aria-current="page"]) {
  --agentdock-catalog-base: #090d16;
  --agentdock-catalog-indigo: rgba(129, 140, 248, 0.10);
  --agentdock-catalog-teal: rgba(45, 212, 191, 0.055);
  --agentdock-catalog-grid: rgba(165, 180, 252, 0.025);
}
body:has(header.pointer-events-none a[href="/pricing"][aria-current="page"]) div.relative > div[aria-hidden="true"][class~="inset-x-0"][class~="top-0"][style*="radial-gradient"] {
  opacity: 1;
  background:
    radial-gradient(ellipse at 24% 18%, var(--agentdock-catalog-indigo), transparent 58%),
    radial-gradient(ellipse at 78% 28%, var(--agentdock-catalog-teal), transparent 55%),
    repeating-linear-gradient(90deg, var(--agentdock-catalog-grid) 0 1px, transparent 1px 32px),
    linear-gradient(var(--agentdock-catalog-base), var(--agentdock-catalog-base)) !important;
}

/* Documentation uses the catalog/rankings wallpaper, including behind the header. */
main:has(> .agentdock-docs-page) {
  position:relative;
  isolation:isolate;
  background:radial-gradient(ellipse at 75% 12%,rgba(99,102,241,.035),transparent 56%),#f3f5f8;
  background-attachment:fixed;
}
.dark main:has(> .agentdock-docs-page) {
  background:radial-gradient(ellipse at 75% 12%,rgba(99,102,241,.045),transparent 56%),#171b22;
  background-attachment:fixed;
}
main:has(> .agentdock-docs-page)::before {
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:url('/brand/catalog-particles-light.svg?v=7') center top / cover no-repeat;
}
.dark main:has(> .agentdock-docs-page)::before {
  background-image:url('/brand/catalog-particles-dark.svg?v=7');
}
.agentdock-docs-host { position:relative; display:block; min-height:calc(100dvh - 64px); }
@media(max-width:767.98px) {
  main:has(> .agentdock-docs-page)::before { background-position:66% top; opacity:.72; }
}
@media(prefers-reduced-motion:reduce) {
  main:has(> .agentdock-docs-page)::before { background-image:url('/brand/catalog-particles-light-still.svg?v=7'); }
  .dark main:has(> .agentdock-docs-page)::before { background-image:url('/brand/catalog-particles-dark-still.svg?v=7'); }
}

/* Rotation runs to completion independently of the pointer state. */
header [class*="system-brand"] > a[href="/"] img {
  transform-origin: 50% 50%;
}

/* Keep the same frosted material in expanded and compact public navigation.
   A subtle surface highlight keeps the glass visible over the quiet hero top. */
html header.pointer-events-none > div > nav {
  background:
    linear-gradient(115deg, rgba(255,255,255,.32), rgba(255,255,255,.06) 52%, rgba(255,255,255,.18)),
    rgba(255,255,255,.58);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border-color: rgba(255,255,255,.80);
  box-shadow: 0 6px 24px rgba(20,25,30,.055), 0 0 0 .5px rgba(20,25,30,.04), inset 0 1px 0 rgba(255,255,255,.92);
}
html.dark header.pointer-events-none > div > nav {
  background:
    linear-gradient(115deg, rgba(255,255,255,.075), rgba(255,255,255,.015) 52%, rgba(255,255,255,.04)),
    rgba(30,31,33,.56);
  border-color: rgba(255,255,255,.13);
  box-shadow: 0 6px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.12);
}

/* Expanded public and console headers share one glass material over pale wallpaper. */
html:not(.dark) :is(header.pointer-events-none > div > nav:not(.h-12), [data-slot="sidebar-wrapper"] > header > div) {
  background:
    linear-gradient(110deg, rgba(203,218,239,.24), rgba(255,255,255,.08) 46%, rgba(209,202,241,.24)),
    rgba(255,255,255,.20);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-color: rgba(255,255,255,.62);
  box-shadow: 0 8px 28px rgba(36,46,74,.065), 0 0 0 .5px rgba(77,94,127,.055), inset 0 1px 0 rgba(255,255,255,.80), inset 0 -1px 0 rgba(255,255,255,.16);
}
html.dark :is(header.pointer-events-none > div > nav:not(.h-12), [data-slot="sidebar-wrapper"] > header > div) {
  background:
    linear-gradient(110deg, rgba(153,179,215,.07), rgba(255,255,255,.015) 46%, rgba(160,142,214,.075)),
    rgba(30,31,33,.38);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

/* The brand remains unfilled on pointer hover; the logo supplies the motion.
   Keep the native keyboard focus ring for accessible navigation. */
html body header :is([class*="system-brand"] > a[href="/"], a[aria-label="返回主页"]) {
  background: transparent !important;
}
