@property --preview-scene {
  syntax: "<color>";
  inherits: true;
  initial-value: #dfe3e2;
}

@property --preview-floor {
  syntax: "<color>";
  inherits: true;
  initial-value: #f5f4f0;
}

:root {
  --ink: #122b33;
  --muted: #60777e;
  --line: #d5e0e1;
  --control: rgba(255, 255, 255, .92);
  --control-hover: #e4efff;
  --accent: #1468d4;
  --stage: #edf4f3;
  --preview-scene: #dfe3e2;
  --preview-floor: #f5f4f0;
  --preview-gradient-size: 92% 64%;
  --preview-gradient-stop: 78%;
  --shadow: 0 12px 28px rgba(31, 64, 72, .14);
  --focus: 0 0 0 4px rgba(20, 104, 212, .18);
}

:root[data-theme="dark"] {
  --ink: #edf6f5;
  --muted: #a3b8bc;
  --line: #30444c;
  --control: rgba(20, 33, 40, .94);
  --control-hover: #173557;
  --accent: #66a8ff;
  --stage: #0c151a;
  --preview-scene: #151616;
  --preview-floor: #252626;
  --preview-gradient-size: 88% 58%;
  --preview-gradient-stop: 72%;
  --shadow: 0 14px 32px rgba(0, 0, 0, .34);
  --focus: 0 0 0 4px rgba(102, 168, 255, .22);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--stage);
  font-family: "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
}

#viewport {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse var(--preview-gradient-size) at 50% 58%,
      var(--preview-floor) 0%,
      var(--preview-floor) 12%,
      var(--preview-scene) var(--preview-gradient-stop)
    );
  transition:
    --preview-scene 420ms ease,
    --preview-floor 420ms ease;
}

.controls,
.fullscreen-control {
  position: fixed;
  z-index: 2;
  border: 1px solid var(--line);
  background: var(--control);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.controls {
  left: 50%;
  bottom: 22px;
  display: flex;
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  transform: translateX(-50%);
}

.fullscreen-control {
  right: 22px;
  bottom: 22px;
  min-width: 68px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 12px;
}

button {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font: 700 13px/1 "Microsoft YaHei UI", sans-serif;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

button:hover {
  color: var(--accent);
  background: var(--control-hover);
}

button.active {
  color: #fff;
  background: var(--accent);
}

button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button:active {
  transform: translateY(1px);
}

#status {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--stage);
  font-size: 13px;
}

#status.hidden {
  display: none;
}

/* @preview-extension:styles */

:root[data-thumbnail="true"] .controls,
:root[data-thumbnail="true"] .fullscreen-control {
  display: none;
}

@media (max-width: 560px) {
  .controls {
    bottom: 14px;
    gap: 2px;
    padding: 4px;
  }

  .controls button {
    padding: 8px 10px;
  }

  .fullscreen-control {
    right: 14px;
    bottom: 14px;
    min-width: 58px;
    padding-inline: 10px;
  }


}

@media (prefers-reduced-motion: reduce) {
  button {
    transition-duration: .01ms;
  }
}
