:root {
  color-scheme: dark;
  --bg: #111113;
  --panel: #1a1a1e;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f2f2f4;
  --muted: #9d9da8;
  --faint: #6f6f7a;
  --blue: #4d7cff;
  --red: #ff7d7d;
  --green: #49d18b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(900px 520px at 90% -10%, rgba(77, 124, 255, 0.2), transparent 60%),
    radial-gradient(700px 460px at -10% 20%, rgba(122, 92, 255, 0.14), transparent 58%),
    var(--bg);
}

.card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(26, 26, 30, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 30px 24px 20px;
  text-align: center;
}

.mark {
  border-radius: 17px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 16px 0 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.lede {
  margin: 7px auto 0;
  max-width: 300px;
  color: var(--muted);
  font-size: 13.5px;
}

.server-state {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 18px 0 4px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.server-state .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  margin-right: 6px;
}

.server-state[data-state="online"] {
  color: #bff4d8;
  border-color: rgba(73, 209, 139, 0.3);
  background: rgba(73, 209, 139, 0.08);
}

.server-state[data-state="online"] .dot {
  background: var(--green);
}

.server-state[data-state="offline"] {
  color: #ffc9c9;
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

.server-state[data-state="offline"] .dot {
  background: var(--red);
}

form {
  margin-top: 20px;
  text-align: left;
}

label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input {
  width: 100%;
  height: 58px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: #131316;
  color: var(--text);
  text-align: center;
  font: 600 26px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  outline: none;
}

input:focus {
  border-color: rgba(77, 124, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(77, 124, 255, 0.12);
}

.button {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), #6b5bff);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(77, 124, 255, 0.24);
}

.button:disabled {
  opacity: 0.6;
}

.error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.08);
  color: #ffc4c4;
  font-size: 13px;
  text-align: left;
}

.hint {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: left;
  color: var(--faint);
  font-size: 11.5px;
}

.hint p {
  margin: 5px 0;
}

code {
  color: #b9c8ff;
  font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

footer {
  margin-top: 18px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
  overflow-wrap: anywhere;
}
