/* 顶部状态条、场景切换、后门常驻入口、横幅与提示 */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-hud);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 1rem;
  padding: 0.7rem 1.1rem 2.2rem;
  background: linear-gradient(180deg, rgba(8, 11, 13, 0.88) 0%, rgba(8, 11, 13, 0.55) 55%, rgba(8, 11, 13, 0) 100%);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.app.is-title .hud, .app.is-title .scene-nav { display: none; }

.hud__place { display: flex; flex-direction: column; line-height: 1.3; }
.hud__day { font-size: 1rem; color: var(--ink); letter-spacing: 0.05em; }
.hud__city { font-size: 0.8rem; color: var(--ink-2); }

.hud__clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.hud__time {
  font-family: var(--font-mono);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #f0e9d2;
  text-shadow: 0 0 18px rgba(232, 194, 122, 0.18);
}
.hud__status { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.05rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: rgba(21, 25, 27, 0.8);
  font-size: 0.78rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill--open { border-color: #6f8f68; color: #bfe0b6; }
.pill--closed { border-color: #8a5a50; color: #e6b5aa; }
.pill--paused { border-color: #8a7a52; color: #ecd59a; }
.pill__dot { width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; }
.pill--running .pill__dot { animation: dot-pulse 1.5s ease-in-out infinite; }
@keyframes dot-pulse { 50% { opacity: 0.35; } }
html.reduce-motion .pill--running .pill__dot, html.reduce-flashing .pill--running .pill__dot { animation: none; }

.hud__right { display: flex; justify-content: flex-end; align-items: flex-start; gap: 0.6rem; }
.hud__cash { text-align: right; line-height: 1.25; }
.hud__cash-value { font-family: var(--font-mono); font-size: 1.35rem; color: #f0e9d2; }
.hud__cash-unit { font-size: 0.8rem; color: var(--ink-2); margin-left: 0.2em; }
.hud__arrears { font-size: 0.78rem; color: var(--rust-2); }
.hud__weather { font-size: 0.78rem; color: var(--ink-2); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(21, 25, 27, 0.75);
  color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }

/* 场景切换 */
.scene-nav {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(13, 16, 18, 0.86);
  box-shadow: var(--shadow);
}
.scene-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 4.6rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.8rem;
}
.scene-nav__btn svg { width: 1.3rem; height: 1.3rem; }
.scene-nav__btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.scene-nav__short { display: none; }
.scene-nav__btn[aria-current="true"] { color: #f0e9d2; border-color: var(--line-2); background: rgba(79, 98, 109, 0.35); }

/* 窄屏物件清单 */
.hotspot-list {
  display: none;
  position: fixed;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 4.9rem;
  z-index: var(--z-nav);
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}
.hotspot-list .btn { background: rgba(21, 25, 27, 0.9); }

/* 横幅（只读标签页、断线） */
.banner {
  position: fixed;
  top: 5.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-banner);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: calc(100vw - 2rem);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid #8a7a52;
  background: rgba(40, 34, 20, 0.95);
  color: #f1e3b8;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.banner[hidden] { display: none; }
.banner--offline { border-color: #8a5a50; background: rgba(48, 24, 20, 0.95); color: #f4d8d1; }

/* 提示 */
.toasts {
  position: fixed;
  top: 5.2rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  background: rgba(21, 25, 27, 0.96);
  color: var(--ink);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s var(--ease);
  pointer-events: auto;
}
.toast--error { border-color: #a35a4e; }
.toast--ok { border-color: #6f8f68; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } }
html.reduce-motion .toast { animation: none; }

/* ---- 窄屏：场景切换改为底部工具条，后门入口不需要横向滚动 ---- */
@media (max-width: 760px) {
  .hud { grid-template-columns: 1fr auto; padding: 0.5rem 0.75rem 1.6rem; gap: 0.5rem; }
  .hud__clock { grid-column: 1 / -1; grid-row: 2; }
  .hud__time { font-size: 1.6rem; }
  .hud__city { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .hud__day { white-space: nowrap; }
  .hud__right { gap: 0.3rem; }
  .hud__cash-unit, .hud__weather { display: none; }
  .hud__cash-value { font-size: 1.1rem; }
  .icon-btn { width: 2.1rem; height: 2.1rem; }
  .scene-nav {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    border-radius: 0;
    border-width: 1px 0 0;
    justify-content: space-between;
    padding: 0.25rem;
  }
  .scene-nav__btn { min-width: 0; flex: 1; padding: 0.3rem 0.1rem; font-size: 0.72rem; white-space: nowrap; }
  .scene-nav__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .scene-nav__short { display: inline; }
  .hotspot-list { display: flex; bottom: 3.9rem; }
  .banner, .toasts { top: 6.4rem; }
  .toasts { left: 1rem; right: 1rem; width: auto; }
}

/* 阶段6：座机按钮上的未接来电数 */
.icon-btn--badge { position: relative; }
.icon-btn__badge {
  position: absolute; top: -0.35rem; right: -0.35rem; min-width: 1.1rem; height: 1.1rem; padding: 0 0.25rem;
  border-radius: 999px; background: var(--rust-2); color: #fff4e6; font-size: 0.7rem; line-height: 1.1rem; text-align: center;
}

/* 阶段7：监控角标——门外有动静时亮一个红点（只提醒，不遮后门：在顶栏，不在右下角） */
.icon-btn--monitor { position: relative; }
.icon-btn--monitor .icon-btn__dot { display: none; position: absolute; top: -0.2rem; right: -0.2rem; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--rust-2); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }
.icon-btn--monitor.is-alert { color: #f4d8d1; border-color: #c06a5c; }
.icon-btn--monitor.is-alert .icon-btn__dot { display: block; animation: monitor-blink 1.6s ease-in-out infinite; }
@keyframes monitor-blink { 50% { opacity: 0.35; } }
:root.reduce-motion .icon-btn--monitor.is-alert .icon-btn__dot { animation: none; }
