/*
  Host isolation + layout for n4859 header.
  Shared by:
    - hf-static-front static pages (inline/static mode)
    - Vue apps (dynamic mode) via /static-resource/seo-chrome/n4859-header-host-guard.css

  Known host conflicts:
  - zui `a{color:#666}` beats CDN for dropNav `label>a` (not `li>a`)
  - zui `label{font-weight:bold;margin-bottom:5px}` makes 运营/更多 look wrong
  - Element UI / global label rules can hit the same dropNav labels
  - portdetail.css Tailwind `.fixed{position:fixed}` breaks n4859 `.leftNav.fixed` / `.list.fixed` float layout

  Layout:
  - CDN `.nav` is position:fixed and does not reserve document flow.
  - Old header.css used in-flow `.header{height:46px}`.
  - Keep #hf_header 46px tall so page content is not covered.

  Load AFTER the n4859 header CDN CSS.
*/

/* Reserve in-flow space for fixed header bar (same as legacy .header height). */
#hf_header.hf-device-web {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  min-height: 46px;
}

/*
  port detail pages load portdetail.css (Tailwind utilities) which defines
  `.fixed { position: fixed }`. n4859 markup uses legacy class pairs like
  `leftNav fixed` / `list fixed` — NOT position utilities. Reset inner `.fixed`
  so logo + nav stay in one row; keep the bar itself fixed via `.nav`.
*/
#hf_header .hf-header2:not(.hf-left-nav-mobile) .leftNav.fixed,
#hf_header .hf-header2:not(.hf-left-nav-mobile) .list.fixed,
#hf_header .hf-header2 .userInfo.fixed {
  position: static !important;
}
#hf_header .hf-header2 .nav.fixed,
#hf_header.hf-device-web .hf-header2 .nav {
  position: fixed !important;
}

#hf_header a,
#hf_header a:link,
#hf_header a:visited,
#hf_header a:hover,
#hf_header a:active,
#hf_header a:focus {
  text-decoration: none;
}

#hf_header .hf_header_menu_radio {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
  appearance: none !important;
}

/* zui / Element UI label resets for dropNav */
#hf_header label.hf_header_menu {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  height: 46px;
  margin: 0 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  line-height: normal !important;
  background: transparent !important;
  border: 0 !important;
  color: rgba(255, 255, 255, 0.78) !important;
  cursor: pointer;
}

/* Beat zui `a{color:#666}` on dropNav (运营/更多 are label>a, not li>a). */
#hf_header .hf-header2 .list li.dropNav label > a,
#hf_header .hf-header2 .list li.dropNav > a,
#hf_header.hf-device-web .hf-header2 .list > li.dropNav label > a,
#hf_header.hf-device-web .hf-header2 .list > li.dropNav > a {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 400 !important;
  text-decoration: none !important;
}

#hf_header .hf-header2 .list li.dropNav label > a:hover,
#hf_header .hf-header2 .list li.dropNav.open .hf_header_menu > a,
#hf_header .hf-header2 .list li.dropNav .hf_header_menu_radio:checked + .hf_header_menu > a,
#hf_header.hf-device-web .hf-header2 .list > li.dropNav label > a:hover,
#hf_header.hf-device-web .hf-header2 .list > li.dropNav.open .hf_header_menu > a,
#hf_header.hf-device-web .hf-header2 .list > li.dropNav .hf_header_menu_radio:checked + .hf_header_menu > a {
  color: #fff !important;
  font-weight: 400 !important;
}

/* Match CDN demo caret (CSS triangle + currentColor), not the PNG/host conflict mix */
#hf_header.hf-device-web .hf-header2 .list > li.dropNav label > a.hasSub::after,
#hf_header.hf-device-web .hf-header2 .list > li.dropNav > a.hasSub::after {
  content: "";
  display: inline-block !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 0 0 6px !important;
  padding: 0 !important;
  border-style: solid !important;
  border-width: 5px 4px 0 4px !important;
  border-color: currentColor transparent transparent transparent !important;
  background: none !important;
  background-image: none !important;
  vertical-align: middle;
  box-shadow: none !important;
}

/* Minimal notice toast used by login iframe → parent.domEvent.notice */
.kou-notice {
  position: fixed;
  top: 72px;
  left: 50%;
  z-index: 100000;
  transform: translateX(-50%);
  pointer-events: none;
}
.kou-notice a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #fff;
  background: rgba(32, 36, 44, 0.92);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}
.kou-notice a i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ab4f8;
}
.kou-notice a i.success { background: #34a853; }
.kou-notice a i.info { background: #4285f4; }
.kou-notice a i.warning { background: #fbbc04; }
.kou-notice a i.error { background: #ea4335; }

/* n4859 fixed header / dropNav 高于旧 loginDialog(z-index:1000)，抬高登录层 */
.loginDialog {
  z-index: 100001 !important;
}

/*
  WordPress / Zakra / global ul-li resets break dropNav submenu alignment
  (运营/更多 subNav left offset). Scope all fixes under #hf_header.
*/
#hf_header ul,
#hf_header ol {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
#hf_header .hf-header2 .list > li {
  list-style: none !important;
  float: left;
}
#hf_header .hf-header2 .list > li.dropNav {
  position: relative !important;
}
#hf_header .hf-header2 .list > li.dropNav > ul.subNav,
#hf_header .hf-header2 .list > li.dropNav ul.subNav {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  width: max-content !important;
  min-width: 100% !important;
  transform: none !important;
  box-sizing: border-box !important;
  z-index: 100002 !important;
}
#hf_header .hf-header2 .list > li.dropNav ul.subNav > li {
  float: none !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  position: relative !important;
  line-height: normal !important;
  overflow: hidden !important;
}
/* CDN 用 flex 垂直居中；勿被 WP/主题 a{line-height} 或 display:block 打偏 */
#hf_header .hf-header2 .list > li.dropNav ul.subNav > li > a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 34px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 20px !important;
  line-height: 1.45 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  text-align: left !important;
  vertical-align: middle !important;
}


