/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* 页面切换 */
.page {
  display: none;
  min-height: 100vh;
  padding: 20px;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ===== 首页 ===== */
.home-container {
  text-align: center;
  color: white;
}

.home-emoji {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.home-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.home-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.home-desc {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.8;
  margin-bottom: 40px;
}

.btn-start {
  background: white;
  color: #764ba2;
  border: none;
  padding: 16px 60px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

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

.home-hint {
  margin-top: 20px;
  font-size: 13px;
  opacity: 0.7;
}

/* ===== 答题页 ===== */
#page-question {
  align-items: flex-start;
  padding-top: 40px;
}

.question-container {
  width: 100%;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.progress-text {
  text-align: center;
  color: white;
  font-size: 14px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.question-card {
  background: white;
  border-radius: 20px;
  padding: 30px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease;
}

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

.question-number {
  font-size: 13px;
  color: #999;
  margin-bottom: 16px;
}

.question-text {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 30px;
  line-height: 1.5;
}

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

.option-btn {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  line-height: 1.5;
}

.option-btn:hover {
  border-color: #764ba2;
  background: #f3eef8;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.selected {
  border-color: #764ba2;
  background: linear-gradient(135deg, #667eea22, #764ba222);
  color: #764ba2;
  font-weight: 500;
}

/* ===== 结果页 ===== */
#page-result {
  align-items: flex-start;
  padding-top: 20px;
  padding-bottom: 40px;
}

.result-container {
  width: 100%;
}

.result-header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.result-emoji {
  font-size: 100px;
  margin-bottom: 10px;
  animation: popIn 0.5s ease;
}

@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-name {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-type {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 12px;
}

.result-traits {
  font-size: 16px;
  opacity: 0.9;
}

.result-section {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.result-section h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
}

.result-section p {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
}

.tag-list.warning .tag {
  background: #fff3e0;
  color: #e65100;
}

.tag-list.career .tag {
  background: #e3f2fd;
  color: #1565c0;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-restart, .btn-share {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-restart {
  background: white;
  color: #764ba2;
}

.btn-share {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
}

.btn-restart:hover, .btn-share:hover {
  transform: translateY(-2px);
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 移动端适配 */
@media (max-width: 360px) {
  .home-title { font-size: 28px; }
  .question-text { font-size: 18px; }
  .result-name { font-size: 26px; }
}
