/*
 * MM3D Slicer — L2 shared public topbar
 * Visual template = current homepage topbar (decision B2, 2026-09-14).
 * Scope: public marketing/content chrome only (Wave 2). Account-flow brands excluded (E2).
 */

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  min-height: 72px;
  padding: 0 clamp(24px, 6vw, 120px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  border-bottom: 1px solid rgba(200, 208, 218, 0.14);
  background: linear-gradient(120deg, #030b17, #0a2445);
  box-shadow: 0 8px 30px rgba(3, 11, 23, 0.16);
  color: #fff;
}

.site-topbar--simple {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.site-topbar:not(.site-topbar--simple):not(.site-topbar--user) {
  grid-template-columns: 1fr auto 1fr;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  font-family: "MM3D Display Serif", "Noto Serif TC", "MM3D Chinese Serif", serif;
  font-size: 18px;
  font-weight: 900;
  font-variation-settings: "wght" 900;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand span {
  color: #ffb13b;
}

.site-brand strong {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.site-topbar-nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.site-topbar--simple .site-topbar-nav {
  justify-self: unset;
  margin-left: auto;
}

.site-topbar:not(.site-topbar--simple):not(.site-topbar--user) {
  grid-template-columns: 1fr auto 1fr;
}

.site-topbar-nav > a,
.site-topbar-item > a,
.site-topbar-actions > a:not(.site-topbar-cta):not(.primary) {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.site-topbar:not(.site-topbar--user) .site-topbar-nav > a,
.site-topbar:not(.site-topbar--user) .site-topbar-item > a,
.site-topbar:not(.site-topbar--user) .site-topbar-actions > a:not(.site-topbar-cta):not(.primary) {
  font-size: 18px;
}

.site-topbar--user .site-topbar-nav > a,
.site-topbar--user .site-topbar-actions > a:not(.site-topbar-cta):not(.primary) {
  font-size: 18px;
}

.site-topbar-nav > a:hover,
.site-topbar-item > a:hover,
.site-topbar-actions > a:not(.site-topbar-cta):not(.primary):hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

/* Pricing sections live one level under 方案 on every standard public nav. */
.site-topbar-item {
  position: relative;
}

.site-topbar-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 120;
  min-width: 148px;
  padding-top: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.site-topbar-item--end .site-topbar-submenu {
  left: auto;
  right: 0;
}

.site-topbar-item:hover .site-topbar-submenu,
.site-topbar-item:focus-within .site-topbar-submenu,
.site-topbar-item.is-open .site-topbar-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .site-topbar-submenu {
    transform: none;
    transition: none;
  }
}

.site-topbar-submenu-panel {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(200, 208, 218, 0.16);
  border-radius: 10px;
  background: linear-gradient(160deg, #071426, #0a2445);
  box-shadow: 0 16px 36px rgba(3, 11, 23, 0.36);
}

.site-topbar-submenu-panel a {
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-topbar-submenu-panel a:hover,
.site-topbar-submenu-panel a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.site-topbar-submenu-panel a[aria-disabled="true"] {
  cursor: default;
}

.site-topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.site-topbar--simple .site-topbar-actions {
  justify-self: unset;
  margin-left: auto;
}

.site-topbar-cta,
.site-topbar-actions > a.primary,
.site-topbar-actions > a.site-topbar-cta {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  border: 1px solid rgba(29, 155, 255, 0.62);
  background: linear-gradient(135deg, #087cff, #0756c7);
  color: #fff;
  box-shadow: 0 8px 22px rgba(8, 124, 255, 0.2);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.site-topbar-cta:hover,
.site-topbar-actions > a.primary:hover,
.site-topbar-actions > a.site-topbar-cta:hover {
  color: #fff;
  filter: brightness(1.05);
}

.site-topbar-home {
  gap: 8px;
}

.site-topbar-home svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-topbar-user-divider {
  width: 1px;
  height: 18px;
  margin: 0 10px;
  background: rgba(255, 255, 255, 0.22);
}

/* Signed-in name menu: one size on every public topbar (I1). */
body .site-topbar .home-user-menu > button {
  min-height: 44px;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

body .site-topbar .home-user-menu > button > span {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

body .site-topbar .home-user-menu > button > strong {
  max-width: 160px;
  font-size: 18px;
}

.site-topbar a:focus-visible,
.site-topbar button:focus-visible {
  outline: 2px solid #1d9bff;
  outline-offset: 2px;
}

/* I1 (2026-09-14): public topbar stays at fixed desktop size.
   Do not add a 1680px font/height grow here. Side padding may still widen. */

@media (max-width: 900px) {
  .site-topbar {
    padding: 0 16px;
    gap: 16px;
  }
}

@media (max-width: 720px) {
  .site-topbar-home span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .site-topbar-user-divider {
    display: none;
  }

  .site-topbar:not(.site-topbar--simple),
  .site-topbar:not(.site-topbar--simple):not(.site-topbar--user) {
    grid-template-columns: auto 1fr;
    row-gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .site-topbar:not(.site-topbar--simple) .site-topbar-nav {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .site-topbar--simple .site-topbar-nav a:not(:last-child) {
    display: none;
  }
}
