/* ===== 黑暗风格全局 ===== */
:root {
  --bg: #0e0f13;
  --bg-card: #1a1c22;
  --bg-card-hover: #22252d;
  --text: #e8e9ed;
  --text-dim: #9aa0ab;
  --accent: #ff4d6d;
  --border: #2a2d36;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

/* ===== 从上向下加载动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 顶部标题 ===== */
.site-header {
  text-align: center;
  padding: 44px 20px 28px;
}
.site-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: 3px;
}

/* ===== Banner（圆角卡片，与页面边缘留距） ===== */
.banner {
  position: relative;
  width: min(1200px, calc(100% - 48px));
  height: 56vh;
  min-height: 300px;
  margin: 8px auto 36px;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  user-select: none;
  touch-action: pan-y; /* 允许纵向滚动，横向滑动交给 JS 处理 */
}
.banner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .32s ease, transform .32s ease;
}
/* 切换过渡：沿滑动方向滑出淡出，换源后滑入 */
.banner video.switching {
  opacity: 0;
  transform: translateX(calc(-1 * var(--dir, 1) * 40px)) scale(1.03);
}
/* 左右切换箭头 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(4px);
  transition: background .25s, transform .2s;
}
.banner-arrow:hover { background: rgba(0, 0, 0, .7); }
.banner-arrow:active { transform: translateY(-50%) scale(.92); }
.banner-arrow.prev { left: 16px; padding-right: 4px; }
.banner-arrow.next { right: 16px; padding-left: 4px; }
.banner-dots {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}
.banner-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
  transition: background .3s, transform .3s;
}
.banner-dots .dot.active {
  background: #fff;
  transform: scale(1.25);
}

/* ===== 简介框（与照片墙左对齐、同宽） ===== */
.intro {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
}
.intro-box {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
.intro-title {
  font-size: 20px;
  margin-bottom: 10px;
}

/* ===== 图片墙（仿小红书瀑布流） ===== */
.gallery {
  padding: 20px 20px 0;
  max-width: 1200px;
  margin: 0 auto;
}
.section-title {
  font-size: 22px;
  margin-bottom: 20px;
}
.back-home { color: var(--accent); text-decoration: none; margin-right: 16px; font-size: 15px; }

.masonry {
  column-count: 4;
  column-gap: 14px;
}
@media (max-width: 1000px) { .masonry { column-count: 3; } }
@media (max-width: 700px)  { .masonry { column-count: 2; } }

.card {
  break-inside: avoid;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .25s ease, background .25s ease;
}
.card:hover { transform: translateY(-4px); background: var(--bg-card-hover); }
.card img {
  width: 100%;
  display: block;
}
.card .card-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 12px;
}
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: color .2s, transform .1s;
}
.like-btn:hover { color: var(--accent); }
.like-btn:active { transform: scale(1.2); }
.like-btn.liked { color: var(--accent); cursor: default; }
/* 矢量爱心：默认灰描边空心，点赞后填充主题色并弹跳一下 */
.like-btn .heart {
  display: inline-flex;
  line-height: 0;
}
.like-btn .heart svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  transition: fill .2s ease;
}
.like-btn.liked .heart svg {
  fill: currentColor;
  animation: heartPop .3s ease;
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* 照片墙尾部淡出 + 查看更多 */
.gallery-fade {
  margin-top: -70px;
  height: 90px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  background: linear-gradient(to bottom, rgba(14,15,19,0), var(--bg) 85%);
  position: relative;
  z-index: 2;
}
.btn-more {
  display: inline-block;
  padding: 10px 32px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 15px;
  background: rgba(14, 15, 19, .8);
  transition: background .25s, color .25s;
  cursor: pointer;
}
.btn-more:hover { background: var(--accent); color: #fff; }

/* ===== 打地鼠（与照片墙同宽、左对齐） ===== */
.game {
  padding: 40px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.game-hud {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
  gap: 28px;
}
.game-hud #startBtn { margin-left: auto; }
.game-grid {
  position: relative;
  height: clamp(340px, 45vw, 520px);
  background: #12141a;
  border: 1px solid var(--border);
  border-radius: 18px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* 3D 洞口：椭圆洞 + 内阴影深度 + 泥土环 + 外投影（绝对定位，位置由 JS 随机分配） */
.hole {
  position: absolute;
  width: 100px; /* 实际宽度由 JS 按场地大小设置 */
  aspect-ratio: 1.25 / 1;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 42%, #05060a 0%, #0b0d13 55%, #151823 100%);
  box-shadow:
    inset 0 16px 22px rgba(0, 0, 0, .92),        /* 洞顶深部阴影：深度感 */
    inset 0 -8px 12px rgba(255, 255, 255, .06),  /* 洞底内反光 */
    0 0 0 7px #1a1d26,                            /* 泥土环 */
    0 0 0 8px #2e323e,                            /* 泥土环亮边 */
    0 10px 16px rgba(0, 0, 0, .6),               /* 洞口外投影 */
    0 3px 6px rgba(0, 0, 0, .5);
  overflow: hidden;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><text y='36' font-size='36'>🔨</text></svg>") 8 36, pointer;
}
.hole .marmot {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 72%;
  height: 96%;
  object-fit: contain;
  transform: translate(-50%, 110%);
  transition: transform .18s ease;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6));
}
.hole.up .marmot { transform: translate(-50%, 0); }
.hole.whacked::after {
  content: "💥";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  z-index: 3;
}
/* 移动端：点击时显示锤子 */
.hammer-fx {
  position: fixed;
  font-size: 40px;
  pointer-events: none;
  z-index: 999;
  animation: hammerHit .3s ease forwards;
}
@keyframes hammerHit {
  0%   { transform: rotate(-45deg) scale(1.4); opacity: 1; }
  100% { transform: rotate(0deg) scale(1); opacity: 0; }
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  color: var(--text-dim);
  padding: 30px 0;
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ===== 游戏进行中：全站鼠标变为锤子 ===== */
body.playing,
body.playing * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><text y='36' font-size='36'>🔨</text></svg>") 8 36, pointer !important;
}

/* ===== 游戏结算弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  animation: modalIn .28s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.95); }
  to   { opacity: 1; transform: none; }
}
.modal-title { font-size: 22px; margin-bottom: 10px; }
.modal-score { color: var(--text-dim); margin-bottom: 4px; }
.modal-score b { color: var(--accent); font-size: 30px; margin-left: 4px; }
.modal-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 22px;
}
.btn-more.ghost { border-color: var(--border); color: var(--text-dim); }
.btn-more.ghost:hover { background: var(--border); color: var(--text); }
