diff --git a/src/app/globals.css b/src/app/globals.css index 5ea5c46..3c57524 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -159,3 +159,10 @@ div[data-media-provider] video { background-repeat: no-repeat !important; /* 防止重复 */ background-color: #000 !important; /* 其余区域填充为黑色 */ } + +/* 隐藏移动端竖屏时的 pip 按钮 */ +@media (max-width: 768px) and (orientation: portrait) { + .art-control-pip { + display: none !important; + } +} diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 6a0dc32..0fb84fe 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -49,6 +49,14 @@ function SearchPageClient() { map.set(key, arr); }); return Array.from(map.entries()).sort((a, b) => { + // 优先排序:标题与搜索词完全一致的排在前面 + const aExactMatch = a[1][0].title === searchQuery.trim(); + const bExactMatch = b[1][0].title === searchQuery.trim(); + + if (aExactMatch && !bExactMatch) return -1; + if (!aExactMatch && bExactMatch) return 1; + + // 如果都匹配或都不匹配,则按原来的逻辑排序 return a[1][0].year === b[1][0].year ? a[0].localeCompare(b[0]) : a[1][0].year > b[1][0].year @@ -89,6 +97,14 @@ function SearchPageClient() { const data = await response.json(); setSearchResults( data.results.sort((a: SearchResult, b: SearchResult) => { + // 优先排序:标题与搜索词完全一致的排在前面 + const aExactMatch = a.title === query.trim(); + const bExactMatch = b.title === query.trim(); + + if (aExactMatch && !bExactMatch) return -1; + if (!aExactMatch && bExactMatch) return 1; + + // 如果都匹配或都不匹配,则按原来的逻辑排序 return a.year === b.year ? a.title.localeCompare(b.title) : a.year > b.year