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

:root {
  --text: #fff;
  --text-dim: rgba(255,255,255,0.7);
  --overlay: rgba(0,0,0,0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  height: 100vh;
  background: #000;
}

.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: center/cover no-repeat;
  z-index: -1;
}

.bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
}

.page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s, transform 0.6s;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  padding: 20px;
}

.page.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.home {
  color: white;
  text-align: center;
  flex-direction: column;
  gap: 24px;
}

.home-avatar {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-title {
  font-size: 42px;
  font-weight: 300;
  letter-spacing: -1px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.home-subtitle {
  font-size: 18px;
  opacity: 0.8;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}

.home-desc {
  font-size: 16px;
  line-height: 1.8;
  opacity: 0.9;
  max-width: 500px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}

.btn {
  background: white;
  color: #1a1a1a;
  border: none;
  padding: 18px 56px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px rgba(0,0,0,0.4);
}

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

.quiz {
  color: var(--text);
}

.quiz-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-header {
  text-align: center;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 10px;
}

.quiz-progress {
  color: var(--text-dim);
  font-weight: 500;
}

.quiz-score {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}

.progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: white;
  transition: width 0.5s ease;
  border-radius: 2px;
}

.quiz-image {
  width: 100%;
  aspect-ratio: 1/1;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.quiz-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.2);
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  text-align: left;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.option:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

.option.selected {
  background: rgba(255,255,255,0.3);
  border-color: white;
}

.option-letter {
  font-weight: 700;
  font-size: 16px;
  min-width: 22px;
}

.option.correct {
  background: rgba(76,175,80,0.4);
  border-color: #4caf50;
}

.option.wrong {
  background: rgba(244,67,54,0.4);
  border-color: #f44336;
}

.confirm-btn {
  width: 100%;
  background: white;
  color: #1a1a1a;
  border: none;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(0,0,0,0.4);
}

.confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 24px;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: rgba(30,30,30,0.95);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  transform: scale(0.9);
  transition: transform 0.3s;
  border: 1px solid rgba(255,255,255,0.1);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-text {
  line-height: 1.8;
  color: rgba(255,255,255,0.9);
  font-size: 16px;
  min-height: 60px;
  margin-bottom: 28px;
}

.modal-content .btn {
  display: block;
  margin: 0 auto;
  padding: 10px 32px;
  font-size: 15px;
}

.modal-text .cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: white;
  margin-left: 2px;
  animation: blink 0.8s infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.success-overlay,
.fail-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
}

.success-overlay img,
.fail-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.success-overlay.active {
  animation: overlayAnim 2s ease;
}

.fail-overlay.active {
  animation: overlayAnim 1.2s ease;
}

@keyframes overlayAnim {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.result {
  color: var(--text);
  text-align: center;
}

.result-content {
  max-width: 600px;
  animation: fadeInUp 1s ease;
}

.result h2 {
  font-size: 48px;
  font-weight: 300;
  margin-bottom: 30px;
  letter-spacing: -1px;
}

.result-score {
  font-size: 80px;
  font-weight: 700;
  margin: 20px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result h3 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.6;
  margin: 30px 0;
  color: var(--text);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .home { gap: 16px; }
  .home-avatar { width: 180px; height: 180px; }
  .home-title { font-size: 28px; }
  .home-subtitle { font-size: 13px; }
  .home-desc { font-size: 14px; }

  .quiz {
    align-items: flex-start;
    overflow-y: auto;
    padding: 16px;
  }
  .quiz-container { gap: 12px; }
  .quiz-image { max-height: 50vw; aspect-ratio: 1/1; }
  .quiz-options { grid-template-columns: 1fr; gap: 8px; }
  .option { padding: 10px 12px; font-size: 13px; }
  .confirm-btn { padding: 12px; font-size: 15px; }

  .modal-content { padding: 24px; }
  .modal-text { font-size: 14px; margin-bottom: 20px; }

  .result h2 { font-size: 32px; margin-bottom: 16px; }
  .result-score { font-size: 56px; }
  .result h3 { font-size: 18px; margin: 20px 0; }
}
