/* Shared PC/H5 navigation from the final V1.2 prototype styles. */
:root {
  --aihx-shell-header-height: calc(70px + env(safe-area-inset-top));
  --aihx-shell-mobile-nav-height: calc(76px + env(safe-area-inset-bottom));
}

#header, #menuHolder {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #222631;
}

body.aihx-shell-active #header {
  border-bottom: 1px solid #f0f0f3;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#header .aihx-topbar {
  display: flex;
  max-width: none;
  padding-inline: clamp(20px, 2.1vw, 34px);
  gap: 28px;
}

#header .aihx-topbar-logo { flex: 0 0 auto; }
#header .aihx-topbar-logo #logo {
  display: block;
  width: 160px;
  height: auto;
  max-width: none;
  max-height: 48px;
}

#header .aihx-desktop-nav { flex: 1; justify-content: flex-start; gap: 28px; }
#header .aihx-desktop-nav ul { gap: 9px; }
#header .aihx-desktop-nav .aihx-secondary-links { margin-left: auto !important; gap: 18px; }

#header .aihx-topnav-link {
  min-width: 0;
  min-height: 0;
  gap: 7px;
  padding: 10px 17px;
  border: 0;
  border-radius: 9px;
  color: #e74672;
  background: #fff3f6;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.6;
  box-shadow: none;
  transform: none;
  transition: none;
}

#header .aihx-topnav-link.active,
#header .aihx-topnav-link.aihx-active { color: #fff; background: #e74672; }
#header .aihx-secondary-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 0;
  color: #94949c;
  background: transparent;
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}
#header .aihx-secondary-link.active { color: #e74672; }
#header .nav-svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

#header .aihx-topbar-account { flex: 0 0 auto; gap: 28px; }
#header button { cursor: pointer; color: inherit; font: inherit; border: 0; background: none; }
#header .aihx-credit-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid #e8e9ed;
  white-space: nowrap;
}
#header .aihx-credit-balance { display: flex; align-items: center; gap: 4px; padding: 2px 6px; font-size: 13px; }
#header .aihx-credit-balance .nav-svg { width: 16px; color: #e74672; }
#header .aihx-topup { padding: 4px 0; color: #a53454; font-size: 12px; }
#header .aihx-header-auth { flex: 0 0 auto; }
#header :is(a, button):focus-visible,
#menuHolder a:focus-visible { outline: 3px solid #e7467270; outline-offset: 3px; }

@media (max-width: 1200px) {
  #header .aihx-topbar-logo #logo { width: 145px; max-height: 43px; }
  #header .aihx-topbar, #header .aihx-topbar-account, #header .aihx-desktop-nav { gap: 20px; }
  #header .aihx-topnav-link { padding: 9px 12px; }
  #header .aihx-desktop-nav .aihx-secondary-links { gap: 10px; }
}

@media (max-width: 1100px) {
  #header .aihx-desktop-nav .aihx-secondary-links, #header .aihx-credit-unit { display: none; }
  #header .aihx-topbar, #header .aihx-topbar-account, #header .aihx-desktop-nav { gap: 12px; }
  #header .aihx-credit-nav { gap: 6px; padding-left: 6px; }
}

@media (max-width: 991px) {
  :root { --aihx-shell-header-height: calc(62px + env(safe-area-inset-top)); }
  body.aihx-shell-active #header { display: block !important; background: rgba(255,255,255,.97); border-bottom: 1px solid rgba(35,38,48,.07); box-shadow: 0 3px 16px rgba(30,32,42,.035); }
  body.aihx-shell-active:not(.aihx-media-immersive) .shell-stage {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  #header .aihx-topbar {
    flex-wrap: nowrap;
    gap: 7px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
  #header .aihx-topbar-logo { margin-right: auto; }
  #header .aihx-topbar-logo #logo { width: 112px; height: auto; max-height: 36px; }
  #header .aihx-desktop-nav, #header .aihx-credit-balance { display: none !important; }
  #header .aihx-credit-nav { flex: 0 0 auto; gap: 0; padding-left: 0; border-left: 0; }
  #header .aihx-topup { min-width: 40px; min-height: 36px; padding: 6px 4px; }
  #header .aihx-topbar-account { gap: 7px; }

  body.aihx-shell-active #menuHolder {
    height: var(--aihx-shell-mobile-nav-height);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    border-top: 1px solid #eae9ed;
    border-radius: 0;
    background: rgba(255,255,255,.97);
    box-shadow: 0 -10px 28px rgba(29,31,40,.065);
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  #menuHolder .mobile-nav ul { align-items: stretch; }
  #menuHolder .mobile-nav li { height: 100%; }
  #menuHolder .mnav-btn {
    gap: 4px;
    border-radius: 11px;
    color: #858b98;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
  }
  #menuHolder .mnav-btn > svg,
  #menuHolder .aihx-create-icon svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #menuHolder .mnav-btn.active { color: #db376b; font-weight: 750; }
  #menuHolder .mnav-btn::before, #menuHolder .mnav-btn::after { content: none; display: none; }
  #menuHolder .mnav-btn.nav-accent {
    z-index: 2;
    align-self: start;
    justify-content: flex-start;
    width: auto;
    height: auto;
    margin: -22px 0 0;
    border-radius: 11px;
    background: none;
    color: #c4325c;
    box-shadow: none;
  }
  #menuHolder .mnav-btn.nav-accent.active { color: #e74672; }
  #menuHolder .aihx-create-icon {
    display: grid;
    place-items: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    margin-bottom: 1px;
    border: 5px solid #fff;
    border-radius: 50%;
    background: #e83f73;
    color: #fff;
    box-shadow: 0 8px 20px rgba(232,63,115,.27);
  }
  #menuHolder .aihx-create-icon svg { width: 27px; height: 27px; stroke-width: 1.8; }
}

@media (max-width: 370px) {
  #header .aihx-topbar { gap: 5px; padding-inline: 14px; }
  #header .aihx-topbar-account { gap: 5px; }
  #header .aihx-topbar-logo #logo { width: 101px; height: 30px; }
  #menuHolder .mnav-btn { font-size: 9px; }
}

/* Keep these after the H5 display rule: immersive media owns the viewport. */
body.aihx-media-immersive #header,
body.aihx-media-immersive #menuHolder { display: none !important; }
