*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #c41e24;
  --primary-dark: #9a1519;
  --gold: #f5d76e;
  --gold-light: #fff3c4;
  --text: #2c1810;
  --text-light: #6b5344;
  --white: #ffffff;
  --shadow: rgba(120, 30, 30, 0.25);
}

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #1a0505;
}

.poster {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.poster-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 215, 110, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(196, 30, 36, 0.4) 0%, transparent 50%),
    linear-gradient(165deg, #8b1015 0%, #c41e24 35%, #9a1519 70%, #5c0a0d 100%);
  z-index: 0;
}

.poster-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.02) 20px,
      rgba(255, 255, 255, 0.02) 40px
    );
}

.poster-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.poster-header {
  text-align: center;
  color: var(--white);
  margin-bottom: 28px;
}

.badge {
  display: inline-block;
  padding: 6px 18px;
  background: linear-gradient(135deg, var(--gold) 0%, #e8b923 100%);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.subtitle {
  font-size: 14px;
  opacity: 0.9;
  letter-spacing: 1px;
}

.register-form {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow:
    0 8px 32px var(--shadow),
    0 0 0 1px rgba(245, 215, 110, 0.3);
  backdrop-filter: blur(8px);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-group label::before {
  content: "• ";
  color: var(--primary);
}

.form-group select,
.form-group input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #faf8f5;
  border: 1.5px solid #e8ddd0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c41e24' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group select:focus,
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 36, 0.12);
}

.submit-btn {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(196, 30, 36, 0.4);
  transition: transform 0.15s, opacity 0.15s;
}

.submit-btn:active {
  transform: scale(0.98);
}

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

.poster-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px 32px;
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  font-size: 28px;
  font-weight: bold;
  line-height: 56px;
  border-radius: 50%;
}

.modal-header h2 {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-tip {
  font-size: 14px;
  color: var(--text-light);
}

.steps-list {
  list-style: none;
  counter-reset: step;
  margin-bottom: 24px;
}

.steps-list li {
  counter-increment: step;
  position: relative;
  padding: 12px 12px 12px 44px;
  margin-bottom: 10px;
  background: #fdf6f0;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 24px;
  border-radius: 50%;
}

.qrcode-section {
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, #fff9f0 0%, #fff 100%);
  border-radius: 12px;
  border: 1px dashed #e8c870;
  margin-bottom: 20px;
}

.qrcode-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.qrcode-wrap {
  display: inline-block;
  padding: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.qrcode-img {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.qrcode-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-light);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-link-btn {
  display: block;
  height: 46px;
  line-height: 46px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  background: var(--gold-light);
  border-radius: 10px;
  text-decoration: none;
}

.quiz-link-btn.hidden {
  display: none;
}

.close-btn {
  height: 46px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  padding: 14px 24px;
  background: rgba(0, 0, 0, 0.78);
  color: white;
  font-size: 14px;
  border-radius: 8px;
  max-width: 80%;
  text-align: center;
}

.toast.hidden {
  display: none;
}

@media (min-width: 481px) {
  .modal {
    align-items: center;
  }

  .modal-panel {
    border-radius: 20px;
    margin: 20px;
  }
}
