/* vibedesign/web 公共层：页面壳 —— 导航壳 / 顶栏 / 菜单 / 按钮体系 / 悬浮工具 / 页脚 / 品牌皮下拉桥接 */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 20px 0 0;
  overflow: visible;
  transition: padding-top .28s var(--ease);
}
.nav-shell:has(.top-nav.is-scrolled) {
  padding-top: 10px;
}
.nav-shell__inner {
  position: relative;
  width: calc(100% - 48px);
  max-width: 1160px;
  margin: 0 auto;
}

/* 须压过 .btn { display: inline-flex }，宽屏才能真正隐藏 */
.btn.nav-menu-toggle {
  display: none;
}

.nav-drawer {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-base);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.nav-drawer.is-open {
  display: block;
}

.nav-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-drawer a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-drawer a:hover {
  background: var(--brand-primary-muted, rgba(var(--brand-primary-rgb), 0.1));
  color: var(--brand-primary);
}


.top-nav {
  display: grid;
  /* 左右按内容占位，中间菜单吃剩余；避免右侧动作区被 1fr 挤扁 */
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px 20px;
  transition:
    width .28s var(--ease),
    margin .28s var(--ease),
    padding .28s var(--ease),
    max-width .28s var(--ease),
    box-shadow .28s var(--ease),
    border-color .28s var(--ease),
    background .28s var(--ease),
    backdrop-filter .28s var(--ease),
    -webkit-backdrop-filter .28s var(--ease);
}
.card.top-nav.is-scrolled {
  width: calc(100% + 80px);
  max-width: calc(100% + 80px);
  margin-left: -40px;
  margin-right: -40px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  box-shadow: 0 8px 24px rgba(48, 36, 120, 0.1), 0 18px 48px rgba(48, 36, 120, 0.12);
  border-color: color-mix(in srgb, var(--brand-primary) 18%, var(--border-subtle));
}
[data-theme="dark"] .card.top-nav.is-scrolled {
  background: rgba(26, 22, 42, 0.68);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42), 0 24px 64px rgba(0, 0, 0, 0.28);
  border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--border-subtle));
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-primary);
  justify-self: start;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand img,
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary);
  color: var(--text-on-primary, #fff);
  box-shadow: 0 6px 14px rgba(var(--brand-primary-rgb), 0.28);
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.brand-mark i {
  font-size: 13px;
  line-height: 1;
}
.menu {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.menu a {
  text-decoration: none;
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s ease;
}
.menu a:hover { color: var(--brand-primary); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-shrink: 0;
  min-width: max-content;
}
.header-actions .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-home-btn {
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s var(--ease);
}
.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
  box-shadow: 0 8px 20px rgba(var(--brand-primary-rgb), 0.28);
}
.btn-primary:hover {
  background: var(--brand-primary-strong);
  border-color: var(--brand-primary-strong);
}
.btn-primary:active,
.btn-soft:active,
.btn-secondary:active { transform: scale(0.98); }
/* 柔和按钮；.btn-secondary 为旧名别名 */
.btn-soft,
.btn-secondary {
  background: var(--wa-btn-soft-fill, rgba(var(--brand-primary-rgb), 0.14));
  border-color: var(--wa-btn-soft-bd, rgba(var(--brand-primary-rgb), 0.28));
  color: var(--brand-primary);
  box-shadow: none;
}
.btn-soft:hover,
.btn-secondary:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-muted);
  color: var(--brand-primary);
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.header-actions .btn-icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}


.floating-tools {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-btn {
  width: 56px;
  min-height: 56px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-base);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  color: var(--brand-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tool-btn i { font-size: 15px; color: var(--brand-primary); }
.tool-btn:hover {
  color: var(--text-on-primary);
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}
.tool-btn:hover i { color: var(--text-on-primary); }
.tool-btn.back-to-top {
  display: none;
  opacity: 0;
  pointer-events: none;
}
.tool-btn.back-to-top.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}


.site-footer {
  margin-top: 72px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.site-footer__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer__copy a {
  color: inherit;
  text-decoration: none;
}
.site-footer__copy a:hover { color: var(--brand-primary); }
.site-footer__sep { color: var(--border-default); user-select: none; }
.site-footer__nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
  font-weight: 600;
}
.site-footer__nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 2px 0;
}
.site-footer__nav a:hover { color: var(--brand-primary); }
.site-footer__nav .site-footer__sep { margin: 0 10px; font-weight: 400; }

.header-actions {
  overflow: visible;
  position: relative;
  z-index: 2;
}
.header-actions .brand-select.wa-dropdown {
  flex: 0 0 auto;
  z-index: 2;
}
.header-actions .brand-select .wa-dropdown__trigger {
  gap: 6px;
  min-height: 32px;
  height: 32px;
  padding: 0 10px 0 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.header-actions .brand-select .wa-dropdown__chevron {
  font-size: 0.55rem;
}
.header-actions .brand-select .wa-dropdown__menu {
  left: 0;
  right: auto;
  width: max-content;
  min-width: 100%;
  max-width: min(16rem, 70vw);
  top: calc(100% + 4px);
  padding: 4px;
  z-index: 80;
}
.header-actions .brand-select .wa-dropdown__item {
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}
.header-actions .brand-select .wa-dropdown__item.is-active {
  background: var(--wa-color-primary-soft);
  color: var(--wa-color-primary);
  font-weight: 600;
}

.nav-home-btn > i {
  display: none;
}

/* 中宽：先收品牌下拉，保证右侧按钮不被挤换行 */
@media (max-width: 1280px) {
  .header-actions .brand-select { display: none; }
}

@media (max-width: 1100px) {
  .header-actions .brand-select { display: none; }
  .menu a { padding: 0 8px; font-size: 13px; }
}

@media (max-width: 960px) {
  .header-actions .brand-select { display: none; }
}

@media (max-width: 480px) {
  .nav-home-btn > i { display: inline-flex; }
}

@media (min-width: 961px) {
  .btn.nav-menu-toggle {
    display: none;
  }

  .nav-drawer,
  .nav-drawer.is-open {
    display: none;
  }
}
