:root {
  color-scheme: light dark;
  --ink: #1a2539;
  --muted: #4d5c74;
  --surface: #fff;
  --background: #eef2f8;
  --subtle: #f3f6fb;
  --line: #cfdaea;
  --accent: #2850bd;
  --action: #274bb0;
  --notice: #89370d;
  --notice-bg: #fff1e5;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8effd;
    --muted: #b7c5dd;
    --surface: #18243a;
    --background: #0d1627;
    --subtle: #212f46;
    --line: #40516e;
    --accent: #bdceff;
    --action: #395fc8;
    --notice: #ffcbac;
    --notice-bg: #46312f;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; display: grid; place-items: center; padding: clamp(12px, 4vw, 48px);
  color: var(--ink); background: var(--background); font-size: 15px; line-height: 1.65;
}
.workbench {
  display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 1.35fr); width: min(100%, 850px);
  overflow: hidden; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 22px 70px #172d551c;
}
.server-panel {
  display: flex; flex-direction: column; justify-content: space-between; gap: 36px; padding: 29px 22px;
  background: radial-gradient(ellipse at 5% 100%, #233f79, transparent 65%), #142641; color: #f2f6ff;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; color: inherit; text-decoration: none; }
.brand img { flex: none; }
.server-address { display: grid; gap: 3px; font-size: 13px; }
.server-address span { color: #bdcce6; }
.server-address strong { font: 500 14px/1.5 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.auth-panel { min-width: 0; display: grid; gap: 18px; align-content: center; padding: clamp(20px, 4vw, 38px); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(23px, 4vw, 31px); line-height: 1.3; letter-spacing: -.025em; margin-bottom: 8px; }
h2 { font-size: 16px; }
header p, .recovery-step p { color: var(--muted); }
.request, .help, .recovery-step { background: var(--subtle); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.request-heading { display: flex; justify-content: space-between; align-items: first baseline; gap: 4px 14px; flex-wrap: wrap; }
.request-heading > strong { overflow-wrap: anywhere; }
.timer { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
summary { width: fit-content; min-height: 32px; display: list-item; color: var(--accent); cursor: pointer; padding-top: 4px; }
details ul, .instructions { margin: 0; padding-inline-start: 1.4em; }
.instructions li + li { margin-top: 8px; }
form, .field, .recovery-step { display: grid; gap: 8px; }
form { gap: 14px; }
.field > label { font-size: 13px; font-weight: 630; }
input, button { font: inherit; }
.field input {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px;
  min-height: 46px; padding: 9px 11px; background: var(--surface); color: var(--ink); font-size: 16px;
}
.field input[aria-invalid=true] { border-color: var(--notice); }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.password-field:has(button:not([hidden])) input { border-radius: 9px 0 0 9px; }
.password-field button { padding: 0 12px; color: var(--accent); background: var(--subtle); border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0; cursor: pointer; }
.primary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 9px 15px;
  color: white; background: var(--action); border: 1px solid transparent; border-radius: 9px;
  font-weight: 650; cursor: pointer; text-decoration: none;
}
.primary:hover { filter: brightness(1.13); }
.primary:disabled { opacity: .55; cursor: not-allowed; }
.notice { padding: 9px 12px; color: var(--notice); background: var(--notice-bg); border-radius: 9px; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.server-panel :focus-visible { outline-color: #b4c9ff; }
footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 13px;
}
pre { margin: 0; padding: 8px 10px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
pre, code { font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 595px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .server-panel { padding: 16px 20px; gap: 8px; }
  .server-panel .brand img { width: 32px; height: 32px; }
  .server-address { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 9px; }
}
