:root {
  --bg: #f5f7f9;
  --ink: #17202a;
  --muted: #6b7788;
  --quiet: #8b97a8;
  --line: #dde3ea;
  --teal: #12736c;
  --red: #b42318;
  --shadow: 0 8px 22px rgba(15, 23, 42, .06);
  --radius: 8px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-xl: 20px;
  --text-2xl: 26px;
}

* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: var(--text-md);
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }

.boot-state {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 40%, #fffdf4 0 18%, #f7fbf5 62%, #eef6ed 100%);
  color: var(--muted);
}
.boot-mascot {
  width: 126px;
  height: 126px;
  background: transparent url("bulletin/update-runner-sprite.png") 0 0 / 400% 100% no-repeat;
  filter: drop-shadow(0 12px 12px rgba(43, 85, 59, .16));
  animation: update-run-cycle .58s steps(1, end) infinite, update-run-bounce .29s ease-in-out infinite alternate;
}
.boot-state strong { color: #244d3a; font-size: clamp(20px, 4vw, 28px); }
.boot-state span { font-size: var(--text-sm); }
.boot-progress { width: min(360px, 76vw); height: 9px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #dce8d7; }
.boot-progress i { display: block; width: 38%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6fa36b, #e4b85e); animation: boot-progress-run 1.5s ease-in-out infinite; }

.entry-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 32px 24px;
  background: var(--bg);
}
.login-layout { width: min(560px, 100%); margin: auto; }
.entry-head { display: grid; justify-items: center; gap: 18px; margin-bottom: 28px; text-align: center; }
.brand { display: flex; min-height: 44px; align-items: center; gap: 10px; margin-bottom: 18px; }
.entry-brand { flex-direction: column; justify-content: center; gap: 10px; margin-bottom: 18px; text-align: center; }
.brand-logo { display: block; width: 72px; height: 42px; flex: 0 0 auto; object-fit: contain; object-position: center; }
.entry-brand .brand-logo { width: 132px; height: 70px; }
.brand span { display: block; margin-top: 2px; color: var(--quiet); font-size: var(--text-xs); }
.entry-title h1 { margin: 0; font-size: var(--text-2xl); font-weight: 800; line-height: 1.2; }
.entry-title p { margin: 6px 0 0; color: var(--quiet); font-size: var(--text-sm); }
.entry-panel { display: grid; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.login-panel { position: relative; grid-template-columns: 1fr; gap: 18px; margin-top: 22px; }
.entry-panel-info h2 { margin: 4px 0 14px; font-size: var(--text-xl); }
.page-kicker { color: var(--quiet); font-size: var(--text-xs); font-weight: 600; }
.login-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { color: #475467; font-size: var(--text-sm); font-weight: 800; }
.form-control { width: 100%; padding: 8px 10px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.primary-button { min-height: 36px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--teal); color: #fff; font-size: var(--text-md); font-weight: 700; }
.login-submit { width: 100%; }
.login-error { min-height: 20px; color: var(--red); font-size: var(--text-sm); font-weight: 600; }
#runtime-failure { grid-template-columns: minmax(0, 1fr); }
#runtime-failure .login-layout { min-width: 0; max-width: 100%; }
#runtime-failure .login-panel { grid-template-columns: minmax(0, 1fr); }
#runtime-failure .entry-panel-info,
#runtime-failure .login-error { min-width: 0; overflow-wrap: anywhere; }
.install-app-button { display: none; }
.app-installed .install-app-button { display: none !important; }

@media (max-width: 760px) {
  .entry-shell { padding: 18px 14px; }
  .entry-head { gap: 14px; margin-bottom: 22px; }
  .entry-title h1 { font-size: 23px; }
  .login-layout { width: min(420px, 100%); }
  .entry-panel { padding: 14px; }
  .entry-shell .entry-brand .brand-logo { width: 132px; height: 80px; background: transparent; object-fit: contain; }
  .entry-shell .entry-brand > div { display: none; }
  button, .primary-button { min-height: 40px; }
  input { font-size: 16px; }
  .install-app-button {
    position: fixed;
    right: 14px;
    bottom: 20px;
    z-index: 120;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(19, 78, 72, .22);
  }
}

@keyframes update-run-cycle { 0%, 24.99% { background-position: 0 0; } 25%, 49.99% { background-position: 33.333% 0; } 50%, 74.99% { background-position: 66.667% 0; } 75%, 100% { background-position: 100% 0; } }
@keyframes update-run-bounce { from { transform: translateY(1px) rotate(-1deg); } to { transform: translateY(-4px) rotate(1deg); } }
@keyframes boot-progress-run { 0% { transform: translateX(-105%); } 55%, 100% { transform: translateX(270%); } }
