:root {
  --bg: #070c10;
  --card: rgba(13, 22, 28, 0.88);
  --border: rgba(210, 238, 242, 0.11);
  --text: #eef6f6;
  --muted: #7f929a;
  --accent: #d9ff68;
  --blue: #8ec9ff;
  --green: #64e0aa;
  --orange: #ffb174;
  --display: Georgia, "Noto Serif SC", "Songti SC", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% -8%, rgba(142, 201, 255, 0.1), transparent 31rem),
    radial-gradient(circle at 14% 104%, rgba(217, 255, 104, 0.05), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ambient-grid {
  position: fixed;
  z-index: -2;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 68%, transparent);
}

.ambient-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
}

.glow-a {
  top: 12%;
  right: -12rem;
  width: 36rem;
  height: 36rem;
  background: radial-gradient(circle, rgba(217, 255, 104, 0.055), transparent 67%);
}

.glow-b {
  bottom: -18rem;
  left: 8%;
  width: 42rem;
  height: 42rem;
  background: radial-gradient(circle, rgba(142, 201, 255, 0.045), transparent 68%);
}

.public-header {
  display: flex;
  width: min(100% - 64px, 1460px);
  min-height: 92px;
  align-items: center;
  gap: 32px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(217, 255, 104, 0.28);
  border-radius: 10px;
  background: rgba(217, 255, 104, 0.04);
}

.brand-mark i {
  height: 50%;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
}

.brand-mark i:nth-child(2) {
  height: 75%;
  opacity: 0.75;
}

.brand-mark i:nth-child(3) {
  height: 100%;
}

.brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0.14em;
}

.brand strong span {
  color: var(--accent);
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #84969d;
  font-size: 10px;
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(100, 224, 170, 0.45);
}

.live-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--green);
  border-radius: inherit;
  animation: pulse 2s ease-out infinite;
  content: "";
}

@keyframes pulse {
  from {
    opacity: 0.6;
    transform: scale(0.6);
  }
  to {
    opacity: 0;
    transform: scale(1.5);
  }
}

.admin-link {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #91a2a9;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  transition: 150ms ease;
}

.admin-link:hover {
  border-color: rgba(217, 255, 104, 0.22);
  color: var(--accent);
}

.admin-link svg {
  width: 13px;
  height: 13px;
}

