/* ==========================================================================
   统一站点栏
   注入到门户与两个子站顶部，提供跨站点切换
   ========================================================================== */

:root {
  --hub-accent: #6366f1;
  --hub-accent-2: #8b5cf6;
  --hub-bar-h: 46px;
}

.hub-bar {
  position: sticky; top: 0; z-index: 100;
  height: var(--hub-bar-h);
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid #e6eaf3;
  color: #0f172a;
}
[data-theme="dark"] .hub-bar { background: rgba(15,23,42,.88); border-bottom-color: #2c3b57; color: #f1f5f9; }

.hub-bar-inner {
  width: min(1180px, 100% - 48px); height: 100%; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hub-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 800; letter-spacing: -.01em; color: inherit; white-space: nowrap;
}
.hub-brand-mark {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 6px;
  border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, var(--hub-accent), var(--hub-accent-2));
  box-shadow: 0 4px 10px -5px var(--hub-accent);
}
.hub-brand-mark svg { width: 100%; height: 100%; }

.hub-nav { display: flex; align-items: center; gap: 4px; }
.hub-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  color: #64748b; transition: color .2s ease, background .2s ease; white-space: nowrap;
}
.hub-nav a:hover { color: var(--hub-accent); background: rgba(99,102,241,.09); }
.hub-nav a svg { width: 14px; height: 14px; }
.hub-nav a[aria-current="page"] { color: var(--hub-accent); background: rgba(99,102,241,.12); }
[data-theme="dark"] .hub-nav a { color: #94a3b8; }
[data-theme="dark"] .hub-nav a[aria-current="page"] { color: #a5b4fc; background: rgba(129,140,248,.16); }
[data-theme="dark"] .hub-nav a:hover { color: #a5b4fc; background: rgba(129,140,248,.12); }

/* 门户站点栏右侧主题按钮 */
.hub-theme-btn {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 7px;
  border: 1px solid #e6eaf3; border-radius: 9px; background: #fff; color: #64748b;
  transition: all .2s ease;
}
.hub-theme-btn:hover { border-color: var(--hub-accent); color: var(--hub-accent); }
.hub-theme-btn svg { width: 100%; height: 100%; }
[data-theme="dark"] .hub-theme-btn { background: #1e293b; border-color: #2c3b57; color: #94a3b8; }
[data-theme="dark"] .hub-theme-btn .icon-sun { display: block; }
[data-theme="dark"] .hub-theme-btn .icon-moon { display: none; }
.hub-theme-btn .icon-sun { display: none; }

/* 子站已黏顶的 header 下移到站点栏之下；锚点滚动留出空间 */
body[data-site="software"] .site-header,
body[data-site="windows"] .site-header { top: var(--hub-bar-h); }
body[data-site="software"] html,
body[data-site="windows"] html { scroll-padding-top: calc(var(--hub-bar-h) + 88px); }

@media (max-width: 640px) {
  .hub-bar-inner { width: min(100% - 28px, 1180px); }
  .hub-brand { font-size: 13px; }
  .hub-nav a { padding: 7px 9px; font-size: 12px; }
  .hub-nav a .hub-label-en { display: none; }
}
