/* === CSS Custom Properties === */
:root {
  --color-primary: #FF6B6B;
  --color-secondary: #FFA07A;
  --color-bg: #FFF5EE;
  --color-accent: #87CEEB;
  --color-text: #3D3D3D;
  --color-text-light: #999;
  --color-card-bg: #FFFFFF;
  --color-success: #4CAF50;
  --color-warning: #FFC107;
  --color-danger: #FF5252;
  --font-serif: Georgia, "STSong", "Noto Serif SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 12px;
  --max-width: 480px;
  --shadow: 0 2px 16px rgba(255, 107, 107, 0.12);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  line-height: 1.6;
}
#app { width: 100%; max-width: var(--max-width); min-height: 100vh; position: relative; }

/* === Stage Visibility === */
.stage { padding: 24px 20px; min-height: 100vh; }
.stage.hidden { display: none; }

/* === Fade Transition === */
.stage {
  animation: fadeIn 0.35s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Container === */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* === Typography === */
h1 { font-family: var(--font-serif); font-size: 28px; color: var(--color-primary); margin-bottom: 8px; }
h2 { font-family: var(--font-serif); font-size: 22px; color: var(--color-text); margin-bottom: 12px; }
.subtitle { color: var(--color-text-light); font-size: 15px; margin-bottom: 24px; line-height: 1.8; }

/* === Buttons === */
.btn-primary, .btn-secondary, .btn-nav {
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: var(--font-sans);
  width: 100%;
  margin-bottom: 10px;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--color-primary); border: 2px solid var(--color-secondary); }
.btn-nav { background: transparent; color: var(--color-text-light); padding: 10px 20px; width: auto; font-size: 14px; }
.btn-nav:disabled { opacity: 0.3; cursor: not-allowed; }

/* === Quiz Header === */
.quiz-header { width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-bar { flex: 1; height: 6px; background: rgba(255,107,107,0.15); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: 3px; transition: width 0.3s; width: 0%; }
.progress-num { font-size: 13px; color: var(--color-text-light); white-space: nowrap; min-width: 48px; text-align: right; }

/* === Dimension Tag === */
.dimension-tag {
  display: inline-block;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(255,160,122,0.2);
  color: var(--color-secondary);
  margin-bottom: 16px;
}

/* === Question === */
.question-text { font-size: 18px; margin-bottom: 8px; text-align: left; }
.scale-labels { width: 100%; display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-light); margin-bottom: 12px; }

/* === Options === */
.options-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; width: 100%; }
.option-circle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--color-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--color-secondary);
  cursor: pointer; transition: all 0.2s;
  background: #fff;
}
.option-circle:hover { border-color: var(--color-primary); color: var(--color-primary); }
.option-circle.selected { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* === Quiz Navigation === */
.quiz-nav { width: 100%; display: flex; justify-content: space-between; align-items: center; }

/* === Cards (share, invite, dimension) === */
.share-card, .invite-card, .dimension-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  width: 100%;
  margin-bottom: 16px;
}
.share-icon, .invite-icon, .hero-icon { font-size: 56px; margin-bottom: 16px; }
.link-box {
  background: #f5f5f5; border-radius: 8px;
  padding: 12px 16px; font-size: 13px; word-break: break-all;
  color: var(--color-text-light); margin-bottom: 16px; width: 100%;
}
.waiting-hint { font-size: 13px; color: var(--color-text-light); margin-top: 12px; }

/* === Report === */
.report-header { text-align: center; margin-bottom: 24px; }
.match-percent { font-size: 64px; font-weight: 700; color: var(--color-primary); font-family: var(--font-serif); }
.animal-label { font-size: 22px; margin-bottom: 8px; }
.animal-reason { font-size: 14px; color: var(--color-text-light); margin-bottom: 16px; }

/* === Radar Chart === */
#radar-canvas { max-width: 100%; height: auto; margin-bottom: 24px; }

/* === Dimension Cards === */
.dimension-cards { width: 100%; }
.dimension-card { text-align: left; }
.dimension-card h3 { font-size: 16px; margin-bottom: 4px; }
.dim-match { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.dim-match.high { color: var(--color-success); }
.dim-match.medium { color: var(--color-warning); }
.dim-match.low { color: var(--color-danger); }
.dim-text { font-size: 14px; color: var(--color-text-light); line-height: 1.7; }

/* === Strengths & Growth === */
.strengths-growth { width: 100%; display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.sg-column { background: var(--color-card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.sg-column h3 { font-size: 16px; margin-bottom: 12px; }
.sg-item { font-size: 14px; color: var(--color-text-light); margin-bottom: 8px; line-height: 1.6; }

/* === Suggestions === */
.suggestions { width: 100%; background: var(--color-card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 40px; }
.suggestions h3 { font-size: 17px; margin-bottom: 12px; }
.suggestion-item { font-size: 14px; color: var(--color-text-light); margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--color-accent); line-height: 1.6; }

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--color-text); color: #fff; padding: 10px 24px;
  border-radius: 20px; font-size: 14px; z-index: 100;
  animation: fadeIn 0.3s ease;
}
