* {
  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;
  background: #10b981;
  border-radius: 50%;
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.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;
}

.line-select-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  background: radial-gradient(circle at 18% 10%, rgba(17, 38, 72, 0.58) 0, transparent 28%),
    radial-gradient(circle at 92% 2%, rgba(14, 80, 78, 0.46) 0, transparent 30%),
    linear-gradient(145deg, #0d1020 0%, #10141b 48%, #171318 100%);
}

.line-select-shell {
  width: min(430px, 100%);
}

.line-select-card {
  width: 100%;
  padding: 26px 18px 28px;
  color: #f4f4f1;
  background: rgba(30, 31, 33, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  animation: fade-rise 0.45s ease both;
}

.line-fastest,
.line-recommend,
.line-option,
.line-recheck {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.line-fastest {
  min-height: 92px;
  padding: 18px 18px 16px;
  color: #27d66a;
  background: rgba(26, 67, 42, 0.72);
  border: 1px solid rgba(45, 183, 89, 0.52);
  border-radius: 18px;
  box-shadow: inset 0 0 22px rgba(33, 155, 82, 0.18), 0 0 0 1px rgba(13, 54, 28, 0.5);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.line-fastest:hover,
.line-fastest:focus-visible {
  background: rgba(28, 82, 48, 0.82);
  border-color: rgba(58, 220, 111, 0.76);
  outline: none;
}

.line-fastest:active,
.line-recommend:active,
.line-option:active,
.line-recheck:active {
  transform: scale(0.985);
}

.line-fastest-title {
  display: block;
  margin-bottom: 12px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.line-fastest-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(216, 229, 221, 0.82);
  font-size: 15px;
  white-space: nowrap;
}

.line-fastest-meta em,
.line-option em,
.line-recommend i {
  display: inline-flex;
  min-width: 40px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  background: #ff3838;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(255, 44, 44, 0.48);
}

.line-fastest-meta strong {
  color: #35d673;
  font-size: 16px;
  font-weight: 800;
}

.line-fastest-meta b {
  color: #d7d7d7;
  font-weight: 600;
}

.line-dot {
  color: rgba(255, 255, 255, 0.35);
}

.line-warning,
.line-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 22px;
  color: #d6a338;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.line-warning span,
.line-section-title span {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(202, 138, 4, 0.55), transparent);
}

.line-warning strong,
.line-section-title strong {
  white-space: nowrap;
}

.line-recommend {
  display: grid;
  grid-template-columns: 32px 1fr auto auto auto;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: #f5f0df;
  text-align: left;
  background: rgba(83, 56, 23, 0.55);
  border: 1px solid rgba(161, 103, 28, 0.7);
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(181, 119, 32, 0.12);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.line-recommend:hover,
.line-recommend:focus-visible {
  background: rgba(96, 64, 25, 0.66);
  border-color: rgba(204, 139, 38, 0.86);
  outline: none;
}

.line-recommend strong {
  font-size: 17px;
}

.line-recommend em,
.line-recommend b,
.line-option b {
  display: inline-flex;
  min-width: 56px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: #f6d482;
  font-style: normal;
  font-size: 15px;
  font-weight: 800;
  background: rgba(126, 82, 25, 0.76);
  border-radius: 10px;
}

.line-section-title {
  margin: 30px 0 18px;
  color: rgba(255, 255, 255, 0.34);
}

.line-section-title span {
  background: rgba(255, 255, 255, 0.1);
}

.line-options {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.line-option {
  display: grid;
  grid-template-columns: 48px 32px minmax(0, 1fr) auto auto;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: #eee;
  text-align: left;
  background: rgba(58, 59, 61, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.line-option.active,
.line-option:hover,
.line-option:focus-visible {
  background: rgba(55, 65, 63, 0.72);
  border-color: rgba(37, 211, 102, 0.26);
  box-shadow: inset 0 0 16px rgba(28, 163, 83, 0.08);
  outline: none;
}

.line-rank {
  display: inline-flex;
  height: 30px;
  align-items: center;
  justify-content: center;
  color: #15e07c;
  font-size: 17px;
  font-weight: 900;
  background: rgba(16, 113, 68, 0.42);
  border-radius: 8px;
}

.line-flag {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.line-flag-asia {
  background: linear-gradient(135deg, #3b82f6, #5eead4);
}

.line-flag-taiwan {
  background: linear-gradient(135deg, #1d4ed8 0 48%, #ef4444 49% 100%);
}

.line-flag-macau {
  background: linear-gradient(135deg, #089981, #14b8a6);
}

.line-flag-hongkong {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.line-flag-mainland {
  background: linear-gradient(135deg, #ef4444, #ff6b00);
}

.line-name {
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-option b {
  min-width: 64px;
  color: #d8d8d8;
  background: rgba(94, 95, 98, 0.72);
}

.line-option.active b {
  color: #3ee07c;
  background: rgba(28, 103, 62, 0.54);
}

.line-recheck {
  height: 58px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 18px;
  font-weight: 700;
  background: rgba(56, 57, 59, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.line-recheck:hover,
.line-recheck:focus-visible {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(70, 71, 74, 0.58);
  border-color: rgba(255, 255, 255, 0.22);
  outline: none;
}

.line-status-text {
  display: none;
}

.line-options-refreshing .line-option {
  animation: line-refresh 0.28s ease both;
}

@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);
  }
}

@keyframes line-refresh {
  from {
    opacity: 0.65;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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;
  }

  .landing-page {
    align-items: stretch;
    justify-content: stretch;
  }

  .union-stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    box-shadow: none;
  }

  .line-select-page {
    padding: 14px;
  }

  .line-select-card {
    padding: 22px 14px 20px;
    border-radius: 22px;
  }

  .line-fastest {
    min-height: 86px;
    padding: 15px 12px 13px;
    border-radius: 16px;
  }

  .line-fastest-title {
    margin-bottom: 10px;
    font-size: 19px;
  }

  .line-fastest-meta {
    gap: 6px;
    font-size: 13px;
  }

  .line-warning,
  .line-section-title {
    gap: 8px;
    margin: 22px 0 18px;
    font-size: 14px;
  }

  .line-section-title {
    margin-top: 24px;
  }

  .line-recommend,
  .line-option {
    min-height: 56px;
    gap: 8px;
    padding: 10px 12px;
  }

  .line-recommend {
    grid-template-columns: 28px 1fr auto auto auto;
  }

  .line-option {
    grid-template-columns: 42px 28px minmax(0, 1fr) auto auto;
  }

  .line-rank {
    height: 28px;
    font-size: 15px;
  }

  .line-flag {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .line-name {
    font-size: 16px;
  }

  .line-fastest-meta em,
  .line-option em,
  .line-recommend i {
    min-width: 36px;
    height: 22px;
    font-size: 12px;
  }

  .line-recommend em,
  .line-recommend b,
  .line-option b {
    min-width: 54px;
    height: 26px;
    font-size: 14px;
  }

  .line-recheck {
    height: 54px;
    font-size: 17px;
  }
}

@media (min-width: 521px) and (max-height: 780px) {
  .line-select-page {
    align-items: flex-start;
  }

  .line-select-shell {
    max-width: 390px;
  }

  .line-select-card {
    padding: 18px 16px;
    border-radius: 22px;
  }

  .line-fastest {
    min-height: 78px;
    padding: 13px 12px;
  }

  .line-fastest-title {
    margin-bottom: 8px;
    font-size: 19px;
  }

  .line-warning,
  .line-section-title {
    margin: 18px 0 15px;
    font-size: 14px;
  }

  .line-section-title {
    margin-top: 18px;
  }

  .line-recommend,
  .line-option {
    min-height: 50px;
    padding: 8px 12px;
  }

  .line-options {
    gap: 8px;
    margin-bottom: 14px;
  }

  .line-recheck {
    height: 50px;
  }
}

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