/* 全国栏目页统一复用地区首页的头部、面包屑以上区域与红线页尾。 */
html.x1-column-standard-shell,
html.x1-column-standard-shell body {
  background: #fff !important;
  background-image: none !important;
}

/* 首屏尚未解析完长栏目列表时也预留滚动条宽度，防止居中页头和筛选区横向跳动。 */
html.x1-column-standard-shell.x1-column-standard-shell {
  scrollbar-gutter: stable !important;
}

html.x1-column-standard-shell body.xwang-a13-page .logosearchtel {
  margin-top: 0 !important;
}

html.x1-column-standard-shell .footer_new.dz-footer-wrap {
  display: none !important;
}

html.x1-column-standard-shell .x1-home-footer-direct-copy {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
}

html.x1-column-standard-shell .license-footer {
  border-top-color: #e30018 !important;
}

/* 全国所有城市和栏目层级共用生活服务的面包屑节奏，只调整公共区域。 */
html.x1-column-standard-shell .dz-breadcrumb {
  margin-top: 10px !important;
}

@media (max-width: 760px) {
  html.x1-column-standard-shell .mobile-compact-footer,
  html.x1-column-standard-shell .ma-site-foot.ma-site-foot--compact {
    border-top: 3px solid #e30018 !important;
  }
}

/*
 * 全国栏目页唯一筛选区。
 * 视觉数值直接沿用用户已验收的 f193181b 基线：29.8px 行轨、
 * 68px 短项、6px 列距、23px 标签和 3px 圆角；不按城市、栏目或 ID 分支。
 */
