/* ============================================
   食物卡喉应急小助手 — 通用样式
   暗色渐变主题 · 霓虹点缀 · 圆润卡片
   ============================================ */

/* --- CSS 自定义属性（主题色） --- */
:root {
  --color-bg-start: #e0f2fe;
  --color-bg-mid: #f0e6ff;
  --color-bg-end: #fce7f3;
  --color-primary: #6366f1;
  --color-accent: #ec4899;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-card-bg: rgba(255, 255, 255, 0.75);
  --color-card-border: rgba(0, 0, 0, 0.08);
  --color-text: #334155;
  --color-text-dim: #64748b;
  --color-text-bright: #0f172a;
  --radius-card: 16px;
  --radius-btn: 12px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --transition-fast: 0.2s ease;
  --transition-med: 0.3s ease;
}

/* --- 全局重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, var(--color-bg-start), var(--color-bg-mid), var(--color-bg-end));
  background-attachment: fixed;
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* --- 渐变标题 --- */
.gradient-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

/* --- 容器 --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* --- 导航栏 --- */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-card-border);
}

.nav-bar .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--color-text-dim);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

/* --- 卡片 --- */
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link .card {
  height: 100%;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  font-size: 1.2rem;
  color: var(--color-text-bright);
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--color-text-dim);
  line-height: 1.5;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

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

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #6366f1);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), #e879f9);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* --- 步骤列表（应急页用） --- */
.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.step-item {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  transition: transform var(--transition-fast);
}

.step-item:hover {
  transform: translateX(4px);
}

.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #0f0c29;
  font-weight: 800;
  font-size: 1rem;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  color: var(--color-text-bright);
  margin-bottom: 0.25rem;
}

/* --- 测验选项 --- */
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.6rem;
  background: var(--color-card-bg);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius-btn);
  color: var(--color-text);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-option:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.06);
}

.quiz-option.selected {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.12);
}

.quiz-option.correct {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.15);
}

.quiz-option.wrong {
  border-color: var(--color-danger);
  background: rgba(239, 68, 68, 0.15);
}

/* --- 错误闪烁动画 --- */
@keyframes shakeFlash {
  0% { border-color: var(--color-danger); background: rgba(239,68,68,0.25); transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { border-color: var(--color-card-border); background: var(--color-card-bg); transform: translateX(0); }
}
.quiz-option.shake-flash {
  animation: shakeFlash 0.5s ease;
}

/* --- 正确答案飘出动画 --- */
@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.correct-pop {
  animation: popIn 0.4s ease forwards;
}

/* --- 倒计时条 --- */
.timer-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-danger), var(--color-warning), var(--color-success));
  border-radius: 4px;
  transition: width 1s linear;
}
.timer-text {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--color-text-bright);
}
.timer-text.warning {
  color: var(--color-danger);
  animation: pulse 0.5s ease infinite alternate;
}
@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* --- 得分榜卡片 --- */
.scoreboard {
  margin-top: 1.5rem;
}
.scoreboard h3 {
  color: var(--color-primary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.scoreboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.3rem;
  background: var(--color-card-bg);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--color-text-dim);
}
.scoreboard-item .stars {
  color: var(--color-warning);
  letter-spacing: 2px;
}
.scoreboard-item .date {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  opacity: 0.6;
}
.scoreboard-item.best {
  border: 1px solid var(--color-warning);
  background: rgba(245, 158, 11, 0.08);
}

