/* ================================================================
   AIWorkshop 统一导航栏 (nav.css) — CGtools 风格
   自包含配色 (--nv-*)，随 html.light / html.dark 切换，
   不依赖各页 token，保证全站每一页的页头完全一致。
   ================================================================ */
.navbar {
  --nv-bg:#1b1f29; --nv-border:#323742; --nv-text:#d4d8e0; --nv-text2:#969eac;
  --nv-text3:#6b7382; --nv-hover:#282d38; --nv-accent:#7eb8da; --nv-card:#282d38;
  position: sticky; top: 0; z-index: 200;
  height: 44px; display: flex; align-items: center;
  padding: 0 16px;
  background: var(--nv-bg);
  border-bottom: 1px solid var(--nv-border);
  flex-shrink: 0;
  /* 🔑 自包含：固定字体与行高，不继承各页 body（workshop 用 system-ui/1.55、
     主站用 Inter/1.6），避免品牌字在不同页面漂移/缩放 */
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  line-height: 1;
}
html.light .navbar {
  --nv-bg:#ffffff; --nv-border:#d8dce3; --nv-text:#2c3038; --nv-text2:#5a6070;
  --nv-text3:#939aa8; --nv-hover:#f1f3f6; --nv-accent:#3b82c4; --nv-card:#f8f9fb;
}
.navbar-inner { width: 100%; display: flex; align-items: center; gap: 8px; }

.navbar-brand {
  font-weight: 700; font-size: calc(14px * var(--fs-scale,1)); color: var(--nv-text);
  text-decoration: none; letter-spacing: -0.3px; white-space: nowrap; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}
.navbar-brand em { color: var(--nv-accent); font-style: normal; }

.navbar-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; flex: 1; }
.nav-link {
  font-size: calc(12px * var(--fs-scale,1)); color: var(--nv-text2); text-decoration: none;
  padding: 4px 10px; border-radius: 6px; transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.nav-link:hover { color: var(--nv-text); background: var(--nv-hover); }
.nav-link.active { color: var(--nv-text); background: var(--nv-hover); }

/* 配额徽标 + 主题/字号控件（靠右） */
.nav-quota {
  font-size: calc(11px * var(--fs-scale,1)); color: var(--nv-text3);
  padding: 3px 10px; background: var(--nv-hover); border-radius: 10px;
  white-space: nowrap; margin-left: auto;
}
.nav-theme-controls { display: flex; align-items: center; gap: 3px; margin: 0 6px; }
.nav-ctl {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--nv-border); background: transparent; color: var(--nv-text2);
  font-size: calc(12px * var(--fs-scale,1)); cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-ctl:hover { color: var(--nv-text); background: var(--nv-hover); border-color: var(--nv-accent); }
.nav-fs { font-size: calc(11px * var(--fs-scale,1)); color: var(--nv-text3); min-width: 32px; text-align: center; }

/* 用户菜单 */
.nav-user {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: calc(12px * var(--fs-scale,1)); color: var(--nv-text2);
  background: transparent; border: none; padding: 4px 8px; border-radius: 6px; transition: all .15s;
}
.nav-user:hover { background: var(--nv-hover); }
.nav-user-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--nv-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(12px * var(--fs-scale,1)); font-weight: 600;
}
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--nv-card); border: 1px solid var(--nv-border); border-radius: 8px;
  min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 220; overflow: hidden;
}
.nav-dropdown-menu.show { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 8px 14px; font-size: calc(12px * var(--fs-scale,1)); color: var(--nv-text2);
  text-decoration: none; white-space: nowrap; transition: all .1s;
}
.nav-dropdown-menu a:hover { background: var(--nv-hover); color: var(--nv-text); }

/* 移动端 */
.nav-toggle { display: none; }
@media (max-width: 768px) {
  .nav-toggle {
    display: flex; flex-direction: column; gap: 4px;
    background: none; border: none; padding: 8px; cursor: pointer; margin-left: auto;
  }
  .nav-toggle span { width: 20px; height: 2px; background: var(--nv-text2); border-radius: 1px; }
  .navbar-links { display: none; }
  .navbar.open .navbar-links {
    display: flex; flex-direction: column; position: absolute; top: 44px; left: 0; right: 0;
    background: var(--nv-card); border-bottom: 1px solid var(--nv-border); padding: 8px; gap: 2px;
  }
}
