/* ============================================================
   北京·美团城市漫游 — 样式表
   美学方向：卡通岛屿风格，鲜艳饱和 + 圆润气泡 + 云朵漂浮
   ============================================================ */

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

:root {
  --ink:       #2C3E50;
  --paper:     #FFFFFF;
  --paper2:    #F0F8FF;
  --gold:      #FFD700;
  --red:       #FF4757;
  --orange:    #FF8C42;
  --blue:      #74B9FF;
  --green:     #2ECC71;
  --cyan:      #00CEFF;
  --purple:    #6C5CE7;
  --shadow:    rgba(44,62,80,0.18);
  --radius:    16px;
  --font-title: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --font-body:  'Noto Sans SC', 'PingFang SC', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #87CEEB 0%, #B0E2FF 50%, #C8F0D8 100%);
  font-family: var(--font-body);
  color: var(--ink);
}

/* ---- 工具类 ---- */
.hidden { display: none !important; }
.fade-out { animation: fadeOut 0.4s forwards; }
.fade-in  { animation: fadeIn  0.4s forwards; }

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

/* ============================================================
   登录界面
   ============================================================ */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(135,206,235,0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(46,204,113,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 20%, rgba(255,215,0,0.2) 0%, transparent 40%),
    linear-gradient(135deg, #87CEEB 0%, #B0E2FF 40%, #C8F0D8 100%);
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  from { filter: hue-rotate(0deg) brightness(1); }
  to   { filter: hue-rotate(20deg) brightness(1.05); }
}

.login-card {
  position: relative;
  background: rgba(255,255,255,0.92);
  border: 3px solid rgba(255,255,255,0.8);
  border-radius: 28px;
  padding: 48px 52px;
  width: 420px;
  box-shadow:
    0 20px 60px rgba(44,62,80,0.15),
    0 0 0 1px rgba(255,255,255,0.5),
    inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
}

.login-card::before {
  content: '';
  position: absolute; inset: 6px;
  border: 1.5px solid rgba(116,185,255,0.3);
  border-radius: 22px;
  pointer-events: none;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,200,255,0.5));
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.login-logo h1 {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--ink);
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.login-logo p {
  font-size: 13px;
  color: rgba(44,62,80,0.6);
  letter-spacing: 1px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(116,185,255,0.5);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.8);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input[type="text"]:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,206,255,0.2);
}

.avatar-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avatar-picker > span {
  font-size: 12px;
  color: rgba(44,62,80,0.55);
  letter-spacing: 1px;
}

.avatars {
display: flex;
gap: 8px;
flex-wrap: wrap;
}

.avatar-btn {
width: 52px; height: 52px;
border: 2.5px solid transparent;
border-radius: 50%;
background: rgba(255,255,255,0.5);
padding: 0;
overflow: hidden;

  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.avatar-btn:hover { border-color: var(--cyan); transform: scale(1.12); }
.avatar-btn.active {
border-color: var(--cyan);
box-shadow: 0 0 0 3px rgba(0,206,255,0.35), 0 2px 8px rgba(0,206,255,0.3);
}

.enter-btn {
  padding: 16px;
  background: linear-gradient(135deg, #00CEFF, #6C5CE7);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(0,206,255,0.4);
}

.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,206,255,0.5);
}

.enter-btn:active { transform: translateY(0); }

/* ============================================================
   游戏主界面
   ============================================================ */
#game-screen {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
}

/* ---- HUD ---- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(240,248,255,0.92) 100%);
  border-bottom: 1.5px solid rgba(116,185,255,0.25);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 2px 20px rgba(44,62,80,0.12),
    0 4px 8px rgba(0,150,255,0.06);
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  flex-shrink: 0;
}

.hud-left #hud-avatar { font-size: 18px; }
.hud-left #hud-name { font-weight: 600; color: var(--ink); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hud-badge {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,206,255,0.3);
}

.hud-center .hud-title {
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink);
  white-space: nowrap;  /* 禁止折行 */
}

.hud-right #online-count { color: var(--green); font-weight: 500; }
.hud-right #current-location { color: rgba(44,62,80,0.6); }

/* ---- 地图容器 ---- */
#map-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background: linear-gradient(135deg, #87CEEB 0%, #B0E2FF 50%, #C8F0D8 100%);
}

#map-container:active { cursor: grabbing; }

#map-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ---- 玩家层 ---- */
#players-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 0 0; /* 与 engine._syncLayerTransform 一致 */
  will-change: transform;
}

.player {
position: absolute;
transform: translate(-50%, -100%);
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
/* 其他玩家：半透明弱化 */
opacity: 0.55;
filter: grayscale(30%) brightness(0.9);
  pointer-events: none;
  transition: left 0.05s linear, top 0.05s linear;
}

