/* ---------- 导航栏容器：全宽蓝色渐变，固定顶部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(to right, #2A93FD 0%, #0145CB 100%);
  transition: box-shadow 0.4s ease;
  /* 滚动后增加阴影，保持渐变背景 */
}
.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(1, 40, 120, 0.35);
}
/* ---------- 导航栏内部布局：内容区 1400px 居中 ---------- */
.header-inner {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  height: 84px;
  gap: 24px;
}
/* ---------- 品牌标识：横版 Logo 图片（设计稿 176x68） ---------- */
.header-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header-brand .header-brand-logo {
  display: block;
  width: auto;
  height: 60px;
  object-fit: contain;
  margin: 0 30px;
}
/* ---------- 导航链接区域：纯文字，间距 40 ---------- */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 42px;
  flex: 1;
  height: 84px;
}
.header-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0;
  font-size: 18px;
  color: #ffffff;
  opacity: 0.85;
  text-decoration: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  /* 非激活项 hover：完全不透明 */
  /* 当前激活的导航项：加粗 + 白色指示条 */
}
.header-nav a:hover {
  opacity: 1;
}
.header-nav a.active {
  opacity: 1;
  font-weight: 600;
  /* 激活项文字正下方白色圆角指示条（24x3，间距 6） */
}
.header-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -26px;
  width: 80px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 2px;
  background-color: #ffffff;
}
.header-placeholder {
  flex: 1;
  width: 1px;
  display: none;
}
/* ---------- 登录态区域 ---------- */
.header-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
/* 用户信息按钮：头像 + 手机号（圆角 8） */
.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  /* 头像圆底（半透明白）+ 人形图标 */
}
.auth-user .auth-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
}
.auth-user .auth-phone {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}
/* 退出按钮：透明底 + 白色描边 */
.auth-logout {
  padding: 10px 20px;
  font-size: 14px;
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.auth-logout:hover {
  background: rgba(255, 255, 255, 0.16);
}
/* 未登录：登录按钮（半透明白底 + 白字） */
.auth-login {
  display: inline-flex;
  align-items: center;
  padding: 10px 40px;
  font-size: 14px;
  color: #ffffff;
  text-decoration: none;
  background: #2069FF;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.auth-login:hover {
  background: rgba(255, 255, 255, 0.28);
}
/* 未登录：注册按钮（白底深蓝字，与登录按钮并排） */
.auth-register {
  display: inline-flex;
  align-items: center;
  padding: 10px 40px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  background: #ffffff;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.auth-register:hover {
  background: rgba(255, 255, 255, 0.85);
}
/* ---------- 移动端汉堡菜单按钮 ---------- */
.header-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  /* 汉堡菜单展开状态（X 形态） */
}
.header-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.header-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.header-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
/* 固定定位下占位空白 */
.blankSpace {
  height: 84px;
}
/* ========== 中屏适配 (max-width: 1300px)：保持横向导航，整体压缩尺寸 ========== */
@media (max-width: 1300px) {
  .header-inner {
    margin: 0 16px;
    height: 64px;
    gap: 16px;
  }
  /* 品牌标识：适当缩小 Logo */
  .header-brand .header-brand-logo {
    width: auto;
    height: 44px;
    margin: 0 8px;
  }
  /* 导航：缩小字号与间距，保持横排 */
  .header-nav {
    gap: 20px;
    height: 64px;
  }
  .header-nav a {
    font-size: 16px;
  }
  .header-nav a.active::after {
    bottom: -18px;
    width: 56px;
  }
  /* 登录态：压缩尺寸 */
  .auth-user {
    padding: 4px 10px 4px 4px;
  }
  .auth-user .auth-avatar {
    width: 24px;
    height: 24px;
  }
  .auth-user .auth-phone {
    font-size: 13px;
  }
  .auth-logout,
  .auth-login,
  .auth-register {
    padding: 7px 14px;
    font-size: 13px;
  }
  /* 占位空间适配 */
  .blankSpace {
    height: 64px;
  }
}
@media (max-width: 1000px) {
  .header-inner {
    margin: 0 6px;
    height: 64px;
    gap: 8px;
  }
  .header-nav {
    gap: 18px;
    height: 64px;
    flex: 1;
    width: 1px;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .header-nav a {
    font-size: 14px;
  }
  .header-nav a.active::after {
    bottom: -18px;
    width: 40px;
  }
}
/* ========== 小屏适配 (max-width: 768px)：仍保持横向导航 ========== */
@media (max-width: 768px) {
  .header-inner {
    margin: 0 12px;
    height: 56px;
    gap: 8px;
  }
  .header-brand .header-brand-logo {
    height: 36px;
    margin: 0 6px;
  }
  .header-nav {
    gap: 14px;
    height: 56px;
  }
  .header-nav a {
    font-size: 15px;
  }
  .header-nav a.active::after {
    bottom: -15px;
    width: 30px;
  }
  .auth-logout,
  .auth-login,
  .auth-register {
    padding: 6px 10px;
    font-size: 12px;
  }
  .auth-user .auth-phone {
    font-size: 12px;
  }
  .blankSpace {
    height: 56px;
  }
}
/* ========== 手机端弹窗模式 (max-width: 480px)：切换为汉堡 + 右侧抽屉 ========== */
@media (max-width: 480px) {
  .header-inner {
    margin: 0 12px;
    height: 56px;
    gap: 8px;
  }
  .header-brand .header-brand-logo {
    height: 32px;
    margin: 0 6px;
  }
  /* 登录态：进一步压缩，仅保留核心按钮 */
  .auth-user .auth-phone {
    font-size: 12px;
  }
  .auth-logout,
  .auth-login,
  .auth-register {
    padding: 5px 10px;
    font-size: 12px;
  }
  /* 导航面板：右侧滑入白色抽屉（弹窗模式） */
  .header-nav {
    position: fixed;
    top: 0;
    left: auto;
    right: 0;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background-color: #ffffff;
    padding: 56px 0 24px 0;
    font-size: 16px;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* 导航面板展开：从右侧滑入 */
    /* 导航链接：全宽深色大触摸区 */
  }
  .header-nav.open {
    transform: translateX(0);
  }
  .header-nav a {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 20px;
    font-size: 15px;
    color: #333333;
    opacity: 1;
    border-radius: 0;
    border-bottom: 1px solid #f0f0f0;
    /* 激活导航项：左侧蓝色指示条 */
  }
  .header-nav a:hover {
    background-color: rgba(1, 77, 178, 0.06);
  }
  .header-nav a.active {
    color: #014db2;
    border-left: 4px solid #014db2;
    padding-left: 16px;
  }
  .header-nav a.active::after {
    display: none;
  }
  .header-placeholder {
    display: block;
  }
  /* 汉堡菜单按钮 */
  .header-hamburger {
    display: flex;
    width: 32px;
    height: 32px;
    gap: 5px;
    z-index: 1003;
    position: relative;
  }
  .header-hamburger span {
    height: 2px;
  }
  .header-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .header-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .header-hamburger.open span {
    background-color: #014db2;
  }
  /* 遮罩层：半透明黑色蒙版 */
  .header-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 1001;
  }
  .header-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  /* 占位空间适配 */
  .blankSpace {
    height: 56px;
  }
}
