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

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #fef7e9;
  color: #3d2b1f;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 竹叶背景 */
.bamboo-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(88,140,60,0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(88,140,60,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 首页 ===== */
.hero {
  text-align: center;
  padding: 50px 20px 20px;
  position: relative; z-index: 1;
}
.hero h1 {
  font-size: 2.6rem;
  color: #8b4513;
  text-shadow: 2px 2px 0 #f0d9b5;
}
.subtitle {
  font-size: 1.1rem;
  color: #6b4423;
  margin-top: 8px;
}
.card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 40px 20px 60px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.card {
  flex: 1 1 280px;
  max-width: 320px;
  background: #fffaf0;
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  text-decoration: none;
  color: #3d2b1f;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 2px solid #e8d5b0;
  position: relative;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.card-icon { font-size: 3rem; margin-bottom: 12px; }
.card h2 { font-size: 1.4rem; margin-bottom: 8px; }
.card p { font-size: 0.9rem; color: #6b5a4e; line-height: 1.5; }
.card-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
}
.card-quyuan .card-tag { background: #d4c5a9; color: #4a3728; }
.card-zongzi .card-tag { background: #c8e6c9; color: #2e7d32; }
.card-longzhou .card-tag { background: #ffccbc; color: #bf360c; }

footer {
  text-align: center;
  padding: 30px;
  color: #8b7355;
  font-size: 1.1rem;
  position: relative; z-index: 1;
}

/* ===== 通用按钮 ===== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  background: #8b4513;
  color: white;
}
.btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(139,69,19,0.3); }
.btn:active { transform: scale(0.97); }
.btn-small { padding: 6px 16px; font-size: 0.85rem; }

/* ===== 头部返回 ===== */
.page-header {
  background: #8b4513;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-header a {
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
}
.page-header a:hover { text-decoration: underline; }
.page-header h2 { flex: 1; text-align: center; font-size: 1.3rem; }

/* ===== 屈原连环画 ===== */
.comic-strip {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.comic-panel {
  display: flex;
  background: #fffaf0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 2px solid #e8d5b0;
  cursor: pointer;
  transition: transform 0.2s;
}
.comic-panel:hover { transform: scale(1.01); }
.comic-panel canvas {
  width: 260px;
  height: 200px;
  flex-shrink: 0;
  background: #f0e6d3;
}
.comic-desc {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.comic-desc h3 {
  font-size: 1.1rem;
  color: #8b4513;
  margin-bottom: 6px;
}
.comic-desc p { font-size: 0.92rem; color: #5a4a3a; line-height: 1.6; }

/* ===== 屈原第一视角弹窗 ===== */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal.show { display: flex; }
.modal-content {
  background: #fffaf0;
  border-radius: 20px;
  padding: 30px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  border: 3px solid #c9a87c;
}
.modal-content h3 { color: #8b4513; font-size: 1.3rem; margin-bottom: 10px; }
.modal-content p { font-size: 1rem; line-height: 1.7; color: #3d2b1f; }
.modal-content .btn { margin-top: 16px; }

/* ===== 包粽子 ===== */
.game-area {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
  text-align: center;
}
#zongziCanvas {
  width: 100%;
  max-width: 500px;
  height: 400px;
  background: #f5ede0;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 3px solid #d4b896;
  cursor: pointer;
  touch-action: none;
}
.step-hint {
  margin-top: 14px;
  padding: 10px 18px;
  background: #fff3e0;
  border-radius: 30px;
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #6b4423;
}
.filling-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}
.filling-btn {
  padding: 8px 18px;
  border: 2px solid #d4b896;
  border-radius: 30px;
  background: white;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filling-btn:hover { border-color: #8b4513; background: #fff3e0; }
.filling-btn.selected { border-color: #8b4513; background: #8b4513; color: white; }

/* ===== 龙舟大赛 ===== */
.race-track-wrap {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
}
#raceCanvas {
  width: 100%;
  height: 360px;
  background: #5fa8d3;
  border-radius: 16px;
  border: 3px solid #3d7ea6;
  display: block;
}
.race-controls {
  display: flex;
  justify-content: space-around;
  margin: 14px 0;
  gap: 20px;
}
.control-box {
  background: #fffaf0;
  border-radius: 12px;
  padding: 12px 20px;
  flex: 1;
  text-align: center;
  border: 2px solid #e8d5b0;
}
.control-box kbd {
  display: inline-block;
  padding: 4px 12px;
  background: #eee;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid #ccc;
}
.coin-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 10px 0;
}
.shop-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}
.shop-item {
  background: #fffaf0;
  border: 2px solid #e8d5b0;
  border-radius: 14px;
  padding: 14px 20px;
  text-align: center;
  min-width: 140px;
}
.shop-item h4 { font-size: 0.95rem; color: #8b4513; }
.shop-item p { font-size: 0.8rem; color: #6b5a4e; }
.shop-item .btn { margin-top: 8px; }
.race-result {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 12px;
  color: #bf360c;
}