.player-bubble {
  background: white;
  border: 2px solid rgba(0,206,255,0.5);
  border-radius: 14px 14px 14px 2px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--ink);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 10px rgba(0,206,255,0.2);
  animation: bubblePop 0.2s ease;
  margin-bottom: 2px;
}

@keyframes bubblePop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.player-avatar {
font-size: 24px;
filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
transition: transform 0.1s;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}

.player-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  display: block;
}

/* 本人角色：全亮 + 光晕 + 更大 */
.player-local {
  opacity: 1 !important;
  filter: none !important;
  z-index: 10 !important;
  position: relative;
}

/* 本人角色底部光圈背景 */
.player-local::before {
  content: '';
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 20px;
  background: radial-gradient(ellipse, rgba(0,206,255,0.55) 0%, rgba(0,206,255,0.15) 55%, transparent 75%);
  border-radius: 50%;
  animation: shadowPulse 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scaleX(1);   opacity: 0.8; }
  50%       { transform: translateX(-50%) scaleX(1.25); opacity: 1;   }
}

.player-local .player-avatar {
font-size: 36px;
width: 44px;
height: 44px;
filter:
  drop-shadow(0 0 8px rgba(0,206,255,1))
  drop-shadow(0 0 18px rgba(0,206,255,0.7))
  drop-shadow(0 0 32px rgba(0,206,255,0.35))
  drop-shadow(0 3px 6px rgba(0,0,0,0.5));
animation: localPulse 2s ease-in-out infinite;
}

.player-local .player-avatar-img {
width: 44px;
height: 44px;
border: 3px solid rgba(0,230,255,1);
box-shadow:
  0 0 0 4px rgba(0,206,255,0.3),
  0 0 16px rgba(0,206,255,0.9),
  0 0 32px rgba(0,206,255,0.5),
  0 4px 10px rgba(0,0,0,0.4);
animation: localImgPulse 2s ease-in-out infinite;
}

@keyframes localPulse {
  0%, 100% { filter:
    drop-shadow(0 0 8px rgba(0,206,255,1))
    drop-shadow(0 0 18px rgba(0,206,255,0.7))
    drop-shadow(0 0 32px rgba(0,206,255,0.35))
    drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
  50% { filter:
    drop-shadow(0 0 14px rgba(0,230,255,1))
    drop-shadow(0 0 28px rgba(0,206,255,0.9))
    drop-shadow(0 0 48px rgba(0,206,255,0.5))
    drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
}

@keyframes localImgPulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(0,206,255,0.3),
      0 0 16px rgba(0,206,255,0.9),
      0 0 32px rgba(0,206,255,0.5),
      0 4px 10px rgba(0,0,0,0.4);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(0,206,255,0.45),
      0 0 24px rgba(0,230,255,1),
      0 0 50px rgba(0,206,255,0.7),
      0 4px 10px rgba(0,0,0,0.4);
  }
}

.player-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(230,245,255,0.9);
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid rgba(116,185,255,0.4);
  white-space: nowrap;
}

.player-local .player-name {
background: rgba(0,206,255,0.22);
border: 1.5px solid rgba(0,206,255,0.7);
color: var(--cyan);
font-weight: 700;
box-shadow: 0 0 6px rgba(0,206,255,0.35);
}

/* ---- 小地图 ---- */
#minimap {
  position: absolute;
  bottom: 20px;
  left: 20px;           /* 小地图左下角 */
  border: 2.5px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(44,62,80,0.2), 0 0 0 1px rgba(116,185,255,0.3);
  z-index: 50;
  background: var(--paper);
  overflow: hidden;
}

/* ---- 商户弹窗 ---- */
#shop-popup {
  position: absolute;
  top: 62px;
  left: 20px;
  width: 340px;
  background: linear-gradient(160deg, rgba(255,255,255,0.98) 0%, rgba(245,250,255,0.96) 100%);
  border: 1.5px solid rgba(116,185,255,0.3);
  border-radius: 22px;
  box-shadow:
    0 12px 48px rgba(44,62,80,0.18),
    0 4px 16px rgba(0,150,255,0.1),
    0 0 0 1px rgba(255,255,255,0.8) inset;
  z-index: 200;
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
}

