* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #f5f8fb;
  color: #18243a;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(22px, 6vw, 36px);
  border: 1px solid #e0e9f5;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 42px #1b396812;
}

.login-brand { display: inline-block; }
.login-brand img { display: block; width: 150px; height: auto; }
h1 { margin: 18px 0 24px; font-size: 28px; line-height: 1.3; }
form { display: grid; gap: 8px; }
label { color: #435778; font-size: 14px; }
input, button { min-height: 44px; border-radius: 9px; font: inherit; }
input { width: 100%; padding: 9px 12px; border: 1px solid #b9c9df; color: inherit; background: #fff; }
input + label { margin-top: 7px; }
button { margin-top: 9px; border: 0; color: #fff; background: #2458a8; font-weight: 600; cursor: pointer; }
button:hover { background: #1b4587; }
button:disabled { opacity: .65; cursor: wait; }
#registration-check {
  min-width: 0;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  color: #435778;
  font-size: 14px;
}
#registration-check legend { padding: 0 0 8px; }
.registration-image-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
#registration-image {
  width: 120px;
  height: 40px;
  border-radius: 6px;
}
#registration-answer { margin-top: 5px; }
#registration-check-status { margin: 4px 0 0; line-height: 1.5; }
#registration-check-retry {
  margin: 0;
  padding: 0 12px;
  border: 1px solid #b9c9df;
  background: #f5f8fb;
  color: #2458a8;
}
#account-close-check p { margin: 10px 0; color: #8a2635; font-size: 14px; line-height: 1.55; }
#account-close-check label { display: flex; align-items: center; gap: 8px; }
#account-close-confirm { width: 18px; min-height: 18px; flex: none; }
.account-close-submit { background: #9c2336; }
.account-close-submit:hover { background: #821a2b; }
#login-status { margin: 4px 0 0; color: #435778; font-size: 14px; line-height: 1.5; }
#login-form[hidden] { display: none; }
.device-card { width: min(100%, 540px); }
.device-summary {
  padding: 14px 16px;
  border: 1px solid #dbe7f7;
  border-radius: 12px;
  background: #f1f6fd;
}
.device-account {
  margin: 0 0 4px;
  color: #435778;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.device-count { margin: 0; color: #244879; font-weight: 700; }
.device-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.device-list:empty { margin: 0; }
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e0e9f5;
  border-radius: 12px;
}
.device-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.device-label { display: inline; margin: 0; color: #18243a; font-size: 15px; }
.device-current {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #e8f3ff;
  color: #214f85;
  font-size: 12px;
  white-space: nowrap;
}
.device-login { margin: 5px 0 0; color: #53647a; font-size: 13px; line-height: 1.45; }
.device-status { margin: 12px 0 0; color: #435778; font-size: 14px; line-height: 1.5; }
.device-remove, .device-confirm button[value="cancel"] {
  flex: none;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #cfdef1;
  background: #f6faff;
  color: #234b83;
  font-size: 14px;
}
.device-remove:hover, .device-confirm button[value="cancel"]:hover { background: #eaf3ff; }
.device-confirm {
  width: min(100% - 32px, 400px);
  padding: 20px;
  border: 1px solid #e0e9f5;
  border-radius: 18px;
  background: #fff;
  color: #18243a;
}
.device-confirm::backdrop { background: #16294b66; }
.device-confirm h2 { margin: 0; font-size: 20px; }
.device-confirm p { margin: 0; color: #435778; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.device-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.device-confirm-actions button { margin: 0; padding: 8px; }
#device-replace-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 5px 0;
  padding: 0;
  border: 0;
}
.device-replace-choice { cursor: pointer; }
.device-replace-choice .device-login { display: block; }
.device-replace-choice:has(input:checked) { border-color: #759cce; background: #eef5ff; }
.device-replace-choice input {
  flex: none;
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #2458a8;
}
nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
nav a { color: #2458a8; font-size: 14px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid #2458a8; outline-offset: 3px; }

#switch-to-user:not([hidden]) {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid #b9c9df;
  border-radius: 9px;
  color: #2458a8;
  background: #f3f7fe;
  font-weight: 600;
  text-decoration: none;
}
#switch-to-user:hover { background: #e6efff; }

@font-face {
  font-family: "Studio Smiley Sans";
  src: url("/fonts/smiley-sans-v2.0.1.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.account-page {
  --account-ink: #171a1e;
  --account-muted: #5d626a;
  --account-line: #e5ebec;
  --account-accent: #006e73;
  --account-heading: "Studio Smiley Sans", "Microsoft YaHei", sans-serif;
  display: block;
  place-items: normal;
  padding: 0;
  color: var(--account-ink);
  background: #fff;
}
.account-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
  padding: 10px clamp(16px, 4vw, 64px);
  border-bottom: 1px solid #f0f1f2;
}
.account-brand { flex: none; }
.account-brand img { width: clamp(113px, 17vw, 180px); }
.account-header nav { margin: 0; gap: clamp(5px, 1vw, 12px); }
.account-header nav a {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 clamp(9px, 1.5vw, 20px);
  border: 1px solid var(--account-line);
  border-radius: 999px;
  color: var(--account-ink);
  font: 400 clamp(12px, 1.3vw, 15px)/1.15 var(--account-heading);
  text-decoration: none;
  white-space: nowrap;
}
.account-header nav a:hover,
.account-header nav a[aria-current="page"] {
  border-color: #bfdfdf;
  color: #005f65;
  background: #eff9f8;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .9fr);
  align-items: center;
  gap: clamp(24px, 6vw, 92px);
  width: min(100% - 56px, 1080px);
  min-height: min(700px, calc(100svh - 82px));
  margin-inline: auto;
  padding-block: 36px 60px;
}
.account-layout:has(.device-card) { grid-template-columns: minmax(0, 540px); justify-content: center; }
.account-layout:has(.device-card) .account-illustration { display: none; }
.account-illustration {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 390px;
  border-radius: 34px;
  background:
    radial-gradient(circle, #8cbdd73d 1px, transparent 1.4px) 0 0 / 29px 29px,
    radial-gradient(circle, #a396d83b 1px, transparent 1.4px) 15px 15px / 44px 44px,
    radial-gradient(ellipse at 55% 57%, #e7f5f5 0, #f7fafc 51%, #fff 90%);
}
.account-illustration img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.account-page .login-card {
  width: 100%;
  min-width: 0;
  padding: clamp(22px, 3.5vw, 42px);
  border: 1px solid var(--account-line);
  border-radius: 28px;
  box-shadow: 0 18px 46px #153f4511;
}
.account-page .login-card h1 {
  margin: 0 0 24px;
  color: var(--account-ink);
  font: 400 clamp(34px, 3.9vw, 49px)/1.12 var(--account-heading);
}
.account-page form label { color: #434951; }
.account-page input:not([type="radio"],[type="checkbox"]),
.account-page textarea {
  min-height: 46px;
  border: 1px solid #dce5e7;
  border-radius: 12px;
  background: #fcfefe;
}
.account-page button {
  background: #1a1c20;
  border-radius: 999px;
}
.account-page button:hover { background: #34383e; }
.account-page button.account-close-submit { background: #9c2336; }
.account-page button.account-close-submit:hover { background: #821a2b; }
.account-page a:not(.login-brand,.account-header nav a) {
  color: var(--account-accent);
  text-underline-offset: 4px;
}
.account-page :focus-visible { outline-color: var(--account-accent); }
.account-page #switch-to-user:not([hidden]) {
  color: #005f65;
  border-color: #c5e0e0;
  background: #f2faf9;
}
.account-page #switch-to-user:hover { background: #e6f5f3; }

@media (max-width: 800px) {
  .account-header { min-height: 68px; }
  .account-layout, .account-layout:has(.device-card) {
    width: min(100% - 32px, 480px);
    min-height: calc(100svh - 68px);
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding-block: clamp(30px, 8vw, 62px);
  }
  .account-illustration { display: none; }
  .account-page .login-card { border-radius: 22px; }
}
