:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --primary: #f43f5e;
  --primary-2: #f97373;
  --primary-dark: #e11d48;
  --pink-50: #fff5f7;
  --pink-100: #ffeaf2;
  --pink-200: #ffe4ec;
  --pink-300: #fce7f3;
  --text-main: #3a2b33;
  --text-muted: #7f6b77;
  --border-soft: rgba(244, 63, 94, 0.08);
  --shadow-soft: 0 24px 70px rgba(244, 63, 94, 0.15);
}

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

body {
  min-height: 100vh;
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif);
  background: linear-gradient(180deg, #fff5f7, #ffeaf2);
  color: var(--text-main);
  position: relative;
}

.page-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 164, 197, 0.35), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255, 212, 233, 0.4), transparent 45%),
    linear-gradient(180deg, #fff5f7, #ffeaf2);
  z-index: -1;
}

.app-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.main-card {
  width: 100%;
  max-width: 920px;
  background: #fff;
  border-radius: 24px;
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.main-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.view {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.45s ease;
}

.view.active {
  display: flex;
}

.hidden {
  display: none !important;
}

.welcome-view {
  gap: 32px;
}

.welcome-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.highlight-tag {
  display: inline-flex;
  align-self: center;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(255, 228, 236, 0.9);
  color: var(--primary);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-main);
}

.hero-subtitle {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 20px;
}

.feature-card {
  background: var(--pink-50);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 16px 40px rgba(244, 63, 94, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pink-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
}

.feature-title {
  font-weight: 600;
  font-size: 1.02rem;
}

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

.welcome-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.privacy-note {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--pink-200);
}

.primary-button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 16px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--primary-2), var(--primary));
  box-shadow: 0 15px 35px rgba(244, 63, 94, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  align-self: center;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.quiz-view {
  gap: 28px;
}

.quiz-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-progress-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--pink-300);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  transition: width 0.3s ease;
}

.question-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-text {
  font-size: 1.3rem;
  line-height: 1.7;
  font-weight: 600;
  color: var(--text-main);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-card {
  border: none;
  text-align: left;
  width: 100%;
  border-radius: 18px;
  padding: 18px 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.option-card:hover {
  transform: translateY(-1px);
  background: var(--pink-50);
  box-shadow: 0 16px 35px rgba(244, 63, 94, 0.12);
}

.option-card.selected {
  background: var(--pink-200);
  box-shadow: 0 18px 38px rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.option-label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pink-300);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0;
}

.option-label::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  transition: background 0.2s ease, transform 0.2s ease;
}

.option-card.selected .option-label {
  background: var(--primary);
}

.option-card.selected .option-label::after {
  background: #fff;
  transform: scale(1.1);
}

.option-content {
  flex: 1;
  line-height: 1.6;
  color: var(--text-main);
}

.quiz-actions {
  display: flex;
  justify-content: flex-start;
}

.text-button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}

.text-button:disabled {
  color: rgba(244, 63, 94, 0.3);
  cursor: not-allowed;
}

.result-view {
  gap: 28px;
}

.result-summary-card {
  background: linear-gradient(160deg, #ffeaf2, #fff5f7);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.result-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 20px 35px rgba(244, 63, 94, 0.2);
}

.result-score-number {
  font-size: clamp(3rem, 6vw, 3.8rem);
  font-weight: 700;
  color: var(--primary-dark);
}

.result-score-caption {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.result-level-label {
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.15);
  color: var(--primary-dark);
  font-weight: 600;
}

.score-scale {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.score-scale-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--pink-300);
  position: relative;
  overflow: visible;
}

.score-scale-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
}

.score-scale-thumb {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.2);
}

.result-section,
.advice-section {
  background: var(--pink-50);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(244, 63, 94, 0.15);
  box-shadow: 0 12px 28px rgba(244, 63, 94, 0.08);
}

.result-section {
  border-left: 5px solid rgba(244, 63, 94, 0.4);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.result-description,
.advice-section p {
  line-height: 1.8;
  color: var(--text-main);
}

.advice-section {
  position: relative;
}

.advice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.advice-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.9rem;
}

.disclaimer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 768px) {
  .app-wrapper {
    padding: 32px 12px;
  }

  .main-card {
    border-radius: 20px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .question-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 520px) {
  .main-card {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .welcome-hero {
    gap: 12px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .feature-card {
    padding: 16px;
  }

  .privacy-note {
    font-size: 0.85rem;
    padding: 10px 14px;
  }

  .primary-button {
    width: 100%;
    padding: 14px 20px;
  }

  .option-card {
    padding: 16px 16px;
    gap: 12px;
  }

  .option-label {
    width: 28px;
    height: 28px;
  }

  .result-summary-card {
    padding: 24px;
  }

  .score-scale-labels {
    font-size: 0.82rem;
  }

  .question-progress-text {
    font-size: 0.85rem;
  }
}

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