/* 3D 电商办公室叠层：分区标签 / 数据条 / 回主页
 * 不改 office-navigator 几何，用 HUD 补足「电商公司」信息密度。
 */

:root {
  --er-ink: #0e1a22;
  --er-sea: #1f6f7a;
  --er-sea-bright: #8fd0d8;
  --er-signal: #d9772c;
  --er-paper: #f3f0ea;
  --er-glass: rgba(14, 26, 34, 0.72);
  --er-z: 36;
}

/* 顶栏：公司抬头 + 回主页 */
.ecom-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--er-z) + 2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(14, 26, 34, 0.82), rgba(14, 26, 34, 0));
  color: var(--er-paper);
  pointer-events: none;
}
.ecom-topbar a,
.ecom-topbar button {
  pointer-events: auto;
}
.ecom-topbar__brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  line-height: 1.2;
}
.ecom-topbar__brand strong {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.ecom-topbar__brand span {
  font-size: 0.7rem;
  opacity: 0.72;
}
.ecom-topbar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ecom-topbar__link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid rgba(143, 208, 216, 0.4);
  background: rgba(14, 26, 34, 0.55);
  color: var(--er-sea-bright);
  font-size: 0.8rem;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ecom-topbar__link:hover {
  border-color: var(--er-signal);
  color: #fff;
}

/* 左侧分区图例（借鉴村落/公司界面的分区密度） */
.ecom-legend {
  position: fixed;
  top: 64px;
  left: 12px;
  z-index: var(--er-z);
  width: min(188px, 42vw);
  padding: 10px;
  border-radius: 8px;
  background: var(--er-glass);
  border: 1px solid rgba(143, 208, 216, 0.22);
  color: var(--er-paper);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.ecom-legend__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ecom-legend__head strong {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}
.ecom-legend__toggle {
  border: 0;
  background: transparent;
  color: rgba(243, 240, 234, 0.7);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 4px;
}
.ecom-legend.is-collapsed .ecom-legend__list {
  display: none;
}
.ecom-legend__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ecom-legend__list li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.75rem;
  line-height: 1.35;
  opacity: 0.9;
}
.ecom-legend__dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--er-sea-bright);
}
.ecom-legend__list li[data-zone="front"] .ecom-legend__dot { background: #e8a87c; }
.ecom-legend__list li[data-zone="lounge"] .ecom-legend__dot { background: #2a9d8f; }
.ecom-legend__list li[data-zone="ops"] .ecom-legend__dot { background: #4ea8de; }
.ecom-legend__list li[data-zone="sample"] .ecom-legend__dot { background: #e9c46a; }
.ecom-legend__list li[data-zone="pack"] .ecom-legend__dot { background: #f4a261; }
.ecom-legend__list li[data-zone="screen"] .ecom-legend__dot { background: #5b8a72; }
.ecom-legend__list li[data-zone="meet"] .ecom-legend__dot { background: #c4a484; }

/* 浮动分区标签（场景四周） */
.ecom-float {
  position: fixed;
  z-index: calc(var(--er-z) - 2);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(42, 28, 20, 0.52);
  border: 1px solid rgba(232, 168, 124, 0.28);
  color: var(--er-paper);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ecom-float-in 0.7s ease both;
  max-width: 140px;
}
.ecom-float strong {
  font-size: 0.78rem;
  font-weight: 600;
}
.ecom-float span {
  font-size: 0.68rem;
  opacity: 0.7;
}
/* V3 通透开间：前台 / 休息中心 / 运营 / 数据面 / 选品 / 仓储 / 会议 */
.ecom-float--front { bottom: 22%; left: 22%; animation-delay: 0.02s; }
.ecom-float--lounge { bottom: 28%; left: 48%; animation-delay: 0.05s; }
.ecom-float--ops { top: 38%; left: 18%; animation-delay: 0.08s; }
.ecom-float--sample { top: 28%; right: 22%; animation-delay: 0.12s; }
.ecom-float--pack { top: 36%; right: 8%; animation-delay: 0.16s; }
.ecom-float--screen { top: 14%; left: 42%; transform: translateX(-50%); animation-delay: 0.2s; }
.ecom-float--meet { bottom: 36%; right: 28%; animation-delay: 0.24s; }

@keyframes ecom-float-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.ecom-float--screen {
  animation-name: ecom-float-in-center;
}
@keyframes ecom-float-in-center {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translateX(-50%); }
}

/* 贴墙数据大屏示意条 */
.ecom-wallboard {
  position: fixed;
  top: 18%;
  right: 10px;
  z-index: calc(var(--er-z) - 4);
  width: min(168px, 28vw);
  padding: 10px;
  border-radius: 8px;
  background: rgba(14, 26, 34, 0.7);
  border: 1px solid rgba(42, 157, 143, 0.35);
  color: var(--er-paper);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.ecom-wallboard__title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
}
.ecom-wallboard__bars {
  display: grid;
  gap: 6px;
}
.ecom-wallboard__row {
  display: grid;
  grid-template-columns: 42px 1fr 28px;
  gap: 6px;
  align-items: center;
  font-size: 0.68rem;
}
.ecom-wallboard__track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.ecom-wallboard__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a9d8f, #8fd0d8);
  transform-origin: left center;
  animation: ecom-bar 2.4s ease both;
}
.ecom-wallboard__row:nth-child(2) .ecom-wallboard__fill {
  background: linear-gradient(90deg, #d9772c, #e9c46a);
  animation-delay: 0.15s;
}
.ecom-wallboard__row:nth-child(3) .ecom-wallboard__fill {
  background: linear-gradient(90deg, #4ea8de, #90e0ef);
  animation-delay: 0.3s;
}
@keyframes ecom-bar {
  from { transform: scaleX(0.15); }
  to { transform: scaleX(1); }
}

/* 底部状态条 */
.ecom-status {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: var(--er-z);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: min(920px, calc(100vw - 24px));
  pointer-events: none;
}
.ecom-status__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 26, 34, 0.62);
  border: 1px solid rgba(143, 208, 216, 0.22);
  color: rgba(243, 240, 234, 0.88);
  font-size: 0.72rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ecom-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a9d8f;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2);
}

/* 给原指路层让出顶栏空间 */
.site-shell.wsnail-guide-ready .room-navigation {
  top: 56px;
}
body.ecom-room-ready .wsnail-guide-dir {
  top: 64px;
}

/* 移动端：收拢浮动标签，保留图例与顶栏 */
@media (max-width: 720px) {
  .ecom-float,
  .ecom-wallboard {
    display: none;
  }
  .ecom-legend {
    top: auto;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    width: min(170px, 56vw);
  }
  .ecom-status {
    bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }
  .ecom-status__chip:nth-child(n + 3) {
    display: none;
  }
  body.ecom-room-ready .wsnail-guide-dir {
    top: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecom-float,
  .ecom-wallboard__fill {
    animation: none !important;
  }
}
