:root {
  --search-header-tab-width: 114px;
  --search-header-tab-height: 48px;
  --search-header-tab-top: 8px;
  --search-header-tab-gap: 32px;
  --search-header-legacy-badge-width: 58.5px;
  --search-header-legacy-badge-height: 30px;
  --search-header-side-reserve: 305px;
  --search-header-logo-width: 289px;
}

html.jufa-search-html,
body.jufa-search-page {
  width: 100% !important;
  min-width: 0 !important;
}

/* 工作台旧页面的外层 header 带 1170px 定宽，先在本页作用域解除后再应用共享布局。 */
body.jufa-search-page > header.header {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.jufa-shared-header,
.jufa-shared-header .lawfrim_header {
  width: 100% !important;
  max-width: 100vw !important;
  min-width: 0 !important;
}

/* 法规页头部高于检索吸顶栏，避免经典版被下方导航遮挡。 */
body.law-search-page > .jufa-shared-header {
  position: relative;
  z-index: 901;
}

/* 所有已登录页面共用三段式头部，中间导航始终以视口中心为定位基准。 */
.jufa-shared-header .jufa-Unified-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 60px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 16px !important;
  background: #fff;
}

.jufa-shared-header .jufa-Unified-header .lawfrim_logo {
  position: relative;
  z-index: 2;
  flex: 0 0 var(--search-header-logo-width);
  width: var(--search-header-logo-width);
  margin-right: 0;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_box {
  position: absolute;
  top: 0;
  left: 50%;
  width: max(220px, calc(100% - (2 * var(--search-header-side-reserve))));
  height: 60px;
  transform: translateX(-50%);
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box {
  position: relative;
  width: 100%;
  height: 60px;
}

/* 顶部 Tab 的定高与横向滚动只作用于直属导航，不能裁剪“更多”中的嵌套列表。 */
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list {
  display: flex;
  align-items: center;
  justify-content: safe center;
  width: 100%;
  height: var(--search-header-tab-height);
  box-sizing: border-box;
  margin: var(--search-header-tab-top) 0 0;
  padding: 0;
  gap: var(--search-header-tab-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list::-webkit-scrollbar {
  display: none;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li {
  display: flex !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0;
  height: var(--search-header-tab-height);
  box-sizing: border-box;
  margin-left: 0;
  padding: 0 !important;
  white-space: nowrap;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li + li {
  margin-left: 0;
}

/* 仅活动 Tab 保留设计图的 114×48 容器，普通菜单按图标和文字的自然宽度排列。 */
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li.active {
  flex: 0 0 var(--search-header-tab-width);
  width: var(--search-header-tab-width) !important;
  min-width: var(--search-header-tab-width);
}

/* 旧头部为活动项附加的左右 9px 装饰会把可视宽度撑至 132px，破坏设计图的 114px Tab 间距。 */
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li.active::before,
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li.active::after {
  display: none;
}

/* 公共经典版按确认的20px内收定位独立锚点，不推动导航图文。 */
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_legacy-badge-anchor {
  position: absolute;
  top: calc(100% - 20px);
  left: calc(50% - 199px);
  z-index: 11;
  width: var(--search-header-legacy-badge-width);
  height: var(--search-header-legacy-badge-height);
  pointer-events: none;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_legacy-badge {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--search-header-legacy-badge-width);
  height: var(--search-header-legacy-badge-height);
  opacity: 1;
  background: #F68A38;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: var(--search-header-legacy-badge-height);
  text-align: center;
  white-space: nowrap;
}

/* 短三角保持8×4px，中心左移一个字宽，对准“经典版”的“经”字。 */
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_legacy-badge::before {
  content: '';
  position: absolute;
  top: -4px;
  left: calc(50% - 1em - 4px);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid #F68A38;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li > i {
  flex: 0 0 auto;
  margin-right: 6px;
  font-size: 20px;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li > .lawFirm_fun_name {
  flex: 0 0 auto;
  color: #333;
  font-size: 16px;
  line-height: 22px;
  white-space: nowrap;
}

.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li.active > i,
.jufa-shared-header .jufa-Unified-header .lawFirm_fun_box > ul.lawFirm_fun_list > li.active > .lawFirm_fun_name {
  color: #0052d9;
}

.jufa-shared-header .jufa-Unified-header .right_header_box {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-left: auto;
}

/* 首页未加载工作台 index.css，这些声明统一补齐头像弹窗的现有工作台视觉契约。 */
.jufa-shared-header #menu3 {
  width: 486px;
  padding: 16px 0 0 !important;
  border-radius: 8px;
}

.jufa-shared-header .header_user_info_box .login_drop_botlist .botlist_item {
  display: inline-block;
  text-align: center;
}

.jufa-shared-header .header_user_info_box .login_drop_bot {
  border-bottom: 1px solid #ddd;
}

.jufa-shared-header .header_user_info_box .botlist_item p {
  height: 20px;
  margin: 0;
  color: #333;
  font-family: PingFangSC-Medium, "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.jufa-shared-header .header_user_info_box .login_drop_bot_btns {
  text-align: right;
  color: #999;
  font-family: PingFangSC-Regular, "PingFang SC", sans-serif;
  font-size: 14px;
}

.jufa-shared-header .header_user_info_box .login_drop_bot_btns a {
  color: #999;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .jufa-shared-header {
    --search-header-side-reserve: 233px;
    --search-header-logo-width: 128px;
  }

  .jufa-shared-header .jufa-Unified-header .lawfrim_logo .logo_link {
    width: var(--search-header-logo-width) !important;
    overflow: hidden;
  }

  .jufa-shared-header .jufa-Unified-header .lawfrim_logo .logo_link > div {
    display: none !important;
  }

  .jufa-shared-header .jufa-Unified-header .lawFirm_fun_legacy-badge-anchor {
    /* 窄屏同样对齐工作台“作”字；普通 Tab 自然宽度不再使用旧图标定位值。 */
    left: 162px;
  }

  /* 导航容器以视口居中，抵消其左偏移，避免窄屏更多浮层越出屏幕。 */
  .jufa-shared-header .jufa-Unified-header .more_tabs_box {
    left: calc(50% - 50vw + 12px) !important;
    right: auto !important;
    max-width: calc(100vw - 24px);
  }

}
