@font-face {
  font-family: "Legal MiSans";
  src: url("./assets/fonts/MiSans-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171f2b;
  --muted: #687483;
  --cyan: #35bce7;
  --cyan-soft: rgba(53, 188, 231, 0.16);
  --line: rgba(47, 157, 190, 0.18);
  --paper: #f5f8f9;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: #f5f8f9;
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
}

.login-brand {
  position: fixed;
  z-index: 4;
  top: 40px;
  left: 36px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Legal MiSans", "Microsoft YaHei UI", sans-serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-synthesis: none;
}

.brand-line {
  width: 3px;
  height: 22px;
  background: var(--cyan);
}

.login-main {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 120px 32px 110px;
}

.login-panel {
  width: min(680px, 100%);
  text-align: center;
  transform: translateY(-2vh);
  animation: panel-arrive 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.identity-mark {
  display: inline-block;
  width: 0;
  height: 0;
  margin-bottom: 31px;
  border-right: 11px solid transparent;
  border-left: 11px solid transparent;
  border-top: 18px solid rgba(53, 188, 231, 0.86);
  clip-path: polygon(0 0, 100% 0, 50% 100%, 42% 82%, 83% 11%, 17% 11%, 58% 82%, 50% 100%);
}

.login-panel h1 {
  margin: 0 0 57px;
  font-size: clamp(27px, 2.25vw, 36px);
  font-weight: 400;
  letter-spacing: 0.035em;
}

.auth-row {
  position: relative;
  width: min(360px, calc(100% - 76px));
  margin: 0 auto;
}

.feishu-login {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 28px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #172330;
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    0 14px 34px rgba(25, 45, 58, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-family: "Legal MiSans", "Microsoft YaHei UI", sans-serif;
  font-size: 17px;
  font-weight: 500;
  font-synthesis: none;
  letter-spacing: 0.025em;
  transition: color 220ms ease, opacity 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.feishu-login > span {
  position: relative;
  z-index: 2;
}

.feishu-login:hover {
  color: #172330;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 16px 38px rgba(25, 45, 58, 0.085),
    inset 0 1px 0 #fff;
}

.feishu-login:focus-visible {
  color: #172330;
  outline: 2px solid rgba(53, 188, 231, 0.58);
  outline-offset: 5px;
}

.feishu-login:active {
  opacity: 0.72;
}

.feishu-login[aria-busy="true"] {
  cursor: wait;
}

.feishu-mark {
  position: relative;
  width: 21px;
  height: 20px;
  margin-right: 10px;
  --mark-1: #00bfa6;
  --mark-2: #00a0e7;
  --mark-3: #306bea;
  --mark-4: #5878e8;
}

.feishu-mark i {
  position: absolute;
  display: block;
  width: 13px;
  height: 6px;
  border-radius: 8px 2px 8px 2px;
  transform-origin: 100% 100%;
}

.feishu-mark i:nth-child(1) { top: 0; left: 1px; background: var(--mark-1); transform: rotate(10deg); }
.feishu-mark i:nth-child(2) { top: 4px; right: 0; background: var(--mark-2); transform: rotate(76deg); }
.feishu-mark i:nth-child(3) { bottom: 0; right: 2px; background: var(--mark-3); transform: rotate(152deg); }
.feishu-mark i:nth-child(4) { bottom: 4px; left: 0; background: var(--mark-4); transform: rotate(218deg); }

.login-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: #277d9c;
  font-size: 13px;
}

.login-footer {
  position: fixed;
  z-index: 4;
  right: 48px;
  bottom: 32px;
  left: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6b7581;
  font-size: 13px;
}

.service-status,
.access-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.service-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #20b477;
  box-shadow: 0 0 0 4px rgba(32, 180, 119, 0.08);
}

.access-note b {
  color: rgba(92, 105, 118, 0.55);
  font-weight: 400;
}

.access-note a {
  color: inherit;
  text-decoration: none;
}

.access-note a:hover,
.access-note a:focus-visible {
  color: #277d9c;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.is-paused *,
.motion-reduced * {
  animation-play-state: paused !important;
}

@keyframes panel-arrive {
  from { opacity: 0; transform: translateY(calc(-2vh + 12px)); }
  to { opacity: 1; transform: translateY(-2vh); }
}

@media (max-width: 860px) {
  .login-brand { top: 26px; left: 24px; }
  .login-main { padding-inline: 22px; }
  .auth-row { width: min(360px, 100%); }
  .login-panel h1 { margin-bottom: 44px; }
  .login-footer { right: 24px; bottom: 22px; left: 24px; gap: 18px; font-size: 12px; }
}

@media (max-width: 620px) {
  .login-footer { align-items: flex-start; flex-direction: column; }
  .access-note { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
