/* 弘山鸣应用页头：通栏玻璃导航，与首页首屏共用同一套青绿视觉语言。 */
:root {
  --hsm-green: color-mix(in srgb, #075f4f 84%, var(--foreground, #141617) 16%);
  --hsm-green-solid: #086451;
  --hsm-green-deep: #064b3f;
}

header > div:first-child {
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #dfe9e6) 82%, #78aa9d 18%) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--background, #fff) 91%, transparent) !important;
  box-shadow: 0 8px 28px rgba(17, 74, 61, .035) !important;
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
}

header > div:first-child::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background-image:
    linear-gradient(rgba(18, 105, 86, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 105, 86, .055) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(90deg, transparent 48%, #000 82%);
  mask-image: linear-gradient(90deg, transparent 48%, #000 82%);
}

header > div:first-child::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -88px;
  right: -40px;
  width: 430px;
  height: 210px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(84, 166, 144, .16), transparent 70%);
  filter: blur(12px);
}

header > div:first-child > nav {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1480px;
  height: 72px;
  margin: 0 auto;
  padding: 0 40px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

header a[href="/"]:first-of-type > div:first-child,
header a[href="/"]:first-of-type img {
  width: 36px !important;
  height: 36px !important;
}

header a[href="/"]:first-of-type > span {
  overflow: visible !important;
  max-width: none !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.12;
  letter-spacing: .025em;
}

header a[href="/"]:first-of-type > span::after {
  content: "HONGSHANMING TECHNOLOGY";
  display: block;
  margin-top: 3px;
  color: var(--hsm-green);
  font-size: 8px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .135em;
  white-space: nowrap;
}

header nav > div:nth-child(2) {
  margin-right: auto !important;
  margin-left: auto !important;
  gap: 6px !important;
}

header nav a[href]:not([href="/sign-in"]) {
  position: relative;
  padding: 11px 15px !important;
  border-radius: 0 !important;
  font-size: 14.5px !important;
  font-weight: 520;
  letter-spacing: .01em;
  transition: color .2s ease;
}

header nav a[href]:not([href="/sign-in"])::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: -8px;
  left: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--hsm-green);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

header nav a[href]:not([href="/sign-in"]):hover { color: var(--hsm-green) !important; }
header nav a[href]:not([href="/sign-in"]):hover::after,
header nav a.active::after,
header nav a[aria-current]::after { transform: scaleX(1) !important; }
header nav a.active,
header nav a[aria-current] { color: var(--hsm-green) !important; font-weight: 700; }
header a[href="/"]:first-of-type::after { display: none !important; }

/* 未登录首页按效果稿只保留主题开关；登录后不影响语言与通知功能。 */
header:has(a[href="/sign-in"]) button:has(.lucide-languages),
header:has(a[href="/sign-in"]) button[aria-label="通知"] { display: none !important; }

header button:has(.lucide-sun) {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: transparent !important;
}

header a[href="/sign-in"] {
  min-width: 140px;
  min-height: 42px;
  padding: 0 25px !important;
  border: 1px solid rgba(4, 75, 62, .76) !important;
  border-radius: 7px !important;
  color: #fff !important;
  background: linear-gradient(135deg, #0a705b, var(--hsm-green-deep)) !important;
  box-shadow: 0 10px 24px rgba(7, 96, 78, .16), inset 0 1px 0 rgba(255, 255, 255, .12);
  font-size: 14px !important;
  font-weight: 720 !important;
  letter-spacing: .025em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

header a[href="/sign-in"]::after {
  content: "→";
  margin-left: 14px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  transition: transform .18s ease;
}

header a[href="/sign-in"]:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(7, 96, 78, .2), inset 0 1px 0 rgba(255, 255, 255, .15);
}
header a[href="/sign-in"]:hover::after { transform: translateX(3px); }

body { --hsm-header-h: 72px; }

@media (max-width: 1280px) {
  header > div:first-child > nav { padding: 0 24px !important; }
  header nav > div:nth-child(2) { gap: 0 !important; }
  header nav a[href]:not([href="/sign-in"]) { padding-right: 11px !important; padding-left: 11px !important; }
  header nav a[href]:not([href="/sign-in"])::after { right: 11px; left: 11px; }
  header a[href="/sign-in"] { min-width: 126px; padding: 0 19px !important; }
}

@media (max-width: 1024px) {
  header > div:first-child::before,
  header > div:first-child::after { display: none; }
  header > div:first-child > nav { height: 58px; padding: 0 18px !important; }
  header a[href="/"]:first-of-type > div:first-child,
  header a[href="/"]:first-of-type img { width: 32px !important; height: 32px !important; }
  header a[href="/"]:first-of-type > span::after { display: none; }
  header a[href="/sign-in"] { min-width: auto; min-height: 36px; padding: 0 15px !important; }
  header a[href="/sign-in"]::after { margin-left: 8px; }
  body { --hsm-header-h: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  header a[href="/sign-in"]:hover { transform: none; }
  header a[href]::after { transition: none; }
}
