:root {
  color-scheme: light;
  --bg: #eef5ff;
  --panel: #ffffff;
  --ink: #13202f;
  --muted: #5d6b7c;
  --line: #d7e0e8;
  --brand: #0087ff;
  --brand-dark: #0072d9;
  --blue: #0087ff;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --shadow: 0 18px 50px rgba(4, 22, 55, 0.05);
}

@font-face {
  font-family: "MiSans";
  src: local("MiSans"), url("/assets/MiSans-Normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MiSans";
  src: local("MiSans Medium"), url("/assets/MiSans-Medium.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MiSans";
  src: local("MiSans Bold"), url("/assets/MiSans-Bold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "MiSans", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(0, 135, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(7, 32, 78, 0.055) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

a {
  color: var(--blue);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 42px clamp(28px, 5vw, 72px);
  background: linear-gradient(150deg, #0087ff 0%, #0072d9 58%, #005fb3 100%);
  box-shadow: none;
  color: #f8fafc;
}

.brand-logo {
  position: absolute;
  left: clamp(28px, 5vw, 72px);
  top: 42px;
  font-family: "MiSans", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.03em;
  font-weight: 800;
  font-size: 23px;
}

.brand-copy {
  max-width: 640px;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: none;
}

.brand-subline {
  margin: 18px 0 0;
  max-width: 540px;
  color: #eaf5ff;
  font-size: 16px;
  line-height: 1.75;
}

.feature-list {
  display: grid;
  gap: 11px;
  margin: 26px 0 0;
  padding: 22px 0 0;
  max-width: 620px;
  border-top: 1px solid rgba(191, 219, 254, 0.24);
  list-style: none;
}

.feature-list li {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 16px;
  color: #e4f1ff;
  font-size: 13.5px;
  line-height: 1.5;
}

.feature-list strong {
  color: #ffffff;
  font-weight: 800;
}

.feature-list span {
  color: #dbeeff;
}

.login-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card,
.status-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  position: relative;
  padding: 30px;
}

.wechat-corner-button[hidden],
.wechat-panel[hidden] {
  display: none !important;
}

.wechat-corner-button:not([hidden]) {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand);
  cursor: pointer;
}

.wechat-corner-button:not([hidden]):hover {
  background: #f8fbff;
  border-color: rgba(0, 135, 255, 0.35);
}

.qr-corner-icon {
  width: 22px;
  height: 22px;
}

.wechat-corner-mark {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #22c55e;
  color: #ffffff;
}

.wechat-mark {
  width: 12px;
  height: 12px;
}

.wechat-panel:not([hidden]) {
  display: grid;
  gap: 18px;
  text-align: center;
}

.wechat-qr-box {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 1;
  margin: 6px auto 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 135, 255, 0.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 135, 255, 0.14) 1px, transparent 1px),
    #ffffff;
  background-size: 18px 18px;
  overflow: hidden;
}

.qr-placeholder {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-columns: repeat(2, 46px) 1fr;
  grid-template-rows: repeat(2, 46px) 1fr;
  gap: 12px;
  opacity: 0.2;
}

.qr-placeholder span {
  display: block;
  border: 10px solid var(--brand);
  border-radius: 6px;
}

.qr-disabled-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
}

.wechat-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.mobile-logo {
  display: none;
  margin-bottom: 20px;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 22px;
}

.login-card h2,
.status-card h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.login-card .sub,
.status-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.form {
  margin-top: 24px;
  display: grid;
  gap: 15px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 135, 255, 0.18);
}

.primary-button,
.oauth-button,
.secondary-button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: #0087ff;
  box-shadow: 0 0 0 4px rgba(0, 135, 255, 0.05);
}

.primary-button:hover {
  background: #0072d9;
}

.primary-button:disabled,
.oauth-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #789;
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.oauth-group {
  display: grid;
  gap: 10px;
}

.oauth-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  background: #ffffff;
  border-color: #cbd5e1;
  color: #182333;
}

.oauth-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.oauth-button:hover,
.secondary-button:hover {
  background: #f8fafc;
}

.oauth-button.github {
  background: #24292f;
  border-color: #24292f;
  color: #ffffff;
}

.oauth-button.github:hover {
  background: #111827;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.small-link {
  display: inline-flex;
  margin-top: 16px;
  font-size: 13px;
}

.alert {
  margin-top: 16px;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.alert.error {
  border: 1px solid #fecaca;
  color: var(--danger);
  background: var(--danger-bg);
}

.alert.ok {
  border: 1px solid #bbf7d0;
  color: var(--ok);
  background: var(--ok-bg);
}

.center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.status-card {
  padding: 30px;
  text-align: center;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #d7e0e8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .page-shell {
    display: block;
  }

  .brand-panel {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .mobile-logo {
    display: block;
    text-align: center;
  }
}

@media (max-width: 460px) {
  .login-panel,
  .center-shell {
    padding: 18px;
  }

  .login-card,
  .status-card {
    padding: 22px;
  }

  .button-row {
    display: grid;
  }
}
