/* ========================================
   地震小勇士 — 大字版 · 缤纷配色
   ======================================== */

/* ----- 基础重置 ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 20px; /* 全局基准放大 */
}

/* ----- 绚丽极光背景（更饱和） ----- */
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  color: #1a2d42;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(55vw 55vw at 5% 0%, rgba(255, 111, 60, 0.22), transparent 50%),
    radial-gradient(45vw 45vw at 90% 5%, rgba(56, 189, 248, 0.2), transparent 50%),
    radial-gradient(50vw 50vw at 30% 90%, rgba(139, 92, 246, 0.2), transparent 50%),
    radial-gradient(40vw 40vw at 75% 55%, rgba(247, 212, 74, 0.18), transparent 50%),
    radial-gradient(35vw 35vw at 50% 30%, rgba(34, 197, 94, 0.12), transparent 50%),
    #f0f4fa;
  background-attachment: fixed;
}

/* ========================================
   顶部导航条（玻璃拟态）
   ======================================== */
.site-header {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30, 58, 95, 0.06);
  box-shadow: 0 2px 20px rgba(0, 20, 50, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 26px;
  font-weight: 900;
  white-space: nowrap;
  background: linear-gradient(135deg, #ff5e3a, #e8547c 40%, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-logo:hover {
  opacity: 0.85;
  transform: scale(1.04);
  transition: transform 0.2s;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 18px;
  color: #4a6a88;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.nav-link:hover {
  background: #eef4fa;
  color: #1a2d42;
  transform: translateY(-2px);
}

.nav-link:active {
  transform: scale(0.93);
}

.nav-link.active {
  background: linear-gradient(135deg, #ff5e3a, #e8547c);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 94, 58, 0.35);
}

.header-star .badge {
  display: inline-block;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  padding: 7px 18px;
  border-radius: 40px;
  font-weight: 800;
  font-size: 18px;
  color: #1a2d42;
  box-shadow: 0 3px 14px rgba(251, 191, 36, 0.45);
  white-space: nowrap;
  transition: transform 0.15s;
}

.badge.pop {
  animation: popStar 0.4s ease;
}

@keyframes popStar {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.28); }
  70%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 34px;
  cursor: pointer;
  color: #1a2d42;
  padding: 4px;
  transition: transform 0.2s;
}

.menu-toggle:active {
  transform: scale(0.82);
}

/* ========================================
   主内容区
   ======================================== */
.site-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 52px;
}

/* SPA 页面切换 */
.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

/* ========================================
   首页 — 英雄区（彩色光晕）
   ======================================== */
.hero {
  text-align: center;
  padding: 72px 28px 52px;
  background: linear-gradient(160deg,
    rgba(255,255,255,0.8) 0%,
    rgba(255,240,230,0.55) 30%,
    rgba(240,245,255,0.5) 60%,
    rgba(245,240,255,0.5) 100%);
  backdrop-filter: blur(6px);
  border-radius: 30px;
  margin-bottom: 48px;
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.03),
    0 20px 48px -12px rgba(30,60,100,0.14);
  position: relative;
  overflow: hidden;
}

/* 英雄区背景光斑 */
.hero::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,143,92,0.2), transparent 70%);
  top: -60px; right: -60px;
  pointer-events: none;
}

