:root{--bg:#f6f7f9;--fg:#1d2330;--mut:#6b7385;--card:#fff;--bd:#e3e6ec;--ac:#d9480f;--hov:#fff4ee}
@media(prefers-color-scheme:dark){:root{--bg:#14171c;--fg:#e6e8ec;--mut:#8b93a3;--card:#1c2027;--bd:#2a303a;--ac:#ff8a4c;--hov:#262b34}}
*{box-sizing:border-box}
html,body{overflow-x:hidden;max-width:100%}
#list li{min-width:0}
.n{min-width:0}
body{margin:0;font:15px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--fg)}
a{color:inherit;text-decoration:none}
header{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;padding:.6rem 1rem;background:var(--card);border-bottom:1px solid var(--bd)}
.brand{font-weight:700;color:var(--ac)}
#crumbs{flex:1;min-width:0;overflow-x:auto;white-space:nowrap;color:var(--mut)}
#crumbs a{color:var(--fg)}#crumbs a:hover{color:var(--ac)}
#crumbs span{margin:0 .35rem}
.tools{display:flex;gap:.4rem}
input,select,button{font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--bd);border-radius:8px;padding:.35rem .6rem}
button{cursor:pointer}
#q{width:12rem}
main{padding:1rem;max-width:1600px;margin:0 auto}
#info{color:var(--mut);font-size:.85rem;margin-bottom:.6rem}
#list{list-style:none;margin:0;padding:0}
/* list view */
.list li a{display:grid;grid-template-columns:2.2rem minmax(0,1fr) 7rem 9rem;gap:.6rem;align-items:center;padding:.4rem .6rem;border-bottom:1px solid var(--bd)}
.list li a:hover{background:var(--hov)}
.list .th{width:2.2rem;height:2.2rem;border-radius:6px;object-fit:cover}
.list .s,.list .m{color:var(--mut);font-size:.85rem;text-align:right}
/* grid view */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.8rem}
.grid li a{min-width:0;display:flex;flex-direction:column;background:var(--card);border:1px solid var(--bd);border-radius:10px;overflow:hidden;height:100%}
.grid li a:hover{border-color:var(--ac)}
.grid .th{width:100%;aspect-ratio:4/3;object-fit:cover;background:var(--bg)}
.grid .ic{width:100%;aspect-ratio:4/3;font-size:1.6rem}
.grid .n{padding:.4rem .5rem 0;font-size:.85rem}
.grid .s{padding:0 .5rem .4rem;color:var(--mut);font-size:.75rem}
.grid .m{display:none}
.n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ic{display:flex;align-items:center;justify-content:center;width:2.2rem;height:2.2rem;border-radius:6px;font-size:.6rem;font-weight:700;color:#fff;text-transform:uppercase}
.ic.d{background:#e8a33d;font-size:1.1rem}
@media(max-width:640px){
 header{padding:.5rem}.tools{width:100%}#q{flex:1;width:auto}
 .list li a{grid-template-columns:2.2rem minmax(0,1fr) 5rem}.list .m{display:none}
 .grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:.5rem}main{padding:.5rem}
}
#lb{position:fixed;top:0;left:0;width:100vw;height:100vh;height:100dvh;z-index:10;background:rgba(0,0,0,.92);display:flex;align-items:center;justify-content:center;touch-action:none;overflow:hidden}
#lb[hidden]{display:none}
#lbi{max-width:100%;max-height:calc(100% - 5rem);object-fit:contain;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;transform-origin:center;will-change:transform;cursor:zoom-in}
#lb button{position:absolute;z-index:2;background:rgba(255,255,255,.08);border:0;color:#fff;font-size:2rem;border-radius:50%;width:3rem;height:3rem;line-height:1}
#lb .x{top:.8rem;right:.8rem;font-size:1.2rem}
#lb .prev{left:.8rem}#lb .next{right:.8rem}
#lb .cap{position:absolute;bottom:.6rem;left:0;right:0;text-align:center;color:#ddd;font-size:.85rem;padding:0 1rem}
#lb .cap a{color:var(--ac);margin-left:.6rem}
#tv{position:fixed;inset:0;z-index:10;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;padding:1rem}
#tv[hidden]{display:none}
.tvw{background:var(--card);border:1px solid var(--bd);border-radius:10px;width:min(1000px,100%);max-height:92vh;display:flex;flex-direction:column}
.tvh{display:flex;gap:.8rem;align-items:center;padding:.5rem .8rem;border-bottom:1px solid var(--bd)}
#tvt{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
#tvd{color:var(--ac)}
#tvb{margin:0;padding:.8rem;overflow:auto;font:13px/1.45 ui-monospace,Consolas,monospace;white-space:pre-wrap;word-break:break-word}
