javascript:(function(){const old=document.getElementById('ej-flt-box');if(old)old.remove();const POST_SEL='.rtd,.c9-10';const CHECK_SEL='.rsc,.c9-11';const hasImg=rE=>{const ln=rE.querySelectorAll('a');for(const o of ln){const hr=(o.href||'').toLowerCase();if(hr.endsWith('.jpg')||hr.endsWith('.png')||hr.endsWith('.gif')||hr.endsWith('.webp'))return true;}return!!rE.querySelector('img');};const collectPosts=()=>{const posts=[];document.querySelectorAll(POST_SEL).forEach(rp=>{if(!rp.querySelector(CHECK_SEL))return;const bq=rp.querySelector('blockquote');if(!bq)return;const table=rp.closest('table');if(!table)return;posts.push({table,text:bq.innerText,img:hasImg(rp)});});return posts;};const box=document.createElement('div');box.id='ej-flt-box';box.style.cssText='position:fixed;top:8px;right:8px;z-index:999999;width:220px;'+'background:#F5F5DC;border:2px solid #800000;padding:8px;'+'font-size:13px;color:#800000;box-shadow:0 2px 6px rgba(0,0,0,.3);'+'display:flex;flex-direction:column;gap:6px;font-family:sans-serif';box.innerHTML='<div id="ej-hd" style="display:flex;justify-content:space-between;align-items:center;cursor:move">'+'<b>耳栓フィルタ</b>'+'<span>'+'<span id="ej-min" style="cursor:pointer;margin-right:8px">_</span>'+'<span id="ej-close" style="cursor:pointer">×</span>'+'</span>'+'</div>'+'<div id="ej-body" style="display:flex;flex-direction:column;gap:6px">'+'<div style="display:flex;align-items:center;gap:4px;font-size:11px">'+'<input id="ej-img" type="checkbox" style="margin:0">'+'<label for="ej-img" style="cursor:pointer;white-space:nowrap">画像のみ</label>'+'<label style="margin-left:4px">表示ワード</label>'+'</div>'+'<input id="ej-kw" type="text" placeholder="(スペース区切り)" '+'style="border:1px solid #ccc;padding:3px;font-size:12px;box-sizing:border-box;width:100%">'+'<label style="font-size:11px">除外ワード</label>'+'<input id="ej-ew" type="text" placeholder="(スペース区切り)" '+'style="border:1px solid #ccc;padding:3px;font-size:12px;box-sizing:border-box;width:100%">'+'<div style="display:flex;gap:4px">'+'<button id="ej-apply" style="flex:1;cursor:pointer;background:#800000;color:#fff;border:none;padding:4px">適用</button>'+'<button id="ej-reset" style="flex:1;cursor:pointer;background:#fff;color:#800000;border:1px solid #800000;padding:4px">解除</button>'+'</div>'+'<div id="ej-count" style="font-size:11px;text-align:right"></div>'+'</div>';document.body.appendChild(box);const imgI=box.querySelector('#ej-img');const kwI=box.querySelector('#ej-kw');const ewI=box.querySelector('#ej-ew');const countEl=box.querySelector('#ej-count');imgI.checked=localStorage.getItem('ejImg')==='1';kwI.value=localStorage.getItem('ejKw')||'';ewI.value=localStorage.getItem('ejEw')||'';const apply=()=>{const imgOnly=imgI.checked;const kw=kwI.value.trim().split(/\s+/).filter(Boolean);const ew=ewI.value.trim().split(/\s+/).filter(Boolean);localStorage.setItem('ejImg',imgOnly?'1':'0');localStorage.setItem('ejKw',kwI.value);localStorage.setItem('ejEw',ewI.value);const posts=collectPosts();let shown=0;posts.forEach(p=>{const matchKw=kw.length>0&&kw.some(k=>p.text.includes(k));const matchEw=ew.length>0&&ew.some(e=>p.text.includes(e));let show;if(imgOnly){show=p.img||matchKw;}else{show=true;}if(matchEw)show=false;p.table.style.display=show?'':'none';if(show)shown++;});countEl.innerText='表示: '+shown+' / '+posts.length;};const reset=()=>{collectPosts().forEach(p=>{p.table.style.display='';});countEl.innerText='';};box.querySelector('#ej-apply').onclick=apply;box.querySelector('#ej-reset').onclick=reset;box.querySelector('#ej-close').onclick=()=>{reset();box.remove();};[kwI,ewI].forEach(i=>{i.onkeydown=e=>{if(e.key==='Enter')apply();};});imgI.onchange=apply;const bodyEl=box.querySelector('#ej-body');const minBtn=box.querySelector('#ej-min');let minimized=false;minBtn.onclick=()=>{minimized=!minimized;bodyEl.style.display=minimized?'none':'flex';minBtn.innerText=minimized?'□':'_';box.style.width=minimized?'auto':'220px';};let dragging=false,ox=0,oy=0;box.querySelector('#ej-hd').onmousedown=e=>{dragging=true;ox=e.clientX-box.getBoundingClientRect().left;oy=e.clientY-box.getBoundingClientRect().top;};document.onmousemove=e=>{if(!dragging)return;box.style.left=(e.clientX-ox)+'px';box.style.top=(e.clientY-oy)+'px';box.style.right='auto';};document.onmouseup=()=>{dragging=false;};if(imgI.checked||kwI.value||ewI.value)apply();})();