#kq-header-auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  position: relative;
  flex: 0 0 auto;
}
#kq-header-auth .kq-auth-btn {
  display: inline-flex !important;
  flex-direction: row !important;
  position: relative;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  height: 40px !important;
  border: none !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #1e88e5 0%, #1976d2 100%) !important;
  gap: 8px;
  padding: 0 20px !important;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.25) !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  overflow: visible !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease !important;
  box-sizing: border-box !important;
}
#kq-header-auth .kq-auth-label {
  display: inline-block !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  color: inherit !important;
  letter-spacing: 0 !important;
}
#kq-header-auth .kq-auth-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  flex-shrink: 0;
  object-fit: cover;
  background: linear-gradient(180deg,#f5f9ff 0%,#ebf3ff 100%);
  box-shadow: 0 0 0 1px rgba(59,130,246,.16);
}
#kq-header-auth .kq-auth-indicator {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: currentColor;
  opacity: .82;
  transition: transform 160ms ease, opacity 160ms ease;
}
#kq-header-auth .kq-auth-btn[aria-expanded="true"] .kq-auth-indicator {
  transform: rotate(180deg);
  opacity: 1;
}
#kq-header-auth .kq-auth-cancel {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #d7e2f2;
  color: #8a9ab4;
  background: #fff;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease, color 150ms ease, background-color 150ms ease;
  pointer-events: none;
}
#kq-header-auth .kq-auth-btn.is-login-pending {
  padding-right: 12px !important;
}
#kq-header-auth .kq-auth-btn.is-login-pending:hover .kq-auth-cancel,
#kq-header-auth .kq-auth-btn.is-login-pending:focus-visible .kq-auth-cancel {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  border-color: #f2b3b8;
  color: #dc2626;
  background: #fff4f4;
}
#kq-header-auth .kq-auth-btn.is-logged-in {
  color: #2563eb !important;
  height: 42px !important;
  border-radius: 999px !important;
  padding: 0 14px 0 10px !important;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #bcd2fb !important;
  border-color: #bcd2fb !important;
  background: linear-gradient(180deg,#ffffff 0%,#f3f8ff 100%) !important;
  box-shadow: 0 4px 14px rgba(59,130,246,.12), inset 0 1px 0 rgba(255,255,255,.95) !important;
}
#kq-header-auth .kq-auth-btn.is-logged-in:hover {
  border-color: #9fbffd !important;
  background: linear-gradient(180deg,#ffffff 0%,#eef5ff 100%) !important;
  box-shadow: 0 6px 18px rgba(59,130,246,.16), inset 0 1px 0 rgba(255,255,255,.95) !important;
}
#kq-header-auth .kq-auth-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid #d9e6fd;
  border-radius: 18px;
  background: linear-gradient(180deg,rgba(255,255,255,.98) 0%,rgba(247,250,255,.98) 100%);
  box-shadow: 0 20px 46px rgba(37,99,235,.18);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  z-index: 100002;
}
#kq-header-auth .kq-auth-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 24px;
  width: 12px;
  height: 12px;
  border-top: 1px solid #d9e6fd;
  border-left: 1px solid #d9e6fd;
  background: rgba(255,255,255,.98);
  transform: rotate(45deg);
}
#kq-header-auth .kq-auth-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#kq-header-auth .kq-auth-panel {
  padding: 12px 12px 14px;
  border: 1px solid #d6e4fb;
  border-radius: 14px;
  background: linear-gradient(180deg,#f7faff 0%,#eef4ff 100%);
  margin-bottom: 8px;
}
#kq-header-auth .kq-auth-panel-name {
  font-size: 14px;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1.4;
}
#kq-header-auth .kq-auth-panel-id {
  margin-top: 4px;
  font-size: 12px;
  color: #6b86b4;
  line-height: 1.4;
}
#kq-header-auth .kq-auth-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #1f3f73;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
#kq-header-auth .kq-auth-menu-item > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}
#kq-header-auth .kq-auth-menu-item:hover {
  background: #f4f8ff;
  color: #1d4ed8;
}
#kq-header-auth .kq-auth-menu-item.danger {
  color: #1f3f73;
}
#kq-header-auth .kq-auth-menu-item.danger:hover {
  background: #f4f8ff;
  color: #1d4ed8;
}
#kq-header-auth .kq-auth-menu-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  border-radius: 10px;
  background: linear-gradient(180deg,#f4f8ff 0%,#e9f1ff 100%);
  color: #7a94be;
}
#kq-header-auth .kq-auth-menu-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

