/**
 * 后台布局 / 侧边栏旧浏览器样式（仅 html.legacy-env 生效）。
 */

html.legacy-env .element-sidebar-menu.el-menu {
  width: 100%;
  padding: 4px 0;
  background: #fff;
  border-right: none;
}

html.legacy-env .element-sidebar-menu .el-menu-item,
html.legacy-env .element-sidebar-menu .el-sub-menu__title {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 20px !important;
  line-height: 48px;
  color: #303133;
}

html.legacy-env .element-sidebar-menu .el-sub-menu .el-menu-item {
  height: 44px;
  padding-left: 48px !important;
  line-height: 44px;
  color: #606266;
}

html.legacy-env .element-menu-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  font-size: 18px;
  vertical-align: middle;
}

html.legacy-env .element-menu-title {
  font-size: 14px;
  vertical-align: middle;
}

html.legacy-env .element-sidebar-menu .el-menu-item.is-active {
  position: relative;
  color: #1890ff !important;
  background: #e6f7ff !important;
}

html.legacy-env .element-sidebar-menu .el-menu-item.is-active::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  content: '';
  background: #1890ff;
}

html.legacy-env .element-sidebar-menu .el-sub-menu__icon-arrow {
  margin-left: auto;
  font-size: 12px;
  color: #909399;
}

/* 顶栏 / 内容区基础 */
html.legacy-env #app {
  min-height: 100vh;
}

html.legacy-env .vben-layout,
html.legacy-env .vben-admin-layout,
html.legacy-env .layout-container {
  display: flex;
  min-height: 100vh;
}

html.legacy-env .vben-layout-sidebar,
html.legacy-env aside {
  flex-shrink: 0;
}

html.legacy-env .vben-layout-main,
html.legacy-env main {
  flex: 1;
  min-width: 0;
}

/* Chrome 86：主内容区固定高度 + overflow:hidden 时，工作台底部会被裁切 */
html.legacy-env-no-aspect-ratio main.relative.bg-background-deep {
  overflow-x: hidden;
  overflow-y: auto;
}

html.legacy-env-no-aspect-ratio .flex.flex-1.flex-col.overflow-hidden {
  overflow-x: hidden;
  overflow-y: auto;
}

html.legacy-env-no-aspect-ratio [class*='rounded-[inherit]'] {
  overflow-x: hidden;
  overflow-y: auto;
}

/* ========== 顶栏 Header（Chrome 86 缺 Tailwind size-* / flex-center 时头像会撑爆） ========== */
html.legacy-env header.flex.w-full {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}

html.legacy-env header.flex.w-full > .flex.flex-1.items-center,
html.legacy-env header.flex.w-full > div.flex.flex-1.items-center {
  display: flex;
  flex: 1 1 0%;
  align-items: center;
  min-width: 0;
  height: 100%;
}

html.legacy-env header.flex.w-full > .flex.shrink-0.items-center,
html.legacy-env header.flex.w-full > div.flex.shrink-0.items-center {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  height: 100%;
}

html.legacy-env header.flex.w-full .group.flex.h-8 {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  flex-shrink: 0;
  white-space: nowrap;
}

html.legacy-env header.flex.w-full > .flex-center {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-width: 0;
}

html.legacy-env header.flex.w-full .vben-breadcrumb ul.flex,
html.legacy-env header.flex.w-full .vben-breadcrumb ol,
html.legacy-env header.flex.w-full .vben-breadcrumb nav ol {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
}

html.legacy-env header.flex.w-full .cursor-pointer.rounded-full {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

html.legacy-env header.flex.w-full .cursor-pointer.rounded-full .relative.flex.shrink-0,
html.legacy-env header.flex.w-full .cursor-pointer.rounded-full .size-8 {
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 9999px;
}

html.legacy-env header.flex.w-full .cursor-pointer.rounded-full .size-full,
html.legacy-env header.flex.w-full .cursor-pointer.rounded-full [class*='rounded-full'] {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 9999px;
}

html.legacy-env header.flex.w-full .cursor-pointer.rounded-full img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
}

@media (min-width: 640px) {
  html.legacy-env header.flex.w-full [class*='sm:mr-4'] {
    margin-right: 1rem;
  }
}

@media (min-width: 768px) {
  html.legacy-env [class*='md:block'] {
    display: block;
  }

  html.legacy-env [class*='md:bg-accent'] {
    background-color: hsl(240 4.8% 95.9%);
  }
}

@media (min-width: 1024px) {
  html.legacy-env .hidden[class*='lg:block'] {
    display: flex;
  }
}

/* ========== 标签栏 Tabbar（工具按钮须与标签同一行，否则会掉到头像正下方） ========== */
html.legacy-env section.flex.w-full.border-b {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

html.legacy-env section.flex.w-full.border-b > .flex.h-full.flex-1,
html.legacy-env section.flex.w-full.border-b > div.flex.h-full.flex-1 {
  display: flex;
  flex: 1 1 0%;
  flex-direction: row;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

html.legacy-env section.flex.w-full.border-b > .flex-center.h-full,
html.legacy-env section.flex.w-full.border-b > div.flex-center.h-full {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  align-items: center;
  align-self: stretch;
  height: 100%;
}

html.legacy-env section.flex.w-full.border-b .flex-center.h-full.cursor-pointer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-shrink: 0;
}

/* 通用工具类统一放在 legacy-fallback.css，本文件只保留布局/侧边栏相关规则 */
