/* Shared top navigation (site-header.js). Every rule is scoped to .ngnh so page
   stylesheets and this header do not affect each other. */
.ngnh {
  --ngnh-ink: #22252b;
  --ngnh-soft: #5d6168;
  --ngnh-line: #e8e5e0;
  --ngnh-blue: #259ae6;
  --ngnh-red: #d6453d;
  position: sticky;
  top: 0;
  z-index: 60;
  display: block;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 0;
  background: rgba(255, 253, 250, 0.96);
  border-bottom: 1px solid var(--ngnh-line);
  color: var(--ngnh-ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.ngnh--overlay { position: fixed; left: 0; right: 0; }
.ngnh *, .ngnh *::before, .ngnh *::after { box-sizing: border-box; }
.ngnh a { color: inherit; text-decoration: none; }
.ngnh button { font: inherit; color: inherit; margin: 0; }
.ngnh svg { display: block; }

.ngnh-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1240px;
  height: 84px;
  margin: 0 auto;
  padding: 0 24px;
}

.ngnh-brand { display: grid; gap: 5px; flex: none; }
.ngnh-bubbles { display: flex; gap: 7px; }
.ngnh-bubbles span {
  position: relative;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #72b5ec 0%, #4da2e4 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.ngnh-bubbles span::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: inherit;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
}
.ngnh-mark { color: var(--ngnh-blue); font-size: 30px; font-weight: 700; letter-spacing: 0.12em; line-height: 0.94; }
.ngnh-sub { color: var(--ngnh-blue); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; line-height: 1; }

.ngnh-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.ngnh-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--ngnh-soft);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.ngnh-links a:hover { background: #f1eee9; color: var(--ngnh-ink); }
.ngnh-links a[aria-current="page"] { background: var(--ngnh-ink); color: #fff; }
.ngnh-links .ngnh-forum { color: var(--ngnh-ink); font-weight: 600; }
.ngnh-new {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--ngnh-red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.ngnh-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ngnh-lang {
  height: 36px;
  min-width: 40px;
  padding: 0 10px;
  border: 1px solid var(--ngnh-line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.ngnh-lang:hover { border-color: #cfcac3; }
.ngnh-auth { display: flex; align-items: center; }
.ngnh .site-auth-nav-button {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--ngnh-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ngnh-ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
}
.ngnh .site-auth-menu { position: relative; }
.ngnh .site-user-chip {
  min-height: 0;
  color: var(--ngnh-ink);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--ngnh-line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.ngnh .site-user-chip span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ngnh .site-user-chip-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.ngnh .site-auth-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--ngnh-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(36, 39, 44, 0.12);
}
.ngnh .site-auth-menu-dropdown[hidden] { display: none; }
.ngnh .site-auth-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}
.ngnh .site-auth-menu-item:hover { background: #f4f2ee; }
.ngnh-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ngnh-ink);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.ngnh-forum-chip {
  display: none;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fdecea;
  color: #b8332c !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.ngnh-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--ngnh-line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}
.ngnh-burger span { display: block; height: 2px; border-radius: 2px; background: var(--ngnh-ink); transition: transform 0.2s, opacity 0.2s; }
.ngnh.is-open .ngnh-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ngnh.is-open .ngnh-burger span:nth-child(2) { opacity: 0; }
.ngnh.is-open .ngnh-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.ngnh-panel {
  max-width: 1240px;
  max-height: calc(100svh - 70px);
  margin: 0 auto;
  padding: 4px 16px 18px;
  overflow-y: auto;
}
.ngnh-panel[hidden] { display: none; }
.ngnh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ngnh-grid a {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  border: 1px solid var(--ngnh-line);
  border-radius: 16px;
  background: #fff;
  font-size: 13px;
  text-align: center;
}
.ngnh-grid a span { display: inline-flex; align-items: center; gap: 3px; }
.ngnh-grid svg { width: 24px; height: 24px; fill: none; stroke: var(--ngnh-blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ngnh-grid a[aria-current="page"] { border-color: var(--ngnh-ink); background: var(--ngnh-ink); color: #fff; }
.ngnh-grid a[aria-current="page"] svg { stroke: #fff; }
.ngnh-grid a[data-ngnh-key="forum"]:not([aria-current]) { border-color: #f1c9c5; background: #fff6f4; }
.ngnh-grid a[data-ngnh-key="forum"] svg { stroke: var(--ngnh-red); }
.ngnh-account {
  display: block;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f4f2ee;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 1120px) {
  .ngnh-links { display: none; }
  .ngnh-actions { margin-left: auto; }
  .ngnh-burger { display: flex; }
  .ngnh-forum-chip { display: inline-flex; }
}
@media (max-width: 640px) {
  .ngnh-bar { height: 64px; gap: 10px; padding: 0 16px; }
  .ngnh-bubbles { display: none; }
  .ngnh-mark { font-size: 24px; }
  .ngnh-sub { font-size: 7.5px; letter-spacing: 0.12em; }
  .ngnh-actions { gap: 6px; }
  .ngnh-lang, .ngnh .site-auth-nav-button, .ngnh-cta, .ngnh .site-user-chip, .ngnh-forum-chip { height: 34px; font-size: 13px; }
  .ngnh-forum-chip { padding: 0 10px; }
  .ngnh-lang { min-width: 34px; padding: 0 8px; }
  .ngnh .site-auth-nav-button, .ngnh-cta { padding: 0 12px; }
  .ngnh .site-user-chip span { max-width: 56px; }
  .ngnh-burger { height: 34px; }
}
@media (max-width: 400px) {
  .ngnh-cta { display: none; }
}
@media (max-width: 350px) {
  .ngnh-forum-chip { display: none; }
}
.ngnh-grid a { position: relative; }
.ngnh-grid a span { white-space: nowrap; }
.ngnh-grid .ngnh-new { position: absolute; top: 6px; right: 6px; }
