:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef3f9;
  color: #172033;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 0%, rgba(53, 118, 198, 0.18), transparent 34%),
    radial-gradient(circle at 95% 15%, rgba(79, 179, 153, 0.13), transparent 28%),
    linear-gradient(145deg, #f7f9fc 0%, #eaf0f7 100%);
}

.card {
  width: min(100%, 480px);
  overflow: hidden;
  border: 1px solid rgba(208, 219, 232, 0.94);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 80px rgba(34, 55, 84, 0.16);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 30px;
  border-bottom: 1px solid #e8edf4;
  background: rgba(249, 251, 254, 0.92);
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #286fc5, #175cae);
  box-shadow: 0 7px 18px rgba(31, 103, 187, 0.24);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.brand {
  color: #203047;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-state { padding: 34px 30px 30px; }

.state-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 16px;
  font-size: 23px;
  font-weight: 800;
}

.state-icon.ready { background: #e6f5ef; color: #137557; }
.state-icon.invalid { background: #fff0ee; color: #b42318; }
.state-icon.checking {
  border: 3px solid #dce7f4;
  border-top-color: #246fc7;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: #55708f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow.success { color: #137557; }
.eyebrow.error { color: #b42318; }

h1 {
  margin: 0 0 12px;
  color: #15243a;
  font-size: clamp(27px, 7vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.intro { margin: 0 0 26px; color: #5b6578; line-height: 1.7; }
form { display: grid; gap: 10px; }
label { margin-top: 8px; color: #263a54; font-size: 14px; font-weight: 700; }

input {
  width: 100%;
  border: 1px solid #c6d3e2;
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
  color: #172033;
  font: inherit;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus { border-color: #3778c8; box-shadow: 0 0 0 3px rgba(55, 120, 200, 0.14); }

.field-hint { margin: -2px 0 4px; color: #718096; font-size: 12px; line-height: 1.5; }

button {
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  padding: 14px 17px;
  background: linear-gradient(145deg, #2875cc, #185fae);
  box-shadow: 0 10px 24px rgba(31, 103, 187, 0.24);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { cursor: wait; opacity: 0.62; }

.status { min-height: 24px; margin: 18px 0 0; color: #5b6578; font-size: 14px; line-height: 1.5; }
.status.error { color: #b42318; }
.status.success { color: #167647; }

.security-note {
  display: grid;
  gap: 6px;
  margin: 0 0 22px;
  padding: 15px 16px;
  border: 1px solid #dce6f1;
  border-radius: 14px;
  background: #f7faff;
  color: #5a6b80;
  font-size: 13px;
  line-height: 1.55;
}

.security-note strong { color: #263a54; }

.privacy-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e8edf4;
  color: #6a788b;
  font-size: 12px;
  line-height: 1.55;
}

.primary-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #c8d7e8;
  border-radius: 12px;
  background: #fff;
  color: #1e64b3;
  font-weight: 700;
  text-decoration: none;
}

.primary-link:hover { background: #f5f9fe; }

@media (max-width: 480px) {
  body { padding: 16px; }
  .card { border-radius: 19px; }
  .brand-row { padding: 18px 21px; }
  .page-state { padding: 28px 21px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .state-icon.checking { animation: none; }
}

/* ---- 账号中心页面（M8，2026-07-27）：登录、注册、用户中心共用 ---- */
/* 这些页面原先靠 cdn.tailwindcss.com 上色。它们都触及会话身份，
   不接受第三方脚本，故样式全部自托管，CSP 收紧到 default-src 'none'。 */

.hidden { display: none !important; }
.muted { color: #6a788b; }
.small { font-size: 13px; line-height: 1.55; }

.link-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 14px;
}

.text-link {
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  box-shadow: none;
  color: #1e64b3;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.text-link:hover { text-decoration: underline; }
.text-link.subtle { color: #6a788b; font-weight: 500; }

button.ghost {
  background: #fff;
  border: 1px solid #c8d7e8;
  box-shadow: none;
  color: #1e64b3;
}

button.ghost:hover { background: #f5f9fe; }

/* 危险动作与主动作必须一眼可分：注销是不可撤销的。 */
button.danger {
  background: linear-gradient(145deg, #d0342c, #b42318);
  box-shadow: 0 10px 24px rgba(180, 35, 24, 0.22);
}

.danger-entry {
  margin-top: 10px;
  border: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  color: #b42318;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.danger-entry:hover { text-decoration: underline; }

.danger-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #f3cfcb;
  border-radius: 14px;
  background: #fffaf9;
}

.danger-panel h2 {
  margin: 0;
  color: #8a1c13;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.danger-panel .warn { margin: 0; color: #7a4a45; font-size: 13px; line-height: 1.6; }
.danger-panel .warn strong { color: #8a1c13; }

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #dce6f1;
  border-radius: 14px;
  background: #f7faff;
}

.detail-row { display: grid; gap: 3px; }
.detail-row dt { color: #6a788b; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.detail-row dd { margin: 0; color: #223148; font-size: 15px; word-break: break-all; }

/* Turnstile 容器：脚本来自 challenges.cloudflare.com，是 CSP 里唯一的第三方来源。 */
.turnstile-slot { min-height: 0; margin-top: 12px; }
.turnstile-slot:empty { margin-top: 0; }

.primary-link.spaced { margin-top: 12px; }
.intro strong { color: #223148; word-break: break-all; }

/* 返回业务前台的链接：只有带合法 return_to 时才由 JS 显示出来。 */
.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}
