/* 地震安全小课堂 — 全站样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* 顶部标题栏 */
.header {
  text-align: center;
  margin: 20px 0 30px;
}
.header h1 {
  font-size: 2rem;
  color: #f97316;
  text-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.header .score-bar {
  margin-top: 10px;
  font-size: 1.1rem;
  color: #ccc;
}
.header .score-bar span { color: #fbbf24; font-weight: bold; }

/* 卡片网格 (首页用) */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 900px;
  width: 100%;
}
.card {
  background: #16213e;
  border: 2px solid #0f3460;
  border-radius: 16px;
  padding: 24px;
  width: 200px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  text-decoration: none;
  color: #eee;
}
.card:hover {
  transform: translateY(-6px);
  border-color: #f97316;
}
.card .icon { font-size: 3rem; margin-bottom: 12px; }
.card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.card p { font-size: 0.85rem; color: #999; }

/* 通用游戏区域 */
.game-area {
  background: #16213e;
  border-radius: 16px;
  padding: 30px;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}
.game-area h2 { color: #f97316; margin-bottom: 20px; }

/* 场景图片（纯 CSS 绘制模拟场景） */
.scene {
  position: relative;
  width: 100%;
  height: 280px;
  background: #2d2d5e;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.scene .floor { 
  position: absolute; bottom: 0; left: 0; right: 0; 
  height: 40px; background: #4a4a7a; 
}
.scene .wall { 
  position: absolute; top: 0; left: 0; right: 0; bottom: 40px;
  background: linear-gradient(180deg, #3a3a6a 0%, #2d2d5e 100%);
}

/* 场景里的家具（可点击的躲藏点） */
.spot {
  position: absolute;
  border: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(255,255,255,0.08);
}
.spot:hover { border-color: #fbbf24; transform: scale(1.05); }
.spot.wrong { border-color: #ef4444; background: rgba(239,68,68,0.2); }
.spot.correct { border-color: #22c55e; background: rgba(34,197,94,0.2); }
.spot .label { font-size: 0.7rem; color: #ccc; position: absolute; bottom: -20px; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  color: #fff;
  background: #f97316;
}
.btn:hover { background: #ea580c; transform: scale(1.03); }
.btn:active { transform: scale(0.97); }
.btn.secondary { background: #0f3460; }
.btn.secondary:hover { background: #1a4a8a; }

/* 选项按钮 (逃生、选择题用) */
.option-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 12px;
  border: 2px solid #0f3460;
  border-radius: 10px;
  background: #1a1a3e;
  color: #eee;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}
.option-btn:hover { background: #2a2a5e; border-color: #f97316; }
.option-btn.selected { border-color: #fbbf24; background: #2a2a4e; }
.option-btn.correct { border-color: #22c55e; background: rgba(34,197,94,0.15); }
.option-btn.wrong { border-color: #ef4444; background: rgba(239,68,68,0.15); }

/* 应急包物品拖拽 */
.kit-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 6px;
  border: 2px solid #0f3460;
  border-radius: 10px;
  background: #1a1a3e;
  cursor: grab;
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}
.kit-item:hover { border-color: #f97316; }
.kit-item.placed { border-color: #22c55e; background: rgba(34,197,94,0.1); }
.kit-item.rejected { border-color: #ef4444; background: rgba(239,68,68,0.1); }
.kit-zone {
  min-height: 100px;
  border: 2px dashed #0f3460;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  transition: border-color 0.2s;
}
.kit-zone.drag-over { border-color: #f97316; background: rgba(249,115,22,0.05); }

/* 反馈消息 */
.feedback {
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  display: none;
}
.feedback.show { display: block; }
.feedback.good { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid #22c55e; }
.feedback.bad { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid #ef4444; }
.feedback.info { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid #3b82f6; }

/* 地震震动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}
.shaking { animation: shake 0.6s ease-in-out; }

/* 防霸凌角色扮演样式 */
.role-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.role-badge.bystander { background: #3b82f6; color: #fff; }
.role-badge.victim { background: #8b5cf6; color: #fff; }
.role-badge.friend { background: #22c55e; color: #fff; }

.scene-desc {
  background: #1a1a3e;
  border-left: 4px solid #f97316;
  padding: 16px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.consequence {
  padding: 16px;
  border-radius: 10px;
  margin-top: 16px;
  font-weight: 600;
  display: none;
}
.consequence.show { display: block; }
.consequence.good { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid #22c55e; }
.consequence.bad { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid #ef4444; }
.consequence.mixed { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid #f59e0b; }

.result-icon { font-size: 2rem; margin-bottom: 8px; }

/* 导航按钮区 */
.nav-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* 进度条 */
.progress-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.progress-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #0f3460;
  transition: background 0.3s;
}
.progress-dot.done { background: #22c55e; }
.progress-dot.current { background: #f97316; }

/* ===== 防霸凌动画小剧场 ===== */
.intro-stage {
  position: relative;
  width: 100%;
  height: 320px;
  background: linear-gradient(180deg, #1a1a3e 0%, #2d2d5e 100%);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  display: none;
}
.intro-stage.show { display: block; }
.stage-floor {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 40px; background: #4a4a7a;
  border-radius: 0 0 12px 12px;
}
/* 角色 */
.stage-char {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 1s ease, opacity 0.5s;
}
.stage-char .char-body {
  width: 56px; height: 80px;
  border-radius: 28px 28px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  position: relative;
}
.stage-char .char-body.bully-body { background: #dc2626; }
.stage-char .char-body.victim-body { background: #6366f1; }
.stage-char .char-body.hero-body { background: #22c55e; }
.stage-char .char-name {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #999;
}
/* 对话气泡 */
.stage-bubble {
  position: absolute;
  top: -58px;
  background: #fff;
  color: #111;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 180px;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.stage-bubble::after {
  content: '';
  position: absolute; bottom: -8px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}
.stage-bubble.show {
  opacity: 1;
  transform: translateY(0);
}
/* 舞台旁白 */
.stage-narrator {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #ccc;
  background: rgba(0,0,0,0.6);
  padding: 6px 16px;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.5s;
  white-space: nowrap;
}
.stage-narrator.show { opacity: 1; }
/* 跳过按钮 */
.intro-skip {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ccc;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.intro-skip:hover { background: rgba(255,255,255,0.25); }

/* 场景预告动画 */
.scene-intro {
  position: relative;
  width: 100%;
  height: 280px;
  background: linear-gradient(180deg, #1a1a3e 0%, #2d2d5e 100%);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  display: none;
}
.scene-intro.show { display: block; }
.scene-intro-floor {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 40px; background: #4a4a7a;
}
.scene-intro-char {
  position: absolute;
  bottom: 50px;
  font-size: 2.8rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  transform: translateX(-50%);
}
.scene-intro-char.show { opacity: 1; }
.scene-intro-label {
  position: absolute;
  bottom: 30px;
  font-size: 0.7rem;
  color: #999;
  text-align: center;
  width: 80px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.4s;
}
.scene-intro-label.show { opacity: 1; }
.scene-intro-emote {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.5s ease, transform 1s ease;
  pointer-events: none;
}
.scene-intro-emote.show { opacity: 1; }
.scene-intro-emote.float-up {
  animation: floatUp 2s ease-in-out infinite;
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
/* 场景预告 + 标题文字 */
.scene-intro-title-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.scene-intro-title-area.show { opacity: 1; }
.scene-intro-desc {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  color: #fbbf24;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.6s ease;
  text-align: center;
  width: 80%;
}
.scene-intro-desc.show { opacity: 1; }
.scene-intro-title-area h3 {
  font-size: 1.6rem;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
  margin-bottom: 8px;
}
.scene-intro-title-area p {
  font-size: 0.95rem;
  color: #f97316;
  font-weight: 600;
}

/* 手机适配 */
@media (max-width: 600px) {
  .card { width: 160px; padding: 16px; }
  .game-area { padding: 16px; }
  .scene { height: 200px; }
  .header h1 { font-size: 1.5rem; }
}
