/* 全站手机端适配：不改变桌面端布局 */
@media (max-width: 767px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { -webkit-text-size-adjust: 100%; }
  img, video, iframe { max-width: 100%; }
  input, textarea, select, button { max-width: 100%; font-size: 16px; }
  .content-wrap, .xj-main, .video-main, .login-wrap, .detail, .page,
  #topicRoot, #albumRoot { width: 100%; max-width: 100%; box-sizing: border-box; }
  .content-wrap, .xj-main { padding-left: 12px; padding-right: 12px; }
  .header-shell { width: 100%; box-sizing: border-box; }
  .site-header .brand { min-width: 180px; width: 180px; flex: 0 0 180px; }
  .site-header .brand-logo-full { width: 180px !important; height: 55px !important; max-width: none !important; object-fit: contain !important; object-position: left center !important; display: block; }
  /* 首页手机端与 PC 端使用同一完整横向 Logo */
  .xj-header .xj-logo-full { display: block !important; width: 92px !important; height: auto !important; max-height: 40px !important; object-fit: contain !important; }
  .xj-header .xj-logo-sm { display: none !important; }
  .xj-header .top-telegram-link { display: none !important; }
  .xj-header-inner { gap: 5px; padding-left: 6px; padding-right: 6px; }
  .xj-logo { width: 92px; flex: 0 0 92px; }
  .xj-search-wrap { min-width: 70px; max-width: none; flex: 1 1 110px; }
  .xj-header-actions { gap: 3px; min-width: 0; flex: 0 1 auto; }
  .xj-header-actions .xj-icon-btn { width: 27px !important; height: 27px !important; border-radius: 9px !important; font-size: .72rem; padding: 0; }
  .xj-header-actions .xj-app-anchor, .xj-header-actions .xj-user-anchor { display: contents; }
  .xj-mobile-nav { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, 22px); gap: 0 !important; overflow: visible !important; width: 100%; box-sizing: border-box; padding: 1px 4px 2px !important; }
  .xj-mobile-nav li:first-child { display: none !important; }
  .xj-header .xj-mobile-nav { margin-top: -8px !important; }
  /* 分类结果页移动端只保留返回首页 */
  .xj-site.category-mode .xj-mobile-nav { display: none !important; }
  .xj-site.category-mode .sub-bar-wrap { display: block !important; background: #45464b !important; border-bottom: 1px solid #606168; }
  .xj-site.category-mode .sub-bar-inner { display: flex !important; width: 100%; min-width: 0; height: 58px; padding: 2px 10px !important; overflow: hidden; }
  .xj-site.category-mode .sub-brand-home { display: inline-flex !important; height: 54px; margin-right: auto; }
  .xj-site.category-mode .sub-brand-home img { width: 100px !important; height: 54px !important; }
  .xj-site.category-mode .sub-nav { display: none !important; }
  .xj-site.category-mode .sub-home-text { display: inline-flex !important; align-items: center; height: 54px; margin: 0 auto; color: #fff !important; font-size: 15px; font-weight: 700; }
  /* 专题、发现、成人 AI 移动端统一顶部栏 */
  body.mobile-section-page .site-header.compact { background: #45464b !important; color: #fff; width: 100%; }
  body.mobile-section-page .site-header.compact .header-shell { height: 58px; min-height: 58px; padding: 2px 10px !important; box-sizing: border-box; }
  body.mobile-section-page .site-header.compact .brand { min-width: 100px; width: 100px; flex: 0 0 100px; }
  body.mobile-section-page .site-header.compact .brand-logo-full { width: 100px !important; height: 54px !important; max-width: none !important; object-fit: contain !important; }
  body.mobile-section-page .site-header.compact .header-home-text { margin: 0 auto; color: #fff !important; font-size: 15px; font-weight: 700; white-space: nowrap; }
  body.mobile-section-page .site-header.compact .xj-theme-toggle { flex: 0 0 36px; }
  .original-nav { background: #45464b !important; width: 100%; height: 58px !important; }
  .original-nav-inner { width: 100% !important; height: 58px; padding: 2px 10px; box-sizing: border-box; gap: 0 !important; }
  .original-brand { flex: 0 0 100px; }
  .original-brand img { width: 100px !important; height: 54px !important; }
  .original-links { display: none !important; }
  .original-mobile-home { display: inline-flex !important; align-items: center; justify-content: center; margin: 0 auto; color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
  .original-search { display: none !important; }
  .original-tools { flex: 0 0 36px; width: 36px !important; height: 36px !important; }
  .xj-mobile-nav li { min-width: 0; width: 100%; text-align: center; }
  .xj-mobile-nav a, .xj-mobile-nav button { width: 100%; height: 22px; box-sizing: border-box; padding: 2px 1px !important; font-size: .67rem !important; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .legacy-header .brand { min-width: 180px; width: 180px; flex: 0 0 180px; overflow: visible; }
  .legacy-header .brand-logo-full { width: 180px !important; height: 55px !important; max-width: none !important; flex: 0 0 180px; object-fit: contain !important; object-position: left center !important; }
  .site-header { max-width: 100vw; overflow: hidden; }
  .main-nav-row, .sub-bar-wrap { max-width: 100vw; }
  .sub-bar-wrap { overflow: hidden; }
  .sub-bar-inner { width: max-content; min-width: 100%; box-sizing: border-box; flex-wrap: nowrap !important; align-items: center !important; overflow-x: auto; padding: 8px 10px !important; }
  .sub-nav { display: flex !important; flex: 0 0 auto !important; flex-wrap: nowrap !important; width: max-content !important; min-width: 0 !important; overflow: visible !important; }
  .sub-nav button { flex: 0 0 auto !important; white-space: nowrap; }
  .xj-grid, .video-grid, .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .xj-card-v2, .xj-card, .card, .album-card { min-width: 0; }
  .xj-card-v2 img, .xj-card img, .card img { width: 100%; height: auto; }
  .player-wrap { width: 100%; max-width: 100%; }
  .player-wrap video { width: 100%; height: auto; max-height: 56vw; }
  .detail { margin: 12px auto; padding: 14px; border-radius: 10px; }
  .detail-actions { position: static !important; flex-direction: row !important; justify-content: space-around; width: 100%; margin: 0 0 12px; }
  .detail-actions button { min-height: 48px !important; width: auto !important; }
  .detail-footer-quick { gap: 12px; flex-wrap: wrap; }
  .detail-footer-card { padding: 20px 14px; }
  .form { flex-wrap: wrap; }
  .form input, .form textarea { min-width: 0; width: 100%; box-sizing: border-box; }
  .original-nav-inner { width: 100%; padding: 0 10px; box-sizing: border-box; gap: 10px; }
  .original-brand img { width: 130px; height: 48px; }
  .original-links { gap: 12px; overflow-x: auto; min-width: 0; }
  .original-links a { font-size: 13px; }
  .wrap { width: 100%; box-sizing: border-box; margin: 12px auto; padding: 0 10px 90px; }
  .feed-actions { position: static !important; transform: none !important; flex-direction: row !important; justify-content: space-around; margin: 4px 8px; }
  .feed-actions button { width: auto !important; font-size: 20px !important; }
  .feed-media { margin: 0 8px; }
  .post-media-item img, .post-media-item video { height: auto; min-height: 120px; }
  .feed-post h2 { font-size: 16px; }
  .bottom-tabbar { left: 4px; right: 4px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
  .login-wrap { padding: 20px 14px; }
}
