:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-weak: #dbeafe;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.main { padding: 24px 0 40px; }

.search-section { display: flex; justify-content: center; }
.search-input {
  width: 100%;
  max-width: 640px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.filter-section { margin-top: 16px; }
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f9fafb;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { background: #f3f4f6; }
.chip.active {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent);
}

.cards-section { margin-top: 20px; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.12s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.card-domain {
  margin: 0;
  color: #374151;
  font-size: 12px;
}
.card-actions {
  margin-top: 4px;
}
.card-link {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.card-link:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}
.card-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
}

.empty-message {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.footer-link {
  color: var(--accent);
  text-decoration: none;
}
.footer-link[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

@media (max-width: 640px) {
  .title { font-size: 22px; }
  .search-input { max-width: 100%; }
  .card-icon { width: 32px; height: 32px; }
}
