:root {
  color-scheme: light dark;

  --navy-950: #070b16;
  --navy-900: #0d1424;
  --navy-800: #1a213e;
  --cyan-400: #5ad6ef;
  --cyan-300: #8ee9f7;
  --ink: #101522;
  --ink-muted: #4a5568;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --border: rgba(26, 33, 62, 0.12);
  --ok: #0f9f6e;
  --ok-soft: rgba(15, 159, 110, 0.14);
  --down: #d64545;
  --down-soft: rgba(214, 69, 69, 0.14);
  --warn: #c47a12;
  --warn-soft: rgba(196, 122, 18, 0.16);
  --shadow: 0 24px 60px rgba(7, 11, 22, 0.18);
  --radius: 28px;
  --font-display: "Outfit", "Noto Sans TC", system-ui, sans-serif;
  --font-body: "Noto Sans TC", "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"],
html[data-theme="system"]:not([data-resolved-theme="light"]) {
  color-scheme: dark;
  --ink: #f3f6fb;
  --ink-muted: #9aa6bc;
  --surface: rgba(16, 22, 40, 0.72);
  --surface-strong: #121a2e;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"]:not([data-resolved-theme="dark"]) {
    color-scheme: light;
    --ink: #101522;
    --ink-muted: #4a5568;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #ffffff;
    --border: rgba(26, 33, 62, 0.12);
    --shadow: 0 24px 60px rgba(7, 11, 22, 0.18);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(90, 214, 239, 0.18), transparent 55%),
    linear-gradient(165deg, #e8eef8 0%, #f7f9fc 42%, #dfe8f5 100%);
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body,
html[data-theme="system"]:not([data-resolved-theme="light"]) body {
  background:
    radial-gradient(1000px 520px at 50% -8%, rgba(90, 214, 239, 0.16), transparent 50%),
    linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 45%, #152038 100%);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: var(--navy-800);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
}

.glow-a {
  width: 280px;
  height: 280px;
  top: 12%;
  left: 8%;
  background: rgba(90, 214, 239, 0.28);
  animation: drift 14s var(--ease) infinite alternate;
}

.glow-b {
  width: 360px;
  height: 360px;
  right: 4%;
  bottom: 8%;
  background: rgba(26, 33, 62, 0.22);
  animation: drift 18s var(--ease) infinite alternate-reverse;
}

.grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 33, 62, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 33, 62, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 35%, #000 18%, transparent 72%);
  opacity: 0.55;
}

html[data-theme="dark"] .grid-fade,
html[data-theme="system"]:not([data-resolved-theme="light"]) .grid-fade {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.host-chip {
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.theme-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.theme-opt {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.theme-opt[aria-checked="true"] {
  background: var(--navy-800);
  color: #fff;
}

html[data-theme="dark"] .theme-opt[aria-checked="true"],
html[data-theme="system"]:not([data-resolved-theme="light"]) .theme-opt[aria-checked="true"] {
  background: rgba(90, 214, 239, 0.18);
  color: var(--cyan-300);
}

.stage {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) 1.25rem 2rem;
  text-align: center;
  animation: rise 700ms var(--ease) both;
}

.brand-mark {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  object-fit: cover;
  margin-bottom: 1.25rem;
}

.brand-name {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.headline {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 auto 1.75rem;
  max-width: 34ch;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.status-panel {
  text-align: left;
  padding: 1.15rem 1.2rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--warn);
  box-shadow: 0 0 0 8px var(--warn-soft);
}

.status-panel[data-state="checking"] .status-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.status-panel[data-state="online"] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 8px var(--ok-soft);
  animation: pulse 2s ease-in-out infinite;
}

.status-panel[data-state="offline"] .status-dot {
  background: var(--down);
  box-shadow: 0 0 0 8px var(--down-soft);
  animation: none;
}

.status-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-sub {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0;
}

.meta-grid > div {
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--navy-800) 5%, transparent);
  border: 1px solid var(--border);
}

html[data-theme="dark"] .meta-grid > div,
html[data-theme="system"]:not([data-resolved-theme="light"]) .meta-grid > div {
  background: rgba(255, 255, 255, 0.04);
}

.meta-grid dt {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.meta-grid dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms var(--ease),
    border-color 180ms var(--ease), opacity 180ms var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-primary {
  background: var(--navy-800);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #243056;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.foot {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.foot a {
  color: inherit;
  text-underline-offset: 0.18em;
}

.foot a:hover {
  color: var(--ink);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.92);
    opacity: 0.72;
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(24px, 18px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