.popup-enter {
  animation: popupSlide 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popupSlide {
  from { transform: translateX(-20px) scale(0.95); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1.5px solid rgba(116,185,255,0.2);
  background: linear-gradient(135deg, rgba(0,206,255,0.06), rgba(108,92,231,0.06));
}

#popup-icon { font-size: 32px; }

.popup-header h3 {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}

#popup-rating {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stars { color: #f5a623; font-size: 13px; }
.rating-num { font-weight: 700; color: var(--ink); }
.reviews { color: rgba(44,62,80,0.5); }

#popup-close {
  margin-left: auto;
  background: rgba(116,185,255,0.1);
  border: 1.5px solid rgba(116,185,255,0.3);
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 14px;
  cursor: pointer;
  color: rgba(44,62,80,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: all 0.15s;
  align-self: flex-start;
  flex-shrink: 0;
}

#popup-close:hover { background: rgba(0,206,255,0.12); color: var(--cyan); }

.popup-body {
  padding: 14px 16px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-body::-webkit-scrollbar { width: 4px; }
.popup-body::-webkit-scrollbar-thumb { background: rgba(0,206,255,0.4); border-radius: 2px; }

#popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: rgba(0,206,255,0.1);
  border: 1px solid rgba(0,206,255,0.35);
  color: #0090C0;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
}

/* 优惠区 */
.deals-section { display: flex; flex-direction: column; gap: 8px; }

.deals-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
}

.deal-item {
  background: linear-gradient(135deg, rgba(0,206,255,0.05), rgba(108,92,231,0.05));
  border: 1.5px solid rgba(0,206,255,0.2);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deal-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.deal-desc { font-size: 11px; color: rgba(44,62,80,0.55); }
.deal-price { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.price-original { font-size: 12px; color: rgba(44,62,80,0.4); text-decoration: line-through; }
.price-discount { font-size: 16px; font-weight: 700; color: var(--red); }

/* 店员对话区 */
.clerk-section {
  border-top: 1.5px solid rgba(116,185,255,0.25);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clerk-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.clerk-avatar { font-size: 22px; }
.clerk-name { font-weight: 600; color: var(--ink); }
.clerk-online { font-size: 11px; color: var(--green); }

.clerk-bubble {
background: rgba(240,248,255,0.9);
border: 1.5px solid rgba(116,185,255,0.3);
border-radius: 0 14px 14px 14px;
padding: 10px 12px;
font-size: 13px;
color: var(--ink);
line-height: 1.5;
}

/* 歇后语彩蛋提示条 */
.clerk-egg-hint {
  margin: 6px 0 4px;
  padding: 5px 10px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px dashed rgba(255, 180, 0, 0.4);
  border-radius: 8px;
  font-size: 11.5px;
  color: rgba(0,80,140,0.6);
  cursor: default;
  transition: background 0.3s;
}
.clerk-egg-hint:hover {
  background: rgba(255, 215, 0, 0.22);
}

.clerk-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-btn {
  background: rgba(0,206,255,0.08);
  border: 1.5px solid rgba(0,206,255,0.35);
  color: #0090C0;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.quick-btn:hover {
  background: rgba(0,206,255,0.2);
  border-color: rgba(0,206,255,0.6);
  transform: translateY(-1px);
}

.clerk-messages {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.clerk-messages::-webkit-scrollbar { width: 3px; }
.clerk-messages::-webkit-scrollbar-thumb { background: rgba(116,185,255,0.35); border-radius: 2px; }

.clerk-msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  font-size: 12px;
}

.clerk-msg-clerk { flex-direction: row; }
.clerk-msg-user  { flex-direction: row-reverse; }

.clerk-msg-text {
  background: rgba(240,248,255,0.95);
  border: 1.5px solid rgba(116,185,255,0.25);
  border-radius: 10px;
  padding: 6px 10px;
  max-width: 200px;
  line-height: 1.4;
  color: var(--ink);
}

.clerk-msg-user .clerk-msg-text {
  background: rgba(108,92,231,0.08);
  border-color: rgba(108,92,231,0.25);
}

.clerk-input-row {
  display: flex;
  gap: 8px;
}

.clerk-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid rgba(116,185,255,0.4);
  border-radius: 20px;
  background: rgba(240,248,255,0.8);
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
}

.clerk-input-row input:focus { border-color: rgba(0,206,255,0.7); }

.clerk-input-row button {
  padding: 8px 14px;
  background: linear-gradient(135deg, #00CEFF, #6C5CE7);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}

.clerk-input-row button:hover { opacity: 0.85; transform: translateY(-1px); }

.popup-cta {
  display: block;
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, #00CEFF, #6C5CE7);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(0,206,255,0.35);
}

.popup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,206,255,0.45);
}

/* ---- 聊天面板 ---- */
#chat-panel {
  position: absolute;
  bottom: 16px;
  right: 16px;
  left: auto;
  width: 420px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(240,250,255,0.96) 0%, rgba(230,244,255,0.94) 100%);
  border: 1.5px solid rgba(116,185,255,0.3);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0,100,200,0.12),
    0 2px 8px rgba(0,150,255,0.08),
    0 0 0 1px rgba(255,255,255,0.6) inset;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  overflow: hidden;
}

/* 折叠时隐藏消息区和输入框 */
#chat-panel.collapsed #chat-messages,
#chat-panel.collapsed #chat-input-row {
  display: none;
}

