:root {
  --bg: #f4f7f2;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --text: #19231f;
  --muted: #5a6762;
  --line: rgba(25, 35, 31, 0.1);
  --accent: #167c6b;
  --accent-soft: rgba(22, 124, 107, 0.12);
  --shadow: 0 20px 50px rgba(15, 28, 25, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(147, 224, 204, 0.45), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(255, 219, 145, 0.4), transparent 26%),
    linear-gradient(180deg, #fbfdf9 0%, var(--bg) 100%);
}

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

.hero {
  padding: 56px 20px 24px;
}

.hero-inner,
.results-bar,
.category {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-inner {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.96;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.search-wrap {
  display: block;
  margin-top: 28px;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

#searchInput {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font: inherit;
  appearance: none;
}

#searchInput:focus {
  outline: none;
  border-color: rgba(22, 124, 107, 0.5);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.page-main {
  padding: 8px 0 80px;
}

.results-bar {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

#categoryContainer {
  display: grid;
  gap: 20px;
}

.category {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.category.hidden {
  display: none;
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.category h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.category-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-item.hidden {
  display: none;
}

.link-card {
  display: block;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(25, 35, 31, 0.08);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 12px 28px rgba(15, 28, 25, 0.06);
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(22, 124, 107, 0.25);
  box-shadow: 0 18px 34px rgba(15, 28, 25, 0.1);
}

.link-card:focus-visible {
  outline: 2px solid rgba(22, 124, 107, 0.35);
  outline-offset: 2px;
}

.link-title {
  display: block;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.page-footer {
  padding: 0 20px 48px;
  text-align: center;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  .hero {
    padding: 20px 10px 12px;
  }

  .hero-inner,
  .results-bar,
  .category {
    width: min(100% - 20px, 1120px);
  }

  .hero-inner,
  .category {
    padding: 20px;
    border-radius: 22px;
  }

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

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