:root { --brand:#6d28d9; --brand2:#9333ea; --ink:#0f172a; --line:#e5e7eb; --muted:#64748b; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; font:15px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:var(--ink); background:#f6f7fb; }
.wrap { max-width:1200px; margin:0 auto; padding:0 22px; }
a { color:var(--brand); }

.hero { background:linear-gradient(135deg,#4c1d95,#7c3aed 55%,#a855f7); color:#fff; }
.hero .wrap { display:flex; justify-content:space-between; align-items:center; padding-top:20px; }
.logo { font-size:20px; letter-spacing:.3px; }
.logo b { font-weight:800; }
.topnav a { color:#fff; text-decoration:none; font-weight:600; opacity:.9; }
.topnav a:hover { opacity:1; }
.hero-body { text-align:center; padding:30px 22px 36px; max-width:760px; margin:0 auto; }
.hero-body h1 { font-size:30px; margin:0 0 10px; font-weight:800; }
.hero-body p { font-size:16px; opacity:.92; margin:0; }

/* Bố cục 2 vùng full-width: menu dọc trái + lưới phải */
.layout { display:flex; align-items:flex-start; width:100%; }
.side { width:250px; flex-shrink:0; align-self:stretch; background:#fff; border-right:1px solid var(--line);
  position:sticky; top:0; height:100vh; overflow-y:auto; padding:18px 14px; }
.side-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); padding:4px 12px 10px; }
.content { flex:1; min-width:0; padding:22px 26px; }

.tabs { display:flex; flex-direction:column; gap:4px; }
.tabs button { display:flex; justify-content:space-between; align-items:center; width:100%; text-align:left;
  background:transparent; border:0; padding:11px 14px; border-radius:10px; font:inherit; font-weight:600;
  cursor:pointer; color:var(--ink); }
.tabs button:hover { background:#f3f0fb; }
.tabs button.active { background:var(--brand); color:#fff; }
.tabs button .c { opacity:.65; font-weight:600; font-size:13px; background:rgba(0,0,0,.06); border-radius:20px; padding:1px 9px; }
.tabs button.active .c { background:rgba(255,255,255,.22); opacity:.95; }

.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:22px; padding-bottom:50px; }
.loading { color:var(--muted); grid-column:1/-1; text-align:center; padding:40px; }
.card { background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; display:flex; flex-direction:column; box-shadow:0 8px 24px rgba(15,23,42,.05); transition:transform .15s, box-shadow .15s; }
.card:hover { transform:translateY(-4px); box-shadow:0 16px 40px rgba(15,23,42,.12); }
.thumb { position:relative; aspect-ratio:16/10; background:#eef2f7 center top/cover no-repeat; overflow:hidden; cursor:pointer; }
.thumb .overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(76,29,149,.0); transition:background .15s; }
.thumb:hover .overlay { background:rgba(76,29,149,.35); }
.thumb .play { opacity:0; transform:scale(.9); transition:.15s; background:#fff; color:var(--brand); font-weight:700; padding:11px 20px; border-radius:30px; }
.thumb:hover .play { opacity:1; transform:scale(1); }
.card-body { padding:16px 18px; flex:1; display:flex; flex-direction:column; }
.card-body h3 { margin:0 0 4px; font-size:18px; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; min-height:2.6em; }
.card-body .desc { color:#475569; font-size:13.5px; line-height:1.5; margin:2px 0 6px; }
.card-body .cat { color:var(--muted); font-size:12.5px; }
.badge-int { display:inline-block; font-size:11px; font-weight:700; padding:2px 9px; border-radius:20px; background:#dcfce7; color:#15803d; vertical-align:middle; white-space:nowrap; }
.badge-static { background:#fef9c3; color:#a16207; }
.card-actions { display:flex; gap:8px; margin-top:auto; padding-top:14px; }
/* Nút Build ẩn mặc định — mở bằng phím tắt Ctrl+Shift+B */
.card-actions .btn.ghost { display:none; }
#demoExport { display:none; }
body.show-build .card-actions .btn.ghost { display:inline-flex; }
body.show-build #demoExport { display:inline-flex; }
.btn { background:var(--brand); color:#fff; border:0; padding:10px 16px; border-radius:9px; font:inherit; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.btn:hover { background:var(--brand2); }
.btn.ghost { background:#fff; color:var(--ink); border:1px solid var(--line); }
.btn.ghost:hover { background:#f8fafc; }
.btn.x { background:transparent; color:#fff; font-size:18px; padding:8px 12px; }
.btn.block { flex:1; justify-content:center; }

/* Demo modal */
.demo { position:fixed; inset:0; z-index:100; background:#1e1b2e; display:flex; flex-direction:column; }
.demo-bar { display:flex; justify-content:space-between; align-items:center; padding:10px 16px; background:#151221; color:#fff; gap:12px; flex-wrap:wrap; }
.demo-title { font-weight:700; }
.demo-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.demo-actions .vp { background:#2d2842; color:#cbd5e1; border:0; padding:8px 12px; border-radius:7px; cursor:pointer; font:inherit; font-size:13px; }
.demo-actions .vp.active { background:var(--brand); color:#fff; }
.demo-stage { flex:1; overflow:auto; display:flex; justify-content:center; background:#0f0d18; padding:0; }
.demo-stage iframe { width:100%; height:100%; border:0; background:#fff; transition:width .2s; }
.foot { background:#0f172a; color:#94a3b8; text-align:center; padding:22px; font-size:13.5px; }
@media(max-width:900px){
  .layout { flex-direction:column; }
  .side { width:100%; height:auto; position:static; border-right:0; border-bottom:1px solid var(--line); }
  .tabs { flex-direction:row; flex-wrap:wrap; }
  .tabs button { width:auto; }
  .content { padding:18px; }
}
@media(max-width:640px){ .hero-body h1{font-size:26px;} }
