/* =========================================================
   hub — 项目入口页样式
   想换配色只改 :root 里的几个变量即可
   ========================================================= */

:root {
  --bg: #07080b;
  --fg: #eef1f6;
  --muted: #939cad;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #7c5cff;
  --radius: 18px;
  --maxw: 1080px;
}

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

/* hidden 属性必须真的隐藏：.btn 上的 display 会盖掉浏览器默认的 [hidden] */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---------- 背景光斑 + 网格 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg::before {
  content: "";
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(58% 48% at 18% 0%, rgba(124, 92, 255, 0.24), transparent 62%),
    radial-gradient(48% 42% at 86% 8%, rgba(34, 211, 238, 0.14), transparent 62%),
    radial-gradient(60% 55% at 50% 105%, rgba(124, 92, 255, 0.12), transparent 62%);
  filter: blur(12px);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  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);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(72% 60% at 50% 18%, #000 15%, transparent 85%);
  mask-image: radial-gradient(72% 60% at 50% 18%, #000 15%, transparent 85%);
}

/* ---------- Hero ---------- */
.hero {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(52px, 11vh, 104px) 24px 44px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

#host {
  color: var(--muted);
  opacity: 0.85;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 7vw, 62px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.035em;
  background: linear-gradient(178deg, #ffffff 10%, #c8c4e4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  max-width: 56ch;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17px);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

.btn.primary {
  background: linear-gradient(180deg, #8f70ff, #6d4bff);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 12px 30px -14px rgba(124, 92, 255, 0.95);
}

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

/* ---------- 项目列表 ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px 88px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  color: var(--muted);
  opacity: 0.7;
}

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

/* 项目少于 3 个时让卡片撑满一行，避免右侧大面积留白 */
.grid.few {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.card {
  --c: var(--accent);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 21px 20px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.22s,
    box-shadow 0.22s;
}

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

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.25s;
  background: radial-gradient(
    120% 90% at 50% 0%,
    color-mix(in srgb, var(--c) 20%, transparent),
    transparent 70%
  );
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c) 52%, transparent);
  box-shadow: 0 26px 52px -30px color-mix(in srgb, var(--c) 85%, #000);
}

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

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

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 20px;
  line-height: 1;
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--c) 32%, transparent),
    rgba(255, 255, 255, 0.04)
  );
}

.card-headtext {
  min-width: 0;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sub {
  color: var(--muted);
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

.st.beta {
  background: #fbbf24;
}

.st.wip {
  background: #64748b;
}

.st.offline {
  background: #f87171;
}

.arrow {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
}

.card:hover .arrow {
  transform: translate(2px, -2px);
  color: var(--fg);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.62;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 3px;
}

.tag {
  padding: 2.5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

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

.empty code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- 页脚 ---------- */
footer {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px 30px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card,
  .dot {
    animation: none;
  }
  .card,
  .btn,
  .card::before {
    transition: none;
  }
}
