:root {
  --ink: #171717;
  --muted: #9a9a9a;
  --line: #e9e9e9;
  --bg: #f3f3f3;
  --accent: #0f766e;
  --accent-dark: #111;
  --paper: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: #1683ff;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: clamp(20px, 3.8vh, 42px);
  padding: 12px 28px 32px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  color: #000;
}

.login-brand img {
  width: 58px;
  height: 58px;
}

.login-brand strong {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 900;
  letter-spacing: 0;
}

.login-card {
  display: grid;
  width: min(1046px, 100%);
  grid-template-columns: 425px 1fr;
  min-height: 500px;
  border-radius: 22px;
  background: var(--paper);
}

.scan-panel,
.form-panel {
  padding: 54px 70px 42px;
}

.scan-panel {
  display: grid;
  align-content: start;
  justify-items: center;
  border-right: 1px solid var(--line);
}

.scan-panel h1 {
  margin: 0 0 34px;
  font-size: 20px;
  font-weight: 500;
}

.qr-frame {
  display: grid;
  width: 226px;
  height: 226px;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.06);
}

.qr-frame img {
  display: block;
  width: 198px;
  height: 198px;
  object-fit: contain;
}

.qr-placeholder {
  position: relative;
  display: grid;
  width: 198px;
  height: 198px;
  place-items: center;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  background: #f8f8f8;
  color: #111;
  text-align: center;
}

.qr-placeholder strong,
.qr-placeholder small {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.9);
}

.qr-placeholder strong {
  margin-top: 0;
  font-size: 16px;
  font-weight: 900;
}

.qr-placeholder small {
  margin-top: 6px;
  color: #666;
  font-size: 12px;
}

.wechat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 0;
  color: #3f3f3f;
  font-size: 17px;
}

.wechat-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #06c160;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.scan-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-panel {
  display: grid;
  align-content: start;
}

.tabs {
  display: flex;
  gap: 36px;
  margin-bottom: 34px;
}

.unified-title {
  margin-bottom: 28px;
}

.unified-title strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.tab {
  border: 0;
  padding: 0;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-size: 20px;
}

.tab.active {
  color: var(--ink);
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 18px;
}

.reset-form {
  display: none;
}

#phoneForm {
  display: none;
}

.register-mode .unified-title,
.register-mode #passwordForm {
  display: none;
}

.register-mode #phoneForm {
  display: grid;
}

.reset-mode .tabs,
.reset-mode #phoneForm,
.reset-mode #passwordForm {
  display: none;
}

.reset-mode .reset-form {
  display: grid;
}

.login-form label {
  position: relative;
  display: grid;
  gap: 8px;
}

.login-form label > span:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.login-form input:not([type="checkbox"]) {
  width: 100%;
  height: 56px;
  border: 1px solid #e4e4e4;
  border-radius: 14px;
  padding: 0 20px;
  outline: none;
  color: var(--ink);
  font-size: 16px;
}

.login-form input::placeholder {
  color: #b7b7b7;
}

.login-form input:focus {
  border-color: #cfcfcf;
}

.code-row input {
  padding-right: 126px;
}

.link-button {
  position: absolute;
  right: 18px;
  bottom: 8px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #1683ff;
  cursor: pointer;
  font-size: 15px;
}

.link-button:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.agree-row {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  gap: 10px !important;
  align-items: center;
  color: #999;
  font-size: 14px;
}

.agree-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-dark);
}

.submit-button {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 14px;
  background: var(--accent-dark);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
}

.submit-button:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  color: #1683ff;
  font-size: 14px;
}

.plain-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1683ff;
  cursor: pointer;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: #d97706;
  font-size: 14px;
}

.region-note {
  margin: 28px 0 0;
  color: #aaa;
  text-align: center;
  font-size: 14px;
}

.register-fields {
  display: grid;
  gap: 18px;
}

.register-toggle {
  width: fit-content;
  justify-self: start;
  font-size: 13px;
}

.qr-official-link {
  display: grid;
  width: 198px;
  height: 198px;
  place-items: center;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 900px) {
  .login-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .scan-panel,
  .form-panel {
    padding: 34px 28px;
  }

  .scan-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scan-panel h1 {
    margin-bottom: 24px;
  }

  .qr-frame {
    width: 204px;
    height: 204px;
  }

  .qr-frame img,
  .qr-placeholder {
    width: 176px;
    height: 176px;
  }

  .tabs {
    margin-bottom: 28px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .login-shell {
    gap: 22px;
    padding: 18px 14px 28px;
  }

  .login-brand {
    gap: 12px;
  }

  .login-brand img {
    width: 54px;
    height: 54px;
  }

  .login-brand strong {
    font-size: 26px;
  }

  .tabs {
    gap: 28px;
  }

  .tab {
    font-size: 20px;
  }

  .login-form input:not([type="checkbox"]) {
    height: 56px;
    border-radius: 14px;
    font-size: 16px;
  }

  .link-button {
    bottom: 8px;
    font-size: 15px;
  }

  .agree-row,
  .region-note {
    font-size: 13px;
  }

  .submit-button {
    height: 58px;
    border-radius: 14px;
    font-size: 20px;
  }
}