#kq-header-auth .kq-auth-btn:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.35) !important;
}

body.qv-homepage .header-actions > #headerLoginBtn {
  display: none !important;
}
  #root .App { position: relative; }
  .mobile-nav-grid-item.active {
    color: #1e88e5;
    background: #e3f2fd;
    font-weight: 600;
    border: 1px solid #bbdefb;
  }
  .mobile-nav-custom-btn.active { box-shadow: 0 0 0 2px #1e88e5; }
  /* 平台概况：Vue 下 .info-card-stats 为横向 flex，子级为 .info-stat-item | .info-stat-divider | .info-stat-item；
     轮换层 .kq-hero-stat-face 须同为横向 flex，否则两数字会竖排 */
  #kq-hero-stat-rotator { flex-wrap: nowrap; }
  .kq-hero-stat-face {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  /* 与旧 SPA（main-*.js）一致：桌面 .nav-primary 可裁切，溢出项由 kqReflowDesktopNav 收进「更多工具」；下拉默认隐藏，hover / .kq-more-open 显示，fixed 坐标由脚本写在按钮下方 */
  @media (min-width: 769px) {
    header.header .nav-primary {
      overflow: hidden !important;
    }
    header.header .nav-item-wrapper {
      flex-shrink: 0;
    }
    header.header .nav {
      overflow: visible !important;
    }
  }
  .header .nav-more-wrapper .nav-more-dropdown {
    display: none !important;
  }
  .header .nav-more-wrapper:hover .nav-more-dropdown,
  .header .nav-more-wrapper:focus-within .nav-more-dropdown,
  .header .nav-more-wrapper.kq-more-open .nav-more-dropdown {
    display: block !important;
  }
  /* fixed 下拉与按钮之间不能有「视觉缝隙」：否则鼠标经过空白时父级 :hover 丢失，菜单会闪没 */
  .header .nav-more-dropdown {
    margin-top: -6px;
    padding-top: 10px;
  }
  /* 更多下拉内与顶栏相同：链接 + 展开按钮同一行（block 会导致箭头换行） */
  .header .nav-more-dropdown .nav-item-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
    box-sizing: border-box;
  }
  .header .nav-more-dropdown .nav-item-wrapper > a {
    flex: 1 1 auto;
    min-width: 0;
  }
  /* 常驻「更多」内两项：避免 flex+min-width:0 把文字挤成不可见 */
  .header .nav-more-dropdown .nav-item-wrapper > a.nav-more-dropdown-item {
    display: block;
    width: 100%;
    min-width: 8em;
    box-sizing: border-box;
  }
  .header .nav-more-dropdown .nav-item-wrapper > .category-dropdown-toggle {
    flex-shrink: 0;
  }
  /* 「更多工具」按钮与下拉项：与顶栏 .nav-link 一致（index-ded8e127：宽屏 14px/400，769–1024 为 13px；dropdown 曾为 15px/500） */
  .header .nav-more-wrapper > .nav-more-trigger,
  .header .nav-more-dropdown a.nav-more-dropdown-item {
    font-family: Microsoft YaHei, PingFang SC, sans-serif;
    font-weight: 400;
  }
  @media (min-width: 1025px) {
    .header .nav-more-wrapper > .nav-more-trigger,
    .header .nav-more-dropdown a.nav-more-dropdown-item {
      font-size: 14px;
    }
  }
  @media (min-width: 769px) and (max-width: 1024px) {
    .header .nav-more-wrapper > .nav-more-trigger,
    .header .nav-more-dropdown a.nav-more-dropdown-item {
      font-size: 13px;
    }
  }
  /* 顶栏分类工具下拉（与 old/dist main-82466e14.js + index-ded8e127.css 一致；打包 CSS 缺省时兜底） */
  .dropdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
  }
  .category-dropdown-panel {
    position: fixed;
    z-index: 100001;
    max-width: min(520px, 90vw);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  }
  .category-dropdown-toggle svg.rotated {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
  }

  /* 顶栏当前分类：仅蓝字 + 下划线（无外框、无背景）；链接与箭头共用一条线 */
  /* 顶栏 / 页脚语言下拉：与工具区内 #langSelect 同数据，由 app.js 同步 */
  .header-actions .select--lang--site-header {
    min-width: 0;
    max-width: 148px;
    height: 34px;
    padding: 4px 28px 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
  }
  .footer-lang-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }
  .footer-lang-row .select--lang--footer {
    min-width: 140px;
    max-width: min(200px, 92vw);
    height: 36px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 4px 28px 4px 10px;
    background: #fff;
    color: #333;
    cursor: pointer;
    box-sizing: border-box;
  }

  @media (min-width: 769px) {
    header.header .nav-item-wrapper:has(> a.nav-link.active):has(.category-dropdown-toggle) {
      position: relative;
    }
    header.header .nav-item-wrapper:has(> a.nav-link.active):has(.category-dropdown-toggle) .nav-link.active::after {
      display: none;
    }
    header.header .nav-item-wrapper:has(> a.nav-link.active):has(.category-dropdown-toggle)::after {
      content: "";
      position: absolute;
      left: 4px;
      right: 2px;
      bottom: 0;
      height: 2px;
      background: #1e88e5;
      border-radius: 1px;
      pointer-events: none;
    }
  }

  @media (max-width: 768px) {
    body.qv-homepage .nav-desktop-measure {
      display: none !important;
    }

    body.qv-homepage .header {
      position: sticky !important;
      top: 0 !important;
      background: #fff !important;
      box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08) !important;
      z-index: 1000 !important;
    }

    body.qv-homepage .header-container {
      padding: 10px 12px !important;
      min-height: 56px !important;
      flex-wrap: nowrap !important;
      gap: 10px !important;
    }

    body.qv-homepage .header-left {
      flex: 1 1 auto !important;
      min-width: 0 !important;
    }

    body.qv-homepage .logo-img {
      height: 28px !important;
      width: auto !important;
    }

    body.qv-homepage .nav,
    body.qv-homepage .search-box,
    body.qv-homepage .header-login-btn,
    body.qv-homepage .select--lang--site-header,
    body.qv-homepage #kq-header-auth {
      display: none !important;
    }

    body.qv-homepage .header-right,
    body.qv-homepage .header-actions {
      display: flex !important;
      align-items: center !important;
      gap: 8px !important;
      min-width: 0 !important;
    }

    body.qv-homepage .header-right {
      flex: 0 0 auto !important;
    }

    body.qv-homepage .header-search-btn,
    body.qv-homepage .mobile-menu-btn {
      display: flex !important;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      padding: 0;
      border: 1px solid #dbe3f1;
      border-radius: 999px;
      background: #fff;
      color: #334155;
      flex-shrink: 0;
      margin: 0 !important;
    }

    body.qv-homepage .mobile-menu-btn {
      font-size: 18px;
      line-height: 1;
    }

    body.qv-homepage .header-search-icon {
      width: 18px;
      height: 18px;
    }

    body.qv-homepage .mobile-nav-dropdown {
      position: fixed !important;
      top: 64px !important;
      left: 12px !important;
      right: 12px !important;
      width: auto !important;
      max-width: none !important;
      max-height: calc(100dvh - 80px) !important;
      overflow-y: auto !important;
      border-radius: 14px !important;
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2) !important;
      z-index: 1002 !important;
    }

    body.qv-homepage .mobile-nav-dropdown.is-open {
      display: block !important;
    }

    body.qv-homepage .search-modal-overlay.is-open {
      display: block !important;
    }
  }
