.fog-lab-canvas,
.fog-world-canvas {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  height: 100vh;
  display: block;
  mix-blend-mode: normal;
  pointer-events: none;
}

body.is-fog-lab .viewport {
  isolation: isolate;
}

body.is-particle-fog-active .viewport {
  isolation: isolate;
}

body.is-fog-lab .stage {
  z-index: 1;
}

body.is-particle-fog-active .stage {
  z-index: 1;
}

.fog-lab-note {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 110;
  display: grid;
  gap: 2px;
  max-width: min(300px, calc(100vw - 44px));
  padding: 9px 12px 10px;
  border: 1px solid rgba(51, 58, 47, 0.13);
  border-radius: 4px;
  color: rgba(39, 46, 37, 0.7);
  background: rgba(250, 248, 241, 0.78);
  box-shadow: 0 7px 24px rgba(57, 52, 43, 0.07);
  backdrop-filter: blur(8px);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.fog-lab-note strong {
  color: rgba(31, 39, 29, 0.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

body.is-fog-lab .fog-lab-note::before {
  content: "";
  width: 32px;
  height: 3px;
  margin-bottom: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(113, 132, 124, 0.58), rgba(255, 255, 255, 0));
}

@media (prefers-reduced-motion: reduce) {
  .fog-lab-note span::after {
    content: " · 已停止持续流动";
  }
}

.fog-particle-panel {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 112;
  display: grid;
  width: min(340px, calc(100vw - 40px));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(49, 59, 51, 0.15);
  border-radius: 7px;
  color: rgba(34, 43, 35, 0.72);
  background: rgba(249, 247, 239, 0.88);
  box-shadow: 0 10px 30px rgba(49, 47, 39, 0.1);
  backdrop-filter: blur(12px);
  font-size: 11px;
  line-height: 1.45;
}

.fog-particle-panel__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.fog-particle-panel__heading strong {
  color: rgba(26, 35, 29, 0.92);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.055em;
}

.fog-particle-panel__heading span {
  color: rgba(62, 74, 64, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fog-particle-panel__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(49, 59, 51, 0.12);
  border-radius: 5px;
  background: rgba(76, 86, 76, 0.06);
}

.fog-particle-panel__switch button {
  min-height: 32px;
  border: 0;
  border-radius: 3px;
  color: rgba(49, 59, 51, 0.62);
  background: transparent;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

.fog-particle-panel__switch button:hover {
  color: rgba(27, 38, 29, 0.9);
}

.fog-particle-panel__switch button:active {
  transform: scale(0.98);
}

.fog-particle-panel__switch button[aria-pressed="true"] {
  color: rgba(248, 247, 239, 0.96);
  background: #29392d;
  box-shadow: 0 2px 7px rgba(31, 43, 34, 0.16);
}

.fog-particle-panel__switch button:focus-visible {
  outline: 2px solid rgba(58, 92, 67, 0.72);
  outline-offset: 2px;
}

.fog-particle-panel p {
  margin: 0;
  color: rgba(50, 61, 51, 0.62);
}

@media (max-width: 720px) {
  .fog-particle-panel {
    right: 12px;
    bottom: 12px;
    width: min(330px, calc(100vw - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fog-particle-panel p::after {
    content: " 当前系统已减少动态。";
  }
}

.fog-authoring-overlay {
  position: fixed;
  inset: 0;
  z-index: 96;
  overflow: hidden;
  pointer-events: none;
}

.fog-boundary {
  position: fixed;
  box-sizing: border-box;
  pointer-events: none;
}

.fog-boundary > span {
  position: absolute;
  top: -25px;
  left: 18px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(250, 248, 241, 0.82);
  box-shadow: 0 4px 14px rgba(40, 46, 39, 0.08);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.fog-boundary-exploration {
  border: 1px dashed rgba(62, 84, 75, 0.38);
}

.fog-boundary-exploration > span {
  color: rgba(45, 68, 59, 0.72);
}

.fog-boundary-feather {
  border: 1px dashed rgba(158, 117, 59, 0.56);
}

.fog-boundary-feather > span {
  color: rgba(122, 83, 36, 0.76);
}

.fog-boundary-clear {
  border: 1.5px solid rgba(48, 91, 65, 0.8);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.44),
    inset 0 0 44px rgba(77, 113, 87, 0.035);
  cursor: grab;
  pointer-events: auto;
}

body.is-fog-boundary-dragging .fog-boundary-clear {
  cursor: grabbing;
}

.fog-boundary-move {
  position: absolute;
  top: -18px;
  left: 50%;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(47, 80, 59, 0.24);
  border-radius: 999px;
  color: rgba(29, 56, 40, 0.88);
  background: rgba(250, 248, 241, 0.94);
  box-shadow: 0 7px 20px rgba(42, 50, 42, 0.12);
  transform: translateX(-50%);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.fog-boundary-move:active,
body.is-fog-boundary-dragging .fog-boundary-move {
  cursor: grabbing;
}

.fog-boundary-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid rgba(247, 245, 236, 0.96);
  border-radius: 50%;
  background: #365f46;
  box-shadow: 0 3px 10px rgba(39, 54, 43, 0.2);
  pointer-events: auto;
  touch-action: none;
}

.fog-boundary-handle.is-nw {
  top: -9px;
  left: -9px;
  cursor: nwse-resize;
}

.fog-boundary-handle.is-ne {
  top: -9px;
  right: -9px;
  cursor: nesw-resize;
}

.fog-boundary-handle.is-se {
  right: -9px;
  bottom: -9px;
  cursor: nwse-resize;
}

.fog-boundary-handle.is-sw {
  bottom: -9px;
  left: -9px;
  cursor: nesw-resize;
}

.fog-authoring-panel {
  position: fixed;
  z-index: 116;
  top: 18px;
  left: 50%;
  display: grid;
  width: min(430px, calc(100vw - 32px));
  gap: 11px;
  padding: 13px 14px 12px;
  border: 1px solid rgba(47, 61, 49, 0.15);
  border-radius: 9px;
  color: rgba(35, 46, 37, 0.76);
  background: rgba(250, 248, 241, 0.92);
  box-shadow: 0 14px 38px rgba(46, 44, 37, 0.13);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  font-size: 11px;
  line-height: 1.4;
}

.fog-authoring-panel[hidden],
.fog-authoring-overlay[hidden] {
  display: none;
}

.fog-authoring-panel header,
.fog-authoring-panel footer,
.fog-authoring-panel label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fog-authoring-panel header > div {
  display: grid;
  gap: 1px;
}

.fog-authoring-panel header strong {
  color: rgba(24, 39, 29, 0.94);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.fog-authoring-panel header span,
.fog-authoring-panel footer span {
  color: rgba(52, 65, 54, 0.55);
}

.fog-authoring-panel button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(47, 66, 52, 0.14);
  border-radius: 999px;
  color: rgba(30, 50, 36, 0.82);
  background: rgba(255, 254, 248, 0.78);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.fog-authoring-panel label {
  display: grid;
  gap: 5px;
}

.fog-authoring-panel output {
  color: rgba(32, 54, 39, 0.88);
  font-variant-numeric: tabular-nums;
}

.fog-authoring-panel input[type="range"] {
  width: 100%;
  accent-color: #3d674b;
}

.fog-authoring-panel footer {
  padding-top: 2px;
  border-top: 1px solid rgba(55, 68, 57, 0.09);
}

html.is-editor-mode .fog-particle-panel {
  top: 18px;
  right: 18px;
  bottom: auto;
  width: 280px;
  opacity: 0.64;
}

body.is-fog-editing .fog-particle-panel {
  display: none;
}

body.is-visitor-preview .fog-authoring-panel,
body.is-visitor-preview .fog-authoring-overlay {
  display: none;
}

@media (max-width: 900px) {
  .fog-authoring-panel {
    top: 12px;
  }

  html.is-editor-mode .fog-particle-panel {
    display: none;
  }
}
