/*
 * 试题通官网公共页头最终对齐层
 * 适用：首页、搜题库、下载页、我的题库。
 * 页面原有样式仍负责各自内容区；这里只收口页头的实际计算尺寸与间距。
 */

:is(
  .stt-home-refresh .dingbutou,
  .stt-tiku-refresh .dingbutou,
  .stt-download .download-header,
  .stt-library-refresh .stt-site-header
) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

@media (min-width: 1181px) {
  :is(
    .stt-home-refresh .dingbutou nav,
    .stt-tiku-refresh .dingbutou nav,
    .stt-download .download-nav,
    .stt-library-refresh .stt-desktop-nav
  ) {
    gap: 2px !important;
    font-size: 14px !important;
    line-height: 21px !important;
  }

  /* 清掉 Tailwind space-x 和各页面旧样式叠加出的隐性外边距。 */
  :is(
    .stt-home-refresh .dingbutou nav,
    .stt-tiku-refresh .dingbutou nav,
    .stt-download .download-nav,
    .stt-library-refresh .stt-desktop-nav
  ) > a {
    margin-left: 0 !important;
    margin-right: 0 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 21px !important;
  }

  .stt-home-refresh .dingbutou nav > .header-search-link,
  .stt-tiku-refresh .dingbutou nav > .header-search-link,
  .stt-download .download-nav > .download-nav-search,
  .stt-library-refresh .stt-desktop-nav > .stt-header-search {
    margin-left: 8px !important;
    margin-right: 8px !important;
  }

  /* 搜题库页显示蓝色选中态；其余页面保留清晰但克制的控件边界。 */
  .stt-home-refresh .dingbutou nav > .header-search-link,
  .stt-download .download-nav > .download-nav-search,
  .stt-library-refresh .stt-desktop-nav > .stt-header-search {
    border-color: #d7e1ee !important;
    background: #fff !important;
    color: #475467 !important;
    box-shadow: none !important;
  }

  .stt-home-refresh .dingbutou nav > .header-search-link:hover,
  .stt-download .download-nav > .download-nav-search:hover,
  .stt-library-refresh .stt-desktop-nav > .stt-header-search:hover {
    border-color: #2563eb !important;
    background: #f8faff !important;
    color: #2563eb !important;
    box-shadow: none !important;
  }

  .stt-download .download-nav-search .download-search-icon {
    border-color: #475467 !important;
  }

  .stt-download .download-nav-search .download-search-icon::after {
    background: #475467 !important;
  }

  .stt-download .download-nav-search:hover .download-search-icon {
    border-color: #2563eb !important;
  }

  .stt-download .download-nav-search:hover .download-search-icon::after {
    background: #2563eb !important;
  }

  :is(
    .stt-home-refresh .header-account,
    .stt-tiku-refresh .header-account,
    .stt-download .download-account,
    .stt-library-refresh .stt-login-area
  ) {
    width: 290px !important;
    min-width: 290px !important;
    flex: 0 0 290px !important;
    justify-content: flex-end !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 21px !important;
  }

  :is(
    .stt-home-refresh .header-account,
    .stt-tiku-refresh .header-account,
    .stt-download .download-account,
    .stt-library-refresh .stt-login-area
  ) .tuichu1 {
    width: 100% !important;
    min-width: 0 !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  :is(
    .stt-home-refresh .header-account,
    .stt-tiku-refresh .header-account,
    .stt-download .download-account,
    .stt-library-refresh .stt-login-area
  ) .tuichu {
    align-items: center !important;
    gap: 8px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    line-height: 24px !important;
    white-space: nowrap !important;
  }

  :is(
    .stt-home-refresh .header-account,
    .stt-tiku-refresh .header-account,
    .stt-download .download-account,
    .stt-library-refresh .stt-login-area
  ) :is(.touxiang, .huiyuan1, .thename) {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  :is(
    .stt-home-refresh .header-account,
    .stt-tiku-refresh .header-account,
    .stt-download .download-account,
    .stt-library-refresh .stt-login-area
  ) .thename {
    display: block !important;
    max-width: 190px !important;
    overflow: hidden !important;
    font-family: inherit !important;
    font-size: 16px !important;
    line-height: 24px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  :is(
    .stt-home-refresh .header-account,
    .stt-tiku-refresh .header-account,
    .stt-download .download-account,
    .stt-library-refresh .stt-login-area
  ) :is(.dl, .tcdl) {
    min-width: 80px !important;
    height: 40px !important;
    padding-right: 18px !important;
    padding-left: 18px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 21px !important;
    transform: none !important;
  }
}
