/* =================== 基础 & 背景 =================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* =================== 背景装饰动画 =================== */
.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: floatShape 12s ease-in-out infinite;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: #e74c3c;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 350px;
  height: 350px;
  background: #8e44ad;
  bottom: -80px;
  right: -80px;
  animation-delay: -4s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: #3498db;
  top: 50%;
  left: 60%;
  animation-delay: -8s;
}

@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.1); }
  66%      { transform: translate(-40px, 30px) scale(0.9); }
}

/* =================== 主页面 Hero =================== */
.main-container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
  animation: fadeInDown 0.8s ease;
}

.hero p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 32px;
  animation: fadeInDown 0.8s ease 0.1s both;
}

.btn-open-modal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  margin: 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease 0.2s both;
  box-shadow: 0 8px 30px rgba(231, 76, 60, 0.3);
}

.btn-open-modal:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(231, 76, 60, 0.5);
}

.btn-open-modal.secondary {
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  box-shadow: 0 8px 30px rgba(142, 68, 173, 0.3);
  animation-delay: 0.3s;
}

.btn-open-modal.secondary:hover {
  box-shadow: 0 12px 40px rgba(142, 68, 173, 0.5);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =================== 弹窗遮罩 =================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* =================== 弹窗容器 =================== */
.modal-container {
  position: relative;
  width: 440px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

/* 滚动条美化 */
.modal-container::-webkit-scrollbar {
  width: 6px;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* =================== 关闭按钮 =================== */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* =================== 面板切换 =================== */
.modal-panel {
  display: none;
}

.modal-panel.active {
  display: block;
  animation: panelSlideIn 0.4s ease;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =================== 弹窗 Header =================== */
.modal-header {
  text-align: center;
  margin-bottom: 30px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.modal-icon.register-icon {
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  box-shadow: 0 8px 25px rgba(142, 68, 173, 0.3);
}

.modal-icon.success-icon {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.modal-header h2 {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-header p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
}

/* =================== 表单 =================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group label i {
  margin-right: 6px;
  opacity: 0.6;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.form-group input:focus {
  border-color: #e74c3c;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* =================== 密码可见切换 =================== */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 44px !important;
}

.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.2s;
}

.toggle-pw:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* =================== 密码强度 =================== */
.password-strength {
  margin-top: 8px;
  display: flex;
  gap: 4px;
}

.password-strength .bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s;
}

.password-strength .bar.weak   { background: #e74c3c; }
.password-strength .bar.medium { background: #f39c12; }
.password-strength .bar.strong { background: #27ae60; }

/* =================== 密码匹配指示 =================== */
.match-indicator {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.match-indicator.match {
  color: #27ae60;
}

.match-indicator.mismatch {
  color: #e74c3c;
}

/* =================== 错误提示 =================== */
.error-msg {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: #e74c3c;
  min-height: 1.2em;
}

/* =================== 性别选择 =================== */
.gender-group {
  display: flex;
  gap: 12px;
}

.gender-option {
  flex: 1;
  cursor: pointer;
}

.gender-option input {
  display: none;
}

.gender-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.gender-option input:checked + .gender-label {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
  color: #fff;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.gender-label:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

/* 自定义性别输入 */
.custom-gender-wrapper input {
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s;
}

.custom-gender-wrapper input:focus {
  border-color: #8e44ad;
  box-shadow: 0 0 0 3px rgba(142,68,173,0.15);
}

.custom-gender-wrapper input::placeholder {
  color: rgba(255,255,255,0.25);
  font-size: 0.82rem;
}

/* =================== 提交按钮 =================== */
.btn-submit {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(231, 76, 60, 0.5);
}

.btn-submit:active {
  transform: translateY(0);
}

.register-submit {
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  box-shadow: 0 6px 20px rgba(142, 68, 173, 0.3);
}

.register-submit:hover {
  box-shadow: 0 10px 30px rgba(142, 68, 173, 0.5);
}

/* =================== 底部链接 =================== */
.modal-footer {
  text-align: center;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.modal-footer a {
  color: #e74c3c;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.modal-footer a:hover {
  color: #ff6b6b;
}

/* =================== Toast 提示 =================== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: rgba(39, 174, 96, 0.5);
  box-shadow: 0 8px 30px rgba(39, 174, 96, 0.3);
}

.toast.error {
  border-color: rgba(231, 76, 60, 0.5);
  box-shadow: 0 8px 30px rgba(231, 76, 60, 0.3);
}

/* =================== 人机验证弹窗 =================== */

#verifyOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: hidden;
}

#verifyOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

.verify-modal {
  position: relative;
  width: 420px;
  max-width: 90vw;
  background: rgba(20, 20, 40, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 36px 30px 30px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: translateX(var(--vm-x, 0px));
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.verify-modal.shake {
  animation: vmShake 0.4s ease;
}

@keyframes vmShake {
  0%,100% { transform: translateX(var(--vm-x, 0px)); }
  20%     { transform: translateX(calc(var(--vm-x, 0px) - 8px)); }
  40%     { transform: translateX(calc(var(--vm-x, 0px) + 8px)); }
  60%     { transform: translateX(calc(var(--vm-x, 0px) - 6px)); }
  80%     { transform: translateX(calc(var(--vm-x, 0px) + 6px)); }
}

.verify-header {
  text-align: center;
  margin-bottom: 24px;
}

.verify-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
}

.verify-header h2 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.verify-prompt {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
}

.verify-prompt .not-human {
  color: #e74c3c;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =================== 滑动条 =================== */

.slider-container {
  position: relative;
  margin: 8px 0 16px;
}

.slider-track {
  position: relative;
  height: 48px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  border-radius: 24px;
  transition: width 0.05s linear;
}

.slider-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 48px;
  background: #fff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  z-index: 2;
  transition: background 0.2s;
}

.slider-thumb:active {
  cursor: grabbing;
  background: #f0f0f0;
}

.slider-thumb i {
  color: #27ae60;
  font-size: 1.1rem;
}

.slider-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}

.slider-track.success .slider-fill {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.slider-track.success .slider-thumb {
  background: #27ae60;
}

.slider-track.success .slider-thumb i {
  color: #fff;
}

/* =================== 验证状态 =================== */

.verify-status {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  min-height: 1.5em;
  margin-bottom: 4px;
}

.verify-status.fail {
  color: #e74c3c;
}

.verify-status.success {
  color: #27ae60;
  font-weight: 600;
}

.verify-counter {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  min-height: 1.2em;
}
