:root {
  --bg-start: #edf3ff;
  --bg-end: #f7faff;
  --card-bg: #ffffff;
  --primary-start: #4f7cff;
  --primary-end: #7465ff;
  --text-main: #1d2840;
  --text-sub: #6d7894;
  --text-muted: #8b94ad;
  --danger: #dc4c64;
  --success: #25a45b;
  --shadow-soft: 0 18px 38px rgba(79, 125, 255, 0.14);
  --radius-2xl: 30px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --page-max-width: 460px;
  --banner-height: 160px;
  --card-padding: 18px 16px 18px;
  --control-height: 48px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 60%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.user-page {
  width: min(100%, var(--page-max-width));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 16px;
  gap: 10px;
}

.banner-wrap {
  padding: 0;
}

.banner-image,
.sign-banner {
  width: 100%;
  height: var(--banner-height);
  border-radius: var(--radius-xl);
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(69, 92, 176, 0.2);
}

.sign-banner {
  background: linear-gradient(135deg, #86adff, #7f87ff 50%, #72beff);
  color: #fff;
  padding: 18px 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.auth-banner-image {
  width: 100%;
  height: auto;
  max-height: 174px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: var(--radius-xl);
  background: #f7faff;
  box-shadow: 0 10px 24px rgba(69, 92, 176, 0.2);
}


.user-page-login {
  min-height: auto;
  padding-bottom: 10px;
}

.login-card {
  flex: 0;
}

.auth-banner-link {
  display: block;
  border-radius: var(--radius-xl);
}



.banner-wrap-clickable {
  cursor: pointer;
}

.auth-banner-link:focus-visible {
  outline: 3px solid rgba(79, 124, 255, 0.35);
  outline-offset: 2px;
}

.sign-banner::after {
  content: "";
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  position: absolute;
  right: -24px;
  top: -28px;
}

.sign-banner h1,
.sign-banner p {
  margin: 0;
  position: relative;
  z-index: 1;
}


.banner-title {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.banner-title h1 {
  width: 100%;
  margin: 0 0 18px 0;
  text-align: center;
}

.sign-banner h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.banner-copy {
  width: min(100%, 620px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.banner-line {
  width: 100%;
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: 0.01em;
  margin: 0;
}

.banner-line-rule {
  color: rgba(255, 255, 255, 0.84);
}

.card {
  margin-top: 0;
  border-radius: var(--radius-2xl);
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  border: 1px solid #e9efff;
  padding: var(--card-padding);
  flex: 1;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.3;
}

.card-subtitle {
  margin: 0 0 18px;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.5;
}

.notice {
  margin: 0 0 14px;
  font-size: 14px;
  border-radius: 14px;
  padding: 11px 12px;
  border: 1px solid transparent;
  line-height: 1.4;
}

.notice.success {
  background: rgba(37, 164, 91, 0.1);
  color: var(--success);
  border-color: rgba(37, 164, 91, 0.18);
}

.notice.error {
  background: rgba(220, 76, 100, 0.1);
  color: var(--danger);
  border-color: rgba(220, 76, 100, 0.18);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--text-sub);
}

input {
  width: 100%;
  height: var(--control-height);
  border: 1px solid #d7e4ff;
  border-radius: 14px;
  padding: 0 14px;
  outline: none;
  font-size: 15px;
  background: #fff;
  color: var(--text-main);
}

input::placeholder {
  color: #acb4ca;
}

input:focus {
  border-color: #7d9fff;
  box-shadow: 0 0 0 3px rgba(114, 104, 255, 0.14);
}

.btn {
  width: 100%;
  border: 0;
  min-height: var(--control-height);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  box-shadow: 0 10px 22px rgba(95, 107, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  margin-top: 12px;
}

.btn-secondary {
  border: 1px solid #d5e1ff;
  background: #f3f7ff;
  color: #3d5490;
  box-shadow: none;
}



.floating-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  min-width: 160px;
  max-width: min(88vw, 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(35, 46, 77, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 8px 22px rgba(15, 24, 46, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  z-index: 10001;
}

.floating-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.link-row {
  text-align: center;
  margin-top: 16px;
  color: var(--text-sub);
  font-size: 14px;
}

.link-row a {
  color: #5774ff;
  text-decoration: none;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.stat-item {
  min-height: 84px;
  background: #f6f9ff;
  border: 1px solid #e4edff;
  border-radius: var(--radius-lg);
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.2;
}

.user-meta {
  border-radius: var(--radius-lg);
  background: #f4f8ff;
  border: 1px solid #dee8ff;
  padding: 12px 14px;
  line-height: 1.6;
  color: #30456f;
  font-size: 14px;
  font-weight: 500;
}

.rule-block {
  margin: 0 0 16px;
  border-radius: 14px;
  border: 1px solid #e1eaff;
  background: #f8faff;
  padding: 12px 14px;
}

.rule-title {
  margin: 0 0 6px;
  font-size: 13px;
  color: #556991;
  font-weight: 600;
}

.rule-text {
  margin: 0;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.5;
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actions-stack form,
.actions-stack p {
  margin: 0;
}

.logout-form {
  margin-top: 0;
}

.lottery-entry-banner {
  display: block;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(69, 92, 176, 0.16);
  aspect-ratio: 2.85 / 1;
  margin: 0;
}

.lottery-entry-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.header-note {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

@media (min-width: 768px) {
  body {
    padding: 18px;
  }

  .user-page {
    width: min(100%, 500px);
    min-height: calc(100vh - 36px);
    padding: 0;
    gap: 12px;
  }
}


.page-loading-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #ffca72 0%, #e53a32 36%, #981b1e 100%);
  padding: 24px;
  overflow: hidden;
}

.page-loading-mask.is-visible {
  display: flex;
}

.red-envelope-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.red-envelope {
  position: absolute;
  top: -18%;
  width: 22px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff4343 0%, #cc1f1f 100%);
  box-shadow: 0 7px 14px rgba(126, 12, 12, 0.36);
  animation: red-envelope-fall linear infinite;
}

.red-envelope::before {
  content: "福";
  position: absolute;
  inset: 0;
  color: #ffd878;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes red-envelope-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(-22px, 120vh, 0) rotate(24deg);
  }
}

.page-loading-mask__content {
  position: relative;
  z-index: 1;
  border-radius: 18px;
  border: 1px solid rgba(255, 232, 173, 0.45);
  background: linear-gradient(180deg, rgba(161, 19, 20, 0.88) 0%, rgba(126, 12, 12, 0.9) 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  color: #fff4d0;
  line-height: 1.5;
  padding: 24px 22px 18px;
  text-align: center;
  width: min(100%, 360px);
}

.lottery-entry-banner.is-disabled {
  pointer-events: none;
  opacity: 0.9;
}

.page-loading-mask__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.page-loading-mask__subtitle {
  margin: 10px 0 0;
  color: rgba(255, 244, 208, 0.84);
  font-size: 14px;
}

.page-loading-mask__action {
  margin-top: 14px;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #9a1b18;
  background: linear-gradient(180deg, #ffe39a 0%, #ffc95a 100%);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.page-loading-mask__action.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.reward-toast-card {
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid #ffdca1;
  background: linear-gradient(135deg, #fff9e9 0%, #fff4d6 100%);
  box-shadow: 0 10px 22px rgba(239, 171, 58, 0.2);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.reward-toast-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reward-toast-card__title {
  margin: 0;
  color: #b45309;
  font-size: 16px;
  font-weight: 700;
}

.reward-toast-card__content {
  margin: 4px 0 0;
  color: #92400e;
  font-size: 14px;
}
