/* 顶部导航独立作用域，兼容旧浏览器保存的侧栏折叠状态。 */
.layout .topbar { position:relative; flex-shrink:0; display:flex; height:52px; min-height:52px; padding:0 20px; gap:14px; z-index:110; background:#fff; }
.layout .topbar .brand { display:flex; flex-direction:row; align-items:center; gap:6px; padding:0; height:52px; flex:0 0 auto; border:0; }
.layout .topbar .brand-copy { display:block; max-width:180px; }
.topbar .brand-copy strong { color:#263348; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar .brand-copy small { color:#8792a2; }
.topbar .品牌标题行 { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; gap:4px; }
.topbar .品牌标题行 strong { font-size:15px; }
.topbar .版本公告入口 { padding:0; border:0; background:transparent; }
.topbar .project-version { padding:2px 4px; font-size:10px; white-space:nowrap; }
.topbar .project-version { color:#64748b; background:#f1f5f9; border-color:#e2e8f0; }
.topbar #menu { display:flex; flex:1; min-width:0; gap:12px; overflow-x:auto; scrollbar-width:thin; }
.topbar #menu > button { position:relative; display:flex; align-items:center; gap:4px; height:52px; flex-shrink:0; padding:0 3px; border:0; border-radius:0; background:transparent; color:#354052; font:inherit; font-size:13px; white-space:nowrap; cursor:pointer; }
.topbar #menu .nav-icon { display:none; }
.topbar #menu .nav-label-text { display:inline; }
.顶部菜单箭头 { order:2; }
.topbar #menu > button.active,.topbar #menu > button:hover,.topbar #menu > button[aria-expanded="true"] { color:#1677ff; background:transparent; }
.topbar #menu > button.active::after { content:''; position:absolute; bottom:0; left:12px; right:12px; height:3px; background:#1677ff; border-radius:3px; }
.topbar #menu > button[aria-expanded="true"] .顶部菜单箭头 { transform:rotate(180deg); }
.topbar #menu > button:focus-visible { outline:2px solid #1677ff; outline-offset:-4px; }
.layout .topbar .顶部二级菜单 { position:fixed; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 16px; width:440px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 150px); overflow:auto; padding:20px; border:1px solid #edf0f5; border-radius:0 0 8px 8px; background:#fff; box-shadow:0 8px 24px #182b4426; }
.layout .topbar .顶部二级菜单[hidden] { display:none; }
.layout .顶部二级菜单 button { height:40px; padding:0 8px; border-radius:5px; color:#566176; justify-content:flex-start; }
.layout .顶部二级菜单 button:hover,.layout .顶部二级菜单 button[aria-current="page"] { color:#1677ff; background:#eff6ff; }
.layout .顶部二级菜单 button[aria-current="page"]::after { display:none; }
/* 窄屏独立一行横滑一级模块，二级面板仍位于视口范围内。 */
@media(max-width:1000px) { .layout .topbar { gap:14px; } #topbarAdminName { display:none; } }
@media(max-width:768px) {
  .layout .topbar { height:80px; min-height:80px; padding:0 12px; gap:0; flex-wrap:wrap; }
  .layout .topbar .brand { height:44px; flex:1; min-width:0; }
  .layout .topbar .brand-copy { max-width:180px; }
  .topbar .brand-copy small { display:none; }
  .layout .topbar-actions { margin-left:auto; }
  .topbar #menu { order:3; flex:0 0 100%; gap:14px; }
  .topbar #menu > button { height:36px; }
  .layout .topbar .顶部二级菜单 { width:calc(100vw - 24px); padding:14px; }
}

/* 顶栏与常用工具栏一起压缩，为列表让出更多高度；保留原收藏及更多菜单机制。 */
.layout .topbar .brand-mark { width:30px; height:30px; flex-basis:30px; border-radius:7px; font-size:14px; }
.layout .topbar .brand-copy small { font-size:10px; line-height:14px; }
.layout .topbar .admin-avatar { width:28px; height:28px; flex-basis:28px; font-size:12px; }
.layout .topbar .admin-account-trigger { padding:3px 6px; gap:6px; font-size:12px; }
.layout > main > .常用菜单 { min-height:36px; box-sizing:border-box; padding:4px 20px; gap:6px; }
.layout > main > .常用菜单 button { min-height:26px; height:26px; padding:0 8px; border-radius:4px; font-size:12px; }
.常用菜单列表 { gap:4px; }
.常用菜单更多 summary { box-sizing:border-box; height:26px; padding:0 8px; line-height:24px; border-radius:4px; font-size:12px; }
@media(max-width:768px) {
  .layout > main > .常用菜单 { min-height:34px; padding:3px 12px; }
}

/* 二级入口用浅色边框分隔，减少大面积空白；单项按内容使用窄面板。 */
.layout .topbar .顶部二级菜单 { gap:6px; width:360px; padding:8px; border-radius:8px; }
.layout .topbar .顶部二级菜单 button { display:flex; align-items:center; justify-content:flex-start; height:38px; min-width:0; padding:0 12px; border:1px solid #e8edf3; border-radius:5px; background:#fafbfd; text-align:left; }
.layout .topbar .顶部二级菜单 button:hover,
.layout .topbar .顶部二级菜单 button[aria-current="page"] { border-color:#c7ddff; background:#eff6ff; color:#1677ff; }
.layout .topbar .顶部二级菜单:has(> button:only-child) { grid-template-columns:minmax(0,1fr); width:200px; }
@media(max-width:768px) {
  .layout .topbar .顶部二级菜单 { width:calc(100vw - 24px); }
  .layout .topbar .顶部二级菜单:has(> button:only-child) { width:200px; }
}
