:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #eef3f3;
  --text: #1f2933;
  --muted: #64707d;
  --border: #d7dee5;
  --accent: #117a7a;
  --accent-strong: #0d5f5f;
  --warn: #b45309;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

h1,
h2,
p {
  margin: 0;
}

button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 7px 12px;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

input,
textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  min-width: 0;
}

.auth-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.auth-shell {
  align-content: center;
  display: grid;
  gap: 14px;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
}

.auth-stage {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 520px) minmax(280px, 300px);
  max-width: 842px;
  width: 100%;
}

.auth-panel,
.auth-access-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(31, 41, 51, 0.08);
}

.auth-panel {
  display: grid;
  gap: 22px;
  max-width: 520px;
  padding: 36px;
  width: 100%;
}

.auth-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.auth-brand .brand-logo {
  border-radius: 50%;
  flex: 0 0 56px;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

.auth-brand h1 {
  color: var(--text);
  font-size: 34px;
  line-height: 1.15;
  min-width: 0;
  white-space: normal;
}

.auth-user {
  color: var(--text);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form[data-modal-locked] {
  pointer-events: none;
}

.auth-form label {
  color: var(--text);
  display: grid;
  font-size: 15px;
  font-weight: 700;
  gap: 8px;
}

.auth-form input {
  font-size: 16px;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.auth-form button {
  font-size: 17px;
  min-height: 50px;
  width: 100%;
}

.auth-field-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.auth-turnstile,
.auth-redeem-inline {
  background: #f7fbfb;
  border: 1px solid #c9dddc;
  border-radius: 8px;
}

.auth-turnstile {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 50px;
  padding: 6px 14px;
}

.auth-turnstile-label {
  color: var(--text);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
}

.auth-turnstile .cf-turnstile {
  flex: 0 0 auto;
  max-width: 100%;
}

.auth-redeem-inline {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.auth-redeem-head span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.auth-redeem-inline label {
  font-size: 14px;
}

.auth-redeem-inline input {
  font-size: 15px;
  min-height: 42px;
}

.auth-redeem-inline button {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 800;
  min-height: 44px;
}

.auth-login-page--redeem .auth-access-panel,
.auth-login-page--redeem .auth-login-side-float,
.auth-login-page--redeem .auth-merit-float,
.auth-login-page--redeem .auth-quote-float,
.auth-login-page--redeem .auth-support-zone {
  display: none;
}

.auth-login-page--redeem .auth-stage {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
  max-width: 520px;
}

.auth-login-page--redeem .auth-panel {
  gap: 18px;
}

.auth-login-page--redeem .auth-form {
  gap: 16px;
}

.auth-login-page--redeem .auth-redeem-inline {
  margin-top: -2px;
  order: 1;
}

.auth-login-page--redeem .auth-form > button.primary {
  background: var(--surface);
  border-color: #cfd8e3;
  color: var(--accent-strong);
  order: 2;
}

.auth-login-page--redeem .auth-link {
  order: 3;
}

.auth-access-panel {
  display: grid;
  gap: 18px;
  padding: 30px 26px;
}

.auth-access-head {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.auth-access-kicker {
  color: var(--accent-strong);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

.auth-access-rule {
  background: #fff8ea;
  border: 1px solid #edcf9b;
  border-radius: 7px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.auth-access-rule p,
.auth-access-list,
.auth-wechat-block p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-access-rule .auth-access-rule-main {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.auth-access-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.auth-wechat-block {
  align-items: center;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-top: 18px;
  text-align: center;
}

.auth-wechat-qr {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  height: auto;
  padding: 6px;
  width: 142px;
}

.auth-login-side-float {
  display: grid;
  gap: 34px;
  position: fixed;
  right: max(clamp(18px, 1.6vw, 28px), calc((100vw - 1263px) / 2 - 416px));
  top: max(61px, calc((100vh - 788px) / 2 + 19px));
  width: min(390px, calc(100vw - 40px));
  z-index: 60;
}

.auth-login-side-float[hidden],
.auth-merit-float[hidden] {
  display: none;
}

.auth-merit-float,
.auth-quote-float {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #c7dcdc;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(31, 41, 51, 0.12);
  display: grid;
}

.auth-merit-float {
  gap: 9px;
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.auth-merit-float::before {
  background: linear-gradient(90deg, #f5c64f 0%, #0d7777 100%);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.auth-merit-close {
  align-items: center;
  background: #f2f7f7;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 21px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
}

.auth-merit-close:hover,
.auth-merit-close:focus-visible {
  background: #e4eeee;
  border-color: #c7dcdc;
  color: var(--accent-strong);
}

.auth-merit-leaderboard-head {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.auth-merit-leaderboard-head h2,
.auth-quote-label {
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.auth-merit-marquee {
  align-items: center;
  background: #eef6f4;
  border: 1px solid #dcebe8;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 26px;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  width: min(314px, 100%);
}

.auth-merit-marquee::before,
.auth-merit-marquee::after {
  content: "";
  height: 100%;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 34px;
  z-index: 1;
}

.auth-merit-marquee::before {
  background: linear-gradient(90deg, rgba(238, 246, 244, 1), rgba(238, 246, 244, 0));
  left: 0;
}

.auth-merit-marquee::after {
  background: linear-gradient(270deg, rgba(238, 246, 244, 1), rgba(238, 246, 244, 0));
  right: 0;
}

.auth-merit-marquee-track {
  animation: auth-merit-marquee-scroll 12s linear infinite;
  display: inline-flex;
  min-width: max-content;
}

.auth-merit-marquee-track span {
  flex: 0 0 auto;
  padding-right: 34px;
  white-space: nowrap;
}

@keyframes auth-merit-marquee-scroll {
  to {
    transform: translateX(-50%);
  }
}

.auth-merit-rank-list {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.auth-merit-rank-row {
  align-items: center;
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 8px 10px;
}

.auth-merit-rank-row:first-child {
  background: #fff8e6;
}

.auth-merit-rank-row:nth-child(2),
.auth-merit-rank-row:nth-child(3) {
  background: #f8fafc;
}

.auth-merit-rank-badge {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.auth-merit-rank-row:first-child .auth-merit-rank-badge {
  background: #ffe8a3;
  border-color: #e9c66c;
  color: #7a4a00;
}

.auth-merit-rank-user {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auth-merit-rank-user strong,
.auth-merit-rank-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-merit-rank-user strong {
  color: var(--text);
  font-size: 15px;
}

.auth-merit-rank-user span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-merit-rank-gain {
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 900;
}

.auth-quote-float {
  gap: 10px;
  padding: 14px 16px 15px;
}

.auth-quote-head {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 32px;
  position: relative;
}

.auth-quote-refresh {
  align-items: center;
  background: #fff;
  border: 1px solid #c9dddc;
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  gap: 3px;
  line-height: 1;
  padding: 4px 7px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.auth-quote-text {
  align-items: center;
  background: #f7fbfb;
  border: 1px solid #c9dddc;
  border-radius: 8px;
  color: var(--accent-strong);
  display: flex;
  font-size: 16px;
  font-weight: 850;
  justify-content: center;
  line-height: 1.45;
  min-height: 42px;
  opacity: 0;
  padding: 9px 14px;
  text-align: center;
  transition: opacity 180ms ease;
}

.auth-quote-text.is-visible {
  opacity: 1;
}

.auth-error {
  background: #fff4f2;
  border: 1px solid #f3b8b1;
  border-radius: 6px;
  color: var(--danger);
  line-height: 1.45;
  padding: 9px 10px;
}

.auth-login-error,
.auth-rate-limit {
  display: grid;
  gap: 4px;
}

.auth-rate-limit-help {
  color: #7a4b45;
  font-size: 13px;
}

.auth-rate-limit-help a,
.auth-link {
  color: var(--accent-strong);
  font-weight: 800;
}

.auth-message {
  background: #eef8f6;
  border: 1px solid #c7e6df;
  border-radius: 6px;
  color: var(--accent-strong);
  font-weight: 800;
  line-height: 1.45;
  padding: 9px 10px;
}

.auth-recovery-email-field {
  position: relative;
}

.auth-field-overlay {
  animation: auth-field-overlay-dismiss 5.8s ease forwards;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(225, 196, 189, 0.76);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(31, 41, 51, 0.10), 0 2px 8px rgba(31, 41, 51, 0.08);
  display: grid;
  gap: 4px;
  left: 8px;
  line-height: 1.42;
  max-width: calc(100% - 16px);
  overflow: hidden;
  padding: 18px 24px 20px;
  pointer-events: none;
  position: absolute;
  right: 8px;
  top: 18px;
  z-index: 20;
}

.auth-field-overlay::before {
  background: linear-gradient(90deg, rgba(245, 198, 79, 0.96) 0%, rgba(13, 119, 119, 0.96) 100%);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.auth-field-overlay strong {
  color: var(--danger);
  font-size: 15px;
  font-weight: 900;
}

.auth-field-overlay-copy {
  display: grid;
  gap: 10px;
}

.auth-field-overlay-copy span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

@keyframes auth-field-overlay-dismiss {
  0%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
  }

  10%,
  82% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

.auth-link {
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-support-zone {
  display: grid;
  gap: 4px;
  padding: 2px 0;
}

.auth-support-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 34px;
}

.auth-support-label {
  background: #eef8f6;
  border: 1px solid #c7dcdc;
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  min-width: 72px;
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}

.auth-support-text {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  min-width: 0;
}

.auth-risk-text,
.auth-account-text,
.auth-feedback-text {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.auth-risk-text {
  color: #3d4854;
}

.auth-risk-text strong {
  color: var(--danger);
}

.auth-friendly-link-text,
.auth-friendly-link-text a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.auth-support-feedback {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  padding: 0;
  text-align: left;
  width: 100%;
}

.auth-support-feedback:hover .auth-support-label,
.auth-support-feedback:focus-visible .auth-support-label {
  background: #e3f3f1;
  border-color: #9dc8c6;
}

.auth-feedback-cta {
  align-items: stretch;
  border: 1px solid var(--accent);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 32px;
  overflow: hidden;
  white-space: nowrap;
}

.auth-feedback-action,
.auth-feedback-reward {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
}

.auth-feedback-action {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  padding: 8px 13px;
}

.auth-feedback-reward {
  background: #fff3d8;
  color: #b65f00;
  font-size: 13px;
  padding: 8px 11px;
}

.site-message-modal[hidden],
.feedback-success[hidden],
.feedback-form-panel[hidden] {
  display: none;
}

.site-message-modal {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  overflow: hidden;
  padding: clamp(16px, 4vh, 32px);
  position: fixed;
  z-index: 2000;
}

body.modal-open {
  overflow: hidden;
}

.site-message-backdrop {
  background: rgba(15, 23, 42, 0.46);
  inset: 0;
  position: absolute;
}

.site-message-dialog {
  background: var(--surface);
  border: 1px solid rgba(17, 122, 122, 0.2);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 64px);
  max-width: min(720px, calc(100vw - 40px));
  overflow-y: auto;
  padding: 40px 44px;
  position: relative;
  width: 100%;
}

.site-message-kicker {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.site-message-dialog h2 {
  color: var(--text);
  font-size: 34px;
  line-height: 1.25;
}

.site-message-dialog p {
  color: var(--text);
  font-size: 18px;
  line-height: 1.85;
  white-space: pre-line;
}

.site-message-actions,
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.feedback-dialog {
  max-width: min(640px, calc(100vw - 32px));
}

.feedback-form,
.feedback-form-panel,
.feedback-success {
  display: grid;
  gap: 14px;
}

.feedback-type-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feedback-type-options label {
  cursor: pointer;
}

.feedback-type-options input {
  position: absolute;
  opacity: 0;
}

.feedback-type-options span {
  align-items: center;
  background: #f7fbfb;
  border: 1px solid #c9dddc;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
}

.feedback-type-options input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.feedback-field {
  color: var(--text);
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 7px;
}

.feedback-field input,
.feedback-field textarea {
  font-size: 15px;
  padding: 9px 10px;
  width: 100%;
}

.feedback-field textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-trap {
  display: none;
}

.feedback-helper,
.feedback-status,
.feedback-success-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.feedback-status.is-error {
  color: var(--danger);
}

.feedback-image-list {
  display: grid;
  gap: 8px;
}

.feedback-image-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e0e7ef;
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
}

@media (min-width: 900px) {
  .auth-login-page .auth-shell {
    padding: 42px;
  }

  .auth-login-page .auth-stage {
    gap: 33px;
    grid-template-columns: minmax(0, 780px) minmax(360px, 450px);
    max-width: 1263px;
  }

  .auth-login-page .auth-panel {
    gap: 33px;
    max-width: 780px;
    padding: 54px;
  }

  .auth-login-page .auth-brand .brand-logo {
    flex-basis: 84px;
    height: 84px;
    width: 84px;
  }

  .auth-login-page .auth-brand h1 {
    font-size: 51px;
  }

  .auth-login-page .auth-form {
    gap: 27px;
  }

  .auth-login-page .auth-form label {
    font-size: 18px;
    gap: 12px;
  }

  .auth-login-page .auth-form input {
    font-size: 20px;
    min-height: 72px;
  }

  .auth-login-page .auth-form button {
    font-size: 22px;
    min-height: 75px;
  }

  .auth-login-page .auth-turnstile {
    min-height: 72px;
  }

  .auth-login-page .auth-access-panel {
    gap: 27px;
    padding: 45px 39px;
  }

  .auth-login-page--redeem .auth-stage {
    grid-template-columns: minmax(0, 520px);
    justify-content: center;
    max-width: 520px;
  }

  .auth-login-page--redeem .auth-panel {
    gap: 18px;
    max-width: 520px;
    padding: 36px;
  }

  .auth-login-page--redeem .auth-form input {
    font-size: 16px;
    min-height: 48px;
  }

  .auth-login-page--redeem .auth-form button {
    font-size: 17px;
    min-height: 50px;
  }
}

@media (max-width: 899px) {
  .auth-stage {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }

  .auth-access-panel,
  .auth-login-side-float {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-panel {
    padding: 24px;
  }

  .auth-brand h1 {
    font-size: 28px;
  }

  .auth-support-row {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

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

  .site-message-dialog {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-merit-marquee-track,
  .auth-field-overlay {
    animation: none;
  }
}
