:root {
  color-scheme: light dark;

  --bg: #f3f5f9;
  --bg-glow: rgba(10, 102, 216, 0.09);
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --text: #171a1f;
  --text-muted: #5f6b7e;
  --border: #e3e7ee;
  --border-strong: #cfd6e2;

  --accent: #0a66d8;
  --accent-hover: #0959bd;
  --accent-soft: #e9f1fd;

  --btn-bg: #0a66d8;
  --btn-bg-hover: #0959bd;
  --btn-text: #ffffff;

  --warn: #9a5700;
  --warn-bg: #fff8e8;
  --warn-border: #f0d7a4;

  --ok: #0f7a4d;
  --ok-bg: #eaf8f0;
  --ok-border: #b9e6cc;

  --error: #b42318;
  --error-bg: #fff2f0;
  --error-border: #f5c2bd;

  --shadow: 0 18px 45px rgba(23, 26, 31, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --focus-ring: 0 0 0 3px rgba(10, 102, 216, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c10;
    --bg-glow: rgba(106, 166, 255, 0.1);
    --surface: #13161c;
    --surface-soft: #191d25;
    --text: #eef1f6;
    --text-muted: #98a2b3;
    --border: #262c37;
    --border-strong: #364050;

    --accent: #6aa6ff;
    --accent-hover: #8ab8ff;
    --accent-soft: #16253d;

    --btn-bg: #2f6fd0;
    --btn-bg-hover: #3d7dde;
    --btn-text: #ffffff;

    --warn: #f0b45a;
    --warn-bg: #221a0d;
    --warn-border: #4a371a;

    --ok: #5fd39b;
    --ok-bg: #0f2018;
    --ok-border: #1f4433;

    --error: #ff8f85;
    --error-bg: #2a1310;
    --error-border: #5a2621;

    --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    --focus-ring: 0 0 0 3px rgba(106, 166, 255, 0.28);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -120px, var(--bg-glow), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--surface);
}

.page {
  width: min(780px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 54px;
}

/* ---------- Hero ---------- */

.hero {
  margin-bottom: 26px;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.hero h1 {
  margin: 14px 0 6px;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero__sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card--notice {
  border-left: 4px solid var(--warn);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card--notice .card__icon {
  background: var(--warn-bg);
  color: var(--warn);
}

.card__icon svg {
  width: 18px;
  height: 18px;
}

.card h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

/* ---------- Notice ---------- */

.notice__intro {
  margin: 0 0 12px;
  font-size: 14.5px;
}

.notice__list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.notice__list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: 11px;
  background: var(--warn-bg);
  font-size: 14px;
  counter-increment: rule;
}

.notice__list li::before {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
  content: counter(rule);
}

.tips {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.tips h3 {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tips ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.steps li span {
  display: grid;
  place-items: center;
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Form ---------- */

.field {
  margin: 0 0 18px;
}

.field__title,
.field label {
  display: block;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.statement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.statement-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.statement {
  margin: 0;
  padding: 13px 15px;
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.85;
  word-break: break-word;
  user-select: text;
}

textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  border: 1.5px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

textarea[aria-invalid="true"] {
  border-color: var(--error);
}

.hint {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- hCaptcha ---------- */

.hcaptcha {
  display: flex;
  align-items: flex-start;
  min-height: 79px;
}

.captcha-status {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.captcha-status[data-kind="ok"] {
  color: var(--ok);
}

.captcha-status[data-kind="warn"] {
  color: var(--warn);
}

.captcha-status[data-kind="error"] {
  color: var(--error);
}

/* ---------- Buttons ---------- */

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  width: 100%;
  min-height: 48px;
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: 0 10px 22px rgba(10, 102, 216, 0.22);
}

.btn--primary:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
}

.btn--primary:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--accent);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--small {
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.2;
}

/* ---------- Terms / Accounts ---------- */

.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}

.agree input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.agree span {
  min-width: 0;
}

.accounts-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.accounts-panel__head h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.accounts-panel__head .hint {
  margin: 0 0 12px;
}

.accounts {
  display: grid;
  gap: 14px;
}

.account {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.account__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.account__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account__index {
  color: var(--text-muted);
  font-size: 12px;
}

.account__username {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  word-break: break-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge--ok {
  border: 1px solid var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok);
}

.badge--bad {
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error);
}

.account-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}

.account-row__label {
  color: var(--text-muted);
  font-size: 12.5px;
}

.account-row__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.account-row__value code {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  word-break: break-all;
}

.copy-btn {
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11.5px;
}

.account__warning {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- Status ---------- */

.form-status {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--error-border);
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 13.5px;
}

.form-status:focus {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.success {
  margin-top: 4px;
  padding: 20px 18px;
  border: 1px solid var(--ok-border);
  border-radius: 14px;
  background: var(--ok-bg);
  text-align: center;
}

.success h3 {
  margin: 0 0 6px;
  color: var(--ok);
  font-size: 17px;
}

.success p {
  margin: 0 0 10px;
  font-size: 13.5px;
}

.success a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.footer p {
  margin: 0;
}

/* ---------- Utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  width: min(780px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--error-border);
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 13.5px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .page {
    width: min(100% - 22px, 780px);
    padding: 28px 0 38px;
  }

  .hero {
    margin-bottom: 20px;
  }

  .hero__sub {
    font-size: 13.5px;
  }

  .card {
    margin-bottom: 14px;
    padding: 18px 15px;
    border-radius: 15px;
  }

  .card--notice {
    border-left-width: 3px;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statement-head {
    flex-direction: column;
    align-items: stretch;
  }

  .statement-head .btn {
    width: 100%;
  }

  .notice__list li {
    padding: 9px 10px;
    font-size: 13.5px;
  }

  .btn--primary {
    min-height: 50px;
  }

  .account-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .agree {
    padding: 11px 12px;
  }
}

@media (max-width: 350px) {
  .hcaptcha {
    transform: scale(0.92);
    transform-origin: left top;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
