/* 页面基础 */
:root {
  --bg-start: #0b0122;
  --bg-end: #0e1f4d;
  --card-bg: rgba(18, 23, 56, 0.82);
  --text: #f3f4ff;
  --muted: rgba(243, 244, 255, 0.72);
  --accent: #5c6fff;
  --accent-2: #a05bff;
  --shadow: 0 24px 40px rgba(3, 13, 41, 0.55);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 18px;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 25% 20%, rgba(92, 111, 255, 0.5), transparent 45%),
    radial-gradient(circle at 75% 40%, rgba(160, 91, 255, 0.4), transparent 45%),
    linear-gradient(155deg, var(--bg-start), var(--bg-end));
  color: var(--text);
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.page {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(142deg, rgba(80, 96, 255, 0.22), rgba(158, 75, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 180ms ease;
  font-weight: 600;
}

.back-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(2, 5, 30, 0.32);
  background: linear-gradient(142deg, rgba(90, 113, 255, 0.35), rgba(222, 148, 255, 0.22));
}

.segment-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.segment-item {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(243, 244, 255, 0.6);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.segment-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.segment-item.active {
  background: linear-gradient(142deg, rgba(80, 96, 255, 0.4), rgba(158, 75, 255, 0.35));
  border: 1px solid rgba(92, 111, 255, 0.3);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(92, 111, 255, 0.2);
}



.scene {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(88, 120, 255, 0.35), transparent 54%),
    radial-gradient(circle at 70% 30%, rgba(162, 90, 255, 0.26), transparent 54%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.08), transparent 45%);
  filter: blur(24px);
  animation: drift 18s ease-in-out infinite;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(6px, -12px) scale(1.02);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

.cards-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1;
  padding: 20px 24px;
}

.test-card {
  position: relative;
  width: clamp(300px, 80vw, 1000px);
  height: clamp(400px, 80vh, 100%);
  padding: 42px 34px;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  overflow: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.test-card.hidden {
  display: none;
}

.test-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(88, 120, 255, 0.35), transparent 54%),
    radial-gradient(circle at 70% 30%, rgba(162, 90, 255, 0.26), transparent 54%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.08), transparent 45%);
  filter: blur(24px);
  opacity: 0.5;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.card-icon {
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(142deg, rgba(80, 96, 255, 0.35), rgba(158, 75, 255, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

.card-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.card-purpose {
  background: rgba(88, 120, 255, 0.12);
  padding: 20px;
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  position: relative;
  z-index: 2;
  flex-shrink: 1;
  min-height: 0;
}

.card-purpose-label {
  font-size: 0.8rem;
  color: rgba(243, 244, 255, 0.65);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.card-purpose-text {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

.card-qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: rgba(80, 96, 255, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(92, 111, 255, 0.2);
  position: relative;
  z-index: 2;
  flex-shrink: 1;
  min-height: 0;
}

.card-qrcode-label {
  font-size: 0.8rem;
  color: rgba(243, 244, 255, 0.65);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qrcode-img {
  width: 200px;
  height: 200px;
  background: white;
  padding: 8px;
  border-radius: 10px;
  border: 2px solid var(--border);
}

.card-link {
  font-size: 0.85rem;
  color: rgba(243, 244, 255, 0.75);
  word-break: break-all;
  font-family: "Courier New", monospace;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(92, 111, 255, 0.15);
  line-height: 1.5;
  position: relative;
  z-index: 2;
  flex-shrink: 1;
  min-height: 0;
  overflow-y: auto;
}

.card-link strong {
  color: var(--accent);
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.page-indicator {
  position: absolute;
  top: 20px;
  right: 24px;
  background: linear-gradient(142deg, rgba(80, 96, 255, 0.22), rgba(158, 75, 255, 0.18));
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  z-index: 20;
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(142deg, rgba(80, 96, 255, 0.22), rgba(158, 75, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: all 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  font-weight: 600;
}

.nav-button:hover:not(:disabled) {
  background: linear-gradient(142deg, rgba(90, 113, 255, 0.35), rgba(222, 148, 255, 0.22));
  box-shadow: 0 12px 28px rgba(92, 111, 255, 0.25);
  transform: translateY(-50%) scale(1.05);
}

.nav-button:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
}

.nav-button.prev {
  left: 24px;
}

.nav-button.next {
  right: 24px;
}

.nav-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn-download {
  background: linear-gradient(142deg, rgba(80, 96, 255, 0.4), rgba(158, 75, 255, 0.35));
  border: 1px solid rgba(92, 111, 255, 0.3);
  color: var(--text);
  flex: 1.5;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(92, 111, 255, 0.25);
  background: linear-gradient(142deg, rgba(90, 113, 255, 0.5), rgba(180, 95, 255, 0.4));
}

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

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  flex: 1;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-copy.copied {
  background: rgba(76, 175, 80, 0.3);
  border-color: rgba(76, 175, 80, 0.5);
  color: rgba(144, 238, 144, 0.9);
}

.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(243, 244, 255, 0.65);
  padding: 16px 24px;
  z-index: 5;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  background: rgba(11, 1, 34, 0.4);
  font-size: 0.85rem;
}

.footer-copyright {
  margin: 0;
  color: rgba(255, 107, 107, 0.75);
  font-weight: 500;
  margin-bottom: 6px;
}

.footer-contact {
  margin: 0;
  color: rgba(79, 127, 255, 0.8);
}

.footer-contact a {
  color: rgba(79, 127, 255, 1);
  text-decoration: none;
  font-weight: 600;
  transition: color 200ms ease;
}

.footer-contact a:hover {
  color: rgba(168, 85, 255, 1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .test-card {
    padding: 32px 20px;
  }

  .card-title {
    font-size: 1.4rem;
  }

  .qrcode-img {
    width: 160px;
    height: 160px;
  }

  .nav-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .page-indicator {
    font-size: 0.8rem;
    padding: 8px 14px;
  }

  .segment-item {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 16px;
  }

  .test-card {
    padding: 24px 18px;
    gap: 18px;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .card-purpose {
    padding: 14px 16px;
  }

  .card-qrcode {
    padding: 14px;
  }

  .qrcode-img {
    width: 140px;
    height: 140px;
  }

  .btn {
    font-size: 0.85rem;
    padding: 12px 14px;
  }

  .nav-button {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .nav-button.prev {
    left: 12px;
  }

  .nav-button.next {
    right: 12px;
  }

  .page-indicator {
    font-size: 0.75rem;
    padding: 6px 10px;
    top: 12px;
    right: 12px;
  }

  .footer {
    padding: 12px 16px;
    font-size: 0.75rem;
  }

  .cards-container {
    padding: 16px 12px;
  }

  .segment-control {
    gap: 2px;
    padding: 3px;
  }

  .segment-item {
    padding: 6px 8px;
    font-size: 0.65rem;
  }
}
