:root {
  --bg: oklch(97.2% 0.014 82);
  --panel: oklch(99.1% 0.008 84);
  --panel-2: oklch(94.7% 0.019 84);
  --ink: oklch(21% 0.028 248);
  --muted: oklch(48% 0.033 248);
  --soft: oklch(64% 0.027 248);
  --line: oklch(83% 0.025 82);
  --accent: oklch(55% 0.142 41);
  --accent-2: oklch(49% 0.1 184);
  --accent-3: oklch(58% 0.11 290);
  --shadow: 0 18px 60px oklch(24% 0.03 248 / 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, oklch(84% 0.09 61 / 0.52), transparent 30rem),
    radial-gradient(circle at 90% 0%, oklch(82% 0.08 194 / 0.44), transparent 31rem),
    linear-gradient(90deg, oklch(30% 0.026 248 / 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, oklch(30% 0.026 248 / 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid oklch(65% 0.16 55);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: oklch(98% 0.012 82 / 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--panel);
  color: var(--accent);
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.top-actions a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-actions a:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--panel);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-copy,
.search-panel,
.filters,
.site-card,
.empty-state,
.redirect-card {
  border: 1.5px solid var(--ink);
  background: var(--panel);
  box-shadow: 7px 7px 0 var(--ink);
}

.hero-copy {
  min-height: 320px;
  padding: 38px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, oklch(98% 0.01 80), oklch(91% 0.048 78));
}

.kicker,
.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.search-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-radius: 24px;
}

.search-box {
  display: grid;
  gap: 10px;
}

.search-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats div {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 26px;
  line-height: 1;
}

.stats span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filters {
  margin: 0 0 34px;
  padding: 18px;
  border-radius: 22px;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.category-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.category-button:hover,
.category-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--panel);
}

.section {
  margin-top: 44px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

h2 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.15;
}

.text-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
}

.text-button:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.result-summary {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

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

.featured-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-card {
  display: flex;
  min-height: 278px;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius);
  transition: transform .18s ease, box-shadow .18s ease;
}

.site-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.favicon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.favicon:not([src])::after {
  content: attr(data-fallback);
}

.site-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.category-badge {
  display: inline-flex;
  margin-top: 5px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.description {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.why {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-list span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.visit-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--panel);
  font-size: 14px;
  font-weight: 900;
}

.short-link {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 26px;
  border-radius: var(--radius);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state span {
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.redirect-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.redirect-card {
  display: grid;
  width: min(460px, 100%);
  gap: 12px;
  padding: 28px;
  border-radius: 24px;
}

.redirect-card h1 {
  margin: 8px 0 0;
  font-size: 28px;
}

.redirect-card p {
  margin-bottom: 12px;
  color: var(--muted);
  word-break: break-word;
}

.button-link {
  display: inline-flex;
  width: max-content;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--panel);
  font-weight: 900;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  h1 {
    font-size: 42px;
  }

  .site-grid,
  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .hero-copy,
  .search-panel {
    padding: 20px;
    border-radius: 22px;
  }

  h1 {
    font-size: 32px;
  }

  .lead {
    font-size: 16px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .site-grid,
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
