/* 全站顶部导航（与首页保持一致） */

/* 品牌字体：中文标题 / 英文副题 */
@font-face {
  font-family: 'PangMenZhengDao';
  src: url('../assets/fonts/pangmenzhengdao.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Morena';
  src: url('../assets/fonts/Morena.otf') format('opentype');
  font-display: swap;
}

/* 顶栏已提供登录入口时，隐藏账号模块的右下角悬浮按钮 */
body .ic-acc-btn { display: none !important; }

.hm-header {
  --hm-line: rgba(139, 124, 246, .28);
  --hm-line-strong: rgba(139, 124, 246, .5);
  --hm-muted: #8e9cc4;
  --hm-purple: #8b7cf6;
  --hm-gold: #fbbf24;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
  /* 通栏：背景铺满整行，内容区左右与 1180 正文对齐 */
  padding: 0 max(28px, calc((100% - 1180px) / 2));
  background: rgba(10, 8, 30, .78);
  border-bottom: 1px solid var(--hm-line);
  backdrop-filter: blur(14px);
  color: #e6ebff;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

.hm-header a { text-decoration: none; }

.hm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #eef1ff;
  white-space: nowrap;
}

.hm-brand-ico {
  display: block;
  height: 26px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(139, 124, 246, .55));
}

.hm-brand-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hm-brand-cn {
  font-family: 'PangMenZhengDao', "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  letter-spacing: 2px;
  line-height: 1;
}

.hm-brand-en {
  font-family: 'Morena', Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: var(--hm-muted);
  opacity: .9;
}

.hm-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.hm-nav a {
  padding: 6px 13px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c5cee9;
  letter-spacing: .4px;
  transition: color .18s, background .18s, border-color .18s;
}

.hm-nav a:hover {
  color: #fff;
  background: rgba(139, 124, 246, .16);
  border-color: rgba(139, 124, 246, .32);
}

.hm-nav a.is-active {
  color: #fff;
  background: rgba(139, 124, 246, .24);
  border-color: rgba(139, 124, 246, .52);
  box-shadow: 0 0 14px rgba(139, 124, 246, .18);
}

.hm-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hm-user-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--hm-line-strong);
  color: #cfc7ff;
  white-space: nowrap;
}

.hm-user-badge.is-member {
  border-color: rgba(251, 191, 36, .5);
  color: var(--hm-gold);
}

.hm-user-badge.is-teacher {
  cursor: pointer;
}

.hm-user-badge.is-teacher:hover {
  background: rgba(251, 191, 36, .18);
}

.hm-auth {
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--hm-line-strong);
  background: rgba(139, 124, 246, .12);
  color: #dfe4ff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.hm-auth:hover { border-color: var(--hm-purple); color: #fff; }

/* 右上角会员入口：会员/教师账号隐藏 */
.hm-member {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, .5);
  background: rgba(251, 191, 36, .12);
  color: var(--hm-gold);
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: .4px;
  transition: color .18s, border-color .18s, background .18s;
}

.hm-member:hover,
.hm-member.is-active {
  color: #1a1330;
  border-color: var(--hm-gold);
  background: var(--hm-gold);
}

/* 闯关 / 学习 模式切换（闯关页与学习页共用） */
.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(139, 124, 246, .3);
  border-radius: 12px;
  background: rgba(12, 10, 32, .72);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 9px;
  color: #c5cee9;
  font-size: 13px;
  letter-spacing: .4px;
  text-decoration: none;
  transition: color .18s, background .18s;
}

.mode-tab:hover { color: #fff; background: rgba(139, 124, 246, .16); }

.mode-tab.is-active {
  color: #fff;
  background: rgba(139, 124, 246, .28);
  box-shadow: 0 0 12px rgba(139, 124, 246, .2);
}

.mode-tab em {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, .4);
  background: rgba(251, 191, 36, .16);
  color: #fbbf24;
}

/* 星域页原本按整屏高度居中，加上顶栏后减去顶栏高度 */
body .page.world-page { min-height: calc(100vh - 62px); }

@media (max-width: 1100px) {
  .hm-header {
    height: auto;
    min-height: 62px;
    padding: 10px max(16px, calc((100% - 1180px) / 2));
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .hm-nav {
    order: 3;
    width: 100%;
    gap: 4px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  body .page.world-page { min-height: calc(100vh - 104px); }
}

@media (max-width: 560px) {
  .hm-header { height: auto; min-height: 60px; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .hm-brand-ico { height: 22px; }
  .hm-brand-cn { font-size: 17px; letter-spacing: 1.5px; }
  .hm-brand-en { font-size: 10px; letter-spacing: 1px; }
  .hm-nav { gap: 4px; font-size: 13px; order: 3; width: 100%; padding-bottom: 4px; flex-wrap: wrap; }
  .hm-nav a { padding: 5px 10px; }
  body .page.world-page { min-height: calc(100vh - 104px); }
}
