/* ──────────────────────────────────────────────────────────────
   首页同款「大圆角悬浮顶栏」—— 查考类页面（books/tracts/dailystudy）复用。
   自带变量，跟随页面 [data-theme] 暗/亮切换；动作按钮（铃铛/登录）由
   NavBar.js 注入到 [data-ebf-actions]，此处覆盖成首页样式。
   依赖：NavBar-css.css（提供 .ebf-icon-btn/.ebf-login-pill 基础结构）需先于本文件加载。
   ────────────────────────────────────────────────────────────── */
.topbar-wrap {
  --tb-accent: #2563eb;
  --tb-accent-2: #4f7cff;
  --tb-surface: rgba(255, 255, 255, 0.82);
  --tb-bar-bg: rgba(255, 255, 255, 0.78);
  --tb-text: #0f172a;
  --tb-faint: #94a3b8;
  --tb-border: rgba(15, 23, 42, 0.08);

  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
:root[data-theme="dark"] .topbar-wrap {
  --tb-accent: #60a5fa;
  --tb-accent-2: #3b82f6;
  --tb-surface: rgba(255, 255, 255, 0.10);
  --tb-bar-bg: rgba(20, 25, 45, 0.72);
  --tb-text: #f1f5f9;
  --tb-faint: rgba(241, 245, 249, 0.36);
  --tb-border: rgba(255, 255, 255, 0.10);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 9px;
  border-radius: 999px;
  background: var(--tb-bar-bg);
  border: 1px solid var(--tb-border);
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  backdrop-filter: saturate(150%) blur(20px);
  overflow: hidden;
  isolation: isolate;
}
:root[data-theme="dark"] .topbar { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.55); }

/* —— Logo —— */
.topbar-logo {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--tb-accent), var(--tb-accent-2));
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.55);
}
.topbar-logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--tb-surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-logo-inner img { width: 100%; height: 100%; object-fit: cover; }
.topbar-logo-inner .logo-fallback { font-weight: 800; font-size: 19px; color: var(--tb-accent); display: none; }
.topbar-logo-inner.fallback img { display: none; }
.topbar-logo-inner.fallback .logo-fallback { display: block; }

/* —— 标题 —— */
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-cn {
  font-size: 16px;
  font-weight: 800;
  color: var(--tb-text);
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-cn .blue { color: var(--tb-accent); }
.topbar-en {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tb-faint);
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
}
.topbar-en .blue { color: var(--tb-accent); font-weight: 800; }

/* —— 动作区（覆盖 NavBar-css 注入的按钮，做成首页同款）—— */
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-actions .ebf-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  gap: 0;
  border: 1px solid var(--tb-border);
  background: var(--tb-surface);
  color: var(--tb-text);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34, 1.32, 0.64, 1);
}
.topbar-actions .ebf-icon-btn:active { transform: scale(0.92); }
.topbar-actions .ebf-icon-btn svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--tb-text); }
.topbar-actions .ebf-icon-btn::after { content: none; }
.topbar-actions .ebf-login-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--tb-accent), var(--tb-accent-2));
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px -8px var(--tb-accent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: transform 0.18s cubic-bezier(0.34, 1.32, 0.64, 1);
}
.topbar-actions .ebf-login-pill:active { transform: scale(0.95); }
.topbar-actions .ebf-login-pill svg { color: #fff; }

/* —— 中和旧版固定导航留出的顶部空白 —— */
body[data-ebf-custom-header] .shell { padding-top: 14px; }
