/* ============================================================
 * AI人才网 · 顶部信息条 + 全栏目导航 + 能力横幅
 * 结构复刻 https://xsd.cn/index.html 导航条及以上内容
 * 配色统一为网站蓝紫渐变 var(--grad)
 * 依赖 style.css（在它之后引入）
 * ============================================================ */

/* ---------- ① 顶部渐变细线（xsd.cn .topline） ---------- */
.topline {
  height: 3px; width: 100%;
  background: var(--grad);
}

/* ---------- ② 顶部信息条（xsd.cn .topbar） ---------- */
.topbar {
  background: var(--grad);
  color: #fff; font-size: 12px; position: relative; z-index: 62;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(560px 90px at 88% -60%, rgba(255,255,255,.22), transparent 70%);
}
.topbar .tb-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px; min-height: 38px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; position: relative;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-right { flex-shrink: 0; }

/* 城市切换触发器（复用 xsd-city-switch 的 #cityTrigger） */
#cityTrigger.city-trigger--bar {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.34);
  color: #fff; border-radius: 999px; padding: 4px 11px;
  font-size: 12px; font-family: inherit; cursor: pointer; line-height: 1.4;
  transition: .18s;
}
#cityTrigger.city-trigger--bar:hover { background: rgba(255,255,255,.3); border-color: rgba(255,255,255,.6); }
#cityTrigger .ct-pin { font-size: 12px; }
#cityTrigger b { font-weight: 700; color: #fff; }
#cityTrigger svg { width: 12px; height: 12px; opacity: .85; }
#cityTrigger .ct-label { color: rgba(255,255,255,.82); }
.tb-slogan { color: rgba(255,255,255,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-user { color: rgba(255,255,255,.92); text-decoration: none; transition: .18s; }
.tb-user:hover { color: #fff; text-decoration: underline; }
.tb-sep { color: rgba(255,255,255,.38); }
.tb-contact { color: #fff; white-space: nowrap; }
.tb-contact b { color: #fff; font-weight: 700; letter-spacing: .2px; }
.tb-theme {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  display: inline-grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .36);
  transition: .18s;
}
.tb-theme:hover { background: rgba(255, 255, 255, .32); border-color: #fff; }
.tb-theme svg { width: 13px; height: 13px; }

/* ---------- ③ 主导航：与顶部信息条统一的蓝紫渐变导航条 ----------
 * 栏目按浏览动线排列，用 space-between 均匀铺满整行，末端不再留大片空白 */
.site-header {
  top: 0;
  background: var(--grad);
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 4px 18px rgba(52, 39, 140, .14);
}
.header-inner { gap: 14px; height: 60px; }
.site-header .brand-mark {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .5);
  color: #fff; box-shadow: none;
}
.site-header .brand-text b { color: #fff; }
.site-header .brand-text span { color: rgba(255, 255, 255, .76); font-size: 10px; }

.nav.nav-all {
  flex: 1; min-width: 0; gap: 0;
  justify-content: space-between; align-items: center;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -ms-overflow-style: none; padding: 2px 0;
}
.nav.nav-all::-webkit-scrollbar { display: none; }
.nav.nav-all a.nav-link {
  padding: 8px 9px; font-size: 13px; font-weight: 600; border-radius: 8px;
  white-space: nowrap; color: rgba(255, 255, 255, .93); transition: .18s;
}
.nav.nav-all a.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .18); }
.nav.nav-all a.nav-link.active {
  color: #fff; background: rgba(255, 255, 255, .24);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .92);
}
.nav.nav-all .nav-sep { margin: 0 4px; height: 14px; background: rgba(255, 255, 255, .36); }

.header-actions { gap: 7px; }
.site-header .icon-btn {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .36); color: #fff;
}
.site-header .icon-btn:hover { background: rgba(255, 255, 255, .3); border-color: #fff; color: #fff; }
.site-header .avatar-btn { background: #fff; color: #4f46e5; }

/* 登录后的头像下拉：会员中心 / 人才端 / 企业端 / 后台 / 退出 */
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-wrap .avatar-btn { cursor: pointer; border: 2px solid rgba(255, 255, 255, .85); font-family: inherit; }
.user-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 11px); width: 196px; z-index: 80;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px;
}
.user-menu.open { display: block; }
.user-menu .um-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-menu .um-head b { font-size: 13px; color: var(--text); }
.user-menu .um-head span { font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.user-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.user-menu a:hover { background: var(--primary-soft); color: var(--primary); }
.user-menu a svg { flex-shrink: 0; }

/* 右侧双 CTA：人才入库 → 注册、企业入驻 → 发布岗位，统一蓝紫渐变按钮 */
.hdr-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 700;
  white-space: nowrap; color: #fff;
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 55%, #0891b2 100%);
  border: 1.5px solid rgba(255, 255, 255, .88);
  box-shadow: 0 4px 12px rgba(24, 18, 70, .26);
  transition: .18s;
}
.hdr-cta:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24, 18, 70, .34); color: #fff; }
.nav-scroll-hint { display: none; }

/* 深色主题：导航条改用与信息条一致的深蓝紫渐变，文字仍为白色 */
html[data-theme="dark"] .site-header {
  background: linear-gradient(100deg, #312471 0%, #4c2f96 55%, #1e4a7a 100%);
  border-bottom-color: rgba(255, 255, 255, .16);
}
html[data-theme="dark"] .hdr-cta {
  background: linear-gradient(135deg, #5b4bd6 0%, #8b5cf6 55%, #0ea5e9 100%);
}

/* ---------- ④ 导航条下方能力横幅（xsd.cn .mt-band） ---------- */
.mt-band {
  background: var(--grad-soft);
  border-bottom: 1px solid var(--line);
}
.mt-band .mt-inner {
  max-width: var(--max); margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.mt-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.mt-logo {
  width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center;
  background: var(--grad); color: var(--on-grad); font-size: 13px; font-weight: 800;
}
.mt-brand__txt b { display: block; font-size: 12.5px; line-height: 1.3; }
.mt-brand__txt span { display: block; font-size: 9.5px; letter-spacing: .6px; color: var(--muted); }
.mt-tags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.mt-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 6px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
}

/* ---------- ⑤ 响应式 ---------- */
@media (max-width: 1320px) {
  .nav.nav-all a.nav-link { padding: 8px 7px; font-size: 12.5px; }
  .hdr-cta { padding: 8px 11px; }
}
@media (max-width: 1180px) {
  .tb-slogan { display: none; }
  .brand-text span { display: none; }
  .nav.nav-all a.nav-link { font-size: 12px; padding: 8px 5px; }
  .nav.nav-all .nav-sep { margin: 0 2px; }
  .hdr-cta { font-size: 12px; padding: 7px 9px; }
  .header-inner { gap: 10px; }
}
/* 桌面窄屏/平板：收进汉堡菜单，菜单内仍含全部栏目与双 CTA */
@media (max-width: 1000px) {
  .nav.nav-all { display: none; }
  .header-actions { margin-left: auto; }
  .menu-toggle { display: grid; }
  .mobile-nav { inset: 60px 0 0; }
}
@media (max-width: 900px) {
  .tb-contact { display: none; }
  .mt-tags .mt-tag:nth-child(n+5) { display: none; }
}
@media (max-width: 768px) {
  .topbar .tb-inner { padding: 0 14px; min-height: 34px; gap: 8px; }
  #cityTrigger .ct-label, #cityTrigger svg { display: none; }
  .tb-right { font-size: 11px; }
  .tb-right .tb-sep { margin: 0 2px; }
  .header-inner { padding: 0 14px; height: 58px; gap: 8px; }
  .brand-text span { display: none; }
  .mt-band .mt-inner { padding: 8px 14px; gap: 10px; }
  .mt-tags { display: none; }
  .mobile-nav { inset: 58px 0 0; }
}
@media (max-width: 560px) {
  /* 手机端双 CTA 收进汉堡菜单，避免挤压 Logo 与主题按钮 */
  .header-actions .hdr-cta { display: none; }
}

/* 深色主题：渐变转深，保证白字对比度 */
html[data-theme="dark"] .topbar {
  background: linear-gradient(100deg, #312471 0%, #4c2f96 55%, #1e4a7a 100%);
}
html[data-theme="dark"] .mt-band { background: var(--grad-soft); }
