/*
  Apache Answer：Admin → 外观 → 自定义 → Custom CSS
  保存后 Ctrl+F5 强刷 /questions 等页面。

  若白底副导航出现两条：Custom Head 与 Header HTML 重复粘贴了 answer-custom-header.html；
  请清空 Custom Head，并保留下面 head 兜底规则。
*/

/* 副导航误贴在 Custom Head 时浏览器仍会渲染，只保留 body 里那一条 */
nav.mn-subnav ~ nav.mn-subnav {
  display: none !important;
}

/* 页脚「Powered by Apache Answer」（Answer 2.x 无后台开关，仅隐藏展示） */
footer.py-3 a[href*="answer.apache.org"] {
  display: none !important;
}

footer.py-3 > div:has(a[href*="answer.apache.org"]) {
  display: none !important;
}

#header {
  --bs-navbar-color: rgba(255, 255, 255, 0.92);
  --bs-navbar-hover-color: #ffffff;
  --bs-navbar-active-color: #ffffff;
  --bs-nav-link-color: rgba(255, 255, 255, 0.92);
  --bs-nav-link-hover-color: #ffffff;
  --bs-nav-link-disabled-color: rgba(255, 255, 255, 0.5);
  --bs-navbar-brand-color: #ffffff;
  --bs-navbar-brand-hover-color: #e8ecff;
}

#header .navbar-brand,
#header .nav-link,
#header .navbar-nav .nav-link,
#header .btn-link,
#header .create-icon,
#header .search-mobile,
#header .answer-navBar,
#header .nav-text {
  color: #ffffff !important;
  opacity: 1 !important;
}

#header .nav-link:hover,
#header .btn-link:hover,
#header .navbar-brand:hover {
  color: #e8ecff !important;
}

#header .br,
#header .bi {
  color: currentColor !important;
}

#header.theme-dark .placeholder-search,
#header.theme-light .placeholder-search {
  color: #fff !important;
}

#header.theme-dark .placeholder-search::placeholder,
#header.theme-light .placeholder-search::placeholder {
  color: rgba(255, 255, 255, 0.85) !important;
}

#header .search-icon {
  color: #fff !important;
}

#header .navbar-toggler-icon {
  filter: brightness(0) invert(1);
}

#header svg {
  color: #fff !important;
  fill: currentColor;
}

/* 顶栏最右侧：登录用户（Answer 默认只把显示名放在头像 alt，页面上不显示） */
#header #dropdown-basic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  background: linear-gradient(145deg, #ff9500, #ff6a00);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  line-height: 1.25;
  text-decoration: none !important;
}

#header .mn-header-display-name {
  color: #ffffff !important;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1 !important;
}

#header #dropdown-basic:hover .mn-header-display-name {
  color: #fff8f0 !important;
}

#header #dropdown-basic:hover {
  background: linear-gradient(145deg, #ffad33, #ff8500);
  box-shadow:
    0 0 0 2px #fff,
    0 2px 10px rgba(255, 106, 0, 0.45);
}

#header #dropdown-basic img.rounded-circle {
  border: 2px solid #fff !important;
  background-color: #ffb347 !important;
  box-sizing: border-box;
  /* identicon 偏蓝时整体偏橙，便于与顶栏区分 */
  filter: hue-rotate(145deg) saturate(1.35) brightness(1.08);
}