/* ============================================================================
   腾龙发科AI元宇宙 · V69 后台左侧导航优化层  admin-nav-v69.css
   前缀 an69-
   目标：彻底解决后台侧边栏"菜单越滚越长"的问题
   能力：① 侧边栏全高固定 + 仅菜单区内部滚动（页面不再被菜单撑长）
        ② 分组手风琴折叠（默认只展开当前页所在组）
        ③ 菜单搜索（实时过滤，支持回车定位）④ 全部展开 / 全部折叠
        ⑤ 「只看当前模块」焦点模式 ⑥ 最近访问分组（本地记忆 8 项）
        ⑦ 紧凑行高（默认生效，一屏容纳 19 组菜单）⑧ 滚动条美化
        ⑨ 兼容 .sidebar-menu / .sidebar-nav / .menu 三种后台菜单容器
   叠加于 admin.css / admin-v53.css / admin-v54.css / admin-v63.css 之上
   严格零内联样式，全部走类名
   ============================================================================ */

/* ---------------- 一、侧边栏骨架：全高固定 + 菜单区独立滚动 ---------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.sidebar-logo { flex: 0 0 auto; }
.sidebar > nav,
.sidebar-menu,
.sidebar-nav,
.sidebar > .menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.45) transparent;
}
.sidebar > nav::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.sidebar > .menu::-webkit-scrollbar { width: 7px; }
.sidebar > nav::-webkit-scrollbar-thumb,
.sidebar-menu::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.sidebar > .menu::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.4); border-radius: 4px;
}
.sidebar > nav::-webkit-scrollbar-track,
.sidebar-menu::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.sidebar > .menu::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 二、工具条：搜索 + 折叠 + 焦点 ---------------- */
.an69-tools {
  flex: 0 0 auto;
  padding: 8px 12px 9px;
  border-bottom: 1px solid rgba(99,102,241,0.15);
  background: rgba(15,23,42,0.6);
}
.an69-searchbox { position: relative; margin-bottom: 6px; }
.an69-search {
  width: 100%;
  height: 33px;
  box-sizing: border-box;
  border-radius: 8px;
  padding: 0 28px 0 30px;
  background: rgba(2,6,23,0.75);
  border: 1px solid rgba(99,102,241,0.28);
  color: #e2e8f0;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}
.an69-search:focus { border-color: rgba(129,140,248,0.65); }
.an69-search-i {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: .65; pointer-events: none;
}
.an69-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
  background: rgba(99,102,241,0.15); border: 1px solid rgba(129,140,248,0.28);
  color: #c7d2fe; font-size: 11px; line-height: 1; font-family: inherit;
  display: none;
}
.an69-search-clear.show { display: block; }
.an69-acts { display: flex; gap: 6px; }
.an69-act {
  flex: 1; height: 27px; border-radius: 7px; cursor: pointer;
  font-size: 11px; font-family: inherit; white-space: nowrap;
  background: rgba(99,102,241,0.13); border: 1px solid rgba(129,140,248,0.26);
  color: #c7d2fe; transition: all .16s;
}
.an69-act:hover { background: rgba(99,102,241,0.26); color: #fff; }
.an69-act.on {
  background: linear-gradient(92deg,#4f46e5,#0891b2);
  color: #fff; border-color: transparent;
}

/* ---------------- 三、分组：紧凑标题 + 手风琴折叠 ---------------- */
.sidebar .menu-group-title.an69-title,
.sidebar .an69-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  margin: 0;
  line-height: 1.25;
  font-size: 11.8px;
  font-weight: 600;
  letter-spacing: .2px;
  color: #93a2bb;
  cursor: pointer;
  border-radius: 7px;
  user-select: none;
  transition: background .16s, color .16s;
}
.sidebar .an69-title:hover { background: rgba(99,102,241,0.14); color: #c7d2fe; }
.an69-caret {
  flex: 0 0 auto;
  width: 12px;
  font-size: 9px;
  color: #64748b;
  transition: transform .18s;
}
.an69-group:not(.an69-collapsed) > .an69-title > .an69-caret { transform: rotate(90deg); }
.an69-title-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an69-cnt {
  flex: 0 0 auto;
  font-size: 10px;
  color: #8ea0bd;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(129,140,248,0.22);
  border-radius: 8px;
  padding: 0 6px;
  line-height: 15px;
}
.an69-group { margin-bottom: 1px; }
.an69-group.an69-collapsed > .menu-item,
.an69-group.an69-collapsed > .menu-items { display: none; }

/* 紧凑行高：一屏容纳更多条目 */
.sidebar .menu-item > a,
.sidebar .menu-items > a.menu-item {
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 12.2px;
  line-height: 19px;
}
.sidebar .menu-item { margin-bottom: 1px; }

/* ---------------- 四、焦点模式：只显示当前模块 + 最近访问 ---------------- */
body.an69-focus .an69-group:not(.an69-focus-show):not(.an69-recent-group) { display: none; }

/* ---------------- 四点五、显示全部模块入口 ---------------- */
.an69-allmod-wrap { margin-bottom: 3px; }
.sidebar a.an69-allmod {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12.2px;
  color: #7dd3fc;
  text-decoration: none;
  background: rgba(8,145,178,0.16);
  border: 1px dashed rgba(34,211,238,0.38);
}
.sidebar a.an69-allmod:hover { background: rgba(8,145,178,0.3); color: #fff; }

/* ---------------- 五、最近访问分组 ---------------- */
.an69-recent-group { margin-bottom: 6px; }
.an69-recent-group > .an69-title { color: #7dd3fc; }
.an69-recent-empty {
  font-size: 11px;
  color: #64748b;
  padding: 2px 10px 6px;
  line-height: 1.5;
}

/* ---------------- 六、搜索命中态 ---------------- */
/* 搜索时忽略焦点模式，跨全部模块检索 */
.an69-menu.an69-search-on .menu-group { display: block !important; }
/* 搜索时强制展开所有命中分组 */
.an69-menu.an69-search-on .menu-group.an69-collapsed > .menu-item,
.an69-menu.an69-search-on .menu-group.an69-collapsed > .menu-items { display: block !important; }
.an69-hide { display: none !important; }
.an69-hit { color: #fca5a5; font-weight: 600; }
.an69-empty {
  display: none;
  margin: 8px 2px;
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed rgba(99,102,241,0.25);
  color: #64748b;
  font-size: 12.5px;
  text-align: center;
  line-height: 1.7;
}
.an69-empty.show { display: block; }
.an69-empty b { color: #a5b4fc; }

/* ---------------- 七、当前页高亮强化 ---------------- */
.sidebar .menu-item.active > a,
.sidebar .menu-item > a.active {
  background: linear-gradient(92deg, rgba(79,70,229,0.9), rgba(8,145,178,0.85));
  color: #fff;
  border-radius: 8px;
}

/* ---------------- 八、顶栏入口（替代内联样式） ---------------- */
.an69-toplink {
  color: #667eea;
  text-decoration: none;
  margin-right: 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.an69-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

/* ---------------- 九、移动端适配 ---------------- */
@media (max-width: 768px) {
  .an69-tools { padding: 8px 10px 9px; }
  .an69-search { height: 31px; }
  .an69-act { height: 25px; font-size: 10.5px; }
  .sidebar .an69-title { padding: 6px 9px; }
}
