:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #6366f1;
  --primary-2: #06b6d4;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(99, 102, 241, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #06b6d4 100%);
  padding: 40px 0 0;
  border-radius: 0 0 32px 32px;
}
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.brand { display: flex; align-items: center; gap: 14px; color: #fff; position: relative; }
.logo { width: 52px; height: 52px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); }
.brand h1 { font-size: 26px; letter-spacing: 2px; font-weight: 700; }
.tagline { font-size: 12px; opacity: .85; letter-spacing: 3px; margin-top: 2px; }
.admin-link {
  margin-left: auto; color: #fff; text-decoration: none; font-size: 20px;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); border-radius: 12px; backdrop-filter: blur(4px);
  transition: background .2s;
}
.admin-link:hover { background: rgba(255,255,255,.3); }

.search-wrap {
  margin: 26px auto 0; max-width: 620px; position: relative;
}
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
#search {
  width: 100%; padding: 16px 20px 16px 48px; font-size: 15px;
  border: none; border-radius: 999px; outline: none; color: var(--text);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}
#search:focus { box-shadow: 0 10px 34px rgba(15,23,42,.26), 0 0 0 3px rgba(255,255,255,.35); }

.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 22px 0 16px;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  white-space: nowrap; padding: 8px 18px; border-radius: 999px; font-size: 14px;
  background: rgba(255,255,255,.16); color: #fff; cursor: pointer; border: 1px solid rgba(255,255,255,.25);
  transition: all .2s;
}
.cat-tab.active, .cat-tab:hover { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; }

/* ---------- content ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 8px 24px 40px; }
.section { margin-top: 28px; }
.section h2 {
  font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.section h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px;
}

.card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.16);
}
.favicon {
  width: 36px; height: 36px; border-radius: 10px; object-fit: contain; background: #f1f5f9;
  padding: 4px; flex: none;
}
.card-info { min-width: 0; }
.card-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* letter avatar fallback */
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}

.hidden { display: none; }

footer {
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 24px 0 36px;
}

@media (max-width: 640px) {
  .hero { border-radius: 0 0 20px 20px; padding-top: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .brand h1 { font-size: 21px; }
}