/* --- 海姆立克动画容器 --- */
.heimlich-animation {
  position: relative;
  width: 200px;
  height: 280px;
  margin: 1.5rem auto;
  cursor: pointer;
  user-select: none;
}
.heimlich-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 160px;
  background: linear-gradient(180deg, #f5a623, #e8922a);
  border-radius: 30px 30px 20px 20px;
  z-index: 1;
}
.heimlich-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: #f5a623;
  border-radius: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.heimlich-arm {
  position: absolute;
  width: 30px;
  height: 80px;
  background: #f5a623;
  border-radius: 15px;
  z-index: 3;
  transform-origin: top center;
}
.heimlich-arm.left {
  left: 10px;
  top: 80px;
  transform: rotate(30deg);
}
.heimlich-arm.right {
  right: 10px;
  top: 80px;
  transform: rotate(-30deg);
}
/* 冲击动画 — 手臂快速向内向上 */
.heimlich-animation.thrust .heimlich-arm.left {
  animation: thrustLeft 0.4s ease infinite;
}
.heimlich-animation.thrust .heimlich-arm.right {
  animation: thrustRight 0.4s ease infinite;
}
@keyframes thrustLeft {
  0%, 100% { transform: rotate(30deg) translate(0, 0); }
  50% { transform: rotate(50deg) translate(8px, -12px); }
}
@keyframes thrustRight {
  0%, 100% { transform: rotate(-30deg) translate(0, 0); }
  50% { transform: rotate(-50deg) translate(-8px, -12px); }
}
/* 冲击时身体抖动 */
.heimlich-animation.thrust .heimlich-body {
  animation: bodyJolt 0.4s ease infinite;
}
@keyframes bodyJolt {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}
.heimlich-label {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-dim);
}
.heimlich-btn {
  display: block;
  margin: 0.5rem auto 0;
}

/* --- 反馈条 --- */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  z-index: 999;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast-success {
  background: var(--color-success);
  color: #0f0c29;
}

.toast-error {
  background: var(--color-danger);
  color: #fff;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* --- 撒花动画（通关庆祝） --- */
@keyframes confetti-fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confetti-fall 2.5s ease-in forwards;
}

/* --- 错题回顾 --- */
.wrong-review {
  margin-top: 1rem;
  text-align: left;
  padding: 1rem;
  background: rgba(239,68,68,0.04);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-card);
}
.wrong-review h3 {
  color: var(--color-danger);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.wrong-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-card-border);
}
.wrong-item:last-child { border-bottom: none; }
.wrong-item .q {
  color: var(--color-text-bright);
  font-weight: 600;
  font-size: 0.9rem;
}
.wrong-item .your-answer {
  color: var(--color-danger);
  font-size: 0.85rem;
}
.wrong-item .correct-answer {
  color: var(--color-success);
  font-size: 0.85rem;
}
.wrong-item .explanation {
  color: var(--color-primary);
  font-size: 0.85rem;
  margin-top: 0.2rem;
  padding: 0.3rem 0.5rem;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 6px;
}

/* --- 拖拽排序 --- */
.sort-area {
  margin-bottom: 1rem;
}
.sort-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sort-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--color-card-bg);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius-btn);
  cursor: grab;
  transition: all var(--transition-fast);
  user-select: none;
}
.sort-item:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.06);
}
.sort-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}
.sort-handle {
  font-size: 1.2rem;
  color: var(--color-text-dim);
  cursor: grab;
  flex-shrink: 0;
}
.sort-text {
  flex: 1;
  color: var(--color-text);
  font-size: 0.95rem;
}
.sort-index {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.85rem;
}
.sort-item.sort-correct {
  border-color: var(--color-success);
  background: rgba(34,197,94,0.12);
}
.sort-item.sort-wrong {
  border-color: var(--color-danger);
  background: rgba(239,68,68,0.12);
}

/* --- 通关弹窗 --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}
.modal-card {
  background: #ffffff;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  animation: modalPop 0.4s ease;
}
.modal-emoji {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}
.modal-card h2 {
  color: var(--color-text-bright);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.modal-card p {
  color: var(--color-text-dim);
  margin-bottom: 1.2rem;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
.score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.score-bar .label { color: var(--color-text-dim); }
.score-bar .value { color: var(--color-primary); font-weight: 700; font-size: 1.1rem; }

/* --- 步骤渐入动画（应急页用） --- */
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-item {
  animation: stepFadeIn 0.5s ease forwards;
  opacity: 0;
}
.step-item:nth-child(1) { animation-delay: 0.1s; }
.step-item:nth-child(2) { animation-delay: 0.3s; }
.step-item:nth-child(3) { animation-delay: 0.5s; }
.step-item:nth-child(4) { animation-delay: 0.7s; }
.step-item:nth-child(5) { animation-delay: 0.9s; }

/* --- 音效解锁按钮 --- */
.audio-unlock-bar {
  text-align: center;
  padding: 0.8rem;
  margin-bottom: 1rem;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-card);
}
.audio-unlock-bar .btn {
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
}
.audio-unlock-bar .hint {
  color: var(--color-text-dim);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}
