/* The initial document and the real page share their light/dark background. */
html[data-surface="public"], html[data-surface="public"] body {
  background: #f4f6fa; color-scheme: light !important; transition: none;
}
html[data-surface="public"].dark, html[data-surface="public"].dark body {
  background: #0f1420; color-scheme: dark !important;
}
body { margin: 0; }
.page-startup {
  --startup-bg: #f4f6fa; --startup-card: #fff; --startup-line: #e4e9f0; --startup-ink: #364254;
  position: fixed; inset: 0; z-index: 1000; overflow: auto; box-sizing: border-box;
  background: var(--startup-bg); color: var(--startup-ink);
  font: 500 14px/1.6 system-ui, sans-serif;
}
html.dark .page-startup {
  --startup-bg: #0f1420; --startup-card: #171e2c; --startup-line: #293345; --startup-ink: #d9e2ef;
}
html[data-surface="app"] .page-startup { background: var(--bg, var(--startup-bg)); }
.page-startup *, .page-startup *::before, .page-startup *::after { box-sizing: border-box; }
.startup-skeleton { visibility: hidden; }
.startup-header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--startup-line); }
.startup-skeleton i { display: block; height: 12px; width: 100%; max-width: 340px; border-radius: 6px; background: var(--startup-line); }
.startup-header i:first-child { width: 128px; height: 24px; }
.startup-header i:last-child { width: 180px; }
.startup-content { max-width: 1228px; margin: 0 auto; padding: 44px 24px; }
.startup-title { display: grid; gap: 16px; margin-bottom: 28px; }
.startup-title i:first-child { height: 30px; width: 156px; }
.startup-title i:last-child { width: 64%; }
.startup-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.startup-card { display: grid; align-content: start; gap: 24px; min-height: 230px; padding: 28px; background: var(--startup-card); border: 1px solid var(--startup-line); border-radius: 18px; }
.startup-card i:first-child { width: 38%; height: 18px; }
.startup-card i:nth-child(2) { max-width: none; height: 44px; background: transparent; border: 1px solid var(--startup-line); }
.startup-card i:last-child { width: 55%; }
html[data-surface="app"] .startup-content { max-width: 1500px; }
.startup-feedback { visibility: hidden; position: fixed; inset-inline: 24px; bottom: max(24px, env(safe-area-inset-bottom)); display: grid; grid-template-areas: 'indicator' 'message' 'action'; justify-items: center; align-content: center; gap: 12px; text-align: center; }
.startup-feedback p { margin: 0; max-width: 36rem; }
.startup-spinner { grid-area: indicator; width: 16px; height: 16px; border: 2px solid var(--startup-line); border-top-color: var(--startup-ink); border-radius: 50%; animation: startup-spin .9s linear infinite; }
.startup-pending, .startup-slow, .startup-failed { grid-area: message; }
.startup-slow, .startup-failed { visibility: hidden; }
.startup-retry { grid-area: action; visibility: hidden; display: inline-flex; }
.page-startup [lang="en"] { display: none; }
html:lang(en) .page-startup [lang="en"] { display: inline; }
html:lang(en) .page-startup [lang="zh-CN"] { display: none; }
.page-startup a { min-width: 44px; min-height: 44px; padding: 10px 16px; color: inherit; border: 1px solid currentColor; border-radius: 10px; text-decoration: underline; text-underline-offset: 3px; align-items: center; justify-content: center; }
.page-startup a:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
[data-page-startup="failed"] .startup-feedback, [data-page-startup="failed"] .startup-failed, [data-page-startup="failed"] .startup-retry { visibility: visible; }
[data-page-startup="failed"] .startup-pending, [data-page-startup="failed"] .startup-spinner { display: none; }
[data-page-startup="failed"] .startup-feedback { top: 0; bottom: 0; align-content: center; }
/* One persistent surface means these clocks never restart at Vue mount.
   CSS also works if the entire application script fails to download.
   visibility:hidden keeps recovery out of keyboard/AX order until needed. */
[data-page-startup=""] .startup-skeleton { animation: startup-reveal 0s .35s forwards; }
[data-page-startup=""] .startup-feedback { animation: startup-reveal 0s 1s forwards; }
[data-page-startup=""] .startup-pending { animation: startup-hide 0s 12s forwards; }
[data-page-startup=""] .startup-slow, [data-page-startup=""] .startup-retry { animation: startup-reveal 0s 12s forwards; }
.startup-noscript { max-width: 38rem; padding: 32px; margin: 15vh auto; text-align: center; }
.startup-noscript a { display: inline-flex; margin-top: 16px; }
.page-startup:has(.startup-noscript) .startup-skeleton, .page-startup:has(.startup-noscript) .startup-feedback { display: none; }
@keyframes startup-reveal { to { visibility: visible; } }
@keyframes startup-hide { to { visibility: hidden; } }
@keyframes startup-spin { to { transform: rotate(360deg); } }
@media (max-width: 680px) {
  .startup-header { height: 68px; padding-inline: 20px; }
  .startup-header i:last-child { width: 88px; }
  .startup-content { padding: 28px 20px; }
  .startup-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .startup-card { min-height: 200px; padding: 24px; }
  .startup-secondary { display: none; }
}
@media (prefers-reduced-motion: reduce) { .startup-spinner { animation: none; } }