/* 折叠态 header 可点击展开 */
#chat-panel.collapsed #chat-header {
  cursor: pointer;
  border-bottom: none;
}
#chat-panel.collapsed #chat-header:hover {
  background: linear-gradient(135deg, rgba(0,206,255,0.14), rgba(108,92,231,0.10));
}

#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1.5px solid rgba(116,185,255,0.2);
  background: linear-gradient(135deg, rgba(0,206,255,0.08), rgba(108,92,231,0.06));
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
}

#chat-title { font-size: 13px; font-weight: 600; color: var(--ink); }

#chat-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: rgba(0,150,200,0.6);
  line-height: 1;
  padding: 0 4px;
}

#chat-messages {
  height: 240px;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

#chat-messages::-webkit-scrollbar { width: 3px; }
#chat-messages::-webkit-scrollbar-thumb { background: rgba(116,185,255,0.35); border-radius: 2px; }

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  animation: msgIn 0.2s ease;
}

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

.chat-msg-system {
  text-align: center;
  color: rgba(0,100,160,0.45);
  font-size: 11px;
  font-style: italic;
  padding: 2px 0;
}

.msg-avatar { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.msg-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.msg-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(0,100,160,0.55);
}

.chat-msg-local .msg-name { color: var(--red); }

.msg-text {
  background: rgba(240,248,255,0.85);
  border: 1.5px solid rgba(116,185,255,0.2);
  border-radius: 10px;
  padding: 5px 8px;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-local .msg-text {
  background: rgba(108,92,231,0.07);
  border-color: rgba(108,92,231,0.2);
}

.msg-time {
  font-size: 10px;
  color: rgba(0,100,160,0.3);
  flex-shrink: 0;
  margin-top: 3px;
}

#chat-input-row {
  display: flex;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1.5px solid rgba(116,185,255,0.2);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid rgba(116,185,255,0.4);
  border-radius: 20px;
  background: rgba(240,248,255,0.8);
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
}

#chat-input:focus { border-color: rgba(0,206,255,0.7); }

#chat-send {
  padding: 8px 14px;
  background: linear-gradient(135deg, #00CEFF, #6C5CE7);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}

#chat-send:hover { opacity: 0.85; transform: translateY(-1px); }

/* ---- 定位自己按钮（嵌在聊天标题栏左侧） ---- */
#locate-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,206,255,0.12);
  border: 1.5px solid rgba(0,206,255,0.35);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
  user-select: none;
  padding: 0;
  line-height: 1;
}

#locate-btn:hover {
  transform: scale(1.15);
  background: rgba(0,206,255,0.22);
}

#locate-btn:active {
  transform: scale(0.9);
}

/* 定位动画：点击后图标旋转一圈 */
#locate-btn.locating {
  animation: locateSpin 0.5s ease-out;
}

@keyframes locateSpin {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.2) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

/* ---- 操作提示 ---- */
#controls-hint {
  position: absolute;
  bottom: 20px;
  left: 210px;   /* 小地图(180px)右侧留出间距，避免与右下角聊天面板重叠 */
  right: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

#controls-hint span {
  background: rgba(230,245,255,0.88);
  border: 1px solid rgba(116,185,255,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  color: rgba(0,80,140,0.65);
  backdrop-filter: blur(8px);
}

/* ---- 进入提示 ---- */
#enter-hint {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(230,245,255,0.97);
  border: 1.5px solid rgba(0,206,255,0.5);
  border-radius: 14px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 4px 20px rgba(0,150,255,0.2);
  opacity: 0;
  pointer-events: none;  /* 隐藏时不拦截事件 */
  transition: all 0.25s;
  white-space: nowrap;
  z-index: 150;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

#enter-hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;  /* 显示时可点击 */
}

#enter-hint:active {
  transform: translateX(-50%) scale(0.95);
  background: rgba(210,240,255,0.97);
}

#enter-hint kbd {
  background: var(--ink);
  color: var(--paper);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

#enter-hint span {
  color: var(--cyan);
  font-weight: 600;
}

/* ============================================================
   手机端全面适配
   ============================================================ */
