/* ============================================================
   restaurant.css - 清水河·猫猫食堂 UI（移动端优先）
   ============================================================ */
.rs-top { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 0.95rem; }
.rs-lv { background: var(--pink); color: #fff; border-radius: 14px; padding: 3px 12px; }
.rs-coin { color: #8a6a2a; font-weight: bold; }
.rs-exp { color: var(--text-soft); font-size: 0.85rem; }
.rs-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 8px 0; }
.rs-body { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.rs-scene { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; background: rgba(255,255,255,0.6); border-radius: 14px; padding: 12px; }
.rs-cat { position: relative; font-size: 2rem; display: flex; flex-direction: column; align-items: center; }
.rs-cat small { font-size: 0.65rem; color: var(--text-soft); }
.rs-cat.w { animation: rs-bob 1.2s ease-in-out infinite; }
.rs-cat.r { animation: rs-rest 2.4s ease-in-out infinite; opacity: 0.8; }
.rs-cat.p { animation: rs-bob 0.6s ease-in-out infinite; }
.rs-cat.i { opacity: 0.9; }
.rs-custs { display: flex; gap: 8px; align-items: flex-end; }
.rs-cust { font-size: 1.4rem; animation: rs-bob 1.6s ease-in-out infinite; }
.rs-cust.c1 { animation-delay: 0.4s; } .rs-cust.c2 { animation-delay: 0.8s; }
.rs-cust:empty::before { content: '🐾'; opacity: 0.6; }
.rs-tag { position: absolute; top: -6px; right: -6px; font-style: normal; font-size: 0.6rem; background: var(--pink); color: #fff; border-radius: 8px; padding: 1px 4px; }
@keyframes rs-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes rs-rest { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(1px) scale(0.98); } }
.rs-info { text-align: center; font-size: 0.85rem; color: var(--text-soft); }
.rs-sec { font-size: 0.9rem; color: var(--pink-deep); margin-top: 6px; }

/* ---------- V2 可视化场景 ---------- */
.rs-stage { position: relative; width: 100%; max-width: min(94vw, 880px); margin: 0 auto; aspect-ratio: 16/10; border-radius: 16px; overflow: hidden; background: #f7e8d3; }
.rs-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rs-bglayer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.rs-hot { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.rs-hotspot { position: absolute; transform: translate(-50%,-50%); pointer-events: auto; cursor: pointer; border-radius: 10px; transition: background .18s ease, box-shadow .18s ease; }
.rs-hotspot:hover { background: rgba(255,246,230,0.18); box-shadow: 0 0 0 2px rgba(255,246,230,0.5) inset; }
.rs-stage.night { filter: brightness(0.85); }
.rs-stage.rain { background: #dfe4ee; }
.rs-stage.snow { background: #eef2f7; }
.rs-hud { position: absolute; top: 6px; left: 8px; z-index: 5; pointer-events: none; background: rgba(255,252,245,0.85); border-radius: 12px; padding: 3px 10px; font-size: 0.8rem; color: #7a5a3a; }
.rs-npc { position: absolute; width: 15%; transform: translate(-50%,-50%); transition: left 1.6s ease, top 1.6s ease; cursor: pointer; z-index: 3; display: flex; flex-direction: column; align-items: center; }
.rs-npc-art { display: block; width: 100%; }
.rs-npc svg { width: 100%; }
.rs-npc small { font-size: 0.6rem; color: #7a5a3a; background: rgba(255,252,245,0.8); border-radius: 8px; padding: 0 5px; }
.rs-npc.r svg { animation: rs-rest 2.4s ease-in-out infinite; }
.rs-npc.w svg { animation: rs-bob 1.1s ease-in-out infinite; }
.rs-npc.p svg { animation: rs-bob 0.6s ease-in-out infinite; }
.rs-npc .npc-tail { transform-origin: 44px 48px; animation: gb-tailwag 1.2s ease-in-out infinite; }
.rs-cust2 { position: absolute; width: 6%; height: 9%; transform: translate(-50%,-50%); border-radius: 50% 50% 40% 40%; background: #b9c8dd; transition: left 1.4s ease, top 1.4s ease; z-index: 2; }
.rs-cust2.enter { background: #a9b8cd; }
.rs-cust2.eat { background: #cdd9ea; }
.rs-cust2.leave { opacity: 0.5; }
.rs-food { position: absolute; top: -1.1em; left: 50%; transform: translateX(-50%); font-size: 0.8rem; font-style: normal; }
.rs-pay { position: absolute; top: -1.2em; left: 50%; transform: translateX(-50%); font-size: 0.7rem; font-style: normal; color: #b8860b; animation: rs-payfloat 1.4s ease forwards; }
@keyframes rs-payfloat { 0% { opacity: 1; transform: translate(-50%,0); } 100% { opacity: 0; transform: translate(-50%,-1em); } }
.rs-oven-dish { position: absolute; left: 13%; top: 45%; font-size: 1rem; z-index: 3; animation: rs-bob 1s ease-in-out infinite; }
.rs-player { position: absolute; transform: translate(-50%,-50%); font-size: 1.6rem; transition: left 0.8s ease, top 0.8s ease; z-index: 4; cursor: pointer; }
.rs-bar { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.rs-stage.hol-spring::after, .rs-stage.hol-christmas::after, .rs-stage.hol-birthday::after {
  content: '🎉'; position: absolute; top: 4px; right: 8px; font-size: 1rem; z-index: 5; }
.rs-stage.hol-christmas::after { content: '🎄'; }
.rs-stage.hol-birthday::after { content: '🎂'; }
.rs-emp { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.7); border-radius: 12px; padding: 8px 10px; }
.rs-eicon { position: relative; font-size: 1.6rem; }
.rs-emeta { flex: 1; display: flex; flex-direction: column; }
.rs-emeta b { font-weight: normal; }
.rs-emeta small { color: var(--text-soft); font-size: 0.75rem; }
/* 结算报告 */
.rs-report { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }
.rr-row { display: flex; justify-content: space-between; font-size: 0.9rem; background: rgba(255,255,255,0.7); border-radius: 10px; padding: 6px 12px; }
.rr-net { text-align: center; font-size: 1.1rem; color: var(--pink-deep); background: #fff3e8; border-radius: 12px; padding: 8px; margin: 6px 0; }

/* ============================================================
   猫咪生活层：头顶气泡 + 底部剧情框（不遮挡按钮，不阻塞操作）
   ============================================================ */
.rs-lifehint { text-align: center; font-size: 0.72rem; color: var(--text-soft); margin-top: 6px; }

/* 正在说话的猫抬高一点，别被别的猫压住 */
.rs-npc.speaking { z-index: 30; }
.rs-npc.speaking svg { animation: rs-speak 0.5s ease-in-out 2; }
@keyframes rs-speak { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* 单句气泡 */
.rs-say {
  position: absolute; bottom: calc(100% - 4px); left: 50%;
  transform: translate(-50%, 6px);
  width: max-content; max-width: 168px;
  padding: 5px 9px 6px;
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid rgba(180, 140, 105, 0.35);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(107, 79, 63, 0.18);
  font-size: 0.68rem; line-height: 1.45; color: #5b4636;
  text-align: center;
  pointer-events: none;
  z-index: 31;
  opacity: 0;
  animation: rs-say-in 0.24s ease forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.rs-say::after {
  content: ''; position: absolute; left: 50%; bottom: -6px;
  width: 9px; height: 9px; margin-left: -5px;
  background: rgba(255, 253, 248, 0.97);
  border-right: 1px solid rgba(180, 140, 105, 0.35);
  border-bottom: 1px solid rgba(180, 140, 105, 0.35);
  transform: rotate(45deg);
}
.rs-say.out { opacity: 0; transform: translate(-50%, -6px); }
@keyframes rs-say-in { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
.rs-say-name { display: block; font-size: 0.6rem; font-weight: normal; opacity: 0.72; }
.rs-say-ico { font-style: normal; margin-right: 2px; }
.rs-say.c-h { border-color: rgba(214, 138, 60, 0.5); }
.rs-say.c-b { border-color: rgba(150, 175, 120, 0.55); }
.rs-say.c-x { border-color: rgba(120, 140, 165, 0.5); }
.rs-say.c-m { border-color: rgba(190, 150, 190, 0.5); }
.rs-say.c-k { border-color: rgba(170, 165, 160, 0.5); }

/* 站在左右边缘的猫：气泡贴边展开，绝不超出场景 */
.rs-say.edge-l { left: 0; transform: none; animation-name: rs-say-in-plain; }
.rs-say.edge-r { left: auto; right: 0; transform: none; animation-name: rs-say-in-plain; }
.rs-say.edge-l::after { left: 26%; }
.rs-say.edge-r::after { left: 74%; }
.rs-say.edge-l.out, .rs-say.edge-r.out { transform: translateY(-6px); }
@keyframes rs-say-in-plain { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 旁白 / 找不到角色时的顶部提示条 */
.rs-say--float {
  bottom: auto; top: 8%; max-width: 74%;
  transform: translate(-50%, 0);
  background: rgba(74, 62, 54, 0.9);
  border-color: transparent; color: #fdf6ec;
  font-size: 0.72rem; padding: 6px 12px;
  animation: rs-float-in 0.26s ease forwards;
}
.rs-say--float::after { display: none; }
.rs-say--float.out { opacity: 0; transform: translate(-50%, -8px); }
@keyframes rs-float-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 多句剧情框（特殊剧情才用，明显但不挡路） */
.rs-convo {
  position: absolute; left: 50%; bottom: 10px;
  width: min(90%, 520px);
  transform: translate(-50%, 14px);
  background: rgba(255, 252, 245, 0.97);
  border: 1px solid rgba(180, 140, 105, 0.4);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(107, 79, 63, 0.22);
  padding: 10px 14px 8px;
  z-index: 40;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.rs-convo.show { opacity: 1; transform: translate(-50%, 0); }
.rs-convo-who { font-size: 0.72rem; color: #b07437; margin-bottom: 3px; min-height: 1em; }
.rs-convo-who.c-x { color: #6c7f96; }
.rs-convo-who.c-b { color: #7f9a5e; }
.rs-convo-txt { font-size: 0.86rem; line-height: 1.6; color: #4f3d30; }
.rs-convo-tip { font-size: 0.6rem; color: var(--text-soft); text-align: right; margin-top: 4px; }

@media (max-width: 480px) {
  .rs-say { max-width: 118px; font-size: 0.64rem; }
  .rs-convo { bottom: 6px; padding: 8px 11px 6px; }
  .rs-convo-txt { font-size: 0.8rem; }
  .rs-lifehint { font-size: 0.66rem; }
}