.public-main {
  width: min(100% - 64px, 1460px);
  margin: 0 auto;
  padding: 7vh 0 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.5fr);
  align-items: end;
  gap: 48px;
  padding-bottom: 5.5vh;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #697b83;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.eyebrow i {
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  margin: 18px 0 18px;
  font-family: var(--display);
  font-size: clamp(48px, 7.4vw, 108px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 em {
  color: var(--accent);
  font-style: italic;
}

.hero p {
  max-width: 610px;
  margin: 0;
  color: #788a92;
  font-size: 13px;
  line-height: 1.85;
}

.hero p code {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.clock-panel {
  padding: 22px 0 6px 24px;
  border-left: 1px solid var(--border);
  text-align: right;
}

.clock-label {
  color: #5f727a;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.clock {
  margin-top: 6px;
  font-family: var(--display);
  font-size: clamp(45px, 5vw, 74px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.date {
  margin-top: 8px;
  color: #7d8f96;
  font-size: 10px;
}

.aggregate-panel {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(210px, 0.4fr) minmax(300px, 0.8fr);
  align-items: center;
  gap: 26px;
  overflow: hidden;
  padding: 24px 28px;
  border: 1px solid rgba(217, 255, 104, 0.15);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(217, 255, 104, 0.08), transparent 35%),
    linear-gradient(145deg, rgba(142, 201, 255, 0.035), transparent 45%),
    var(--card);
  backdrop-filter: blur(15px);
}

.aggregate-panel::after {
  position: absolute;
  right: 30%;
  bottom: -80px;
  width: 280px;
  height: 160px;
  background: radial-gradient(ellipse, rgba(217, 255, 104, 0.045), transparent 70%);
  content: "";
  pointer-events: none;
}

.panel-index {
  align-self: stretch;
  padding-right: 20px;
  border-right: 1px solid var(--border);
  color: #41535c;
  font-family: var(--display);
  font-size: 34px;
  font-style: italic;
}

.section-kicker {
  color: #5d7078;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.aggregate-copy h2,
.section-head h2 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.aggregate-copy p {
  margin: 6px 0 0;
  color: #60737b;
  font-size: 9px;
}

.endpoint-box {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 9px 9px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(4, 8, 11, 0.48);
}

.endpoint-box code {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-box button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(217, 255, 104, 0.18);
  border-radius: 7px;
  background: rgba(217, 255, 104, 0.1);
  color: var(--accent);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.endpoint-box button:hover {
  background: rgba(217, 255, 104, 0.16);
}

.endpoint-box button svg {
  width: 13px;
  height: 13px;
}

.aggregate-meta {
  display: flex;
  grid-column: 2 / -1;
  align-items: center;
  gap: 21px;
  padding-top: 2px;
  color: #5d7078;
  font-size: 8px;
}

.aggregate-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aggregate-meta strong {
  color: var(--muted);
}

.meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #55676f;
}

.meta-dot.healthy {
  background: var(--green);
}

.warehouse-section {
  padding-top: 4.5vh;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 32px;
}

.section-head > span {
  color: #61747c;
  font-size: 9px;
}

.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.route-card {
  position: relative;
  display: flex;
  min-height: 188px;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 52%),
    rgba(12, 20, 26, 0.8);
  transition: 160ms ease;
}

.route-card:hover {
  border-color: rgba(217, 255, 104, 0.18);
  transform: translateY(-2px);
}

.route-card::after {
  position: absolute;
  right: -35px;
  bottom: -58px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  content: "";
}

.route-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-kind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.route-kind svg {
  width: 12px;
  height: 12px;
}

.route-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6f8289;
  font-size: 7px;
}

.route-live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #65777f;
}

.route-live.is-healthy {
  color: var(--green);
}

.route-live.is-healthy i {
  background: var(--green);
}

.route-live.is-stale {
  color: var(--orange);
}

.route-live.is-stale i {
  background: var(--orange);
}

.route-live.is-offline {
  color: var(--red, #ff786f);
}

.route-live.is-offline i {
  background: #ff786f;
  box-shadow: 0 0 6px rgba(255, 120, 111, 0.35);
}

.route-live.is-untouched {
  color: #6f8188;
}

.route-name {
  margin-top: 18px;
  font-family: var(--display);
  font-size: 31px;
  line-height: 1;
}

.route-path {
  margin-top: 8px;
  overflow: hidden;
  color: #687b83;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-author {
  margin-top: 8px;
  color: #8fa0a6;
  font-size: 9px;
}

.route-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  color: #5b6e76;
  font-size: 8px;
}

.route-meta strong {
  color: #9aabb1;
}

.route-copy {
  position: absolute;
  z-index: 1;
  right: 15px;
  bottom: 15px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #75888f;
  cursor: pointer;
}

.route-copy:hover {
  border-color: rgba(217, 255, 104, 0.2);
  color: var(--accent);
}

.route-copy svg {
  width: 13px;
  height: 13px;
}

.loading-card,
.empty-card {
  display: flex;
  min-height: 188px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(12, 20, 26, 0.58);
  text-align: center;
}

.loading-card span {
  width: 24px;
  height: 24px;
  margin-bottom: 12px;
  border: 1px solid rgba(217, 255, 104, 0.13);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-card strong,
.empty-card strong {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
}

.loading-card p,
.empty-card p {
  margin: 7px 0 0;
  color: #61747c;
  font-size: 9px;
}

.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-top: 5vh;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  color: #53666e;
  font-size: 8px;
}

.public-footer p {
  margin: 0;
}

.public-footer span {
  letter-spacing: 0.11em;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid rgba(217, 255, 104, 0.17);
  border-radius: 9px;
  background: #142026;
  color: #d7e4e3;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-size: 9px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-warning {
  border-color: rgba(255, 177, 116, 0.2);
}

@media (max-width: 1100px) {
  .warehouse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aggregate-panel {
    grid-template-columns: 42px 1fr;
  }

  .endpoint-box {
    grid-column: 2;
  }

  .aggregate-meta {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .public-header,
  .public-main {
    width: calc(100% - 28px);
  }

  .public-header {
    min-height: 74px;
    gap: 12px;
  }

  .header-status {
    display: none;
  }

  .admin-link {
    margin-left: auto;
  }

  .public-main {
    padding-top: 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero h1 {
    font-size: clamp(45px, 15vw, 72px);
  }

  .hero p {
    font-size: 11px;
  }

  .clock-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    text-align: left;
  }

  .clock {
    margin: 0;
    font-size: 30px;
  }

  .date {
    margin: 0;
  }

  .aggregate-panel {
    display: block;
    padding: 18px;
  }

  .panel-index {
    display: none;
  }

  .endpoint-box {
    margin-top: 16px;
    grid-template-columns: 1fr;
  }

  .endpoint-box button {
    justify-content: center;
  }

  .aggregate-meta {
    flex-wrap: wrap;
    gap: 9px 15px;
    margin-top: 12px;
  }

  .warehouse-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .section-head h2 {
    font-size: 27px;
  }

  .public-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

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