@media (max-width: 768px) {

  /* ---- 登录卡片 ---- */
  .login-card {
    width: 92vw;
    max-width: 400px;
    padding: 28px 20px 24px;
    border-radius: 22px;
  }
  .login-logo { margin-bottom: 20px; }
  .logo-icon { font-size: 42px; margin-bottom: 8px; }
  .login-logo h1 { font-size: 22px; letter-spacing: 3px; }
  .login-logo p  { font-size: 12px; }
  .login-form { gap: 14px; }
  .login-form input[type="text"] {
    padding: 13px 16px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
  }
  .avatar-btn { width: 46px; height: 46px; }
  .enter-btn  { padding: 15px; font-size: 16px; }
  .city-picker { margin-bottom: 14px; }
  .city-btn { padding: 11px 0; font-size: 15px; }

  /* ---- HUD：手机端精简为两行 ---- */
  #hud {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 4px;
  }
  .hud-left  { gap: 5px; font-size: 12px; order: 1; }
  .hud-center { order: 3; width: 100%; justify-content: center; display: flex; }
  .hud-right { gap: 5px; font-size: 11px; order: 2; }
  .hud-center .hud-title { font-size: 11px; letter-spacing: 0.5px; }
  .hud-right #current-location { display: none; } /* 省掉位置，太挤 */
  .hud-badge { font-size: 9px; padding: 2px 7px; }

  /* ---- 城市切换：嵌入 HUD 第二行，不浮在地图上 ---- */
  #city-switcher {
    position: static;
    transform: none;
    order: 4;
    width: 100%;
    justify-content: center;
    gap: 6px;
    background: none;
    box-shadow: none;
    padding: 2px 0 4px;
  }
  .city-switch-btn {
    padding: 5px 14px;
    font-size: 12px;
    backdrop-filter: none;
  }

  /* ---- HUD 改为 flex-wrap 容纳城市切换行 ---- */
  #hud {
    flex-wrap: wrap;
    align-items: center;
  }

  /* ---- 音乐控制：收进 HUD 右侧，紧凑图标模式 ---- */
  #music-ctrl {
    position: static;
    order: 2;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    gap: 2px;
  }
  #music-toggle { font-size: 18px; padding: 0; }
  #music-label  { display: none; } /* 手机端只显示图标 */

  /* ---- 商户弹窗：底部抽屉式 ---- */
  #shop-popup {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
  }
  @keyframes popupSlide {
    from { transform: translateY(100%); opacity: 0.6; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .popup-header {
    padding: 14px 14px 10px;
    gap: 10px;
  }
  .popup-header h3 { font-size: 15px; }
  .popup-photo-wrap { width: 68px; height: 68px; }
  #popup-close {
    width: 34px; height: 34px;
    font-size: 16px;
  }
  .popup-body {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    gap: 10px;
    /* iOS 弹性滚动 */
    -webkit-overflow-scrolling: touch;
  }
  /* 弹窗顶部拖拽把手 */
  #shop-popup::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    margin: 8px auto 0;
    flex-shrink: 0;
  }
  .clerk-messages { max-height: 120px; }
  .clerk-input-row input  { font-size: 16px; } /* 防 iOS 缩放 */

  /* ---- 聊天面板：底部全宽，折叠时只显示标题栏 ---- */
  #chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 14px 14px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  /* 地图容器底部留出聊天面板折叠高度，避免内容被遮挡 */
  #map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 52px;   /* 折叠态高度 */
    height: auto;
    transition: bottom 0.25s;
  }
  /* 聊天展开时地图缩小，留出面板空间（约 300px = 消息区200 + header44 + 输入行56） */
  body.chat-open #map-container {
    bottom: 300px;
  }
  #chat-panel.collapsed {
    /* 折叠时只露出标题栏 */
  }
  #chat-messages { height: 200px; }

  /* 聊天展开时面板高度自适应，最大不超过地图区域一半 */
  #chat-panel:not(.collapsed) {
    max-height: 55vh;
  }
  #chat-input { font-size: 16px; } /* 防 iOS 缩放 */
  #chat-header { min-height: 44px; padding: 8px 14px; }
  #chat-title  { font-size: 13px; }
  #locate-btn  { width: 30px; height: 30px; font-size: 15px; }

  /* iOS safe area：输入行底部留出 home indicator 空间 */
  #chat-input-row {
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  }
  /* 整个面板底部也跟随 safe area */
  #chat-panel {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* ---- 小地图：手机端显示，右上角小尺寸 ---- */
  #minimap {
    display: block !important;
    bottom: auto;
    top: 104px;  /* HUD双行高度约96px，再留间距 */
    left: auto;
    right: 10px;
    width: 90px !important;
    height: 72px !important;
    border-radius: 10px;
    opacity: 0.85;
  }

  /* ---- 操作提示：换成手机提示 ---- */
  #controls-hint {
    display: flex !important;
    bottom: auto;
    top: 104px;  /* 与小地图对齐，避开双行HUD */
    right: auto;
    left: 10px;
    gap: 3px;
  }
  #controls-hint span {
    font-size: 10px;
    padding: 4px 8px;
  }
  /* 隐藏键盘提示，只保留触摸提示 */
  #controls-hint span:first-child { display: none; }

  /* ---- 进入提示：手机端上移，避开聊天栏 ---- */
  #enter-hint {
    bottom: 220px;
    font-size: 12px;
    padding: 8px 16px;
  }

  /* ---- POI 图片标签：手机端稍大 ---- */
  .poi-photo-label { font-size: 9px; }

  /* ---- 手机端隐藏桌面浮层（城市切换 + 音乐控制） ---- */
  #city-switcher { display: none !important; }
  #music-ctrl    { display: none !important; }

  /* ---- 手机端 HUD 第二行 ---- */
  .hud-mobile-row {
    display: flex !important;
    width: 100%;
    order: 4;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 3px 0 5px;
    border-top: 1px solid rgba(116,185,255,0.2);
  }

}