@media (min-width: 961px) {
  html.x1-column-standard-shell body.x1-national-category-shell .dz-list-filter {
    overflow: visible !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    box-sizing: border-box !important;
    margin: 0 14px !important;
    padding: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select > dl {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: subgrid !important;
    column-gap: 30px !important;
    align-items: start !important;
    overflow: visible !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 3.6px 0 !important;
    border-bottom: 1px dashed #d8d8d8 !important;
    line-height: 29.8px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select > dl:nth-last-child(2),
  html.x1-column-standard-shell body.x1-national-category-shell #select > dl:last-child {
    border-bottom: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select dt,
  html.x1-column-standard-shell body.x1-national-category-shell #select dd {
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select > dl > dt {
    box-sizing: border-box !important;
    min-width: 65px !important;
    height: 29.8px !important;
    padding-right: 0 !important;
    color: #5f6d70 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 29.8px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select > dl > dd,
  html.x1-column-standard-shell body.x1-national-category-shell #select .content {
    overflow: visible !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select > dl > dd {
    width: 100% !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand > dd > .x1-category-filter-uniform-row,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-area-aligned-dd {
    display: flex !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 30px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-limit,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-area-limit {
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    height: 29.8px !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-area-option-grid {
    display: flex !important;
    width: 0 !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    column-gap: 6px !important;
    row-gap: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow > .x1-category-filter-major-item,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-area-option-grid > .x1-filter-area-option {
    display: flex !important;
    position: relative !important;
    width: 68px !important;
    min-width: 0 !important;
    height: 29.8px !important;
    flex: 0 0 68px !important;
    align-items: center !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 29.8px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 29.8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: flex-start !important;
    column-gap: 6px !important;
    row-gap: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row > .x1-filter-auto-balance-item {
    display: flex !important;
    position: relative !important;
    width: 68px !important;
    min-width: 0 !important;
    height: 29.8px !important;
    flex: 0 0 68px !important;
    align-items: center !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 29.8px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row > .x1-filter-auto-balance-item:first-child {
    width: 60px !important;
    flex-basis: 60px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow > .x1-filter-item--expanded,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-area-option-grid > .x1-filter-item--expanded,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row > .x1-filter-item--expanded {
    width: max-content !important;
    min-width: 68px !important;
    flex: 0 0 max-content !important;
  }

  /* 6px 基础列距加 34px，只扩大真实长项，下一项净间距保持40px。 */
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow > .x1-filter-item--expanded:not(:last-child),
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-area-option-grid > .x1-filter-item--expanded:not(:last-child),
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row > .x1-filter-item--expanded:not(:last-child) {
    margin-right: 34px !important;
  }

  /* 长项占多数时改用紧凑列距，避免整行被重复40px留白拉散。只按数据长度判断。 */
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row--dense-long {
    column-gap: 12px !important;
  }

  /* 紧凑长项行的首个实际选项仍与普通行共用起始列线。 */
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row--dense-long:not(.x1-filter-auto-balance-row--equal-monthly) > .x1-filter-auto-balance-item:first-child {
    margin-right: -6px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row--dense-long > .x1-filter-item--expanded:not(:last-child) {
    margin-right: 0 !important;
  }

  /*
   * 栏目分类无论数量多少，都按真实字宽和可用宽度计算共享列线；
   * 所有行使用同一组列宽，列与列之间保持40px净间距。
   * 只按数据与容器宽度判断，不含城市、栏目名称或ID分支。
   */
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow--many > .x1-filter-item--has-children {
    width: max-content !important;
    min-width: 70px !important;
    flex: 0 0 max-content !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow--many > .x1-filter-item--has-children:not(:last-child) {
    margin-right: 34px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow.x1-category-grid-ready {
    display: grid !important;
    column-gap: 40px !important;
    row-gap: 0 !important;
    align-items: start !important;
    align-content: start !important;
    justify-content: start !important;
  }

  /* 大分类在脚本执行前直接使用对应宽度的列数，不经历 flex 到 grid 的高度跳变。 */
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow:has(> .x1-category-filter-major-item:nth-child(41)):not(.x1-category-grid-ready) {
    display: grid !important;
    grid-template-columns: repeat(7, max-content) !important;
    column-gap: 40px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow:has(> .x1-category-filter-major-item:nth-child(41)):not(.x1-category-grid-ready) > .x1-category-filter-major-item {
    margin-right: 0 !important;
  }

  /* 少量且字宽接近区县名的分类，沿用区县行的74px列节奏。 */
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow.x1-category-grid-compact {
    column-gap: 6px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow.x1-category-grid-ready > .x1-category-filter-major-item {
    margin-right: 0 !important;
    justify-self: start !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select dd > div,
  html.x1-column-standard-shell body.x1-national-category-shell #select .content > div {
    position: relative !important;
    overflow: visible !important;
    float: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select dd a {
    display: inline-flex !important;
    box-sizing: border-box !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 23px !important;
    min-height: 23px !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: visible !important;
    padding: 1.5px 5px !important;
    border: 0 !important;
    border-radius: 3px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #263437 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    text-align: left !important;
    text-decoration: none !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select dd a:not(.curr):is(:hover, :focus-visible) {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: inset 0 0 0 0.5px #e30018 !important;
    color: #263437 !important;
    outline: 0 !important;
    z-index: 5 !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select dd a.curr,
  html.x1-column-standard-shell body.x1-national-category-shell #select dd a.curr:is(:hover, :focus-visible) {
    border-color: #000 !important;
    background: #000 !important;
    box-shadow: none !important;
    color: #fff !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children {
    position: relative !important;
    z-index: 1;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children.is-open,
  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children:focus-within {
    z-index: 200;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children > a {
    position: relative !important;
    padding-right: 13px !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children > a::before {
    content: none !important;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children > a::after {
    content: "+";
    display: block;
    position: absolute;
    top: 0;
    right: 5px;
    left: auto;
    width: 8px;
    height: 10px;
    color: #e30018;
    opacity: 0.4;
    background: none;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 10px;
    text-align: center;
    pointer-events: none;
  }

  html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-item--has-children > a.curr::after {
    color: #fff;
  }
}

/* 与公共列轨计算的桌面宽度区间一致；仅是同一公共组件的首次绘制，不按栏目分流。 */
@media (min-width: 1250px) and (max-width: 1420px) {
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow:has(> .x1-category-filter-major-item:nth-child(41)):not(.x1-category-grid-ready) {
    grid-template-columns: repeat(6, max-content) !important;
  }
}

@media (min-width: 1080px) and (max-width: 1249px) {
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow:has(> .x1-category-filter-major-item:nth-child(41)):not(.x1-category-grid-ready) {
    grid-template-columns: repeat(5, max-content) !important;
  }
}

@media (min-width: 961px) and (max-width: 1079px) {
  html.x1-column-standard-shell body.x1-national-category-shell #select-brand .x1-category-filter-major-flow:has(> .x1-category-filter-major-item:nth-child(41)):not(.x1-category-grid-ready) {
    grid-template-columns: repeat(4, max-content) !important;
  }
}

/* 月薪沿用公共筛选行的列线：前两项与下一行对齐，长项仅占自身字宽。 */
html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row--equal-monthly {
  column-gap: 6px !important;
}

html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-auto-balance-row--equal-monthly > .x1-filter-item--expanded:not(:last-child) {
  margin-right: 0 !important;
}

html.x1-column-standard-shell body.x1-national-category-shell .x1-filter-popover {
  position: fixed;
  z-index: 95;
  display: block;
  box-sizing: border-box;
  width: min(var(--subcategory-width, 298px), calc(100vw - 16px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 7px 13px;
  border: 2px solid #e30018;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px #1d3e402e;
  backdrop-filter: none;
}

html.x1-column-standard-shell body.x1-national-category-shell .x1-filter-popover[hidden] {
  display: none !important;
}

html.x1-column-standard-shell body.x1-national-category-shell .x1-filter-popover strong {
  display: none;
}

html.x1-column-standard-shell body.x1-national-category-shell .x1-filter-popover-grid {
  display: grid;
  grid-template-columns: repeat(var(--subcategory-columns, 1), max-content);
  column-gap: 15px;
  row-gap: 0;
  margin: 0;
}

html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-popover-grid a {
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 25px !important;
  min-height: 25px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: visible !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #263437 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 25px !important;
  text-decoration: none !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

html.x1-column-standard-shell body.x1-national-category-shell #select .x1-filter-popover-grid a:is(:hover, :focus-visible) {
  border-color: #e30018 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #e30018 !important;
  outline: 0 !important;
}
