/* ===== 防骗小卫士 v2 — 全新样式 ===== */
/* 安全 · 清爽 · 友好 */

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: linear-gradient(160deg, #eef2ff 0%, #f0f9ff 40%, #fff7ed 100%);
  min-height: 100vh;
  color: #1e293b;
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- 容器 ---------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- 首页头部 ---------- */
.hero {
  text-align: center;
  padding: 32px 0 20px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 18px;
  color: #64748b;
  margin-top: 4px;
}

/* ---------- 防骗等级徽章 ---------- */
.badge-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: white;
  border-radius: 16px;
  padding: 12px 20px;
  margin: 12px 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 2px solid #e2e8f0;
}

.badge-star { font-size: 28px; }

.badge-title { font-weight: 700; font-size: 18px; color: #475569; }
.badge-title span { color: #6d28d9; }
.badge-score { font-size: 15px; color: #94a3b8; margin-left: auto; }
.badge-score strong { color: #2563eb; font-size: 18px; }

/* ---------- 卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.card {
  background: white;
  border-radius: 18px;
  padding: 22px 14px;
  text-decoration: none;
  color: #1e293b;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 2.5px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.card:active { transform: translateY(0); }

.card-icon { font-size: 44px; margin-bottom: 10px; transition: transform 0.2s; }
.card:hover .card-icon { transform: scale(1.15); }
.card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.card p { font-size: 14px; color: #64748b; }

.card-learn::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.card-learn:hover { border-color: #fbbf24; }
.card-quiz::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.card-quiz:hover { border-color: #60a5fa; }
.card-chat::before { background: linear-gradient(90deg, #10b981, #34d399); }
.card-chat:hover { border-color: #34d399; }
.card-tip::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.card-tip:hover { border-color: #f472b6; }
.card-escape::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.card-escape:hover { border-color: #ef4444; }

/* ---------- 安全提示条 ---------- */
.safety-rule {
  background: linear-gradient(135deg, #fef2f2, #fff5f5);
  border: 2px solid #fca5a5;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  font-size: 16px;
}

.rule-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.highlight { color: #dc2626; font-weight: 700; }

/* ---------- 页面头部 ---------- */
.page-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 3px dashed #cbd5e1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 28px; font-weight: 800; }

.back-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 10px;
  background: #eff6ff;
  transition: background 0.2s;
}
.back-link:hover { background: #dbeafe; }

/* ---------- 骗术大揭秘卡片 ---------- */
.scam-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.scam-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}
.scam-card:hover { transform: translateY(-2px); }

.scam-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scam-emoji { font-size: 34px; }
.scam-header h2 { font-size: 20px; font-weight: 700; }

.scam-gold { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.scam-police { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.scam-family { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.scam-game { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }

.scam-body { padding: 14px 20px 18px; font-size: 16px; }
.scam-body p { margin-bottom: 10px; }

.scam-truth, .scam-action {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 15px;
}

.scam-truth { background: #f0fdf4; border: 2px solid #86efac; }
.scam-action { background: #fff7ed; border: 2px solid #fdba74; }
.truth-icon, .action-icon { font-size: 22px; flex-shrink: 0; }

/* ---------- 按钮 ---------- */
.btn-next {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.btn-next:active { transform: translateY(0); }

.btn-secondary { background: #e2e8f0; color: #475569; margin-left: 8px; }
.btn-secondary:hover { background: #cbd5e1; box-shadow: none; transform: translateY(-2px); }

/* ---------- 测验页 ---------- */
.quiz-area { margin: 16px 0; }

.score-board {
  background: white;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  margin-bottom: 18px;
  text-align: center;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.score-emoji { font-size: 26px; }

.question-card {
  background: white;
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  border: 2px solid #e2e8f0;
}

.q-number {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.question-text {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.7;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-answer {
  flex: 1;
  padding: 16px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-yes { background: #dcfce7; color: #166534; border-color: #86efac; }
.btn-yes:hover { background: #bbf7d0; transform: scale(1.02); }
.btn-no { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-no:hover { background: #fecaca; transform: scale(1.02); }

.btn-answer:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-answer.correct-pick {
  border-color: #059669;
  background: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.2);
}

.btn-answer.wrong-pick {
  border-color: #dc2626;
  background: #fecaca;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.2);
}

.feedback {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.feedback.correct { background: #f0fdf4; border: 2px solid #86efac; color: #166534; }
.feedback.wrong { background: #fef2f2; border: 2px solid #fca5a5; color: #991b1b; }

.hidden { display: none !important; }

.result-card {
  background: white;
  border-radius: 20px;
  padding: 36px 24px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-top: 20px;
  border: 2px solid #e2e8f0;
  animation: popIn 0.4s ease-out;
}

.result-icon { font-size: 60px; margin-bottom: 10px; }
.result-card h2 { font-size: 26px; margin-bottom: 8px; }
.result-card p { font-size: 17px; color: #64748b; margin-bottom: 18px; }

/* ---------- 模拟聊天页 ---------- */
.chat-setup { text-align: center; padding: 16px 0; }
.setup-text { font-size: 18px; font-weight: 600; margin-bottom: 14px; }

.setup-buttons { display: flex; flex-direction: column; gap: 10px; }

.btn-scenario {
  background: white;
  border: 2.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-scenario:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateX(4px);
}
.btn-scenario:active { transform: translateX(2px); }

.chat-box {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  border: 2px solid #e2e8f0;
}

.chat-header {
  background: #f8fafc;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-messages {
  padding: 18px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
  animation: msgSlide 0.3s ease-out;
}

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

.msg-scammer {
  background: #fef2f2;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 2px solid #fecaca;
}

.msg-user {
  background: #eff6ff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  border: 2px solid #bfdbfe;
}

.msg-system {
  background: #fffbeb;
  border: 2px solid #fde68a;
  align-self: center;
  text-align: center;
  font-weight: 600;
  max-width: 92%;
  font-size: 15px;
}

.chat-options {
  padding: 10px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-option {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.btn-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateX(3px);
}
.btn-option:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.chat-result {
  text-align: center;
  padding: 20px 24px;
  border-top: 2px solid #e2e8f0;
}
.chat-result .result-icon { font-size: 44px; }
.chat-result p { font-size: 17px; margin-bottom: 14px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 380px;
  width: 90%;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: popIn 0.3s ease-out;
}

.tip-text { font-size: 19px; line-height: 1.7; padding: 12px 0; }

/* ---------- 反馈动效 ---------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake { animation: shake 0.4s ease; }

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

.bounce-in { animation: bounceIn 0.5s ease; }

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .hero h1 { font-size: 30px; }
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .card h2 { font-size: 19px; }
  .btn-group { flex-direction: column; }
  .msg { max-width: 90%; }
  .page-header h1 { font-size: 24px; }
}
