/* =========================================================================
 * 海洋系列 · 共用顶栏
 * Ocean Series shared top nav
 *
 * 约定 markup（门户与 styleguide 共用）：
 * <nav class="os-nav" aria-label="海洋系列">
 *   <div class="os-nav__inner">
 *     <a class="os-nav__brand" href="http://wangdw.xyz/">…</a>
 *     <div class="os-nav__pills">A/B/C/D pills</div>
 *     <a class="os-nav__ds" href="/design-system/">设计系统</a>
 *   </div>
 * </nav>
 * ========================================================================= */

.os-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h, 56px);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
  color: var(--fg);
}

.os-nav__inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.os-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.os-nav__brand:hover {
  color: var(--primary);
}

.os-nav__mark {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--pan-a), var(--pan-b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.os-nav__pills {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.os-nav__pills::-webkit-scrollbar {
  display: none;
}

.os-nav__pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.95;
}

.os-nav__pill:hover {
  opacity: 1;
  filter: brightness(1.06);
}

.os-nav__pill--a { background: var(--pan-a); }
.os-nav__pill--b { background: var(--pan-b); }
.os-nav__pill--c { background: var(--pan-c); }
.os-nav__pill--d { background: var(--pan-d); }

.os-nav__pill.is-current {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px currentColor;
}

.os-nav__ds {
  margin-left: auto;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.os-nav__ds:hover,
.os-nav__ds.is-current {
  color: var(--accent);
}

@media (max-width: 640px) {
  .os-nav__brand-text {
    display: none;
  }

  .os-nav__inner {
    padding: 0 var(--s-3);
    gap: var(--s-2);
  }
}
