:root {
  color-scheme: light;
  --background: #f5f7fa;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-border: rgba(213, 220, 230, 0.92);
  --text: #1f2937;
  --text-secondary: #667085;
  --text-muted: #98a2b3;
  --primary: #0879d1;
  --primary-hover: #0069bb;
  --primary-soft: #e9f4fc;
  --primary-border: rgba(8, 121, 209, 0.16);
  --warning: #f59e0b;
  --shadow:
    0 24px 70px rgba(31, 41, 55, 0.10),
    0 5px 18px rgba(31, 41, 55, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  font-family:
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    "Microsoft JhengHei",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--background);
}

button,
select {
  font: inherit;
}

.page {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100dvh;
  grid-template-rows: 1fr auto;
  place-items: center;
  overflow: hidden;
  padding:
    max(70px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.page::before {
  position: absolute;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(rgba(120, 136, 156, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 136, 156, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 82%);
}

.background-shape {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.background-shape--one {
  top: -220px;
  left: -150px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(8, 121, 209, 0.13), rgba(8, 121, 209, 0));
}

.background-shape--two {
  right: -210px;
  bottom: -260px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(66, 153, 225, 0.10), rgba(66, 153, 225, 0));
}

.maintenance-card {
  position: relative;
  width: min(470px, 100%);
  margin: auto;
  padding: 38px 42px 40px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(16px);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 50%;
  width: 118px;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #52a8e8, var(--primary), #52a8e8);
  transform: translateX(-50%);
}

.status-illustration {
  display: block;
  width: 200px;
  height: 170px;
  margin: 0 auto 24px;
}

.status-illustration img {
  display: block;
  width: 200px;
  height: 170px;
  max-width: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.message {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 550;
  line-height: 1.55;
}

.primary-button {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  margin-top: 26px;
  padding: 12px 20px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(0, 82, 150, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.035)),
    var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  box-shadow:
    0 8px 18px rgba(8, 121, 209, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.primary-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:hover {
  background-color: var(--primary-hover);
  box-shadow:
    0 10px 23px rgba(8, 121, 209, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.primary-button:active {
  box-shadow:
    0 5px 12px rgba(8, 121, 209, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(0);
}

.primary-button:focus-visible {
  outline: 3px solid rgba(8, 121, 209, 0.22);
  outline-offset: 3px;
}

.footer {
  margin: 26px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

html.is-reloading .primary-button {
  cursor: wait;
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 520px) {
  .page {
    align-items: end;
    padding-inline: 0;
    padding-bottom: 0;
  }

  .page::before {
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
  }

  .maintenance-card {
    width: 100%;
    padding:
      36px
      26px
      max(32px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .card-accent {
    width: 92px;
  }

  .status-badge {
    margin-bottom: 20px;
  }

  .footer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button {
    transition: none;
  }
}
