/* [2026-02-24] 修改：新增全局导航统一覆盖层 */
/* 原因：侧栏与移动端底部菜单在不同页面被多份历史样式覆盖，出现字号/高度/位置漂移 */
/* 影响：导航尺寸、触控区域与文案排版全局一致，减少切页后的“菜单飘移/遮挡” */
/* 未改动：菜单结构、路由地址与权限逻辑保持不变 */

:root {
  --app-nav-desktop-item-height: 46px;
  --app-nav-desktop-item-font-size: 14px;
  --app-nav-mobile-item-height: 50px;
  --app-nav-mobile-label-size: 11px;
  --app-nav-mobile-icon-size: 17px;
}

body .ant-layout-body > .ant-sider .ant-sider-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 0 !important;
}

body .ant-layout-body > .ant-sider .ant-sider-item,
body .ant-layout-body > .ant-sider .ant-sider-item:link,
body .ant-layout-body > .ant-sider .ant-sider-item:visited {
  min-height: var(--app-nav-desktop-item-height) !important;
  height: var(--app-nav-desktop-item-height) !important;
  padding: 11px 12px !important;
  font-size: var(--app-nav-desktop-item-font-size) !important;
  line-height: 1.2 !important;
  font-weight: 560 !important;
  letter-spacing: .01em !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body .ant-layout-body > .ant-sider .ant-sider-item .ant-sider-icon {
  width: 18px !important;
  min-width: 18px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  text-align: center !important;
}

body .ant-layout-body > .ant-sider .ant-sider-item span:last-child {
  font-size: var(--app-nav-desktop-item-font-size) !important;
  line-height: 1.2 !important;
  font-weight: 560 !important;
  letter-spacing: .01em !important;
}

/* [2026-02-24] 修改：固定移动底栏容器尺寸与布局约束 */
/* 原因：部分页面有不同底栏样式覆盖，导致点击后出现左移/宽度突变 */
/* 影响：移动端底栏在切页时保持一致宽高与对齐 */
/* 未改动：底栏图标、文案和路由顺序保持不变 */
body .mobile-bottom-nav[data-mobile-nav="primary"] {
  position: fixed !important;
  left: max(7px, calc((100vw - 620px) / 2)) !important;
  right: max(7px, calc((100vw - 620px) / 2)) !important;
  width: auto !important;
  max-width: 620px !important;
  min-height: 62px !important;
  transform: none !important;
  contain: layout paint style;
  will-change: transform;
}

body .mobile-bottom-nav[data-mobile-nav="primary"] .nav-item,
body .mobile-bottom-nav[data-mobile-nav="primary"] .nav-item:link,
body .mobile-bottom-nav[data-mobile-nav="primary"] .nav-item:visited {
  min-height: var(--app-nav-mobile-item-height) !important;
  height: var(--app-nav-mobile-item-height) !important;
  padding: 4px 2px !important;
  gap: 2px !important;
  flex: 1 1 0 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 560 !important;
  line-height: 1.12 !important;
}

body .mobile-bottom-nav[data-mobile-nav="primary"] .nav-icon {
  font-size: var(--app-nav-mobile-icon-size) !important;
  width: 18px !important;
  height: 18px !important;
  line-height: 1 !important;
}

body .mobile-bottom-nav[data-mobile-nav="primary"] .nav-label {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  font-size: var(--app-nav-mobile-label-size) !important;
  line-height: 1.12 !important;
  font-weight: 560 !important;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

html.is-mobile body .mobile-bottom-nav,
body.device-mobile .mobile-bottom-nav,
body.device-tablet .mobile-bottom-nav {
  display: flex !important;
}

body.device-desktop .mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 991.98px) {
  body .ant-layout-body > .ant-sider {
    display: none !important;
  }

  body .ant-layout-body > .ant-content,
  body .ant-layout-body > .page-shell {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .mobile-bottom-nav[data-mobile-nav="primary"],
  body .mobile-bottom-nav[data-mobile-nav="primary"] .nav-item {
    transition: none !important;
    animation: none !important;
  }
}

/* [2026-02-24] 修改：桌面壳层与品牌区稳定锁定（修复跨页“横跳/不固定”） */
/* 原因：不同页面头部结构和侧栏历史样式冲突，导致 logo 区与侧栏位置在切页时抖动 */
/* 影响：桌面端顶部品牌区与左侧菜单位置统一固定，悬停不再横向位移 */
/* 未改动：导航链接、权限判断和菜单路由逻辑保持不变 */
@media (min-width: 992px) {
  body .header.header-sticky.p-0.mb-3.topbar,
  body header.ant-header.unified-topbar {
    margin: 0 !important;
    min-height: 56px !important;
    height: 56px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body header.ant-header.unified-topbar .topbar,
  body .topbar {
    min-height: 56px !important;
    height: 56px !important;
    padding: 0 14px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.26) !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }

  body .brand,
  body .ant-logo {
    min-height: 40px !important;
    align-items: center !important;
  }

  body .brand-mark,
  body .ant-logo-badge {
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
    font-size: 16px !important;
  }

  body .brand-text,
  body .ant-logo-title {
    font-size: 16px !important;
    line-height: 1 !important;
    font-weight: 650 !important;
    white-space: nowrap !important;
  }

  body .brand-sub {
    display: none !important;
  }

  body .topbar-actions,
  body .ant-header-right {
    min-height: 40px !important;
    gap: 8px !important;
  }

  body .ant-layout-body > .ant-sider {
    width: 248px !important;
    min-width: 248px !important;
    flex: 0 0 248px !important;
    margin: 8px 0 8px 12px !important;
    top: 64px !important;
    scrollbar-gutter: stable both-edges !important;
  }

  body .ant-layout-body > .ant-sider .ant-sider-item,
  body .ant-layout-body > .ant-sider .ant-sider-item:link,
  body .ant-layout-body > .ant-sider .ant-sider-item:visited,
  body .ant-layout-body > .ant-sider .ant-sider-item:hover,
  body .ant-layout-body > .ant-sider .ant-sider-item:active {
    width: 100% !important;
    transform: none !important;
  }
}
