:root {
  color-scheme: dark;
  --ink: #eaf9ff;
  --muted: #91adbb;
  --cyan: #46d7e8;
  --blue: #5b8cff;
  --panel: rgba(7, 25, 37, .84);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #061019;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button { font: inherit; }

#page-shell {
  display: grid;
  grid-template-rows: 64px 1fr;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 18% 14%, rgba(51, 186, 206, .17), transparent 34%),
    linear-gradient(135deg, #07131d, #03090e 70%);
}

.site-header {
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(120, 213, 231, .18);
  background: rgba(4, 15, 23, .9);
  backdrop-filter: blur(18px);
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
}

.brand-mark span {
  position: absolute;
  inset: 3px;
  border: 2px solid var(--cyan);
  border-radius: 7px;
  box-shadow: 0 0 20px rgba(70, 215, 232, .34);
}

.brand-mark span:nth-child(2) { inset: 9px -3px -3px 9px; border-color: #72a2ff; }
.brand-mark span:nth-child(3) { inset: -3px 9px 9px -3px; opacity: .65; }

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { letter-spacing: .08em; font-size: 17px; }
.brand-copy small { color: var(--muted); font-size: 11px; letter-spacing: .05em; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.desktop-note { color: var(--muted); font-size: 12px; }

.site-header button, .error-card button {
  border: 1px solid rgba(91, 215, 232, .62);
  border-radius: 999px;
  padding: 8px 17px;
  color: #eaffff;
  background: linear-gradient(135deg, rgba(40, 183, 206, .3), rgba(76, 106, 221, .28));
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.site-header button:hover, .error-card button:hover {
  transform: translateY(-1px);
  border-color: #8df1ff;
  background: linear-gradient(135deg, rgba(40, 183, 206, .46), rgba(76, 106, 221, .42));
}

#viewer-shell { position: relative; min-width: 0; min-height: 0; overflow: hidden; }

#viewer-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #07131d;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #07131d;
  outline: 0;
}

.loading-cover, .error-cover {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(3, 13, 20, .79), rgba(3, 13, 20, .92)),
    radial-gradient(circle at 50% 30%, rgba(43, 197, 216, .2), transparent 45%);
  transition: opacity .42s ease, visibility .42s ease;
}

.loading-cover[hidden], .error-cover[hidden] { display: none; }
.loading-cover.is-complete { opacity: 0; visibility: hidden; }

.loading-card, .error-card {
  width: min(520px, calc(100vw - 38px));
  padding: 40px 44px;
  text-align: center;
  border: 1px solid rgba(104, 221, 235, .25);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .46), inset 0 1px rgba(255, 255, 255, .08);
  backdrop-filter: blur(20px);
}

.eyebrow { margin: 22px 0 8px; color: var(--cyan); font-size: 10px; letter-spacing: .22em; }
.loading-card h1, .error-card h2 { margin: 0 0 10px; font-weight: 600; letter-spacing: .08em; }
.loading-card > p:not(.eyebrow), .error-card p { color: var(--muted); }

.progress-track {
  height: 7px;
  margin-top: 25px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(144, 203, 216, .13);
}

#progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 16px rgba(70, 215, 232, .72);
  transition: width .18s ease;
}

#progress-value { margin: 9px 0 0; font-variant-numeric: tabular-nums; }

.orbit { position: relative; width: 76px; height: 76px; margin: 0 auto; animation: spin 7s linear infinite; }
.orbit i { position: absolute; inset: 15px; border: 1px solid rgba(91, 214, 233, .48); border-radius: 50%; }
.orbit i:nth-child(2) { inset: 4px 24px; transform: rotate(60deg); border-color: rgba(95, 136, 255, .62); }
.orbit i:nth-child(3) { inset: 24px 4px; transform: rotate(-60deg); }
.orbit::after { content: ""; position: absolute; inset: 31px; border-radius: 50%; background: #8df1ff; box-shadow: 0 0 24px #47d8e9; }

.control-tip {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 14px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.control-tip span {
  padding: 6px 9px;
  border: 1px solid rgba(148, 221, 234, .18);
  border-radius: 8px;
  color: rgba(229, 249, 255, .68);
  background: rgba(3, 15, 23, .48);
  font-size: 11px;
  backdrop-filter: blur(10px);
}

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

@media (max-width: 720px) {
  #page-shell { grid-template-rows: 56px 1fr; }
  .site-header { padding: 0 12px; gap: 9px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-copy small, .desktop-note { display: none; }
  .brand-copy strong { font-size: 14px; }
  .site-header button { padding: 7px 11px; font-size: 12px; }
  .loading-card, .error-card { padding: 30px 22px; }
  .control-tip { width: calc(100% - 16px); justify-content: center; flex-wrap: wrap; bottom: 8px; }
  .control-tip span { padding: 4px 6px; font-size: 9px; }
}
