* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --primary: #2f6fed;
  --primary-dark: #1e55c8;
  --border: #e6eaf0;
  --shadow: 0 16px 40px rgba(26, 44, 73, 0.08);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 111, 237, 0.16), transparent 30%),
    linear-gradient(180deg, #eef4ff 0%, var(--bg) 38%, #f8fafc 100%);
}

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

.site-header {
  padding: 28px 20px 36px;
}

.topbar {
  max-width: 1120px;
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #7c5cff);
  font-weight: 800;
  font-size: 24px;
  box-shadow: var(--shadow);
}

.brand h1 {
  margin: 0;
  font-size: 26px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.header-links {
  display: flex;
  gap: 10px;
}

.header-links a {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
}

.search-card,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.search-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px;
}

.search-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  background: #edf2fa;
  color: #38465d;
  font-size: 15px;
}

.search-tabs button.active {
  color: white;
  background: var(--primary);
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-size: 17px;
  outline: none;
}

.search-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.search-form button {
  border: 0;
  border-radius: 16px;
  padding: 0 26px;
  color: white;
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

.search-form button:hover {
  background: var(--primary-dark);
}

.quick-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quick-keywords a {
  color: var(--muted);
  font-size: 14px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 42px;
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-title h2,
.category h2,
.sidebar h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.section-title span {
  color: var(--muted);
  font-size: 14px;
}

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

.site-card {
  padding: 16px;
  border-radius: 18px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  transition: 0.18s ease;
}

.site-card:hover,
.link-list a:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 237, 0.4);
  box-shadow: 0 10px 24px rgba(26, 44, 73, 0.08);
}

.site-card strong {
  display: block;
  margin-bottom: 6px;
}

.site-card span {
  color: var(--muted);
  font-size: 13px;
}

.category-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 18px;
}

.sidebar a {
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  color: #38465d;
}

.sidebar a:hover {
  background: #f0f5ff;
  color: var(--primary);
}

.content-panels {
  min-width: 0;
}

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

.link-list a {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  transition: 0.18s ease;
}

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

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

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

  .sidebar {
    position: static;
  }

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

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

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .site-grid,
  .link-list {
    grid-template-columns: 1fr;
  }
}
