:root{
  --bg:#0f1014; --panel:#171922; --panel2:#1d2030;
  --line:#262938; --text:#e6e8ee; --muted:#9aa0b4; --dim:#5b6078;
  --fig:#a259ff; --sketch:#f7b500; --xd:#ff61f6; --psd:#31a8ff;
  --brand:#6b5cff; --brand2:#19c37d;
  --card:#13151d;
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;line-height:1.55;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--panel);padding:1px 6px;border-radius:6px;font-size:.88em;color:var(--muted)}
.wrap{max-width:1440px;margin:0 auto;padding:0 24px}

/* HERO */
.hero{padding:56px 0 28px;background:radial-gradient(1200px 400px at 50% -100%,rgba(107,92,255,.25),transparent 60%),linear-gradient(180deg,#141622,#0f1014)}
.hero h1{font-size:36px;margin:0 0 10px;letter-spacing:-.02em;background:linear-gradient(90deg,#fff,#b5bbf8);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.hero .sub{color:var(--muted);margin:0 0 20px;font-size:15px}
.stats{display:flex;gap:10px;flex-wrap:wrap}
.stats .stat{background:var(--panel);border:1px solid var(--line);padding:8px 14px;border-radius:999px;font-size:13px;color:var(--muted)}
.stats .stat b{color:var(--text);margin-right:4px;font-weight:600}
.banner{margin-top:18px;padding:12px 16px;background:rgba(25,195,125,.08);border:1px solid rgba(25,195,125,.3);border-radius:10px;color:#9ce6c2;font-size:13px;line-height:1.6;display:none}
.banner.show{display:block}
.banner b{color:var(--brand2)}
.banner a{color:#fff;text-decoration:underline;font-weight:600}

/* TOOLBAR */
.toolbar{position:sticky;top:0;z-index:10;backdrop-filter:blur(14px);background:rgba(15,16,20,.78);border-bottom:1px solid var(--line);padding:14px 0}
.toolbar .wrap{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.filters{display:flex;gap:8px;flex-wrap:wrap}
.pill{background:var(--panel);border:1px solid var(--line);color:var(--muted);padding:7px 14px;border-radius:999px;cursor:pointer;font-size:13px;transition:all .15s}
.pill:hover{color:var(--text);border-color:#3a3f55}
.pill.active{background:var(--brand);border-color:var(--brand);color:#fff}
#search{margin-left:auto;background:var(--panel);border:1px solid var(--line);color:var(--text);padding:8px 14px;border-radius:10px;font-size:14px;min-width:260px;outline:none}
#search:focus{border-color:var(--brand)}

/* GRID */
main{padding:32px 0 80px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;cursor:pointer;transition:all .2s;display:flex;flex-direction:column}
.card:hover{transform:translateY(-3px);border-color:#3a3f55;box-shadow:0 12px 30px -10px rgba(0,0,0,.6)}
.card .cover{aspect-ratio:16/10;background:var(--panel) center/cover;position:relative;overflow:hidden}
.card .cover img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .4s}
.card:hover .cover img{transform:scale(1.04)}
.card .id{position:absolute;top:10px;left:10px;background:rgba(0,0,0,.6);color:#fff;font-family:ui-monospace,monospace;font-size:11px;padding:3px 8px;border-radius:6px;font-weight:600}
.card .imported{position:absolute;top:10px;right:10px;background:var(--brand2);color:#000;font-size:10px;font-weight:700;padding:3px 8px;border-radius:6px;letter-spacing:.5px}
.card .body{padding:14px 16px;flex:1;display:flex;flex-direction:column;gap:10px}
.card h3{margin:0;font-size:14px;font-weight:600;line-height:1.35;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.7em}
.card .meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--dim);font-size:12px;margin-top:auto}
.badges{display:flex;gap:5px;flex-wrap:wrap}
.badge{font-size:10px;padding:2px 7px;border-radius:4px;font-weight:700;letter-spacing:.3px}
.badge.fig   {background:rgba(162,89,255,.15);color:var(--fig);border:1px solid rgba(162,89,255,.35)}
.badge.sketch{background:rgba(247,181,0,.12);color:var(--sketch);border:1px solid rgba(247,181,0,.35)}
.badge.xd    {background:rgba(255,97,246,.12);color:var(--xd);border:1px solid rgba(255,97,246,.35)}
.badge.psd   {background:rgba(49,168,255,.12);color:var(--psd);border:1px solid rgba(49,168,255,.35)}

.empty{text-align:center;color:var(--muted);padding:60px 0;font-size:14px}

/* MODAL */
.modal{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:40px 20px;animation:fadeIn .18s ease}
.modal[hidden]{display:none}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal-bg{position:absolute;inset:0;background:rgba(0,0,0,.8);backdrop-filter:blur(6px)}
.modal-panel{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:16px;max-width:1200px;width:100%;max-height:90vh;overflow:auto;box-shadow:0 30px 80px rgba(0,0,0,.6)}
.modal-close{position:absolute;top:12px;right:12px;background:var(--panel2);border:1px solid var(--line);color:var(--text);width:36px;height:36px;border-radius:10px;cursor:pointer;font-size:16px;z-index:2;display:flex;align-items:center;justify-content:center}
.modal-close:hover{background:var(--line)}
.modal-body{padding:32px}
.modal-body h2{margin:0 0 6px;font-size:22px;letter-spacing:-.01em;padding-right:40px}
.modal-body .sub2{color:var(--muted);font-size:13px;margin-bottom:20px;display:flex;gap:14px;flex-wrap:wrap;align-items:center}
.modal-body .actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:24px}
.btn{background:var(--brand);color:#fff;border:none;padding:9px 16px;border-radius:10px;font-size:13px;font-weight:600;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.btn:hover{opacity:.9}
.btn.ghost{background:var(--panel2);border:1px solid var(--line);color:var(--text)}
.btn.ghost:hover{background:var(--line)}
.gallery{display:grid;grid-template-columns:1fr;gap:14px}
.gallery img{width:100%;border-radius:10px;display:block;background:var(--panel2)}
.spec{display:grid;grid-template-columns:120px 1fr;gap:8px 20px;margin:20px 0;font-size:13px}
.spec .k{color:var(--muted)}
.spec .v{color:var(--text);font-family:ui-monospace,monospace;font-size:12px;word-break:break-all}
.figma-embed{width:100%;aspect-ratio:16/10;border:0;border-radius:10px;background:var(--panel2);margin-bottom:16px}

/* FOOTER */
footer{border-top:1px solid var(--line);padding:20px 0;color:var(--muted);font-size:12px}
footer .wrap{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
