:root {
  --bg: #04111d;
  --bg-soft: #0b2234;
  --panel: rgba(8, 17, 29, 0.78);
  --panel-border: rgba(132, 230, 255, 0.16);
  --text: #f5fbff;
  --muted: rgba(221, 237, 247, 0.72);
  --accent: #66e5ff;
  --accent-strong: #b7f7ff;
  --field: rgba(255, 255, 255, 0.045);
  --field-border: rgba(255, 255, 255, 0.06);
  font-family:
    "Noto Sans SC",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(88, 230, 255, 0.18), transparent 20%),
    radial-gradient(circle at 82% 24%, rgba(43, 111, 205, 0.16), transparent 24%),
    radial-gradient(circle at 50% 80%, rgba(29, 66, 108, 0.22), transparent 28%),
    linear-gradient(180deg, #06111b 0%, #04101a 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell,
#scene {
  width: 100%;
  height: 100%;
}

#scene {
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  pointer-events: none;
}

.badge {
  align-self: flex-start;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(3, 10, 18, 0.54);
  backdrop-filter: blur(16px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.panel {
  align-self: flex-end;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  padding: 22px;
  overflow: auto;
  pointer-events: auto;
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 100%),
    var(--panel);
  backdrop-filter: blur(28px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel::-webkit-scrollbar {
  width: 10px;
}

.panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(102, 229, 255, 0.34);
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel__header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.panel__header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.action-button {
  appearance: none;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.action-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.controls {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-tab {
  appearance: none;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.panel-tab.is-active {
  background: rgba(102, 229, 255, 0.16);
  border-color: rgba(156, 240, 255, 0.28);
  color: rgba(255, 255, 255, 0.96);
}

.panel-pages {
  display: grid;
  gap: 18px;
}

.panel-page[hidden] {
  display: none;
}

.section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.section__header h2 {
  margin: 0;
  font-size: 18px;
}

.section__header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.preset-group {
  display: grid;
  gap: 10px;
}

.preset-group__label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-button {
  appearance: none;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.preset-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.preset-button.is-active {
  background: rgba(102, 229, 255, 0.18);
  border-color: rgba(156, 240, 255, 0.28);
  color: rgba(255, 255, 255, 0.98);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.field {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: var(--field);
  border: 1px solid var(--field-border);
}

.field--toggle {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__top span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.field__value {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 920px) {
  .panel {
    width: min(100%, calc(100vw - 24px));
    max-height: min(58vh, 520px);
    padding: 18px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .panel__header {
    flex-direction: column;
  }
}
