html[data-aihero-zh] {
  --aihero-zh-font-fallback: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

html[data-aihero-zh] body {
  font-family: var(--font-sans), var(--aihero-zh-font-fallback);
}

html[data-aihero-zh] :is(h1, h2, h3, h4, p, a, button, label, li, dt, dd) {
  overflow-wrap: anywhere;
}

html[data-aihero-zh] :is(button, input[type="submit"], input[type="button"]) {
  min-height: 2.25rem;
}

html[data-aihero-zh] [data-aihero-translated="true"] {
  letter-spacing: 0;
}

/* Small source links live in the existing header rhythm; they do not replace
 * or reorder any upstream navigation item. */
html[data-aihero-zh] header[data-aihero-community-header] > [data-aihero-community-links] {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  margin-left: auto;
  white-space: nowrap;
}

html[data-aihero-zh] [data-aihero-community-links] a {
  border-radius: 6px;
  color: var(--ah-fg-muted, var(--muted-foreground));
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 6px;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

html[data-aihero-zh] [data-aihero-community-links] a:hover {
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  color: var(--foreground);
}

html[data-aihero-zh] [data-aihero-community-links] span {
  color: var(--border);
  font-size: 12px;
  user-select: none;
}

html[data-aihero-zh] [data-aihero-community-top-links] {
  align-items: center;
  display: none;
  gap: 10px;
  height: 34px;
  position: absolute;
  right: 14px;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}

html[data-aihero-zh] [data-aihero-community-top-links] a {
  color: var(--ah-fg-subtle, var(--muted-foreground));
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

html[data-aihero-zh] [data-aihero-community-top-links] a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-aihero-zh] header[data-aihero-community-header] > nav[aria-label="User navigation"] {
  margin-left: 0 !important;
}

html[data-aihero-zh] [data-aihero-community-notice] {
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--ah-fg-faint, var(--muted-foreground));
  display: flex;
  font-size: 11.5px;
  gap: 16px;
  justify-content: space-between;
  line-height: 1.55;
  padding: 14px 18px 18px;
}

html[data-aihero-zh] [data-aihero-community-notice] p {
  margin: 0;
  max-width: 70ch;
}

html[data-aihero-zh] [data-aihero-community-notice] nav {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  white-space: nowrap;
}

html[data-aihero-zh] [data-aihero-community-notice] a {
  color: var(--ah-fg-subtle, var(--muted-foreground));
  text-decoration: none;
  transition: color 160ms ease;
}

html[data-aihero-zh] [data-aihero-community-notice] a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-aihero-zh] [data-aihero-community-notice] a:focus-visible,
html[data-aihero-zh] [data-aihero-community-links] a:focus-visible {
  outline: 2px solid var(--ring, var(--foreground));
  outline-offset: 2px;
}

/*
 * Preserve the current page while a same-origin document navigation prepares
 * the translated destination. Modern Chromium uses this as the full-load
 * fallback; normal Next.js client navigation keeps the shared shell mounted.
 */
@view-transition {
  navigation: auto;
}

html[data-aihero-zh] main {
  view-transition-name: aihero-route-content;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-old(aihero-route-content) {
  animation: 150ms cubic-bezier(0.4, 0, 1, 1) both aihero-route-out;
}

::view-transition-new(aihero-route-content) {
  animation: 210ms cubic-bezier(0.16, 1, 0.3, 1) both aihero-route-in;
}

html[data-aihero-zh] > [data-aihero-route-progress] {
  --aihero-route-progress: 0;
  background: var(--accent-fill, #f5c451);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-fill, #f5c451) 58%, transparent);
  height: 2px;
  inset: 0 0 auto;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transform: scaleX(var(--aihero-route-progress));
  transform-origin: left center;
  transition: transform 170ms cubic-bezier(0.16, 1, 0.3, 1), opacity 140ms ease;
  width: 100%;
  z-index: 2147483647;
}

html[data-aihero-zh-navigation="pending"] > [data-aihero-route-progress],
html[data-aihero-zh-navigation="complete"] > [data-aihero-route-progress] {
  opacity: 1;
}

@keyframes aihero-route-out {
  to {
    opacity: 0.76;
    transform: translateY(-2px);
  }
}

@keyframes aihero-route-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

@media (max-width: 767px) {
  html[data-aihero-zh] :is(h1, h2, h3) {
    text-wrap: balance;
  }

  html[data-aihero-zh] header[data-aihero-community-header] > [data-aihero-community-links] {
    display: none;
  }

  html[data-aihero-zh] [data-aihero-community-top-links] {
    display: flex;
  }

  html[data-aihero-zh] [data-aihero-community-notice] {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 22px;
  }
}

@media (max-width: 380px) {
  html[data-aihero-zh] [data-aihero-community-top-links] {
    gap: 7px;
    right: 9px;
  }

  html[data-aihero-zh] [data-aihero-community-top-links] a {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(aihero-route-content),
  ::view-transition-new(aihero-route-content) {
    animation-duration: 1ms;
  }

  html[data-aihero-zh] > [data-aihero-route-progress] {
    transition-duration: 1ms;
  }
}
