:root {
  --yzh-header-bg: rgba(11, 10, 14, .96);
  --yzh-header-line: rgba(231, 227, 234, .1);
  --yzh-header-text: #e7e3ea;
  --yzh-header-soft: #b8b5c0;
  --yzh-header-green: #b8d9c0;
  --yzh-header-purple: #c9a7ff;
  --yzh-header-warm: #eadcbc;
}

.yzh-site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  width: 100%;
  min-height: 78px;
  border-bottom: 1px solid var(--yzh-header-line);
  background: var(--yzh-header-bg);
  box-shadow: 0 12px 38px rgba(8, 8, 10, .2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.yzh-site-header__inner {
  width: min(1120px, calc(100% - 36px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.yzh-site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: var(--yzh-header-text);
  text-decoration: none;
}

.yzh-site-brand img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(201, 167, 255, .28);
  border-radius: 12px;
  background: #050506;
}

.yzh-site-brand span {
  color: var(--yzh-header-text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.yzh-site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.yzh-site-nav a,
.yzh-site-nav button,
.yzh-header-action {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--yzh-header-soft);
  background: transparent;
  font: 800 13px/1 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.yzh-site-nav a:hover,
.yzh-site-nav button:hover,
.yzh-header-action:hover {
  color: var(--yzh-header-text);
  background: rgba(231, 227, 234, .055);
}

.yzh-site-nav .yzh-member-link {
  color: #272128;
  border-color: rgba(234, 220, 188, .25);
  background: linear-gradient(135deg, #e9d9b2, #d9c6ee);
}

.yzh-site-nav .yzh-member-link:hover {
  color: #1e1920;
  background: linear-gradient(135deg, #f0e1bd, #e1cdf3);
  transform: translateY(-1px);
}

.yzh-site-nav [aria-current="page"]:not(.yzh-member-link) {
  color: var(--yzh-header-green);
  border-color: rgba(184, 217, 192, .2);
  background: rgba(184, 217, 192, .07);
}

.yzh-header-action {
  flex: 0 0 auto;
  border-color: rgba(201, 167, 255, .25);
  border-radius: 11px;
  color: var(--yzh-header-purple);
  background: rgba(201, 167, 255, .08);
}

.yzh-header-action[hidden] { display: none !important; }

.yzh-nav-group { position: relative; margin-left: auto; }

.yzh-nav-trigger { display: inline-flex; align-items: center; gap: 6px; }

.yzh-nav-caret { font-size: 9px; transition: transform .16s ease; }

.yzh-nav-group[data-open="true"] .yzh-nav-caret { transform: rotate(180deg); }

.yzh-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 148px;
  padding: 6px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--yzh-header-line);
  border-radius: 13px;
  background: var(--yzh-header-bg);
  box-shadow: 0 18px 40px rgba(8, 8, 10, .35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.yzh-nav-group[data-open="true"] .yzh-nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.yzh-nav-menu a {
  padding: 10px 12px;
  border-radius: 9px;
  display: block;
  color: var(--yzh-header-soft);
  font: 750 13px "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.yzh-nav-menu a:hover,
.yzh-nav-menu a[aria-current="page"] {
  color: var(--yzh-header-text);
  background: rgba(231, 227, 234, .06);
}

:where(.yzh-site-header a, .yzh-site-header button):focus-visible {
  outline: 2px solid var(--yzh-header-green);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .yzh-site-header, .yzh-site-header__inner { min-height: 68px; }
  .yzh-site-header__inner { width: calc(100% - 22px); gap: 10px; }
  .yzh-site-brand img { width: 40px; height: 40px; }
  .yzh-site-brand span { font-size: 16px; }
  .yzh-site-nav { gap: 6px; }
  .yzh-site-nav a:not(.yzh-member-link) { display: none; }
  .yzh-site-nav a, .yzh-site-nav button, .yzh-header-action { min-height: 38px; padding-inline: 12px; font-size: 12px; }
}

@media (max-width: 420px) {
  .yzh-site-header__inner { width: calc(100% - 16px); }
  .yzh-site-brand { gap: 9px; }
  .yzh-site-brand span { font-size: 15px; }
  .yzh-header-action { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .yzh-site-header * { transition: none !important; }
}