.hero-emoji {
  font-size: 120px;
  display: block;
  animation: floatHero 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes floatHero {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40%     { transform: translateY(-18px) rotate(4deg); }
  60%     { transform: translateY(-10px) rotate(-3deg); }
}

.hero h1 {
  font-size: 56px;
  font-weight: 900;
  margin: 16px 0 12px;
  background: linear-gradient(135deg, #ff5e3a, #e8547c 35%, #8b5cf6 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

.hero .hero-desc {
  font-size: 20px;
  color: #3b5a78;
  line-height: 1.9;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero .hero-desc b {
  color: #ff5e3a;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin: 32px 0 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  background: rgba(255,255,255,0.6);
  padding: 16px 28px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.stat-num {
  font-size: 56px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff5e3a, #e8547c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.stat-label {
  font-size: 17px;
  color: #5a7a95;
  margin-top: 4px;
  font-weight: 700;
}

/* ========================================
   首页 — 功能卡片区（每张卡不同色）
   ======================================== */
.section-title {
  font-size: 36px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 32px;
  background: linear-gradient(135deg, #1a2d42, #4a6a88);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 36px;
}

.feature-card {
  background: #fff;
  border-radius: 24px;
  padding: 34px 22px;
  text-align: center;
  text-decoration: none;
  color: #1a2d42;
  box-shadow:
    0 2px 3px rgba(0,0,0,0.03),
    0 10px 28px -8px rgba(30,60,100,0.12);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

/* 每张卡顶部彩色条纹（不同颜色） */
.feature-card:nth-child(1)::before { background: linear-gradient(90deg, #ff8a5c, #ff5e3a); }
.feature-card:nth-child(2)::before { background: linear-gradient(90deg, #22c55e, #10b981); }
.feature-card:nth-child(3)::before { background: linear-gradient(90deg, #8b5cf6, #a855f7); }

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

/* 每张卡 hover 边框不同色 */
.feature-card:nth-child(1):hover { border-color: #ffccbb; }
.feature-card:nth-child(2):hover { border-color: #bbf7d0; }
.feature-card:nth-child(3):hover { border-color: #e4d4fc; }

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow:
    0 3px 6px rgba(0,0,0,0.04),
    0 24px 56px -14px rgba(30,60,100,0.22);
}

.feature-card:active {
  transform: scale(0.94);
  transition: transform 0.1s;
}

.feature-card .card-emoji {
  font-size: 72px;
  transition: transform 0.3s;
}

.feature-card:hover .card-emoji {
  transform: scale(1.18) rotate(-6deg);
}

.feature-card h3 {
  font-size: 24px;
  font-weight: 800;
}

.feature-card p {
  font-size: 17px;
  color: #4a6a85;
  line-height: 1.6;
}

/* ========================================
   子页面 — 内容卡片
   ======================================== */
.page-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow:
    0 2px 3px rgba(0,0,0,0.03),
    0 12px 32px -10px rgba(30,60,100,0.15);
  margin-bottom: 24px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(0,0,0,0.03);
}

.page-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.page-card-title {
  font-weight: 900;
  font-size: 28px;
  background: linear-gradient(135deg, #1a2d42, #3b6fa0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========================================
   按钮（大字版）
   ======================================== */
.btn-primary {
  background: linear-gradient(135deg, #ff7a4d, #ff4d2d);
  border: none;
  border-radius: 60px;
  padding: 15px 32px;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 77, 45, 0.4);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 77, 45, 0.55);
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: scale(0.93);
  box-shadow: 0 2px 8px rgba(255, 77, 45, 0.3);
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn-primary:disabled {
  opacity: 0.5;
  transform: none;
  pointer-events: none;
  filter: grayscale(0.35);
  box-shadow: none;
}

.btn-secondary {
  background: #eef4fa;
  border: none;
  border-radius: 60px;
  padding: 13px 26px;
  font-weight: 700;
  font-size: 18px;
  color: #1a2d42;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.btn-secondary:hover {
  background: #dce7f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(30, 60, 100, 0.12);
}

.btn-secondary:active {
  transform: scale(0.93);
  background: #cddced;
  transition: transform 0.08s;
}

.btn-secondary:disabled {
  opacity: 0.5;
  transform: none;
  pointer-events: none;
}

/* 涟漪 */
@keyframes rip {
  to { transform: scale(3.5); opacity: 0; }
}

/* 脉冲呼吸 */
.btn-primary.pulse {
  animation: btnPulse 1.6s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(255, 77, 45, 0.4); }
  50%      { box-shadow: 0 10px 36px rgba(255, 77, 45, 0.7); transform: scale(1.04); }
}

/* ========================================
   徽章
   ======================================== */
.badge {
  display: inline-block;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  padding: 7px 18px;
  border-radius: 40px;
  font-weight: 800;
  font-size: 17px;
  color: #1a2d42;
  box-shadow: 0 2px 12px rgba(251, 191, 36, 0.4);
}

.badge-danger {
  background: linear-gradient(135deg, #ff4d2d, #dc2626);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 77, 45, 0.4);
}

/* ========================================
   布局工具
   ======================================== */
.flex { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hidden { display: none !important; }

/* ========================================
   AI 回复框
   ======================================== */
.ai-answer {
  background: linear-gradient(135deg, #f0f6fe, #faf5ff);
  border-radius: 18px;
  padding: 16px 20px;
  margin: 14px 0 6px;
  font-size: 18px;
  line-height: 1.8;
  color: #1a2d42;
  border-left: 5px solid #ff7a4d;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* ========================================
   Canvas 地图
   ======================================== */
#mapCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 4;
  border-radius: 18px;
  background: #eaf0e3;
  display: block;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.5),
    0 6px 18px rgba(0,0,0,0.06);
  touch-action: none;
  cursor: crosshair;
  transition: box-shadow 0.3s;
}

#mapCanvas:hover {
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.5),
    0 8px 26px rgba(30, 60, 100, 0.16);
}

/* 地图场景选择器 */
.map-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.map-scene-btn {
  padding: 8px 16px;
  border-radius: 30px;
  border: 2px solid #dce7f5;
  background: #fff;
  font-weight: 700;
  font-size: 16px;
  color: #4a6a88;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.map-scene-btn:hover {
  background: #eef4fa;
  border-color: #bccfdf;
  transform: translateY(-2px);
}

.map-scene-btn:active {
  transform: scale(0.93);
}

.map-scene-btn.active {
  background: linear-gradient(135deg, #1a2d42, #3a6fa0);
  color: #fff;
  border-color: #1a2d42;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.map-tip {
  font-size: 17px;
  color: #4a6a88;
  margin-top: 8px;
}

/* ========================================
   Toast 提示
   ======================================== */
.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(110px);
  background: linear-gradient(135deg, #1a2d42, #2c5282);
  color: #fff;
  padding: 16px 32px;
  border-radius: 60px;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 12px 40px rgba(30, 58, 95, 0.4);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 999;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   成就列表
   ======================================== */
.achieve-item {
  background: #f7faff;
  border-radius: 18px;
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid transparent;
}

.achieve-item.unlocked {
  border-color: #b8e8c8;
  background: linear-gradient(135deg, #f4fdf6, #edfdf2);
  box-shadow: 0 3px 16px rgba(80, 200, 100, 0.15);
  animation: unlockGlow 0.6s ease;
}

@keyframes unlockGlow {
  0%   { box-shadow: 0 0 0 0 rgba(80, 200, 100, 0.55); }
  100% { box-shadow: 0 3px 16px rgba(80, 200, 100, 0.15); }
}

.achieve-item .emoji       { font-size: 50px; flex-shrink: 0; }
.achieve-item .info        { flex: 1; }
.achieve-item .info h4     { font-size: 20px; color: #1a2d42; font-weight: 800; }
.achieve-item .info p      { font-size: 17px; color: #4a6a88; line-height: 1.5; }
.achieve-item .check-mark  { font-size: 28px; flex-shrink: 0; }

/* ========================================
   页脚
   ======================================== */
.site-footer {
  background: linear-gradient(135deg, #162740, #1a2d42);
  color: #8aa0b8;
  text-align: center;
  padding: 26px 24px;
  font-size: 17px;
  margin-top: auto;
}

.site-footer strong {
  color: #fbbf24;
  font-weight: 800;
}

/* ========================================
   动画
   ======================================== */
@keyframes enter {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.enter {
  animation: enter 0.55s ease both;
}

@keyframes shake {
  10%, 90%        { transform: translateX(-3px); }
  20%, 80%        { transform: translateX(4px); }
  30%, 50%, 70%   { transform: translateX(-6px); }
  40%, 60%        { transform: translateX(6px); }
}

.shake {
  animation: shake 0.5s ease;
}

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

.fade-up {
  animation: fadeUp 0.55s ease both;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 900px) {
  html { font-size: 15px; }

  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .hero { padding: 48px 20px 36px; }
  .hero h1 { font-size: 34px; }
  .hero-emoji { font-size: 72px; }
  .site-main { padding: 28px 16px 40px; }
  .feature-card { padding: 26px 16px; }
  .feature-card .card-emoji { font-size: 46px; }
  .stat-num { font-size: 38px; }
}

@media (max-width: 600px) {
  html { font-size: 14px; }

  .header-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 10px 18px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 10px 28px rgba(0,0,0,0.1);
  }

  .header-nav.open { display: flex; }
  .menu-toggle { display: block; }

  .nav-link {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 17px;
  }

  .header-star { margin-left: auto; margin-right: 10px; }

  .feature-cards { grid-template-columns: 1fr; gap: 16px; }
  .hero { padding: 32px 14px 26px; border-radius: 22px; }
  .hero h1 { font-size: 28px; }
  .hero-emoji { font-size: 56px; }
  .stats-bar { gap: 20px; }
  .stat-num { font-size: 34px; }
  .stat-item { padding: 12px 20px; }
  .page-card { padding: 20px 16px; border-radius: 20px; }
  .site-main { padding: 18px 12px 32px; }
  .section-title { font-size: 24px; }
  .page-card-title { font-size: 20px; }
  .btn-primary { font-size: 17px; padding: 14px 24px; }
}
