:root {
  --bg: #070b16;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(125, 211, 252, 0.45);
  --text: #e8edf7;
  --text-dim: #93a0b8;
  --text-faint: #5b6880;
  --accent-1: #7dd3fc;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --down: #64748b;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- animated background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}
.b1 {
  width: 55vmax; height: 55vmax;
  left: -18vmax; top: -20vmax;
  background: radial-gradient(circle, #2563eb 0%, transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.b2 {
  width: 45vmax; height: 45vmax;
  right: -15vmax; top: 8vmax;
  background: radial-gradient(circle, #7c3aed 0%, transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.b3 {
  width: 42vmax; height: 42vmax;
  left: 28vmax; bottom: -24vmax;
  background: radial-gradient(circle, #0891b2 0%, transparent 65%);
  animation: drift3 38s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(9vmax, 7vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vmax, 10vmax) scale(0.92); } }
@keyframes drift3 { to { transform: translate(-6vmax, -9vmax) scale(1.1); } }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 75%);
}

/* ---------- layout ---------- */
.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}

/* ---------- hero ---------- */
.hero { text-align: center; margin-bottom: 44px; }

.logo { margin-bottom: 18px; animation: rise 0.7s ease both; }

.title {
  font-size: clamp(44px, 8vw, 68px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  animation: rise 0.7s 0.05s ease both;
}
.grad {
  background: linear-gradient(100deg, var(--accent-1) 10%, var(--accent-2) 60%, #f0abfc 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 0.06em;
  animation: rise 0.7s 0.12s ease both;
}

.clock {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  animation: rise 0.7s 0.18s ease both;
}

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

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  flex-wrap: wrap;
  animation: rise 0.7s 0.22s ease both;
}

.searchbox {
  flex: 1;
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-faint);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.searchbox:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12);
}
.searchbox input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.searchbox input::placeholder { color: var(--text-faint); }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; }

.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat {
  padding: 7px 13px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat b { color: var(--text); font-weight: 600; }
.stat .dot-ok { color: var(--ok); }

/* ---------- cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.5, 1), background 0.22s, border-color 0.22s, box-shadow 0.22s;
  opacity: 0;
  animation: rise 0.55s ease both;
  animation-delay: var(--d, 0ms);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), hsl(var(--h) 85% 62% / 0.13), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: hsl(var(--h) 85% 62% / 0.5);
  box-shadow: 0 14px 38px -14px hsl(var(--h) 80% 50% / 0.35);
}
.card:hover::before { opacity: 1; }
.card:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.icon-box {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 23px;
  border-radius: 13px;
  background: linear-gradient(135deg, hsl(var(--h) 85% 62% / 0.22), hsl(var(--h) 85% 62% / 0.07));
  border: 1px solid hsl(var(--h) 85% 62% / 0.28);
}
.card-title-wrap { min-width: 0; flex: 1; }
.card-name {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2.5px 7px;
  border-radius: 6px;
  color: hsl(var(--h) 80% 75%);
  background: hsl(var(--h) 80% 62% / 0.13);
  border: 1px solid hsl(var(--h) 80% 62% / 0.25);
}
.card-desc {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.card-url {
  font-size: 12px;
  color: var(--text-faint);
  font-family: ui-monospace, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-side {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
  transition: background 0.3s, box-shadow 0.3s;
}
.status.checking { animation: pulse 1.1s ease-in-out infinite; }
.status.online { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.arrow {
  color: var(--text-faint);
  transition: transform 0.22s, color 0.22s;
}
.card:hover .arrow { transform: translate(3px, -3px); color: hsl(var(--h) 85% 70%); }

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.empty {
  text-align: center;
  padding: 56px 0;
  color: var(--text-faint);
  font-size: 14px;
}

/* ---------- footer ---------- */
.foot {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.foot a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.foot a:hover { color: var(--accent-1); }
.sep { opacity: 0.5; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .wrap { padding-top: 44px; }
  .grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .stats { justify-content: center; }
}

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