/* 共用介面樣式：頁面結構維持由 Tailwind 負責，這裡放專案專屬元件。 */
body { font-family: Arial, sans-serif; }
.cube-scene { perspective: 800px; }
.cube-box { transform-style: preserve-3d; }
.chart-wrapper { position: relative; height: 260px; }
.notification-card { transition: all .2s ease; }
.notification-card:hover { transform: translateY(-2px); }
.notification-overlay { background: rgba(15, 23, 42, .88); }

.network-layout { max-width: 980px; }
.network-step { position: relative; padding-left: 3.25rem; }
.network-step__number {
    position: absolute; left: 0; top: 0;
    display: grid; width: 2.25rem; height: 2.25rem; place-items: center;
    border: 1px solid rgba(96, 165, 250, .5); border-radius: 9999px;
    background: rgba(37, 99, 235, .16); color: #93c5fd; font-weight: 700;
}
.password-toggle { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); }
.ble-status--active { display: block; }
.ble-status--info { background: rgba(59, 130, 246, .1); color: #93c5fd; border: 1px solid rgba(59, 130, 246, .3); }
.ble-status--success { background: rgba(16, 185, 129, .1); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, .3); }
.ble-status--error { background: rgba(244, 63, 94, .1); color: #fda4af; border: 1px solid rgba(244, 63, 94, .3); }

/* ── 右下角彈出通知 ── */
#alert-stack {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column-reverse;
    gap: .6rem;
    pointer-events: none;
}
.alert-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 280px;
    max-width: 360px;
    padding: .85rem 1rem;
    border-radius: .875rem;
    border: 1px solid;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    animation: alertSlideIn .3s ease forwards;
    background: #1e293b;
}
.alert-toast.removing {
    animation: alertSlideOut .3s ease forwards;
}
.alert-toast__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    display: grid;
    place-items: center;
    font-size: .85rem;
}
.alert-toast__body { flex: 1; min-width: 0; }
.alert-toast__title { font-size: .8rem; font-weight: 700; margin-bottom: .2rem; }
.alert-toast__desc  { font-size: .72rem; color: #94a3b8; line-height: 1.45; }
.alert-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: .8rem;
    padding: 0;
    line-height: 1;
}
.alert-toast__close:hover { color: #cbd5e1; }
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateX(110%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes alertSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(110%); }
}


/* ==================================================
   節點 3D 空間分佈示意
================================================== */

.node-3d-panel {
  width: 100%;
  min-width: 0;
}

.node-3d-container {
  position: relative;
  width: 100%;
  height: 270px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.65);
  background:
    radial-gradient(
      ellipse at 50% 45%,
      rgba(30, 64, 105, 0.5),
      rgba(15, 23, 42, 0.98) 75%
    );
  cursor: grab;
  touch-action: pan-y;
}

.node-3d-container:active {
  cursor: grabbing;
}

.node-3d-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.node-3d-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 9px 0 12px;
  color: #94a3b8;
  font-size: 10px;
}

.node-3d-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.node-3d-legend button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 3px;
  border: 1px solid rgba(71, 85, 105, 0.65);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  font-size: 11px;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s;
}

.node-3d-legend button:hover {
  background: rgba(51, 65, 85, 0.8);
  transform: translateY(-1px);
}

.node-3d-legend button.is-selected {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.node-3d-legend button span {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

@media (max-width: 480px) {
  .node-3d-container {
    height: 235px;
  }

  .node-3d-legend {
    gap: 5px;
  }

  .node-3d-legend button {
    font-size: 10px;
  }
}