.audio-unlock-bar .hint.unlocked {
  color: var(--color-success);
}

/* --- 首页冲击动画（CSS 画人 + 大幅冲击） --- */
.hero-animation {
  position: relative;
  text-align: center;
  margin: 1.5rem auto;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-card);
  padding: 2.5rem 1rem 1.5rem;
  border: 2px solid var(--color-card-border);
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.hero-animation:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.12);
}
.hero-scene {
  position: relative;
  width: 280px;
  height: 320px;
  margin: 0 auto;
}

/* --- 救助者（背后，蓝色） --- */
.hh-body {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 160px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-radius: 30px 30px 16px 16px;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}
.hh-head {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  background: #3b82f6;
  border-radius: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}
/* 救助者手臂 — 从肩膀位置伸出，环抱患者 */
.hh-arm-left, .hh-arm-right {
  position: absolute;
  width: 28px;
  height: 100px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-radius: 14px;
  z-index: 3;
  transform-origin: top center;
  top: 80px;
}
.hh-arm-left {
  left: 30px;
  transform: rotate(25deg);
}
.hh-arm-right {
  right: 30px;
  transform: rotate(-25deg);
}

/* --- 患者（前面，橙色） --- */
.hp-body {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 140px;
  background: linear-gradient(180deg, #f5a623, #e8922a);
  border-radius: 28px 28px 14px 14px;
  z-index: 4;
  box-shadow: 0 4px 20px rgba(245,166,35,0.2);
}
.hp-head {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: #f5a623;
  border-radius: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 2px 10px rgba(245,166,35,0.2);
}

/* --- 冲击箭头（默认隐藏，冲击时显示） --- */
.hi-arrow-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  transition: none;
  pointer-events: none;
}
.hi-arrow {
  display: block;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-accent);
  text-shadow: 0 0 30px rgba(255,107,53,0.9), 0 0 60px rgba(255,107,53,0.4);
}
.hi-text {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(255,107,53,0.8);
  margin-top: 0.3rem;
  white-space: nowrap;
}
/* 箭头弹出动画 */
.hi-arrow-area.hi-pop {
  opacity: 1;
  animation: arrowPopBig 0.8s ease forwards;
}
@keyframes arrowPopBig {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  50% { transform: translate(-50%, -60%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(1); opacity: 0; }
}

/* --- 冲击波扩散环 --- */
.shockwave-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-accent);
  border-radius: 50%;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}
.shockwave-ring.ring-burst {
  animation: ringExpand 0.8s ease-out forwards;
}
@keyframes ringExpand {
  0% { width: 40px; height: 40px; opacity: 0.8; border-width: 6px; }
  100% { width: 300px; height: 300px; opacity: 0; border-width: 1px; }
}

/* --- 冲击时动画 --- */
/* 患者抖动 */
.hero-animation.hero-thrust .hp-head {
  animation: hpShake 0.3s ease infinite;
}
.hero-animation.hero-thrust .hp-body {
  animation: hpShake 0.3s ease infinite;
}
@keyframes hpShake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(-50%) translateY(-10px); }
  75% { transform: translateX(-50%) translateY(-4px); }
}
/* 手臂冲击 — 快速向内向上 */
.hero-animation.hero-thrust .hh-arm-left {
  animation: armThrustLeft 0.3s ease infinite;
}
.hero-animation.hero-thrust .hh-arm-right {
  animation: armThrustRight 0.3s ease infinite;
}
@keyframes armThrustLeft {
  0%, 100% { transform: rotate(25deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(10px, -16px); }
}
@keyframes armThrustRight {
  0%, 100% { transform: rotate(-25deg) translate(0, 0); }
  50% { transform: rotate(-45deg) translate(-10px, -16px); }
}
/* 救助者身体前倾 */
.hero-animation.hero-thrust .hh-body {
  animation: hhLean 0.3s ease infinite;
}
@keyframes hhLean {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}
/* 整个卡片闪烁 */
.hero-animation.hero-thrust {
  animation: cardFlash 0.3s ease infinite;
}
@keyframes cardFlash {
  0%, 100% { border-color: var(--color-card-border); box-shadow: 0 0 0 transparent; }
  50% { border-color: var(--color-accent); box-shadow: 0 0 40px rgba(236, 72, 153, 0.2); }
}

.hero-label {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text-dim);
  font-weight: 600;
}

