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

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --text: #ffffff;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
}

button {
  font-family: inherit;
}

.connect-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #6677ee 0%, #7744aa 100%);
}

.connect-card {
  width: min(420px, 90vw);
  padding: 50px 40px;
  text-align: center;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  animation: fade-rise 0.5s ease both;
}

.connect-card h1 {
  color: #1a1a2e;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.3;
  margin-bottom: 12px;
}

.connect-card p {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.connect-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top-color: #6677ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

.progress-track {
  width: 100%;
  height: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #e9ecef;
  border-radius: 3px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6677ee, #7744aa);
  animation: progress-grow 1.2s ease-out forwards;
}

.domain-box {
  padding: 10px 16px;
  color: #495057;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
  background: #f8f9fa;
  border-radius: 8px;
}

.security-page {
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #1a0d3d 0%, #2d1b69 25%, #4a2c8a 50%, #6b46c1 75%, #8b5cf6 100%);
}

.security-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.2) 0%, transparent 50%);
}

.security-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
}

.security-content {
  width: min(500px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  animation: fade-rise 0.8s ease both;
}

.security-content h1 {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.security-content p {
  margin-top: -10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.shield-stage {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-svg {
  position: relative;
  z-index: 3;
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.4));
  animation: shield-pulse 3s ease-in-out infinite;
}

.shield-svg rect {
  fill: rgba(255, 255, 255, 0.82);
  animation: line-pulse 2s ease-in-out infinite;
}

.shield-svg rect:nth-of-type(2) {
  animation-delay: 0.2s;
}

.shield-svg rect:nth-of-type(3) {
  animation-delay: 0.4s;
}

.shield-svg rect:nth-of-type(4) {
  animation-delay: 0.6s;
}

.scan-ring {
  position: absolute;
  border: 2px solid rgba(139, 92, 246, 0.46);
  border-radius: 50%;
  animation: scan-pulse 3s ease-out infinite;
}

.ring-one {
  width: 100px;
  height: 100px;
}

.ring-two {
  width: 140px;
  height: 140px;
  animation-delay: 0.5s;
}

.ring-three {
  width: 180px;
  height: 180px;
  animation-delay: 1s;
}

.security-status {
  font-size: 18px;
  font-weight: 550;
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  animation: text-pulse 2s ease-in-out infinite;
}

.verify-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #1f2937;
  background: #ffffff;
}

.verify-card {
  width: min(420px, 90vw);
  padding: 48px 32px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.verify-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 16px;
}

.verify-icon svg {
  width: 36px;
  height: 36px;
  fill: #ffffff;
}

.verify-card h1 {
  margin-bottom: 8px;
  color: #111827;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.3;
}

.verify-card p {
  margin-bottom: 32px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.verify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 164px;
  min-height: 58px;
  padding: 16px 32px;
  color: #374151;
  font-size: 15px;
  line-height: 1.2;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.verify-button:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.verify-button:active {
  transform: scale(0.98);
}

.verify-button[disabled] {
  cursor: default;
  pointer-events: none;
}

.verify-button-icon {
  display: none;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.verify-button-icon.show {
  display: inline-flex;
}

.mini-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.success-dot {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

  background: #10b981;
}

.success-dot::before {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: rotate(-45deg) translateY(-1px);
}

.verify-message {
  min-height: 20px;
  margin-top: 16px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.verify-message.success {
  color: #059669;
}

.landing-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #160816;
}

.union-stage {
  position: relative;
  width: min(100vw, calc(100vh * 946 / 2048));
  height: min(100vh, calc(100vw * 2048 / 946));
  width: min(100vw, calc(100dvh * 946 / 2048));
  height: min(100dvh, calc(100vw * 2048 / 946));
  margin: 0 auto;
  background: #2a1010;
  box-shadow: 0 0 46px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.union-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
}

.union-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.union-hotspot {
  position: absolute;
  left: 5%;
  width: 90%;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: rgba(255, 219, 120, 0.16);
}

.union-hotspot:focus-visible {
  outline: 3px solid rgba(255, 238, 150, 0.9);
  outline-offset: 3px;
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes progress-grow {
  0% { width: 0; }
  50% { width: 60%; }
  80% { width: 85%; }
  100% { width: 95%; }
}

@keyframes shield-pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.4));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 20px rgba(139, 92, 246, 0.6));
  }
}

@keyframes line-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@keyframes scan-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
    border-color: rgba(139, 92, 246, 0.8);
  }
  50% {
    transform: scale(1.2);
    opacity: 0.4;
    border-color: rgba(168, 85, 247, 0.6);
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
    border-color: rgba(196, 181, 253, 0.2);
  }
}

@keyframes text-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .connect-card {
    padding: 42px 30px;
  }

  .security-content {
    gap: 25px;
  }

  .security-content h1 {
    font-size: 20px;
  }

  .security-content p {
    font-size: 14px;
  }

  .shield-stage {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 520px) {
  .connect-page,
  .verify-page {
    padding: 16px;
  }

  .connect-card {
    padding: 40px 26px;
  }

  .connect-card h1 {
    font-size: 20px;
  }

  .verify-card {
    padding: 42px 24px;
  }

  .security-content h1 {
    font-size: 18px;
  }

  .security-status {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
