:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --surface: #fffaf0;
  --surface-strong: #ffffff;
  --text: #1c2024;
  --muted: #626a73;
  --line: #ddd6c8;
  --accent: #246b5a;
  --accent-strong: #16493d;
  --blue: #245e9f;
  --amber: #9b6422;
  --rose: #9a4a5a;
  --shadow: 0 18px 40px rgba(38, 34, 27, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 320px),
    var(--bg);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header {
  padding: 22px clamp(18px, 4vw, 56px) 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 42px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
}

.brand-mark {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.brand-domain {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.source-link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.source-link:hover {
  color: var(--accent);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: end;
  gap: clamp(24px, 5vw, 64px);
  max-width: 1180px;
  margin: 0 auto;
}

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

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro-text {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
}

.search-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: var(--shadow);
}

.search-panel label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-strong);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 107, 90, 0.14);
}

.search-box button,
.category-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: pointer;
}

.search-box button:hover,
.category-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 56px) 54px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 14px;
  padding: 16px 0 18px;
  background: rgba(246, 242, 234, 0.92);
  backdrop-filter: blur(16px);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.category-tab[aria-pressed="true"] {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

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

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

.site-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(38, 34, 27, 0.04);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.site-card:hover {
  border-color: rgba(36, 107, 90, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

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

.site-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: #ffffff;
}

.category-pill {
  overflow-wrap: anywhere;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f2eadb;
}

.site-card h2 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.site-description {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.site-domain {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.empty-state,
.sources {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
}

.empty-state h2,
.sources h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.empty-state p,
.sources p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.sources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.sources a {
  color: var(--blue);
  font-weight: 700;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

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

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

@media (max-width: 720px) {
  .site-header {
    padding-top: 18px;
  }

  .topbar {
    margin-bottom: 30px;
  }

  h1 {
    font-size: 46px;
  }

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

  .toolbar {
    position: static;
  }

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

  .site-card {
    min-height: 164px;
  }

  .site-footer {
    display: grid;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
