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

:root {
  --neon-blue: #00f0ff;
  --neon-purple: #a855f7;
  --neon-pink: #ff0080;
  --dark-bg: #07131d;
  --card-bg: rgba(18, 22, 34, 0.82);
  --border-color: rgba(0, 240, 255, 0.3);
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--dark-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(0, 240, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gridMove {
  from { transform: translateY(0); }
  to { transform: translateY(50px); }
}

body::after {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.15) 0%, rgba(0, 240, 255, 0.1) 25%, transparent 50%);
  animation: rotate 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}

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

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(transparent, rgba(0, 240, 255, 0.05), transparent);
  animation: scan 4s linear infinite;
  pointer-events: none;
  z-index: 10;
}

@keyframes scan {
  from { transform: translateY(-100px); }
  to { transform: translateY(100vh); }
}

.container {
  max-width: 1000px;
  width: 100%;
  position: relative;
  z-index: 1;
}

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

.header h1 {
  font-size: clamp(40px, 7vw, 62px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
  letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.45);
}

.header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 19px;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 34px;
}

.nav-link {
  padding: 12px 26px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.28), transparent);
  transition: left 0.5s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
  left: 100%;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5), inset 0 0 20px rgba(0, 240, 255, 0.08);
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  margin-bottom: 42px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: 0 0 15px var(--neon-blue);
  position: relative;
}

.progress-fill::after,
.progress-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.steps-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}

.step-indicator {
  flex: 1;
  text-align: center;
}

.step-number {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 700;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.step-indicator.active .step-number {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 20px var(--neon-blue);
  background: rgba(0, 240, 255, 0.1);
}

.step-indicator.completed .step-number {
  border-color: var(--neon-purple);
  background: var(--neon-purple);
  color: white;
  box-shadow: 0 0 20px var(--neon-purple);
}

.step-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.step-indicator.active .step-label {
  color: var(--neon-blue);
  font-weight: 600;
}

.card-wrapper {
  perspective: 1500px;
  min-height: 450px;
  position: relative;
}

.query-wrapper {
  min-height: auto;
}

.card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 38px 46px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateX(100px) rotateY(20deg);
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.query-card {
  position: relative;
  opacity: 1;
  transform: none;
  pointer-events: all;
}

.card.active {
  opacity: 1;
  transform: translateX(0) rotateY(0);
  position: relative;
  pointer-events: all;
  animation: cardGlow 2.2s ease-in-out infinite alternate;
}

@keyframes cardGlow {
  from {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 20px rgba(0, 240, 255, 0.1);
  }
  to {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 40px rgba(168, 85, 247, 0.18);
  }
}

.card.exit-left {
  opacity: 0;
  transform: translateX(-100px) rotateY(-20deg);
}

.form-group {
  margin-bottom: 28px;
}

.form-group label {
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  font-size: 16px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: "Menlo", "Consolas", monospace;
}

.hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 8px;
  line-height: 1.6;
}

.hint a {
  color: var(--neon-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.hint a:hover {
  border-bottom-color: var(--neon-blue);
}

.buttons {
  display: flex;
  gap: 15px;
  margin-top: 36px;
}

.buttons-single {
  justify-content: center;
}

.btn {
  flex: 1;
  padding: 16px 24px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  position: relative;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 280px;
  height: 280px;
}

.btn span {
  position: relative;
  z-index: 2;
}

.btn-primary {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.58);
  transform: translateY(-2px);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.78);
}

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
  border-left: 4px solid;
}

.alert.show {
  display: block;
}

.alert-success {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

.alert-error {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fcd34d;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid var(--neon-blue);
  border-radius: 20px;
  color: var(--neon-blue);
  font-size: 14px;
  margin-top: 8px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.28);
}

.confirm-box {
  background: rgba(0, 0, 0, 0.42);
  padding: 24px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  margin-bottom: 22px;
}

.confirm-box h3 {
  color: var(--neon-blue);
  margin-bottom: 12px;
}

.confirm-box p {
  color: rgba(255, 255, 255, 0.84);
  margin-bottom: 10px;
}

.result-section {
  text-align: center;
  padding: 26px 14px;
}

.result-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
}

.result-icon.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
}

.result-icon.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
}

.result-icon.processing {
  background: rgba(0, 240, 255, 0.2);
  color: var(--neon-blue);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.45);
}

.result-title {
  font-size: 28px;
  margin-bottom: 12px;
  color: white;
}

.result-message {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.76);
  margin-bottom: 24px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 24px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--neon-blue);
  position: relative;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-box {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 34px;
  max-width: 450px;
  width: min(90vw, 450px);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.26);
}

.modal-icon {
  text-align: center;
  margin-bottom: 18px;
  font-size: 50px;
  color: var(--neon-purple);
}

.modal-title {
  font-size: 24px;
  color: white;
  text-align: center;
  margin-bottom: 12px;
}

.modal-message {
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  gap: 15px;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 34px;
  }

  .header p {
    font-size: 15px;
  }

  .card {
    padding: 26px 18px;
  }

  .buttons,
  .modal-buttons {
    flex-direction: column;
  }

  .steps-container {
    gap: 10px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .step-label {
    font-size: 12px;
  }
}
