/* ============================================================
   eggle0v0 · 个人入口
   想换成照片背景：
   1. 把图片放到 assets/bg.jpg（或 png/webp）
   2. 把下面 --bg-image 改成 url("bg.jpg")，路径相对本文件
   3. 觉得太亮/太暗，调 --bg-image-opacity
   ============================================================ */

:root {
  --bg: #06060a;
  --ink: #f5f6fb;
  --muted: #a3a8bb;
  --faint: #71778c;
  --ok: #3ddc97;
  --bad: #ff6b81;
  --warn: #f5b544;
  --idle: #7d8398;
  --accent: #7c8cff;

  --bg-image: none;
  --bg-image-opacity: 0.5;

  --radius: 20px;
  --shell: min(1040px, 100% - 48px);
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(124, 140, 255, 0.35);
  color: #fff;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -52px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: #1a1c28;
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.bg__photo {
  position: absolute;
  inset: 0;
  background-image: var(--bg-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: var(--bg-image-opacity);
}

.orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.orb--indigo {
  width: 78vmax;
  height: 78vmax;
  top: -38vmax;
  left: -26vmax;
  background: radial-gradient(circle at 50% 50%, rgba(86, 96, 255, 0.3), rgba(86, 96, 255, 0) 62%);
}

.orb--mint {
  width: 66vmax;
  height: 66vmax;
  right: -22vmax;
  bottom: -34vmax;
  background: radial-gradient(circle at 50% 50%, rgba(53, 214, 184, 0.2), rgba(53, 214, 184, 0) 62%);
}

.orb--rose {
  width: 52vmax;
  height: 52vmax;
  top: 26%;
  right: 8%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 122, 144, 0.14), rgba(255, 122, 144, 0) 62%);
}

.bg__grid {
  position: absolute;
  inset: -2px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 0%, transparent 76%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 0%, transparent 76%);
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 20%, transparent 30%, rgba(4, 4, 8, 0.55) 78%, rgba(4, 4, 8, 0.88) 100%);
}

/* ---------- 布局 ---------- */

.shell {
  width: var(--shell);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 6vh, 56px) 0 clamp(20px, 3.5vh, 36px);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(34px, 6vh, 60px);
  padding: clamp(20px, 4vh, 40px) 0;
}

/* ---------- 标题 ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #8f95ab;
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c8cff, #35d6b8);
  box-shadow: 0 0 12px rgba(124, 140, 255, 0.7);
}

.wordmark {
  margin: 0;
  font-size: clamp(3.2rem, 8.4vw, 6.2rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.045em;
  color: transparent;
  background: linear-gradient(96deg, #ffffff 8%, #cfd3ff 46%, #7fe7d2 96%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 12px 40px rgba(124, 140, 255, 0.18));
}

.tagline {
  margin: 20px 0 0;
  max-width: 46ch;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  color: var(--muted);
}

/* ---------- 卡片 ---------- */

.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 20px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.2vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.022) 48%, rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s ease, box-shadow 0.4s ease;
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 15%, transparent), transparent 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 36px 80px -40px rgba(0, 0, 0, 1),
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.card:hover::after {
  opacity: 1;
}

.card:active {
  transform: translateY(-1px);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(22px, 2.6vw, 30px);
}

.card__glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
  transition: background 0.3s, box-shadow 0.3s;
}

.status[data-state="online"] {
  color: color-mix(in srgb, var(--ok) 72%, white);
  border-color: color-mix(in srgb, var(--ok) 26%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, rgba(0, 0, 0, 0.35));
}

.status[data-state="online"] .status__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent),
    0 0 12px color-mix(in srgb, var(--ok) 70%, transparent);
}

.status[data-state="offline"],
.status[data-state="error"] {
  color: color-mix(in srgb, var(--bad) 75%, white);
  border-color: color-mix(in srgb, var(--bad) 26%, transparent);
  background: color-mix(in srgb, var(--bad) 10%, rgba(0, 0, 0, 0.35));
}

.status[data-state="offline"] .status__dot,
.status[data-state="error"] .status__dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 16%, transparent),
    0 0 12px color-mix(in srgb, var(--bad) 60%, transparent);
}

.status[data-state="checking"] .status__dot {
  animation: blink 1.3s ease-in-out infinite;
}

.status[data-state="warn"] {
  color: color-mix(in srgb, var(--warn) 78%, white);
  border-color: color-mix(in srgb, var(--warn) 28%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, rgba(0, 0, 0, 0.35));
}

.status[data-state="warn"] .status__dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 16%, transparent),
    0 0 12px color-mix(in srgb, var(--warn) 65%, transparent);
}

.card__name {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.32rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card__host {
  margin: 7px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--faint);
  word-break: break-all;
}

.card__desc {
  flex: 1;
  margin: 16px 0 26px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  color: var(--faint);
}

.card__meta {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

.card__meta.is-bad {
  color: color-mix(in srgb, var(--bad) 78%, white);
}

.card__meta.is-warn {
  color: color-mix(in srgb, var(--warn) 82%, white);
}

.card__go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  transition: color 0.3s;
}

.card__go svg {
  width: 13px;
  height: 13px;
  transition: transform 0.3s;
}

.card:hover .card__go {
  color: var(--ink);
}

.card:hover .card__go svg {
  transform: translate(2px, -2px);
}

.noscript {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- 页脚 ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  font-size: 0.76rem;
  color: var(--faint);
}

.foot__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-mono);
}

.foot__sep {
  opacity: 0.45;
}

.refresh {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.refresh:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.refresh svg {
  width: 15px;
  height: 15px;
}

.refresh.is-busy svg {
  animation: spin 1s linear infinite;
}

.refresh:disabled {
  cursor: progress;
}

/* ---------- 动画 ---------- */

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

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

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

@keyframes drift {
  to {
    transform: translate3d(5vw, 4vh, 0) scale(1.07);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .orb--indigo {
    animation: drift 26s ease-in-out infinite alternate;
  }

  .orb--mint {
    animation: drift 32s ease-in-out infinite alternate-reverse;
  }

  .orb--rose {
    animation: drift 24s ease-in-out infinite alternate;
  }

  .hero > *,
  .card {
    animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .hero > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .card {
    animation-delay: calc(0.16s + var(--i) * 0.08s);
  }
}

/* ---------- 小屏 ---------- */

@media (max-width: 760px) {
  :root {
    --shell: min(100% - 36px, 560px);
  }

  .shell {
    padding: max(24px, env(safe-area-inset-top)) 0 max(18px, env(safe-area-inset-bottom));
  }

  .stage {
    gap: 28px;
    padding: 22px 0;
  }

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

  .wordmark {
    font-size: clamp(2.75rem, 12vw, 4rem);
  }

  .tagline {
    margin-top: 16px;
  }

  .card__head {
    margin-bottom: 20px;
  }

  .card__desc {
    margin: 14px 0 18px;
  }

  .card__foot {
    padding-top: 13px;
  }

  .foot {
    padding-top: 16px;
  }

  .refresh {
    width: 38px;
    height: 38px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .stage {
    justify-content: flex-start;
    padding-top: 8px;
  }
}
