/* === Header / Nav === */

.navPop a,
nav a {
  color: var(--text-primary);
}

.navPop a:hover,
nav a:hover {
  color: var(--accent-cyan);
  transition: color 0.2s ease;
}

/* === Mask === */
.mask {
  width: 100vw;
  height: 100vh;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  background: rgba(5, 8, 24, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* === Mobile Nav Popup === */
.navPop {
  display: none;
  position: fixed;
  width: 100%;
  height: calc(100% - 64px);
  top: 64px;
  left: 0;
  z-index: 1000;
  background: rgba(5, 8, 24, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-glow);
}

.navPop section {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
}

.nav-linkBox {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 15px;
}

.nav-linkItem {
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-primary);
  font-style: normal;
  font-weight: 400;
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-linkItem:hover {
  color: var(--accent-cyan);
  background: rgba(41, 121, 255, 0.06);
}

.nav-loginBox {
  width: 100%;
  height: 128px;
  display: flex;
  flex-direction: column;
}

.nav-loginItem {
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-style: normal;
  font-weight: 400;
  font-size: 17px;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.nav-loginItem:hover {
  background: rgba(255, 255, 255, 0.04);
}

.nav-singUp {
  background: var(--gradient-primary);
}

.nav-singUp:hover {
  opacity: 0.9;
  background: var(--gradient-primary);
}

/* === Responsive Popup === */
@media (min-width: 640px) and (max-width: 1139px) {
  .navPop {
    top: 56px;
    height: calc(100% - 56px);
  }
}

@media (min-width: 320px) and (max-width: 639px) {
  .navPop {
    top: 56px;
    height: calc(100% - 56px);
  }
}

/* === Main Nav === */
nav {
  width: 100%;
  height: 64px;
  background: rgba(5, 8, 24, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  border-bottom: 1px solid var(--border-subtle);
  /* Subtle gradient bottom glow */
  box-shadow: 0 1px 0 var(--border-glow), 0 4px 24px rgba(5, 8, 24, 0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

nav:hover {
  background: rgba(5, 8, 24, 0.92);
}

nav>section {
  width: 1140px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 0;
  align-items: center;
}

nav .logo {
  width: 160px;
  height: 100%;
  /* background-image: url("/huiying/img/header/huiying_logo.svg"); */
  background-size: auto 36px;
  background-repeat: no-repeat;
  background-position: left center;
  /* Subtle glow on logo */
  filter: drop-shadow(0 0 8px rgba(41, 121, 255, 0.3));
  transition: filter 0.3s ease;
}

nav .logo:hover {
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.5));
}

nav .navItemBox {
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 14px;
  line-height: 64px;
  display: flex;
  align-items: center;
  letter-spacing: 0.02em;
}

nav .navItemBox-mobile {
  display: none;
}

.close-navItemBox-mobile {
  display: none;
}

nav .navItem {
  padding: 0 24px;
  cursor: pointer;
  position: relative;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  height: 64px;
  display: flex;
  align-items: center;
}

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

/* === Sign Up Button === */
.nav-signUpBox {
  width: 96px;
  height: 32px;
  display: flex;
  cursor: pointer;
  position: relative;
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  line-height: 32px;
  letter-spacing: 0.03em;
  transition: filter 0.2s ease;
}

.nav-signUpBox:hover {
  filter: brightness(1.15) drop-shadow(0 0 8px rgba(41, 121, 255, 0.6));
}

.nav-signUpBox>span {
  width: 96px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
  color: #fff;
}

.nav-signUpBox>svg {
  position: absolute;
  top: 0;
  left: -50%;
  transform: translateX(50%);
  z-index: 2;
}

/* Override SVG color for gradient look */
.nav-signUpBox>svg path {
  fill: var(--primary);
}

/* === Active Nav Item === */
.navItemActive {
  position: relative;
  color: var(--text-primary) !important;
}

.navItemActive .active {
  width: calc(100% - 48px);
  height: 2px;
  background: var(--gradient-primary);
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: var(--glow-primary);
}

/* === Tablet === */
@media (min-width: 640px) and (max-width: 1139px) {
  nav {
    width: 100vw;
    height: 56px;
  }

  nav>section {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
  }

  nav .logo {
    display: block;
    margin-left: 24px;
    background-size: auto 30px;
  }

  nav .navItemBox {
    margin-right: 24px;
    line-height: 56px;
  }

  nav .navItem {
    padding: 0 16px;
    height: 56px;
  }

  .navItemActive .active {
    width: calc(100% - 32px);
  }
}

/* === Mobile === */
@media (min-width: 320px) and (max-width: 639px) {
  nav {
    height: 56px;
  }

  nav>section {
    width: 100vw;
    display: block;
  }

  nav .logo {
    display: block;
    margin: 0 auto;
    background-image: url("/huiying/img/header/huiying_logo_mobile.svg");
    background-size: 88px 24px;
    background-position: center;
  }

  nav .navItemBox {
    display: none;
  }

  nav .navItemBox-mobile {
    display: block;
    width: 56px;
    height: 56px;
    position: absolute;
    top: 0;
    right: 0;
  }

  .close-navItemBox-mobile {
    display: none;
    width: 56px;
    height: 56px;
    position: absolute;
    top: 0;
    right: 0;
  }
}

/* === Container Offset === */
.container {
  margin-top: 64px;
}

@media (min-width: 640px) and (max-width: 1139px) {
  .container {
    margin-top: 56px;
  }
}

@media (min-width: 320px) and (max-width: 639px) {
  .container {
    margin-top: 56px;
  }
}