:root{--bg:#0f172a;--surface:#0b1223;--text:#e6edf3;--muted:#94a3b8;--line:#1f2a44;--code-bg:#1e293b}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto}
header{max-width:1024px;margin:24px auto 6px;padding:0 16px}
h1{margin:.2rem 0 0;font-size:24px}
.muted{color:var(--muted);margin:.2rem 0}
main{max-width:1024px;margin:0 auto 48px;padding:0 16px}
.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.item{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.item-image img,.item-video video{display:block;width:100%;height:auto;object-fit:contain;background:#000}
.item figcaption{padding:10px 12px;color:var(--muted);border-top:1px solid var(--line)}
.item-code{display:flex;flex-direction:column}
.code-header{padding:10px 12px;background:var(--code-bg);border-bottom:1px solid var(--line);font-weight:600;font-size:13px;display:flex;align-items:center;gap:8px}
.caption-inline{font-weight:400;color:var(--muted);margin-left:8px}
.item-code pre{margin:0;padding:12px;background:var(--code-bg);overflow:auto;max-height:400px}
.item-code code{font-family:ui-monospace,Consolas,Monaco,monospace;font-size:12px;line-height:1.5;color:#e6edf3}
.html-sandbox{width:100%;height:300px;border:none;background:#fff}
.expand-btn{background:rgba(255,255,255,.1);border:1px solid var(--line);color:var(--text);padding:4px 8px;border-radius:6px;cursor:pointer;font-size:11px;margin-left:auto}
.expand-btn:hover{background:rgba(255,255,255,.15)}
.item-expandable.expanded{grid-column:1/-1;max-width:100%}
.item-expandable.expanded .html-sandbox{height:80vh}
.item-expandable.expanded .code-content{max-height:80vh}
.code-content{margin:0;padding:12px;background:var(--code-bg);overflow:auto;max-height:400px}
.html-sandbox-full{width:100%;height:calc(100vh - 64px);border:0;background:#fff}