/* ---- 手机端 HUD 第二行按钮样式（全局，不在 media query 内） ---- */
.hud-mobile-row {
  display: none; /* 桌面端隐藏 */
}

.city-switch-btn-m {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(116,185,255,0.4);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s;
  font-family: var(--font-body);
}

.city-switch-btn-m.active {
  background: linear-gradient(135deg, #74B9FF, #0984E3);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(9,132,227,0.3);
}

#music-toggle-m {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(116,185,255,0.4);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  padding: 0;
  line-height: 1;
}

#music-toggle-m:active { transform: scale(0.9); }

/* ---- 未读消息徽章 ---- */
#chat-unread-badge {
  display: none;
  background: #FF4757;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(255,71,87,0.4);
  animation: badgePop 0.2s ease;
}

@keyframes badgePop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* 消息入场动画已在上方定义，此处不重复 */

/* ============================================================
   POI 实拍图浮层
   ============================================================ */
#poi-photo-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  transform-origin: 0 0; /* 与 engine._syncLayerTransform 一致 */
  will-change: transform;
}

.poi-photo-card {
  position: absolute;
  border-radius: 50%;
  overflow: visible;   /* 允许光环溢出 */
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.22),
    0 1px 4px rgba(0,0,0,0.12),
    0 0 0 1px rgba(0,150,255,0.15);
  cursor: pointer;
  pointer-events: all;
  opacity: 0;
  transform: scale(0.7) translateY(6px);
  transition: opacity 0.35s, transform 0.35s;
  background: #eee;
  animation: none;
  clip-path: none;
  /* 抵消 layer 的 scale，让卡片在屏幕上保持固定视觉大小 */
  transform-origin: 50% 100%;
}

.poi-photo-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: poiFloat 3s ease-in-out infinite;
}

/* 悬浮抖动（幅度加大以补偿 layer scale 缩小） */
@keyframes poiFloat {
  0%   { transform: scale(1) translateY(0px); }
  50%  { transform: scale(1) translateY(-10px); }
  100% { transform: scale(1) translateY(0px); }
}

/* 脉冲光环（::before 伪元素） */
.poi-photo-card.visible::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0, 206, 255, 0.6);
  animation: poiPulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes poiPulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.poi-photo-card:hover {
  transform: scale(1.22) translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 50;
  animation: none !important;
}

.poi-photo-card:hover::before {
  animation: none;
  border-color: rgba(255, 140, 66, 0.8);
  transform: scale(1.1);
  opacity: 1;
}

/* 内层裁剪容器 */
.poi-photo-img-wrap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.poi-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poi-photo-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 13px;
  background: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  line-height: 1;
}

.poi-photo-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(116,185,255,0.4);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  color: #2C3E50;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ---- POI 聚合气泡 ---- */
.poi-cluster {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00CEFF, #6C5CE7);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 3px 12px rgba(0,150,255,0.45), 0 0 0 4px rgba(0,206,255,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: clusterPulse 2.5s ease-in-out infinite;
}
.poi-cluster:hover {
  transform: scale(1.18);
  box-shadow: 0 6px 20px rgba(0,150,255,0.6), 0 0 0 6px rgba(0,206,255,0.3);
}
@keyframes clusterPulse {
  0%,100% { box-shadow: 0 3px 12px rgba(0,150,255,0.45), 0 0 0 4px rgba(0,206,255,0.2); }
  50%      { box-shadow: 0 3px 12px rgba(0,150,255,0.45), 0 0 0 10px rgba(0,206,255,0.08); }
}

/* ---- 无图片 POI 文字气泡 ---- */
.poi-text-card {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid rgba(116,185,255,0.45);
  border-radius: 20px;
  padding: 4px 8px 4px 5px;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0,100,200,0.15);
  opacity: 0;
  transition: opacity 0.3s, transform 0.15s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.poi-text-card.visible {
  opacity: 1;
}
.poi-text-card::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(116,185,255,0.6);
}
.poi-text-card:hover {
  transform: translate(-50%, -100%) scale(1.06);
  box-shadow: 0 4px 14px rgba(0,100,200,0.25);
}
.poi-text-icon {
  font-size: 13px;
  line-height: 1;
}
.poi-text-name {
  font-size: 11px;
  font-weight: 500;
  color: #2C3E50;
  line-height: 1;
}

