/* x-ti 共享样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #fff0f5 0%, #fffbf0 50%, #fff5f0 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* 页面容器 */
.page {
  display: none;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px;
  text-align: center;
  animation: fadeIn 0.5s ease;
  min-height: 100vh;
  justify-content: center;
  flex-direction: column;
}
.page.active { display: flex; }

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

/* 首页 */
.home-title {
  font-size: 28px;
  font-weight: 700;
  color: #e8837c;
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.home-sub {
  font-size: 16px;
  color: #c49a9a;
  margin-bottom: 40px;
}
.emoji-deco { font-size: 48px; margin-bottom: 20px; }

/* 按钮 */
.btn, .btn-start, .btn-option, .btn-retry {
  background: linear-gradient(135deg, #ffb7b2, #ffdac1);
  border: none;
  border-radius: 50px;
  padding: 14px 40px;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255,183,178,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  display: inline-block;
}
.btn:active, .btn-start:active, .btn-option:active, .btn-retry:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(255,183,178,0.3);
}

/* 答题页 */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #fce4e4;
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb7b2, #ffa5a0);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 13px;
  color: #c49a9a;
  margin-bottom: 30px;
}
.question-text {
  font-size: 20px;
  color: #5a4a4a;
  line-height: 1.6;
  margin-bottom: 30px;
  font-weight: 500;
}
.options { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.btn-option {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  text-align: left;
  border-radius: 16px;
  background: #fff;
  color: #6b5a5a;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: 2px solid transparent;
}
.btn-option:active {
  transform: scale(0.96);
  border-color: #ffb7b2;
  background: #fff5f3;
}

/* 结果页 */
.result-card {
  background: #fff;
  border-radius: 24px;
  padding: 36px 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}
.result-card img {
  width: 100%;
  max-width: 280px;
  border-radius: 16px;
  display: block;
  margin: 0 auto 12px;
}
.result-title {
  font-size: 26px;
  font-weight: 700;
  color: #e8837c;
  margin-bottom: 16px;
}
.result-sub {
  font-size: 16px;
  color: #9a8a8a;
  line-height: 1.6;
  margin-bottom: 24px;
}
.result-image { margin-bottom: 16px; }
.result-voucher {
  font-size: 14px;
  color: #9a8a8a;
  line-height: 1.6;
  margin-top: 8px;
}

/* 撒花动画 */
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -20px;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.star {
  position: fixed;
  font-size: 20px;
  animation: starFloat 2s ease-out forwards;
  pointer-events: none;
  z-index: 998;
}
@keyframes starFloat {
  0% { transform: scale(0) rotate(0); opacity: 1; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

.result-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.btn-retry {
  background: linear-gradient(135deg, #ffb7b2, #ffdac1);
  display: inline-block;
}

/* Home buttons */
.home-actions { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.btn-secondary {
  background: #fff;
  border: 2px solid #ffb7b2;
  border-radius: 50px;
  padding: 12px 36px;
  font-size: 16px;
  color: #e8837c;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: transform 0.2s;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:active { transform: scale(0.95); }
