/**
 * 旧版浏览器样式回退（仅 html.legacy-env 生效，避免覆盖 Tailwind）。
 *
 * 注意：所有通用工具类（Tailwind 同名回退）只允许定义在本文件，
 * 且本文件必须是 index.html 中第一个 legacy 样式表。
 * 不要在 legacy-antd.css / legacy-dashboard.css / legacy-layout.css 再复制一份，
 * 否则后加载的工具类（如 .flex-col）会以同特异性覆盖前面文件里的语义规则
 * （曾导致登录页卡片被强制竖排、表单区被裁掉）。
 */

html.legacy-env .flex {
  display: flex;
}

html.legacy-env .inline-flex {
  display: inline-flex;
}

html.legacy-env .flex-col {
  flex-direction: column;
}

html.legacy-env .flex-1 {
  flex: 1 1 0%;
}

html.legacy-env .flex-row {
  flex-direction: row;
}

html.legacy-env .items-center {
  align-items: center;
}

html.legacy-env .justify-center {
  justify-content: center;
}

html.legacy-env .shrink-0 {
  flex-shrink: 0;
}

html.legacy-env .flex-nowrap {
  flex-wrap: nowrap;
}

html.legacy-env .min-w-0 {
  min-width: 0;
}

html.legacy-env .hidden {
  display: none;
}

html.legacy-env .gap-1 {
  gap: 0.25rem;
}

html.legacy-env .gap-3 {
  gap: 0.75rem;
}

html.legacy-env .ml-1 {
  margin-left: 0.25rem;
}

html.legacy-env .ml-2 {
  margin-left: 0.5rem;
}

html.legacy-env .mr-1 {
  margin-right: 0.25rem;
}

html.legacy-env .mr-2 {
  margin-right: 0.5rem;
}

html.legacy-env .flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

html.legacy-env .size-3 {
  width: 0.75rem;
  height: 0.75rem;
}

html.legacy-env .size-4 {
  width: 1rem;
  height: 1rem;
}

html.legacy-env .size-8 {
  width: 2rem;
  height: 2rem;
}

html.legacy-env .size-12 {
  width: 3rem;
  height: 3rem;
}

html.legacy-env .size-full {
  width: 100%;
  height: 100%;
}

html.legacy-env .h-8 {
  height: 2rem;
}

html.legacy-env .object-cover {
  object-fit: cover;
}

html.legacy-env .w-full {
  width: 100%;
}

html.legacy-env .h-full {
  height: 100%;
}

html.legacy-env .min-h-0 {
  min-height: 0;
}

html.legacy-env .overflow-hidden {
  overflow: hidden;
}

html.legacy-env .text-center {
  text-align: center;
}

html.legacy-env .text-left {
  text-align: left;
}

html.legacy-env .relative {
  position: relative;
}

html.legacy-env .object-contain {
  object-fit: contain;
}

html.legacy-env .cursor-pointer {
  cursor: pointer;
}

html.legacy-env .rounded-lg {
  border-radius: 0.5rem;
}

html.legacy-env .rounded-full {
  border-radius: 9999px;
}

html.legacy-env .font-semibold {
  font-weight: 600;
}

html.legacy-env .leading-tight {
  line-height: 1.25;
}

html.legacy-env .justify-between {
  justify-content: space-between;
}

html.legacy-env .justify-end {
  justify-content: flex-end;
}

html.legacy-env .items-end {
  align-items: flex-end;
}

html.legacy-env .flex-wrap {
  flex-wrap: wrap;
}

html.legacy-env .flex-auto {
  flex: 1 1 auto;
}

html.legacy-env .absolute {
  position: absolute;
}

html.legacy-env .inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

html.legacy-env .block {
  display: block;
}

html.legacy-env .text-base {
  font-size: 16px;
  line-height: 24px;
}

html.legacy-env .text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

html.legacy-env .font-medium {
  font-weight: 500;
}

html.legacy-env .mb-4 {
  margin-bottom: 1rem;
}

html.legacy-env .mt-2 {
  margin-top: 8px;
}

html.legacy-env .p-4 {
  padding: 1rem;
}

html.legacy-env .px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

html.legacy-env .py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

html.legacy-env .w-56 {
  width: 14rem;
}

