:root {
  color-scheme: light;
  --page: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.96);
  --text: #102746;
  --muted: #607394;
  --line: #e4eaf2;
  --primary: #2468f2;
  --primary-dark: #1e5de0;
  --danger: #c43131;
}

* { box-sizing: border-box; }

html,
body,
#app { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--page);
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

a { color: inherit; }

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
}

.login-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f8fbff;
}

.login-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.login-card {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: clamp(34px, 5vw, 82px);
  width: clamp(340px, 23vw, 390px);
  max-height: calc(100% - 176px);
  overflow: auto;
  padding: 32px 34px 28px;
  transform: translateY(-50%);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(50, 72, 107, 0.15);
  backdrop-filter: blur(12px);
}

.login-partner-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-size: 17px;
  font-weight: 700;
}

.login-partner-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #edf3ff;
}

.login-partner-icon img {
  width: 24px;
  height: 24px;
  filter: invert(37%) sepia(98%) saturate(2798%) hue-rotate(214deg) brightness(98%) contrast(94%);
}

.dingtalk-box {
  margin-top: 34px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.dingtalk-box h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.dingtalk-login-description {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.dingtalk-login-actions {
  display: grid;
  margin-top: 24px;
}

.btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid rgba(36, 104, 242, 0.25); outline-offset: 3px; }

.btn-primary {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 12px 22px rgba(36, 104, 242, 0.2);
}

.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary img { width: 27px; height: 27px; filter: brightness(0) invert(1); }
.btn:disabled { cursor: wait; opacity: 0.72; }

.compact-login-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compact-login-note img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  filter: invert(50%) sepia(23%) saturate(876%) hue-rotate(179deg) brightness(88%) contrast(88%);
}

.admin-login-panel { padding-top: 20px; }

.admin-login-panel summary {
  position: relative;
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.admin-login-panel summary::-webkit-details-marker { display: none; }

.admin-login-panel summary strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.admin-login-title {
  font-size: 16px;
  font-weight: 700;
}

.admin-login-panel summary > img {
  width: 20px;
  height: 20px;
  transition: transform 160ms ease;
  filter: invert(20%) sepia(34%) saturate(1140%) hue-rotate(177deg) brightness(88%) contrast(91%);
}

.admin-login-panel[open] summary > img { transform: rotate(90deg); }
.admin-login-panel[open] summary { margin-bottom: 16px; }

.muted-text { color: var(--muted); }
.admin-login-panel > .compact-login-note { display: block; }

.password-form { display: grid; gap: 12px; }
.password-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }

.password-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.password-form .btn-primary { min-height: 46px; font-size: 15px; }

.form-error,
.form-notice {
  margin-top: 14px;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.form-error { border: 1px solid rgba(196, 49, 49, 0.3); background: rgba(196, 49, 49, 0.08); color: var(--danger); }
.form-notice { border: 1px solid #c7d9fa; background: #f0f5ff; color: #245aaf; }

.login-card-progress { min-height: 290px; }
.progress-panel { margin-top: 36px; }
.progress-panel h2 { margin: 0; font-size: 26px; }
.progress-panel > p { margin: 14px 0 0; color: var(--muted); line-height: 1.7; }
.progress-panel .btn { width: 100%; margin-top: 18px; }

.login-product-footer {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 43px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-product-footer [data-runtime-product-version] { font-size: 14px; font-weight: 600; }

.login-compliance {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 16px;
  color: rgba(70, 88, 116, 0.58);
  font-size: 10px;
  text-decoration: none;
}

@media (max-width: 980px) {
  .login-hero { object-position: 43% center; }
  .login-card { right: 28px; }
}

@media (max-width: 720px) {
  .login-page { display: block; padding: 0; }
  .login-stage { width: 100%; min-height: 100vh; min-height: 100dvh; height: auto; max-height: none; border-radius: 0; }
  .login-hero { object-position: 38% center; opacity: 0.58; }
  .login-card {
    position: relative;
    top: auto;
    right: auto;
    width: min(calc(100% - 32px), 390px);
    max-height: none;
    margin: 0 auto;
    transform: none;
    top: 50vh;
    top: 50dvh;
    translate: 0 -50%;
  }
  .login-product-footer {
    right: 12px;
    bottom: 34px;
    width: auto;
    color: #102746;
  }
  .login-compliance { right: 12px; bottom: 10px; }
}

@media (max-height: 740px) and (min-width: 721px) {
  .login-card { max-height: calc(100% - 130px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
