/* 通用新版外壳：把所有老后台页面换成与 ads-manager.html 一致的 Firefly ADS 白底侧栏 + 顶栏。
   只换「外壳」：老 .topbar 里的功能按钮（添加链接 / 域名池 / 保存规则 / 切换规则集 / 返回列表…）
   一个都不隐藏、不删除，业务 DOM 与各页面 JS 原封不动 —— 斗篷全部旧功能完整保留。
   菜单统一指向 ads-manager.html#<新版模块>，任何位置都不会再看到老版本 UI。 */
body.ns-new { background: #f6f7f9; }
body.ns-new .app-shell { display: block !important; min-height: 100vh; }
body.ns-new .app-shell > .sidebar { display: none !important; }
body.ns-new .app-shell > .main {
  margin-left: 190px !important;
  width: calc(100% - 190px) !important;
  max-width: none !important;
  min-height: 100vh;
  background: #f6f7f9 !important;
  transition: none !important;
}

/* 老顶栏重新皮肤化成新版白底顶栏；里面的按钮全部保留可用 */
body.ns-new .app-shell > .main > .topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px !important;
  margin-bottom: 16px;
  background: #fff !important;
  border: 0 !important; border-bottom: 1px solid #e8ebf0 !important;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
body.ns-new .topbar .menu-btn { display: none !important; }   /* 新版侧栏常驻，不需要汉堡键 */
body.ns-new .topbar h1 { margin: 0 !important; font-size: 15px !important; font-weight: 600 !important; color: #111827 !important; line-height: 1.3 !important; }
body.ns-new .topbar p { margin: 2px 0 0 !important; font-size: 12px !important; color: #9ca3af !important; }
body.ns-new .topbar > div:not(.actions) { flex: 1; min-width: 110px; }
/* 老顶栏里的功能按钮组（新增 BM / 添加链接 / 保存规则 …）保持自然宽度并靠右，
   不被 flex:1 拉宽，保证换壳后每颗按钮仍然紧挨着、清晰可点 */
body.ns-new .topbar > .actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
body.ns-new .ns-user { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: #6b7280; }
body.ns-new .ns-user .ns-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: #e8efff; color: #2563eb;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
body.ns-new .ns-user .ns-bell { font-size: 13px; }

/* ---------- 新版侧栏（与 ads-manager.html / wizard-newshell 同一套视觉） ---------- */
.ns-side {
  position: fixed; inset: 0 auto 0 0; width: 190px;
  background: #fff; border-right: 1px solid #e8ebf0;
  overflow-y: auto; z-index: 60;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: #111827;
}
.ns-side::-webkit-scrollbar { width: 6px; }
.ns-side::-webkit-scrollbar-thumb { background: #d8dde6; border-radius: 99px; }
.ns-side .brand { display: flex; align-items: center; gap: 8px; padding: 16px 14px 18px; font-size: 16px; font-weight: 700; color: #1a1a1a; }
.ns-side .brand .logo { color: #2563eb; font-size: 18px; }
.ns-side .nav-t {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  font-size: 14px; color: #4b5563; cursor: pointer; user-select: none; text-decoration: none;
}
.ns-side .nav-t:hover { background: #f7f8fa; }
.ns-side .nav-t.on { background: #eef4ff; color: #2563eb; font-weight: 600; }
.ns-side .nav-t .ico { color: #9ca3af; font-size: 13px; width: 15px; text-align: center; }
.ns-side .nav-t.on .ico { color: #2563eb; }
.ns-side .nav-t .ar { margin-left: auto; color: #c9ced8; font-size: 11px; transition: transform .15s; }
.ns-side .nav-g.open > .nav-t { color: #111827; }
.ns-side .nav-g.open > .nav-t .ico { color: #2563eb; }
.ns-side .nav-g.open > .nav-t .ar { transform: rotate(90deg); }
.ns-side .nav-s { display: none; }
.ns-side .nav-g.open .nav-s { display: block; }
.ns-side .nav-s a {
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 8px 14px 8px 40px; font-size: 13px; color: #6b7280; text-decoration: none;
}
.ns-side .nav-s a:hover { background: #f7f8fa; color: #2563eb; }
.ns-side .nav-s a.on { background: #eef4ff; color: #2563eb; font-weight: 600; }
.ns-side .nav-s a .dot { width: 4px; height: 4px; border-radius: 50%; background: #d1d5db; flex: 0 0 4px; }
.ns-side .nav-s a.on .dot { background: #2563eb; }
.ns-side .nav-g3 .nav-i3head {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px 8px 40px;
  font-size: 13px; color: #6b7280; cursor: pointer;
}
.ns-side .nav-g3 .nav-i3head:hover { background: #f7f8fa; color: #2563eb; }
.ns-side .nav-g3 .nav-i3head .ar { margin-left: auto; font-size: 10px; color: #c9ced8; transition: transform .15s; }
.ns-side .nav-g3.open .nav-i3head .ar { transform: rotate(90deg); }
.ns-side .nav-s3 { display: none; }
.ns-side .nav-g3.open .nav-s3 { display: block; }
.ns-side .nav-s3 a { display: flex; align-items: center; gap: 7px; padding: 7px 14px 7px 56px; font-size: 13px; color: #6b7280; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-side .nav-s3 a:hover { background: #f7f8fa; color: #2563eb; }
.ns-side .nav-s3 a.on { background: #eef4ff; color: #2563eb; font-weight: 600; }
.ns-side .ns-side-foot { padding: 14px; border-top: 1px solid #eef1f6; margin-top: 14px; }
.ns-side .ns-side-foot a { font-size: 12px; color: #9ca3af; text-decoration: none; }
.ns-side .ns-side-foot a:hover { color: #2563eb; }

@media (max-width: 900px) {
  body.ns-new .ns-side { display: none; }
  body.ns-new .app-shell > .main { margin-left: 0 !important; width: 100% !important; }
}