/* --- 二维码占位 --- */
.qrcode-box {
  display: inline-block;
  padding: 1rem;
  background: #fff;
  border-radius: 12px;
}
.qrcode-placeholder {
  text-align: center;
}

/* --- 步骤进度指示器 --- */
.step-progress {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-card-border);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.progress-dot {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  opacity: 0.4;
  transition: all 0.3s ease;
  cursor: pointer;
}
.progress-dot.done {
  color: var(--color-success);
  opacity: 0.8;
}
.progress-dot.active {
  color: var(--color-primary);
  opacity: 1;
  transform: scale(1.3);
  text-shadow: 0 0 8px rgba(0,212,255,0.6);
}
.progress-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin: 0;
}

/* --- 语音引导条 --- */
.voice-guide-bar {
  text-align: center;
  padding: 0.8rem;
  margin-bottom: 1rem;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-card);
}
.voice-guide-bar .hint {
  color: var(--color-text-dim);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}
.btn-voice-step {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: background 0.2s;
  vertical-align: middle;
}
.btn-voice-step:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* --- 页脚 --- */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-card-border);
  margin-top: 3rem;
}

/* --- 闯关卡片 --- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.level-card {
  position: relative;
  background: var(--color-card-bg);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-med);
  overflow: hidden;
}
.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.1);
}
.level-card.level-open {
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(99,102,241,0.1);
}
.level-card.level-open:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 30px rgba(236,72,153,0.15);
}
.level-card.level-done {
  border-color: var(--color-success);
  background: rgba(16,185,129,0.04);
}
.level-card.level-locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.level-card.level-locked:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}
.level-badge {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.level-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.2rem;
}
.level-card h3 {
  font-size: 1.1rem;
  color: var(--color-text-bright);
  margin-bottom: 0.3rem;
}
.level-desc {
  font-size: 0.85rem;
  color: var(--color-text-dim);
}
.level-badge-earned {
  font-size: 0.8rem;
  color: var(--color-success);
  font-weight: 600;
  margin-top: 0.3rem;
}
.level-lock-msg {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-top: 0.3rem;
}

/* --- 徽章收集页 --- */
.badge-progress-wrap {
  width: 100%;
  max-width: 400px;
  height: 10px;
  background: rgba(0,0,0,0.06);
  border-radius: 5px;
  margin: 0.75rem auto;
  overflow: hidden;
}
.badge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-warning));
  border-radius: 5px;
  transition: width 0.6s ease;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.badge-card {
  position: relative;
  background: var(--color-card-bg);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition-med);
}
.badge-card.earned {
  border-color: var(--badge-color, var(--color-success));
  box-shadow: 0 0 24px rgba(16,185,129,0.1);
}
.badge-card.earned:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.1), 0 0 30px rgba(16,185,129,0.15);
}
.badge-card.locked {
  opacity: 0.5;
  filter: grayscale(0.5);
}
.badge-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.badge-icon {
  font-size: 3.5rem;
  position: relative;
  z-index: 1;
}
.badge-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--badge-color, var(--color-success)) 0%, transparent 70%);
  opacity: 0.25;
  animation: badgePulse 2s ease infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.25; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.45; }
}
.badge-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 2;
}
.badge-card h3 {
  font-size: 1.05rem;
  color: var(--color-text-bright);
  margin-bottom: 0.2rem;
}
.badge-level {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-bottom: 0.3rem;
}
.badge-desc {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  line-height: 1.4;
}
.badge-date {
  font-size: 0.75rem;
  color: var(--color-success);
  margin-top: 0.4rem;
  font-weight: 600;
}
.badge-hint {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  margin-top: 0.4rem;
  font-style: italic;
}

/* --- 响应式 --- */
@media (max-width: 600px) {
  .container {
    padding: 1rem 0.75rem;
  }

  .nav-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    justify-content: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .step-item {
    flex-direction: column;
    align-items: stretch;
  }
}