html.legacy-env .min-h-full {
  min-height: 100%;
}

html.legacy-env .truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.legacy-env .border-b {
  border-bottom: 1px solid #e5e6eb;
}

html.legacy-env .bg-card {
  background-color: #fff;
}

html.legacy-env .flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Chrome 86 等不支持 aspect-ratio（88+）的环境：二维码容器高度塌陷 + overflow 裁切 */
html.legacy-env-no-aspect-ratio .login-page__body {
  overflow-x: hidden;
  overflow-y: auto;
}

html.legacy-env-no-aspect-ratio .login-page__scale-box {
  overflow: visible;
}

html.legacy-env-no-aspect-ratio .login-page__card {
  overflow: visible;
}

html.legacy-env-no-aspect-ratio .login-page__panel {
  min-height: 560px;
  overflow: visible;
  padding-bottom: 48px;
}

html.legacy-env-no-aspect-ratio .login-qrcode-panel .aspect-square,
html.legacy-env-no-aspect-ratio .login-qrcode-panel [class*='aspect-square'] {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 232px;
  height: 232px;
  max-width: 232px;
  overflow: visible;
  border: 1px solid #999999;
}

html.legacy-env-no-aspect-ratio .login-qrcode-panel .aspect-square img,
html.legacy-env-no-aspect-ratio .login-qrcode-panel [class*='aspect-square'] img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

html.legacy-env .h-dvh {
  min-height: 100vh;
  height: 100vh;
}

html.legacy-env .login-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #e4effd;
}

html.legacy-env .login-page__body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 0 1rem;
}

html.legacy-env .login-page__scale-box {
  flex-shrink: 0;
}

html.legacy-env .login-page__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 7px 1px rgba(206, 206, 206, 0.5);
}

@media (min-width: 1024px) {
  /* 提高特异性到 (0,3,1)：卡片元素上挂着 Tailwind 的 flex-col，
     若任何后加载的样式再出现同特异性 (0,2,1) 的 .flex-col 工具类，
     会在平局时把方向覆盖回 column、表单区被挤出卡片外（曾实际发生），
     故显式加 .flex-col 兜底。 */
  html.legacy-env .login-page__card,
  html.legacy-env .login-page__card.flex-col {
    flex-direction: row;
    width: 1440px;
    height: 900px;
  }
}

html.legacy-env .login-page__brand {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (min-width: 1024px) {
  html.legacy-env .login-page__brand {
    width: 44%;
    max-width: 630px;
    height: 100%;
    background-size: auto 100%;
  }
}

html.legacy-env .login-page__brand-logo {
  object-fit: contain;
  margin: 30px;
  width: 158px;
  height: 52.5px;
}

html.legacy-env .login-page__brand-title {
  margin-left: 74px;
  margin-top: 35px;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.25;
  color: #1d2129;
}

html.legacy-env .login-page__brand-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  margin-left: 74px;
  height: 54px;
  padding: 0 18px;
  border-radius: 9999px;
  background: #0090ff;
  color: #fff;
  font-size: 30px;
}

html.legacy-env .login-page__form-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

html.legacy-env .login-page__form-inner {
  width: 100%;
  max-width: 408px;
}

html.legacy-env .login-page__welcome {
  margin-bottom: 23px;
  text-align: left;
  color: #000;
  font-size: 30px;
}

html.legacy-env .login-page__panel {
  min-height: 480px;
  padding: 40px 48px;
  border-radius: 0.5rem;
  box-shadow: 0 0 18px 0 rgba(0, 0, 0, 0.08);
}

html.legacy-env .login-page__tabs {
  display: flex;
  width: 100%;
  align-items: center;
  border-bottom: 2px solid #e3e3e3;
}

html.legacy-env .login-page__tab {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 20px;
  cursor: pointer;
}

html.legacy-env .login-page__tab.is-active {
  color: #0090ff;
}

html.legacy-env .login-page__tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: #0090ff;
}

html.legacy-env .login-page__copyright {
  flex-shrink: 0;
  padding: 10px 16px;
  text-align: center;
  color: #515a6e;
  font-size: 12px;
}

@media (min-width: 640px) {
  html.legacy-env .login-page__copyright {
    text-align: right;
    font-size: 14px;
  }
}
