:root {
  color-scheme: dark;
  --background: #081522;
  --panel: #0e2333;
  --line: #29485b;
  --text: #e6f1f7;
  --muted: #9ab3c3;
  --accent: #58d7e7;
  --success: #85dfbb;
  --warning: #f2c384;
  --danger: #ffb9be;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background: var(--background);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 50% 0, #12334a 0, transparent 62%), var(--background); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, p { margin: 0; }
h1 { margin: 0 0 12px; font-size: 26px; font-weight: 650; line-height: 1.4; letter-spacing: .01em; }
strong { font-weight: 600; }
.auth-shell { width: min(100%, 536px); margin: 0 auto; padding: clamp(24px, 7vh, 72px) 18px 28px; }
.site-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 22px 4px; font-size: 18px; font-weight: 650; }
.site-mark { display: grid; place-items: center; width: 33px; height: 33px; color: var(--accent); border: 1px solid #30768a; border-radius: 9px; background: #103546; font-size: 17px; }
.auth-card { min-width: 0; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, #10293b, var(--panel) 72%); box-shadow: 0 18px 60px #0003; }
.auth-footer { margin-top: 20px; text-align: center; color: #7893a5; font-size: 12px; }
.step-label { margin-bottom: 12px; color: var(--accent); font-size: 13px; font-weight: 600; }
.intro { margin-bottom: 24px; color: var(--muted); font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.intro strong { color: var(--text); }
.auth-form { margin: 22px 0 0; }
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; min-width: 0; }
.form-field>label { color: #cbdfe9; font-size: 14px; font-weight: 600; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=submit]), select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; color: var(--text); background: #091b29; border: 1px solid #36576b; border-radius: 8px; line-height: 1.5; }
input::placeholder { color: #6e8b9f; }
input[readonly] { color: var(--muted); background: #102634; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0 7px 0 0; accent-color: var(--accent); vertical-align: middle; }
input[autocomplete=one-time-code] { font-variant-numeric: tabular-nums; letter-spacing: .18em; font-size: 22px; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-help { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.field-help ul { margin: 0; padding-left: 19px; }
.field-errors, .form-error { color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.has-error input { border-color: #b56773; }
.form-error { padding: 11px 13px; margin-bottom: 18px; border: 1px solid #704751; border-radius: 8px; background: #42232e; }
.errorlist { list-style: none; padding: 0; margin: 0; }
.errorlist li + li { margin-top: 5px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.form-actions>.primary { flex: 1; }
.form-actions.stacked { flex-direction: column; align-items: stretch; gap: 14px; }
.form-actions.stacked .text-link { text-align: center; font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; max-width: 100%; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-size: 15px; font-weight: 600; line-height: 1.5; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.button:hover { text-decoration: none; }
.primary { color: #052530; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #8ce9f2; border-color: #8ce9f2; }
.secondary { color: #c5dfec; background: #133246; border-color: #355b70; }
.secondary:hover { background: #1a4155; }
.full-width { width: 100%; }
.text-button { color: var(--accent); border: 0; background: none; padding: 4px 0; font-size: inherit; line-height: inherit; }
.text-button:hover { text-decoration: underline; }
.alternative-action { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.alternative-methods { display: grid; gap: 8px; margin: 16px 0; }
.footnote { margin-top: 22px; color: #8ca7b8; font-size: 12px; }
.notice, .page-messages { padding: 13px 15px; border: 1px solid #2e5667; border-radius: 8px; background: #102e3e; color: #bad8e4; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.page-messages { margin-bottom: 20px; }
.page-messages p + p { margin-top: 8px; }
.notice.error { color: var(--danger); background: #42232e; border-color: #704751; }
.status-label { display: inline-block; margin-bottom: 15px; padding: 3px 9px; color: #aed8e6; border: 1px solid #3d6175; border-radius: 6px; background: #163748; font-size: 12px; font-weight: 600; }
.status-label.success { color: var(--success); border-color: #396b60; background: #123c35; }
.status-label.warning { color: var(--warning); border-color: #735d3c; background: #3e3321; }
.setup-outline { list-style: none; padding: 0; margin: 24px 0; }
.setup-outline li { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; }
.setup-outline li>span { display: grid; place-items: center; flex: 0 0 26px; height: 26px; margin-top: 1px; border-radius: 50%; color: var(--accent); background: #164254; font-size: 12px; }
.setup-outline strong { font-size: 14px; }
.setup-outline p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.qr-frame { width: fit-content; max-width: 100%; margin: 20px auto 12px; padding: 10px; border-radius: 10px; background: #fff; }
.qr-frame img { display: block; width: 240px; max-width: 100%; height: auto; aspect-ratio: 1; }
.qr-caption { margin: 0 0 18px; text-align: center; color: var(--muted); font-size: 12px; }
details { font-size: 13px; }
summary { cursor: pointer; color: #9fd9e8; }
details>p { margin-top: 12px; color: var(--muted); overflow-wrap: anywhere; }
.manual-key { padding: 13px 15px; margin: 18px 0; border: 1px solid var(--line); border-radius: 8px; background: #0b1f2e; }
.secret-key { display: block; margin-top: 12px; padding: 10px; background: #071826; border-radius: 6px; color: var(--text); font-size: 14px; letter-spacing: .05em; overflow-wrap: anywhere; user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 18px; margin: 24px 0; border: 1px solid #315168; border-radius: 9px; background: #091d2b; }
.recovery-codes li { min-width: 0; padding: 5px 2px; text-align: center; }
.recovery-codes code { color: #e5f4f9; font-family: ui-monospace, Consolas, monospace; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.regenerate-codes { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.regenerate-codes .auth-form { margin-top: 14px; }
.back-link { display: inline-block; margin-top: 22px; font-size: 13px; }
.security-progress { list-style: none; padding: 0; margin: 24px 0; border-block: 1px solid var(--line); }
.security-progress li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; font-size: 14px; }
.security-progress li + li { border-top: 1px solid #29485b80; }
.security-progress strong { flex-shrink: 0; font-size: 12px; }
.security-progress .done { color: var(--success); }
.security-progress .pending { color: var(--warning); }
.account-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.account-links form { margin: 0; }
@media (max-width: 420px) {
  .auth-shell { padding: 22px 12px; }
  .site-heading { margin-bottom: 17px; font-size: 17px; }
  .auth-card { padding: 25px 20px; border-radius: 13px; }
  h1 { font-size: 23px; }
  .intro { font-size: 14px; }
  .recovery-codes { padding: 13px 9px; gap: 8px 5px; }
  .recovery-codes code { font-size: 15px; letter-spacing: .03em; }
  .security-progress li { gap: 8px; font-size: 13px; }
}
@media (max-width: 350px) {
  .auth-card { padding: 22px 17px; }
  h1 { font-size: 21px; }
  .button { padding-inline: 12px; font-size: 14px; }
  .notice { padding: 11px 12px; }
}
@media print {
  :root { color-scheme: light; color: #111; background: #fff; }
  body, .auth-card, .recovery-codes { background: #fff; box-shadow: none; }
  .auth-card { border-color: #bbb; }
  .auth-shell { width: 100%; max-width: 600px; padding: 0; }
  .intro, .notice, .recovery-codes code { color: #111; }
  .auth-form, .regenerate-codes, .back-link, .auth-footer, .account-links { display: none; }
}
