:root {
  --ink: #17352c;
  --ink-soft: #50675f;
  --muted: #82938c;
  --paper: #f3f3ec;
  --primary: #1e7159;
  --primary-deep: #144f3f;
  --line: #d9e2dc;
  --line-strong: #c5d4cc;
  --coral: #e47758;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 90%, rgba(235, 183, 111, 0.18), transparent 34%),
    radial-gradient(circle at 93% 6%, rgba(150, 215, 188, 0.32), transparent 33%),
    var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-shell {
  display: grid;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 0;
  grid-template-columns: minmax(0, 1.2fr) minmax(390px, 0.8fr);
  align-items: center;
  gap: clamp(54px, 8vw, 110px);
}

.auth-intro {
  padding: 20px 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #effff8;
  border-radius: 15px;
  background: var(--primary);
  box-shadow: 0 12px 28px rgba(30, 113, 89, 0.23);
}

.auth-mark svg {
  width: 27px;
  height: 27px;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.auth-brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.intro-copy {
  margin-top: clamp(80px, 14vh, 150px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.intro-copy h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: clamp(43px, 5.1vw, 68px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.intro-copy h1 span {
  color: var(--primary);
}

.intro-copy > p:last-child {
  max-width: 530px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.security-strip {
  display: flex;
  gap: 34px;
  margin-top: clamp(56px, 10vh, 96px);
  padding-top: 22px;
  border-top: 1px solid rgba(58, 90, 78, 0.15);
}

.security-strip > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.security-strip svg {
  width: 21px;
  height: 21px;
  color: var(--primary);
}

.security-strip strong,
.security-strip small {
  display: block;
}

.security-strip strong {
  font-size: 11px;
}

.security-strip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.auth-card {
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(29, 65, 51, 0.13);
  backdrop-filter: blur(18px);
}

.auth-card.shake {
  animation: shake 260ms ease;
}

@keyframes shake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--primary-deep);
  border-radius: 999px;
  background: #e8f3ee;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.server-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2c8d6c;
  box-shadow: 0 0 0 4px rgba(44, 141, 108, 0.12);
}

.port-label {
  color: #9aa8a2;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.card-heading {
  margin: 38px 0 30px;
}

.card-heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.field {
  position: relative;
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #334d44;
  font-size: 11px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 49px;
  padding: 0 44px;
  color: var(--ink);
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  transition: 160ms ease;
}

.field input::placeholder {
  color: #a5b1ac;
}

.field input:focus {
  border-color: #72a995;
  background: white;
  box-shadow: 0 0 0 4px rgba(71, 145, 120, 0.1);
}

.field-icon {
  position: absolute;
  top: 38px;
  left: 15px;
  color: #879991;
}

.field-icon svg {
  width: 18px;
  height: 18px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: grid;
  width: 33px;
  height: 33px;
  padding: 0;
  place-items: center;
  color: #8b9b94;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--primary);
  background: #edf4f1;
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.password-note {
  margin: -5px 0 16px;
  color: var(--muted);
  font-size: 9px;
}

.auth-submit {
  display: flex;
  width: 100%;
  height: 49px;
  margin-top: 25px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  color: white;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(110deg, var(--primary-deep), var(--primary));
  box-shadow: 0 12px 28px rgba(30, 113, 89, 0.2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 32px rgba(30, 113, 89, 0.25);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.8;
}

.submit-arrow {
  font-size: 18px;
  font-weight: 400;
}

.spinner {
  width: 16px;
  height: 16px;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

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

.form-error {
  min-height: 17px;
  margin: 10px 0 0;
  color: #bb5146;
  font-size: 10px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 17px;
  color: #9ca9a3;
  border-top: 1px solid #e7ece9;
  font-size: 8px;
  letter-spacing: 0.03em;
}

@media (max-width: 850px) {
  .auth-shell {
    width: min(520px, calc(100% - 28px));
    padding: 28px 0;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .intro-copy {
    margin-top: 54px;
  }

  .intro-copy h1 {
    font-size: clamp(39px, 10vw, 52px);
  }

  .security-strip {
    display: none;
  }

  .auth-card {
    padding: 28px 22px;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
  }

  .intro-copy {
    margin-top: 38px;
  }

  .intro-copy > p:last-child {
    display: none;
  }

  .card-heading {
    margin: 30px 0 24px;
  }

  .card-heading h2 {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
