/* ============================================================
   头部导航 - 完整版（手机端平铺展示，不折叠）
   ============================================================ */

/* ===== 头部 ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  padding-block: 0;
  backdrop-filter: none;
  transition: box-shadow var(--transition-nav);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--space-nav-height);
  gap: 20px;
  background: transparent;
}

/* Logo：不可点击 */
.header__logo {
  flex-shrink: 0;
  display: inline-block;
  height: 40px;
  line-height: 0;
}

.header__logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* 导航 */
.header__nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  height: var(--space-nav-height);
  padding-inline: 56px;
  background-color: var(--color-bg-muted);
  border-radius: var(--radius-nav-pill);
  min-width: 300px;
  flex: 0 1 auto;
}

.nav-pill__link {
  position: relative;
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-nav);
  line-height: var(--line-height-nav);
  color: var(--color-text);
  transition: color var(--transition-nav);
  cursor: pointer;
  white-space: nowrap;
}

.nav-pill__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 50px;
  transition: width var(--transition-nav);
}

.nav-pill__link.is-active {
  font-weight: var(--font-weight-nav-active);
}

.nav-pill__link.is-active::after {
  width: 16px;
}

.nav-pill__link:hover {
  color: var(--color-primary);
}

/* 操作按钮 */
.header__actions {
  flex-shrink: 0;
  display: flex;
  gap: 9px;
  transition: opacity 0.3s, visibility 0.3s;
}

.nav-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--space-nav-height);
  padding-inline: 20px;
  background-color: var(--color-bg-muted);
  border-radius: var(--radius-nav-btn);
  font-size: var(--font-size-nav-btn);
  line-height: var(--line-height-nav-btn);
  color: var(--color-text-secondary);
  transition: color var(--transition-nav);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.nav-action:hover {
  color: #3C8AFF;
}

/* ===== WeChat 二维码 ===== */
.wechat-qr {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0) !important;
  margin-top: -12px !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
  width: 240px;
  height: 240px;
  pointer-events: none;
}

.nav-action--wechat:hover .wechat-qr {
  opacity: 1;
  visibility: visible;
}

.wechat-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 汉堡按钮（默认隐藏，手机端也不显示） */
.header__toggle {
  display: none !important;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}

.header__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  transition: var(--transition-nav);
}

/* 滚动后隐藏 Logo 和操作按钮（桌面端） */
.header.is-scrolled .header__logo,
.header.is-scrolled .header__actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.header.is-scrolled .header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* ============================================================
   iPad 适配 (1024px及以下)
   ============================================================ */
@media (max-width: 1024px) {
  .nav-pill {
    gap: 20px !important;
    padding-inline: 24px !important;
    min-width: auto !important;
  }
  .nav-pill__link {
    font-size: 14px !important;
  }
  .nav-action {
    padding-inline: 14px !important;
    font-size: 13px !important;
  }
  .header__actions {
    gap: 6px !important;
  }
}

/* ============================================================
   手机适配 (768px及以下) - 平铺展示，不折叠
   ============================================================ */
@media (max-width: 768px) {
  .header__inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    min-height: 56px;
    gap: 10px;
  }

  /* ★ 手机端 Logo 在滚动后消失 ★ */
  .header.is-scrolled .header__logo {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* ★ 手机端导航在滚动后占据全部空间 ★ */
  .header.is-scrolled .header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .header__logo img {
    height: 32px;
  }

  /* 导航始终显示，不折叠 */
  .header__nav {
    display: flex !important;
    width: auto;
    flex: 1 1 auto;
    order: 0;
    margin-top: 0;
  }

  .nav-pill {
    flex-direction: row !important;
    height: 40px;
    padding: 0 16px !important;
    gap: 16px !important;
    border-radius: 40px;
    background-color: var(--color-bg-muted);
    backdrop-filter: none;
    box-shadow: none;
    min-width: auto !important;
    flex: 0 1 auto;
  }

  /* ★ 手机端导航样式：normal #111，选中蓝色，无hover ★ */
  .nav-pill__link {
    font-size: 13px !important;
    padding: 0 !important;
    white-space: nowrap;
    color: #111111 !important;
  }

  .nav-pill__link.is-active {
    color: #3C8AFF !important;
    font-weight: 600 !important;
  }

  .nav-pill__link.is-active::after {
    width: 16px;
    background-color: #3C8AFF !important;
  }

  /* ★ 手机端无 hover 效果 ★ */
  .nav-pill__link:hover {
    color: #111111 !important;
  }

  .nav-pill__link.is-active:hover {
    color: #3C8AFF !important;
  }

  .nav-pill__link::after {
    display: block !important;
    bottom: -4px;
    height: 2px;
    background-color: #111111;
  }

  /* ★ 手机端隐藏发邮件和 WeChat 按钮 ★ */
  .header__actions {
    display: none !important;
  }

  /* 汉堡按钮保持隐藏 */
  .header__toggle {
    display: none !important;
  }
}

/* 375px以下超小手机导航防挤压补充 */
@media (max-width: 375px) {
  .nav-pill__link {
    letter-spacing: -0.2px;
  }
}
