/* ═══ 三站统一导航标识 ══════════════════════════════════════════════════════
   首页 / 工作中心 / 宗谱浏览 / 会员中心 四个入口共用同一套标识，
   固定于各页右上角（app.html 用 .xnav-fixed 浮动；其余两页内嵌于吸顶页头）。
   权限门控由 js/crossnav.js 完成：
     · 未登录（无 token）      → 整条隐藏（.xnav-off）
     · 已登录非职能人员        → 隐藏「工作中心」（.xnav-hide）
     · 当前所在页             → 高亮（.xnav-active）
   ══════════════════════════════════════════════════════════════════════════ */
.xnav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #E8D5B8;
  box-shadow: 0 4px 14px rgba(77, 54, 34, .10);
  font-family: "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  flex-shrink: 0;
}

/* 品牌区（点击回网站首页） */
.xnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 9px;
  margin-right: 3px;
  border-right: 1px solid #EFE6D8;
  text-decoration: none;
  color: #4D3622;
  flex-shrink: 0;
}
.xnav-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6B4D30, #8B6540);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.xnav-brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}

/* 导航项 */
.xnav-item {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #8B6540;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.xnav-item:hover { background: #F5EDE0; color: #6B4D30; }
.xnav-item.xnav-active {
  background: linear-gradient(90deg, #6B4D30, #8B6540);
  color: #fff;
}

/* 权限隐藏 / 整条隐藏 */
.xnav-item.xnav-hide { display: none; }
.xnav.xnav-off { display: none !important; }

/* app.html：页面无吸顶页头，标识浮动固定于视口右上角 */
.xnav-fixed {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 500; /* 高于侧边栏(101)，低于模态框(1000)/toast(2000) */
}

/* 窄屏：收起品牌文字，压缩项间距 */
@media (max-width: 720px) {
  .xnav-brand-text { display: none; }
  .xnav-brand { padding-right: 6px; margin-right: 1px; }
  .xnav-item { padding: 6px 10px; font-size: 12px; }
}

/* 后台深色模式（.dark 加在 <html> 上，仅 app.html 会触发） */
.dark .xnav {
  background: rgba(42, 37, 32, .94);
  border-color: #3d352e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.dark .xnav-brand { color: #E8BE8C; border-right-color: #3d352e; }
.dark .xnav-item { color: #D8CCBE; }
.dark .xnav-item:hover { background: #3d352e; color: #fff; }
.dark .xnav-item.xnav-active { background: linear-gradient(90deg, #8B6540, #A07D56); color: #fff; }
