:root {
  --bg: #07070b;
  --text: #f5f5f7;
  --muted: rgba(245, 245, 247, .64);
  --faint: rgba(245, 245, 247, .4);
  --line: rgba(255, 255, 255, .08);
  --radius: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- 背景 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.b1 {
  width: 64vmax; height: 64vmax; left: -20vmax; top: -26vmax;
  background: radial-gradient(circle, rgba(124, 58, 237, .45), transparent 62%);
  animation: drift1 22s ease-in-out infinite alternate;
}
.b2 {
  width: 52vmax; height: 52vmax; right: -18vmax; top: 6vh;
  background: radial-gradient(circle, rgba(236, 72, 153, .28), transparent 62%);
  animation: drift2 27s ease-in-out infinite alternate;
}
.b3 {
  width: 58vmax; height: 58vmax; left: 18vw; bottom: -34vmax;
  background: radial-gradient(circle, rgba(34, 211, 238, .18), transparent 62%);
  animation: drift3 31s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(9vw, 7vh, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-8vw, 12vh, 0) scale(.92); } }
@keyframes drift3 { to { transform: translate3d(-10vw, -8vh, 0) scale(1.1); } }

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 75%);
}
.grain {
  position: absolute; inset: 0; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.topbar.scrolled {
  background: rgba(7, 7, 11, .62);
  border-color: var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; font-size: 17px; }
.brand img { border-radius: 9px; box-shadow: 0 6px 20px -6px rgba(236, 72, 153, .6); }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
}
.status i {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: ping 2.4s var(--ease) infinite;
}
.status b { color: var(--text); font-weight: 600; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }

/* ---------- Hero ---------- */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(56px, 11vh, 120px) 24px 16px;
  text-align: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 6px 16px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  font-size: 13px; letter-spacing: .12em; color: var(--muted);
  animation: fade-up .8s var(--ease) both;
}
.eyebrow .pill {
  padding: 3px 9px; border-radius: 999px; letter-spacing: .06em;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
}
.hero h1 {
  margin: 28px 0 0;
  font-size: clamp(44px, 7.4vw, 100px);
  line-height: 1.06;
  letter-spacing: -.04em;
  font-weight: 800;
  animation: fade-up .9s var(--ease) .08s both;
}
.grad {
  background: linear-gradient(100deg, #c4b5fd 0%, #f0abfc 35%, #fda4af 65%, #fcd34d 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lead {
  max-width: 620px; margin: 26px auto 0;
  font-size: clamp(15px, 1.6vw, 18px); line-height: 1.8;
  color: var(--muted);
  text-wrap: balance;
  animation: fade-up .9s var(--ease) .16s both;
}
.hero-cta {
  margin-top: 38px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center;
  animation: fade-up .9s var(--ease) .24s both;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  background: #fff; color: #0b0b10; font-weight: 600; font-size: 15px;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.btn-primary svg { width: 18px; height: 18px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(255, 255, 255, .5); }
.btn-ghost {
  padding: 14px 22px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--muted); font-size: 15px;
}
.btn-ghost b { color: var(--text); }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }

/* ---------- 跑马灯 ---------- */
.marquee {
  margin-top: clamp(56px, 9vh, 88px);
  padding: 20px 0;
  border-block: 1px solid var(--line);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee-item {
  display: inline-flex; align-items: center; gap: 36px; padding-right: 36px;
  white-space: nowrap;
  font-size: clamp(24px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .3);
}
.marquee-item:nth-child(3n + 2) { color: rgba(255, 255, 255, .9); -webkit-text-stroke: 0; }
.marquee-item i { font-style: normal; font-size: .55em; color: #f0abfc; -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 工具卡片 ---------- */
.tools { max-width: 1200px; margin: 0 auto; padding: clamp(64px, 10vh, 100px) 24px 40px; scroll-margin-top: 40px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 32px;
}
.section-head .kicker { display: block; font-size: 12px; letter-spacing: .28em; color: var(--faint); margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.03em; font-weight: 750; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .card.featured { grid-column: span 2; }
}
@media (min-width: 1080px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  --c1: #8b5cf6; --c2: #22d3ee; --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 340px; padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  transition: translate .6s var(--ease), box-shadow .6s var(--ease), border-color .4s;
  animation: rise .9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 200ms);
  outline: none;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* 跟随鼠标的光斑 */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(460px circle at var(--mx) var(--my), var(--glow), transparent 60%);
  opacity: 0; transition: opacity .45s;
}
/* 渐变描边 */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--c1), transparent 42%, transparent 58%, var(--c2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0; transition: opacity .45s;
}
.card:hover, .card:focus-visible { translate: 0 -6px; box-shadow: 0 36px 70px -36px var(--glow-strong); border-color: transparent; }
.card:hover::before, .card:hover::after, .card:focus-visible::after { opacity: 1; }

.card-orb {
  position: absolute; z-index: -1; top: -70px; right: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--c2), var(--c1) 45%, transparent 70%);
  opacity: .42; filter: blur(10px);
  transition: transform 1s var(--ease), opacity .6s;
}
.card:hover .card-orb { transform: scale(1.15) rotate(25deg); opacity: .7; }

.card-top { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.card-index { font-size: 12px; letter-spacing: .24em; color: var(--faint); font-variant-numeric: tabular-nums; }
.badge {
  padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  color: var(--tint); background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

.card-icon {
  margin-top: 26px; width: 66px; height: 66px; border-radius: 20px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 14px 30px -12px var(--glow-strong);
  transition: transform .6s var(--ease);
}
.card:hover .card-icon { transform: translateY(-3px) rotate(-6deg); }
.card-icon svg { width: 30px; height: 30px; }
.card-icon .emoji { font-size: 32px; line-height: 1; }

.card-body { margin-top: auto; padding-top: 36px; }
.card h3 { margin: 0; font-size: clamp(24px, 2.4vw, 30px); font-weight: 750; letter-spacing: -.02em; }
.card .tagline { margin: 8px 0 0; font-size: 15px; font-weight: 500; color: var(--tint); }
.card .desc {
  margin: 12px 0 0; font-size: 14px; line-height: 1.75; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card.featured .desc { max-width: 560px; }

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
}
.host {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--faint);
}
.go { flex: none; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.go .arrow {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: #0b0b10;
  transition: transform .6s var(--ease), background .3s, color .3s;
}
.go .arrow svg { width: 16px; height: 16px; }
.card:hover .go .arrow { transform: rotate(-45deg); background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 80px 20px;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted);
}
.noscript-list { line-height: 2; color: var(--muted); }
.noscript-list a { color: var(--text); text-decoration: underline; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1200px; margin: 48px auto 0;
  padding: 28px 24px calc(40px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}

@media (max-width: 560px) {
  .topbar-inner { padding: 12px 18px; }
  .status { font-size: 12px; padding: 6px 12px; }
  .hero, .tools { padding-left: 18px; padding-right: 18px; }
  .card { min-height: 300px; padding: 24px; border-radius: 24px; }
  .section-head { margin-bottom: 22px; }
}

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