/* CollapseAI · 全站统一顶栏风格（仅作用于顶部导航栏，避免误伤模型广场等页面内的 <header>） */
:root {
  --cai-nav-bg: rgba(9, 11, 16, 0.88);
  --cai-nav-border: rgba(255, 255, 255, 0.085);
  --cai-nav-text: #f8fafc;
  --cai-nav-muted: #94a3b8;
  --cai-nav-amber: #fbbf24;
  --cai-nav-amber-bg: rgba(245, 158, 11, 0.14);
}

#root header:is(.fixed, .sticky).top-0 {
  background: var(--cai-nav-bg) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--cai-nav-border) !important;
  min-height: 64px !important;
  color: var(--cai-nav-text) !important;
  box-shadow: 0 8px 30px -16px rgba(0, 0, 0, 0.65) !important;
}

/* 防止公开页滚动时顶栏内层 nav 收缩成二次悬浮框 */
#root header.fixed.top-0 > div {
  max-width: 80rem !important;
  padding-top: 0 !important;
}

#root header.fixed.top-0 > div > nav {
  height: 64px !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 统一控制台顶栏导航链接尺寸与圆角，与首页/模型广场/关于页保持一致的矩形框 */
#root header.sticky.top-0 nav {
  gap: 4px !important;
}

#root header.sticky.top-0 nav > a {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  line-height: 1.4 !important;
}

#root header:is(.fixed, .sticky).top-0 a,
#root header:is(.fixed, .sticky).top-0 button {
  color: var(--cai-nav-muted) !important;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease !important;
}

#root header:is(.fixed, .sticky).top-0 a:not(:has(img)):not(.group):hover,
#root header:is(.fixed, .sticky).top-0 button:hover {
  color: var(--cai-nav-text) !important;
  background-color: rgba(255, 255, 255, 0.065) !important;
}

/* Active nav item highlight — 仅作用于菜单导航项，排除左上角品牌 Logo 链接 */
#root header:is(.fixed, .sticky).top-0 a[aria-current="page"]:not(:has(img)):not(.group),
#root header:is(.fixed, .sticky).top-0 a[data-status="active"]:not(:has(img)):not(.group) {
  color: var(--cai-nav-amber) !important;
  background-color: var(--cai-nav-amber-bg) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
}

/* Brand title & logo inside header — 彻底去除背景框、边框与截断 */
#root header:is(.fixed, .sticky).top-0 a[href="/"]:has(img),
#root header:is(.fixed, .sticky).top-0 a[href="/"]:has(img):hover,
#root header:is(.fixed, .sticky).top-0 a[href="/"]:has(img)[aria-current="page"],
#root header:is(.fixed, .sticky).top-0 a[href="/"]:has(img)[data-status="active"],
#root header:is(.fixed, .sticky).top-0 a.group[href="/"],
#root header:is(.fixed, .sticky).top-0 a.group[href="/"]:hover,
#root header:is(.fixed, .sticky).top-0 a.group[href="/"][aria-current="page"],
#root header:is(.fixed, .sticky).top-0 a.group[href="/"][data-status="active"],
#root header:is(.fixed, .sticky).top-0 [class*="system-brand"] > a,
#root header:is(.fixed, .sticky).top-0 [class*="system-brand"] > a:hover,
#root header:is(.fixed, .sticky).top-0 [class*="system-brand"] > a[aria-current="page"],
#root header:is(.fixed, .sticky).top-0 [class*="system-brand"] > a[data-status="active"] {
  color: var(--cai-nav-text) !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#root header:is(.fixed, .sticky).top-0 [class*="system-brand"] a span,
#root header:is(.fixed, .sticky).top-0 a[href="/"]:has(img) span {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: var(--cai-nav-text) !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#root header:is(.fixed, .sticky).top-0 a[href="/"] img {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  object-fit: contain !important;
  box-shadow: 0 4px 14px -3px rgba(245, 158, 11, 0.45) !important;
}

/* Header outline buttons / search / kbd / icons */
#root header:is(.fixed, .sticky).top-0 button[class*="border"],
#root header:is(.fixed, .sticky).top-0 input {
  background-color: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--cai-nav-text) !important;
}

#root header:is(.fixed, .sticky).top-0 kbd {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--cai-nav-muted) !important;
}

#root header:is(.fixed, .sticky).top-0 svg {
  color: inherit;
}

/* Primary CTA button (Login / Dashboard) inside header */
#root header:is(.fixed, .sticky).top-0 a[href="/sign-in"],
#root header:is(.fixed, .sticky).top-0 a[href="/sign-up"] {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  color: #090b10 !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 20px -6px rgba(245, 158, 11, 0.6) !important;
}

#root header:is(.fixed, .sticky).top-0 a[href="/sign-in"]:hover,
#root header:is(.fixed, .sticky).top-0 a[href="/sign-up"]:hover {
  filter: brightness(1.08) !important;
  color: #090b10 !important;
}
