:root {
  color-scheme: light;
  --ink: #14213a;
  --muted: #748096;
  --line: #dfe5ef;
  --surface: #ffffff;
  --page: #f4f7fb;
  --accent: #1769ff;
  --accent-hover: #0c55dc;
  --focus: rgba(23, 105, 255, .1);
  --shadow: 0 24px 60px rgba(25, 48, 83, .12);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.router-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  margin: 0;
  background: #f4f7fb;
  color: #6f7d91;
  font: 14px/1.5 Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.loader { display: grid; justify-items: center; gap: 12px; }
.loader img { width: 64px; height: 64px; object-fit: contain; }
.loader p { margin: 0; }

.desktop-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background: #e7ecf4;
}

.desktop-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, .82fr);
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  min-width: 900px;
  min-height: 506px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.visual-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid rgba(20, 33, 58, .06);
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.72) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 68%, rgba(255,255,255,.5) 0 1px, transparent 2px),
    linear-gradient(145deg, #e6ebf3 0%, #dbe2ec 56%, #eef2f7 100%);
  background-size: 34px 34px, 39px 39px, auto;
}

.visual-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, rgba(255,255,255,.3), transparent 42%);
  pointer-events: none;
}

.background-label {
  position: absolute;
  bottom: 4.6%;
  left: 5.8%;
  z-index: 1;
  color: rgba(62, 77, 101, .38);
  font-size: clamp(9px, .66vw, 12px);
  font-weight: 650;
  letter-spacing: .2em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.02em;
}

.brand--desktop {
  position: absolute;
  top: 4.6%;
  left: 5.7%;
  z-index: 2;
}

.brand__icon {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 4px 9px rgba(14, 46, 112, .13));
}

.login-panel {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  padding: 6% 11% 4.5%;
  background: var(--surface);
}

.login-card {
  align-self: center;
  width: min(100%, 420px);
  margin: 0 auto;
}

.status-copy {
  margin: 0 0 clamp(13px, 1.25vh, 20px);
  color: var(--accent);
  font-size: clamp(10px, .74vw, 13px);
  font-weight: 720;
  letter-spacing: .035em;
  white-space: pre-wrap;
}

h1 {
  margin: 0;
  color: #101b31;
  font-size: clamp(34px, 3vw, 54px);
  font-weight: 760;
  letter-spacing: -.06em;
  line-height: 1.08;
}

.intro {
  margin: clamp(13px, 1.6vh, 22px) 0 0;
  color: var(--muted);
  font-size: clamp(13px, .96vw, 16px);
  line-height: 1.75;
}

.fields {
  display: grid;
  gap: clamp(13px, 1.5vh, 18px);
  margin-top: clamp(24px, 3.4vh, 42px);
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  color: #455269;
  font-size: clamp(11px, .76vw, 13px);
  font-weight: 650;
}

.field__control {
  display: flex;
  align-items: center;
  min-height: clamp(44px, 5.1vh, 56px);
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field__control:focus-within {
  border-color: #8eb4ff;
  background: #fff;
  box-shadow: 0 0 0 4px var(--focus);
}

.field__control svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 11px;
  fill: none;
  stroke: #9aa5b7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.field__control input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(12px, .82vw, 14px);
}

.field__control input::placeholder { color: #b2bac7; }

.assist-row {
  display: flex;
  justify-content: flex-end;
  min-height: 21px;
  margin-top: 11px;
}

.text-button {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: clamp(11px, .76vw, 13px);
  font-weight: 620;
}

.text-button:hover { color: var(--accent-hover); }
.text-button:focus-visible {
  border-radius: 2px;
  outline: 2px solid #8eb4ff;
  outline-offset: 4px;
}

.login-button {
  width: 100%;
  min-height: clamp(45px, 5.3vh, 58px);
  margin-top: clamp(14px, 1.7vh, 21px);
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  box-shadow: 0 9px 22px rgba(23, 105, 255, .2);
  color: #fff;
  cursor: pointer;
  font-size: clamp(13px, .9vw, 15px);
  font-weight: 700;
  letter-spacing: .06em;
}

.login-button:disabled {
  cursor: wait;
  opacity: .72;
}

.login-feedback {
  margin: 11px 0 0;
  color: #c83545;
  font-size: clamp(10px, .72vw, 12px);
  font-weight: 620;
  line-height: 1.5;
  text-align: center;
}

.icp-placeholder {
  align-self: end;
  color: #a4adbc;
  font-size: clamp(9px, .66vw, 11px);
  letter-spacing: .04em;
  text-align: center;
}

.login-feedback[data-tone="warning"] { color: #b26814; }

.icp-placeholder a {
  color: inherit;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color .18s ease, text-decoration-color .18s ease;
}

.icp-placeholder a:hover,
.icp-placeholder a:focus-visible {
  color: #6f7b8e;
  text-decoration-color: currentColor;
}

.mobile-page {
  min-height: 100svh;
  background: #e7ecf4;
}

.mobile-canvas {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  max-width: 520px;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 96% -5%, rgba(47, 127, 255, .14), transparent 29%),
    linear-gradient(180deg, #f8faff 0%, #f5f7fb 100%);
}

.brand--mobile {
  position: relative;
  z-index: 1;
  font-size: 14px;
}

.brand--mobile .brand__icon {
  width: 38px;
  height: 38px;
}

.mobile-login-card {
  align-self: center;
  width: 100%;
  padding: 7vh 0 5vh;
}

.mobile-login-card .status-copy {
  margin-bottom: 14px;
  font-size: 10px;
  letter-spacing: .025em;
}

.mobile-login-card h1 { font-size: clamp(36px, 11vw, 48px); }
.mobile-login-card .intro { font-size: 14px; }
.mobile-login-card .fields { margin-top: 34px; gap: 17px; }
.mobile-login-card .field__label { font-size: 12px; }
.mobile-login-card .field__control { min-height: 54px; }
.mobile-login-card .field__control input { font-size: 14px; }
.mobile-login-card .text-button { font-size: 12px; }
.mobile-login-card .login-button { min-height: 54px; font-size: 15px; }
.mobile-login-card .login-feedback { margin-top: 11px; font-size: 11px; }
.mobile-canvas > .icp-placeholder { padding-top: 18px; font-size: 10px; }

.contact-dialog {
  width: min(calc(100% - 40px), 390px);
  padding: 30px 28px 26px;
  border: 0;
  border-radius: 18px;
  outline: 0;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 31, 59, .25);
  color: var(--ink);
  text-align: center;
}

.contact-dialog::backdrop {
  background: rgba(17, 29, 49, .46);
  backdrop-filter: blur(4px);
}

.contact-dialog p {
  margin: 2px 0 24px;
  color: #4e5c72;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.7;
}

.contact-dialog button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 680;
}

.contact-dialog button:hover { background: var(--accent-hover); }
.contact-dialog button:focus-visible {
  outline: 3px solid #a7c5ff;
  outline-offset: 3px;
}

@media (max-height: 650px) and (min-width: 768px) {
  .login-card { transform: scale(.9); }
}

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