:root {
  color-scheme: dark;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #111315;
  color: #f2f4f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 13, 15, 0.86);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-panel {
  display: grid;
  width: min(360px, 100%);
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.spinner {
  width: 58px;
  height: 58px;
  border: 5px solid rgba(255, 255, 255, 0.18);
  border-top-color: #e9c46a;
  border-right-color: #2a9d8f;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-panel h2 {
  margin: 6px 0 0;
  font-size: 22px;
}

.loading-panel p {
  font-size: 14px;
}

.loading-panel .slogan {
  color: #e9c46a;
  font-weight: 750;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: #181b1e;
  border-right: 1px solid #2a2f33;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #e9c46a;
}

h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 750;
}

p {
  margin: 0;
  color: #aab1b7;
  font-size: 13px;
}

.control-group {
  display: grid;
  gap: 9px;
}

.control-group > label {
  color: #d9dedb;
  font-size: 14px;
  font-weight: 650;
}

select,
input[type="file"] {
  width: 100%;
  border: 1px solid #3b4248;
  border-radius: 7px;
  background: #101214;
  color: #f5f7f6;
  padding: 10px 11px;
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  color: #f0f2f1;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2a9d8f;
}

.hint {
  line-height: 1.5;
}

.primary-action {
  width: 100%;
  border: 1px solid #2a9d8f;
  border-radius: 7px;
  background: #2a9d8f;
  color: #071312;
  padding: 11px 12px;
  font-weight: 750;
  cursor: pointer;
}

.primary-action:hover {
  background: #35b6a6;
}

.stats {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #2a2f33;
}

.stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats span {
  color: #aab1b7;
  font-size: 13px;
}

.stats strong {
  color: #f2f4f3;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.viewport {
  position: relative;
  min-width: 0;
  background: radial-gradient(circle at 50% 45%, #293036 0%, #15181b 58%, #0c0d0f 100%);
}

#scene {
  display: block;
  width: 100%;
  height: 100vh;
}

.toolbar {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar button {
  min-width: 64px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(16, 18, 20, 0.78);
  color: #f8faf9;
  padding: 9px 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.toolbar button:hover {
  border-color: #e9c46a;
}

@media (max-width: 780px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #2a2f33;
  }

  #scene {
    height: 68vh;
  }
}
