/* ============ 弹层：预约弹窗 / 请求遮罩 / Toast / 返回顶部 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 75, 183, 0.22), transparent 20rem),
    radial-gradient(circle at 62% 58%, rgba(63, 231, 255, 0.2), transparent 28rem),
    rgba(5, 6, 13, 0.82);
  backdrop-filter: blur(10px);
}

.modal.open .modal-backdrop {
  animation: fadeIn 0.3s ease both;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: clamp(24px, 4vw, 36px);
  border: 2px solid rgba(63, 231, 255, 0.82);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(182, 255, 61, 0.1), transparent 22%),
    linear-gradient(155deg, rgba(31, 43, 227, 0.36), rgba(5, 6, 13, 0.96)),
    var(--panel-strong);
  box-shadow:
    8px 9px 0 rgba(255, 75, 183, 0.76),
    -7px -6px 0 rgba(182, 255, 61, 0.68),
    0 0 70px rgba(63, 231, 255, 0.28);
  clip-path: polygon(28px 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%, 0 28px);
  overflow: hidden;
}

.modal.open .modal-panel {
  animation: modalIn 0.55s cubic-bezier(0.18, 1.25, 0.4, 1) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(38px) scale(0.92) rotate(-1.2deg);
  }
}

.modal-panel::before,
.modal-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.modal-panel::before {
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 8px),
    linear-gradient(90deg, transparent, rgba(63, 231, 255, 0.14), transparent);
  opacity: 0.2;
}

.modal-panel::after {
  right: -44px;
  bottom: 28px;
  width: 170px;
  height: 36px;
  background: var(--lime);
  transform: rotate(-12deg);
  box-shadow: 0 0 28px rgba(182, 255, 61, 0.45);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(5, 6, 13, 0.72);
  color: var(--white);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.modal-close:hover {
  border-color: var(--magenta);
  color: var(--magenta);
  transform: translateY(-2px) rotate(90deg);
}

.modal-form,
.success-panel {
  position: relative;
  z-index: 1;
}

.modal-panel h2 {
  margin: 10px 0 12px;
  font-size: clamp(38px, 6vw, 58px);
}

.modal-kicker,
.modal-signal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-kicker span,
.modal-signal span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cyan);
  font-family: "Saira Condensed", "Noto Sans SC", sans-serif;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

.modal-kicker span {
  padding: 5px 12px;
  background: rgba(255, 75, 183, 0.12);
}

.modal-kicker span:last-child {
  color: #09100a;
  background: var(--lime);
  border-color: var(--lime);
}

.modal-signal {
  margin: 16px 0 18px;
}

.modal-signal span {
  flex: 1;
  min-width: 104px;
  padding: 8px 10px;
  text-align: center;
  color: var(--white);
  background: rgba(255, 255, 255, 0.055);
}

.modal-sub {
  color: var(--muted);
  line-height: 1.6;
}

.modal-sub strong {
  color: var(--lime);
}

.form-field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.form-field label {
  color: var(--lime);
  font-family: "Saira Condensed", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

#register-form input[type="tel"],
#register-form input[type="text"] {
  width: 100%;
  height: 54px;
  border: 2px solid rgba(63, 231, 255, 0.32);
  border-radius: 0;
  outline: 0;
  padding: 0 16px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(63, 231, 255, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.06);
  clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#register-form input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 24px rgba(182, 255, 61, 0.2);
  background:
    linear-gradient(90deg, rgba(182, 255, 61, 0.15), transparent 42%),
    rgba(255, 255, 255, 0.08);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 8px;
}

#get-code {
  border: 2px solid rgba(63, 231, 255, 0.46);
  border-radius: 0;
  background: rgba(5, 6, 13, 0.72);
  color: var(--cyan);
  cursor: pointer;
  font-weight: 900;
  padding: 0 12px;
  white-space: nowrap;
  clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#get-code:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--lime);
  background: rgba(182, 255, 61, 0.1);
}

#get-code:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.56);
  border-color: rgba(255, 255, 255, 0.16);
}

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.agree-row input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--lime);
}

.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--magenta);
  font-size: 13px;
  font-weight: 700;
}

.modal .submit-btn {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  border: 2px solid rgba(5, 6, 13, 0.92);
  border-radius: 0;
  background: linear-gradient(105deg, var(--lime), #f6ff5b 54%, var(--cyan));
  color: #071006;
  font-family: "Saira Condensed", "Noto Sans SC", sans-serif;
  font-size: 24px;
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.32);
  box-shadow:
    4px 5px 0 rgba(255, 75, 183, 0.86),
    0 0 26px rgba(182, 255, 61, 0.34);
  clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
}

.success-panel {
  text-align: center;
}

.success-mark {
  width: 70px;
  height: 70px;
  margin: 6px auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  box-shadow: 0 0 32px rgba(182, 255, 61, 0.38);
  animation: successPop 0.6s var(--ease-spring) both;
}

@keyframes successPop {
  from { transform: scale(0); }
}

.success-mark::after {
  content: "";
  display: block;
  width: 30px;
  height: 16px;
  border-left: 5px solid #071006;
  border-bottom: 5px solid #071006;
  transform: translate(20px, 22px) rotate(-45deg);
}

.success-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 110;
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(5, 6, 13, 0.8);
  color: var(--cyan);
  cursor: pointer;
  font-size: 22px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.back-top:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(63, 231, 255, 0.45);
  transform: translateY(-3px);
}

.back-top.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.request-mask {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 48%, rgba(63, 231, 255, 0.22), transparent 22rem),
    rgba(5, 6, 13, 0.58);
  backdrop-filter: blur(6px);
}

.request-mask.show {
  display: grid;
}

.request-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 16px 20px;
  border: 1px solid rgba(63, 231, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(182, 255, 61, 0.12), rgba(63, 231, 255, 0.1)),
    rgba(5, 6, 13, 0.92);
  color: var(--white);
  font-weight: 900;
  box-shadow:
    5px 6px 0 rgba(255, 75, 183, 0.64),
    0 0 36px rgba(63, 231, 255, 0.26);
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}

.request-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.78s linear infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 400;
  min-width: 220px;
  max-width: calc(100% - 36px);
  padding: 12px 18px;
  border: 1px solid rgba(63, 231, 255, 0.5);
  background:
    linear-gradient(90deg, rgba(63, 231, 255, 0.12), rgba(255, 75, 183, 0.08)),
    rgba(5, 6, 13, 0.92);
  color: var(--white);
  font-weight: 700;
  text-align: center;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  box-shadow: 4px 5px 0 rgba(255, 75, 183, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease-spring);
}

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