/* AiKey home navigation. Load this stylesheet in New API's outer document. */
/* The selector limits these changes to the custom HTML home page. */
body:has(iframe[src*="/aikey-home.html"]) header > div:has(> nav) {
  width: calc(100% - 40px) !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
  padding: 16px 0 0 !important;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav {
  --foreground: #172b4d;
  --muted-foreground: #526580;
  --primary: #2563eb;
  --primary-foreground: #ffffff;
  --muted: rgba(30, 64, 120, 0.06);
  --border: rgba(59, 130, 246, 0.13);
  --ring: rgba(37, 99, 235, 0.48);

  min-height: 64px !important;
  height: auto !important;
  padding: 10px 22px !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: 9999px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.70), rgba(245, 250, 255, 0.62)) !important;
  color: #172b4d !important;
  -webkit-backdrop-filter: blur(12px) saturate(175%);
  backdrop-filter: blur(12px) saturate(175%);
  box-shadow:
    0 1px 0 rgba(30, 45, 58, 0.08),
    0 8px 24px rgba(30, 45, 58, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22) !important;
  background-clip: padding-box !important;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav :is(a, button) {
  color: #243650 !important;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav a[aria-current="page"] {
  color: #2563eb !important;
  background-color: rgba(37, 99, 235, 0.09) !important;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav a:has(img[alt="logo"]) {
  color: #172b4d !important;
  background: transparent !important;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav :is(a, button):hover {
  color: #172b4d !important;
  background-color: rgba(30, 64, 120, 0.055) !important;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav :is(a, button):focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  body:has(iframe[src*="/aikey-home.html"]) header > div:has(> nav) {
    width: calc(100% - 24px) !important;
    padding-top: 10px !important;
  }

  body:has(iframe[src*="/aikey-home.html"]) header > div > nav {
    min-height: 58px !important;
    padding: 8px 12px !important;
    border-radius: 9999px !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body:has(iframe[src*="/aikey-home.html"]) header > div > nav {
    background: rgba(255, 255, 255, 0.96) !important;
  }
}
/* Capsule controls complement the fully rounded glass shell. */
body:has(iframe[src*="/aikey-home.html"]) header > div > nav :is(a, button) {
  border-radius: 9999px !important;
}
/* 手机同时锁住 iframe 外层，避免触摸滚动传到网站空白背景。 */
@media (max-width: 767px), (max-width: 1024px) and (max-height: 600px) and (hover: none) and (pointer: coarse) {
  html:has(iframe[src*="/aikey-home.html"]) {
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body:has(iframe[src*="/aikey-home.html"]) {
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body:has(iframe[src*="/aikey-home.html"]) iframe[src*="/aikey-home.html"] {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 100dvh !important;
    border: 0;
    overscroll-behavior: none;
    touch-action: pan-y pinch-zoom;
  }
}
/* Light blue glass treatment for the sign-in / sign-up actions. */
body:has(iframe[src*="/aikey-home.html"]) header > div > nav :is(
  a[href^="/login"],
  a[href^="/sign-in"],
  a[href^="/register"],
  a[href^="/sign-up"],
  button.bg-primary,
  a.bg-primary
) {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.09) !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  font-weight: 600;
}

body:has(iframe[src*="/aikey-home.html"]) header > div > nav :is(
  a[href^="/login"],
  a[href^="/sign-in"],
  a[href^="/register"],
  a[href^="/sign-up"],
  button.bg-primary,
  a.bg-primary
):hover {
  color: #1d4ed8 !important;
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.26) !important;
}
