@import url("https://fonts.googleapis.com/css2?family=Syne:wght@500;700;800&family=Manrope:wght@400;500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root,
html[data-theme="aurora"] {
  --bg-top: #f7fbff;
  --bg-bottom: #eef6ff;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(9, 28, 59, 0.14);
  --text-main: #0f2140;
  --text-sub: #4b6189;
  --brand: #1778f2;
  --brand-soft: rgba(23, 120, 242, 0.14);
  --orange: #ff7d3c;
  --green: #00a07a;
  --section-text: #1150a8;
  --card-bg-top: rgba(255, 255, 255, 0.9);
  --card-bg-mid: rgba(255, 255, 255, 0.72);
  --card-bg-bottom: rgba(247, 251, 255, 0.7);
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-xl: 0 22px 56px rgba(18, 62, 132, 0.16);
  --shadow-md: 0 10px 26px rgba(18, 62, 132, 0.1);
}

html[data-theme="nightfall"] {
  --bg-top: #081224;
  --bg-bottom: #0e1d37;
  --panel: rgba(9, 23, 47, 0.72);
  --panel-strong: rgba(14, 30, 58, 0.86);
  --line: rgba(154, 183, 232, 0.24);
  --text-main: #e7efff;
  --text-sub: #9bb3da;
  --brand: #61b6ff;
  --brand-soft: rgba(97, 182, 255, 0.2);
  --orange: #ff9a57;
  --green: #2fc5aa;
  --section-text: #93c7ff;
  --card-bg-top: rgba(18, 38, 72, 0.94);
  --card-bg-mid: rgba(11, 28, 56, 0.8);
  --card-bg-bottom: rgba(11, 24, 46, 0.9);
  --shadow-xl: 0 28px 60px rgba(5, 12, 27, 0.52);
  --shadow-md: 0 14px 30px rgba(5, 12, 27, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  transition: background 0.35s ease, color 0.25s ease;
}

[v-cloak] {
  display: none;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.mesh {
  position: absolute;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0.34;
}

.mesh-a {
  width: 42vw;
  height: 42vw;
  left: -8vw;
  top: -10vw;
  background: radial-gradient(circle at 35% 30%, rgba(255, 125, 60, 0.55), rgba(255, 125, 60, 0));
  animation: drift-a 15s ease-in-out infinite;
}

.mesh-b {
  width: 36vw;
  height: 36vw;
  right: -6vw;
  top: 8vh;
  background: radial-gradient(circle at 40% 35%, rgba(23, 120, 242, 0.5), rgba(23, 120, 242, 0));
  animation: drift-b 18s ease-in-out infinite;
}

.mesh-c {
  width: 32vw;
  height: 32vw;
  left: 36vw;
  bottom: -10vw;
  background: radial-gradient(circle at 45% 30%, rgba(0, 160, 122, 0.45), rgba(0, 160, 122, 0));
  animation: drift-c 16s ease-in-out infinite;
}

.shell {
  width: min(1160px, 92vw);
  margin: 28px auto 34px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-xl);
  padding: 26px;
  animation: drop-in 0.7s ease both;
}

.badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
}

.hero h1 {
  margin: 0;
  font-family: "Syne", "Noto Sans SC", sans-serif;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.hero p {
  margin: 9px 0 0;
  color: var(--text-sub);
  font-size: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
  min-width: 260px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -55% auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--brand-soft);
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 27px;
  font-family: "Syne", sans-serif;
}

.toolbar {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  animation: drop-in 0.8s 0.1s ease both;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 12px;
  font: inherit;
  color: var(--text-main);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 120, 242, 0.14);
}

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

.ghost {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-main);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ghost:hover {
  transform: translateY(-2px);
}

.ghost.active,
.ghost:hover {
  border-color: rgba(23, 120, 242, 0.45);
  color: var(--brand);
}

.theme-switch {
  background: linear-gradient(120deg, rgba(23, 120, 242, 0.12), rgba(0, 160, 122, 0.12));
}

.perf-switch {
  background: linear-gradient(120deg, rgba(255, 125, 60, 0.14), rgba(23, 120, 242, 0.12));
}

.chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: drop-in 0.88s 0.16s ease both;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-main);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(120deg, rgba(23, 120, 242, 0.16), rgba(0, 160, 122, 0.16));
  border-color: rgba(23, 120, 242, 0.38);
  color: var(--section-text);
}

.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.site-card {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--card-bg-top), var(--card-bg-mid) 56%, var(--card-bg-bottom));
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.site-card:hover {
  border-color: rgba(23, 120, 242, 0.32);
}

.site-card.tilt {
  transform-style: preserve-3d;
  transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.22s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.site-card.tilt:hover {
  box-shadow: 0 20px 42px rgba(18, 62, 132, 0.2);
}

.site-card::after {
  content: "";
  position: absolute;
  top: -22px;
  right: -24px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--accent-soft, rgba(23, 120, 242, 0.18));
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-family: "Syne", "Noto Sans SC", sans-serif;
}

.icon {
  font-size: 22px;
}

.desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-sub);
  min-height: 42px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.pill.section {
  background: var(--accent-soft, rgba(23, 120, 242, 0.18));
  color: var(--section-text);
}

.pill.tag {
  background: rgba(9, 28, 59, 0.08);
  color: var(--text-sub);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.enter,
.star {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
}

.enter {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  padding: 9px 12px;
}

.enter:hover {
  border-color: rgba(23, 120, 242, 0.52);
  color: var(--brand);
}

.star {
  width: 44px;
  cursor: pointer;
  color: var(--text-sub);
  padding: 9px 0;
}

.star.active {
  color: var(--orange);
  border-color: rgba(255, 125, 60, 0.45);
  background: rgba(255, 125, 60, 0.12);
}

.empty {
  margin: 24px 0 8px;
  text-align: center;
  color: var(--text-sub);
}

.footer {
  margin-top: 20px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}

.card-enter-active,
.card-leave-active {
  transition: all 0.34s ease;
}

.card-enter-from,
.card-leave-to {
  opacity: 0;
  transform: translateY(20px) scale(0.97);
}

.card-move {
  transition: transform 0.34s ease;
}

@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(4vw, 3vh) scale(1.08);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-3vw, 2vh) scale(1.06);
  }
}

@keyframes drift-c {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(2vw, -2vh) scale(1.04);
  }
}

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

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

@media (max-width: 720px) {
  .shell {
    width: min(1160px, 94vw);
    margin-top: 16px;
  }

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

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

  .hero-stats {
    min-width: 0;
  }

  .hero,
  .toolbar,
  .site-card {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mesh-a,
  .mesh-b,
  .mesh-c {
    animation: none;
  }

  .hero,
  .toolbar,
  .chips {
    animation: none;
  }

  .card-enter-active,
  .card-leave-active,
  .card-move {
    transition: none;
  }
}

html[data-performance="eco"] .mesh-a,
html[data-performance="eco"] .mesh-b,
html[data-performance="eco"] .mesh-c {
  animation: none;
}

html[data-performance="eco"] .hero,
html[data-performance="eco"] .toolbar,
html[data-performance="eco"] .chips {
  animation: none;
}

html[data-performance="eco"] .site-card {
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

html[data-performance="eco"] .card-enter-active,
html[data-performance="eco"] .card-leave-active,
html[data-performance="eco"] .card-move {
  transition: none;
}
