/* Works with: <div id="loading" style="display:none">加载中…</div> */
#loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  box-sizing: border-box;
  padding: calc(50dvh + 34px) 24px 24px;
  background: rgba(248, 250, 252, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #475569;
  font: 500 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  letter-spacing: 0.04em;
}

#loading[hidden] {
  display: none !important;
}

#loading::before {
  content: "";
  position: absolute;
  top: calc(50% - 28px);
  left: calc(50% - 24px);
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border: 4px solid #e0e7ff;
  border-top-color: #6366f1;
  border-right-color: #a5b4fc;
  border-radius: 50%;
  animation: lodging-spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  #loading::before { animation: none; }
}
