:root{
  --bg:#fafafa;
  --card-bg:#ffffff;
  --text:#222222;
  --sub:#8a8a8a;
  --border:#e7e7e7;
  --accent:#2563eb;
}
*{ box-sizing:border-box; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px;
  line-height:1.5;
}
a{ text-decoration:none; color:inherit; }

.topbar{
  background:var(--card-bg);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  max-width:900px;
  margin:0 auto;
  padding:18px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.site-title{
  font-size:17px;
  font-weight:600;
  margin:0;
  color:var(--text);
}
.search-box input{
  width:240px;
  max-width:50vw;
  padding:7px 12px;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--bg);
  font-size:13px;
  color:var(--text);
  outline:none;
}
.search-box input:focus{
  border-color:var(--accent);
  background:#fff;
}

.container{
  max-width:900px;
  margin:0 auto;
  padding:24px 20px 60px;
}
.cat-section{ margin-bottom:28px; }
.cat-title{
  font-size:13px;
  font-weight:600;
  color:var(--sub);
  text-transform:uppercase;
  letter-spacing:.5px;
  margin:0 0 10px;
  padding-bottom:6px;
  border-bottom:1px solid var(--border);
}

.link-list{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  gap:8px;
}
.link-item{
  display:flex;
  align-items:stretch;
  gap:10px;
  background:var(--card-bg);
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 12px;
  transition:border-color .12s, background .12s;
}
.link-item:hover{
  border-color:var(--accent);
  background:#f5f8ff;
}

.link-icon{
  flex:0 0 auto;
  align-self:stretch;
  aspect-ratio:1 / 1;
  border-radius:6px;
  background:var(--bg);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.link-icon img{ width:100%; height:100%; object-fit:cover; display:block; }
.icon-fallback{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  font-weight:700;
  color:var(--sub);
}

.link-text{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:1px;
}
.link-title{
  font-size:13.5px;
  font-weight:600;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.link-sub{
  font-size:12px;
  color:var(--sub);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.empty-tip{
  color:var(--sub);
  font-size:13px;
  text-align:center;
  padding:40px 0;
}
.empty-tip a{ color:var(--accent); }
.footer{
  text-align:center;
  padding:20px;
  font-size:12px;
  color:var(--sub);
}
.footer a{ color:var(--sub); }
.footer a:hover{ color:var(--accent); }

@media(max-width:600px){
  .link-list{ grid-template-columns:1fr; }
  .topbar-inner{ padding:14px 16px; }
  .search-box input{ width:100%; max-width:none; }
  .container{ padding:18px 16px 50px; }
}