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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
  color: #0f172a;
  padding: 16px 0;
}

.card {
  width: min(94vw, 440px);
  min-height: 520px;
  padding: 36px 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  text-align: center;
  margin: 8px auto;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  animation: fade-in 0.3s ease both;
}

.hidden {
  display: none;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.main-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(120deg, #2563eb, #16a34a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 36px;
}

.btn-primary {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(120deg, #2563eb, #3b82f6);
  padding: 13px 40px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.38);
}

.btn-primary:active {
  transform: scale(0.97);
}

.quiz-header {
  width: 100%;
  margin-bottom: 32px;
}

.step {
  display: inline-block;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px;
}

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width 0.3s ease;
}

.question {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 34px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.option {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  padding: 15px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  transform: translateY(-2px);
}

/* 加载动画 */
.loader-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid #e2e8f0;
  border-top-color: #2563eb;
  border-right-color: #16a34a;
  border-bottom-color: #ef4444;
  animation: spin 0.8s linear infinite;
  margin-bottom: 28px;
}

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

.loading-text {
  font-size: 18px;
  letter-spacing: 2px;
  color: #334155;
}

.dots span {
  animation: blink 1.2s infinite;
  display: inline-block;
}

.dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}

/* 结果页 */
.result-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #0f172a;
  margin-bottom: 24px;
}

.result-img-wrap {
  width: 100%;
  max-width: 300px;
  height: 320px;
  border: 3px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  margin-bottom: 28px;
  transition: border-color 0.3s ease;
}

.result-img-wrap.result-father {
  border-color: #2563eb;
}

.result-img-wrap.result-mother {
  border-color: #ef4444;
}

.result-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 右下角水印 */
.watermark {
  position: fixed;
  right: 10px;
  bottom: 8px;
  font-size: 13px;
  color: #94a3b8;
  user-select: none;
  z-index: 10;
}

/* 手机端适配 */
@media (max-width: 480px) {
  body {
    padding: 16px 0;
  }

  .card {
    padding: 32px 20px;
  }

  .main-title {
    font-size: 32px;
  }

  .subtitle {
    font-size: 14px;
  }

  .question {
    font-size: 19px;
  }

  .result-title {
    font-size: 24px;
  }

  .result-img-wrap {
    height: min(52vh, 300px);
  }
}
