/* 旧版内核兜底（微信/X5/老安卓 WebView）。只在浏览器不支持时生效，新浏览器完全忽略。
   维护：新增 aspect-ratio / inset / dvh / :has 时，在这里补一条对应兜底。 */

/* 没有 dvh：用 vh 作为上限 */
@supports not (height: 1dvh) {
  .sheet { max-height: 88vh; }
  .chat-zoom img { max-height: 85vh; }
  .suggestions { max-height: 45vh; }
  .chat-sheet .sheet-body { height: min(660px, 88vh); }
}

/* 没有 aspect-ratio：用 padding-top 撑出 3:2 */
@supports not (aspect-ratio: 1 / 1) {
  .card .photo, .detail-media, .chat-product-photo { position: relative; height: 0; padding-top: 66.6667%; }
  .card .photo > *, .detail-media > *, .chat-product-photo > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
}

/* 没有 inset：用 top/right/bottom/left */
@supports not (inset: 0) {
  .photo img, .photo-placeholder, .custom-place img { top: 0; right: 0; bottom: 0; left: 0; }
  .suggestions { top: calc(100% + 5px); right: 0; left: 0; }
  .sheet { right: 0; bottom: 0; left: 0; }
  .support-dock { left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .group-rail [aria-pressed="true"]::after { right: 0; bottom: 0; left: 0; }
}

/* 没有 :has：搜索建议直接抬高层级 */
@supports not selector(:has(a)) {
  .search-block { position: relative; z-index: 5; }
}
