html:not([data-branding-ready]),
html:not([data-branding-ready]) body {
  min-height: 100%;
  overflow: hidden;
}

html:not([data-branding-ready]) body > * {
  visibility: hidden !important;
}

html:not([data-branding-ready]) body::before,
html:not([data-branding-ready]) body::after {
  position: fixed;
  visibility: visible !important;
  z-index: 2147483647;
}

html:not([data-branding-ready]) body::before {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-top: 76px;
  background: #f6f8fb;
  color: #526071;
  font: 500 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

html:not([data-branding-ready]):not([data-branding-error]) body::before {
  content: "正在加载站点配置";
}

html:not([data-branding-ready]):not([data-branding-error]) body::after {
  content: "";
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  margin: -31px 0 0 -17px;
  border: 3px solid #d7dee8;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: branding-spin 0.75s linear infinite;
}

html[data-branding-error] body::before {
  content: "站点配置加载失败";
  padding-top: 0;
  color: #b42318;
  font-size: 16px;
  font-weight: 600;
}

html[data-branding-error] body::after {
  display: none;
}

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

@media (prefers-color-scheme: dark) {
  html:not([data-branding-ready]) body::before {
    background: #111827;
    color: #cbd5e1;
  }

  html:not([data-branding-ready]) body::after {
    border-color: #334155;
    border-top-color: #60a5fa;
  }

  html[data-branding-error] body::before {
    color: #fca5a5;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-branding-ready]):not([data-branding-error]) body::after {
    animation-duration: 1.5s;
  }
}
