:root {
  --bg: #0b0e14;
  --bg-soft: #121722;
  --card: #161c28;
  --card-hover: #1c2433;
  --border: #232c3d;
  --text: #e7ecf3;
  --text-dim: #97a3b6;
  --primary: #6d7bff;
  --primary-soft: rgba(109, 123, 255, 0.14);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --nav-h: 58px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(109, 123, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(0, 200, 180, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 20px 36px;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }

.hero-logo {
  width: 84px; height: 84px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: block;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: 40px;
  margin: 0 0 10px;
  background: linear-gradient(90deg, #fff, #b9c2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--text-dim);
  font-size: 16px;
  margin: 0 0 28px;
  line-height: 1.6;
}

/* ---------- Search + Company ---------- */
.controls {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  align-items: stretch;
}
.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.search-icon { color: var(--text-dim); flex-shrink: 0; }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}
.search-box input::placeholder { color: var(--text-dim); }

.clear-btn {
  border: none;
  background: var(--border);
  color: var(--text-dim);
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: none;
  place-items: center;
}
.clear-btn:hover { color: var(--text); background: #2c374b; }
.clear-btn.show { display: grid; }

.company-select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 0 38px 0 16px;
  font-size: 14px;
  cursor: pointer;
  max-width: 240px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397a3b6' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color .2s, box-shadow .2s;
}
.company-select:hover { border-color: var(--primary); }
.company-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.company-select option { background: var(--bg-soft); color: var(--text); }

.stats {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 14px;
}
.stats span { color: var(--text); font-weight: 600; }

/* ---------- Filters ---------- */
.filters {
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  padding: 14px 20px;
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.chip-row.sub {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.chip {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.chip .count {
  font-size: 12px;
  opacity: .8;
  background: rgba(255,255,255,.15);
  padding: 1px 7px;
  border-radius: 999px;
}

/* ---------- Grid ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }

.result-bar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 15px;
}
.result-bar #resultLabel { color: var(--text); font-weight: 600; font-size: 17px; }
.result-count { font-size: 13px; }

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

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: var(--card-hover);
}
.card::after {
  content: "↗";
  position: absolute;
  top: 14px; right: 16px;
  color: var(--text-dim);
  font-size: 16px;
  opacity: 0;
  transition: opacity .18s;
}
.card:hover::after { opacity: 1; }

.card-head { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  background: #0e131d;
  border: 1px solid var(--border);
}
.logo-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.card-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title .name { font-weight: 700; font-size: 16px; }
.card-title .company { color: var(--text-dim); font-size: 12px; }

.card-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Empty / Footer ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-emoji { font-size: 42px; margin-bottom: 12px; }

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 30px 20px 50px;
  border-top: 1px solid var(--border);
}

@media (max-width: 540px) {
  .hero { padding: 44px 16px 28px; }
  .hero h1 { font-size: 30px; }
  .controls { flex-direction: column; }
  .company-select { max-width: none; width: 100%; padding: 12px 38px 12px 16px; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- Top Nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(90deg, #fff, #b9c2ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.brand-logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.menu { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.menu a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
  transition: all .18s ease;
}
.menu a:hover { color: var(--text); background: var(--bg-soft); }
.menu a.active { color: #fff; background: var(--primary-soft); font-weight: 600; }

@media (max-width: 540px) {
  .topnav-inner { gap: 10px; padding: 0 14px; }
  .brand { font-size: 16px; }
  .menu a { padding: 7px 10px; font-size: 13px; }
}

/* ---------- AI 精选专题 / 热榜 ---------- */
.topic-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.topic-meta { color: var(--text-dim); font-size: 13px; }
.topic-meta b { color: var(--text); }
.refresh-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all .18s;
}
.refresh-btn:hover { border-color: var(--primary); color: #fff; }

.platform-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.platform-tab {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s;
}
.platform-tab:hover { color: var(--text); }
.platform-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.hotlist { display: flex; flex-direction: column; gap: 8px; }
.hot-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .18s, background .18s, transform .18s;
}
.hot-item:hover { border-color: var(--primary); background: var(--card-hover); transform: translateX(3px); }
.hot-rank {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-soft);
}
.hot-item:nth-child(1) .hot-rank { background: #ff4d4f; color: #fff; }
.hot-item:nth-child(2) .hot-rank { background: #ff7a45; color: #fff; }
.hot-item:nth-child(3) .hot-rank { background: #ffa940; color: #fff; }
.hot-title { flex: 1; font-size: 14.5px; line-height: 1.4; }
.hot-heat { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }

/* 模型开源角标 */
.badge-open {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 200, 140, 0.15);
  color: #2ee6a6;
  border: 1px solid rgba(0, 200, 140, 0.35);
}

/* ---------- skill 集图标 / GitHub 卡片 ---------- */
.skill-ico {
  width: 46px; height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, #6d7bff, #00c8b4);
  border: 1px solid var(--border);
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}
.lang-tag { font-size: 12.5px; color: var(--text-dim); display: inline-flex; align-items: center; }
.lang-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-right: 6px; display: inline-block; }
.stars-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: #ffce4d;
  background: rgba(255, 206, 77, 0.12);
  border: 1px solid rgba(255, 206, 77, 0.3);
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.scene-tag {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(109, 123, 255, 0.35);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

