:root {
  --glass-bg: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.35);
  --accent: #6fb3ff;
  --accent-deep: #2f7fe0;
  --text: #f3f8ff;
  --text-dim: rgba(243, 248, 255, 0.7);
  --danger: #ff7a8a;
  --success: #7ee0a8;
}

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

html, body {
  height: 100%;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  overflow: hidden;
}

/* 背景图 */
.bg-layer {
  position: fixed;
  inset: 0;
  background: url("assets/background.jpg") center center / cover no-repeat fixed;
  z-index: -2;
  transform: scale(1.05);
  animation: bgZoom 20s ease-in-out infinite alternate;
}

@keyframes bgZoom {
  from { transform: scale(1.05); }
  to   { transform: scale(1.14); }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(80, 140, 220, 0.15), transparent 60%),
    linear-gradient(180deg, rgba(20, 35, 60, 0.35), rgba(15, 25, 45, 0.55));
}

/* 弹窗卡片 */
.popup-card {
  position: relative;
  width: min(420px, 92vw);
  margin: 6vh auto;
  padding: 38px 34px 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 70px rgba(10, 25, 50, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: popIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 88vh;
  overflow-y: auto;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(120, 180, 255, 0.35), transparent 70%);
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}

/* 头部 */
.popup-header {
  text-align: center;
  margin-bottom: 28px;
}

.halo-icon {
  margin: 0 auto 8px;
  filter: drop-shadow(0 0 10px rgba(150, 200, 255, 0.7));
  animation: floaty 4s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.popup-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(60, 120, 200, 0.5);
}

.popup-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

/* 表单 */
.register-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  position: relative;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.field input::placeholder {
  color: rgba(220, 232, 250, 0.65);
}

.field input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(111, 179, 255, 0.25);
}

.toggle-pwd {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.toggle-pwd:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.2);
}

/* 提交按钮 */
.submit-btn {
  position: relative;
  margin-top: 6px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 3px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s, filter 0.25s;
  box-shadow: 0 10px 28px rgba(47, 127, 224, 0.4);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 14px 34px rgba(47, 127, 224, 0.55);
}

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

.submit-btn:disabled {
  cursor: wait;
  filter: brightness(0.85);
}

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 状态提示 */
.status-box {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 12px;
  text-align: center;
  animation: popIn 0.35s ease;
}

.status-box.success {
  color: #073a1f;
  background: rgba(126, 224, 168, 0.85);
  border: 1px solid rgba(126, 224, 168, 0.9);
}

.status-box.error {
  color: #3a0712;
  background: rgba(255, 122, 138, 0.85);
  border: 1px solid rgba(255, 122, 138, 0.9);
}

.status-box.info {
  color: #06243f;
  background: rgba(150, 195, 255, 0.85);
  border: 1px solid rgba(150, 195, 255, 0.9);
}

.popup-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* 响应式 */
@media (max-width: 480px) {
  .popup-card {
    padding: 30px 22px 22px;
    margin-top: 4vh;
  }
  .popup-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-layer, .halo-icon { animation: none; }
}
