:root {
  --ink: #19251d;
  --muted: #6d786f;
  --line: #e0e5df;
  --accent: #72eb30;
  --link: #357d22;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f7f8f6;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.desk-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.desk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 24px;
  width: min(1200px, calc(100% - 64px));
  min-height: 92px;
  margin-inline: auto;
}

.desk-brand {
  width: 260px;
}

.desk-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.desk-back:hover,
.desk-footer a:hover {
  color: var(--link);
}

.login-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 24px 20px 40px;
}

.desk-login {
  width: min(100%, 460px);
  padding: 38px 40px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 36px #20381806;
}

.desk-login-title {
  margin-bottom: 28px;
}

.desk-login-title h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.4;
}

.desk-login-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.desk-account-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  border-radius: 9px;
  background: #f2f4f0;
}

.desk-account-types button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 500;
  transition: color .18s ease, background-color .18s ease;
}

.desk-account-types button.active {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 4px #162a1408;
  font-weight: 650;
}

.desk-account-types button:hover {
  color: var(--link);
}

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

.desk-field {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.desk-field > label {
  font-size: 13px;
  font-weight: 600;
}

.desk-field input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #d7ded5;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.desk-field input::placeholder {
  color: #8b948d;
  font-size: 14px;
}

.desk-field input:focus {
  border-color: #6b9f5a;
  outline: none;
  box-shadow: 0 0 0 3px #72eb301f;
}

.desk-password {
  position: relative;
}

.desk-password input {
  padding-right: 52px;
}

.desk-password button {
  position: absolute;
  inset: 3px 3px 3px auto;
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.desk-password button img {
  opacity: .55;
}

.desk-password button:hover {
  background: #f2f4f0;
}

.desk-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.desk-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.desk-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--link);
}

.desk-options a,
.desk-register a,
.desk-help a {
  color: var(--link);
}

.desk-options a:hover,
.desk-register a:hover,
.desk-help a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.desk-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  color: #102509;
  background: var(--accent);
  font-size: 15px;
  font-weight: 650;
  transition: background-color .18s ease;
}

.desk-submit:hover {
  background: #84ef49;
}

.desk-submit:disabled {
  cursor: wait;
  opacity: .7;
}

.desk-submit.success {
  background: #dff3d8;
}

.desk-submit img {
  width: 16px;
  height: 16px;
}

.desk-register {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid #edf0eb;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.desk-register a {
  margin-left: 5px;
  font-weight: 600;
}

.desk-help {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.desk-help a {
  margin-left: 6px;
}

.desk-footer {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 20px 24px 28px;
  color: #7b857d;
  font-size: 12px;
}

.desk-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.desk-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 4px;
  max-width: min(400px, calc(100% - 32px));
  padding: 16px 20px;
  border: 1px solid #c8dfbf;
  border-radius: 10px;
  color: #2e572b;
  background: #f1f8ee;
  box-shadow: 0 8px 30px #132b1a12;
  opacity: 0;
  pointer-events: none;
  overflow-wrap: anywhere;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.desk-toast.show {
  opacity: 1;
  transform: none;
}

.desk-toast.error {
  border-color: #e9c2b9;
  color: #963d2c;
  background: #fff4f1;
}

.desk-toast strong {
  font-size: 14px;
}

.desk-toast span {
  font-size: 13px;
}

@media (max-width: 560px) {
  .desk-header {
    width: calc(100% - 36px);
    min-height: 76px;
    gap: 16px;
  }

  .desk-brand {
    width: 200px;
    min-width: 0;
  }

  .desk-back {
    font-size: 12px;
  }

  .login-shell {
    justify-content: flex-start;
    padding: 18px 16px 24px;
  }

  .desk-login {
    padding: 28px 24px 24px;
    border-radius: 12px;
  }

  .desk-login-title h1 {
    font-size: 28px;
  }

  .desk-footer {
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
  }

  .desk-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (max-width: 360px) {
  .desk-login {
    padding-inline: 20px;
  }

  .desk-login-title p {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none;
  }
}
