:root {
  color: #e6ebf0;
  background: #0e1217;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body,
.viewer-shell {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
select,
input {
  font: inherit;
}

.viewer-shell {
  position: relative;
  background: #10161c;
}

#scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#scene-canvas.dragging {
  cursor: grabbing;
}

.viewer-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 310px;
  padding: 48px 20px 17px;
  background: rgba(23, 28, 34, 0.95);
  border: 1px solid #303842;
  border-radius: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.mode-switch {
  position: absolute;
  top: 7px;
  left: 10px;
  height: 21px;
  display: flex;
  overflow: hidden;
  background: #20262e;
  border: 1px solid #39434e;
  border-radius: 999px;
}

.mode-switch a,
.mode-switch span {
  min-width: 39px;
  padding: 0 8px;
  color: #9aa6b1;
  font-size: 10px;
  line-height: 19px;
  text-align: center;
  text-decoration: none;
}

.mode-switch .active {
  color: #ffffff;
  background: #287a75;
}

.mode-switch a:hover {
  color: #ffffff;
  background: #29333c;
}

.language-button {
  position: absolute;
  top: 7px;
  right: 10px;
  height: 21px;
  padding: 0 8px;
  color: #9addd8;
  background: #20262e;
  border: 1px solid #39434e;
  border-radius: 999px;
  cursor: pointer;
  font-size: 10px;
  line-height: 19px;
}

.language-button:hover {
  color: #ffffff;
  border-color: #5b6875;
}

.viewer-control-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: #e0e6ec;
  font-size: 13px;
  font-weight: 600;
}

.seed-position-row {
  grid-template-columns: 1fr auto;
  row-gap: 10px;
}

.seed-position-row output {
  color: #b9c2cc;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.seed-position-row input {
  grid-column: 1 / -1;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  background: #3a424c;
  border-radius: 999px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  background: #171c22;
  border: 2px solid #70c9c2;
  border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: #171c22;
  border: 2px solid #70c9c2;
  border-radius: 50%;
}

.viewer-controls select,
.viewer-controls button {
  height: 36px;
  color: #e3e8ed;
  background: #202831;
  border: 1px solid #3b4651;
  border-radius: 7px;
}

.viewer-controls select {
  min-width: 0;
  padding: 0 10px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.button-row button {
  height: 39px;
}

.viewer-controls button {
  cursor: pointer;
}

.viewer-controls button:hover {
  background: #2b3741;
  border-color: #5a6875;
}

.viewer-controls .primary-button {
  color: #ffffff;
  background: #287a75;
  border-color: #287a75;
  font-weight: 650;
}

.viewer-controls .primary-button:hover {
  background: #31918b;
  border-color: #31918b;
}

#load-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  margin: 10px 0 0;
  color: #8f9aa5;
  font-size: 11px;
  text-align: center;
}

.viewer-help {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 7px 10px;
  color: #aeb8c1;
  background: rgba(20, 27, 34, 0.78);
  border-radius: 7px;
  font-size: 11px;
  pointer-events: none;
}

.speed-legend {
  position: absolute;
  top: 24px;
  right: 22px;
  display: grid;
  grid-template-columns: 12px 34px 18px;
  grid-template-rows: 1fr 1fr 1fr;
  width: 82px;
  height: 250px;
  padding: 12px 10px;
  color: #f3f6f8;
  background: #171c22;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
}

.speed-gradient {
  grid-row: 1 / 4;
  width: 12px;
  border-radius: 2px;
  background: linear-gradient(to top, #30123b, #4145ab, #2a8bd1, #1bcfd4, #61fc6c, #d1e834, #fca50a, #e12a1f, #7a0403);
}

.speed-maximum,
.speed-midpoint,
.speed-minimum {
  padding-left: 6px;
  font-variant-numeric: tabular-nums;
}

.speed-maximum { align-self: start; }
.speed-midpoint { align-self: center; }
.speed-minimum { align-self: end; }

.speed-title {
  grid-column: 3;
  grid-row: 1 / 4;
  align-self: center;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

html[lang="zh-CN"] .speed-title {
  transform: none;
}

[hidden] {
  display: none !important;
}
