/* 桌间漫游 · 访客指路层（不改动 office-navigator 混淆脚本）
 * 暖色半透明玻璃，贴近工作室木色/奶油墙，少挡 3D。
 */

:root {
  /* 奶油 / 桃雾玻璃：房间能透出来 */
  --wg-bg: rgba(255, 246, 235, 0.62);
  --wg-bg-solid: rgba(255, 248, 240, 0.78);
  --wg-bg-item: rgba(255, 255, 255, 0.42);
  --wg-fg: #4a3428;
  --wg-muted: rgba(74, 52, 40, 0.68);
  --wg-accent: #e08a5a;
  --wg-accent-soft: rgba(224, 138, 90, 0.22);
  --wg-border: rgba(196, 148, 110, 0.38);
  --wg-radius: 16px;
  --wg-z-dir: 40;
  --wg-z-welcome: 50;
  --wg-shadow: 0 8px 28px rgba(90, 55, 35, 0.14);
}

/* —— 再弱化房间状态文案，别抢戏 —— */
.site-shell .room-context {
  opacity: 0.28;
  z-index: 4;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  transition: opacity 0.25s ease;
}
.site-shell .room-context:hover,
.site-shell .room-context:focus-within {
  opacity: 0.55;
}
.site-shell .room-context p {
  font-size: 0.72rem;
  padding: 3px 9px;
  background: rgba(255, 246, 235, 0.45);
  color: rgba(74, 52, 40, 0.75);
  border: 1px solid rgba(196, 148, 110, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@media (max-width: 620px) {
  .site-shell .room-context {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    opacity: 0.2;
  }
}

/* —— 「房间全景」略暖，不抢戏 —— */
.site-shell .room-navigation {
  z-index: 8;
}
.site-shell .room-return {
  box-shadow: 0 3px 14px rgba(90, 55, 35, 0.12);
  border-color: rgba(196, 148, 110, 0.45);
  background: rgba(255, 246, 235, 0.55);
  color: var(--wg-fg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-shell .room-return:not(:disabled):hover {
  border-color: var(--wg-accent);
  background: rgba(255, 248, 240, 0.78);
}
.site-shell .room-return-hint {
  opacity: 0.55;
  font-size: 0.72rem;
}

/* 原 keyboard-projects 默认离屏；指路层启用后改为弱可见兜底 */
.site-shell.wsnail-guide-ready .keyboard-projects {
  position: absolute;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  display: none; /* 主目录由指路层承担；保留焦点可达 */
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 32px);
}
.site-shell.wsnail-guide-ready .keyboard-projects:focus-within {
  display: flex;
}
.site-shell.wsnail-guide-ready .keyboard-projects button {
  border: 1px solid var(--wg-border);
  background: rgba(255, 246, 235, 0.7);
  color: var(--wg-fg);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.site-shell.wsnail-guide-ready .keyboard-projects button:hover,
.site-shell.wsnail-guide-ready .keyboard-projects button:focus-visible {
  border-color: var(--wg-accent);
  background: rgba(255, 248, 240, 0.9);
  transform: translateY(-1px);
}

/* —— 常驻「去哪里」目录 —— */
.wsnail-guide-dir {
  position: fixed;
  z-index: var(--wg-z-dir);
  right: calc(12px + env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  width: min(220px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--wg-fg);
  background: var(--wg-bg);
  border: 1px solid var(--wg-border);
  border-radius: var(--wg-radius);
  box-shadow: var(--wg-shadow);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.wsnail-guide-dir[hidden] {
  display: none !important;
}
/* 欢迎层打开时：收起/藏目录，避免和欢迎卡叠在一起 */
.wsnail-guide-dir.is-welcome-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.wsnail-guide-dir__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--wg-border);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.wsnail-guide-dir__head span[aria-hidden="true"] {
  color: var(--wg-accent);
  margin-right: 4px;
}
.wsnail-guide-dir__toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--wg-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 8px;
}
.wsnail-guide-dir__toggle:hover,
.wsnail-guide-dir__toggle:focus-visible {
  color: var(--wg-fg);
  background: var(--wg-accent-soft);
  outline: none;
}
.wsnail-guide-dir__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wsnail-guide-dir__list a,
.wsnail-guide-dir__list button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--wg-fg);
  text-decoration: none;
  background: var(--wg-bg-item);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.wsnail-guide-dir__list a:hover,
.wsnail-guide-dir__list a:focus-visible,
.wsnail-guide-dir__list button:hover,
.wsnail-guide-dir__list button:focus-visible {
  background: var(--wg-accent-soft);
  border-color: rgba(224, 138, 90, 0.45);
  outline: none;
  transform: translateY(-1px);
}
.wsnail-guide-dir__hint {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--wg-muted);
  font-weight: 400;
  opacity: 0.85;
}
.wsnail-guide-dir__foot {
  padding: 6px 12px 8px;
  border-top: 1px solid var(--wg-border);
  font-size: 0.68rem;
  color: var(--wg-muted);
  line-height: 1.35;
  opacity: 0.75;
}

/* 折叠态：仅保留小胶囊，避免挡 3D */
.wsnail-guide-dir.is-collapsed {
  width: auto;
  max-height: none;
  top: auto;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  transform: none;
}
.wsnail-guide-dir.is-collapsed .wsnail-guide-dir__list,
.wsnail-guide-dir.is-collapsed .wsnail-guide-dir__foot {
  display: none;
}
.wsnail-guide-dir.is-collapsed .wsnail-guide-dir__head {
  border-bottom: 0;
  padding: 10px 14px;
}

/* 移动端：底部强调目录 */
@media (max-width: 720px) {
  .wsnail-guide-dir {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    max-height: min(48vh, 420px);
    border-radius: 18px 18px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .wsnail-guide-dir.is-collapsed {
    width: auto;
    left: auto;
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 999px;
    border: 1px solid var(--wg-border);
  }
  .wsnail-guide-dir__head {
    font-size: 1rem;
    padding: 12px 14px;
  }
  .wsnail-guide-dir__list a,
  .wsnail-guide-dir__list button {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
}

/* —— 进站轻提示：更轻遮罩 + 更小卡片 —— */
.wsnail-guide-welcome {
  position: fixed;
  inset: 0;
  z-index: var(--wg-z-welcome);
  display: grid;
  place-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(90, 55, 35, 0.12);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.wsnail-guide-welcome.is-visible {
  opacity: 1;
}
.wsnail-guide-welcome[hidden] {
  display: none !important;
}
.wsnail-guide-welcome__card {
  width: min(360px, 100%);
  color: var(--wg-fg);
  background: var(--wg-bg-solid);
  border: 1px solid var(--wg-border);
  border-radius: 18px;
  box-shadow: var(--wg-shadow);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  padding: 16px 14px 12px;
}
.wsnail-guide-welcome__card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 650;
}
.wsnail-guide-welcome__card > p {
  margin: 0 0 12px;
  color: var(--wg-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.wsnail-guide-welcome__actions {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.wsnail-guide-welcome__actions a {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--wg-fg);
  background: var(--wg-bg-item);
  border: 1px solid var(--wg-border);
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.wsnail-guide-welcome__actions a:hover,
.wsnail-guide-welcome__actions a:focus-visible {
  background: var(--wg-accent-soft);
  border-color: rgba(224, 138, 90, 0.55);
  outline: none;
  transform: translateY(-1px);
}
.wsnail-guide-welcome__dismiss {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--wg-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 8px;
  border-radius: 12px;
}
.wsnail-guide-welcome__dismiss:hover,
.wsnail-guide-welcome__dismiss:focus-visible {
  color: var(--wg-fg);
  background: rgba(255, 255, 255, 0.35);
  outline: none;
}


/* —— 厚涂质感保留，斑驳柔化（轻滤镜，勿糊 UI） —— */
.site-shell .scene canvas {
  filter: blur(0.4px) contrast(0.92) saturate(1.03) brightness(1.03);
}
.site-shell.is-impasto:not(.is-night) .scene-vignette {
  opacity: 0.12; /* 略软于上游默认 ~0.18 */
}
@media (prefers-reduced-motion: reduce) {
  .wsnail-guide-welcome,
  .wsnail-guide-dir,
  .wsnail-guide-dir__list a,
  .wsnail-guide-dir__list button,
  .wsnail-guide-welcome__actions a {
    transition: none !important;
  }
  .site-shell .scene canvas {
    filter: contrast(0.95) brightness(1.02);
  }
}
