/* ==========================================================================
   宏璞统一顶栏 hp-nav v2（2026-11-14）
   - 所有类名以 hpbar- 开头，避免与各应用旧样式（含旧 .hp-nav 浮动条）冲突
   - 顶栏吸顶；高度写在 --hpbar-h，应用自己的吸顶元素用 top: var(--hpbar-h) 让位
   ========================================================================== */
:root { --hpbar-h: 56px; }
@media (max-width: 600px) { :root { --hpbar-h: 48px; } }

.hpbar {
  position: sticky; top: 0; z-index: 950;
  height: var(--hpbar-h); box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; margin: 0;
  background: #F8F5EE; border-bottom: 1px solid #E6DCC6;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.2; color: #2E2A20; text-align: left;
  -webkit-font-smoothing: antialiased;
}
.hpbar *, .hpbar-panel * { box-sizing: border-box; }
.hpbar a { text-decoration: none; }
.hpbar-logo { display: inline-flex; align-items: center; gap: 8px; color: #2E2A20; font-weight: 700; font-size: 15px; flex: none; }
.hpbar-seal {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: #B5121B; color: #FFF; font-size: 12px; letter-spacing: -1px; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.hpbar-crumb { display: flex; align-items: center; gap: 6px; min-width: 0; color: #7A705C; }
.hpbar-crumb a { color: #7A705C; }
.hpbar-crumb a:hover { color: #B5121B; }
.hpbar-app { color: #2E2A20; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpbar-sp { flex: 1; }
.hpbar-user { font-size: 13px; color: #7A705C; white-space: nowrap; }
.hpbar-btn {
  height: 36px; padding: 0 12px; margin: 0; border-radius: 8px;
  border: 1px solid #E6DCC6; background: #FFF; color: #2E2A20;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
  -webkit-appearance: none; appearance: none; box-shadow: none;
}
.hpbar-btn:hover { border-color: #B8924A; }
.hpbar-btn:focus-visible { outline: 2px solid #B8924A; outline-offset: 2px; }
.hpbar-out { border-color: transparent; background: transparent; color: #B5121B; }
.hpbar-out:hover { background: #FBEFEF; border-color: transparent; }

.hpbar-panel {
  position: fixed; z-index: 960; top: calc(var(--hpbar-h) + 6px); right: 16px;
  width: 420px; max-width: calc(100vw - 24px);
  background: #FFF; border: 1px solid #E6DCC6; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 14px;
  display: none; grid-template-columns: repeat(3, 1fr); gap: 6px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; color: #2E2A20;
}
.hpbar-panel.is-open { display: grid; }
.hpbar-panel h4 { grid-column: 1 / -1; margin: 2px 4px 6px; font-size: 13px; color: #7A705C; font-weight: 500; }
.hpbar-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; color: #2E2A20; text-decoration: none; font-size: 13px; text-align: center; }
.hpbar-tile span { font-size: 22px; line-height: 1; }
.hpbar-tile:hover { background: #F8F5EE; }
.hpbar-tile.is-current { background: #FBEFEF; color: #B5121B; font-weight: 600; }
.hpbar-mask { position: fixed; inset: 0; z-index: 955; background: rgba(0,0,0,.35); display: none; }
.hpbar-acct { grid-column: 1 / -1; display: none; justify-content: space-between; align-items: center; border-top: 1px solid #E6DCC6; margin-top: 8px; padding-top: 12px; font-size: 14px; }

@media (max-width: 600px) {
  .hpbar { padding: 0 10px; gap: 8px; }
  .hpbar-brand, .hpbar-home-crumb, .hpbar-user, .hpbar-btn .hpbar-t { display: none; }
  .hpbar-app { font-size: 15px; }
  .hpbar-btn { padding: 0 10px; }
  /* 手机：切换应用改成底部弹出面板，账号/登出也收在面板底部 */
  .hpbar-panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; border-radius: 16px 16px 0 0; grid-template-columns: repeat(4, 1fr); padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }
  .hpbar-panel.is-open + .hpbar-mask { display: block; }
  .hpbar-acct { display: flex; }
  .hpbar-out.hpbar-out-top { display: none; }
}
.hpbar-expired {
  position: sticky; top: var(--hpbar-h); z-index: 949;
  padding: 10px 16px; background: #FFF3E0; border-bottom: 1px solid #F0C27B; color: #8A4B00;
  font: 14px/1.4 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; text-align: center;
}
.hpbar-expired a { color: #B5121B; font-weight: 700; text-decoration: underline; margin: 0 4px; }
.hpbar-expired small { color: #8A6A3A; }
@media print { .hpbar, .hpbar-panel, .hpbar-mask, .hpbar-expired { display: none !important; } }
