Text to vertical video in 100+ styles: AI codes each scene (HTML/SVG/WebGL), renders a 9:16 MP4 with music and English/Vietnamese voice. MCP, CLI and REST for AI agents.
/* "Tạo mẫu từ video" (learn-panel.js). Dùng token của style.css (--panel, --ink, --accent…). */
.lp-open { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.lp-open svg { width: 18px; height: 18px; flex: none; }
.lp-open:hover { background: var(--accent); color: var(--accent-ink); }
.lp { width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); overflow: auto; }
.lp::backdrop { background: rgba(0, 0, 0, .66); }
.lp[open] { animation: lp-in .2s ease-out; }
@keyframes lp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lp[open] { animation: none; } }
.lp > * { margin-left: 24px; margin-right: 24px; }
.lp-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 16px 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.lp-head h2 { margin: 0; flex: 1; font: 700 24px/1.2 var(--cond); text-transform: uppercase; letter-spacing: .03em; overflow-wrap: anywhere; }
.lp-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--panel-2); color: var(--ink-2); cursor: pointer; }
.lp-icon:hover { color: var(--ink); }
.lp-icon svg { width: 18px; height: 18px; }
.lp-lead { color: var(--ink-2); margin-top: 16px; margin-bottom: 16px; max-width: 70ch; }
.lp-dim { color: var(--ink-3); font-size: 14px; }
.lp-hint { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }
.lp-err { color: var(--bad); margin: 12px 0 0; }
.lp-empty { color: var(--ink-2); background: var(--panel-2); border-radius: 10px; padding: 16px; }
.lp-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding-bottom: 24px; }
.lp-col { min-width: 0; }
.lp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 260px; padding: 24px; border: 2px dashed var(--line); border-radius: var(--r); background: var(--panel-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.lp-drop:hover, .lp-drop.on, .lp-drop:focus-visible { border-color: var(--accent); }
.lp-drop-ic svg { width: 36px; height: 36px; color: var(--accent); }
.lp-big { font-weight: 600; font-size: 17px; }
.lp-picked { display: flex; flex-direction: column; gap: 8px; }
.lp-vid { width: 100%; max-height: 420px; aspect-ratio: 9 / 16; object-fit: contain; background: #000; border-radius: 10px; }
.lp-file { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; overflow-wrap: anywhere; }
.lp-link { border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 4px; }
.lp-field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.lp-field:first-child { margin-top: 0; }
.lp-field label { font-weight: 600; font-size: 15px; }
.lp-opt { color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.lp-in { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
textarea.lp-in { resize: vertical; line-height: 1.5; }
.lp-mono { font-family: var(--mono); font-size: 14px; }
.lp-range { display: flex; align-items: center; gap: 12px; }
.lp-range input { flex: 1; min-height: 44px; accent-color: var(--accent); }
.lp-range output { font: 500 14px var(--mono); color: var(--ink-2); white-space: nowrap; }
.lp-rules { margin-top: 16px; padding: 12px 16px; border-radius: 10px; background: var(--panel-2); border-left: 3px solid var(--warn); font-size: 14px; color: var(--ink-2); }
.lp-rules strong { color: var(--ink); }
.lp-rules ul { margin: 6px 0 0; padding-left: 18px; }
.lp-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; min-height: 44px; cursor: pointer; color: var(--ink-2); font-size: 15px; }
.lp-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.lp-consent { color: var(--ink); font-weight: 500; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.lp-primary, .lp-ghost, .lp-danger { min-height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: filter .15s, background .15s; }
.lp-primary { border: 0; background: var(--accent); color: var(--accent-ink); }
.lp-primary:hover:not(:disabled) { filter: brightness(1.08); }
.lp-ghost { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
.lp-danger { border: 1px solid var(--line); background: transparent; color: var(--bad); }
.lp-primary:disabled, .lp-ghost:disabled, .lp-danger:disabled { opacity: .45; cursor: not-allowed; }
.lp-bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 12px; }
.lp-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.lp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lp-row { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 56px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); text-align: left; cursor: pointer; }
.lp-row:hover { border-color: var(--ink-3); }
.lp-row-t { flex: 1 1 200px; font-weight: 600; overflow-wrap: anywhere; }
.lp-row-m { font: 400 13px var(--mono); color: var(--ink-3); }
.lp-chip { font: 600 12px/1 var(--mono); padding: 6px 8px; border-radius: 6px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.lp-chip.ok { background: var(--ok); border-color: var(--ok); color: #06210F; }
.lp-chip.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.lp-chip.run { border-color: var(--accent); color: var(--accent); }
.lp-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 16px; }
.lp-steps-wrap { margin-top: 8px; }
.lp-steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 4px; }
.lp-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 40px; color: var(--ink-3); }
.lp-steps li.now { color: var(--ink); }
.lp-steps li.done { color: var(--ink-2); }
.lp-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.lp-dot svg { width: 14px; height: 14px; }
.lp-steps li.done .lp-dot { background: var(--ok); border-color: var(--ok); color: #06210F; }
.lp-steps li.now .lp-dot { border-color: var(--accent); border-top-color: transparent; animation: lp-spin 1s linear infinite; }
@keyframes lp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lp-steps li.now .lp-dot { animation: none; border-top-color: var(--accent); } }
.lp-step-t { font-weight: 600; }
.lp-step-m { font: 400 13px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.lp-step-n { grid-column: 2 / -1; font-size: 13px; color: var(--ink-3); margin-top: -6px; }
.lp-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.lp-media figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lp-media figcaption { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.lp-media video { width: 100%; aspect-ratio: 9 / 16; max-height: 560px; object-fit: contain; background: #000; border-radius: 10px; }
.lp-media img { width: 100%; height: auto; border-radius: 10px; background: #000; }
.lp-ph { aspect-ratio: 9 / 16; max-height: 560px; display: grid; place-items: center; padding: 16px; text-align: center; border-radius: 10px; background: var(--panel-2); color: var(--ink-3); }
.lp-sheets, .lp-self { margin-top: 16px; }
.lp-sheets summary, .lp-self summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.lp-self ul { list-style: none; padding: 0; margin: 4px 0 0; font-size: 14px; }
.lp-self li { padding: 4px 0; }
.lp-self li.ok span:first-child { color: var(--ok); }
.lp-self li.bad span:first-child { color: var(--bad); }
.lp-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.lp-table caption { text-align: left; font-weight: 600; padding-bottom: 8px; color: var(--ink); }
.lp-table th, .lp-table td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lp-table thead th { color: var(--ink-3); font-weight: 500; }
.lp-table td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lp-table tr.off td:last-child { color: var(--warn); }
.lp-table tr.ok td:last-child { color: var(--ok); }
.lp-tag { margin-left: 8px; font-family: var(--sans); font-size: 12px; }
.lp-sw { display: inline-flex; gap: 4px; }
.lp-sw i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .2); }
.lp-diffs { margin-top: 20px; padding: 12px 16px; border-radius: 10px; background: var(--panel-2); }
.lp-diffs h3, .lp-save h3 { margin: 0 0 8px; font-size: 16px; }
.lp-diffs ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.lp-guide { margin-top: 24px; }
.lp-errs, .lp-warns { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.lp-errs { color: var(--bad); }
.lp-warns { color: var(--warn); }
.lp-save { margin-top: 24px; margin-bottom: 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }
.lp-save-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.lp-save-row .lp-field { margin-top: 0; }
.lp-done { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 20px; margin-bottom: 24px; padding: 20px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--ok); }
.lp-done > div { flex: 1 1 240px; }
.lp-done p { margin: 4px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.lp-done-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--ok); color: #06210F; display: grid; place-items: center; animation: lp-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.lp-done-ic svg { width: 24px; height: 24px; }
@keyframes lp-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lp-done-ic { animation: none; } }
@media (max-width: 720px) {
.lp { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
.lp > * { margin-left: 16px; margin-right: 16px; }
.lp-head { padding: 12px 8px 8px 16px; }
.lp-form, .lp-save-row { grid-template-columns: 1fr; }
.lp-media { gap: 8px; }
.lp-table th:nth-child(1) { width: 40%; }
}