/* ============================================================
   天气 Canvas 层
   ============================================================ */
#weather-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  display: none;
}

/* ============================================================
   天气 Badge
   ============================================================ */
.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: background 0.5s, color 0.5s;
}

.weather-sunny  { background: rgba(255,220,50,0.25);  color: #B8860B; border: 1px solid rgba(255,220,50,0.5); }
.weather-rainy  { background: rgba(100,150,220,0.25); color: #1565C0; border: 1px solid rgba(100,150,220,0.5); }
.weather-cloudy { background: rgba(180,190,200,0.25); color: #546E7A; border: 1px solid rgba(180,190,200,0.5); }
.weather-night  { background: rgba(30,50,80,0.35);    color: #B0C4DE; border: 1px solid rgba(100,130,180,0.4); }

/* ============================================================
   音乐控制
   ============================================================ */
#music-ctrl {
  position: absolute;
  top: 52px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.88);
  border: 1.5px solid rgba(116,185,255,0.4);
  border-radius: 20px;
  padding: 5px 12px 5px 6px;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

#music-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: transform 0.2s;
}

#music-toggle:hover { transform: scale(1.2); }

#music-label {
  font-size: 11px;
  color: rgba(44,62,80,0.7);
  white-space: nowrap;
}

/* ============================================================
   城市切换按钮
   ============================================================ */
#city-switcher {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
}

.city-switch-btn {
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(116,185,255,0.4);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s;
  color: var(--ink);
}

.city-switch-btn:hover {
  background: rgba(116,185,255,0.2);
  transform: translateY(-1px);
}

