/* ============================================================
   趣打卡 FunDaka — 参与者打卡 H5（移动端优先）
   ============================================================ */
:root {
  --primary: #FF5A1F;
  --primary-dark: #E8490F;
  --primary-soft: #FFE9DE;
  --primary-grad: linear-gradient(135deg, #FF8A50 0%, #FF5A1F 100%);
  --ink: #221D2E;
  --ink-2: #4A4358;
  --muted: #7A7385;
  --paper: #FFF9F3;
  --paper-2: #F7F2EC;
  --line: #EFE8E0;
  --dark: #191627;
  --green: #1E9E63;
  --green-soft: #E3F7EC;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}
/* 安卓自带浏览器默认会对「看起来像正文」的页面放大字号（font boosting），
   同一份代码在不同机型上排版会不一样。这里明确关掉，保证各机型一致。 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: #151221;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.p-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: min(860px, calc(100vh - 40px));
  min-height: 600px;
  background: var(--paper-2);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}
/* 真机取「看得见的那一块」当高度，而不是 100vh：
   手机自带浏览器（小米/华为/OPPO/vivo 那类）与微信内置浏览器上下都有
   浮在页面上面、不占布局的工具条。用 100vh 时容器底部会伸到工具条后面，
   游客端的「首页/地图/我的印章/奖品」四个 tab 就被压在工具条里看不见、点不到。
   真机实测（用户那台 Chrome/144 自带浏览器）：100vh = 100dvh = innerHeight = 667px，
   而 100svh = 616px —— 差的 51px 正是工具条占的。所以按 svh 排：
     --app-h（JS 量到的真实可见高度，已与 svh 取小） → 100svh → 100vh（老浏览器兜底） */
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  body { padding: 0; align-items: stretch; }
  .p-shell {
    max-width: none; border-radius: 0;
    height: 100vh;
    height: 100svh;
    height: var(--app-h, 100svh);
    min-height: 0;
  }
}

/* 状态栏 */
.p-status {
  flex-shrink: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 8px 22px 6px; font-size: 11px; font-weight: 700; color: var(--ink);
  background: #fff;
}
/* 手机壳预览的拟物装饰：桌面端摆出 iOS 样子（时间 + 状态 + 电量），
   真机上隐藏假的时间与电量，只保留中间的真实状态并居中。
   判定用「窄屏 或 触摸设备」两条，横屏手机（宽 > 480px 但 pointer:coarse）也覆盖得住。
   硬规则：装饰不得伪装成系统信息 —— 别再把它们放回来。 */
@media (max-width: 480px), (hover: none) and (pointer: coarse) {
  .p-status-bar { justify-content: center; padding: 9px 16px 8px; font-size: 12px; }
  .p-status-bar .p-sys { display: none; }
}

/* 屏幕容器 */
.p-screen { display: none; flex: 1; overflow-y: auto; flex-direction: column; background: var(--paper-2); }
.p-screen.active { display: flex; }
.p-screen::-webkit-scrollbar { display: none; }

/* 顶部渐变头 */
.p-head { padding: 18px 20px 22px; color: #fff; position: relative; }
.p-head .p-kicker { font-size: 11px; font-weight: 700; opacity: 0.85; letter-spacing: 0.08em; }
.p-head .p-title { font-size: 21px; font-weight: 800; margin-top: 4px; }
.p-head .p-back { position: absolute; top: 14px; left: 12px; width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,0.16); }
.p-head .p-back svg { width: 18px; height: 18px; }
/* 地图页标题收进短卡片，为游客首屏多留出导览图空间。 */
.p-map-head { flex: 0 0 auto; padding: 8px 12px 0; background: transparent; }
.p-map-head .p-back { top: 8px; left: 12px; }
.p-map-title-card {
  box-sizing: border-box; margin-left: 42px; width: calc(100% - 42px);
  padding: 7px 12px 8px; border-radius: 14px; color: #fff;
  background: var(--primary-grad); box-shadow: 0 4px 12px rgba(164, 70, 30, 0.16);
}
.p-map-head .p-kicker { font-size: 9px; line-height: 1.3; letter-spacing: 0.04em; }
.p-map-head .p-title { margin-top: 2px; font-size: 17px; line-height: 1.25; }

/* 首页 */
.p-home-cover { padding: 30px 24px 26px; color: #fff; text-align: center; }
.p-home-cover .p-emoji { font-size: 64px; margin-bottom: 10px; }
.p-home-cover .p-kicker { font-size: 12px; font-weight: 700; opacity: 0.9; letter-spacing: 0.08em; }
.p-home-cover h1 { font-size: 24px; font-weight: 800; margin-top: 6px; }
.p-home-cover .p-desc { font-size: 13px; opacity: 0.92; margin-top: 10px; line-height: 1.7; max-width: 300px; margin-left: auto; margin-right: auto; }
.p-badge-row { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.p-badge { font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,0.22); }

.p-card {
  margin: -22px 16px 0; background: #fff; border-radius: 22px;
  padding: 18px; box-shadow: 0 12px 32px rgba(34, 29, 46, 0.12); position: relative; z-index: 2;
}
.p-progress-label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.p-progress-label b { color: var(--primary); }
.p-progress-bar { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.p-progress-bar span { display: block; height: 100%; border-radius: 99px; background: var(--primary-grad); transition: width 0.5s ease; }
.p-rules { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.p-rules b { color: var(--ink-2); }
.p-home-actions { padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.p-reset { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 0 10px; }

/* 大按钮 */
.p-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 14px 24px; font-size: 15px; font-weight: 800;
  background: var(--primary-grad); color: #fff; box-shadow: 0 10px 24px rgba(255, 90, 31, 0.32);
  transition: transform 0.15s ease, opacity 0.15s;
}
.p-btn:active { transform: scale(0.97); }
.p-btn.ghost { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.p-btn.dark { background: var(--dark); box-shadow: 0 10px 24px rgba(25, 22, 39, 0.3); }
.p-btn:disabled { opacity: 0.45; }
.p-btn svg { width: 16px; height: 16px; }

/* 地图屏 */
/* 地图区自己就是滚动容器：地图在里面滚，下面的提示条占自己的位置，不压地图。
   以前提示条是绝对定位、又没有任何定位祖先 —— 它被钉在了「视口」底部，
   手机上正好压住地图最下面那几个点位（点位是 button，被压住就点不动），
   而且滚地图它也不跟着走。 */
.p-map-wrap {
  flex: 1; position: relative; z-index: 0; background: #EDF3EA; min-height: 320px;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.p-map-warning:not([hidden]) {
  flex-shrink: 0; margin: 10px 12px 0; padding: 10px 13px; border-radius: 12px;
  background: #FFF4DE; color: #80510A; font-size: 12px; line-height: 1.6; font-weight: 700;
}
.p-map-wrap svg.roads { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-pin {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; min-width: 44px; min-height: 44px;
}
.p-pin .dot {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(var(--emoji-scale, 1));
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 6px 14px rgba(34, 29, 46, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.p-pin .dot span { transform: rotate(45deg); font-size: 14px; }
.p-pin.earned .dot { background: var(--green); }
.p-pin .tag {
  background: #fff; border-radius: 8px; padding: 2px 8px; font-size: 10.5px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(34, 29, 46, 0.14); white-space: nowrap;
}
.p-pin .tag.earned { color: var(--green); }
/* 提示条：正常占位的一行，不再浮在地图上（浮着就会挡住最下面的点位） */
.p-map-tip {
  flex-shrink: 0; margin: 10px 12px 12px;
  background: rgba(25, 22, 39, 0.85); color: #fff; border-radius: 14px;
  padding: 10px 14px; font-size: 12px; font-weight: 600; text-align: center;
  backdrop-filter: blur(6px);
}

/* 集章屏 */
.p-stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px; }
.p-stamp {
  aspect-ratio: 1; border-radius: 18px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: inset 0 0 0 1.5px var(--line); color: #C9C2D0;
}
.p-stamp .s-emoji { font-size: 30px; filter: grayscale(1); opacity: 0.5; }
.p-stamp .s-name { font-size: 10.5px; font-weight: 700; max-width: 90%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-stamp.earned {
  background: var(--primary-soft); color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(255, 90, 31, 0.35);
}
.p-stamp.earned .s-emoji { filter: none; opacity: 1; }
.p-stamp .s-check { font-size: 9.5px; font-weight: 800; }

/* 奖品屏 */
.p-prize-card { margin: 18px 16px; background: #fff; border-radius: 22px; padding: 22px 18px; text-align: center; box-shadow: 0 12px 32px rgba(34, 29, 46, 0.1); }
.p-prize-card .p-emoji { font-size: 56px; }
.p-prize-card h3 { font-size: 18px; font-weight: 800; margin-top: 8px; }
.p-prize-card .p-prize-desc { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.p-prize-actions { padding: 0 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.p-code-box {
  margin-top: 14px; background: var(--paper-2); border: 2px dashed var(--primary);
  border-radius: 16px; padding: 12px; font-size: 20px; font-weight: 800; letter-spacing: 0.2em; color: var(--primary);
}

/* 完成屏 */
.p-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; background: #fff; }
.p-done .p-emoji { font-size: 84px; animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.p-done h2 { font-size: 24px; font-weight: 800; margin-top: 16px; }
.p-done p { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.7; }

/* 底部 tab */
.p-tabbar {
  flex-shrink: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  /* safe-area：iPhone 的 home 指示条、安卓手势条会压住最后 20~34px，
     底部工具栏必须自己让开，否则标签会被系统手势条挡住 */
  padding: 6px 4px calc(12px + env(safe-area-inset-bottom, 0px));
}
.p-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.p-tab svg { width: 20px; height: 20px; }
.p-tab.active { color: var(--primary); }

/* ---------- 回头路：一次性提示卡 + 首页分享卡 ---------- */
/* 提示卡占独立的一行；地图允许收缩，避免浮层挡住可点击点位或挤出底部导航。 */
#screenMap { min-height: 0; overflow: hidden; }
#screenMap .p-map-wrap { min-height: 0; }
.p-reentry-hold { position: relative; flex: 0 0 auto; }
.p-reentry {
  position: relative; margin: 6px 12px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; border-radius: 14px;
  background: #FFF6E5; border: 1px solid #FFE2AE; color: #6B4A00;
  box-shadow: 0 10px 26px rgba(107, 74, 0, 0.18);
  max-height: 42vh; overflow-y: auto;
}
.p-reentry .pr-body { flex: 1; font-size: 12.5px; line-height: 1.75; }
.p-reentry .pr-body b { display: block; font-size: 13px; margin-bottom: 2px; }
.p-reentry .pr-x {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.06); color: #6B4A00; font-size: 12px; line-height: 1;
}
.p-share-card {
  margin: 14px 20px 0; padding: 14px 16px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); text-align: center;
}
.p-share-card .ps-title { font-size: 14px; font-weight: 800; }
.p-share-card .ps-sub { font-size: 12px; color: var(--muted); margin: 6px 0 12px; line-height: 1.7; }
.qr-box { margin-top: 12px; }
.qr-box img { width: 168px; height: 168px; }
.qr-box .qr-url {
  font-size: 10.5px; color: var(--muted); word-break: break-all;
  margin-top: 8px; line-height: 1.6;
}
.qr-box .qr-fail { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- 页面内扫码取景器 ---------- */
.p-scan {
  position: absolute; inset: 0; z-index: 40;      /* 盖住 tab 栏：扫码时不该乱点 */
  background: #0d0b14; color: #fff;
  display: none; flex-direction: column;
}
.p-scan.show { display: flex; }
.p-scan-bar {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 14px; font-weight: 800;
}
.p-scan-x {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.14);
  color: #fff; font-size: 15px; line-height: 1;
}
.p-scan-view { position: relative; flex: 1; overflow: hidden; background: #000; }
.p-scan-view video { width: 100%; height: 100%; object-fit: cover; }
.p-scan-frame {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(66%, 240px); aspect-ratio: 1; border-radius: 16px;
  box-shadow: 0 0 0 200vmax rgba(0,0,0,0.45);
  border: 2px solid rgba(255,255,255,0.85);
}
.p-scan-frame::before, .p-scan-frame::after {
  content: ''; position: absolute; width: 26px; height: 26px; border: 3px solid var(--primary);
}
.p-scan-frame::before { left: -3px; top: -3px; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.p-scan-frame::after { right: -3px; bottom: -3px; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.p-scan-tip { padding: 14px 20px 6px; font-size: 12.5px; line-height: 1.7; text-align: center; color: rgba(255,255,255,0.82); }
.p-scan .p-btn { margin: 0 20px 20px; }

/* 双重校验时的定位状态 */
.qr-geo {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-align: center;
  font-size: 12.5px; font-weight: 700; line-height: 1.6;
  background: var(--paper-2); color: var(--muted);
}
.qr-geo.ok { background: var(--green-soft); color: var(--green); }
.qr-geo.bad { background: #FFE9E3; color: #D1341A; }
/* 答题选项：提交中 / 对了 / 错了 */
.p-quiz-opt.picked { border-color: var(--primary); background: var(--primary-soft); }

.qr-foot { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.7; }

/* 底部弹层 */
.p-mask { position: absolute; inset: 0; background: rgba(20, 16, 30, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 20; }
.p-mask.show { opacity: 1; pointer-events: auto; }
.p-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-radius: 24px 24px 0 0; padding: 10px 18px 22px;
  transform: translateY(105%); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -12px 40px rgba(34, 29, 46, 0.2);
}
.p-sheet.show { transform: none; }
.p-sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 14px; }
.p-sheet .sh-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.p-sheet .sh-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.p-sheet .sh-body { margin-top: 16px; }
.p-input {
  width: 100%; border: 2px solid var(--line); border-radius: 14px;
  padding: 13px 16px; font-size: 15px; outline: none; transition: border 0.2s;
}
.p-input:focus { border-color: var(--primary); }
.p-quiz-opt {
  display: flex; width: 100%; text-align: left; align-items: center; gap: 10px;
  border: 2px solid var(--line); border-radius: 14px; padding: 13px 16px;
  font-size: 14.5px; font-weight: 600; margin-bottom: 10px; transition: all 0.18s;
}
.p-quiz-opt:active { border-color: var(--primary); background: var(--primary-soft); }
.p-quiz-opt .o-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.p-quiz-opt.wrong { border-color: #F06292; background: #FDEBEF; animation: shake 0.4s; }
.p-quiz-opt.right { border-color: var(--green); background: var(--green-soft); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 盖印章动画 */
.p-stamp-fx {
  position: absolute; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
.p-stamp-fx.show { display: flex; }
.p-stamp-fx .fx-stamp {
  width: 150px; height: 150px; border-radius: 28px;
  background: var(--primary-grad); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 22px; font-weight: 800; box-shadow: 0 20px 60px rgba(255, 90, 31, 0.5);
  animation: stampIn 0.5s cubic-bezier(0.15, 1.3, 0.4, 1);
}
.p-stamp-fx .fx-stamp .fx-emoji { font-size: 46px; }
@keyframes stampIn { 0% { transform: scale(2.6) rotate(-14deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.p-stamp-fx .fx-bg { position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,138,80,0.35), rgba(25,22,39,0.55)); }

/* 彩纸 */
.confetti { position: absolute; z-index: 61; pointer-events: none; }
.confetti span {
  position: absolute; width: 9px; height: 9px; border-radius: 2px;
  animation: confFall 1.4s ease-out forwards;
}
@keyframes confFall {
  0% { transform: translateY(-10px) rotate(0); opacity: 1; }
  100% { transform: translateY(240px) rotate(560deg); opacity: 0; }
}

/* 提示 toast */
.p-toast {
  position: absolute; left: 50%; top: 16%; transform: translate(-50%, -10px);
  background: rgba(25, 22, 39, 0.92); color: #fff; font-size: 13px; font-weight: 700;
  padding: 11px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: all 0.3s; z-index: 70; white-space: nowrap;
}
.p-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Demo 选择页（无参数进入时） */
.p-picker { padding: 20px 16px; }
.p-picker h2 { font-size: 18px; font-weight: 800; margin: 4px 4px 14px; }
.p-picker .p-demo-card {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px;
  padding: 14px; margin-bottom: 10px; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform 0.15s;
}
.p-picker .p-demo-card:active { transform: scale(0.98); }
.p-picker .p-demo-emoji { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; }
.p-picker .p-demo-name { font-size: 14.5px; font-weight: 800; }
.p-picker .p-demo-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.p-picker .p-demo-arrow { margin-left: auto; color: #C9C2D0; }

/* ---------- 真实地图（高德）相关 ---------- */
.map-loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: #EDF3EA; font-size: 13px; color: var(--muted); font-weight: 600;
}
/* 地图区现在会滚，控件要一直停在可视区右上角：
   零高粘性层（跟着滚动容器粘住）+ 绝对定位的按钮放在层里。 */
.map-ctl-layer { position: sticky; top: 0; height: 0; z-index: 12; }
.map-ctl {
  position: absolute; top: 10px; right: 10px; z-index: 12;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 13px; font-size: 11.5px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(34, 29, 46, 0.14); cursor: pointer;
}
.map-ctl.active { background: var(--primary-grad); color: #fff; border-color: transparent; }

/* 高德 Marker 内部的自定义图钉 */
.am-pin { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; min-width: 44px; min-height: 44px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.am-pin .dot {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(var(--emoji-scale, 1));
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 6px 14px rgba(34, 29, 46, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.am-pin .dot span { transform: rotate(45deg); font-size: 14px; }
.am-pin.earned .dot { background: var(--green); }
.am-pin .tag {
  background: #fff; border-radius: 8px; padding: 2px 8px; font-size: 10.5px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(34, 29, 46, 0.14); white-space: nowrap;
}
.am-pin .tag.earned { color: var(--green); }

/* 测试模式定位图钉 */
.am-test {
  font-size: 30px; line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(34, 29, 46, 0.35));
  animation: testPulse 1.6s ease-in-out infinite;
}
@keyframes testPulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* 我的真实位置蓝点 */
.am-me { position: relative; width: 16px; height: 16px; display: block; }
.am-me .me-dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: #4A90E2; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(34, 29, 46, 0.3);
}
.am-me .me-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  background: rgba(74, 144, 226, 0.25);
  animation: meRing 2s ease-out infinite;
}
@keyframes meRing { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.4); opacity: 0; } }

/* GPS 打卡状态文字 */
.gps-status {
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  text-align: center; margin-bottom: 12px; line-height: 1.6;
}
.gps-status b { color: var(--primary); font-size: 15px; }

/* ---------- 自定义导览图 ---------- */
.pm-stage {
  position: relative; width: 100%; border-radius: 16px; overflow: hidden;
  background: #f0f0f0; box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  /* 同上：不要用 line-height:0 消空隙，会把点位名字压成一条线 */
}
.pm-stage img { width: 100%; height: auto; display: block; }
.pm-stage.pm-loading, .pm-stage.pm-image-failed { min-height: 220px; }
.pm-stage.pm-loading .pm-pin, .pm-stage.pm-image-failed .pm-pin { visibility: hidden; }
.pm-map-status {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 20px;
  box-sizing: border-box; color: #625a52; background: rgba(248, 246, 242, 0.96);
  text-align: center; font-size: 14px; line-height: 1.6;
}
.pm-map-status button {
  border: 0; border-radius: 999px; padding: 9px 18px; color: #fff;
  background: var(--primary-grad); font: inherit; font-weight: 700; cursor: pointer;
}
.pm-map-status button[hidden] { display: none; }
.pm-stage.pm-stage-capped img { height: 100%; object-fit: contain; background: #f0f0f0; }
/* 竖长导览图：铺满宽度、自然滚动，别压缩成一小块 */
.pm-stage img { width: 100%; height: auto; }
/* 横版全景图：按高度铺满、左右滑动，点位才看得清 */
.pm-stage.pm-stage-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.pm-stage.pm-stage-scroll img { width: auto; height: 100%; max-width: none; }
/* 滑动条太丑，移动端本来也是手势滑动 */
.pm-stage.pm-stage-scroll::-webkit-scrollbar { height: 4px; }
.pm-stage.pm-stage-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 2px; }

.pm-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.4;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  -webkit-tap-highlight-color: transparent; min-width: 44px; min-height: 44px;
}
.pm-pin-dot {
  position: relative; width: 40px; height: 40px; border-radius: 50% 50% 50% 5px;
  transform: rotate(-45deg) scale(var(--emoji-scale, 1));
  background: linear-gradient(135deg, #FF8A50, #FF5A1F);
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.30);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: filter .15s;
}
.pm-pin:active .pm-pin-dot { filter: brightness(.92); }
.pm-pin-dot > * { transform: rotate(45deg); }
.pm-pin-no {
  position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; border-radius: 50%;
  background: #111; color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.pm-pin-name {
  margin-top: 4px; font-size: 12px; font-weight: 700; white-space: nowrap;
  line-height: 1.4;
  background: rgba(0,0,0,0.74); color: #fff; padding: 2px 8px; border-radius: 6px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}
.pm-pin.pm-earned .pm-pin-dot {
  background: linear-gradient(135deg, #34D399, #10B981);
}
.pm-pin-check {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: #10B981; color: #fff; font-size: 12px; font-weight: 800; line-height: 20px;
  text-align: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* ---------- GPS 模拟定位（自测用） ---------- */
.sim-wrap {
  margin-top: 12px; padding: 11px 12px; border-radius: 12px;
  border: 1px dashed rgba(255,90,31,0.35); background: rgba(255,90,31,0.05);
}
.sim-title { font-size: 11.5px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.sim-btn {
  display: block; width: 100%; font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; margin-bottom: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .15s;
}
.sim-btn:last-child { margin-bottom: 0; }

/* ---------- 扫码点位：要求扫实体码时的提示 ---------- */
.qr-needscan {
  margin-top: 4px; padding: 18px 14px; border-radius: 14px; text-align: center;
  border: 1px dashed rgba(255,90,31,0.4); background: rgba(255,90,31,0.05);
}
.qr-needscan .qns-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.qr-needscan .qns-title { font-size: 14.5px; font-weight: 800; margin-bottom: 7px; }
.qr-needscan .qns-sub { font-size: 12px; color: var(--muted); line-height: 1.75; }
.sim-in { border-color: #10B981; color: #0E8A62; }
.sim-in:hover { background: #10B981; color: #fff; }
.sim-out { border-color: #E0335F; color: #B32446; }
.sim-out:hover { background: #E0335F; color: #fff; }

/* ---------- 点位实景图 ---------- */
.sp-photo {
  margin: -4px -4px 14px; border-radius: 14px; overflow: hidden;
  background: #f0f0f0; line-height: 0;
}
.sp-photo img { width: 100%; max-height: 220px; object-fit: cover; display: block; }

/* 有主视觉时：图片上压一层渐变，保证白字仍然读得清 */
.p-home-cover.has-photo { position: relative; }
.p-home-cover.has-photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.62) 100%);
}
.p-home-cover.has-photo > * { position: relative; z-index: 1; }

/* ---------- 预设问卷 ---------- */
.sv-sheet { padding: 22px 20px 24px; }
.sv-head h3 { font-size: 18px; margin: 0 0 8px; }
.sv-head p { font-size: 12.5px; color: var(--muted); line-height: 1.8; margin-bottom: 6px; }
.sv-q { padding: 16px 0 12px; border-top: 1px solid var(--line); }
.sv-q:first-of-type { border-top: 0; }
.sv-q-title { font-size: 14.5px; font-weight: 800; margin-bottom: 4px; }
.sv-q-hint { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; line-height: 1.6; }
.sv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-opt {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 9px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .15s;
}
.sv-opt:hover { border-color: var(--primary); }
.sv-opt.on {
  background: var(--primary-grad); border-color: transparent; color: #fff; font-weight: 700;
}
.sv-sheet .p-btn { width: 100%; margin-top: 18px; }
.sv-sheet .p-btn:disabled { opacity: .5; }
.sv-skip {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  font: inherit; font-size: 12.5px; color: var(--muted);
  background: none; border: 0; cursor: pointer;
}
.sv-skip:hover { color: var(--ink-2); }

/* ---------- 参与者页底部的隐私说明 ---------- */
.p-legal {
  margin: 18px 0 6px; padding: 0 4px;
  font-size: 11.5px; line-height: 1.8; color: var(--muted); text-align: center;
}
.p-legal a { color: var(--primary); font-weight: 700; text-decoration: underline; }

/* 矮屏和横屏保留地图操作面积，说明区可随地图页滚动，底部导航仍固定可用。 */
@media (max-height: 600px) {
  #screenMap { overflow-y: auto; }
  #screenMap .p-map-wrap { flex: 1 0 220px; min-height: 220px; }
}

/* UX03：下一步行动与收集里程碑，不虚构额外奖品。 */
.p-home-actions .p-journey { line-height: 1.65; margin: 0; width: 100%; box-sizing: border-box; }
.p-journey p { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.journey-milestones { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.journey-milestones span { border: 1px solid #e3e0da; border-radius: 10px; padding: 7px 9px; font-size: 12px; color: #756e66; }
.journey-milestones .reached { color: #28784b; background: #edf8ef; border-color: #c4e5ce; }
#hNext { overflow-wrap: anywhere; white-space: normal; }
#hNext[hidden] { display: none; }
.sv-sheet button { min-height: 44px; }
#svError { color: #a73122; line-height: 1.5; }
.sv-sheet .sv-skip { display: block; width: 100%; white-space: normal; margin-top: 10px; }

/* HUMAN04: 点位详情与照片在小屏/键盘弹起时可滚动，始终可关闭。 */
#sheet { box-sizing: border-box; max-height: calc(100% - 16px); overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.p-sheet-close { position: sticky; top: 0; z-index: 1; float: right; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
