:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-soft: #0e1420;
  --card: rgba(18, 26, 41, 0.78);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e8edf7;
  --muted: #94a3b8;
  --orange: #f6821f;
  --orange-soft: rgba(246, 130, 31, 0.14);
  --blue: #4f8cff;
  --green: #34d399;
  --red: #fb7185;
  --radius: 18px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 56px 56px;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  padding: 0.12rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 0.88em;
}

.glow {
  position: fixed;
  z-index: -1;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.34;
  pointer-events: none;
}

.glow-one {
  top: -15rem;
  right: -9rem;
  background: radial-gradient(circle, var(--orange), transparent 66%);
}

.glow-two {
  bottom: -18rem;
  left: -11rem;
  background: radial-gradient(circle, var(--blue), transparent 68%);
  opacity: 0.22;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), #ffb547);
  color: #1a1208;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 800;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.badge {
  padding: 0.35rem 0.75rem;
}

.badge::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.badge.online {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.35);
}

.badge.online::before {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.badge.offline {
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.35);
}

.badge.offline::before {
  background: var(--red);
}

.chip {
  padding: 0.3rem 0.65rem;
}

/* ------------------------------------------------------------- header auth */

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth {
  position: relative;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 160ms ease, background 160ms ease;
}

.auth-button:hover {
  border-color: rgba(246, 130, 31, 0.5);
  background: var(--orange-soft);
  text-decoration: none;
}

.auth-icon {
  flex: none;
  color: var(--muted);
}

.auth-button:hover .auth-icon {
  color: var(--orange);
}

.auth-avatar {
  display: grid;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ffb547);
  color: #1a1208;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.auth-avatar[hidden],
.auth-menu[hidden] {
  display: none;
}

.auth-label {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 0.55rem;
  min-width: 12rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111a29;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.auth-email {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.auth-logout {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 10px;
  background: rgba(251, 113, 133, 0.1);
  color: #ffe4e6;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-logout:hover {
  background: rgba(251, 113, 133, 0.18);
  filter: none;
  transform: none;
}

.page {
  display: grid;
  gap: 1.6rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

.hero {
  max-width: 760px;
  padding: 3rem 0 1rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 8vw, 5.4rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

h1 span {
  background: linear-gradient(100deg, var(--orange), #ffd28a 60%, var(--orange));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.lede {
  max-width: 640px;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

.card,
.tip,
.endpoint {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(14px);
}

.card {
  padding: 1.6rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.card-head p,
.endpoint p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hello-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-row {
  display: flex;
  gap: 0.7rem;
}

input {
  flex: 1;
  min-width: 0;
  padding: 0.82rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(8, 11, 18, 0.75);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: rgba(246, 130, 31, 0.7);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

button {
  padding: 0.82rem 1.3rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), #ffab3d);
  color: #1b1206;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 140ms ease, filter 140ms ease;
}

button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.25) brightness(0.8);
  transform: none;
}

.output {
  min-height: 3.2rem;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(8, 11, 18, 0.55);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.output.ok {
  border-color: rgba(52, 211, 153, 0.4);
  color: #d1fae5;
}

.output.error {
  border-color: rgba(251, 113, 133, 0.4);
  color: #ffe4e6;
}

.output.pending {
  color: var(--orange);
}

.output-meta {
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.endpoint {
  padding: 1.1rem;
}

.endpoint code {
  display: block;
  margin: 0.65rem 0;
  padding: 0;
  border: 0;
  background: none;
  color: #dbeafe;
  overflow-wrap: anywhere;
}

.method {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.method.get {
  background: rgba(79, 140, 255, 0.15);
  color: #93c5fd;
}

.method.post {
  background: var(--orange-soft);
  color: #fdba74;
}

.tip {
  padding: 1.4rem 1.6rem;
}

.tip ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.tip li::marker {
  color: var(--orange);
}

.site-footer {
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.not-found {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.not-found h1 {
  font-size: clamp(4rem, 16vw, 9rem);
  line-height: 1;
}

.not-found p {
  color: var(--muted);
}

/* -------------------------------------------------------------- login page */

.auth-page {
  display: grid;
  min-height: calc(100vh - 13rem);
  padding: 1.5rem 1.25rem 4rem;
  place-items: center;
}

.auth-card {
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-intro {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-bottom: 1.3rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 11, 18, 0.55);
}

.auth-tab {
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.auth-tab:hover {
  color: var(--text);
  filter: none;
  transform: none;
}

.auth-tab.is-active {
  background: var(--orange-soft);
  color: var(--orange);
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
}

.auth-submit {
  width: 100%;
  margin-top: 0.3rem;
}

.auth-error {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(251, 113, 133, 0.4);
  border-radius: 10px;
  background: rgba(251, 113, 133, 0.1);
  color: #ffe4e6;
  font-size: 0.82rem;
}

.auth-error[hidden] {
  display: none;
}

.auth-hint {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

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

  .card-head {
    flex-direction: column;
  }

  .field-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .auth-card {
    padding: 1.5rem;
  }
}

@media (max-width: 560px) {
  .site-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .header-actions {
    margin-left: auto;
  }

  .auth-label {
    display: none;
  }

  .auth-button {
    padding: 0.45rem;
  }
}

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