.city-switch-btn.active {
  background: linear-gradient(135deg, #74B9FF, #0984E3);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(9,132,227,0.35);
}

/* ============================================================
   弹窗：评价 + 促销区块
   ============================================================ */
.reviews-section,
.promos-section {
  margin-top: 12px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid rgba(116,185,255,0.3);
}

.review-item {
  background: rgba(240,248,255,0.7);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.review-user {
  font-weight: 600;
  color: var(--ink);
}

.review-stars {
  color: #FFD700;
  font-size: 11px;
}

.review-time {
  color: rgba(44,62,80,0.45);
  font-size: 10px;
  margin-left: auto;
}

.review-text {
  color: rgba(44,62,80,0.75);
  line-height: 1.5;
}

.reviews-more {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.reviews-toggle-btn {
  width: 100%;
  background: rgba(116,185,255,0.08);
  border: 1px dashed rgba(116,185,255,0.4);
  border-radius: 8px;
  padding: 5px 0;
  font-size: 11px;
  color: rgba(0,144,192,0.8);
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.reviews-toggle-btn:hover {
  background: rgba(116,185,255,0.15);
  color: var(--cyan);
}

.promo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,240,220,0.7);
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 5px;
  font-size: 12px;
  border-left: 3px solid var(--orange);
}

.promo-item.promo-coupon { border-left-color: #FF4757; background: rgba(255,71,87,0.08); }
.promo-item.promo-member { border-left-color: #6C5CE7; background: rgba(108,92,231,0.08); }
.promo-item.promo-new    { border-left-color: #2ECC71; background: rgba(46,204,113,0.08); }
.promo-item.promo-group  { border-left-color: #FF8C42; background: rgba(255,140,66,0.08); }

.promo-title {
  font-weight: 700;
  white-space: nowrap;
}

.promo-desc {
  flex: 1;
  color: rgba(44,62,80,0.7);
}

.promo-expire {
  font-size: 10px;
  color: rgba(44,62,80,0.45);
  white-space: nowrap;
}

/* ============================================================
   彩蛋烟花动画
   ============================================================ */
.firework-emoji {
  position: absolute;
  font-size: 28px;
  pointer-events: none;
  z-index: 9999;
  animation: fireworkFloat 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  transform-origin: center;
  will-change: transform, opacity;
}

@keyframes fireworkFloat {
  0%   {
    opacity: 1;
    transform: scale(0.3) translateY(0) rotate(0deg);
    filter: brightness(2);
  }
  20%  {
    opacity: 1;
    transform: scale(1.6) translateY(-20px) rotate(15deg);
    filter: brightness(1.5);
  }
  60%  {
    opacity: 0.9;
    transform: scale(1.2) translateY(-55px) rotate(-10deg);
    filter: brightness(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-110px) rotate(20deg);
    filter: brightness(0.8);
  }
}

/* ============================================================
   彩蛋聊天消息特殊样式
   ============================================================ */
.chat-msg-egg {
  background: linear-gradient(135deg,
    rgba(255,215,0,0.15) 0%,
    rgba(255,140,66,0.12) 30%,
    rgba(108,92,231,0.12) 70%,
    rgba(0,206,255,0.15) 100%);
  border: 1.5px solid rgba(255,215,0,0.5);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 4px 0;
  opacity: 0;
  transform: scale(0.95) translateY(4px);
  transition: opacity 0.4s, transform 0.4s;
  position: relative;
  overflow: hidden;
}

.chat-msg-egg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 50%,
    transparent 100%);
  animation: eggShine 2s ease-in-out infinite;
}

@keyframes eggShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.chat-msg-egg.egg-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.egg-name {
  background: linear-gradient(90deg, #FFD700, #FF8C42, #6C5CE7, #00CEFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800 !important;
  font-size: 12px !important;
}

.egg-text {
  color: rgba(44,62,80,0.9) !important;
  font-weight: 500;
  line-height: 1.5;
}

/* ============================================================
   弹窗实拍图
   ============================================================ */
.popup-photo-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
}

.popup-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.popup-icon-overlay {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 18px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================================================
   登录界面城市选择
   ============================================================ */
.city-picker {
  margin-bottom: 20px;
}

.city-picker-label {
  display: block;
  font-size: 12px;
  color: rgba(44,62,80,0.55);
  margin-bottom: 8px;
  font-weight: 500;
}

.city-btns {
  display: flex;
  gap: 10px;
}

.city-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 12px;
  border: 2px solid rgba(116,185,255,0.4);
  background: rgba(240,248,255,0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--ink);
}

.city-btn:hover {
  background: rgba(116,185,255,0.2);
  transform: translateY(-1px);
}

.city-btn.active {
  background: linear-gradient(135deg, #74B9FF, #0984E3);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(9,132,227,0.3);
}

/* ============================================================
   虚拟摇杆（仅手机端显示）
   ============================================================ */
#joystick-zone {
  display: none; /* 默认隐藏，手机端 JS 检测后显示 */
  position: fixed;
  bottom: 120px;  /* 再下移一点 */
  left: 24px;
  z-index: 300;
  touch-action: none;
  user-select: none;
}

#joystick-base {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.10) 60%, rgba(0,0,0,0.08) 100%);
  border: 2px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 6px 24px rgba(0,0,0,0.22),
    0 2px 8px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 方向刻度线 */
#joystick-base::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.25);
}

#joystick-knob {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,206,255,0.85), rgba(108,92,231,0.85));
  border: 2px solid rgba(255,255,255,0.7);
  box-shadow:
    0 3px 12px rgba(0,0,0,0.25),
    0 0 0 4px rgba(0,206,255,0.2),
    inset 0 1px 0 rgba(255,255,255,0.4);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: box-shadow 0.1s;
  pointer-events: none;
}

#joystick-knob.active {
  box-shadow:
    0 3px 16px rgba(0,0,0,0.3),
    0 0 0 6px rgba(0,206,255,0.35),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

/* 方向箭头提示 */
#joystick-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#joystick-arrows span {
  position: absolute;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}
#joystick-arrows .arr-up    { top: 4px;  left: 50%; transform: translateX(-50%); }
#joystick-arrows .arr-down  { bottom: 4px; left: 50%; transform: translateX(-50%); }
#joystick-arrows .arr-left  { left: 4px;  top: 50%; transform: translateY(-50%); }
#joystick-arrows .arr-right { right: 4px; top: 50%; transform: translateY(-50%); }

/* 橙色进入按钮已废弃，统一用横幅点击 */
#mobile-enter-btn { display: none !important; }

@media (max-width: 768px) {
  #joystick-zone { display: block; }
  /* 聊天面板在摇杆上方留出空间 */
  #chat-panel {
    bottom: 0;
  }
  /* POI 弹窗展开时：隐藏摇杆 + 进入按钮 + 进入提示 */
  body.poi-open #joystick-zone,
  body.poi-open #enter-hint { display: none !important; }

}

/* ============================================================
   POI 展开时隐藏聊天广场
   ============================================================ */
#chat-panel.poi-hidden {
  display: none !important;
}

/* 聊天广场展开时：隐藏摇杆（移出 media query，确保所有设备生效） */
body.chat-open #joystick-zone { display: none !important; }

/* ============================================================
   查看新消息按钮（悬浮在聊天面板消息区底部）
   ============================================================ */
#chat-new-msg-btn {
  display: none;
  position: fixed;
  bottom: 108px;  /* 聊天面板输入框上方 */
  right: 28px;
  z-index: 200;
  background: rgba(0, 160, 220, 0.92);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,120,200,0.35);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

#chat-new-msg-btn.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#chat-new-msg-btn:active {
  transform: scale(0.95);
}

/* 手机端：聊天面板全宽，按钮位置调整 */
@media (max-width: 768px) {
  #chat-new-msg-btn {
    bottom: 96px;
    right: 16px;
  }
}
