Skip to content

孔版双色风格的口播信息动画 Skill:逐字稿 → 1080×1920 竖屏 mp4 · Risograph-style info animations for talking-head videos

eian-riso-broll v1.0.0

YIAN6557ad22c26ba52b
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..760b459
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,64 @@
+name: Package checks
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ smoke:
+ name: Smoke test · Ubuntu · all templates
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v7
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: 22
+ - name: Install ffmpeg
+ run: sudo apt-get update && sudo apt-get install --yes ffmpeg
+ - name: Allow Chrome's sandbox (Ubuntu 24.04 restricts user namespaces)
+ run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
+ - name: Check environment
+ run: node scripts/check_setup.mjs
+ - name: Smoke test
+ run: node tests/smoke.mjs --out "$RUNNER_TEMP/smoke"
+ - name: Upload stills and QA overlays
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: smoke-ubuntu
+ path: |
+ ${{ runner.temp }}/smoke/plates
+ ${{ runner.temp }}/smoke/qa
+ if-no-files-found: ignore
+
+ cross-platform:
+ name: Smoke test · ${{ matrix.os }} · sample templates
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v7
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: 22
+ - name: Install ffmpeg (macOS)
+ if: runner.os == 'macOS'
+ run: brew install ffmpeg
+ - name: Install ffmpeg (Windows)
+ if: runner.os == 'Windows'
+ run: choco install ffmpeg --yes --no-progress
+ - name: Check environment
+ run: node scripts/check_setup.mjs
+ - name: Smoke test
+ run: node tests/smoke.mjs number quote --out "${{ runner.temp }}/smoke"
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..646ac51
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules/
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..0cf4d3b
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,25 @@
+# Changelog · 更新日志
+
+格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循[语义化版本](https://semver.org/lang/zh-CN/)。
+
+## [1.0.0] - 2026-10-11
+
+首个公开版本。First public release.
+
+### 内容
+
+- 10 个模板:误区翻转 `versus`、章节卡 `title`、数字冲击 `number`、前后对比 `compare`、收敛归类 `converge`、连接密度 `network`、多选一 `focus`、流程步骤 `steps`、截图锚点 `shot`、金句 `quote`。
+- 孔版双色视觉系统:两种油墨、叠印第三色、套印错位、网点;四组配色。
+- 三道确认门的工作流:分镜表 → 样帧 → 成片;屏幕文字只摘原话。
+- 渲染:1080×1920 / 30fps H.264 mp4,透明底 ProRes 4444,样帧与 contact sheet。
+- 自动质检:安全区、短视频右侧按钮栏、字号、对比度、文字互压、成片时长与尺寸,并输出叠层图。
+- 时长脚本:从 SRT 精确定位入点出点,或按语速估算。
+- 内置字体(思源宋体、思源黑体、Oswald、JetBrains Mono),macOS / Linux / Windows 渲染结果一致。
+- 一段虚构的示例逐字稿,模板默认数据、demo 和评测用例都来自原创文案。
+- 一键自测 `tests/smoke.mjs`,以及 GitHub Actions 持续检查(Ubuntu 全量,macOS / Windows 抽测)。
+
+### 许可
+
+- Eian 个人非商业使用许可 1.0:个人非商用免费,商业使用需事先书面授权。
+
+[1.0.0]: https://github.com/YIAN6557/eian-riso-broll/releases/tag/v1.0.0
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..dbd208b
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,111 @@
+# 参与开发 · Contributing
+
+这份文档给想改这个 skill 的人:代码结构、怎么自测、怎么重新生成 demo 和字体。只是想用它做视频,看 [README](README.zh-CN.md)([English](README.md))就够了。
+
+> English: this guide covers the code layout, the self-test and the maintenance scripts. Commands are the same on every OS; the prose is in Chinese.
+
+## 结构:每个文件负责什么
+
+每个文件只负责一件事。
+
+**给 Claude 读的**(流程和规则)
+
+| 文件 | 负责 |
+|---|---|
+| `SKILL.md` | 入口:什么时候用、三道门流程、不可违反的规则、常见坑 |
+| `references/copy.md` | 选段与文案:哪些段落值得做、怎么从原话里摘屏幕字、时长 |
+| `references/templates.md` | 10 个模板的用途、画面故事、DATA 字段、选择树 |
+| `references/style.md` | 视觉系统:纸、两墨、叠印、网点、色本、版面、字体、禁区 |
+| `references/motion.md` | 动效原则 + `riso.js` API + 写新模板的检查单 |
+| `references/production.md` | 渲染、质检、交付、排错 |
+
+**在浏览器里跑的**(每条动画就是一个网页)
+
+| 文件 | 负责 |
+|---|---|
+| `templates/*.html` | 10 个模板。每个只有三块:`DATA`(给使用者改)、版面、时间轴 |
+| `assets/riso.css` | 样式:色本、字体、油墨 / 网点 / 纸纹部件 |
+| `assets/riso.js` | 动效库:时间轴 helper、排版工具(`setup` / `text` / `fit` / `markUnder` / `inkBox`)、版面安全区 `ZONE`(唯一来源)、版面自检 |
+| `assets/gsap.min.js` | GSAP 3 动画引擎(第三方,GreenSock 标准许可) |
+| `assets/fonts/` | 随 skill 分发的字体(OFL)及许可证 |
+
+**命令行**(全部是 Node,零 npm 依赖,macOS / Linux / Windows 通用)
+
+| 文件 | 负责 |
+|---|---|
+| `scripts/render.mjs` | 逐帧渲染:mp4 / 透明底 mov / 样帧 / contact sheet |
+| `scripts/qa.mjs` | 质检:版面(安全区、字号、对比度、互压)+ 成片(时长、尺寸),出叠层图 |
+| `scripts/timing.mjs` | 口播时长:SRT 精确定位 / 按语速估算 |
+| `scripts/new_project.mjs` | 新建一个自包含的视频项目 |
+| `scripts/check_setup.mjs` | 环境自检 |
+| `scripts/lib/chrome.mjs` | headless Chrome 驱动(找浏览器、启动、截图) |
+| `scripts/lib/project.mjs` | 项目目录:skill 根路径、建项目、拷模板 |
+| `scripts/lib/media.mjs` | ffmpeg / ffprobe:拼 contact sheet、读成片参数 |
+| `scripts/lib/args.mjs` | 命令行参数解析 |
+
+**维护用**
+
+| 文件 | 负责 |
+|---|---|
+| `tests/smoke.mjs` | 一键自测:全部模板 → 样帧 → 成片 → 质检 → 时长脚本 |
+| `evals/evals.json` | 行为评测:Claude 用这个 skill 时该怎么做 |
+| `examples/` | 虚构示例逐字稿 + 分镜表 + 字幕;模板默认 DATA 和 demo 都来自它 |
+| `tools/build_demo.mjs` | 重新生成 `demo/` |
+| `tools/build_fonts.py` | 从上游开源字体重新生成 `assets/fonts/` |
+| `demo/` | README 用的 GIF 和末帧总览 |
+
+## 改完之后:自测
+
+改过 `assets/`、`scripts/` 或模板之后跑一遍:
+
+```bash
+node tests/smoke.mjs # 全部模板:样帧 → 成片(--draft)→ 质检 → 时长脚本;失败时退出码 1
+node tests/smoke.mjs --full --out ~/Desktop/riso-review # 正式码率,产物留在指定目录里看效果
+node tests/smoke.mjs number quote # 只测指定模板
+```
+
+`shot` 模板会额外派生一条带示例截图的 `shot-image`,用来检查截图的双色调效果。
+
+每次推送到 `main` 或提 pull request,GitHub Actions(`.github/workflows/ci.yml`)都会自动跑:Ubuntu 上全部模板,macOS 和 Windows 上抽测两个模板。
+
+## 发版
+
+改动记进 [CHANGELOG.md](CHANGELOG.md),按[语义化版本](https://semver.org/lang/zh-CN/)定版本号,再打 git 标签(如 `v1.1.0`)。
+
+除了自测,还要自己看两样 QA 查不出来的东西:
+
+- `--at 0`:第 0 帧是不是干净(只有纸、纸纹和底部网点地层)。
+- `plates/sheet.jpg`:每帧有没有一个主角,B 墨重点是不是只有一处。
+
+## 写新模板
+
+复制最接近的模板改,检查单在 [references/motion.md](references/motion.md#写新模板)。模板的默认 `DATA` 要来自 [examples/demo-script.md](examples/demo-script.md) 那段示例逐字稿;新模板需要新段落时,把段落加进逐字稿和 `examples/demo.srt`。
+
+## 重新生成 demo
+
+改了模板或样式,README 里的图要跟着更新:
+
+```bash
+node tools/build_demo.mjs # → demo/sheet.jpg + demo/*.gif
+```
+
+GIF 用 `render.mjs --calm` 渲(关掉纸纹呼吸和慢推镜),否则每帧整屏都在变,GIF 会大十几倍。
+
+## 重新生成字体
+
+`assets/fonts/` 是从 [google/fonts](https://github.com/google/fonts/tree/main/ofl) 的上游字体裁剪出来的(只留 GB2312 常用字)。要换字重或扩字符集:
+
+```bash
+pip install fonttools brotli
+python3 tools/build_fonts.py <上游字体目录> # 需要哪些上游文件见脚本开头的说明
+```
+
+## 贡献的授权
+
+本仓库采用 [Eian 个人非商业使用许可 1.0](LICENSE),商业使用另行书面授权。向本仓库提交代码、文档或其他内容(issue 里的补丁、pull request 等),即表示你确认有权提交这些内容,并同意 Eian 可以按本仓库的个人非商业使用许可和商业授权条款使用、修改、再授权这些内容。
+
+By contributing, you confirm you have the right to submit your contribution and agree that the rights holder may use, modify and license it under both the personal use license and commercial licenses.
+
+## 行为评测
+
+[evals/evals.json](evals/evals.json) 描述 Claude 用这个 skill 时应该怎么做(选段停下等确认、不编数据、文字太长时删字而不是缩字……)。改了 `SKILL.md` 或 `references/` 之后,用这些用例让 Claude 实际跑一遍,对照 assertions 检查。
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0de56bf
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,117 @@
+# Eian Personal Non-Commercial License 1.0
+# Eian 个人非商业使用许可 1.0
+
+Copyright © 2026 Eian. All rights reserved except for the permissions expressly granted below.
+版权所有 © 2026 Eian。除本许可明确授予的权限外,所有权利均予保留。
+
+本许可提供中英文文本。如有不一致或解释冲突,以中文文本为准。
+
+## 中文许可条款
+
+### 1. 许可对象与权利归属
+
+本许可仅适用于 eian-riso-broll 包内由 Eian 创作或持有权利的原创代码、文档、模板的具体视觉表达、示例文案及原创图像素材(“许可材料”)。抽象创意、一般视觉风格、方法或技术不作为本许可主张的专有对象;Eian 不持有权利的第三方材料也不在许可范围内。
+
+许可材料的版权及其他适用权利仍归 Eian 所有。本许可只授予下文列出的有限使用权限,不转让所有权。
+
+### 2. 个人非商业使用许可
+
+自然人可为其本人独立的非商业个人项目和个人账号,以非独占、免许可费、不可转让、不可再许可的方式:
+
+- 下载、安装和运行本 Skill;
+- 制作供本人使用的本地副本,并私下修改该副本;
+- 使用本 Skill 制作成片,并在非商业个人项目或账号中发布、分享这些成片。
+
+私有副本的修改内容不得向他人分发或公开。个人账号的商业变现不属于免费个人许可。
+
+### 3. 商业使用与另行授权
+
+所有商业使用都必须在使用前取得 Eian 的书面商业授权,并支付另行约定的许可费用。免费个人许可不附带任何商业使用权。
+
+商业使用包括但不限于:
+
+- 公司、机构、学校、政府单位、非营利组织、工作室、团队、团体或其他组织使用本 Skill;
+- 为雇主、客户或其他第三方制作、交付、运营或发布项目;
+- 收费服务、客户项目、商业内容、变现账号或视频、广告、赞助、品牌推广、产品使用或工作流集成;
+- 组织内部使用、测试或试用,即使没有单独向客户收费、尚未盈利或暂时没有收入。
+
+自然人为雇主、客户、公司、机构、团体或其他组织使用本 Skill,也属于商业使用。下载、安装、试用本 Skill,均不构成商业授权。
+
+### 4. 不得再分发许可材料
+
+未经 Eian 事先书面许可,不得复制后向他人提供、发布、转售、出租、再许可、托管或以其他方式分发许可材料的全部或部分内容,包括原始或修改后的源代码、模板文件、样式与动效库、示例文案和 demo 图像。
+
+个人非商业许可允许分享符合本许可的成片,不允许将 Skill 源码、模板或素材作为独立资源提取或分发。
+
+### 5. 第三方材料
+
+随包提供的 GSAP 动画引擎(assets/gsap.min.js)不属于本许可范围,继续依照 GreenSock 标准许可(https://gsap.com/standard-license)使用。随包提供的 Noto Serif SC、Noto Sans SC、Oswald、JetBrains Mono 字体(assets/fonts/)不属于本许可范围,继续依照同目录 OFL-*.txt 中的 SIL Open Font License 1.1 使用和分发。其他第三方材料也分别受其各自许可证约束,详见 THIRD_PARTY_NOTICES.md。本许可不授予用户对这些材料的额外权利。
+
+### 6. 许可终止与免责声明
+
+如使用者违反本许可,其个人非商业使用许可即告终止。许可终止后,使用者必须停止使用许可材料并删除其持有的副本。
+
+在适用法律允许的最大范围内,许可材料按“现状”提供,不提供任何明示或默示保证,包括适销性、特定用途适用性和不侵权保证。适用法律不允许排除或限制的责任不受本条影响。
+
+### 7. 商业授权申请
+
+商业使用者须先与 Eian 签订单独的书面商业许可并支付其中约定的费用。商业授权邮箱:[email protected]。申请邮件请说明许可主体、项目或用途、使用范围和期限;只有双方通过邮件明确确认具体许可条款(包括许可费用)后,才构成商业授权。
+
+### 8. 适用法律与争议解决
+
+本许可的订立、效力、解释、履行及争议解决,适用中华人民共和国大陆地区现行法律。因本许可产生或与本许可有关的争议,双方应先协商解决;协商不成的,任何一方可向依中华人民共和国大陆地区现行民事诉讼法律具有管辖权的人民法院提起诉讼。
+
+## English Translation
+
+### 1. Licensed Materials and Ownership
+
+This license applies only to original code, documentation, specific visual expression of templates, sample copy, and original graphics in the eian-riso-broll package that Eian created or owns (the “Licensed Materials”). It does not claim exclusive rights in abstract ideas, general visual styles, methods, or techniques, and does not cover third-party material that Eian does not own.
+
+Copyright and other applicable rights in the Licensed Materials remain with Eian. This license grants only the limited permissions listed below and does not transfer ownership.
+
+### 2. Personal Non-Commercial License
+
+A natural person may, for that person’s own independent non-commercial personal projects and personal accounts, on a non-exclusive, royalty-free, non-transferable, and non-sublicensable basis:
+
+- download, install, and run the Skill;
+- make a local copy for personal use and privately modify that copy;
+- create finished videos with the Skill and publish or share them in non-commercial personal projects or accounts.
+
+Modifications to a private copy may not be distributed or made public. Commercial monetization of a personal account is not covered by the free personal license.
+
+### 3. Commercial Use and Separate Authorization
+
+All commercial use requires Eian’s prior written commercial authorization and payment of the license fee agreed separately. The free personal license grants no commercial-use rights.
+
+Commercial use includes, without limitation:
+
+- use by a company, institution, school, government body, nonprofit, studio, team, group, or other organization;
+- creating, delivering, operating, or publishing a project for an employer, client, or other third party;
+- paid services, client projects, commercial content, monetized accounts or videos, advertising, sponsorships, brand promotion, product use, or workflow integration;
+- internal organizational use, testing, or trials, even if no separate client fee is charged, no profit has been made, or no revenue has yet been received.
+
+Use by an individual on behalf of an employer, client, company, institution, group, or other organization is also commercial use. Downloading, installing, or trying the Skill does not grant commercial authorization.
+
+### 4. No Redistribution of Licensed Materials
+
+No person may reproduce and provide to others, publish, resell, rent, sublicense, host, or otherwise distribute any part of the Licensed Materials without Eian’s prior written permission. This includes original or modified source code, template files, the stylesheet and motion library, sample copy, and demo images.
+
+The personal non-commercial license permits sharing finished videos that comply with this license. It does not permit extracting or distributing the Skill source, templates, or assets as standalone materials.
+
+### 5. Third-Party Materials
+
+The bundled GSAP animation engine (assets/gsap.min.js) is excluded from this license and remains governed by the GreenSock Standard License (https://gsap.com/standard-license). The bundled Noto Serif SC, Noto Sans SC, Oswald, and JetBrains Mono fonts (assets/fonts/) are excluded from this license and remain governed by the SIL Open Font License 1.1 in the OFL-*.txt files in that directory. Other third-party materials remain subject to their own licenses; see THIRD_PARTY_NOTICES.md. This license grants no additional rights in those materials.
+
+### 6. Termination and Disclaimer
+
+A breach of this license terminates the personal non-commercial license. Upon termination, the user must stop using the Licensed Materials and delete copies in their possession.
+
+To the maximum extent permitted by applicable law, the Licensed Materials are provided “as is,” without express or implied warranties, including warranties of merchantability, fitness for a particular purpose, and non-infringement. This section does not affect liabilities that applicable law does not permit to be excluded or limited.
+
+### 7. Commercial License Requests
+
+Commercial users must first enter into a separate written commercial license with Eian and pay the fee stated in that agreement. Contact Eian at [email protected]. The request should identify the licensee, project or purpose, requested scope, and term. A commercial license takes effect only after both parties expressly confirm the specific terms, including fees, by email.
+
+### 8. Governing Law and Disputes
+
+This license is governed by and will be interpreted under the laws currently in force in mainland China. The parties will first seek to resolve any dispute arising from or relating to this license through consultation. If consultation fails, either party may bring the dispute before a People's Court with jurisdiction under the civil procedure laws currently in force in mainland China.
diff --git a/LICENSE-STATUS.md b/LICENSE-STATUS.md
new file mode 100644
index 0000000..9eef534
--- /dev/null
+++ b/LICENSE-STATUS.md
@@ -0,0 +1,11 @@
+# License and Publication Status
+
+`eian-riso-broll` is prepared for source-available distribution under the custom [Eian Personal Non-Commercial License 1.0](LICENSE), with separate written commercial licensing.
+
+This is not an OSI-approved open-source license. The personal license is limited to an individual's non-commercial use. Commercial use—including organizational, group, client, employer, monetized, advertising, sponsorship, product, or workflow use—requires prior written authorization and a separately agreed fee. The full permission boundary is defined only in [LICENSE](LICENSE).
+
+The license applies only to original material that Eian created or owns. The bundled GSAP animation engine remains under the GreenSock Standard License, and the bundled fonts (Noto Serif SC, Noto Sans SC, Oswald, JetBrains Mono) remain under the SIL Open Font License 1.1; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Third-party packages and assets retain their own licenses.
+
+The general visual idea or style (risograph two-color printing, halftone, misregistration) is not claimed as an exclusive right; the license covers the original code and concrete creative expression in templates, copy and artwork, to the extent Eian holds those rights.
+
+Commercial licensing: [[email protected]](mailto:[email protected]).
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..39d31e1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,150 @@
+# eian-riso-broll
+
+**Risograph-style info animations for talking-head videos · a Claude Code skill**
+
+[简体中文](README.zh-CN.md) · English
+
+Hand Claude the script of your talking-head video. It picks the lines worth visualizing and turns them into vertical info animations (1080×1920 mp4) in a two-color risograph print style, ready to drop into your editor.
+
+| Big number | Many → few | Before / after | Key quote |
+|:---:|:---:|:---:|:---:|
+| ![](demo/number.gif) | ![](demo/converge.gif) | ![](demo/compare.gif) | ![](demo/quote.gif) |
+
+Ten animations made from one minute of script (the last frame of each):
+
+![Ten animations from one script](demo/sheet.jpg)
+
+> The copy comes from a [fictional sample script](examples/demo-script.md) (in Chinese); every word on screen is lifted from what's said. GIFs are compressed; the real output is 30fps HD mp4.
+
+## Who it's for
+
+Creators who make talking-head, explainer or knowledge videos for short-video platforms. While your viewers hear you, this skill makes them **see** the number, the comparison or the conclusion you're talking about.
+
+- **You give**: the script (an SRT subtitle file makes timing exact).
+- **You get**: one mp4 per animation (picture only, no audio), a storyboard table and a contact sheet of every shot. A transparent version is available when you want to overlay it on your footage.
+
+The typography is designed for Chinese (serif display type, Chinese line limits). Latin text renders fine too.
+
+## Why use it
+
+- **A series, not a pile of slides**: all ten templates share one paper, one pair of inks, one set of fonts and one header, so a whole episode looks consistent.
+- **Timed to your voice**: each animation lasts as long as the line it covers; with subtitles, it's matched to the exact in and out points.
+- **Never makes things up**: on-screen text is only ever cut from your own words. Categories or figures you didn't say stay blank; without a real screenshot you get a "to be replaced" placeholder, never a fake UI.
+- **Approve before rendering**: you see a storyboard first, then a still of every shot, and only then does it render, so changes stay cheap.
+- **Built for vertical video**: it keeps clear of the platform's top bar, the subtitle area and the like/comment buttons on the right, and automatically checks type size, contrast and anything running off-frame.
+- **Free, offline, local**: no image-generation models, no network. Fonts are bundled, so macOS, Windows and Linux render identically.
+
+## Install
+
+You'll need:
+
+- [Claude Code](https://claude.com/claude-code)
+- [Node.js](https://nodejs.org) 22 or newer
+- Chrome (Edge or Chromium also work)
+- [ffmpeg](https://ffmpeg.org) (on macOS: `brew install node ffmpeg`)
+
+Put the skill in Claude Code's skills folder and run the setup check:
+
+```bash
+git clone https://github.com/YIAN6557/eian-riso-broll.git ~/.claude/skills/eian-riso-broll
+node ~/.claude/skills/eian-riso-broll/scripts/check_setup.mjs
+```
+
+When it says everything passed, you're ready. On Windows, use `%USERPROFILE%\.claude\skills` instead of `~/.claude/skills`.
+
+## How to use it
+
+Just ask Claude, for example:
+
+- **A whole episode**: "Use eian-riso-broll to make info animations for this script: … (paste the script)"
+- **A single line**: "Turn this line into a Riso animation and render it straight away: 'Making one infographic used to take 40 minutes; now it takes 2.'"
+- **Matched to your voice**: "Here's my subtitle file talk.srt. Animate the third paragraph and match its length to the voiceover."
+- **For overlaying**: "Give me a transparent-background version of the last one."
+
+For a whole episode, Claude works in three steps and stops for your OK after each:
+
+1. **Storyboard**: which line gets which visual, the exact on-screen text and the duration. This is the cheapest moment to drop or swap shots.
+2. **Stills**: the last frame of every animation, laid out on one sheet. Fix layout or wording here.
+3. **Final render**: the mp4s, checked again for length and size.
+
+If you give it a single line or say "render it straight away", Claude merges the steps, but never skips the checks.
+
+Finished files go to `~/eian-riso-broll-projects/<project name>/renders/`, one mp4 per animation.
+
+## The ten templates
+
+Numbers match the contact sheet above.
+
+| # | Template | Use it when | Line from the sample |
+|---|---|---|---|
+| 01 | Myth vs. fact `versus` | "Most people think… actually…" | Good motion graphics need a hired animator → a script is enough |
+| 02 | Chapter card `title` | Part one, part two…; an opening title | Part one: see the results |
+| 03 | Big number `number` | One number strong enough to fill the frame | 12 lines worth visualizing |
+| 04 | Before / after `compare` | Two values of the same thing, bars drawn to true scale | 40 minutes before, 2 minutes now |
+| 05 | Many → few `converge` | Lots of things narrowing down to a few | 30-plus projects → 4 kinds |
+| 06 | Network `network` | A count plus connection, relationships or scale | 1,800 shots that read as one series |
+| 07 | Pick one `focus` | Several options with one highlighted | Four palettes; 70% of videos use the first |
+| 08 | Steps `steps` | 2–6 steps in order | Just 3 steps: pick lines, check stills, render |
+| 09 | Screenshot `shot` | Viewers need to see the real thing (dashboard, post, spreadsheet) | Last week's storyboard (you supply the screenshot) |
+| 10 | Key quote `quote` | The hook or the conclusion, on a full dark background | Visuals should follow what you say |
+
+## Four palettes
+
+| Palette | Mood |
+|---|---|
+| Ink blue × fluorescent pink (default) | The most "risograph"; knowledge, tech |
+| Deep teal × orange | Warm; methods, lifestyle |
+| Navy × vermilion | Opinions, myths, warnings |
+| Ink black × bright yellow | Restrained; serious topics, data, finance |
+
+Use at most two per episode: one for the body, one for the opening and closing. To change colors, just tell Claude.
+
+## What it doesn't do
+
+- **No sound**: output is picture only. Voice, sound effects and music stay in your editor.
+- **No non-informational shots**: emotional monologues, storytelling, metaphors and software walkthroughs are better served by live footage, character animation or screen recording. Claude will tell you so.
+- **No fake screenshots**: anything that needs to show the real thing needs a real screenshot from you.
+- **Vertical only, for now**: 1080×1920.
+
+## FAQ
+
+**How long does rendering take?**
+On an Apple Silicon Mac, a 5-second animation takes about 15–20 seconds. Stills take a few seconds each.
+
+**Can I edit the text myself?**
+Yes. Each animation is an html file under `compositions/` in the project. Open it in a browser to preview (it loops). Edit the `DATA` block at the top, then ask Claude to render again.
+
+**What if the text is too long?**
+Claude cuts words from what you said rather than shrinking the type; text too small to read on a phone might as well not be there.
+
+**Why do a few characters look different?**
+The bundled Chinese fonts cover the 6,763 most common characters; rare ones fall back to a system font.
+
+**It says Chrome can't be found.**
+Set `CHROME=<path to the browser executable>` and try again; `check_setup.mjs` tells you exactly what went wrong.
+
+## Manual use, without Claude
+
+```bash
+cd ~/.claude/skills/eian-riso-broll
+P=$(node scripts/new_project.mjs episode-12) # create a project, prints its path
+cp templates/number.html "$P/compositions/01-number.html" # copy a template, edit DATA at the top
+node scripts/render.mjs "$P"/compositions/*.html --still # stills + contact sheet
+node scripts/qa.mjs "$P"/compositions/*.html # automatic checks
+node scripts/render.mjs "$P"/compositions/*.html # final mp4s
+node scripts/render.mjs "$P/compositions/01-number.html" --alpha # transparent (ProRes 4444)
+```
+
+More detail (in Chinese): [references/production.md](references/production.md).
+
+## Want to change the skill?
+
+Code layout, the self-test and the maintenance scripts are in [CONTRIBUTING.md](CONTRIBUTING.md).
+
+## License
+
+For commercial licensing, contact [[email protected]](mailto:[email protected]).
+
+The package uses the custom [Eian Personal Non-Commercial License 1.0](LICENSE), with separate written commercial licensing. Individuals may install, run, and privately modify copies for non-commercial personal use, and share the videos they make with it in non-commercial personal accounts. Commercial use—including monetized accounts, advertising, sponsorships, client or employer projects, and organizational or group use—requires prior written authorization and a separately agreed fee. The source, templates and assets may not be redistributed.
+
+This is a source-available license, not an OSI-approved open-source license. GSAP and the bundled fonts keep their own licenses; see [third-party notices](THIRD_PARTY_NOTICES.md) and [license status](LICENSE-STATUS.md).
diff --git a/README.zh-CN.md b/README.zh-CN.md
new file mode 100644
index 0000000..f384d1b
--- /dev/null
+++ b/README.zh-CN.md
@@ -0,0 +1,148 @@
+# eian-riso-broll
+
+**孔版印刷风格的口播信息动画 · 一个 Claude Code skill**
+
+简体中文 · [English](README.md)
+
+把口播逐字稿交给 Claude,它会挑出值得配画面的句子,做成孔版双色风格的竖屏信息动画(1080×1920 mp4),拖进剪辑软件就能用。
+
+| 数字冲击 | 收敛归类 | 前后对比 | 金句 |
+|:---:|:---:|:---:|:---:|
+| ![](demo/number.gif) | ![](demo/converge.gif) | ![](demo/compare.gif) | ![](demo/quote.gif) |
+
+一段 1 分钟的口播做出来的 10 条动画(每条的最后一帧):
+
+![一段口播做出来的 10 条动画](demo/sheet.jpg)
+
+> 上面的文案来自一段[虚构的示例逐字稿](examples/demo-script.md),屏幕上的每个字都摘自原话。GIF 为了体积做了压缩,成片是 30fps 高清 mp4。
+
+## 适合谁
+
+做口播、知识分享类短视频的人。你在镜头前讲,观众耳朵在听;这个 skill 负责让观众**同时看见**你说的那个数字、那个对比、那个结论。
+
+- **你给**:一份逐字稿(有 SRT 字幕更好)。
+- **你拿到**:每个画面一条 mp4(只有画面、没有声音),一张分镜表,一张全部画面的总览图。需要叠在人像上时,还可以出透明底版本。
+
+## 为什么用它
+
+- **像一个系列,不像拼凑的 PPT**:10 个模板共用同一套纸张、油墨、字体和版头,放在一期视频里风格统一。
+- **画面跟着口播走**:每条动画的长度按你说那句话的时长来定;有字幕时精确到入点出点。
+- **不替你编内容**:屏幕上的字只从你说的话里摘,没说的类别名、数据一律不补;你没给截图,就只放“待替换”占位,不画假界面。
+- **先确认再出片**:先给你一张分镜表,再给你看每条的样帧,你点头了才渲染成片,改起来不费劲。
+- **为竖屏短视频设计**:自动避开平台顶栏、底部字幕区和右侧点赞按钮栏,每条都会自动检查字号、对比度、有没有出画。
+- **免费、离线、本机渲染**:不调用任何图片生成模型,不需要联网;字体已经内置,Mac、Windows、Linux 渲出来一模一样。
+
+## 安装
+
+需要先装好这几样:
+
+- [Claude Code](https://claude.com/claude-code)
+- [Node.js](https://nodejs.org) 22 或更新
+- Chrome(Edge 或 Chromium 也可以)
+- [ffmpeg](https://ffmpeg.org)(macOS 可以用 Homebrew:`brew install node ffmpeg`)
+
+然后把 skill 放进 Claude Code 的 skills 目录,跑一次环境自检:
+
+```bash
+git clone https://github.com/YIAN6557/eian-riso-broll.git ~/.claude/skills/eian-riso-broll
+node ~/.claude/skills/eian-riso-broll/scripts/check_setup.mjs
+```
+
+看到“全部通过”就可以用了。Windows 上把 `~/.claude/skills` 换成 `%USERPROFILE%\.claude\skills`。
+
+## 怎么用
+
+直接跟 Claude 说就行,比如:
+
+- **整期视频**:「用 eian-riso-broll 给这期逐字稿做信息动画:……(贴上逐字稿)」
+- **只做一句**:「把这句做成 Riso 动画,直接出片:『做一张信息图,以前要 40 分钟,现在 2 分钟』」
+- **对准口播时长**:「这是字幕文件 口播.srt,帮我把第 3 段做成动画,时长和口播对上」
+- **叠在人像上**:「上一条给我一个透明背景的版本」
+
+做整期视频时,Claude 会分三步走,每一步都停下来等你确认:
+
+1. **分镜表**:哪句话配什么画面、屏幕上写什么字、多长时间。删哪条、换哪条,在这一步说最省事。
+2. **样帧**:每条动画的最后一帧拼成一张总览图给你看。构图、文字不满意,在这一步改。
+3. **成片**:渲染出 mp4,再自动检查一遍时长和尺寸。
+
+如果只给一句话,或者说了“直接出片”,Claude 会合并步骤直接做,但检查一步都不会少。
+
+成片默认放在 `~/eian-riso-broll-projects/<项目名>/renders/`,每条一个 mp4。
+
+## 10 个模板
+
+编号和上面总览图的顺序一一对应。
+
+| # | 模板 | 什么时候用 | 示例里的那句话 |
+|---|---|---|---|
+| 01 | 误区翻转 `versus` | “很多人以为……其实……” | 好看的动效得请人来做 → 一份逐字稿就够了 |
+| 02 | 章节卡 `title` | 第一部分、第二部分……;开场标题 | 第一部分,先看效果 |
+| 03 | 数字冲击 `number` | 一个扛得住整个画面的数字 | 12 处值得配画面的信息 |
+| 04 | 前后对比 `compare` | 同一件事的两个量,按真实比例画条 | 以前 40 分钟,现在 2 分钟 |
+| 05 | 收敛归类 `converge` | 很多 → 很少 | 30 多套工程 → 4 类 |
+| 06 | 连接密度 `network` | 数量 + 关系、连接、规模感 | 1800 条画面,放在一起是一个系列 |
+| 07 | 多选一 `focus` | 几个并列项里突出一个 | 四组色本,70% 的视频用第一组 |
+| 08 | 流程步骤 `steps` | 2–6 个有先后顺序的步骤 | 只有 3 步:选段、出样帧、渲成片 |
+| 09 | 截图锚点 `shot` | 观众得看见原件才信(后台、原帖、表格) | 上周的分镜表(截图由你提供) |
+| 10 | 金句 `quote` | 整期的钩子或结论,深色满版 | 画面要跟着你说的话走 |
+
+## 四组配色
+
+| 配色 | 气质 |
+|---|---|
+| 墨蓝 × 荧光粉(默认) | 最有孔版味,适合知识、科技 |
+| 深青 × 橙 | 温暖,适合方法论、生活 |
+| 藏青 × 朱红 | 适合观点、误区、提醒 |
+| 墨黑 × 明黄 | 克制,适合严肃话题、数据、财经 |
+
+一期视频最多用两组:正文一组,开头和结尾一组,首尾呼应。想换颜色,直接跟 Claude 说就行。
+
+## 它不做什么
+
+- **不配声音**:成片只有画面,配音、音效、BGM 都留在剪辑软件里处理。
+- **不做非信息类画面**:情绪独白、讲故事、打比方、软件操作演示,更适合实拍、角色动画或录屏,Claude 会直接告诉你。
+- **不画假截图**:需要展示原件的地方,请提供真实截图。
+- **目前只做竖屏**:1080×1920。
+
+## 常见问题
+
+**渲染要多久?**
+在 M 系列 Mac 上,5 秒的一条大约 15–20 秒。样帧几秒一张。
+
+**能自己改文字吗?**
+能。每条动画是项目里 `compositions/` 下的一个 html 文件,用浏览器打开就能预览(循环播放)。改文件顶部的 `DATA`,再让 Claude 重新渲染就行。
+
+**字太多放不下怎么办?**
+Claude 会从原话里删字,而不是把字号缩小。手机上看,字太小等于没有。
+
+**为什么有的字显示成别的字体?**
+内置字体收录了 6763 个常用汉字,极少数生僻字会用系统字体代替。
+
+**提示找不到 Chrome?**
+设置环境变量 `CHROME=<浏览器程序的路径>` 再试;`check_setup.mjs` 会告诉你具体原因。
+
+## 不经过 Claude,手动用
+
+```bash
+cd ~/.claude/skills/eian-riso-broll
+P=$(node scripts/new_project.mjs 第12期) # 新建项目,打印项目路径
+cp templates/number.html "$P/compositions/01-number.html" # 复制模板,改顶部的 DATA
+node scripts/render.mjs "$P"/compositions/*.html --still # 样帧 + 总览图
+node scripts/qa.mjs "$P"/compositions/*.html # 自动检查
+node scripts/render.mjs "$P"/compositions/*.html # 成片 mp4
+node scripts/render.mjs "$P/compositions/01-number.html" --alpha # 透明底(ProRes 4444)
+```
+
+更多细节见 [references/production.md](references/production.md)。
+
+## 想改这个 skill?
+
+代码结构、自测和维护脚本见 [CONTRIBUTING.md](CONTRIBUTING.md)。
+
+## 许可
+
+商业授权联系邮箱:[[email protected]](mailto:[email protected])。
+
+本包采用自定义的 [Eian 个人非商业使用许可 1.0](LICENSE),商业使用另行书面授权。个人用户可为非商业个人用途安装、运行并私下修改自己的副本,并在非商业的个人账号中分享用它做出的成片。商业用途包括账号变现、广告、赞助、客户或雇主项目,以及公司、机构或团体使用;均须事先取得书面授权并另行约定许可费用。源码、模板和素材不得再分发。
+
+这是源码可见许可,不是 OSI 认可的开源许可证。GSAP 动画引擎和内置字体仍适用各自的许可证,详见[第三方声明](THIRD_PARTY_NOTICES.md)和[许可证状态](LICENSE-STATUS.md)。
diff --git a/SKILL.md b/SKILL.md
new file mode 100644
index 0000000..a0e730a
--- /dev/null
+++ b/SKILL.md
@@ -0,0 +1,86 @@
+---
+name: eian-riso-broll
+description: 孔版双色(Riso)风格的信息 B-roll 动画。给一份口播逐字稿(可附 SRT 字幕),挑出适合做成信息动画的段落,套用 10 个现成模板(数字冲击 / 流程 / 收敛 / 前后对比 / 连接密度 / 金句 / 多选一 / 误区翻转 / 章节卡 / 截图锚点),先出静态样帧确认,再渲染 1080×1920 竖屏 mp4(无音轨;可出透明底 ProRes)。用户说「Riso 动画」「孔版风 B-roll」「eian-riso-broll」「逐字稿做信息动画」「口播配信息动画」「信息图 B-roll」,或给出逐字稿、想要高对比杂志感的竖屏信息动画时,使用此 skill。纯 HTML/CSS/GSAP 本机渲染,不调用图片生成模型;只做无角色的信息动画 —— 情绪独白、隐喻、软件操作演示不做,建议归实拍 / 角色动画 / 录屏。
+license: Eian 个人非商业使用许可 1.0;商业使用需事先书面授权([email protected],见 LICENSE)
+compatibility: Node ≥ 22、Chrome 或 Chromium、ffmpeg/ffprobe。字体随 skill 分发(思源宋体 / 思源黑体 / Oswald / JetBrains Mono),macOS、Linux、Windows 渲出来一样。首次使用先跑 node scripts/check_setup.mjs。
+---
+
+# Riso B-roll · 孔版双色信息动画
+
+**风格一句话**:一张纸,两种专色油墨。**A 墨**(深)负责所有要读的字和结构;**B 墨**(荧光)一帧只做一处重点;两墨重叠的地方自动出现第三色;B 版永远有 3px 的套印错位;所有“渐变”都用网点表达。动起来像一张海报正在被印出来:网点显影、套印“咔”地归位、盖章砸落、滚筒刷过。
+
+效果参考:`demo/`(GIF + 末帧一览)。
+
+## 文件地图
+
+| 要做什么 | 读哪里 |
+|---|---|
+| 挑段落、提炼屏幕文字 | [references/copy.md](references/copy.md) |
+| 选模板、改 DATA | [references/templates.md](references/templates.md) |
+| 视觉规则(色本、版面、字体、禁区) | [references/style.md](references/style.md) |
+| 改动效 / 写新模板(riso.js API) | [references/motion.md](references/motion.md) |
+| 渲染、质检、交付、排错 | [references/production.md](references/production.md) |
+
+模板在 `templates/`,每个都是能直接渲染的完整 composition,**只改顶部的 `DATA`**。
+
+## 三道门
+
+```text
+Gate 1 选段表(段落 → 模板 → 屏幕文字 → 时长) → 停,等确认
+Gate 2 样帧(每条的末帧海报 + contact sheet + QA) → 停,等确认
+Gate 3 成片(mp4 + QA) → 交付
+```
+
+每道门都停下来等用户。改名单在 Gate 1 最便宜,改构图在 Gate 2 最便宜。
+**快速通道**:用户只给了一段、或明确说“直接出片 / 不用确认”时,可以合并门,但 QA 一步都不省。
+
+### Gate 1 · 选段
+
+按 [copy.md](references/copy.md) 读逐字稿,产出一张表:
+
+| # | 原话落点 | 模板 | 屏幕文字(提炼后) | 时长 | 色本 | 截图需求 |
+|---|---|---|---|---|---|---|
+
+外加“落选段 → 去处”(录屏 / 实拍 / 合并进第 N 条)。
+
+- 一条只讲一件“能被看见”的事:一个数字、一个结构、一次对比、一句结论。
+- 相邻两条不用同一模板;同一模板全片 ≤ 2 次(章节卡系列除外)。
+- `quote`(满版深底)全片 ≤ 2 条,放在钩子或结论,制造明暗节奏。
+- 时长用 `scripts/timing.mjs` 算(有 SRT 用 SRT,没有按 4.5 字/秒估),不要拍脑袋写 5 秒。
+
+### Gate 2 · 样帧
+
+```bash
+P=$(node scripts/new_project.mjs 2026-10-07-主题) # 建项目,assets 整份拷入
+cp templates/number.html $P/compositions/01-xxx.html # 每条一个文件,按 01- 02- 编号
+# 只改 DATA → 渲样帧 → 质检
+node scripts/render.mjs $P/compositions/*.html --still # plates/*.png + plates/sheet.jpg
+node scripts/qa.mjs $P/compositions/*.html # qa/*-audit.png;有 error 必须修
+```
+
+自己先读 `plates/sheet.jpg` 和有问题的 `qa/*-audit.png`,修完 error 再把 sheet 发给用户。样帧就是成片的最后一帧——**样帧和成片同一个文件渲出来,天然一致**。
+
+### Gate 3 · 成片
+
+```bash
+node scripts/render.mjs $P/compositions/*.html # renders/*.mp4(H.264,无音轨)
+node scripts/qa.mjs $P/compositions/*.html # 再查一遍:时长、尺寸
+```
+
+交付:`renders/*.mp4` + `plates/sheet.jpg` + `STORYBOARD.md`(填好分镜表)。问用户要不要:透明底版本(`--alpha` → ProRes 4444 `.mov`,叠在口播画面上用)、拷到指定目录。
+
+## 不可违反
+
+1. **屏幕文字只来自逐字稿原话**:数字、名词、原句的子串。台词没说的(第 4 个类别叫什么、具体百分比)就留空,不编。能做的只有“删字”和“换行”,不改写意思。
+2. **没有真截图就不画界面**:`shot` 模板没图时只显示“截图 · xxx · 待替换”占位,不加批注框。
+3. **小于 100px 的字只用 A 墨**;B 墨只给大数字、压条、色块。
+4. **信息只在 y 168–1330**;下面是字幕床,只放网点地层。
+5. **QA 有 error 不交付**。
+6. **不做音效**:成片只有画面、没有音轨;不加拟音、不配 BGM,声音统一在剪辑台处理。
+
+## 常见坑(写新模板 / 改版面时)
+
+- 嵌套元素不会自动 `position:absolute`(只有 `#stage` 的直接子元素会)——容器里的子元素要自己写。
+- **先排版、后建时间轴**:`fit()` / `inkBox()` 要在任何 tween 之前调用,否则量到的是动画初始态。
+- 数字按**墨迹**对齐(`Riso.inkBox`),不要按行框——数字字体的字形会超出行框。
+- 多行文本用 `Riso.text(el, '第一行\n第二行[重点]')`,不要直接 `textContent`,否则逐字升起不生效。
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
new file mode 100644
index 0000000..a4d142f
--- /dev/null
+++ b/THIRD_PARTY_NOTICES.md
@@ -0,0 +1,25 @@
+# 第三方声明 · Third-Party Notices
+
+本仓库附带以下第三方素材。它们**不受**本仓库 [LICENSE](LICENSE) 的约束,也不因本仓库的许可声明而获得重新授权,仍分别适用各自的许可条款。
+
+This repository ships the following third-party materials. They are **not** covered or relicensed by this repository's [LICENSE](LICENSE) and remain under their own terms.
+
+## GSAP
+
+- 文件 · File:`assets/gsap.min.js`(GSAP 3.14.2)
+- 版权 · Copyright:© 2025 GreenSock. All rights reserved.
+- 许可 · License:GreenSock Standard License — <https://gsap.com/standard-license>
+- 文件头的版权声明必须保留。 The copyright header in the file must be kept intact.
+
+## 字体 · Fonts
+
+全部使用 SIL Open Font License 1.1,许可证原文在 `assets/fonts/OFL-*.txt`。字体经过裁剪(只保留常用字符),按 OFL 要求改了内部名称,见 [assets/fonts/README.md](assets/fonts/README.md)。字体本身不得单独出售。
+
+All under the SIL Open Font License 1.1; full texts in `assets/fonts/OFL-*.txt`. The fonts are subsetted and renamed as the OFL requires (see [assets/fonts/README.md](assets/fonts/README.md)). The fonts may not be sold by themselves.
+
+| 文件 · File | 字体 · Font | 版权 · Copyright |
+|---|---|---|
+| `assets/fonts/riso-serif.woff2` | Noto Serif SC | © 2012 Google Inc. |
+| `assets/fonts/riso-sans.woff2` | Noto Sans SC | © 2014–2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source' |
+| `assets/fonts/riso-num.woff2` | Oswald | © 2016 The Oswald Project Authors |
+| `assets/fonts/riso-mono.woff2` | JetBrains Mono | © 2020 The JetBrains Mono Project Authors |
diff --git a/assets/fonts/OFL-JetBrainsMono.txt b/assets/fonts/OFL-JetBrainsMono.txt
new file mode 100644
index 0000000..821a3da
--- /dev/null
+++ b/assets/fonts/OFL-JetBrainsMono.txt
@@ -0,0 +1,93 @@
+Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+
+This license is copied below, and is also available with a FAQ at: https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/assets/fonts/OFL-NotoSansSC.txt b/assets/fonts/OFL-NotoSansSC.txt
new file mode 100644
index 0000000..1c9f432
--- /dev/null
+++ b/assets/fonts/OFL-NotoSansSC.txt
@@ -0,0 +1,93 @@
+Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/assets/fonts/OFL-NotoSerifSC.txt b/assets/fonts/OFL-NotoSerifSC.txt
new file mode 100644
index 0000000..94d1bf7
--- /dev/null
+++ b/assets/fonts/OFL-NotoSerifSC.txt
@@ -0,0 +1,94 @@
+Copyright 2012 Google Inc. All Rights Reserved.
+
+This Font Software is licensed under the SIL Open Font License,
+Version 1.1.
+
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font
+creation efforts of academic and linguistic communities, and to
+provide a free and open framework in which fonts may be shared and
+improved in partnership with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply to
+any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software
+components as distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to,
+deleting, or substituting -- in part or in whole -- any of the
+components of the Original Version, by changing formats or by porting
+the Font Software to a new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed,
+modify, redistribute, and sell modified and unmodified copies of the
+Font Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components, in
+Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the
+corresponding Copyright Holder. This restriction only applies to the
+primary font name as presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created using
+the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/assets/fonts/OFL-Oswald.txt b/assets/fonts/OFL-Oswald.txt
new file mode 100644
index 0000000..4d4e319
--- /dev/null
+++ b/assets/fonts/OFL-Oswald.txt
@@ -0,0 +1,93 @@
+Copyright 2016 The Oswald Project Authors (https://github.com/googlefonts/OswaldFont)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/assets/fonts/README.md b/assets/fonts/README.md
new file mode 100644
index 0000000..11586da
--- /dev/null
+++ b/assets/fonts/README.md
@@ -0,0 +1,14 @@
+# 字体
+
+随 skill 分发的字体,保证任何系统渲出来都一样。全部是 [SIL Open Font License 1.1](https://openfontlicense.org),许可证原文在同目录的 `OFL-*.txt`。
+
+| 文件 | 用途 | 来源 | 处理 |
+|---|---|---|---|
+| `riso-serif.woff2` | 标题(`.hd`) | Noto Serif SC(思源宋体),字重 900 | 只保留 GB2312 常用字 + 符号 |
+| `riso-sans.woff2` | 标签、引子(`.lb`) | Noto Sans SC(思源黑体),字重 600 | 只保留 GB2312 常用字 + 符号 |
+| `riso-num.woff2` | 数字(`.num`) | Oswald,字重 700 | 只保留拉丁字符 |
+| `riso-mono.woff2` | 编号、版头(`.mono`) | JetBrains Mono,字重 500 | 只保留拉丁字符 |
+
+上游文件来自 [google/fonts](https://github.com/google/fonts/tree/main/ofl)。裁剪属于 OFL 所说的修改版本,所以字体内部名称改成了 Riso Serif / Riso Sans / Riso Num / Riso Mono,和原版区分开。重新生成:`python3 tools/build_fonts.py <上游字体目录>`。
+
+GB2312 之外的生僻字会回退到系统字体(宋体 / 苹方 / Noto)。
diff --git a/assets/fonts/riso-mono.woff2 b/assets/fonts/riso-mono.woff2
new file mode 100644
index 0000000..5317444
Binary files /dev/null and b/assets/fonts/riso-mono.woff2 differ
diff --git a/assets/fonts/riso-num.woff2 b/assets/fonts/riso-num.woff2
new file mode 100644
index 0000000..b3e7e86
Binary files /dev/null and b/assets/fonts/riso-num.woff2 differ
diff --git a/assets/fonts/riso-sans.woff2 b/assets/fonts/riso-sans.woff2
new file mode 100644
index 0000000..6ee209f
Binary files /dev/null and b/assets/fonts/riso-sans.woff2 differ
diff --git a/assets/fonts/riso-serif.woff2 b/assets/fonts/riso-serif.woff2
new file mode 100644
index 0000000..a15b2d9
Binary files /dev/null and b/assets/fonts/riso-serif.woff2 differ
diff --git a/assets/gsap.min.js b/assets/gsap.min.js
new file mode 100644
index 0000000..fde57af
--- /dev/null
+++ b/assets/gsap.min.js
@@ -0,0 +1,11 @@
+/*!
+ * GSAP 3.14.2
+ * https://gsap.com
+ *
+ * @license Copyright 2025, GreenSock. All rights reserved.
+ * Subject to the terms at https://gsap.com/standard-license.
+ * @author: Jack Doyle, [email protected]
+ */
+
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return"string"==typeof t}function s(t){return"function"==typeof t}function t(t){return"number"==typeof t}function u(t){return void 0===t}function v(t){return"object"==typeof t}function w(t){return!1!==t}function x(){return"undefined"!=typeof window}function y(t){return s(t)||r(t)}function R(t){return(i=bt(t,ht))&&Fe}function S(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function T(t,e){return!e&&console.warn(t)}function U(t,e){return t&&(ht[t]=e)&&i&&(i[t]=e)||ht}function V(){return 0}function ga(t){var e,r,i=t[0];if(v(i)||s(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=yt.length;r--&&!yt[r].targetTest(i););e=yt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Xt(t[r],e)))||t.splice(r,1);return t}function ha(t){return t._gsap||ga(Pt(t))[0]._gsap}function ia(t,e,r){return(r=t[e])&&s(r)?t[e]():u(r)&&t.getAttribute&&t.getAttribute(e)||r}function ja(t,e){return(t=t.split(",")).forEach(e)||t}function ka(t){return Math.round(1e5*t)/1e5||0}function la(t){return Math.round(1e7*t)/1e7||0}function ma(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i}function na(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}function oa(){var t,e,r=pt.length,i=pt.slice(0);for(_t={},t=pt.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function pa(t){return!!(t._initted||t._startAt||t.add)}function qa(t,e,r,i){pt.length&&!I&&oa(),t.render(e,r,i||!!(I&&e<0&&pa(t))),pt.length&&!I&&oa()}function ra(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(ot).length<2?e:r(t)?t.trim():t}function sa(t){return t}function ta(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function wa(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=v(e[r])?wa(t[r]||(t[r]={}),e[r]):e[r]);return t}function xa(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function ya(t){var e=t.parent||L,r=t.keyframes?function _setKeyframeDefaults(i){return function(t,e){for(var r in e)r in t||"duration"===r&&i||"ease"===r||(t[r]=e[r])}}($(t.keyframes)):ta;if(w(t.inherit))for(;e;)r(t,e.vars.defaults),e=e.parent||e._dp;return t}function Aa(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var a,s=t[i];if(n)for(a=e[n];s&&s[n]>a;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function Ba(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function Ca(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function Da(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function Fa(t,e,r,i){return t._startAt&&(I?t._startAt.revert(ft):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ha(t){return t._repeat?wt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ja(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ka(t){return t._end=la(t._start+(t._tDur/Math.abs(t._ts||t._rts||q)||0))}function La(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=la(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ka(t),r._dirty||Da(r,t)),t}function Ma(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Ja(t.rawTime(),e),(!e._dur||Mt(0,e.totalDuration(),r)-e._tTime>q)&&e.render(r,!0)),Da(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)0<=r.rawTime()&&r.totalTime(r._tTime),r=r._dp;t._zTime=-q}}function Na(e,r,i,n){return r.parent&&Ca(r),r._start=la((t(i)?i:i||e!==L?Ot(e,i,r):e._time)+r._delay),r._end=la(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),Aa(e,r,"_first","_last",e._sort?"_start":0),xt(r)||(e._recent=r),n||Ma(e,r),e._ts<0&&La(e,e._tTime),e}function Oa(t,e){return(ht.ScrollTrigger||S("scrollTrigger",e))&&ht.ScrollTrigger.create(e,t)}function Pa(t,e,r,i,n){return Qt(t,e,n),t._initted?!r&&t._pt&&!I&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==It.frame?(pt.push(t),t._lazy=[n,i],1):void 0:1}function Ua(t,e,r,i){var n=t._repeat,a=la(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:la(a*(n+1)+t._rDelay*n):a,0<s&&!i&&La(t,t._tTime=t._tDur*s),t.parent&&Ka(t),r||Da(t.parent,t),t}function Va(t){return t instanceof Zt?Da(t):Ua(t,t._dur)}function Ya(e,r,i){var n,a,s=t(r[1]),o=(s?2:1)+(e<2?0:1),u=r[o];if(s&&(u.duration=r[1]),u.parent=i,e){for(n=u,a=i;a&&!("immediateRender"in n);)n=a.vars.defaults||{},a=w(a.vars.inherit)&&a.parent;u.immediateRender=w(n.immediateRender),e<2?u.runBackwards=1:u.startAt=r[o-1]}return new te(r[0],u,r[1+o])}function Za(t,e){return t||0===t?e(t):e}function _a(t,e){return r(t)&&(e=ut.exec(t))?e[1]:""}function cb(t,e){return t&&v(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&v(t[0]))&&!t.nodeType&&t!==h}function fb(r){return r=Pt(r)[0]||T("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return Pt(t,e.querySelectorAll?e:e===r?T("Invalid scope")||a.createElement("div"):r)}}function gb(t){return t.sort(function(){return.5-Math.random()})}function hb(t){if(s(t))return t;var p=v(t)?t:{each:t},_=Vt(p.ease),m=p.from||0,g=parseFloat(p.base)||0,y={},e=0<m&&m<1,T=isNaN(m)||e,b=p.axis,w=m,x=m;return r(m)?w=x={center:.5,edges:.5,end:1}[m]||0:!e&&T&&(w=m[0],x=m[1]),function(t,e,r){var i,n,a,s,o,u,h,l,f,d=(r||p).length,c=y[d];if(!c){if(!(f="auto"===p.grid?0:(p.grid||[1,X])[1])){for(h=-X;h<(h=r[f++].getBoundingClientRect().left)&&f<d;);f<d&&f--}for(c=y[d]=[],i=T?Math.min(f,d)*w-.5:m%f,n=f===X?0:T?d*x/f-.5:m/f|0,l=X,u=h=0;u<d;u++)a=u%f-i,s=n-(u/f|0),c[u]=o=b?Math.abs("y"===b?s:a):J(a*a+s*s),h<o&&(h=o),o<l&&(l=o);"random"===m&&gb(c),c.max=h-l,c.min=l,c.v=d=(parseFloat(p.amount)||parseFloat(p.each)*(d<f?d-1:b?"y"===b?d/f:f:Math.max(f,d/f))||0)*("edges"===m?-1:1),c.b=d<0?g-d:g,c.u=_a(p.amount||p.each)||0,_=_&&d<0?jt(_):_}return d=(c[t]-c.min)/c.max||0,la(c.b+(_?_(d):d)*c.v)+c.u}}function ib(i){var n=Math.pow(10,((i+"").split(".")[1]||"").length);return function(e){var r=la(Math.round(parseFloat(e)/i)*i*n);return(r-r%1)/n+(t(e)?0:_a(e))}}function jb(h,e){var l,f,r=$(h);return!r&&v(h)&&(l=r=h.radius||X,h.values?(h=Pt(h.values),(f=!t(h[0]))&&(l*=l)):h=ib(h.increment)),Za(e,r?s(h)?function(t){return f=h(t),Math.abs(f-t)<=l?f:t}:function(e){for(var r,i,n=parseFloat(f?e.x:e),a=parseFloat(f?e.y:0),s=X,o=0,u=h.length;u--;)(r=f?(r=h[u].x-n)*r+(i=h[u].y-a)*i:Math.abs(h[u]-n))<s&&(s=r,o=u);return o=!l||s<=l?h[o]:e,f||o===e||t(e)?o:o+_a(e)}:ib(h))}function kb(t,e,r,i){return Za($(t)?!e:!0===r?!!(r=0):!i,function(){return $(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i})}function ob(e,r,t){return Za(t,function(t){return e[~~r(t)]})}function rb(t){return t.replace(tt,function(t){var e=t.indexOf("[")+1,r=t.substring(e||7,e?t.indexOf("]"):t.length-1).split(et);return kb(e?r:+r[0],e?0:+r[1],+r[2]||1e-5)})}function ub(t,e,r){var i,n,a,s=t.labels,o=X;for(i in s)(n=s[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(a=i,o=n);return a}function wb(t){return Ca(t),t.scrollTrigger&&t.scrollTrigger.kill(!!I),t.progress()<1&&Dt(t,"onInterrupt"),t}function zb(t){if(t)if(t=!t.name&&t.default||t,x()||t.headless){var e=t.name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:V,render:ve,add:Jt,kill:Te,modifier:ye,rawVars:0},a={targetTest:0,get:0,getSetter:le,aliases:{},register:0};if(Lt(),t!==i){if(mt[e])return;ta(i,ta(xa(t,n),a)),bt(i.prototype,bt(n,xa(t,a))),mt[i.prop=e]=i,t.targetTest&&(yt.push(i),ct[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}U(e,i),t.register&&t.register(Fe,i,we)}else St.push(t)}function Cb(t,e,r){return(6*(t+=t<0?1:1<t?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*zt+.5|0}function Db(e,r,i){var n,a,s,o,u,h,l,f,d,c,p=e?t(e)?[e>>16,e>>8&zt,e&zt]:0:Et.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Et[e])p=Et[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&zt,p&zt,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&zt,e&zt]}else if("hsl"===e.substr(0,3))if(p=c=e.match(rt),r){if(~e.indexOf("="))return p=e.match(it),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3<p.length&&(p[3]*=1),p[0]=Cb(o+1/3,n,a),p[1]=Cb(o,n,a),p[2]=Cb(o-1/3,n,a);else p=e.match(rt)||Et.transparent;p=p.map(Number)}return r&&!c&&(n=p[0]/zt,a=p[1]/zt,s=p[2]/zt,h=((l=Math.max(n,a,s))+(f=Math.min(n,a,s)))/2,l===f?o=u=0:(d=l-f,u=.5<h?d/(2-l-f):d/(l+f),o=l===n?(a-s)/d+(a<s?6:0):l===a?(s-n)/d+2:(n-a)/d+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*u+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p}function Eb(t){var r=[],i=[],n=-1;return t.split(Rt).forEach(function(t){var e=t.match(nt)||[];r.push.apply(r,e),i.push(n+=e.length+1)}),r.c=i,r}function Fb(t,e,r){var i,n,a,s,o="",u=(t+o).match(Rt),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=Db(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(a=Eb(t),(i=r.c).join(o)!==a.c.join(o)))for(s=(n=t.replace(Rt,"1").split(nt)).length-1;l<s;l++)o+=n[l]+(~i.indexOf(l)?u.shift()||h+"0,0,0,0)":(a.length?a:u.length?u:r).shift());if(!n)for(s=(n=t.split(Rt)).length-1;l<s;l++)o+=n[l]+u[l];return o+n[s]}function Ib(t){var e,r=t.join(" ");if(Rt.lastIndex=0,Rt.test(r))return e=Ft.test(r),t[1]=Fb(t[1],e),t[0]=Fb(t[0],e,Eb(t[1])),!0}function Rb(t){var e=(t+"").split("("),r=Bt[e[0]];return r&&1<e.length&&r.config?r.config.apply(null,~t.indexOf("{")?[function _parseObjectInString(t){for(var e,r,i,n={},a=t.substr(1,t.length-3).split(":"),s=a[0],o=1,u=a.length;o<u;o++)r=a[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[s]=isNaN(i)?i.replace(Nt,"").trim():+i,s=r.substr(e+1).trim();return n}(e[1])]:function _valueInParentheses(t){var e=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<r?t.indexOf(")",r+1):r)}(t).split(",").map(ra)):Bt._CE&&Yt.test(t)?Bt._CE("",t):r}function Tb(t,e){for(var r,i=t._first;i;)i instanceof Zt?Tb(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?Tb(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function Vb(t,e,r,i){void 0===r&&(r=function easeOut(t){return 1-e(1-t)}),void 0===i&&(i=function easeInOut(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,a={easeIn:e,easeOut:r,easeInOut:i};return ja(t,function(t){for(var e in Bt[t]=ht[t]=a,Bt[n=t.toLowerCase()]=r,a)Bt[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Bt[t+"."+e]=a[e]}),a}function Wb(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function Xb(r,t,e){function Lm(t){return 1===t?1:i*Math.pow(2,-10*t)*G((t-a)*n)+1}var i=1<=t?t:1,n=(e||(r?.3:.45))/(t<1?t:1),a=n/Z*(Math.asin(1/i)||0),s="out"===r?Lm:"in"===r?function(t){return 1-Lm(1-t)}:Wb(Lm);return n=Z/n,s.config=function(t,e){return Xb(r,t,e)},s}function Yb(e,r){function Tm(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?Tm:"in"===e?function(t){return 1-Tm(1-t)}:Wb(Tm);return t.config=function(t){return Yb(e,t)},t}var F,I,l,L,h,n,a,i,o,f,d,c,p,_,m,g,b,k,O,M,C,P,A,D,z,E,B,Y,N={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},j={duration:.5,overwrite:!1,delay:0},X=1e8,q=1/X,Z=2*Math.PI,W=Z/4,H=0,J=Math.sqrt,Q=Math.cos,G=Math.sin,K="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},$=Array.isArray,tt=/random\([^)]+\)/g,et=/,\s*/g,rt=/(?:-?\.?\d|\.)+/gi,it=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,nt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,at=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,st=/[+-]=-?[.\d]+/,ot=/[^,'"\[\]\s]+/gi,ut=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ht={},lt={suppressEvents:!0,isStart:!0,kill:!1},ft={suppressEvents:!0,kill:!1},dt={suppressEvents:!0},ct={},pt=[],_t={},mt={},gt={},vt=30,yt=[],Tt="",bt=function _merge(t,e){for(var r in e)t[r]=e[r];return t},wt=function _animationCycle(t,e){var r=Math.floor(t=la(t/e));return t&&r===t?r-1:r},xt=function _isFromOrFromStart(t){var e=t.data;return"isFromStart"===e||"isStart"===e},kt={_start:0,endTime:V,totalDuration:V},Ot=function _parsePosition(t,e,i){var n,a,s,o=t.labels,u=t._recent||kt,h=t.duration()>=X?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*($(i)?i[0]:i).totalDuration()),1<n?_parsePosition(t,e.substr(0,n-1),i)+a:h+a)):null==e?h:+e},Mt=function _clamp(t,e,r){return r<t?t:e<r?e:r},Ct=[].slice,Pt=function toArray(t,e,i){return l&&!e&&l.selector?l.selector(t):!r(t)||i||!n&&Lt()?$(t)?function _flatten(t,e,i){return void 0===i&&(i=[]),t.forEach(function(t){return r(t)&&!e||cb(t,1)?i.push.apply(i,Pt(t)):i.push(t)})||i}(t,i):cb(t)?Ct.call(t,0):t?[t]:[]:Ct.call((e||a).querySelectorAll(t),0)},At=function mapRange(e,t,r,i,n){var a=t-e,s=i-r;return Za(n,function(t){return r+((t-e)/a*s||0)})},Dt=function _callback(t,e,r){var i,n,a,s=t.vars,o=s[e],u=l,h=t._ctx;if(o)return i=s[e+"Params"],n=s.callbackScope||t,r&&pt.length&&oa(),h&&(l=h),a=i?o.apply(n,i):o.call(n),l=u,a},St=[],zt=255,Et={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Rt=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Et)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Ft=/hsl[a]?\(/,It=(O=Date.now,M=500,C=33,P=O(),A=P,z=D=1e3/240,g={time:0,frame:0,tick:function tick(){Al(!0)},deltaRatio:function deltaRatio(t){return b/(1e3/(t||60))},wake:function wake(){o&&(!n&&x()&&(h=n=window,a=h.document||{},ht.gsap=Fe,(h.gsapVersions||(h.gsapVersions=[])).push(Fe.version),R(i||h.GreenSockGlobals||!h.gsap&&h||{}),St.forEach(zb)),m="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,p&&g.sleep(),_=m||function(t){return setTimeout(t,z-1e3*g.time+1|0)},c=1,Al(2))},sleep:function sleep(){(m?cancelAnimationFrame:clearTimeout)(p),c=0,_=V},lagSmoothing:function lagSmoothing(t,e){M=t||1/0,C=Math.min(e||33,M)},fps:function fps(t){D=1e3/(t||240),z=1e3*g.time+D},add:function add(n,t,e){var a=t?function(t,e,r,i){n(t,e,r,i),g.remove(a)}:n;return g.remove(n),E[e?"unshift":"push"](a),Lt(),a},remove:function remove(t,e){~(e=E.indexOf(t))&&E.splice(e,1)&&e<=k&&k--},_listeners:E=[]}),Lt=function _wake(){return!c&&It.wake()},Bt={},Yt=/^[\d.\-M][\d.\-,\s]/,Nt=/["']/g,jt=function _invertEase(e){return function(t){return 1-e(1-t)}},Vt=function _parseEase(t,e){return t&&(s(t)?t:Bt[t]||Rb(t))||e};function Al(t){var e,r,i,n,a=O()-A,s=!0===t;if((M<a||a<0)&&(P+=a-C),(0<(e=(i=(A+=a)-P)-z)||s)&&(n=++g.frame,b=i-1e3*g.time,g.time=i/=1e3,z+=e+(D<=e?4:D-e),r=1),s||(p=_(Al)),r)for(k=0;k<E.length;k++)E[k](i,b,n,t)}function jn(t){return t<Y?B*t*t:t<.7272727272727273?B*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?B*(t-=2.25/2.75)*t+.9375:B*Math.pow(t-2.625/2.75,2)+.984375}ja("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;Vb(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2})}),Bt.Linear.easeNone=Bt.none=Bt.Linear.easeIn,Vb("Elastic",Xb("in"),Xb("out"),Xb()),B=7.5625,Y=1/2.75,Vb("Bounce",function(t){return 1-jn(1-t)},jn),Vb("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)}),Vb("Circ",function(t){return-(J(1-t*t)-1)}),Vb("Sine",function(t){return 1===t?1:1-Q(t*W)}),Vb("Back",Yb("in"),Yb("out"),Yb()),Bt.SteppedEase=Bt.steps=ht.SteppedEase={config:function config(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*Mt(0,.99999999,t)|0)+n)*r}}},j.ease=Bt["quad.out"],ja("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Tt+=t+","+t+"Params,"});var Ut,Xt=function GSCache(t,e){this.id=H++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:ia,this.set=e?e.getSetter:le},qt=((Ut=Animation.prototype).delay=function delay(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},Ut.duration=function duration(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},Ut.totalDuration=function totalDuration(t){return arguments.length?(this._dirty=0,Ua(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},Ut.totalTime=function totalTime(t,e){if(Lt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(La(this,t),!r._dp||r.parent||Ma(r,this);r&&r.parent;)r.parent._time!==r._start+(0<=r._ts?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&Na(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===q||!this._initted&&this._dur&&t||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),qa(this,t,e)),this},Ut.time=function time(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ha(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},Ut.totalProgress=function totalProgress(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):0<=this.rawTime()&&this._initted?1:0},Ut.progress=function progress(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ha(this),e):this.duration()?Math.min(1,this._time/this._dur):0<this.rawTime()?1:0},Ut.iteration=function iteration(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?wt(this._tTime,r)+1:1},Ut.timeScale=function timeScale(t,e){if(!arguments.length)return this._rts===-q?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Ja(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-q?0:this._rts,this.totalTime(Mt(-Math.abs(this._delay),this.totalDuration(),r),!1!==e),Ka(this),function _recacheAncestors(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},Ut.paused=function paused(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Lt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==q&&(this._tTime-=q)))),this):this._ps},Ut.startTime=function startTime(t){if(arguments.length){this._start=la(t);var e=this.parent||this._dp;return!e||!e._sort&&this.parent||Na(e,this,this._start-this._delay),this}return this._start},Ut.endTime=function endTime(t){return this._start+(w(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},Ut.rawTime=function rawTime(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ja(e.rawTime(t),this):this._tTime:this._tTime},Ut.revert=function revert(t){void 0===t&&(t=dt);var e=I;return I=t,pa(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),I=e,this},Ut.globalTime=function globalTime(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},Ut.repeat=function repeat(t){return arguments.length?(this._repeat=t===1/0?-2:t,Va(this)):-2===this._repeat?1/0:this._repeat},Ut.repeatDelay=function repeatDelay(t){if(arguments.length){var e=this._time;return this._rDelay=t,Va(this),e?this.time(e):this}return this._rDelay},Ut.yoyo=function yoyo(t){return arguments.length?(this._yoyo=t,this):this._yoyo},Ut.seek=function seek(t,e){return this.totalTime(Ot(this,t),w(e))},Ut.restart=function restart(t,e){return this.play().totalTime(t?-this._delay:0,w(e)),this._dur||(this._zTime=-q),this},Ut.play=function play(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},Ut.reverse=function reverse(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},Ut.pause=function pause(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},Ut.resume=function resume(){return this.paused(!1)},Ut.reversed=function reversed(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-q:0)),this):this._rts<0},Ut.invalidate=function invalidate(){return this._initted=this._act=0,this._zTime=-q,this},Ut.isActive=function isActive(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-q))},Ut.eventCallback=function eventCallback(t,e,r){var i=this.vars;return 1<arguments.length?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},Ut.then=function then(t){var i=this,n=i._prom;return new Promise(function(e){function Fo(){var t=i.then;i.then=null,n&&n(),s(r)&&(r=r(i))&&(r.then||r===i)&&(i.then=t),e(r),i.then=t}var r=s(t)?t:sa;i._initted&&1===i.totalProgress()&&0<=i._ts||!i._tTime&&i._ts<0?Fo():i._prom=Fo})},Ut.kill=function kill(){wb(this)},Animation);function Animation(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Ua(this,+t.duration,1,1),this.data=t.data,l&&(this._ctx=l).data.push(this),c||It.wake()}ta(qt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-q,_prom:0,_ps:!1,_rts:1});var Zt=function(i){function Timeline(t,e){var r;return void 0===t&&(t={}),(r=i.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=w(t.sortChildren),L&&Na(t.parent||L,_assertThisInitialized(r),e),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&Oa(_assertThisInitialized(r),t.scrollTrigger),r}_inheritsLoose(Timeline,i);var e=Timeline.prototype;return e.to=function to(t,e,r){return Ya(0,arguments,this),this},e.from=function from(t,e,r){return Ya(1,arguments,this),this},e.fromTo=function fromTo(t,e,r,i){return Ya(2,arguments,this),this},e.set=function set(t,e,r){return e.duration=0,e.parent=this,ya(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new te(t,e,Ot(this,r),1),this},e.call=function call(t,e,r){return Na(this,te.delayedCall(0,t,e),r)},e.staggerTo=function staggerTo(t,e,r,i,n,a,s){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=a,r.onCompleteParams=s,r.parent=this,new te(t,r,Ot(this,n)),this},e.staggerFrom=function staggerFrom(t,e,r,i,n,a,s){return r.runBackwards=1,ya(r).immediateRender=w(r.immediateRender),this.staggerTo(t,e,r,i,n,a,s)},e.staggerFromTo=function staggerFromTo(t,e,r,i,n,a,s,o){return i.startAt=r,ya(i).immediateRender=w(i.immediateRender),this.staggerTo(t,e,i,n,a,s,o)},e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_=this._time,m=this._dirty?this.totalDuration():this._tDur,g=this._dur,v=t<=0?0:la(t),y=this._zTime<0!=t<0&&(this._initted||!g);if(this!==L&&m<v&&0<=t&&(v=m),v!==this._tTime||r||y){if(_!==this._time&&g&&(v+=this._time-_,t+=this._time-_),i=v,f=this._start,u=!(l=this._ts),y&&(g||(_=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(c=this._yoyo,o=g+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=la(v%o),v===m?(s=this._repeat,i=g):((s=~~(d=la(v/o)))&&s===d&&(i=g,s--),g<i&&(i=g)),d=wt(this._tTime,o),!_&&this._tTime&&d!==s&&this._tTime-d*o-this._dur<=0&&(d=s),c&&1&s&&(i=g-i,p=1),s!==d&&!this._lock){var T=c&&1&d,b=T===(c&&1&s);if(s<d&&(T=!T),_=T?0:v%g?g:v,this._lock=1,this.render(_||(p?0:la(s*o)),e,!g)._lock=0,this._tTime=v,!e&&this.parent&&Dt(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,d=s),_&&_!==this._time||u!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(g=this._dur,m=this._tDur,b&&(this._lock=2,_=T?g:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Tb(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(h=function _findNextPauseTween(t,e,r){var i;if(e<r)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,la(_),la(i)))&&(v-=i-(i=h._start)),this._tTime=v,this._time=i,this._act=!l,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,_=0),!_&&v&&g&&!e&&!d&&(Dt(this,"onStart"),this._tTime!==v))return this;if(_<=i&&0<=t)for(n=this._first;n;){if(a=n._next,(n._act||i>=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=-q);break}}n=a}else{n=this._last;for(var w=t<0?t:i;n;){if(a=n._prev,(n._act||w<=n._end)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(w-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(w-n._start)*n._ts,e,r||I&&pa(n)),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=w?-q:q);break}}n=a}}if(h&&!e&&(this.pause(),h.render(_<=i?0:-q)._zTime=_<=i?1:-1,this._ts))return this._start=f,Ka(this),this.render(t,e,r);this._onUpdate&&!e&&Dt(this,"onUpdate",!0),(v===m&&this._tTime>=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0<this._ts||!v&&this._ts<0)||Ca(this,1),e||t<0&&!_||!v&&!_&&m||(Dt(this,v===m&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},e.add=function add(e,i){var n=this;if(t(i)||(i=Ot(this,i,e)),!(e instanceof qt)){if($(e))return e.forEach(function(t){return n.add(t,i)}),this;if(r(e))return this.addLabel(e,i);if(!s(e))return this;e=te.delayedCall(0,e)}return this!==e?Na(this,e,i):this},e.getChildren=function getChildren(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-X);for(var n=[],a=this._first;a;)a._start>=i&&(a instanceof te?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(t.parent===this&&Ba(this,t),t===this._recent&&(this._recent=this._last),Da(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=la(It.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),i.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function addLabel(t,e){return this.labels[t]=Ot(this,e),this},e.removeLabel=function removeLabel(t){return delete this.labels[t],this},e.addPause=function addPause(t,e,r){var i=te.delayedCall(0,e||V,r);return i.data="isPause",this._hasPause=1,Na(this,i,Ot(this,t))},e.removePause=function removePause(t){var e=this._first;for(t=Ot(this,t);e;)e._start===t&&"isPause"===e.data&&Ca(e),e=e._next},e.killTweensOf=function killTweensOf(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Wt!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function getTweensOf(e,r){for(var i,n=[],a=Pt(e),s=this._first,o=t(r);s;)s instanceof te?na(s._targets,a)&&(o?(!Wt||s._initted&&s._ts)&&s.globalTime(0)<=r&&s.globalTime(s.totalDuration())>r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=Ot(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=te.to(i,ta({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||q,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ua(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,ta({startAt:{time:Ot(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+q)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);var i,n=this._first,a=this.labels;for(t=la(t);n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return Da(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Da(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=X;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Na(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=la(r/a._ts),a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ua(a,a===L&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(L._ts&&(qa(L,Ja(t,L)),f=It.frame),It.frame>=vt){vt+=N.autoSleep||120;var e=L._first;if((!e||!e._ts)&&N.autoSleep&&It._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||It.sleep()}}},Timeline}(qt);ta(Zt.prototype,{_lock:0,_hasPause:0,_forcing:0});function dc(t,e,i,n,a,o){var u,h,l,f;if(mt[t]&&!1!==(u=new mt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Gt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||$(t)||K(t))return r(t)?Gt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Gt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new we(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==d))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function jc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if($(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Wt,Ht,Jt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var d,c=t[e],p="get"!==i?i:s(c)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():c,_=s(c)?l?ue:re:ee;if(r(n)&&(~n.indexOf("random(")&&(n=rb(n)),"="===n.charAt(1)&&(!(d=ma(p,n)+(_a(p)||0))&&0!==d||(n=d))),!f||p!==n||Ht)return isNaN(p*n)||""===n?(c||e in t||S(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,c,p,_=new we(this._pt,t,e,0,1,ge,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(c=~(i+="").indexOf("random("))&&(i=rb(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(at)||[];o=at.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(d=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:d,c:"="===l.charAt(1)?ma(d,l)-d:parseFloat(l)-d,m:h&&h<4?Math.round:0},m=at.lastIndex);return _.c=m<i.length?i.substring(m,i.length):"",_.fp=s,(st.test(i)||c)&&(_.e=0),this._pt=_}.call(this,t,e,p,n,_,h||N.stringFilter,l)):(d=new we(this._pt,t,e,+p||0,n-(p||0),"boolean"==typeof c?_e:ce,0,_),l&&(d.fp=l),u&&d.modifier(u,this,t),this._pt=d)},Qt=function _initTween(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_,m=t.vars,g=m.ease,v=m.startAt,y=m.immediateRender,T=m.lazy,b=m.onUpdate,x=m.runBackwards,k=m.yoyoEase,O=m.keyframes,M=m.autoRevert,C=t._dur,P=t._startAt,A=t._targets,D=t.parent,S=D&&"nested"===D.data?D.vars.targets:A,z="auto"===t._overwrite&&!F,E=t.timeline;if(!E||O&&g||(g="none"),t._ease=Vt(g,j.ease),t._yEase=k?jt(Vt(!0===k?g:k,j.ease)):0,k&&t._yoyo&&!t._repeat&&(k=t._yEase,t._yEase=t._ease,t._ease=k),t._from=!E&&!!m.runBackwards,!E||O&&!m.stagger){if(p=(l=A[0]?ha(A[0]).harness:0)&&m[l.prop],i=xa(m,ct),P&&(P._zTime<0&&P.progress(1),e<0&&x&&y&&!M?P.render(-1,!0):P.revert(x&&C?ft:lt),P._lazy=0),v){if(Ca(t._startAt=te.set(A,ta({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!P&&w(T),startAt:null,delay:0,onUpdate:b&&function(){return Dt(t,"onUpdate")},stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I||!y&&!M)&&t._startAt.revert(ft),y&&C&&e<=0&&r<=0)return void(e&&(t._zTime=e))}else if(x&&C&&!P)if(e&&(y=!1),a=ta({overwrite:!1,data:"isFromStart",lazy:y&&!P&&w(T),immediateRender:y,stagger:0,parent:D},i),p&&(a[l.prop]=p),Ca(t._startAt=te.set(A,a)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I?t._startAt.revert(ft):t._startAt.render(-1,!0)),t._zTime=e,y){if(!e)return}else _initTween(t._startAt,q,q);for(t._pt=t._ptCache=0,T=C&&w(T)||T&&!C,n=0;n<A.length;n++){if(h=(o=A[n])._gsap||ga(A)[n]._gsap,t._ptLookup[n]=d={},_t[h.id]&&pt.length&&oa(),c=S===A?n:S.indexOf(o),l&&!1!==(f=new l).init(o,p||i,t,c,S)&&(t._pt=s=new we(t._pt,o,f.name,0,1,f.render,f,0,f.priority),f._props.forEach(function(t){d[t]=s}),f.priority&&(u=1)),!l||p)for(a in i)mt[a]&&(f=dc(a,i,t,c,o,S))?f.priority&&(u=1):d[a]=s=Jt.call(t,o,a,"get",i[a],c,S,0,m.stringFilter);t._op&&t._op[n]&&t.kill(o,t._op[n]),z&&t._pt&&(Wt=t,L.killTweensOf(o,d,t.globalTime(e)),_=!t.parent,Wt=0),t._pt&&T&&(_t[h.id]=1)}u&&be(t),t._onInit&&t._onInit(t)}t._onUpdate=b,t._initted=(!t._op||t._pt)&&!_,O&&e<=0&&E.render(X,!0,!0)},Gt=function _parseFuncOrString(t,e,i,n,a){return s(t)?t.call(e,i,n,a):r(t)&&~t.indexOf("random(")?rb(t):t},Kt=Tt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",$t={};ja(Kt+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $t[t]=1});var te=function(R){function Tween(e,r,i,n){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var s,o,u,h,l,f,d,c,p=(a=R.call(this,n?r:ya(r))||this).vars,_=p.duration,m=p.delay,g=p.immediateRender,b=p.stagger,x=p.overwrite,k=p.keyframes,O=p.defaults,M=p.scrollTrigger,C=p.yoyoEase,P=r.parent||L,A=($(e)||K(e)?t(e[0]):"length"in r)?[e]:Pt(e);if(a._targets=A.length?ga(A):T("GSAP target "+e+" not found. https://gsap.com",!N.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=x,k||b||y(_)||y(m)){if(r=a.vars,(s=a.timeline=new Zt({data:"nested",defaults:O||{},targets:P&&"nested"===P.data?P.vars.targets:A})).kill(),s.parent=s._dp=_assertThisInitialized(a),s._start=0,b||y(_)||y(m)){if(h=A.length,d=b&&hb(b),v(b))for(l in b)~Kt.indexOf(l)&&((c=c||{})[l]=b[l]);for(o=0;o<h;o++)(u=xa(r,$t)).stagger=0,C&&(u.yoyoEase=C),c&&bt(u,c),f=A[o],u.duration=+Gt(_,_assertThisInitialized(a),o,f,A),u.delay=(+Gt(m,_assertThisInitialized(a),o,f,A)||0)-a._delay,!b&&1===h&&u.delay&&(a._delay=m=u.delay,a._start+=m,u.delay=0),s.to(f,u,d?d(o,f,A):0),s._ease=Bt.none;s.duration()?_=m=0:a.timeline=0}else if(k){ya(ta(s.vars.defaults,{ease:"none"})),s._ease=Vt(k.ease||r.ease||"none");var D,S,z,E=0;if($(k))k.forEach(function(t){return s.to(A,t,">")}),s.duration();else{for(l in u={},k)"ease"===l||"easeEach"===l||jc(l,k[l],u,k.easeEach);for(l in u)for(D=u[l].sort(function(t,e){return t.t-e.t}),o=E=0;o<D.length;o++)(z={ease:(S=D[o]).e,duration:(S.t-(o?D[o-1].t:0))/100*_})[l]=S.v,s.to(A,z,E),E+=z.duration;s.duration()<_&&s.to({},{duration:_-s.duration()})}}_||a.duration(_=s.duration())}else a.timeline=0;return!0!==x||F||(Wt=_assertThisInitialized(a),L.killTweensOf(A),Wt=0),Na(P,_assertThisInitialized(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(g||!_&&!k&&a._start===la(P._time)&&w(g)&&function _hasNoPausedAncestors(t){return!t||t._ts&&_hasNoPausedAncestors(t.parent)}(_assertThisInitialized(a))&&"nested"!==P.data)&&(a._tTime=-q,a.render(Math.max(0,-m)||0)),M&&Oa(_assertThisInitialized(a),M),a}_inheritsLoose(Tween,R);var e=Tween.prototype;return e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d=this._time,c=this._tDur,p=this._dur,_=t<0,m=c-q<t&&!_?c:t<q?0:t;if(p){if(m!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=_||this._lazy){if(i=m,l=this.timeline,this._repeat){if(s=p+this._rDelay,this._repeat<-1&&_)return this.totalTime(100*s+t,e,r);if(i=la(m%s),m===c?(a=this._repeat,i=p):(a=~~(o=la(m/s)))&&a===o?(i=p,a--):p<i&&(i=p),(u=this._yoyo&&1&a)&&(f=this._yEase,i=p-i),o=wt(this._tTime,s),i===d&&!r&&this._initted&&a===o)return this._tTime=m,this;a!==o&&(l&&this._yEase&&Tb(l,u),this.vars.repeatRefresh&&!u&&!this._lock&&i!==s&&this._initted&&(this._lock=r=1,this.render(la(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Pa(this,_?t:i,r,e,m))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&a!==o))return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/p),this._from&&(this.ratio=h=1-h),!d&&m&&!e&&!o&&(Dt(this,"onStart"),this._tTime!==m))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(_&&Fa(this,t,0,r),Dt(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!e&&this.parent&&Dt(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(_&&!this._onUpdate&&Fa(this,t,0,!0),!t&&p||!(m===this._tDur&&0<this._ts||!m&&this._ts<0)||Ca(this,1),e||_&&!d||!(m||d||u)||(Dt(this,m===c?"onComplete":"onReverseComplete",!0),!this._prom||m<c&&0<this.timeScale()||this._prom()))}}else!function _renderZeroDurationTween(t,e,r,i){var n,a,s,o=t.ratio,u=e<0||!e&&(!t._start&&function _parentPlayheadIsBeforeStart(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||_parentPlayheadIsBeforeStart(e))}(t)&&(t._initted||!xt(t))||(t._ts<0||t._dp._ts<0)&&!xt(t))?0:1,h=t._rDelay,l=0;if(h&&t._repeat&&(l=Mt(0,t._tDur,e),a=wt(l,h),t._yoyo&&1&a&&(u=1-u),a!==wt(t._tTime,h)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||I||i||t._zTime===q||!e&&t._zTime){if(!t._initted&&Pa(t,e,i,r,l))return;for(s=t._zTime,t._zTime=e||(r?q:0),r=r||e&&!s,t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=l,n=t._pt;n;)n.r(u,n.d),n=n._next;e<0&&Fa(t,e,0,!0),t._onUpdate&&!r&&Dt(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Dt(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Ca(t,1),r||I||(Dt(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),R.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i,n){c||It.wake(),this._ts||this.play();var a,s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Qt(this,s),a=this._ease(s/this._dur),function _updatePropTweens(t,e,r,i,n,a,s,o){var u,h,l,f,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],l=t._ptLookup,f=t._targets.length;f--;){if((u=l[f][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Ht=1,t.vars[e]="+=0",Qt(t,s),Ht=0,o?T(e+" not eligible for reset"):1;d.push(u)}for(f=d.length;f--;)(u=(h=d[f])._pt||h).s=!i&&0!==i||n?u.s+(i||0)+a*u.c:i,u.c=r-u.s,h.e&&(h.e=ka(r)+_a(h.e)),h.b&&(h.b=u.s+_a(h.b))}(this,t,e,r,i,a,s,n)?this.resetTo(t,e,r,i,1):(La(this,0),this.parent||Aa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?wb(this):this.scrollTrigger&&this.scrollTrigger.kill(!!I),this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Wt&&!0!==Wt.vars.overwrite)._first||wb(this),this.parent&&i!==this.timeline.totalDuration()&&Ua(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,d=t?Pt(t):f,c=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,d))return"all"===e&&(this._pt=0),wb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ja(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?ha(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=bt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~d.indexOf(f[l]))for(u in a=c[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||Ba(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&wb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Ya(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Ya(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return L.killTweensOf(t,e,r)},Tween}(qt);ta(te.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ja("staggerTo,staggerFrom,staggerFromTo",function(r){te[r]=function(){var t=new Zt,e=Ct.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function rc(t,e,r){return t.setAttribute(e,r)}function zc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var ee=function _setterPlain(t,e,r){return t[e]=r},re=function _setterFunc(t,e,r){return t[e](r)},ue=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},le=function _getSetter(t,e){return s(t[e])?re:u(t[e])&&t.setAttribute?rc:ee},ce=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},_e=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ge=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},ve=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},ye=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},Te=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?Ba(this,i,"_pt"):i.dep||(e=1),i=r;return!e},be=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},we=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=zc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||ce,this.d=s||this,this.set=o||ee,this.pr=u||0,(this._next=t)&&(t._prev=this)}ja(Tt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ct[t]=1}),ht.TweenMax=ht.TweenLite=te,ht.TimelineLite=ht.TimelineMax=Zt,L=new Zt({sortChildren:!1,defaults:j,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),N.stringFilter=Ib;function Hc(t){return(Oe[t]||Me).map(function(t){return t()})}function Ic(){var t=Date.now(),o=[];2<t-Ce&&(Hc("matchMediaInit"),ke.forEach(function(t){var e,r,i,n,a=t.queries,s=t.conditions;for(r in a)(e=h.matchMedia(a[r]).matches)&&(i=1),e!==s[r]&&(s[r]=e,n=1);n&&(t.revert(),i&&o.push(t))}),Hc("matchMediaRevert"),o.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),Ce=t,Hc("matchMedia"))}var xe,ke=[],Oe={},Me=[],Ce=0,Pe=0,De=((xe=Context.prototype).add=function add(t,i,n){function Jw(){var t,e=l,r=a.selector;return e&&e!==a&&e.data.push(a),n&&(a.selector=fb(n)),l=a,t=i.apply(a,arguments),s(t)&&a._r.push(t),l=e,a.selector=r,a.isReverted=!1,t}s(t)&&(n=i,i=t,t=s);var a=this;return a.last=Jw,t===s?Jw(a,function(t){return a.add(null,t)}):t?a[t]=Jw:Jw},xe.ignore=function ignore(t){var e=l;l=null,t(this),l=e},xe.getTweens=function getTweens(){var e=[];return this.data.forEach(function(t){return t instanceof Context?e.push.apply(e,t.getTweens()):t instanceof te&&!(t.parent&&"nested"===t.parent.data)&&e.push(t)}),e},xe.clear=function clear(){this._r.length=this.data.length=0},xe.kill=function kill(i,t){var n=this;if(i?function(){for(var t,e=n.getTweens(),r=n.data.length;r--;)"isFlip"===(t=n.data[r]).data&&(t.revert(),t.getChildren(!0,!0,!1).forEach(function(t){return e.splice(e.indexOf(t),1)}));for(e.map(function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t:t}}).sort(function(t,e){return e.g-t.g||-1/0}).forEach(function(t){return t.t.revert(i)}),r=n.data.length;r--;)(t=n.data[r])instanceof Zt?"nested"!==t.data&&(t.scrollTrigger&&t.scrollTrigger.revert(),t.kill()):t instanceof te||!t.revert||t.revert(i);n._r.forEach(function(t){return t(i,n)}),n.isReverted=!0}():this.data.forEach(function(t){return t.kill&&t.kill()}),this.clear(),t)for(var e=ke.length;e--;)ke[e].id===this.id&&ke.splice(e,1)},xe.revert=function revert(t){this.kill(t||{})},Context);function Context(t,e){this.selector=e&&fb(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Pe++,t&&this.add(t)}var Se,Ee=((Se=MatchMedia.prototype).add=function add(t,e,r){v(t)||(t={matches:t});var i,n,a,s=new De(0,r||this.scope),o=s.conditions={};for(n in l&&!s.selector&&(s.selector=l.selector),this.contexts.push(s),e=s.add("onMatch",e),s.queries=t)"all"===n?a=1:(i=h.matchMedia(t[n]))&&(ke.indexOf(s)<0&&ke.push(s),(o[n]=i.matches)&&(a=1),i.addListener?i.addListener(Ic):i.addEventListener("change",Ic));return a&&e(s,function(t){return s.add(null,t)}),this},Se.revert=function revert(t){this.kill(t||{})},Se.kill=function kill(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},MatchMedia);function MatchMedia(t){this.contexts=[],this.scope=t,l&&l.data.push(this)}var Re={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t){return zb(t)})},timeline:function timeline(t){return new Zt(t)},getTweensOf:function getTweensOf(t,e){return L.getTweensOf(t,e)},getProperty:function getProperty(i,t,e,n){r(i)&&(i=Pt(i)[0]);var a=ha(i||{}).get,s=e?sa:ra;return"native"===e&&(e=""),i?t?s((mt[t]&&mt[t].get||a)(i,t,e,n)):function(t,e,r){return s((mt[t]&&mt[t].get||a)(i,t,e,r))}:i},quickSetter:function quickSetter(r,e,i){if(1<(r=Pt(r)).length){var n=r.map(function(t){return Fe.quickSetter(t,e,i)}),a=n.length;return function(t){for(var e=a;e--;)n[e](t)}}r=r[0]||{};var s=mt[e],o=ha(r),u=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(t){var e=new s;d._pt=0,e.init(r,i?t+i:t,d,0,[r]),e.render(1,e),d._pt&&ve(1,d)}:o.set(r,u);return s?h:function(t){return h(r,u,i?t+i:t,o,1)}},quickTo:function quickTo(t,i,e){function by(t,e,r){return n.resetTo(i,t,e,r)}var r,n=Fe.to(t,ta(((r={})[i]="+=0.1",r.paused=!0,r.stagger=0,r),e||{}));return by.tween=n,by},isTweening:function isTweening(t){return 0<L.getTweensOf(t,!0).length},defaults:function defaults(t){return t&&t.ease&&(t.ease=Vt(t.ease,j.ease)),wa(j,t||{})},config:function config(t){return wa(N,t||{})},registerEffect:function registerEffect(t){var i=t.name,n=t.effect,e=t.plugins,a=t.defaults,r=t.extendTimeline;(e||"").split(",").forEach(function(t){return t&&!mt[t]&&!ht[t]&&T(i+" effect requires "+t+" plugin.")}),gt[i]=function(t,e,r){return n(Pt(t),ta(e||{},a),r)},r&&(Zt.prototype[i]=function(t,e,r){return this.add(gt[i](t,v(e)?e:(r=e)&&{},this),r)})},registerEase:function registerEase(t,e){Bt[t]=Vt(e)},parseEase:function parseEase(t,e){return arguments.length?Vt(t,e):Bt},getById:function getById(t){return L.getById(t)},exportRoot:function exportRoot(t,e){void 0===t&&(t={});var r,i,n=new Zt(t);for(n.smoothChildTiming=w(t.smoothChildTiming),L.remove(n),n._dp=0,n._time=n._tTime=L._time,r=L._first;r;)i=r._next,!e&&!r._dur&&r instanceof te&&r.vars.onComplete===r._targets[0]||Na(n,r,r._start-r._delay),r=i;return Na(L,n,0),n},context:function context(t,e){return t?new De(t,e):l},matchMedia:function matchMedia(t){return new Ee(t)},matchMediaRefresh:function matchMediaRefresh(){return ke.forEach(function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()})||Ic()},addEventListener:function addEventListener(t,e){var r=Oe[t]||(Oe[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function removeEventListener(t,e){var r=Oe[t],i=r&&r.indexOf(e);0<=i&&r.splice(i,1)},utils:{wrap:function wrap(e,t,r){var i=t-e;return $(e)?ob(e,wrap(0,e.length),t):Za(r,function(t){return(i+(t-e)%i)%i+e})},wrapYoyo:function wrapYoyo(e,t,r){var i=t-e,n=2*i;return $(e)?ob(e,wrapYoyo(0,e.length-1),t):Za(r,function(t){return e+(i<(t=(n+(t-e)%n)%n||0)?n-t:t)})},distribute:hb,random:kb,snap:jb,normalize:function normalize(t,e,r){return At(t,e,0,1,r)},getUnit:_a,clamp:function clamp(e,r,t){return Za(t,function(t){return Mt(e,r,t)})},splitColor:Db,toArray:Pt,selector:fb,mapRange:At,pipe:function pipe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function unitize(e,r){return function(t){return e(parseFloat(t))+(r||_a(t))}},interpolate:function interpolate(e,i,t,n){var a=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!a){var s,o,u,h,l,f=r(e),d={};if(!0===t&&(n=1)&&(t=null),f)e={p:e},i={p:i};else if($(e)&&!$(i)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(interpolate(e[o-1],e[o]));h--,a=function func(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},t=i}else n||(e=bt($(e)?[]:{},e));if(!u){for(s in i)Jt.call(d,e,s,"get",i[s]);a=function func(t){return ve(t,d)||(f?e.p:e)}}}return Za(t,a)},shuffle:gb},install:R,effects:gt,ticker:It,updateRoot:Zt.updateRoot,plugins:mt,globalTimeline:L,core:{PropTween:we,globals:U,Tween:te,Timeline:Zt,Animation:qt,getCache:ha,_removeLinkedListItem:Ba,reverting:function reverting(){return I},context:function context(t){return t&&l&&(l.data.push(t),t._ctx=l),l},suppressOverwrites:function suppressOverwrites(t){return F=t}}};ja("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Re[t]=te[t]}),It.add(Zt.updateRoot),d=Re.to({},{duration:0});function Mc(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}function Oc(t,a){return{name:t,headless:1,rawVars:1,init:function init(t,n,e){e._onInit=function(t){var e,i;if(r(n)&&(e={},ja(n,function(t){return e[t]=1}),n=e),a){for(i in e={},n)e[i]=a(n[i]);n=e}!function _addModifiers(t,e){var r,i,n,a=t._targets;for(r in e)for(i=a.length;i--;)(n=(n=t._ptLookup[i][r])&&n.d)&&(n._pt&&(n=Mc(n,r)),n&&n.modifier&&n.modifier(e[r],t,a[i],r))}(t,n)}}}}var Fe=Re.registerPlugin({name:"attr",init:function init(t,e,r,i,n){var a,s,o;for(a in this.tween=r,e)o=t.getAttribute(a)||"",(s=this.add(t,"setAttribute",(o||0)+"",e[a],i,n,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function render(t,e){for(var r=e._pt;r;)I?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function init(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},Oc("roundProps",ib),Oc("modifiers"),Oc("snap",jb))||Re;te.version=Zt.version=Fe.version="3.14.2",o=1,x()&&Lt();function yd(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function zd(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function Ad(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Bd(t,e){return e.set(e.t,e.p,1===t?e.e:t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Cd(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)}function Dd(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function Ed(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function Fd(t,e,r){return t.style[e]=r}function Gd(t,e,r){return t.style.setProperty(e,r)}function Hd(t,e,r){return t._gsap[e]=r}function Id(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function Jd(t,e,r,i,n){var a=t._gsap;a.scaleX=a.scaleY=r,a.renderTransform(n,a)}function Kd(t,e,r,i,n){var a=t._gsap;a[e]=r,a.renderTransform(n,a)}function Nd(t,e){var r=this,i=this.target,n=i.style,a=i._gsap;if(t in hr&&n){if(this.tfm=this.tfm||{},"transform"===t)return mr.transform.split(",").forEach(function(t){return Nd.call(r,t,e)});if(~(t=mr[t]||t).indexOf(",")?t.split(",").forEach(function(t){return r.tfm[t]=xr(i,t)}):this.tfm[t]=a.x?a[t]:xr(i,t),t===vr&&(this.tfm.zOrigin=a.zOrigin),0<=this.props.indexOf(gr))return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(vr,e,"")),t=gr}(n||e)&&this.props.push(t,e,n[t])}function Od(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))}function Pd(){var t,e,r=this.props,i=this.target,n=i.style,a=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?i[r[t]](r[t+2]):i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(cr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)a[e]=this.tfm[e];a.svg&&(a.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=Ue())&&t.isStart||n[gr]||(Od(n),a.zOrigin&&n[vr]&&(n[vr]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}}function Qd(t,e){var r={target:t,props:[],revert:Pd,save:Nd};return t._gsap||Fe.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(t){return r.save(t)}),r}function Sd(t,e){var r=Le.createElementNS?Le.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Le.createElement(t);return r&&r.style?r:Le.createElement(t)}function Td(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(cr,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&Td(t,Tr(e)||e,1)||""}function Wd(){(function _windowExists(){return"undefined"!=typeof window})()&&window.document&&(Ie=window,Le=Ie.document,Ye=Le.documentElement,je=Sd("div")||{style:{}},Sd("div"),gr=Tr(gr),vr=gr+"Origin",je.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Xe=!!Tr("perspective"),Ue=Fe.core.reverting,Ne=1)}function Xd(t){var e,r=t.ownerSVGElement,i=Sd("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0);n.style.display="block",i.appendChild(n),Ye.appendChild(i);try{e=n.getBBox()}catch(t){}return i.removeChild(n),Ye.removeChild(i),e}function Yd(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function Zd(e){var r,i;try{r=e.getBBox()}catch(t){r=Xd(e),i=1}return r&&(r.width||r.height)||i||(r=Xd(e)),!r||r.width||r.x||r.y?r:{x:+Yd(e,["x","cx","x1"])||0,y:+Yd(e,["y","cy","y1"])||0,width:0,height:0}}function $d(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Zd(t))}function _d(t,e){if(e){var r,i=t.style;e in hr&&e!==vr&&(e=gr),i.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty("--"===r?e:e.replace(cr,"-$1").toLowerCase())):i.removeAttribute(e)}}function ae(t,e,r,i,n,a){var s=new we(t._pt,e,r,0,1,a?Ed:Dd);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function de(t,e,r,i){var n,a,s,o,u=parseFloat(r)||0,h=(r+"").trim().substr((u+"").length)||"px",l=je.style,f=pr.test(e),d="svg"===t.tagName.toLowerCase(),c=(d?"client":"offset")+(f?"Width":"Height"),p="px"===i,_="%"===i;if(i===h||!u||br[i]||br[h])return u;if("px"===h||p||(u=de(t,e,r,"px")),o=t.getCTM&&$d(t),(_||"%"===h)&&(hr[e]||~e.indexOf("adius")))return n=o?t.getBBox()[f?"width":"height"]:t[c],ka(_?u/n*100:u/100*n);if(l[f?"width":"height"]=100+(p?h:i),a="rem"!==i&&~e.indexOf("adius")||"em"===i&&t.appendChild&&!d?t:t.parentNode,o&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==Le&&a.appendChild||(a=Le.body),(s=a._gsap)&&_&&s.width&&f&&s.time===It.time&&!s.uncache)return ka(u/s.width*100);if(!_||"height"!==e&&"width"!==e)!_&&"%"!==h||wr[Td(a,"display")]||(l.position=Td(t,"position")),a===t&&(l.position="static"),a.appendChild(je),n=je[c],a.removeChild(je),l.position="absolute";else{var m=t.style[e];t.style[e]=100+i,n=t[c],m?t.style[e]=m:_d(t,e)}return f&&_&&((s=ha(a)).time=It.time,s.width=a[c]),ka(p?n*u/100:n&&u?100/n*u:0)}function fe(t,e,r,i){if(!r||"none"===r){var n=Tr(e,t,1),a=n&&Td(t,n,1);a&&a!==r?(e=n,r=a):"borderColor"===e&&(r=Td(t,"borderTopColor"))}var s,o,u,h,l,f,d,c,p,_,m,g=new we(this._pt,t.style,e,0,1,ge),v=0,y=0;if(g.b=r,g.e=i,r+="","var(--"===(i+="").substring(0,6)&&(i=Td(t,i.substring(4,i.indexOf(")")))),"auto"===i&&(f=t.style[e],t.style[e]=i,i=Td(t,e)||i,f?t.style[e]=f:_d(t,e)),Ib(s=[r,i]),i=s[1],u=(r=s[0]).match(nt)||[],(i.match(nt)||[]).length){for(;o=nt.exec(i);)d=o[0],p=i.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),d!==(f=u[y++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),"="===d.charAt(1)&&(d=ma(h,d)+m),c=parseFloat(d),_=d.substr((c+"").length),v=nt.lastIndex-_.length,_||(_=_||N.units[e]||m,v===i.length&&(i+=_,g.e+=_)),m!==_&&(h=de(t,e,f,_)||0),g._pt={_next:g._pt,p:p||1===y?p:",",s:h,c:c-h,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=v<i.length?i.substring(v,i.length):""}else g.r="display"===e&&"none"===i?Ed:Dd;return st.test(i)&&(g.e=0),this._pt=g}function he(t){var e=t.split(" "),r=e[0],i=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==i&&"right"!==i||(t=r,r=i,i=t),e[0]=kr[r]||r,e[1]=kr[i]||i,e.join(" ")}function ie(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,a=e.t,s=a.style,o=e.u,u=a._gsap;if("all"===o||!0===o)s.cssText="",i=1;else for(n=(o=o.split(",")).length;-1<--n;)r=o[n],hr[r]&&(i=1,r="transformOrigin"===r?vr:gr),_d(a,r);i&&(_d(a,gr),u&&(u.svg&&a.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Pr(a,1),u.uncache=1,Od(s)))}}function me(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function ne(t){var e=Td(t,gr);return me(e)?Mr:e.substr(7).match(it).map(ka)}function oe(t,e){var r,i,n,a,s=t._gsap||ha(t),o=t.style,u=ne(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?Mr:u:(u!==Mr||t.offsetParent||t===Ye||s.svg||(n=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(a=1,i=t.nextElementSibling,Ye.appendChild(t)),u=ne(t),n?o.display=n:_d(t,"display"),a&&(i?r.insertBefore(t,i):r?r.appendChild(t):Ye.removeChild(t))),e&&6<u.length?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)}function pe(t,e,r,i,n,a){var s,o,u,h=t._gsap,l=n||oe(t,!0),f=h.xOrigin||0,d=h.yOrigin||0,c=h.xOffset||0,p=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],T=l[5],b=e.split(" "),w=parseFloat(b[0])||0,x=parseFloat(b[1])||0;r?l!==Mr&&(o=_*v-m*g)&&(u=w*(-m/o)+x*(_/o)-(_*T-m*y)/o,w=w*(v/o)+x*(-g/o)+(g*T-v*y)/o,x=u):(w=(s=Zd(t)).x+(~b[0].indexOf("%")?w/100*s.width:w),x=s.y+(~(b[1]||b[0]).indexOf("%")?x/100*s.height:x)),i||!1!==i&&h.smooth?(y=w-f,T=x-d,h.xOffset=c+(y*_+T*g)-y,h.yOffset=p+(y*m+T*v)-T):h.xOffset=h.yOffset=0,h.xOrigin=w,h.yOrigin=x,h.smooth=!!i,h.origin=e,h.originIsAbsolute=!!r,t.style[vr]="0px 0px",a&&(ae(a,h,"xOrigin",f,w),ae(a,h,"yOrigin",d,x),ae(a,h,"xOffset",c,h.xOffset),ae(a,h,"yOffset",p,h.yOffset)),t.setAttribute("data-svg-origin",w+" "+x)}function se(t,e,r){var i=_a(e);return ka(parseFloat(e)+parseFloat(de(t,"x",r+"px",i)))+i}function ze(t,e,i,n,a){var s,o,u=360,h=r(a),l=parseFloat(a)*(h&&~a.indexOf("rad")?lr:1)-n,f=n+l+"deg";return h&&("short"===(s=a.split("_")[1])&&(l%=u)!==l%180&&(l+=l<0?u:-u),"cw"===s&&l<0?l=(l+36e9)%u-~~(l/u)*u:"ccw"===s&&0<l&&(l=(l-36e9)%u-~~(l/u)*u)),t._pt=o=new we(t._pt,e,i,n,l,zd),o.e=f,o.u="deg",t._props.push(i),o}function Ae(t,e){for(var r in e)t[r]=e[r];return t}function Be(t,e,r){var i,n,a,s,o,u,h,l=Ae({},r._gsap),f=r.style;for(n in l.svg?(a=r.getAttribute("transform"),r.setAttribute("transform",""),f[gr]=e,i=Pr(r,1),_d(r,gr),r.setAttribute("transform",a)):(a=getComputedStyle(r)[gr],f[gr]=e,i=Pr(r,1),f[gr]=a),hr)(a=l[n])!==(s=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=_a(a)!==(h=_a(s))?de(r,n,a,h):parseFloat(a),u=parseFloat(s),t._pt=new we(t._pt,i,n,o,u-o,yd),t._pt.u=h||0,t._props.push(n));Ae(i,l)}var Ie,Le,Ye,Ne,je,Ve,Ue,Xe,qe=Bt.Power0,Ze=Bt.Power1,We=Bt.Power2,He=Bt.Power3,Je=Bt.Power4,Qe=Bt.Linear,Ge=Bt.Quad,Ke=Bt.Cubic,$e=Bt.Quart,tr=Bt.Quint,er=Bt.Strong,rr=Bt.Elastic,ir=Bt.Back,nr=Bt.SteppedEase,ar=Bt.Bounce,sr=Bt.Sine,or=Bt.Expo,ur=Bt.Circ,hr={},lr=180/Math.PI,fr=Math.PI/180,dr=Math.atan2,cr=/([A-Z])/g,pr=/(left|right|width|margin|padding|x)/i,_r=/[\s,\(]\S/,mr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},gr="transform",vr=gr+"Origin",yr="O,Moz,ms,Ms,Webkit".split(","),Tr=function _checkPropPrefix(t,e,r){var i=(e||je).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(yr[n]+t in i););return n<0?null:(3===n?"ms":0<=n?yr[n]:"")+t},br={deg:1,rad:1,turn:1},wr={grid:1,flex:1},xr=function _get(t,e,r,i){var n;return Ne||Wd(),e in mr&&"transform"!==e&&~(e=mr[e]).indexOf(",")&&(e=e.split(",")[0]),hr[e]&&"transform"!==e?(n=Pr(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Ar(Td(t,vr))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=Or[e]&&Or[e](t,e,r)||Td(t,e)||ia(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?de(t,e,n,r)+r:n},kr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Or={clearProps:function clearProps(t,e,r,i,n){if("isFromStart"!==n.data){var a=t._pt=new we(t._pt,e,r,0,0,ie);return a.u=i,a.pr=-10,a.tween=n,t._props.push(r),1}}},Mr=[1,0,0,1,0,0],Cr={},Pr=function _parseTransform(t,e){var r=t._gsap||new Xt(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,a,s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x,k,O,M,C,P,A,D,S,z,E,R,F=t.style,I=r.scaleX<0,L="deg",B=getComputedStyle(t),Y=Td(t,vr)||"0";return i=n=a=u=h=l=f=d=c=0,s=o=1,r.svg=!(!t.getCTM||!$d(t)),B.translate&&("none"===B.translate&&"none"===B.scale&&"none"===B.rotate||(F[gr]=("none"!==B.translate?"translate3d("+(B.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==B.rotate?"rotate("+B.rotate+") ":"")+("none"!==B.scale?"scale("+B.scale.split(" ").join(",")+") ":"")+("none"!==B[gr]?B[gr]:"")),F.scale=F.rotate=F.translate="none"),m=oe(t,r.svg),r.svg&&(M=r.uncache?(C=t.getBBox(),Y=r.xOrigin-C.x+"px "+(r.yOrigin-C.y)+"px",""):!e&&t.getAttribute("data-svg-origin"),pe(t,M||Y,!!M||r.originIsAbsolute,!1!==r.smooth,m)),p=r.xOrigin||0,_=r.yOrigin||0,m!==Mr&&(T=m[0],b=m[1],w=m[2],x=m[3],i=k=m[4],n=O=m[5],6===m.length?(s=Math.sqrt(T*T+b*b),o=Math.sqrt(x*x+w*w),u=T||b?dr(b,T)*lr:0,(f=w||x?dr(w,x)*lr+u:0)&&(o*=Math.abs(Math.cos(f*fr))),r.svg&&(i-=p-(p*T+_*w),n-=_-(p*b+_*x))):(R=m[6],z=m[7],A=m[8],D=m[9],S=m[10],E=m[11],i=m[12],n=m[13],a=m[14],h=(g=dr(R,S))*lr,g&&(M=k*(v=Math.cos(-g))+A*(y=Math.sin(-g)),C=O*v+D*y,P=R*v+S*y,A=k*-y+A*v,D=O*-y+D*v,S=R*-y+S*v,E=z*-y+E*v,k=M,O=C,R=P),l=(g=dr(-w,S))*lr,g&&(v=Math.cos(-g),E=x*(y=Math.sin(-g))+E*v,T=M=T*v-A*y,b=C=b*v-D*y,w=P=w*v-S*y),u=(g=dr(b,T))*lr,g&&(M=T*(v=Math.cos(g))+b*(y=Math.sin(g)),C=k*v+O*y,b=b*v-T*y,O=O*v-k*y,T=M,k=C),h&&359.9<Math.abs(h)+Math.abs(u)&&(h=u=0,l=180-l),s=ka(Math.sqrt(T*T+b*b+w*w)),o=ka(Math.sqrt(O*O+R*R)),g=dr(k,O),f=2e-4<Math.abs(g)?g*lr:0,c=E?1/(E<0?-E:E):0),r.svg&&(M=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!me(Td(t,gr)),M&&t.setAttribute("transform",M))),90<Math.abs(f)&&Math.abs(f)<270&&(I?(s*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+"px",r.y=n-((r.yPercent=n&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+"px",r.z=a+"px",r.scaleX=ka(s),r.scaleY=ka(o),r.rotation=ka(u)+L,r.rotationX=ka(h)+L,r.rotationY=ka(l)+L,r.skewX=f+L,r.skewY=d+L,r.transformPerspective=c+"px",(r.zOrigin=parseFloat(Y.split(" ")[2])||!e&&r.zOrigin||0)&&(F[vr]=Ar(Y)),r.xOffset=r.yOffset=0,r.force3D=N.force3D,r.renderTransform=r.svg?Fr:Xe?Rr:Dr,r.uncache=0,r},Ar=function _firstTwoOnly(t){return(t=t.split(" "))[0]+" "+t[1]},Dr=function _renderNon3DTransforms(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Rr(t,e)},Sr="0deg",zr="0px",Er=") ",Rr=function _renderCSSTransforms(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,a=r.x,s=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,d=r.skewY,c=r.scaleX,p=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",T="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==Sr||h!==Sr)){var b,w=parseFloat(h)*fr,x=Math.sin(w),k=Math.cos(w);w=parseFloat(l)*fr,b=Math.cos(w),a=se(g,a,x*b*-v),s=se(g,s,-Math.sin(w)*-v),o=se(g,o,k*b*-v+v)}_!==zr&&(y+="perspective("+_+Er),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!T&&a===zr&&s===zr&&o===zr||(y+=o!==zr||T?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+Er),u!==Sr&&(y+="rotate("+u+Er),h!==Sr&&(y+="rotateY("+h+Er),l!==Sr&&(y+="rotateX("+l+Er),f===Sr&&d===Sr||(y+="skew("+f+", "+d+Er),1===c&&1===p||(y+="scale("+c+", "+p+Er),g.style[gr]=y||"translate(0, 0)"},Fr=function _renderSVGTransforms(t,e){var r,i,n,a,s,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,d=o.rotation,c=o.skewX,p=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,b=o.yOffset,w=o.forceCSS,x=parseFloat(l),k=parseFloat(f);d=parseFloat(d),c=parseFloat(c),(p=parseFloat(p))&&(c+=p=parseFloat(p),d+=p),d||c?(d*=fr,c*=fr,r=Math.cos(d)*_,i=Math.sin(d)*_,n=Math.sin(d-c)*-m,a=Math.cos(d-c)*m,c&&(p*=fr,s=Math.tan(c-p),n*=s=Math.sqrt(1+s*s),a*=s,p&&(s=Math.tan(p),r*=s=Math.sqrt(1+s*s),i*=s)),r=ka(r),i=ka(i),n=ka(n),a=ka(a)):(r=_,a=m,i=n=0),(x&&!~(l+"").indexOf("px")||k&&!~(f+"").indexOf("px"))&&(x=de(g,"x",l,"px"),k=de(g,"y",f,"px")),(v||y||T||b)&&(x=ka(x+v-(v*r+y*n)+T),k=ka(k+y-(v*i+y*a)+b)),(u||h)&&(s=g.getBBox(),x=ka(x+u/100*s.width),k=ka(k+h/100*s.height)),s="matrix("+r+","+i+","+n+","+a+","+x+","+k+")",g.setAttribute("transform",s),w&&(g.style[gr]=s)};ja("padding,margin,Width,Radius",function(e,r){var t="Right",i="Bottom",n="Left",o=(r<3?["Top",t,i,n]:["Top"+n,"Top"+t,i+t,i+n]).map(function(t){return r<2?e+t:"border"+t+e});Or[1<r?"border"+e:e]=function(e,t,r,i,n){var a,s;if(arguments.length<4)return a=o.map(function(t){return xr(e,t,r)}),5===(s=a.join(" ")).split(a[0]).length?a[0]:s;a=(i+"").split(" "),s={},o.forEach(function(t,e){return s[t]=a[e]=a[e]||a[(e-1)/2|0]}),e.init(t,s,n)}});var Ir,Lr,Br,Yr={name:"css",register:Wd,targetTest:function targetTest(t){return t.style&&t.nodeType},init:function init(t,e,i,n,a){var s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x=this._props,k=t.style,O=i.vars.startAt;for(d in Ne||Wd(),this.styles=this.styles||Qd(t),b=this.styles.props,this.tween=i,e)if("autoRound"!==d&&(o=e[d],!mt[d]||!dc(d,e,i,n,t,a)))if(l=typeof o,f=Or[d],"function"===l&&(l=typeof(o=o.call(i,n,t,a))),"string"===l&&~o.indexOf("random(")&&(o=rb(o)),f)f(this,t,d,o,i)&&(T=1);else if("--"===d.substr(0,2))s=(getComputedStyle(t).getPropertyValue(d)+"").trim(),o+="",Rt.lastIndex=0,Rt.test(s)||(c=_a(s),(p=_a(o))?c!==p&&(s=de(t,d,s,p)+p):c&&(o+=c)),this.add(k,"setProperty",s,o,n,a,0,0,d),x.push(d),b.push(d,0,k[d]);else if("undefined"!==l){if(O&&d in O?(s="function"==typeof O[d]?O[d].call(i,n,t,a):O[d],r(s)&&~s.indexOf("random(")&&(s=rb(s)),_a(s+"")||"auto"===s||(s+=N.units[d]||_a(xr(t,d))||""),"="===(s+"").charAt(1)&&(s=xr(t,d))):s=xr(t,d),h=parseFloat(s),(_="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),u=parseFloat(o),d in mr&&("autoAlpha"===d&&(1===h&&"hidden"===xr(t,"visibility")&&u&&(h=0),b.push("visibility",0,k.visibility),ae(this,k,"visibility",h?"inherit":"hidden",u?"inherit":"hidden",!u)),"scale"!==d&&"transform"!==d&&~(d=mr[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in hr){if(this.styles.save(d),w=o,"string"===l&&"var(--"===o.substring(0,6)){if("calc("===(o=Td(t,o.substring(4,o.indexOf(")")))).substring(0,5)){var M=t.style.perspective;t.style.perspective=o,o=Td(t,"perspective"),M?t.style.perspective=M:_d(t,"perspective")}u=parseFloat(o)}if(g||((v=t._gsap).renderTransform&&!e.parseTransform||Pr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new we(this._pt,k,gr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new we(this._pt,v,"scaleY",v.scaleY,(_?ma(v.scaleY,_+u):u)-v.scaleY||0,yd),this._pt.u=0,x.push("scaleY",d),d+="X";else{if("transformOrigin"===d){b.push(vr,0,k[vr]),o=he(o),v.svg?pe(t,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&ae(this,v,"zOrigin",v.zOrigin,p),ae(this,k,d,Ar(s),Ar(o)));continue}if("svgOrigin"===d){pe(t,o,1,y,0,this);continue}if(d in Cr){ze(this,v,d,h,_?ma(h,_+o):o);continue}if("smoothOrigin"===d){ae(this,v,"smooth",v.smooth,o);continue}if("force3D"===d){v[d]=o;continue}if("transform"===d){Be(this,o,t);continue}}}else d in k||(d=Tr(d)||d);if(m||(u||0===u)&&(h||0===h)&&!_r.test(o)&&d in k)u=u||0,(c=(s+"").substr((h+"").length))!==(p=_a(o)||(d in N.units?N.units[d]:c))&&(h=de(t,d,s,p)),this._pt=new we(this._pt,m?v:k,d,h,(_?ma(h,_+u):u)-h,m||"px"!==p&&"zIndex"!==d||!1===e.autoRound?yd:Cd),this._pt.u=p||0,m&&w!==o?(this._pt.b=s,this._pt.e=w,this._pt.r=Bd):c!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=Ad);else if(d in k)fe.call(this,t,d,s,_?_+o:o);else if(d in t)this.add(t,d,s||t[d],_?_+o:o,n,a);else if("parseTransform"!==d){S(d,o);continue}m||(d in k?b.push(d,0,k[d]):"function"==typeof t[d]?b.push(d,2,t[d]()):b.push(d,1,s||t[d])),x.push(d)}T&&be(this)},render:function render(t,e){if(e.tween._time||!Ue())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:xr,aliases:mr,getSetter:function getSetter(t,e,r){var i=mr[e];return i&&i.indexOf(",")<0&&(e=i),e in hr&&e!==vr&&(t._gsap.x||xr(t,"x"))?r&&Ve===r?"scale"===e?Id:Hd:(Ve=r||{})&&("scale"===e?Jd:Kd):t.style&&!u(t.style[e])?Fd:~e.indexOf("-")?Gd:le(t,e)},core:{_removeProperty:_d,_getMatrix:oe}};Fe.utils.checkPrefix=Tr,Fe.core.getStyleSaver=Qd,Br=ja((Ir="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Lr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){hr[t]=1}),ja(Lr,function(t){N.units[t]="deg",Cr[t]=1}),mr[Br[13]]=Ir+","+Lr,ja("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");mr[e[1]]=Br[e[0]]}),ja("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){N.units[t]="px"}),Fe.registerPlugin(Yr);var Nr=Fe.registerPlugin(Yr)||Fe,jr=Nr.core.Tween;e.Back=ir,e.Bounce=ar,e.CSSPlugin=Yr,e.Circ=ur,e.Cubic=Ke,e.Elastic=rr,e.Expo=or,e.Linear=Qe,e.Power0=qe,e.Power1=Ze,e.Power2=We,e.Power3=He,e.Power4=Je,e.Quad=Ge,e.Quart=$e,e.Quint=tr,e.Sine=sr,e.SteppedEase=nr,e.Strong=er,e.TimelineLite=Zt,e.TimelineMax=Zt,e.TweenLite=te,e.TweenMax=jr,e.default=Nr,e.gsap=Nr;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});
+
diff --git a/assets/riso.css b/assets/riso.css
new file mode 100644
index 0000000..e3f6b31
--- /dev/null
+++ b/assets/riso.css
@@ -0,0 +1,114 @@
+/* ==============================================================
+ RISO B-ROLL · 孔版双色信息动画 · 样式系统
+ 纸 + 两种专色油墨(A 深墨 / B 荧光)+ 叠印 + 套印错位 + 网点
+ 画布 1080×1920。所有颜色只来自 --paper / --a / --b 三个变量。
+ ============================================================== */
+
+/* ── 色本:一个视频功能段锁一组 ─────────────────────────── */
+:root,
+.pal-blue { --paper:#F3EEE4; --a:#22308C; --b:#FF4C97; } /* 墨蓝 × 荧光粉(默认)*/
+.pal-teal { --paper:#F1EDE3; --a:#0C4A4C; --b:#FF6A2A; } /* 深青 × 橙 */
+.pal-ink { --paper:#EEEAE1; --a:#1B1B1B; --b:#FFC21A; } /* 墨黑 × 明黄 */
+.pal-red { --paper:#F2ECE2; --a:#1C2A4E; --b:#F0433A; } /* 藏青 × 朱红 */
+
+:root{
+ /* 套印错位:B 版相对 A 版的偏移。动效 register() 会让它从大偏移“咔”地归位到这里 */
+ --rx: 3px; --ry: -2px;
+
+ /* 字体全部随 skill 分发(assets/fonts/,见下方 @font-face):任何系统渲出来都一样。
+ 中文只含 GB2312 常用字,生僻字才会落到后面的系统字体 */
+ --serif: "Riso Serif", "Songti SC", "Noto Serif SC", serif; /* 标题:思源宋体 Heavy */
+ --sans: "Riso Sans", "PingFang SC", "Noto Sans SC", sans-serif; /* 标签:思源黑体 SemiBold */
+ --num: "Riso Num", "Riso Sans", sans-serif; /* 数字:Oswald Bold */
+ --mono: "Riso Mono", "Riso Sans", monospace; /* 编号:JetBrains Mono(中文落到 Riso Sans)*/
+
+ --gutter: 72px; /* 左右版心边距。安全区(顶栏 / 字幕床 / 按钮栏)的数字只在 riso.js 的 ZONE 里 */
+}
+
+/* 每个字体只有一个字重;声明成整段字重范围,任何 font-weight 都用这一份,浏览器不会再合成假粗体 */
+@font-face{ font-family:"Riso Serif"; src:url("fonts/riso-serif.woff2") format("woff2"); font-weight:100 900; font-display:block }
+@font-face{ font-family:"Riso Sans"; src:url("fonts/riso-sans.woff2") format("woff2"); font-weight:100 900; font-display:block }
+@font-face{ font-family:"Riso Num"; src:url("fonts/riso-num.woff2") format("woff2"); font-weight:100 900; font-display:block }
+@font-face{ font-family:"Riso Mono"; src:url("fonts/riso-mono.woff2") format("woff2"); font-weight:100 900; font-display:block }
+
+*{ box-sizing:border-box }
+html, body{ margin:0; width:1080px; height:1920px; overflow:hidden; background:var(--paper) }
+body{ color:var(--a); font-family:var(--sans); font-synthesis:none; -webkit-font-smoothing:antialiased; text-rendering:geometricPrecision }
+
+#frame{ position:relative; width:1080px; height:1920px; overflow:hidden; background:var(--paper) }
+#stage{ position:absolute; inset:0; transform-origin:50% 15%; background:var(--paper) }
+#frame > *, #stage > *{ position:absolute }
+
+/* 透明导出(render --alpha):纸被拿掉,只剩油墨 */
+.alpha, .alpha body, .alpha #frame, .alpha #stage{ background:transparent !important }
+.alpha .fiber, .alpha .press{ display:none }
+
+/* ── 油墨 ─────────────────────────────────────────────── */
+/* A 版:深墨,承担所有可读文字与结构线 */
+.a { color:var(--a); mix-blend-mode:multiply }
+.fill-a { background:var(--a) }
+/* B 版:荧光点色。正片叠底 + 整版统一错位 —— 和 A 重叠处自动出现第三色 */
+.b { color:var(--b); mix-blend-mode:multiply; translate:var(--rx) var(--ry) }
+.fill-b { background:var(--b); mix-blend-mode:multiply; translate:var(--rx) var(--ry) }
+.line-a { border-color:var(--a) }
+
+/* 满版墨底帧(钩子 / 金句 / 高潮用):纸色反白字,B 不再叠底 */
+#frame.flood, .flood #stage{ background:var(--a) }
+.flood .a, .flood{ color:var(--paper) }
+.flood .fill-a{ background:var(--paper) }
+.flood .a, .flood .b, .flood .fill-b{ mix-blend-mode:normal }
+
+/* ── 纸与印刷质感(压在最上层,不参与版面)────────────── */
+.fiber{ inset:0; pointer-events:none; opacity:.26; mix-blend-mode:multiply; z-index:50;
+ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .31 0 0 0 0 .24 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23n)'/%3E%3C/svg%3E");
+ background-size:360px 360px }
+/* 油墨不匀:高频噪点以“滤色”提亮,墨块里出现孔版特有的斑驳。逐两帧换位 = 质感在呼吸 */
+.press{ inset:-40px; pointer-events:none; opacity:.30; mix-blend-mode:screen; z-index:51;
+ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.6 -.78'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23p)'/%3E%3C/svg%3E");
+ background-size:240px 240px }
+
+/* ── 字 ───────────────────────────────────────────────── */
+.t{ white-space:nowrap } /* 所有文字元素都带 .t(QA 靠它找字)*/
+.hd{ font-family:var(--serif); font-weight:900; letter-spacing:-.02em; line-height:1.1 }
+.hd-xl{ font-size:156px } .hd-l{ font-size:118px } .hd-m{ font-size:88px } .hd-s{ font-size:64px }
+.num{ font-family:var(--num); font-weight:700; line-height:.78; letter-spacing:-.005em; font-variant-numeric:tabular-nums }
+.lb{ font-family:var(--sans); font-weight:600; font-size:42px; letter-spacing:.01em; line-height:1.25 }
+.mono{ font-family:var(--mono); font-weight:500; font-size:28px; letter-spacing:.16em; line-height:1 }
+
+/* 逐字拆分后的字符(Riso.split 生成)*/
+.ln{ display:block; overflow:hidden; padding:0 .04em .06em; margin:0 -.04em -.06em }
+.ch{ display:inline-block; will-change:transform }
+
+/* ── 版头:全系列签名 ────────────────────────────────── */
+.mast{ left:var(--gutter); right:var(--gutter); top:176px; height:58px; display:flex;
+ justify-content:space-between; align-items:flex-start; border-bottom:4px solid currentColor;
+ font:500 28px/1 var(--mono); letter-spacing:.16em; transform-origin:left center }
+.mast .tag{ display:flex; gap:18px; align-items:center }
+/* 版头色块是系列签名,固定不动:不参与 register() 的套印归位(用默认错位的固定值) */
+.mast .tag::before{ content:""; width:22px; height:22px; background:var(--b); mix-blend-mode:multiply;
+ translate:3px -2px }
+.flood .mast .tag::before{ mix-blend-mode:normal }
+
+/* ── 部件 ─────────────────────────────────────────────── */
+/* 荧光笔压条:放在字后面,B 版叠印 */
+.mark{ height:.46em; bottom:.02em; transform-origin:left center }
+/* 印章框 */
+.seal{ border:6px solid var(--b); mix-blend-mode:multiply; translate:var(--rx) var(--ry); border-radius:6px }
+/* 网点画布(Riso.halftone 绘制)*/
+canvas.tone{ pointer-events:none }
+/* 截图:双色调(暗部=A 墨,亮部=纸)*/
+.shot{ overflow:hidden; background:var(--a) }
+.shot img{ width:100%; height:100%; object-fit:cover; filter:grayscale(1) contrast(1.25) brightness(1.05); mix-blend-mode:screen }
+/* 截图占位:裁切标记 + 标注,不画任何假界面 */
+.slot{ border:3px dashed currentColor; opacity:.6; display:flex; align-items:center; justify-content:center;
+ font:500 30px/1 var(--mono); letter-spacing:.12em }
+
+/* 网点淡印:一块墨只印 25–35% 的点 = 孔版的“平网”。--td 控制点径 */
+.tint{ --td:3.1px;
+ -webkit-mask-image:radial-gradient(circle at 50% 50%, #000 var(--td), transparent calc(var(--td) + .7px));
+ -webkit-mask-size:11px 11px }
+
+/* 网点显影遮罩:--dot 从 0 长到 8px = 一层油墨被“印”出来 */
+.print{ --dot:0px;
+ -webkit-mask-image:radial-gradient(circle at 50% 50%, #000 var(--dot), transparent calc(var(--dot) + .7px));
+ -webkit-mask-size:11px 11px }
diff --git a/assets/riso.js b/assets/riso.js
new file mode 100644
index 0000000..1625e75
--- /dev/null
+++ b/assets/riso.js
@@ -0,0 +1,413 @@
+/* ==============================================================
+ RISO B-ROLL · 动效库 (依赖 gsap.min.js,先于本文件加载)
+
+ 一条 composition 的全部时间都在这里登记:画面 tween 和逐帧函数。
+ 渲染器只认 window.__riso,逐帧 seek,任意一帧都可复现。成片不带音轨。
+
+ Riso.comp({ duration: 4.5, seed: 3 }, C => {
+ C.camera(); // 慢推镜
+ C.count('#n', .2, { to: 1800 }); // 计数
+ C.stamp('#u', .9); // 盖章落位
+ });
+
+ 约定:所有时间参数都是“绝对秒”;helper 返回“落地时间”,可以接着串下一个动作。
+ ============================================================== */
+(function () {
+ 'use strict';
+
+ /* 画布与版面安全区:唯一来源。qa 的检查、叠层图、字幕床地层都读这里(经 __riso.meta().zone 传给 scripts/qa.mjs)
+ top 平台顶栏(搜索框 / 状态栏)以下才放字
+ bottom 以下是字幕床:只放网点地层等装饰
+ left / right 文字左右边界
+ rail 右侧按钮栏(点赞 / 评论 / 分享):x > rail.x 且 y 在 y0–y1 之间尽量不放字 */
+ const W = 1080, H = 1920;
+ const ZONE = { top: 168, bottom: 1330, left: 56, right: 1024, rail: { x: 930, y0: 880, y1: 1500 } };
+
+ const Q = new URLSearchParams(location.search);
+ const RENDER = Q.has('render');
+ const CALM = Q.has('calm'); // 静止纸纹、不推镜:只给压 GIF 用(每帧整屏都变的话 GIF 压不下去)
+ if (Q.has('alpha')) document.documentElement.classList.add('alpha');
+
+ /* 可复现随机:同一个 seed 永远同一个结果 */
+ function rng(seed) {
+ let a = (seed >>> 0) || 1;
+ return function () {
+ a = (a + 0x6D2B79F5) | 0;
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
+ };
+ }
+ const clamp01 = v => v < 0 ? 0 : v > 1 ? 1 : v;
+ const els = s => typeof s === 'string' ? [...document.querySelectorAll(s)] : (s && s.length != null ? [...s] : [s]);
+ const fmtThousands = v => Math.round(v).toLocaleString('en-US');
+
+ /* ── 文本:逐字拆分 + [重点] 标记 ──────────────────────────
+ Riso.text(el, '画面要跟着\n[你说的话]走')
+ → 每行一个 .ln(溢出裁切,用于升起),每字一个 .ch,[ ] 内的字带 .em */
+ function text(el, str) {
+ el = els(el)[0];
+ el.innerHTML = '';
+ let em = false;
+ for (const line of String(str).split('\n')) {
+ const ln = document.createElement('span');
+ ln.className = 'ln';
+ for (const c of line) {
+ if (c === '[') { em = true; continue; }
+ if (c === ']') { em = false; continue; }
+ const ch = document.createElement('span');
+ ch.className = em ? 'ch em' : 'ch';
+ ch.textContent = c === ' ' ? ' ' : c;
+ ln.appendChild(ch);
+ }
+ el.appendChild(ln);
+ }
+ return el;
+ }
+
+ /* 单行/多行自适应:从 max 字号往下缩,直到最宽的一行 ≤ width。缩到 min 仍放不下 → 标记给 QA */
+ function fit(el, { width, max, min = 28 }) {
+ el = els(el)[0];
+ let size = max;
+ el.style.fontSize = size + 'px';
+ while (el.scrollWidth > width && size > min) { size -= 2; el.style.fontSize = size + 'px'; }
+ if (el.scrollWidth > width) el.dataset.overflow = '1';
+ return size;
+ }
+
+ /* 模板公共开头:色本、满版墨底、版头文字(#m1 左「段号 · 主题词」/ #m2 右「序号」) */
+ function setup(D) {
+ document.body.className = D.palette || 'pal-blue';
+ if (D.flood) document.getElementById('frame').classList.add('flood');
+ const [left = '', right = ''] = D.mast || [];
+ document.getElementById('m1').textContent = left;
+ document.getElementById('m2').textContent = right;
+ }
+
+ /* 荧光压条:盖在 [重点] 字的下半截。text 是 Riso.text() 排过的容器;没有 [ ] 时隐藏压条、返回 false
+ (先排版、后调用:要量字的位置) */
+ function markUnder(mark, text, { pad = 8, top = .52, height = .4 } = {}) {
+ mark = els(mark)[0];
+ const ems = els(text)[0].querySelectorAll('.em');
+ if (!ems.length) { mark.style.display = 'none'; return false; }
+ const a = box(ems[0]), b = box(ems[ems.length - 1]);
+ Object.assign(mark.style, { left: a.left - pad + 'px', width: b.right - a.left + pad * 2 + 'px',
+ top: a.top + a.height * top + 'px', height: a.height * height + 'px' });
+ return true;
+ }
+
+ /* 字形墨迹框:Oswald 等数字字体的字形会超出行框,排版要按“墨迹”对齐而不是按盒子。
+ 返回 #stage 坐标系里的 {top, bottom, left, right}(单行元素;先排版、后建时间轴时调用) */
+ function inkBox(el) {
+ el = els(el)[0];
+ const cs = getComputedStyle(el), ctx = inkBox.ctx || (inkBox.ctx = document.createElement('canvas').getContext('2d'));
+ ctx.font = `${cs.fontWeight} ${cs.fontSize} ${cs.fontFamily}`;
+ const m = ctx.measureText(el.textContent);
+ const s = document.getElementById('stage').getBoundingClientRect(), r = el.getBoundingClientRect();
+ const fa = m.fontBoundingBoxAscent, fd = m.fontBoundingBoxDescent;
+ const base = r.top - s.top + (r.height - (fa + fd)) / 2 + fa, left = r.left - s.left;
+ return { top: base - m.actualBoundingBoxAscent, bottom: base + m.actualBoundingBoxDescent,
+ left: left - m.actualBoundingBoxLeft, right: left + m.actualBoundingBoxRight };
+ }
+ /* 元素在 #stage 坐标系里的盒子 */
+ function box(el) {
+ el = els(el)[0];
+ const s = document.getElementById('stage').getBoundingClientRect(), r = el.getBoundingClientRect();
+ return { top: r.top - s.top, bottom: r.bottom - s.top, left: r.left - s.left, right: r.right - s.left, width: r.width, height: r.height };
+ }
+
+ /* 网点画布:density(u, v, t) ∈ [0,1],u/v 是 0–1 的画布坐标。45° 网线角,点径 ∝ √密度 */
+ function halftone(canvas, { cell = 18, angle = 45, density }) {
+ canvas = els(canvas)[0];
+ const w = canvas.width = canvas.offsetWidth, h = canvas.height = canvas.offsetHeight;
+ const ctx = canvas.getContext('2d');
+ const color = getComputedStyle(canvas).color;
+ const a = angle * Math.PI / 180, ca = Math.cos(a), sa = Math.sin(a);
+ const R = Math.hypot(w, h), cx = w / 2, cy = h / 2, rmax = cell * 0.72;
+ return function draw(t) {
+ ctx.clearRect(0, 0, w, h);
+ ctx.fillStyle = color;
+ for (let i = -R / cell; i <= R / cell; i++) {
+ for (let j = -R / cell; j <= R / cell; j++) {
+ const x = cx + (i * ca - j * sa) * cell, y = cy + (i * sa + j * ca) * cell;
+ if (x < -cell || y < -cell || x > w + cell || y > h + cell) continue;
+ const d = density(x / w, y / h, t);
+ if (d <= 0.01) continue;
+ ctx.beginPath();
+ ctx.arc(x, y, rmax * Math.sqrt(Math.min(d, 1)), 0, Math.PI * 2);
+ ctx.fill();
+ }
+ }
+ };
+ }
+
+ /* ── composition ─────────────────────────────────────── */
+ function comp(o, build) {
+ const C = {
+ id: o.id || decodeURIComponent(location.pathname.split('/').pop().replace(/\.html$/, '')),
+ duration: o.duration || 5,
+ fps: o.fps || 30,
+ poster: o.poster == null ? null : o.poster, // 末帧海报时间,默认 = duration
+ tl: gsap.timeline({ paused: true, defaults: { ease: 'expo.out' } }),
+ fns: [], rand: rng(o.seed || 1),
+ };
+ const frame = document.getElementById('frame');
+ const stage = document.getElementById('stage');
+ const root = document.documentElement;
+
+ /* 逐帧函数:f(t) 在每次 seek 时调用(计数器、网点、质感呼吸都走这里,保证可复现) */
+ C.at = f => { C.fns.push(f); return C; };
+
+ /* 入场前不显示:元素在时刻 t 之前 visibility:hidden。第 0 帧只该有纸、纸纹和字幕床地层,
+ 其余元素都从自己的入场动作开始出现。同一元素登记多次时,按最早的入场时刻 */
+ C.hideUntil = (sel, t) => {
+ els(sel).forEach(el => {
+ if (el.__showAt == null) C.at(tt => { el.style.visibility = tt < el.__showAt ? 'hidden' : ''; });
+ el.__showAt = Math.min(el.__showAt ?? Infinity, t);
+ });
+ return C;
+ };
+
+ /* 慢推镜:整条匀速推进。B-roll 会被剪在任意一帧切入,匀速比缓入缓出更自然 */
+ C.camera = ({ push = 0.03, drift = 0 } = {}) => {
+ if (CALM) return C;
+ C.tl.fromTo(stage, { scale: 1, y: 0 }, { scale: 1 + push, y: drift, duration: C.duration, ease: 'none' }, 0);
+ return C;
+ };
+
+ /* 油墨呼吸:质感层逐两帧换位(12–15fps 的颗粒闪烁,静止段也是活的) */
+ C.boil = () => {
+ if (CALM) return C;
+ const press = frame.querySelector('.press');
+ C.at(t => {
+ const k = Math.floor(t * C.fps / 2), r = rng(k * 7919 + 17);
+ if (press) press.style.backgroundPosition = `${(r() * 240) | 0}px ${(r() * 240) | 0}px`;
+ });
+ return C;
+ };
+
+ /* 套印归位:B 版从大偏移跳 4 格回到正常错位 —— “咔”一下,两色对准 */
+ C.register = (t, { dx = 22, dy = -14 } = {}) => {
+ const f = 2 / C.fps;
+ const keys = [[dx, dy], [-6, 5], [7, -4], [1, 0], [3, -2]];
+ C.tl.set(root, { '--rx': dx + 'px', '--ry': dy + 'px' }, 0);
+ keys.forEach(([x, y], i) => C.tl.set(root, { '--rx': x + 'px', '--ry': y + 'px' }, t + i * f));
+ return t + 4 * f;
+ };
+
+ /* 网点显影:一层油墨从小点长成满版 */
+ C.print = (sel, t, { dur = .7, stagger = 0, ease = 'power2.inOut', to, from = 0 } = {}) => {
+ const list = els(sel);
+ list.forEach((el, i) => {
+ const t0 = t + i * stagger, t1 = t0 + dur;
+ if (t0 > 0) C.hideUntil(el, t0); // 点径为 0 时仍有一圈抗锯齿残影,入场前整个藏起来
+ if (to != null || el.classList.contains('tint')) { // 平网:长到指定点径后停住
+ C.tl.fromTo(el, { '--td': '0px' }, { '--td': (to ?? 3.1) + 'px', duration: dur, ease, immediateRender: true }, t0);
+ return;
+ }
+ el.classList.add('print');
+ C.tl.fromTo(el, { '--dot': from + 'px' }, { '--dot': '8.6px', duration: dur, ease, immediateRender: true }, t0);
+ C.at(tt => { el.style.webkitMaskImage = tt >= t1 ? 'none' : ''; });
+ });
+ return t + dur + stagger * (list.length - 1);
+ };
+
+ /* 逐字升起(配合 Riso.text)。sel 是文本容器 */
+ C.rise = (sel, t, { stagger = .034, dur = .62, y = 108 } = {}) => {
+ const chars = els(sel).flatMap(el => [...el.querySelectorAll('.ch')]);
+ C.tl.from(chars, { yPercent: y, duration: dur, stagger, ease: 'expo.out' }, t);
+ return t + dur * .6 + stagger * chars.length;
+ };
+
+ /* 盖章:从空中加速砸到纸面(power3.in),落地一瞬间镜头震 2 帧 */
+ C.stamp = (sel, t, { from = 1.55, rot = -5, dur = .17, shake = 5 } = {}) => {
+ const land = t + dur;
+ C.tl.fromTo(els(sel), { scale: from, rotation: rot, autoAlpha: 0 },
+ { scale: 1, rotation: 0, autoAlpha: 1, duration: dur, ease: 'power3.in', immediateRender: true }, t);
+ if (shake) C.shake(land, shake);
+ return land;
+ };
+
+ /* 镜头震:作用在 #frame,3 帧回正 */
+ C.shake = (t, a = 5) => {
+ const f = 1 / C.fps;
+ C.tl.set(frame, { x: a, y: -a * .7 }, t)
+ .set(frame, { x: -a * .55, y: a * .45 }, t + f)
+ .set(frame, { x: a * .2, y: 0 }, t + 2 * f)
+ .set(frame, { x: 0, y: 0 }, t + 3 * f);
+ return C;
+ };
+
+ /* 滚筒刷过:clip-path 从一侧扫开(文字、色带都可以) */
+ C.roll = (sel, t, { dur = .55, dir = 'right', stagger = 0 } = {}) => {
+ // 四周多留 30% 余量:数字字体的墨迹会超出行框,裁到 inset(0) 会把字头切掉
+ const o = '-30%', from = { right: `inset(${o} 100% ${o} ${o})`, left: `inset(${o} ${o} ${o} 100%)`, down: `inset(${o} ${o} 100% ${o})`, up: `inset(100% ${o} ${o} ${o})` }[dir];
+ C.tl.fromTo(els(sel), { clipPath: from }, { clipPath: `inset(${o} ${o} ${o} ${o})`, duration: dur, stagger, ease: 'expo.inOut', immediateRender: true }, t);
+ C.at(tt => { if (tt >= t + dur + stagger * (els(sel).length - 1)) els(sel).forEach(e => { e.style.clipPath = 'none'; }); });
+ return t + dur + stagger * (els(sel).length - 1);
+ };
+
+ /* 条形伸展:scaleX/scaleY 从 0 长出(transform-origin 由 CSS 决定) */
+ C.bar = (sel, t, { dur = .6, axis = 'x', stagger = 0, ease = 'expo.inOut' } = {}) => {
+ const k = axis === 'x' ? 'scaleX' : 'scaleY';
+ C.tl.fromTo(els(sel), { [k]: 0 }, { [k]: 1, duration: dur, stagger, ease, immediateRender: true }, t);
+ return t + dur + stagger * (els(sel).length - 1);
+ };
+
+ /* 计数:值是时间的纯函数(不依赖回调),任意帧可复现 */
+ C.count = (sel, t, { from = 0, to, dur = 1.1, ease = 'expo.out', fmt = fmtThousands } = {}) => {
+ const el = els(sel)[0], e = gsap.parseEase(ease);
+ if (t > 0) C.hideUntil(el, t); // 计数开始前不显示“0”
+ C.at(tt => { el.textContent = fmt(from + (to - from) * e(clamp01((tt - t) / dur))); });
+ return t + dur;
+ };
+
+ /* 描线:SVG path/line/polyline 从头画到尾 */
+ C.draw = (sel, t, { dur = .8, stagger = 0, ease = 'power2.inOut' } = {}) => {
+ els(sel).forEach((p, i) => {
+ const len = p.getTotalLength();
+ p.style.strokeDasharray = len + ' ' + len;
+ C.hideUntil(p, t + i * stagger); // 方头线帽在长度 0 时也会画出一个点
+ C.tl.fromTo(p, { strokeDashoffset: len }, { strokeDashoffset: 0, duration: dur, ease, immediateRender: true }, t + i * stagger);
+ });
+ return t + dur + stagger * (els(sel).length - 1);
+ };
+
+ /* 弹出:小元素(点、徽章)从 0 弹到 1 */
+ C.pop = (sel, t, { dur = .45, stagger = 0 } = {}) => {
+ C.tl.fromTo(els(sel), { scale: 0 }, { scale: 1, duration: dur, stagger, ease: 'back.out(2.2)', immediateRender: true }, t);
+ return t + dur + stagger * (els(sel).length - 1);
+ };
+
+ /* 滑入:通用位移入场 */
+ C.slide = (sel, t, { x = 0, y = 0, dur = .6, stagger = 0, ease = 'expo.out' } = {}) => {
+ C.tl.from(els(sel), { x, y, duration: dur, stagger, ease }, t);
+ return t + dur + stagger * (els(sel).length - 1);
+ };
+
+ /* 网点地层:字幕床里的装饰,越往下越密;开场 0.6s 从 70% 长满 —— 第 0 帧就不是空的 */
+ C.floor = (sel, { top = .0, power = 2.1, max = .62, cell = 16, grow = .6 } = {}) => {
+ Object.assign(els(sel)[0].style, { left: 0, top: ZONE.bottom + 'px', width: W + 'px', height: H - ZONE.bottom + 'px' }); // 铺满字幕床
+ const draw = halftone(sel, {
+ cell, density: (u, v, t) => {
+ const g = .7 + .3 * clamp01(t / grow);
+ return Math.pow(clamp01((v - top) / (1 - top)), power) * max * g;
+ }
+ });
+ C.at(draw);
+ return C;
+ };
+
+ C.seek = t => { C.tl.seek(t, false); for (const f of C.fns) f(t); };
+
+ /* ── 构建:等字体就绪再量尺寸 ── */
+ const fams = ['900 100px "Riso Serif"', '700 100px "Riso Num"', '600 40px "Riso Sans"', '500 28px "Riso Mono"'];
+ const ready = Promise.all(fams.map(f => document.fonts.load(f).catch(() => null)))
+ .then(() => document.fonts.ready)
+ .then(() => {
+ // 字体随 skill 分发;没加载上(assets/fonts 缺失或路径错)时报错,不要悄悄换成系统字体出片
+ const miss = fams.filter(f => !document.fonts.check(f));
+ if (miss.length) console.error('字体没加载上:' + miss.join(', ') + '(检查 assets/fonts/)');
+ if (!frame.querySelector('.fiber')) frame.insertAdjacentHTML('beforeend', '<div class="fiber"></div><div class="press"></div>');
+ build(C);
+ C.seek(0);
+ });
+
+ const posterT = () => C.poster == null ? C.duration : C.poster;
+ window.__riso = {
+ ready,
+ meta: () => ({ id: C.id, duration: C.duration, fps: C.fps, width: W, height: H, poster: posterT(), zone: ZONE }),
+ seek: t => { C.seek(t === 'end' ? posterT() : +t); return new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r))); },
+ audit: () => audit(C),
+ };
+
+ if (!RENDER) ready.then(() => preview(C, posterT));
+ return C;
+ }
+
+ /* ── 浏览器预览:循环播放;?t=end / ?t=2.4 定格 ── */
+ function preview(C, posterT) {
+ const fixed = Q.get('t');
+ if (fixed != null) { C.seek(fixed === 'end' ? posterT() : +fixed); return; }
+ const t0 = performance.now(), loop = C.duration + 1;
+ (function tick(now) {
+ const t = Math.min(((now - t0) / 1000) % loop, C.duration);
+ C.seek(t);
+ requestAnimationFrame(tick);
+ })(t0);
+ }
+
+ /* ── 版面自检(scripts/qa.mjs 调用)── */
+ function lum([r, g, b]) {
+ const f = c => { c /= 255; return c <= .03928 ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4); };
+ return .2126 * f(r) + .7152 * f(g) + .0722 * f(b);
+ }
+ const rgb = s => (s.match(/[\d.]+/g) || [0, 0, 0]).slice(0, 3).map(Number);
+ function contrast(c1, c2) { const a = lum(c1), b = lum(c2); return (Math.max(a, b) + .05) / (Math.min(a, b) + .05); }
+ function visible(el) {
+ for (let n = el; n && n.nodeType === 1; n = n.parentElement) {
+ const cs = getComputedStyle(n);
+ if (cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity < .05) return false;
+ }
+ const r = el.getBoundingClientRect();
+ return r.width > 1 && r.height > 1;
+ }
+ /* 在“镜头归零”的版面坐标里量(推镜 3–4% 是设计内的轻微裁切,不算越界);
+ 数字元素按字形墨迹量,不按行框量 */
+ function audit(C) {
+ const out = [];
+ document.getElementById('stage').style.transform = 'none';
+ document.getElementById('frame').style.transform = 'none';
+ const rectOf = el => {
+ const r = el.getBoundingClientRect();
+ if (!el.classList.contains('num')) return r;
+ const k = inkBox(el);
+ return { left: k.left, right: k.right, top: k.top, bottom: k.bottom, width: k.right - k.left, height: k.bottom - k.top };
+ };
+ const name = el => el.id ? '#' + el.id : (el.className ? '.' + String(el.className).split(' ').join('.') : el.tagName) + ' “' + el.textContent.trim().slice(0, 10) + '”';
+ const texts = [...document.querySelectorAll('#stage .t')].filter(visible);
+ const css = getComputedStyle(document.getElementById('frame'));
+ const paper = hex(css.getPropertyValue('--paper'));
+ const flood = document.getElementById('frame').classList.contains('flood');
+ const bg = flood ? hex(css.getPropertyValue('--a')) : paper;
+ for (const el of texts) {
+ const r = rectOf(el), cs = getComputedStyle(el), fs = parseFloat(cs.fontSize);
+ const flag = (level, msg) => out.push([level, name(el), msg, [r.left | 0, r.top | 0, r.width | 0, r.height | 0]]);
+ if (r.top < ZONE.top - 2 || r.bottom > ZONE.bottom + 2) flag('error', `文字越出信息区:y ${r.top | 0}–${r.bottom | 0}(允许 ${ZONE.top}–${ZONE.bottom})`);
+ if (r.left < ZONE.left - 2 || r.right > ZONE.right + 2) flag('error', `文字贴边或出画:x ${r.left | 0}–${r.right | 0}(允许 ${ZONE.left}–${ZONE.right})`);
+ const lines = el.querySelectorAll(':scope > .ln'); // 多行文本逐行量,不按整块的外框量
+ const parts = lines.length ? [...lines].filter(l => l.lastElementChild).map(l => { // .ln 是块级,宽度=容器;用首尾字量真实行宽
+ const a = l.firstElementChild.getBoundingClientRect(), b = l.lastElementChild.getBoundingClientRect();
+ return { left: a.left, right: b.right, top: Math.min(a.top, b.top), bottom: Math.max(a.bottom, b.bottom) };
+ }) : [r];
+ if (parts.some(p => p.right > ZONE.rail.x && p.bottom > ZONE.rail.y0 && p.top < ZONE.rail.y1)) flag('warn', `压到短视频右侧按钮栏(x>${ZONE.rail.x}, y ${ZONE.rail.y0}–${ZONE.rail.y1})`);
+ if (fs < 28) flag('error', `字号 ${fs}px < 28px,手机上读不清`);
+ if (el.dataset.overflow) flag('error', 'fit() 缩到最小字号仍放不下:删字,不要硬塞');
+ let col = rgb(cs.color);
+ if (cs.mixBlendMode === 'multiply' && !flood) col = col.map((c, i) => c * paper[i] / 255);
+ const cr = contrast(col, bg);
+ if (fs < 100 && cr < 4.5) flag('error', `对比度 ${cr.toFixed(2)} < 4.5(小于 100px 的字只能用 A 墨)`);
+ else if (fs >= 100 && cr < (fs >= 200 ? 1.3 : 2.0)) flag('warn', `大字对比度 ${cr.toFixed(2)} 偏低`); // 越大的字越能扛低对比(黄墨大数字 ≈ 1.4)
+ }
+ for (let i = 0; i < texts.length; i++) for (let j = i + 1; j < texts.length; j++) {
+ const A = texts[i], B = texts[j];
+ if (A.contains(B) || B.contains(A)) continue;
+ if (A.closest('[data-overprint]') || B.closest('[data-overprint]')) continue;
+ const a = rectOf(A), b = rectOf(B);
+ const ix = Math.min(a.right, b.right) - Math.max(a.left, b.left), iy = Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top);
+ if (ix > 4 && iy > 4) {
+ const share = ix * iy / Math.min(a.width * a.height, b.width * b.height);
+ if (share > .03) out.push(['error', name(A) + ' × ' + name(B), `文字互相压住 ${(share * 100) | 0}%(有意叠印请给其中一个加 data-overprint)`, [Math.max(a.left, b.left) | 0, Math.max(a.top, b.top) | 0, ix | 0, iy | 0]]);
+ }
+ }
+ return { id: C.id, texts: texts.length, issues: out };
+ }
+ function hex(s) {
+ s = String(s).trim();
+ if (s[0] !== '#') return rgb(s);
+ const n = parseInt(s.slice(1), 16);
+ return [(n >> 16) & 255, (n >> 8) & 255, n & 255];
+ }
+
+ window.Riso = { comp, setup, text, fit, markUnder, inkBox, box, halftone, rng, ZONE };
+})();
diff --git a/demo/compare.gif b/demo/compare.gif
new file mode 100644
index 0000000..dbcf727
Binary files /dev/null and b/demo/compare.gif differ
diff --git a/demo/converge.gif b/demo/converge.gif
new file mode 100644
index 0000000..e97fe3e
Binary files /dev/null and b/demo/converge.gif differ
diff --git a/demo/number.gif b/demo/number.gif
new file mode 100644
index 0000000..19e7245
Binary files /dev/null and b/demo/number.gif differ
diff --git a/demo/quote.gif b/demo/quote.gif
new file mode 100644
index 0000000..4ae3a60
Binary files /dev/null and b/demo/quote.gif differ
diff --git a/demo/sheet.jpg b/demo/sheet.jpg
new file mode 100644
index 0000000..b986dfa
Binary files /dev/null and b/demo/sheet.jpg differ
diff --git a/evals/evals.json b/evals/evals.json
new file mode 100644
index 0000000..e05d172
--- /dev/null
+++ b/evals/evals.json
@@ -0,0 +1,95 @@
+{
+ "skill_name": "eian-riso-broll",
+ "evals": [
+ {
+ "id": 1,
+ "name": "选段:完整逐字稿 → 选段表并停下",
+ "prompt": "用 eian-riso-broll 给我下期视频做信息动画,逐字稿如下:\n\n「很多人以为记账就是把每一笔都写下来,其实我坚持了 3 年才明白,关键不在记。我一年记了 2400 多笔,可月底一看,根本不知道钱花哪了。后来我把方法改成了 3 步:先分账户、再定预算、最后每周对一次账。光分账户这一步,我就把原来 20 多个消费类别合并成了 5 个。效果呢?以前月底对账要 2 小时,现在 15 分钟。所以记账不是为了记,是为了下个月花得更明白。」",
+ "expected_output": "Gate 1 选段表:5–7 条,覆盖 误区(以为…其实…)/ 2400 多笔 / 3 步 / 20 多→5 / 2 小时→15 分钟 / 结论金句,每条给模板、提炼后的屏幕文字、时长、色本;停下等确认。",
+ "assertions": [
+ "输出是一张选段表(原话落点 / 模板 / 屏幕文字 / 时长 / 色本),没有产出任何 HTML、PNG、mp4",
+ "至少覆盖 2400 多笔、3 步方法、20 多→5 个类别、2 小时→15 分钟、结论金句 中的 4 个",
+ "2 小时→15 分钟 用 compare;20 多→5 用 converge;3 步 用 steps(模板与信号匹配)",
+ "相邻两条没有使用同一模板;quote 至多 2 条",
+ "5 个类别没有被编造出具体名称",
+ "时长不是一律 5 秒,而是按台词长度给出(或说明用 timing.mjs 计算)",
+ "结尾明确请用户确认名单"
+ ]
+ },
+ {
+ "id": 2,
+ "name": "单条直出样帧",
+ "prompt": "用 eian-riso-broll 把这句做成一条,先给我看样帧:「做菜的时候我试过四种火候:大火、中火、小火、焖。真正决定口感的是最后一步焖,80% 的菜都靠它入味。」",
+ "expected_output": "选 focus 模板(四项里一个重点 + 80% 结论),只改 DATA,渲出 1080×1920 样帧,QA 零 error,发图并停在确认。",
+ "assertions": [
+ "从 templates/ 复制了模板(focus 或 steps),只修改了 DATA",
+ "运行了 render.mjs --still 并产出 1080×1920 的 PNG",
+ "运行了 qa.mjs 且没有 error(或修到没有 error)",
+ "屏幕文字只来自台词:四种火候的名称、80%、‘的菜都靠它入味’;没有新增说法",
+ "没有渲染 mp4,结尾请用户确认样帧"
+ ]
+ },
+ {
+ "id": 3,
+ "name": "拦截情绪独白",
+ "prompt": "帮我看看这段配什么 Riso 动画:「那是我来这座城市的第 5 年,一个人在出租屋里看着窗外的灯,突然很想家。」",
+ "expected_output": "判断为情绪独白,不适合信息动画,建议实拍或角色动画;不硬做。",
+ "assertions": [
+ "明确判断该段不适合做信息动画",
+ "给出去处建议(实拍 / 角色动画),没有把‘第 5 年’硬做成 number 模板",
+ "没有产出任何文件"
+ ]
+ },
+ {
+ "id": 4,
+ "name": "截图锚点:没有截图时不画假界面",
+ "prompt": "用 eian-riso-broll 做这句,直接出片:「你看,这是我的记账表,每一行都是一笔支出。」",
+ "expected_output": "使用 shot 模板,img 留空显示‘待替换’占位,note 为 null,不画任何假表格或界面;成片后在交付里列出截图待替换清单。",
+ "assertions": [
+ "使用 shot 模板",
+ "DATA.img 为空、note 为 null(没有在占位上加批注框)",
+ "没有用 HTML/CSS 画出仿造的表格、行列或界面",
+ "交付说明里告诉用户需要提供哪张截图、放到 assets/shots/ 后改哪一行",
+ "成片没有音轨,也没有添加任何音效"
+ ]
+ },
+ {
+ "id": 5,
+ "name": "文字太长:删字而不是缩字",
+ "prompt": "用 eian-riso-broll 的 number 模板做:「我们这个小团队过去一年一共做了 156 期节目,平均每期的完播率都超过了百分之四十,这在同类账号里是非常少见的成绩」,say 字段就用整句原话。",
+ "expected_output": "指出整句超出 say 的字数上限(≤ 2 行 × 8 字),从原话里摘出短句(如 ‘平均每期\\n完播率超过[百分之四十]’ 这类子串),不改写意思;QA 无 fit 溢出。",
+ "assertions": [
+ "没有把整句塞进 say;说明了原因(字数上限 / fit 溢出)",
+ "提炼后的屏幕文字是原话的子串或删字结果,没有换说法",
+ "没有通过调小 min 字号或改 CSS 来硬塞",
+ "qa.mjs 没有 ‘fit() 缩到最小字号仍放不下’ 的 error"
+ ]
+ },
+ {
+ "id": 6,
+ "name": "用 SRT 定时长",
+ "prompt": "这是字幕文件 examples/demo.srt。用 eian-riso-broll 给『做一张信息图,以前要 40 分钟,现在 2 分钟』这句做一条 compare,时长要和口播对上。",
+ "files": [
+ "examples/demo.srt"
+ ],
+ "expected_output": "运行 timing.mjs --srt 找到入点出点,把建议 duration 写进 DATA;compare 的 base 换算成同一单位(2400 / 120)。",
+ "assertions": [
+ "运行了 scripts/timing.mjs --srt 并引用了它给出的入点 / 出点",
+ "DATA.duration 等于 timing.mjs 的建议值",
+ "before.base = 2400、after.base = 120(同一单位:秒)",
+ "没有虚构‘效率提升 20 倍’之类台词里没有的结论"
+ ]
+ },
+ {
+ "id": 7,
+ "name": "透明底交付",
+ "prompt": "上一条 12 处信息的 eian-riso-broll 动画,我想叠在口播画面上半屏,给我一个透明背景的版本。",
+ "expected_output": "用 render.mjs --alpha 输出 ProRes 4444 .mov,说明纸被拿掉、只剩油墨。",
+ "assertions": [
+ "运行了 render.mjs 并带 --alpha",
+ "产物是 .mov(ProRes 4444,带 alpha 通道)",
+ "向用户说明透明版的用途和与 mp4 的区别"
+ ]
+ }
+ ]
+}
diff --git a/examples/demo-script.md b/examples/demo-script.md
new file mode 100644
index 0000000..556e4bc
--- /dev/null
+++ b/examples/demo-script.md
@@ -0,0 +1,37 @@
+# 示例逐字稿(虚构)
+
+> 这是为 demo 写的**虚构示例**,里面的数字不是真实统计。模板的默认 `DATA`、`demo/` 里的动画、`evals/` 的评测用例都来自这一段。
+> 配套字幕:[`demo.srt`](demo.srt)(按 4.5 字/秒排的时间轴,用来演示 `timing.mjs --srt`)。
+
+## 逐字稿
+
+很多人以为,好看的动效得请人来做。其实,一份逐字稿就够了。
+
+第一部分,先看效果。一期 3 分钟的口播,能挑出 12 处值得配画面的信息。做一张信息图,以前要 40 分钟,现在 2 分钟。
+
+我电脑里原来存着 30 多套动效工程,真正常用的只有 4 类:数字、流程、对比、金句。这套模板半年里出了 1800 条画面,放在一起看,是一个系列。
+
+四组色本:墨蓝配荧光粉、深青配橙、藏青配朱红、墨黑配明黄。我最常用第一组,70% 的视频都用它。
+
+怎么做呢?整个流程只有 3 步:选段、出样帧、渲成片。这是我上周交出去的分镜表,每一行对应一条动画。
+
+所以,别再从一张白纸开始了。画面要跟着你说的话走。
+
+## 分镜表(Gate 1 的产出示范)
+
+屏幕文字全部从原话里摘:只删字、换行,不改写。时长由 `node scripts/timing.mjs --srt examples/demo.srt "…"` 算出。
+
+| # | 原话落点 | 模板 | 屏幕文字 | 时长 | 色本 |
+|---|---|---|---|---|---|
+| 01 | “很多人以为,好看的动效得请人来做。其实,一份逐字稿就够了” | versus | 以为:好看的动效↵得请人来做 / 其实:一份逐字稿↵就[够了] | 6.5 | red |
+| 02 | “第一部分,先看效果” | title(满版) | 01 / 第一部分 / 先看效果 | 3 | blue |
+| 03 | “能挑出 12 处值得配画面的信息” | number | 12 / 处信息 / 值得配[画面] | 5.5 | blue |
+| 04 | “做一张信息图,以前要 40 分钟,现在 2 分钟” | compare | 做一张信息图 / 以前 40 分钟 / 现在 2 分钟 | 4.5 | blue |
+| 05 | “30 多套动效工程,真正常用的只有 4 类:数字、流程、对比、金句” | converge | 30+ 套动效工程 → 4 类:数字 / 流程 / 对比 / 金句 | 8.5 | blue |
+| 06 | “出了 1800 条画面,放在一起看,是一个系列” | network | 1800 / 条画面 / 放在一起[是一个系列] | 7 | blue |
+| 07 | “四组色本……我最常用第一组,70% 的视频都用它” | focus | 四组色本 / 4 项选第 1 项 / 70% 的视频都用它 | 9.5 | blue |
+| 08 | “整个流程只有 3 步:选段、出样帧、渲成片” | steps | 只有 3 步 / 选段 · 出样帧 · [渲成片] | 4.5 | blue |
+| 09 | “这是我上周交出去的分镜表” | shot | 截图占位:分镜表截图 / 上周的分镜表 | 5.5 | blue |
+| 10 | “所以,别再从一张白纸开始了。画面要跟着你说的话走” | quote | 所以,别再从一张白纸开始了 / 画面要跟着↵[你说的话]走 | 6 | red |
+
+两组色本:正文统一墨蓝 × 荧光粉,开头的误区和结尾的结论用藏青 × 朱红,首尾呼应。满版深底两帧(02、10)制造明暗节奏。
diff --git a/examples/demo.srt b/examples/demo.srt
new file mode 100644
index 0000000..ca82469
--- /dev/null
+++ b/examples/demo.srt
@@ -0,0 +1,63 @@
+1
+00:00:00,500 --> 00:00:03,980
+很多人以为,好看的动效得请人来做。
+
+2
+00:00:04,230 --> 00:00:06,600
+其实,一份逐字稿就够了。
+
+3
+00:00:06,850 --> 00:00:08,780
+第一部分,先看效果。
+
+4
+00:00:09,030 --> 00:00:13,980
+一期 3 分钟的口播,能挑出 12 处值得配画面的信息。
+
+5
+00:00:14,230 --> 00:00:18,290
+做一张信息图,以前要 40 分钟,现在 2 分钟。
+
+6
+00:00:18,540 --> 00:00:22,160
+我电脑里原来存着 30 多套动效工程,
+
+7
+00:00:22,410 --> 00:00:26,340
+真正常用的只有 4 类:数字、流程、对比、金句。
+
+8
+00:00:26,590 --> 00:00:30,120
+这套模板半年里出了 1800 条画面,
+
+9
+00:00:30,370 --> 00:00:32,740
+放在一起看,是一个系列。
+
+10
+00:00:32,990 --> 00:00:38,470
+四组色本:墨蓝配荧光粉、深青配橙、藏青配朱红、墨黑配明黄。
+
+11
+00:00:38,720 --> 00:00:42,110
+我最常用第一组,70% 的视频都用它。
+
+12
+00:00:42,360 --> 00:00:45,180
+怎么做呢?整个流程只有 3 步:
+
+13
+00:00:45,430 --> 00:00:47,360
+选段、出样帧、渲成片。
+
+14
+00:00:47,610 --> 00:00:52,430
+这是我上周交出去的分镜表,每一行对应一条动画。
+
+15
+00:00:52,680 --> 00:00:55,500
+所以,别再从一张白纸开始了。
+
+16
+00:00:55,750 --> 00:00:58,120
+画面要跟着你说的话走。
diff --git a/references/copy.md b/references/copy.md
new file mode 100644
index 0000000..88c316b
--- /dev/null
+++ b/references/copy.md
@@ -0,0 +1,77 @@
+# 选段与文案
+
+B-roll 的工作是:**观众耳朵在听一句话,眼睛同时“看见”这句话里的那个信息**。不是把口播再写一遍。
+
+## 哪些段落值得做
+
+先找“能被看见”的信号,一条至少命中一个:
+
+| 信号 | 例子 | 模板 |
+|---|---|---|
+| 一个扛得住整帧的数字 | 12 处信息、90%、3 年 | `number` |
+| 有顺序的步骤 | 先选段、再出样帧、然后… | `steps` |
+| 很多 → 很少 | 30 多套工程收敛成 4 类 | `converge` |
+| 同一件事的前后两个量 | 以前 40 分钟,现在 2 分钟 | `compare` |
+| 关系 / 连接 / 规模感 | 1800 条画面连成一个系列、互相引用 | `network` |
+| 整段的结论或钩子 | 画面要跟着你说的话走 | `quote` |
+| 几个并列项里有一个是重点 | 四组色本,70% 的视频用第一组 | `focus` |
+| 先立一个认知再推翻 | 很多人以为…其实… | `versus` |
+| 章节口 | 第一个…第二个…第三个… | `title` |
+| 观众需要看见原件才信 | 我的后台、原帖、关系图 | `shot` |
+
+**拦下来,不做的**(写进“落选段 → 去处”):
+
+- 软件操作过程 → 录屏
+- 情绪、场景、故事(“那天我坐在工位上…”)→ 实拍 / 角色动画
+- 隐喻(“好的画面像一个翻译官”)→ 隐喻动画;信息动画不画比喻
+- 没有新信息的过渡句(“我们来看下一个”)→ 不需要画面
+
+## 数量
+
+- 默认挑 **5–8 条**;用户指定数量就按用户的。宁缺毋滥:一条平庸的 B-roll 比没有更糟。
+- 相邻两条不用同一模板;同一模板全片 ≤ 2 次(`title` 章节卡系列除外)。
+- 同一段里有两个信号时,选**观众最可能记住的那一个**,另一个放弃或拆成相邻两条。
+
+## 提炼屏幕文字
+
+口播是给耳朵的,屏幕字是给眼睛的。眼睛在 0.5 秒里只能抓住一个词组。
+
+1. **从原话里摘,不改写**:可以删字、可以断行,不能换说法、不能加词。“好看的动效得请人来做”可以留成“好看的动效\n得请人来做”,不能写成“动画外包才好看”。
+2. **数字原样**:口播说“1 万 2 千”,屏幕可以写 `12,000`(同一个值换写法);不能四舍五入、不能换算出台词里没说的结论(比如“40 分钟 → 2 分钟”就写成“效率提升 20 倍”——台词没说就不写)。
+3. **字数上限**(超了就删,模板的 `fit()` 只负责微调):
+ - 标题 / 论点:每行 ≤ 8 字,≤ 2 行(`quote` ≤ 3–4 行,每行 ≤ 7 字)
+ - 单位 / 标签:≤ 4 字
+ - 步骤名 / 选项:≤ 5–7 字
+4. **断行按意群**:`画面要跟着\n你说的话走`,不要把一个词劈在两行。
+5. **重点用 `[ ]` 标出**:一帧最多一处,渲染成 B 墨荧光压条(或 B 墨字,≥ 100px 时)。
+6. **台词没给的内容留空**:“收敛成 6 大类”但没说哪 6 类 → 6 个只带序号的空块(`names: []`);台词说了“4 类:数字、流程、对比、金句”才填名字。不替用户编类别名、编案例、编数据。
+
+## 时长
+
+B-roll 盖住的是“这句话被说出来的那几秒”。
+
+```bash
+node scripts/timing.mjs --srt examples/demo.srt "能挑出 12 处值得配画面的信息" "整个流程只有 3 步"
+node scripts/timing.mjs "做一张信息图,以前要 40 分钟,现在 2 分钟" # 没有字幕时按 4.5 字/秒估
+```
+
+把建议的 `duration` 填进 DATA。关键落点(数字砸下、压条刷出)最好落在那个词被说出来的时刻附近——有 SRT 时,在分镜表里写下入点,剪辑时对齐。
+
+## 色本分配
+
+四组色本(见 [style.md](style.md)),**一个功能段锁一组**,同一条视频最多用 2 组:主色本给正文,另一组给钩子 / 结论(首尾呼应)。不要每条换一个颜色。
+
+完整的示范见 [examples/demo-script.md](../examples/demo-script.md):一段虚构逐字稿 → 10 条分镜,模板默认 DATA 和 demo 都来自它。
+
+## Gate 1 的产出格式
+
+```markdown
+| # | 原话落点 | 模板 | 屏幕文字 | 时长 | 色本 | 截图 |
+|---|---|---|---|---|---|---|
+| 01 | “能挑出 12 处值得配画面的信息” | number | 12 / 处信息 / 值得配[画面] | 5.5 | blue | — |
+| 02 | “整个流程只有 3 步:选段、出样帧、渲成片” | steps | 只有 3 步 / 选段·出样帧·渲成片 | 4.5 | blue | — |
+
+落选段:
+- “很多人以为,好看的动效得请人来做” → 并进 00 versus(误区)
+- “那天我…” → 实拍
+```
diff --git a/references/motion.md b/references/motion.md
new file mode 100644
index 0000000..a6f40e5
--- /dev/null
+++ b/references/motion.md
@@ -0,0 +1,88 @@
+# 动效
+
+## 原则
+
+成片**只有画面、不带音轨**——本 skill 不做音效,声音统一在剪辑台处理。
+
+**动画 = 这张海报被印出来的过程。** 每个动作都要对应一个印刷动作:
+
+| 印刷动作 | 动效 | API |
+|---|---|---|
+| 一层墨被印上去 | 网点从小长满 | `C.print` |
+| 两版对准 | B 版从大偏移跳 4 格归位 | `C.register` |
+| 盖章 | 从空中加速砸下,镜头震 3 帧 | `C.stamp` |
+| 滚筒刷过 | clip-path 从一侧扫开 | `C.roll` |
+| 铅字排上 | 逐字从行底升起 | `C.rise` |
+| 色条 / 线被拉出 | scaleX 从 0 长出 | `C.bar` |
+| 油墨被抽掉 | 平网点径缩小(退后) | `tl.fromTo(el, {'--td':'9px'}, {'--td':'4px'})` |
+
+规矩:
+
+1. **第 0 帧干净:只有纸、纸纹和字幕床网点地层**(`quote` 例外:满版墨底 + 网点太阳)。文字、数字、框线、色块都从自己的入场动作开始出现,不在第 0 帧摆一个“0”或淡影。`C.print` / `C.count` / `C.draw` 会自动在入场前隐藏元素;其他手写的动作用 `C.hideUntil(sel, t)`。地层本身保证画面不是空纸,从口播硬切进来不会像卡顿。
+2. **入场快、落点准、停得住。** 入场用 `expo.out` / `back.out`;盖章用 `power3.in`(加速撞上去才有重量)。主要信息在 2–2.5 秒内全部到位,剩下的时间是“暂停即海报”。
+3. **静止不等于死。** `C.camera()` 匀速慢推 3%,`C.boil()` 让油墨颗粒逐两帧换位。匀速(不缓入缓出)是故意的:剪辑师会在任意一帧切入切出。
+4. **一条只有一个高潮。** 盖章 / 套印归位 / 压条,三选一做落点;其余动作都是铺垫。
+5. **不用 opacity 淡入当主动效。** 淡入是“网页动画”的味道。需要出现就印出来、刷出来、升起来。
+6. **时间全写绝对秒**,不用 GSAP 的相对排队;同一时间线里可以读前一个 helper 的返回值(落地时间)来接下一个。
+
+## API(assets/riso.js)
+
+```js
+Riso.comp({ duration: 4.5, seed: 11 }, C => {
+ // 1. 先排版(量尺寸)
+ // 2. 再建时间轴
+});
+```
+
+**排版工具**(在建时间轴之前调用)
+
+| 函数 | 作用 |
+|---|---|
+| `Riso.setup(DATA)` | 模板公共开头:色本、`flood` 满版墨底、版头文字 |
+| `Riso.text(el, '第一行\n第二行[重点]')` | 拆成 `.ln` 行 + `.ch` 字;`[ ]` 内的字带 `.em` |
+| `Riso.fit(el, { width, max, min })` | 从 max 字号往下缩到最宽一行 ≤ width;缩到 min 仍放不下 → QA 报错 |
+| `Riso.inkBox(el)` | 单行元素的**字形墨迹**框(#stage 坐标)——数字对齐用它 |
+| `Riso.box(el)` | 元素盒子(#stage 坐标) |
+| `Riso.markUnder(mark, textEl, { pad: 8 })` | 荧光压条盖在 `[重点]` 字的下半截;没有 `[ ]` 时隐藏并返回 false |
+| `Riso.ZONE` | 版面安全区(顶栏 / 字幕床 / 左右边界 / 按钮栏)的唯一来源,QA 也读它 |
+| `Riso.halftone(canvas, { cell, density(u, v, t) })` | 返回 `draw(t)`;配合 `C.at(draw)` 做会动的网点 |
+
+**时间轴 helper**(返回“落地时间”,可串联)
+
+| 函数 | 参数(默认) |
+|---|---|
+| `C.camera({ push: .03, drift: 0 })` | 整条慢推 |
+| `C.boil()` | 油墨颗粒呼吸 |
+| `C.floor('#floor', { power: 2.1, max: .62, cell: 16 })` | 字幕床网点地层(自动铺满 `ZONE.bottom` 以下;开场 0.6s 从 70% 长满) |
+| `C.print(sel, t, { dur: .7, from: 0, to, stagger })` | 网点显影;给 `to`(px)或元素带 `.tint` 时停在平网 |
+| `C.register(t, { dx: 22, dy: -14 })` | 套印归位(整版 B 墨;版头色块固定不参与)。一条最多一次 |
+| `C.hideUntil(sel, t)` | 元素在 t 之前不显示(print / count / draw 已自动调用) |
+| `C.stamp(sel, t, { from: 1.55, rot: -5, dur: .17, shake: 5 })` | 盖章 |
+| `C.rise(sel, t, { stagger: .034, dur: .62 })` | 逐字升起(需要先 `Riso.text`) |
+| `C.roll(sel, t, { dur: .55, dir: 'right' })` | 滚筒刷开:right / left / up / down |
+| `C.bar(sel, t, { dur: .6, axis: 'x' })` | 条形伸展(transform-origin 由 CSS 定) |
+| `C.count(sel, t, { from: 0, to, dur: 1.1, fmt })` | 计数(值是时间的纯函数) |
+| `C.draw(sel, t, { dur: .8, stagger })` | SVG 描线 |
+| `C.pop(sel, t)` / `C.slide(sel, t, { x, y })` | 弹出 / 滑入 |
+| `C.shake(t, a)` | 镜头震 |
+| `C.at(f)` | 逐帧函数 `f(t)`(计数、画布都走这里) |
+| `C.tl` | 原生 GSAP 时间线,复杂动作直接写 |
+
+## 确定性(渲染器逐帧 seek,必须可复现)
+
+- 不用 `setTimeout` / `requestAnimationFrame` / `Date.now()` / `Math.random()` 驱动画面。随机用 `C.rand()`(按 seed 可复现)。
+- 计数器、画布、任何“随时间变”的东西放进 `C.at(t => …)`。
+- 不发网络请求:字体在 `assets/fonts/`,GSAP 在 `assets/` 里,截图放项目 `assets/shots/`。
+
+
+## 写新模板
+
+复制最接近的模板改。检查单:
+
+- [ ] 顶部注释写清楚:用于什么段落 / 画面是怎么讲故事的
+- [ ] 脚本以 `Riso.setup(DATA)` 开头(色本、版头),不要自己写 `body.className`
+- [ ] 只有 `DATA` 是给使用者改的;版面全部由 DATA 推算(`fit` / `inkBox` / `box`);荧光压条用 `Riso.markUnder`
+- [ ] 版面坐标不写死安全区数字,需要时读 `Riso.ZONE`
+- [ ] 所有文字元素带 `.t`;有意叠印的加 `data-overprint`
+- [ ] 第 0 帧干净(只有纸 + 地层);2.5 秒内信息到位;有且只有一个高潮
+- [ ] `render --still` + `qa` 零 error,再看一遍 `--at 0`、`--at 1` 两帧
diff --git a/references/production.md b/references/production.md
new file mode 100644
index 0000000..9f6dc8c
--- /dev/null
+++ b/references/production.md
@@ -0,0 +1,99 @@
+# 渲染 · 质检 · 交付 · 排错
+
+## 环境
+
+`node scripts/check_setup.mjs` 一次查完:Node ≥ 22(渲染器用 Node 自带的 WebSocket 驱动 Chrome,**零 npm 依赖**)、Chrome/Chromium(会真的启动一次;找不到时设 `CHROME=<路径>`,也会自动找 Playwright 下载的 Chromium)、ffmpeg/ffprobe、字体文件。
+
+字体随 skill 分发(`assets/fonts/`,见那里的 README),不依赖系统字体,所以 macOS / Linux / Windows 渲出来一样。字体没加载上时页面会报错、渲染中止,不会悄悄换成系统字体出片。
+
+## 项目结构
+
+```
+<项目>/ node scripts/new_project.mjs <名字> 生成;默认在 ~/eian-riso-broll-projects/
+├── assets/ riso.css / riso.js / gsap / fonts —— 整份拷入,项目自包含
+│ └── shots/ 真截图放这里
+├── compositions/NN-名字.html 每条一个,从 templates/ 复制
+├── plates/ 样帧 PNG + sheet.jpg
+├── renders/ 成片
+├── qa/ 质检叠层图
+└── STORYBOARD.md 分镜表(Gate 1 的表 + 截图待替换清单)
+```
+
+## 命令
+
+```bash
+S=~/.claude/skills/eian-riso-broll/scripts # 或 skill 的实际安装路径
+
+node $S/render.mjs compositions/*.html --still # 末帧样帧 → plates/<id>.png + plates/sheet.jpg
+node $S/render.mjs compositions/03-x.html --at 1.2 # 任意时刻(查动画中间态)
+node $S/render.mjs compositions/*.html # 成片 → renders/<id>.mp4
+node $S/render.mjs compositions/*.html --draft # 快速低码率预览
+node $S/render.mjs compositions/*.html --calm # 纸纹不动、不推镜:只给压 GIF 用,别交付
+node $S/render.mjs compositions/01-x.html --alpha # 透明底 → renders/<id>.mov(ProRes 4444)
+node $S/qa.mjs compositions/*.html # 质检 → qa/<id>-audit.png,error 时退出码 1
+node $S/timing.mjs --srt 口播.srt "某句台词" # 精确入点 / 出点 / 建议时长
+```
+
+浏览器里直接打开 composition 可以预览:自动循环播放;`?t=end` 或 `?t=2.4` 定格到某一刻。
+
+速度参考(M 系列 Mac):样帧 ~2 秒一张;成片 5 秒一条约 20 秒。
+
+改过 `assets/`、`scripts/` 或模板之后,跑一遍自测:
+
+```bash
+node tests/smoke.mjs # 全部模板:样帧 → 成片(--draft)→ 质检 → 时长脚本;失败时退出码 1
+node tests/smoke.mjs --full --out ~/Desktop/riso-review # 正式码率,产物留在指定目录里看效果
+node tests/smoke.mjs number quote # 只测指定模板
+```
+
+## 渲染器怎么工作
+
+`render.mjs` 启动 headless Chrome → 打开 `composition.html?render` → 读 `window.__riso.meta()`(时长、帧率)→ 逐帧 `seek(t)` + 截图 → 管道喂给 ffmpeg(H.264 CRF 18,码率上限 24 Mbps,不写音轨)。
+
+样帧和成片是**同一个文件、同一个 seek**渲出来的,所以“成片末帧 = 确认过的样帧”是结构保证的,不靠人对。
+
+## 质检(qa.mjs)
+
+在“镜头归零”的版面坐标里量末帧:
+
+| 检查 | 级别 |
+|---|---|
+| 文字越出信息区(y 168–1330、x 56–1024) | error |
+| 字号 < 28px | error |
+| 小于 100px 的字对比度 < 4.5 | error |
+| 文字互相压住(未标 `data-overprint`) | error |
+| `fit()` 缩到最小仍放不下 | error |
+| 压到右侧按钮栏(x > 930、y 880–1500),逐行量 | warn |
+| 大字对比度偏低 | warn |
+| 成片:时长不符、尺寸不是 1080×1920 | warn / error |
+
+每条都会生成 `qa/<id>-audit.png`:绿虚线 = 信息区,橙色 = 按钮栏,斜纹 = 字幕床,红框编号 = 问题元素。有问题先看这张图。
+
+QA 查不了的,自己看:
+- `plates/sheet.jpg`:每帧有没有一个主角?B 墨重点是不是只有一处?
+- `--at 0`:第 0 帧是不是干净(只有纸、纸纹和底部网点地层,没有“0”、虚线框、淡影)?
+- 文字是不是全部来自原话?
+
+## 交付
+
+- `renders/*.mp4`:1080×1920 / 30fps / H.264,**无音轨**、无字幕(口播、BGM、字幕都在剪辑台合成)。
+- `plates/sheet.jpg`:末帧一览。
+- `STORYBOARD.md`:分镜表 + 截图待替换清单(哪条、哪个 `slot`、要什么截图)。
+- 可选:`--alpha` 透明底 ProRes 4444(纸被拿掉,只剩油墨;适合叠在口播画面上半屏)。注意:
+ - 体积大(4.5 秒约 340MB),这是 ProRes 4444 的正常水平,只给剪辑师用,不要直接上传平台。
+ - A 墨是深色,叠在暗的口播画面上会看不清——适合明亮的画面;暗画面用普通 mp4 整屏切过去。
+- 问用户是否拷到指定目录。
+
+## 排错
+
+| 现象 | 原因 / 解决 |
+|---|---|
+| 元素全堆在左上角 | 嵌套元素没有 `position:absolute`(只有 `#stage` 的直接子元素自动绝对定位) |
+| 数字顶上被切掉 | 对 `.num` 做了 `clip-path`/`overflow:hidden`;用 `C.roll`(自带 30% 余量)或按 `inkBox` 留空间 |
+| 位置量错、动画后错位 | 在建时间轴**之后**才 `fit`/`inkBox`——排版必须在任何 tween 之前 |
+| 逐字升起没效果 | 没用 `Riso.text()`,直接写了 `textContent` |
+| 容器 `right:` 不生效、宽度为 0 | 父容器是 0 宽的绝对定位元素;给父容器 `inset:0` |
+| 页面脚本报错 | 渲染器会把页面的 console error 原样打出来;浏览器打开 composition 看控制台 |
+| `fit() 缩到最小字号仍放不下` | 删字。不要调小 min、不要改 CSS |
+| 渲染卡住 / Chrome 启动超时 | 有残留的 headless Chrome:`pkill -f riso-chrome` |
+| Chrome 启动失败 | 报错里会带 Chrome 自己的最后几行输出。root 身份(Docker / CI)下会自动加 `--no-sandbox` |
diff --git a/references/style.md b/references/style.md
new file mode 100644
index 0000000..874032e
--- /dev/null
+++ b/references/style.md
@@ -0,0 +1,66 @@
+# 视觉系统 · 孔版双色
+
+所有部件都在 `assets/riso.css`。这份文档解释每条规则为什么存在,改样式前先读。
+
+## 为什么是 Riso
+
+竖屏信息动画在手机上被看 1–3 秒。它需要:**一眼可读的明暗反差**、**一个明确的重点**、**和口播画面明显不同的质感**。孔版印刷天然满足:两种油墨 = 强制克制;荧光色 = 天然的重点;网点和错位 = 一眼就知道“这是印出来的”,而不是又一个 PPT 动画。
+
+## 五个部件
+
+1. **纸**:纯色纸场 `--paper` + 纤维噪点 `.fiber`(正片叠底)+ 油墨不匀 `.press`(滤色,逐两帧换位 = 颗粒在呼吸)。纸面上**没有任何渐变**——“渐变”一律用网点画。
+2. **A 墨(深)**:所有小字、结构线、框线。正片叠底,压在 B 墨上会变成更深的第三色。
+3. **B 墨(荧光)**:大数字、压条、色块、网点地层、一处印章。正片叠底 + 全版统一错位 `translate: var(--rx) var(--ry)`(默认 3px, -2px)——**错位必须是整版一致的**,因为真实印刷里是整张 B 版没对准,不是每个元素各歪各的。
+4. **网点**:
+ - `.print` 显影:一层墨从小点长成实地(入场)。
+ - `.tint` 平网:墨只印 25–45%(退后、背景大字、落选项)。
+ - `Riso.halftone()` 画布:点径随位置变化的网点(地层、太阳)。网线角 45°。
+5. **满版墨底 `flood`**:整张纸印满 A 墨,字变成纸色反白。全片 ≤ 2 帧,用在钩子 / 结论——它的作用是**节奏**,用多了就没有节奏。
+
+## 色本
+
+| class | 纸 | A 墨 | B 墨 | 气质 |
+|---|---|---|---|---|
+| `pal-blue`(默认) | `#F3EEE4` | 墨蓝 `#22308C` | 荧光粉 `#FF4C97` | 最“Riso”,适合知识、科技 |
+| `pal-teal` | `#F1EDE3` | 深青 `#0C4A4C` | 橙 `#FF6A2A` | 温暖、方法论、生活 |
+| `pal-red` | `#F2ECE2` | 藏青 `#1C2A4E` | 朱红 `#F0433A` | 观点、误区、警告 |
+| `pal-ink` | `#EEEAE1` | 墨黑 `#1B1B1B` | 明黄 `#FFC21A` | 严肃、数据、财经 |
+
+- 一个功能段锁一组;一条视频最多 2 组。
+- 新色本:A 墨对纸的对比度必须 ≥ 7;B 墨只用在大元素上,100–200px 的字 ≥ 2.0、200px 以上 ≥ 1.3 即可(`pal-ink` 的黄 ≈ 1.4,只适合超大数字和色块)。叠印色(A×B)要比 A 更深,不能发灰。
+- `pal-ink` 的 B(黄)与 A(黑)叠印后是黑——没有第三色,所以它最克制。
+
+## 版面
+
+下面的数字在代码里只有一份:`assets/riso.js` 的 `ZONE`(QA、叠层图、字幕床地层都读它)。改版面先改那里。
+
+```
+y 0–168 平台顶栏(搜索框 / 状态栏):不放任何东西
+y 176–234 版头 .mast:左「段号 · 主题词」+ 右「序号」+ 下划线 —— 全系列签名
+y 260–1330 信息区:所有文字只能在这里
+x > 930, y 880–1500 右侧按钮栏(点赞 / 评论 / 分享):避免放字(QA 警告)
+y 1330–1920 字幕床:只放网点地层 / 太阳等装饰,绝不放字
+左右边距 72px
+```
+
+- 每帧 **3–5 个元素组**。挤了就删信息,不缩字号。
+- 一帧 **一个主角**,占信息区的 40% 以上:超大数字、一张表、一张网、一个序号。没有主角的帧就是 PPT。
+- 一帧只有 **一处 B 墨重点**(压条 / 印章 / 色块三选一),大数字和地层不算。
+
+## 字
+
+| 用途 | 字体 | class | 规则 |
+|---|---|---|---|
+| 标题、论点 | 思源宋体 Heavy(`Riso Serif`,900) | `.hd` `.hd-xl/l/m/s` | 字距 -0.02em;不描边、不阴影 |
+| 数字 | Oswald Bold(`Riso Num`) | `.num` | 越大越好;按墨迹对齐(`Riso.inkBox`) |
+| 标签、引子 | 思源黑体 SemiBold(`Riso Sans`) | `.lb` | 42px 左右 |
+| 编号、版头 | JetBrains Mono(`Riso Mono`) | `.mono` | 28px、字距 0.16em;只放编号 / 段号,不放句子 |
+
+字体全部在 `assets/fonts/`,随 skill 分发,不依赖系统字体。
+
+- 最小字号 28px(1080 宽的画面在手机上约缩到 36%)。
+- 宋体的横细竖粗在大字号下非常漂亮,小于 64px 时改用黑体(`.lb`)。
+
+## 禁止
+
+渐变背景、玻璃拟态、投影(Riso 没有影子——层次靠叠印和网点)、圆角卡片、通用图标(火箭 / 灯泡 / 对勾 / 齿轮)、emoji、3D、粒子、假界面截图、第三种油墨颜色。
diff --git a/references/templates.md b/references/templates.md
new file mode 100644
index 0000000..5913361
--- /dev/null
+++ b/references/templates.md
@@ -0,0 +1,125 @@
+# 模板手册
+
+每个模板都是完整可渲染的 composition。用法:复制到项目 `compositions/NN-名字.html`,**只改顶部的 `const DATA = {…}`**。版面会按字数自动排;字太多时 QA 会报 `fit` 溢出——那是让你删字,不是让你改 CSS。
+
+下面每个模板的示例 DATA 就是它的默认值,全部来自同一段虚构逐字稿([examples/demo-script.md](../examples/demo-script.md))。
+
+所有模板共有的字段:
+
+| 字段 | 说明 |
+|---|---|
+| `palette` | `pal-blue` / `pal-teal` / `pal-red` / `pal-ink` |
+| `mast` | `[左, 右]`:左 =「段号 · 主题词」,右 =「序号 / 总数」 |
+| `duration` | 秒。用 `scripts/timing.mjs` 算 |
+
+`[ ]` 标记 = 一处 B 墨重点(压条或 B 墨字)。
+
+---
+
+## number · 数字冲击
+**用于** 一个能扛住整帧的数字。**故事** 数字网点显影 + 计数 → 套印归位 → 单位盖章压在数字脚上(叠印出第三色)→ 论点升起 → 重点压条。
+
+```js
+number: 12, prefix: '', suffix: '', comma: false, // 8 位以内;≥ 10000 建议 comma
+unit: '处信息', // ≤ 4 字
+say: '值得配[画面]', // ≤ 2 行 × 8 字
+```
+
+## steps · 流程拆解
+**用于** 2–6 个有顺序的步骤。**故事** 标题里步数是 B 墨大字 → 一行一步像排好的目录表(细线刷出、序号显影、步骤名升起,一步接一步)→ 右侧网点淡印的大步数 → 落点那一步压条。
+
+```js
+title: ['只有', 3, '步'], // [前半, 数字, 后半]
+steps: ['选段', '出样帧', '渲成片'], // 每步 ≤ 5 字
+key: -1, // 落点那一步(-1 = 最后一步)
+```
+
+## converge · 收敛归类
+**用于** 很多 → 很少。**故事** 「30+ → 6」两个数字 → N 张小卡逐张落下 → 小卡分组飞进 K 个大块被吸收,大块平网印出 → 少的那个数字盖章。
+
+```js
+from: { n: '30+', cap: '套动效工程', count: 30 }, // count = 画多少张小卡(≤ 36)
+to: { n: '4', cap: '类', count: 4 }, // 2–6 个大块
+names: ['数字', '流程', '对比', '金句'], // 大类名:台词给了才填,没给就 []
+```
+
+## compare · 前后对比
+**用于** 同一件事的两个量(时间、次数、成本)。**故事** 两根条按**真实比例**:“以前”匀速长满(数字跟着爬,像时间在走)→ “现在”一下到位、数字盖章。慢 vs 快本身就是论点。
+
+```js
+title: '做一张信息图',
+before: { label: '以前', value: 40, unit: '分钟', base: 2400 }, // base = 换算成同一单位(秒)
+after: { label: '现在', value: 2, unit: '分钟', base: 120 },
+```
+比例差太悬殊(> 50 倍)时短条会只剩一个点——这正是要表达的,不要“为了好看”放大。
+
+## network · 连接 / 密度
+**用于** 关系、链接、网络效应。**故事** 大数字 + 单位叠印 → 论点 → 一张网从中心向外长出(节点弹出、连线逐条画),数字和连线同步爬升。
+
+```js
+number: 1800, comma: false, unit: '条画面',
+say: '放在一起[是一个系列]', // 一行 ≤ 10 字
+nodes: 58, // 网是示意,不代表真实数量
+```
+
+## quote · 金句 / 结论 / 钩子(满版深底)
+**用于** 整条视频的论点落地。全片 ≤ 2 条。**故事** 第 0 帧就是满版墨底 + 半个网点太阳 → 引子刷出 → 大字逐字升起 → 关键词 B 墨显影 + 套印归位。
+
+```js
+lead: '所以,别再从一张白纸开始了', // 可空;≤ 16 字
+quote: '画面要跟着\n[你说的话]走', // 2–4 行 × ≤ 7 字
+```
+
+## focus · 多选一 / 卡点
+**用于** 几个并列项里有一个是重点。**故事** 纸条依次滑入 → 落选项退网成平网(还读得出,但退后了)→ 选中项刷满 B 墨、往前一步 → 结论数字盖章。
+
+```js
+title: '四组色本',
+items: ['墨蓝配荧光粉', '深青配橙', '藏青配朱红', '墨黑配明黄'], // 2–5 项 × ≤ 7 字
+pick: 0,
+verdict: { n: '70%', text: '的视频都用它' }, // 没数字时 n: '';没结论时 verdict: null
+```
+
+## versus · 误区翻转
+**用于** “很多人以为…其实…”。**故事** 误区那句印出来 → 一笔划掉 → 整块退网 → 中线刷开 → 真相升起 + 关键词压条 + 套印归位。
+
+```js
+before: { tag: '以为', text: '好看的动效\n得请人来做' },
+after: { tag: '其实', text: '一份逐字稿\n就[够了]' },
+```
+
+## title · 章节卡
+**用于** 第一个 / 第二个… 的章节口;开场标题。同模板换 `index` 派生整套,可以 `flood: true` 与浅底交替。**故事** 巨大序号从下往上印出 → 套印归位 → 小标签刷出 → 宋体标题叠印压住序号的脚。
+
+```js
+flood: true, index: '01', kicker: '第一部分', title: '先看效果', sub: '',
+```
+
+## shot · 截图锚点
+**用于** 观众需要看见原件才信的那句。**故事** 四角裁切标记弹出 → 截图从上往下刷入,A 墨双色调 + 网点显影 → (仅真截图)一处 B 墨批注框盖章 → 说明升起。
+
+```js
+img: '../assets/shots/storyboard.png', // 空 = “待替换”占位
+slot: '分镜表截图', // 占位时写清楚要什么截图
+note: { x: .52, y: .30, w: .30, h: .22 }, // 批注框(相对版位比例);没有真截图时必须是 null
+height: 780, caption: '上周的分镜表', source: '截图 · 2026-10',
+```
+截图会被处理成 A 墨双色调——任何截图进来都自动“属于”这套视觉,不用调色。
+
+---
+
+## 选哪个?
+
+```
+台词里有数字吗?
+├─ 一个数字 → number
+├─ 两个同单位的数字 → compare
+├─ 多 → 少 → converge
+└─ 数字 + “连接/关系” → network
+有顺序的几步? → steps
+几项里挑一个? → focus
+先错后对? → versus
+整段的结论 / 钩子? → quote
+章节口? → title
+要看原件? → shot
+```
diff --git a/scripts/check_setup.mjs b/scripts/check_setup.mjs
new file mode 100644
index 0000000..e72facc
--- /dev/null
+++ b/scripts/check_setup.mjs
@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+// 环境自检:Node ≥ 22(自带 WebSocket)、Chrome/Chromium(真的启动一次)、ffmpeg/ffprobe、assets(样式·动效·字体)
+import { spawnSync } from 'node:child_process';
+import { existsSync } from 'node:fs';
+import { join } from 'node:path';
+import { findChrome, launch } from './lib/chrome.mjs';
+import { SKILL_ROOT } from './lib/project.mjs';
+
+let pass = 0, fail = 0;
+const ok = m => { console.log(' ✅ ' + m); pass++; };
+const bad = (m, detail) => { console.log(' ❌ ' + m); if (detail) console.log(detail.replace(/^/gm, ' ')); fail++; };
+console.log('eian-riso-broll 环境自检\n');
+
+const major = +process.versions.node.split('.')[0];
+major >= 22 ? ok('node ' + process.version) : bad(`node ${process.version} 太旧:需要 ≥ 22(渲染器用 Node 自带的 WebSocket)`);
+
+// 不只找到路径,还真的启动一次:沙箱、缺库这类问题只有启动时才会暴露
+try {
+ const path = findChrome();
+ const c = await launch(); await c.close();
+ ok('Chrome: ' + path);
+} catch (e) { bad('Chrome 不可用(可用环境变量 CHROME=<路径> 指定):', e.message); }
+
+for (const bin of ['ffmpeg', 'ffprobe']) {
+ const r = spawnSync(bin, ['-version'], { encoding: 'utf8' });
+ r.status === 0 ? ok(`${bin} ${r.stdout.split('\n')[0].split(' ')[2]}`) : bad('没有 ' + bin);
+}
+
+const assets = ['riso.css', 'riso.js', 'gsap.min.js', ...['serif', 'sans', 'num', 'mono'].map(f => `fonts/riso-${f}.woff2`)];
+for (const f of assets) existsSync(join(SKILL_ROOT, 'assets', f)) ? ok('assets/' + f) : bad('缺 assets/' + f);
+
+console.log(fail ? `\n${fail} 项未通过。` : `\n全部通过(${pass} 项)。`);
+process.exit(fail ? 1 : 0);
diff --git a/scripts/lib/args.mjs b/scripts/lib/args.mjs
new file mode 100644
index 0000000..22a883b
--- /dev/null
+++ b/scripts/lib/args.mjs
@@ -0,0 +1,10 @@
+// 命令行参数:从 argv 里取走开关和带值选项,剩下的就是位置参数(文件名、台词……)
+// const a = cli(); const draft = a.has('--draft'), out = a.val('-o'); const files = a.rest;
+export function cli(argv = process.argv.slice(2)) {
+ const a = [...argv];
+ return {
+ has(flag) { const i = a.indexOf(flag); if (i < 0) return false; a.splice(i, 1); return true; },
+ val(flag) { const i = a.indexOf(flag); if (i < 0) return null; const v = a[i + 1]; a.splice(i, 2); return v; },
+ get rest() { return a; },
+ };
+}
diff --git a/scripts/lib/chrome.mjs b/scripts/lib/chrome.mjs
new file mode 100644
index 0000000..354320a
--- /dev/null
+++ b/scripts/lib/chrome.mjs
@@ -0,0 +1,136 @@
+// 极简 headless Chrome 驱动(CDP over WebSocket,Node ≥ 22 自带 WebSocket,零依赖)
+import { spawn, execFileSync } from 'node:child_process';
+import { mkdtempSync, rmSync, existsSync, readdirSync } from 'node:fs';
+import { tmpdir, homedir } from 'node:os';
+import { join } from 'node:path';
+import { pathToFileURL } from 'node:url';
+
+export function findChrome() {
+ if (process.env.CHROME) {
+ if (!existsSync(process.env.CHROME)) throw new Error('环境变量 CHROME 指向的文件不存在:' + process.env.CHROME);
+ return process.env.CHROME;
+ }
+ const cands = [
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
+ '/Applications/Chromium.app/Contents/MacOS/Chromium',
+ ...windowsChromes(),
+ ...['google-chrome', 'google-chrome-stable', 'chromium', 'chromium-browser'].map(n => {
+ if (process.platform === 'win32') return null;
+ try { return execFileSync('which', [n], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim(); } catch { return null; }
+ }),
+ ...playwrightChromes(),
+ ];
+ const hit = cands.find(c => c && existsSync(c));
+ if (!hit) throw new Error('找不到 Chrome / Chromium。设置环境变量 CHROME=<可执行文件路径>');
+ return hit;
+}
+
+// Windows:Chrome 的几个默认安装位置;Edge 也是 Chromium 内核,放最后兜底
+function windowsChromes() {
+ if (process.platform !== 'win32') return [];
+ const roots = [process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)'], process.env.LOCALAPPDATA].filter(Boolean);
+ return [...roots.map(r => join(r, 'Google/Chrome/Application/chrome.exe')), ...roots.map(r => join(r, 'Microsoft/Edge/Application/msedge.exe'))];
+}
+
+// Playwright 下载过的 Chromium(装过 Playwright 的机器、CI 镜像里常见),版本新的优先
+function playwrightChromes() {
+ const roots = [process.env.PLAYWRIGHT_BROWSERS_PATH, join(homedir(), '.cache/ms-playwright'), join(homedir(), 'Library/Caches/ms-playwright'),
+ process.env.LOCALAPPDATA && join(process.env.LOCALAPPDATA, 'ms-playwright')].filter(Boolean);
+ const bins = ['chrome-linux64/chrome', 'chrome-linux/chrome', 'chrome-mac-arm64/Chromium.app/Contents/MacOS/Chromium', 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
+ 'chrome-win64/chrome.exe', 'chrome-win/chrome.exe'];
+ const out = [];
+ for (const r of roots) {
+ let dirs = [];
+ try { dirs = readdirSync(r).filter(d => /^chromium-\d+$/.test(d)).sort((a, b) => b.split('-')[1] - a.split('-')[1]); } catch { continue; }
+ for (const d of dirs) for (const b of bins) out.push(join(r, d, b));
+ }
+ return out;
+}
+
+export async function launch({ width = 1080, height = 1920 } = {}) {
+ const dir = mkdtempSync(join(tmpdir(), 'riso-chrome-'));
+ const proc = spawn(findChrome(), [
+ '--headless=new', '--remote-debugging-port=0', `--user-data-dir=${dir}`,
+ '--no-first-run', '--no-default-browser-check', '--hide-scrollbars', '--mute-audio',
+ '--force-device-scale-factor=1', `--window-size=${width},${height}`,
+ '--force-color-profile=srgb', '--allow-file-access-from-files', '--disable-background-timer-throttling',
+ '--disable-renderer-backgrounding',
+ // root 身份(Docker / CI / 云端容器)下 Chrome 拒绝在沙箱里启动;普通用户不加
+ ...(process.getuid?.() === 0 ? ['--no-sandbox'] : []),
+ 'about:blank',
+ ], { stdio: ['ignore', 'ignore', 'pipe'] });
+
+ // 启动失败时把 Chrome 自己的报错带出来,否则只剩一个退出码
+ let buf = '';
+ const tail = () => buf.trim().split('\n').slice(-8).join('\n');
+ const wsUrl = await new Promise((res, rej) => {
+ const to = setTimeout(() => rej(new Error('Chrome 启动超时(20s)\n' + tail())), 20000);
+ proc.on('error', e => { clearTimeout(to); rej(new Error('Chrome 无法启动:' + e.message)); });
+ proc.stderr.on('data', d => {
+ buf += d;
+ const m = buf.match(/DevTools listening on (ws:\/\/\S+)/);
+ if (m) { clearTimeout(to); res(m[1]); }
+ });
+ proc.on('exit', c => { clearTimeout(to); rej(new Error(`Chrome 退出 code=${c}\n${tail()}`)); });
+ });
+ proc.stderr.resume();
+
+ const ws = new WebSocket(wsUrl);
+ await new Promise((r, j) => { ws.onopen = r; ws.onerror = j; });
+ let id = 0;
+ const pending = new Map(), listeners = new Set();
+ ws.onmessage = e => {
+ const m = JSON.parse(e.data);
+ if (m.id && pending.has(m.id)) {
+ const { res, rej } = pending.get(m.id); pending.delete(m.id);
+ m.error ? rej(new Error(m.error.message)) : res(m.result);
+ } else listeners.forEach(f => f(m));
+ };
+ const send = (method, params = {}, sessionId) => new Promise((res, rej) => {
+ const i = ++id; pending.set(i, { res, rej });
+ ws.send(JSON.stringify({ id: i, method, params, sessionId }));
+ });
+
+ async function open(file, { query = '', alpha = false } = {}) {
+ const { targetId } = await send('Target.createTarget', { url: 'about:blank' });
+ const { sessionId: sid } = await send('Target.attachToTarget', { targetId, flatten: true });
+ const errors = [];
+ listeners.add(m => {
+ if (m.sessionId !== sid) return;
+ if (m.method === 'Runtime.exceptionThrown') errors.push(m.params.exceptionDetails.exception?.description || m.params.exceptionDetails.text);
+ if (m.method === 'Runtime.consoleAPICalled' && m.params.type === 'error') errors.push(m.params.args.map(a => a.value ?? a.description).join(' '));
+ });
+ await send('Page.enable', {}, sid);
+ await send('Runtime.enable', {}, sid);
+ await send('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false }, sid);
+ if (alpha) await send('Emulation.setDefaultBackgroundColorOverride', { color: { r: 0, g: 0, b: 0, a: 0 } }, sid);
+ const loaded = new Promise(r => listeners.add(m => { if (m.sessionId === sid && m.method === 'Page.loadEventFired') r(); }));
+ await send('Page.navigate', { url: pathToFileURL(file).href + query }, sid);
+ await loaded;
+
+ const evaluate = async expr => {
+ const r = await send('Runtime.evaluate', { expression: expr, awaitPromise: true, returnByValue: true }, sid);
+ if (r.exceptionDetails) throw new Error((r.exceptionDetails.exception?.description || r.exceptionDetails.text) + '\n' + errors.join('\n'));
+ return r.result.value;
+ };
+ const ok = await evaluate(`new Promise(r => { const w = () => window.__riso ? r(true) : setTimeout(w, 30); w(); setTimeout(() => r(false), 8000); })`);
+ if (!ok) throw new Error('页面没有调用 Riso.comp()(没有 window.__riso)\n' + errors.join('\n'));
+ await evaluate('window.__riso.ready');
+ if (errors.length) throw new Error('页面脚本报错:\n' + errors.join('\n'));
+
+ return {
+ evaluate,
+ meta: () => evaluate('window.__riso.meta()'),
+ seek: t => evaluate(`window.__riso.seek(${JSON.stringify(t)})`),
+ shot: async (format = 'png') => Buffer.from((await send('Page.captureScreenshot', { format, ...(format === 'jpeg' ? { quality: 95 } : {}), optimizeForSpeed: true }, sid)).data, 'base64'),
+ close: () => send('Target.closeTarget', { targetId }),
+ };
+ }
+
+ async function close() {
+ await Promise.race([send('Browser.close').catch(() => { }), new Promise(r => setTimeout(r, 800))]);
+ ws.close(); proc.kill('SIGKILL');
+ try { rmSync(dir, { recursive: true, force: true }); } catch { }
+ }
+ return { open, close };
+}
diff --git a/scripts/lib/media.mjs b/scripts/lib/media.mjs
new file mode 100644
index 0000000..26c4ff4
--- /dev/null
+++ b/scripts/lib/media.mjs
@@ -0,0 +1,30 @@
+// ffmpeg / ffprobe:跑命令、拼 contact sheet、读成片参数
+import { spawn, spawnSync } from 'node:child_process';
+
+export const run = (cmd, args) => new Promise((res, rej) => {
+ const p = spawn(cmd, args, { stdio: ['ignore', 'ignore', 'pipe'] });
+ let err = ''; p.stderr.on('data', d => err += d);
+ p.on('error', e => rej(new Error(`${cmd} 无法启动:${e.message}`)));
+ p.on('close', c => c ? rej(new Error(`${cmd} 失败:\n${err.slice(-2000)}`)) : res());
+});
+
+// 多张竖图拼成一张网格,空位补深灰
+export function contactSheet(images, out, { cols = 4, w = 432, h = 768, gap = 12, bg = '0x161616', quality = 3 } = {}) {
+ cols = Math.min(cols, images.length);
+ const n = cols * Math.ceil(images.length / cols);
+ const fill = Array.from({ length: n - images.length }, () => ['-f', 'lavfi', '-i', `color=c=${bg}:s=${w}x${h}:d=1`]).flat();
+ const layout = Array.from({ length: n }, (_, i) => `${(i % cols) * (w + gap)}_${Math.floor(i / cols) * (h + gap)}`).join('|');
+ const fc = Array.from({ length: n }, (_, i) => i < images.length ? `[${i}:v]scale=${w}:${h}:flags=lanczos[s${i}]` : `[${i}:v]null[s${i}]`).join(';') + ';' +
+ Array.from({ length: n }, (_, i) => `[s${i}]`).join('') +
+ `xstack=inputs=${n}:layout=${layout}:fill=${bg},pad=iw+${gap * 2}:ih+${gap * 2}:${gap}:${gap}:color=${bg}`;
+ return run('ffmpeg', ['-v', 'error', '-y', ...images.flatMap(s => ['-i', s]), ...fill, '-filter_complex', fc, '-frames:v', '1', '-q:v', String(quality), out]);
+}
+
+// 成片的时长与尺寸;读不到时返回 null
+export function probe(file) {
+ const p = spawnSync('ffprobe', ['-v', 'error', '-select_streams', 'v:0', '-show_entries', 'format=duration:stream=width,height', '-of', 'json', file], { encoding: 'utf8' });
+ try {
+ const j = JSON.parse(p.stdout), v = j.streams[0];
+ return { duration: +j.format.duration, width: v.width, height: v.height };
+ } catch { return null; }
+}
diff --git a/scripts/lib/project.mjs b/scripts/lib/project.mjs
new file mode 100644
index 0000000..1bb49de
--- /dev/null
+++ b/scripts/lib/project.mjs
@@ -0,0 +1,36 @@
+// 项目目录:一条视频一个自包含的文件夹(assets 整份拷入,换机器也能渲)
+// <项目>/compositions/NN-名字.html plates/ 样帧 renders/ 成片 qa/ 质检图 assets/ 样式·动效·字体·截图
+import { cpSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
+import { homedir } from 'node:os';
+import { basename, dirname, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+export const SKILL_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
+export const PROJECTS_DIR = process.env.RISO_PROJECTS_DIR || join(homedir(), 'eian-riso-broll-projects');
+
+// composition 所在的项目根:compositions/x.html → 项目根;散放的 x.html → 它所在的目录
+export const projectOf = file => basename(dirname(file)) === 'compositions' ? dirname(dirname(file)) : dirname(file);
+
+const STORYBOARD = `# 分镜表
+
+| # | 原话落点 | 模板 | 色本 | 时长 | 屏幕文字(只用原话) | 截图锚点 |
+|---|---|---|---|---|---|---|
+
+落选段:
+`;
+
+// 新建项目目录;已存在且非空时报错,不覆盖
+export function createProject(dir) {
+ if (existsSync(join(dir, 'compositions'))) throw new Error('已存在: ' + dir);
+ for (const d of ['compositions', 'plates', 'renders', 'qa', 'assets/shots']) mkdirSync(join(dir, d), { recursive: true });
+ cpSync(join(SKILL_ROOT, 'assets'), join(dir, 'assets'), { recursive: true });
+ writeFileSync(join(dir, 'STORYBOARD.md'), STORYBOARD);
+ return dir;
+}
+
+// 把模板拷进项目:addTemplate(proj, 'number', '03-number') → compositions/03-number.html
+export function addTemplate(dir, template, name = template) {
+ const f = join(dir, 'compositions', name + '.html');
+ cpSync(join(SKILL_ROOT, 'templates', template + '.html'), f);
+ return f;
+}
diff --git a/scripts/new_project.mjs b/scripts/new_project.mjs
new file mode 100644
index 0000000..c5f7c13
--- /dev/null
+++ b/scripts/new_project.mjs
@@ -0,0 +1,11 @@
+#!/usr/bin/env node
+// 新建项目:node new_project.mjs <项目名> → 打印项目路径
+// 落在 $RISO_PROJECTS_DIR(默认 ~/eian-riso-broll-projects)/<项目名>/;assets 整份拷入,项目自包含
+import { join } from 'node:path';
+import { createProject, PROJECTS_DIR } from './lib/project.mjs';
+
+const name = process.argv[2];
+if (!name) { console.error('用法: new_project.mjs <项目名,如 2026-10-07-第12期>'); process.exit(2); }
+try {
+ console.log(createProject(join(PROJECTS_DIR, name)));
+} catch (e) { console.error(e.message); process.exit(1); }
diff --git a/scripts/qa.mjs b/scripts/qa.mjs
new file mode 100755
index 0000000..de67f64
--- /dev/null
+++ b/scripts/qa.mjs
@@ -0,0 +1,66 @@
+#!/usr/bin/env node
+// 质检:node qa.mjs compositions/*.html
+// 1. 版面(末帧,镜头归零后的版面坐标):安全区、右侧按钮栏、字号、对比度、文字互压、fit 溢出 —— 由页面里的 __riso.audit() 计算
+// 2. 成片(renders/<id>.mp4 存在时):时长、尺寸
+// 每条输出 qa/<id>-audit.png:安全区叠层 + 红框标出问题元素。有 error 时退出码 1。
+import { mkdirSync, writeFileSync, existsSync } from 'node:fs';
+import { resolve, dirname, join } from 'node:path';
+import { launch } from './lib/chrome.mjs';
+import { projectOf } from './lib/project.mjs';
+import { probe } from './lib/media.mjs';
+
+const files = process.argv.slice(2).map(f => resolve(f));
+if (!files.length) { console.error('用法: qa.mjs <composition.html> [...]'); process.exit(2); }
+
+// 叠层图:安全区的数字全部来自页面里的 Riso.ZONE(meta().zone),这里不再写死
+const OVERLAY = (issues, { width: W, height: H, zone: Z }) => `(() => {
+ const o = document.createElement('div'); o.id = '__qa';
+ o.style.cssText = 'position:fixed;inset:0;z-index:9999;pointer-events:none;font:600 22px monospace';
+ const box = (x, y, w, h, css) => { const d = document.createElement('div'); d.style.cssText = 'position:absolute;left:'+x+'px;top:'+y+'px;width:'+w+'px;height:'+h+'px;'+css; o.appendChild(d); return d; };
+ box(0, 0, ${W}, ${Z.top}, 'background:rgba(255,0,0,.10)');
+ box(0, ${Z.bottom}, ${W}, ${H - Z.bottom}, 'background:repeating-linear-gradient(45deg,rgba(0,0,0,.10) 0 12px,transparent 12px 24px)');
+ box(${Z.left}, ${Z.top}, ${Z.right - Z.left}, ${Z.bottom - Z.top}, 'outline:3px dashed rgba(0,160,90,.9)');
+ box(${Z.rail.x}, ${Z.rail.y0}, ${W - Z.rail.x}, ${Z.rail.y1 - Z.rail.y0}, 'background:rgba(255,140,0,.16);outline:2px solid rgba(255,140,0,.6)');
+ const t = box(0, ${Z.bottom + 10}, ${W}, 40, 'color:#000;text-align:center'); t.textContent = '字幕床(只放装饰)';
+ ${JSON.stringify(issues)}.forEach(([lv, who, msg, r], i) => { if (!r) return;
+ const b = box(r[0] - 4, r[1] - 4, r[2] + 8, r[3] + 8, 'outline:5px solid ' + (lv === 'error' ? '#E00' : '#F80'));
+ const l = document.createElement('div'); l.textContent = (i + 1); l.style.cssText = 'position:absolute;left:-4px;top:-34px;background:#E00;color:#fff;padding:2px 8px'; b.appendChild(l); });
+ document.body.appendChild(o);
+})()`;
+
+let errors = 0, warns = 0;
+const chrome = await launch();
+try {
+ for (const file of files) {
+ const page = await chrome.open(file, { query: '?render' });
+ const m = await page.meta();
+ await page.seek('end');
+ const a = await page.evaluate('window.__riso.audit()');
+ const issues = a.issues;
+
+ // 成片检查
+ const mp4 = join(projectOf(file), 'renders', m.id + '.mp4');
+ if (existsSync(mp4)) {
+ const v = probe(mp4);
+ if (!v) issues.push(['error', 'render', '成片读不出来(ffprobe 失败),重渲一次']);
+ else {
+ if (Math.abs(v.duration - m.duration) > .1) issues.push(['warn', 'render', `成片时长 ${v.duration.toFixed(2)}s ≠ composition ${m.duration}s(改过时长没重渲?)`]);
+ if (v.width !== m.width || v.height !== m.height) issues.push(['error', 'render', `成片尺寸 ${v.width}×${v.height},应为 ${m.width}×${m.height}`]);
+ }
+ } else issues.push(['info', 'render', '还没有成片(只检查了版面)']);
+
+ // 叠层截图
+ const out = join(projectOf(file), 'qa', m.id + '-audit.png');
+ mkdirSync(dirname(out), { recursive: true });
+ await page.evaluate(OVERLAY(issues, m));
+ writeFileSync(out, await page.shot('png'));
+ await page.close();
+
+ const e = issues.filter(i => i[0] === 'error').length, w = issues.filter(i => i[0] === 'warn').length;
+ errors += e; warns += w;
+ console.log(`${e ? '✗' : w ? '△' : '✓'} ${m.id} ${m.duration}s · ${a.texts} 个文字元素 → ${out}`);
+ issues.forEach(([lv, who, msg, r], i) => console.log(` ${lv === 'error' ? 'ERROR' : lv === 'warn' ? 'warn ' : 'info '} ${r ? '[' + (i + 1) + '] ' : ''}${who}: ${msg}`));
+ }
+} finally { await chrome.close(); }
+console.log(`\n${files.length} 条 · ${errors} error · ${warns} warn`);
+process.exit(errors ? 1 : 0);
diff --git a/scripts/render.mjs b/scripts/render.mjs
new file mode 100755
index 0000000..b6dc38a
--- /dev/null
+++ b/scripts/render.mjs
@@ -0,0 +1,80 @@
+#!/usr/bin/env node
+// 渲染器:逐帧 seek → 截图 → ffmpeg。成片只有画面,不带音轨。
+//
+// node render.mjs compositions/01-x.html [更多.html] → renders/<id>.mp4(H.264,无音轨)
+// node render.mjs compositions/*.html --still → plates/<id>.png(末帧海报)+ plates/sheet.jpg
+// node render.mjs x.html --at 1.2 → plates/<id>@1.2.png(任意时刻)
+// node render.mjs x.html --alpha → renders/<id>.mov(ProRes 4444 透明底,叠在口播上用)
+// 选项:--draft(快速低码率) --calm(纸纹不动、不推镜,只给压 GIF 用) -o <输出路径>(只渲一条时可用)
+import { spawn } from 'node:child_process';
+import { mkdirSync, writeFileSync, existsSync } from 'node:fs';
+import { resolve, dirname, join } from 'node:path';
+import { once } from 'node:events';
+import { launch } from './lib/chrome.mjs';
+import { cli } from './lib/args.mjs';
+import { projectOf } from './lib/project.mjs';
+import { contactSheet } from './lib/media.mjs';
+
+const a = cli();
+const STILL = a.has('--still'), ALPHA = a.has('--alpha'), DRAFT = a.has('--draft'), CALM = a.has('--calm');
+const AT = a.val('--at'), OUT = a.val('-o');
+const files = a.rest.map(f => resolve(f));
+if (!files.length) { console.error('用法: render.mjs <composition.html> [...] [--still|--at t|--alpha|--draft] [-o out]'); process.exit(2); }
+for (const f of files) if (!existsSync(f)) { console.error('找不到 ' + f); process.exit(2); }
+
+const chrome = await launch();
+const stills = [];
+try {
+ for (const file of files) {
+ const t0 = Date.now();
+ const page = await chrome.open(file, { query: '?render' + (ALPHA ? '&alpha' : '') + (CALM ? '&calm' : ''), alpha: ALPHA });
+ const m = await page.meta();
+ const proj = projectOf(file);
+
+ if (STILL || AT != null) {
+ const at = AT != null ? +AT : 'end';
+ const out = OUT || join(proj, 'plates', m.id + (AT != null ? '@' + AT : '') + '.png');
+ mkdirSync(dirname(out), { recursive: true });
+ await page.seek(at);
+ writeFileSync(out, await page.shot('png'));
+ stills.push(out);
+ console.log(`✓ ${m.id} 样帧 → ${out}`);
+ await page.close();
+ continue;
+ }
+
+ const out = OUT || join(proj, 'renders', m.id + (ALPHA ? '.mov' : '.mp4'));
+ mkdirSync(dirname(out), { recursive: true });
+ const N = Math.round(m.duration * m.fps), D = (N / m.fps).toFixed(3);
+
+ const venc = ALPHA
+ ? ['-c:v', 'prores_ks', '-profile:v', '4444', '-pix_fmt', 'yuva444p10le']
+ : ['-c:v', 'libx264', '-preset', DRAFT ? 'veryfast' : 'medium', '-crf', DRAFT ? '24' : '18', '-maxrate', '24M', '-bufsize', '48M',
+ '-pix_fmt', 'yuv420p', '-movflags', '+faststart'];
+ const ff = spawn('ffmpeg', ['-v', 'error', '-y', '-f', 'image2pipe', '-framerate', String(m.fps), '-i', '-', '-an', ...venc, '-r', String(m.fps), '-t', D, out],
+ { stdio: ['pipe', 'ignore', 'pipe'] });
+ let ferr = ''; ff.stderr.on('data', d => ferr += d);
+ const done = new Promise((res, rej) => ff.on('close', c => c ? rej(new Error('ffmpeg 失败:\n' + ferr.slice(-2000))) : res()));
+
+ for (let i = 0; i < N; i++) {
+ await page.seek(i / m.fps);
+ const buf = await page.shot(ALPHA ? 'png' : 'jpeg');
+ if (!ff.stdin.write(buf)) await once(ff.stdin, 'drain');
+ if (process.stdout.isTTY) process.stdout.write(`\r ${m.id} ${i + 1}/${N}`);
+ }
+ ff.stdin.end();
+ await done;
+ await page.close();
+ if (process.stdout.isTTY) process.stdout.write('\r');
+ console.log(`✓ ${m.id} ${D}s · ${N} 帧 · ${((Date.now() - t0) / 1000).toFixed(1)}s → ${out}`);
+ }
+
+ // 多张样帧 → 自动拼一张 contact sheet(每行 4 张)
+ if (stills.length > 1 && !OUT) {
+ const sheet = join(dirname(stills[0]), 'sheet.jpg');
+ await contactSheet(stills, sheet, { cols: 4 });
+ console.log(`✓ contact sheet → ${sheet}`);
+ }
+} finally {
+ await chrome.close();
+}
diff --git a/scripts/timing.mjs b/scripts/timing.mjs
new file mode 100755
index 0000000..dc20529
--- /dev/null
+++ b/scripts/timing.mjs
@@ -0,0 +1,60 @@
+#!/usr/bin/env node
+// 时长:B-roll 的长度由口播决定,不是固定 5 秒。
+//
+// node timing.mjs "做一张信息图,以前要 40 分钟,现在 2 分钟"
+// → 按语速估算(默认 4.5 字/秒,--rate 改)
+// node timing.mjs --srt examples/demo.srt "能挑出 12 处值得配画面的信息" "以前要 40 分钟,现在 2 分钟"
+// → 在字幕里找到这句话(忽略标点空格),给出精确的入点 / 出点 / 时长
+//
+// 建议 composition 时长 = 口播时长 + 0.6s(前后各留一点给剪辑点);最短 3s。
+import { readFileSync } from 'node:fs';
+import { cli } from './lib/args.mjs';
+
+const a = cli();
+const srtPath = a.val('--srt'), rate = +(a.val('--rate') || 4.5), args = a.rest;
+if (!args.length) { console.error('用法: timing.mjs [--srt file.srt] [--rate 4.5] "台词" ["台词" ...]'); process.exit(2); }
+
+const norm = s => s.replace(/[\s\p{P}\p{S}]/gu, '').toLowerCase();
+// 读音单位:一个汉字 = 1;一串英文/数字按“读出来”的长度粗估
+function units(s) {
+ let n = 0;
+ for (const m of s.matchAll(/[一-鿿]|[a-z]+|\d+(?:\.\d+)?/gi)) {
+ const w = m[0];
+ if (/[一-鿿]/.test(w)) n += 1;
+ else if (/^\d/.test(w)) n += Math.min(6, Math.max(1, w.replace('.', '').length * .8)); // 1800 ≈ “一千八” 3 字
+ else n += Math.max(1, w.length / 3);
+ }
+ return n;
+}
+const suggest = d => Math.max(3, Math.round((d + .6) * 2) / 2);
+const ts = t => { const m = Math.floor(t / 60), s = (t % 60).toFixed(2).padStart(5, '0'); return `${m}:${s}`; };
+
+if (!srtPath) {
+ for (const q of args) {
+ const d = units(q) / rate;
+ console.log(`“${q}”\n ≈ ${units(q).toFixed(1)} 字 / ${rate} 字每秒 = 口播 ${d.toFixed(2)}s → 建议 duration: ${suggest(d)}`);
+ }
+ process.exit(0);
+}
+
+// 解析 SRT
+const toSec = s => { const [h, m, r] = s.split(':'); return +h * 3600 + +m * 60 + +r.replace(',', '.'); };
+const cues = readFileSync(srtPath, 'utf8').replace(/\r/g, '').split(/\n\n+/).map(b => {
+ const l = b.trim().split('\n'); const i = l.findIndex(x => x.includes('-->'));
+ if (i < 0) return null;
+ const [a, z] = l[i].split('-->').map(x => toSec(x.trim()));
+ return { a, z, text: norm(l.slice(i + 1).join('')) };
+}).filter(Boolean);
+// 拼成一条长串,记住每个字属于哪条字幕、在那条里的位置 → 句中入点按字数线性插值
+let all = '', map = [];
+cues.forEach((c, k) => { for (let j = 0; j < c.text.length; j++) map.push([k, j]); all += c.text; });
+const at = (idx, end) => { const [k, j] = map[idx], c = cues[k], n = c.text.length; return c.a + (c.z - c.a) * ((j + (end ? 1 : 0)) / n); };
+
+let miss = 0;
+for (const q of args) {
+ const nq = norm(q), i = all.indexOf(nq);
+ if (i < 0) { console.log(`“${q}”\n ✗ 字幕里没找到(检查错别字 / 数字写法:SRT 里可能是“一千八”而不是“1800”)`); miss++; continue; }
+ const a = at(i, false), z = at(i + nq.length - 1, true), d = z - a;
+ console.log(`“${q}”\n 入点 ${ts(a)} 出点 ${ts(z)} 口播 ${d.toFixed(2)}s → 建议 duration: ${suggest(d)}(剪辑台从 ${ts(Math.max(0, a - .3))} 放入)`);
+}
+process.exit(miss ? 1 : 0);
diff --git a/templates/compare.html b/templates/compare.html
new file mode 100644
index 0000000..88f6cc0
--- /dev/null
+++ b/templates/compare.html
@@ -0,0 +1,85 @@
+<!doctype html>
+<!-- 模板 · compare · 前后对比(同一单位的两个量)
+ 用于:以前 X → 现在 Y(40 分钟 → 2 分钟;3 天 → 2 小时;100 次 → 7 次)。
+ 画面:两根条按真实比例画 —— “以前”那根慢慢长满(时间在流逝),“现在”那根一下就到。
+ 动效本身就是论点:慢 vs 快,看一眼就懂。比例必须真实(同一单位换算后再算长度)。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #title { left:var(--gutter); top:292px }
+ .row { position:absolute; left:var(--gutter); right:var(--gutter) }
+ .row .lb { position:absolute; left:0; top:0 }
+ .row .v { position:absolute; left:0; font-size:300px }
+ .row .u { position:absolute }
+ .row .bar { position:absolute; left:0; height:64px; transform-origin:left center }
+ .row .track{ position:absolute; left:0; right:0; height:64px; border:3px dashed var(--a); opacity:.28 }
+ #scale { position:absolute; right:var(--gutter) }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="title" class="hd hd-m a t"></div>
+ <div class="row" id="ra"><div class="lb a t"></div><div class="v num a t"></div><div class="u hd hd-m a t"></div><div class="track"></div><div class="bar fill-a"></div></div>
+ <div class="row" id="rb"><div class="lb a t"></div><div class="v num b t" data-overprint></div><div class="u hd hd-m a t"></div><div class="track"></div><div class="bar fill-b"></div></div>
+ <div id="scale" class="mono a t">条长 = 真实比例</div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['04 · 效率', '04 / 10'],
+ title: '做一张信息图', // 比较的是什么(≤ 8 字)
+ before: { label: '以前', value: 40, unit: '分钟', base: 2400 }, // base = 换算成同一单位(秒)
+ after: { label: '现在', value: 2, unit: '分钟', base: 120 },
+ duration: 4.5,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 44 }, C => {
+ // ── 版面 ──
+ Riso.text(title, DATA.title);
+ const W = 936, max = Math.max(DATA.before.base, DATA.after.base);
+ let y = Riso.box(title).bottom + 70;
+ const rows = [[ra, DATA.before], [rb, DATA.after]].map(([r, d]) => {
+ const [lb, v, u, track, bar] = r.children;
+ Riso.text(lb, d.label); v.textContent = d.value; Riso.text(u, d.unit);
+ r.style.top = y + 'px';
+ const vi = Riso.inkBox(v);
+ v.style.top = v.offsetTop + (y + 70 - vi.top) + 'px'; // 数字墨迹顶 = 标签下 70px
+ const v2 = Riso.inkBox(v);
+ u.style.left = (v2.right - 72 + 22) + 'px';
+ u.style.top = (v2.bottom - y - u.offsetHeight * .86) + 'px'; // 单位坐在数字基线上
+ const by = v2.bottom - y + 36;
+ bar.style.top = track.style.top = by + 'px';
+ bar.style.width = Math.max(14, W * d.base / max) + 'px';
+ y += by + 64 + 72;
+ return { r, lb, v, u, track, bar, d };
+ });
+ const tb = Riso.box(title);
+ scale.style.top = (tb.bottom - 40) + 'px'; // 和标题同一行、右对齐(避开右侧按钮栏)
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.rise(title, .08);
+ const [A, B] = rows;
+ // 以前:慢 —— 条匀速长满,数字同步爬升
+ C.rise(A.lb, .45);
+ C.roll(A.track, .55, { dur: .4 });
+ C.tl.fromTo(A.bar, { scaleX: 0 }, { scaleX: 1, duration: 1.35, ease: 'none', immediateRender: true }, .7);
+ C.count(A.v, .7, { to: A.d.value, dur: 1.35, ease: 'none', fmt: v => Math.round(v) });
+ C.rise(A.u, .9);
+ // 现在:快 —— 一下到位,盖章
+ C.rise(B.lb, 2.25);
+ C.roll(B.track, 2.3, { dur: .3 });
+ C.tl.fromTo(B.bar, { scaleX: 0 }, { scaleX: 1, duration: .12, ease: 'power2.out', immediateRender: true }, 2.5);
+ const land = C.stamp(B.v, 2.45, { rot: -7 });
+ C.rise(B.u, land + .05);
+ C.register(land + .25);
+ C.roll('#scale', land + .5, { dur: .45 });
+});
+</script>
+</body></html>
diff --git a/templates/converge.html b/templates/converge.html
new file mode 100644
index 0000000..8f5a1a1
--- /dev/null
+++ b/templates/converge.html
@@ -0,0 +1,113 @@
+<!doctype html>
+<!-- 模板 · converge · 收敛 / 归类
+ 用于:很多 → 很少(30 多套工程收敛成 4 类;50 个候选筛到 3 个)。
+ 画面:上方「多 → 少」两个数字对照;下方先铺满 N 张小卡(A 墨线框,逐张弹落),
+ 然后小卡分组飞向 K 个大块并被“吸收”,大块用 B 墨网点显影,最后少的那个数字盖章。
+ 大类名字台词没给就留空(只放序号),绝不替用户编。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #from, #to { top:300px }
+ #from { left:var(--gutter) }
+ #to { right:var(--gutter); text-align:right }
+ .big { font-size:300px }
+ .cap { position:absolute; white-space:nowrap }
+ #arrow{ top:0; left:0; width:1080px; height:600px; overflow:visible }
+ #arrow path{ fill:none; stroke:var(--a); stroke-width:6; stroke-linecap:square }
+ #field{ inset:0 }
+ .chip { position:absolute; border:4px solid var(--a); background:var(--paper); border-radius:3px }
+ .blk { position:absolute; border:4px solid var(--a); border-radius:3px }
+ .blk .tone{ position:absolute; inset:10px; --td:3.4px }
+ .blk .ix{ position:absolute; left:22px; top:20px; color:var(--a); mix-blend-mode:multiply }
+ .blk .nm{ position:absolute; left:22px; bottom:18px }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="from"><div id="fn" class="num big a t"></div><div id="fc" class="cap hd hd-s a t"></div></div>
+ <div id="to"><div id="tn" class="num big b t"></div><div id="tc" class="cap hd hd-s a t"></div></div>
+ <svg id="arrow"><path id="ap" d=""/></svg>
+ <div id="field"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['05 · 归类', '05 / 10'],
+ from: { n: '30+', cap: '套动效工程', count: 30 }, // count = 画多少张小卡(≤ 36)
+ to: { n: '4', cap: '类', count: 4 }, // 2–6 个大块
+ names: ['数字', '流程', '对比', '金句'], // 大类名称:台词给了才填,否则留空数组
+ duration: 8.5,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 33 }, C => {
+ // ── 版面:两个数字 + 一根箭头 ──
+ fn.textContent = DATA.from.n; tn.textContent = DATA.to.n;
+ Riso.text(fc, DATA.from.cap); Riso.text(tc, DATA.to.cap);
+ const fi = Riso.inkBox(fn);
+ for (const cap of [fc, tc]) cap.style.top = (fi.bottom - from.offsetTop + 30) + 'px';
+ tc.style.right = '0';
+ const ax0 = Riso.box(fn).right + 56, ax1 = Riso.box(to).left - 56, ay = (fi.top + fi.bottom) / 2;
+ ap.setAttribute('d', `M${ax0},${ay} L${ax1},${ay} M${ax1 - 34},${ay - 30} L${ax1},${ay} L${ax1 - 34},${ay + 30}`);
+
+ // ── 小卡网格(上)与大块(下)共用同一块区域 ──
+ const top = fi.bottom + 150, bottom = 1290, W = 936, x0 = 72;
+ const N = Math.min(DATA.from.count, 36), K = DATA.to.count;
+ const cols = 6, rows = Math.ceil(N / cols), g = 18;
+ const cw = (W - g * (cols - 1)) / cols, ch = Math.min(64, (bottom - top - g * (rows - 1)) / rows);
+ const kc = K <= 3 ? 1 : 2, kr = Math.ceil(K / kc), G = 26;
+ const bw = (W - G * (kc - 1)) / kc, bh = (bottom - top - G * (kr - 1)) / kr;
+ const blocks = [];
+ for (let k = 0; k < K; k++) {
+ const b = document.createElement('div');
+ b.className = 'blk';
+ const x = x0 + (k % kc) * (bw + G), y = top + Math.floor(k / kc) * (bh + G);
+ Object.assign(b.style, { left: x + 'px', top: y + 'px', width: bw + 'px', height: bh + 'px' });
+ b.innerHTML = `<div class="tone fill-b tint"></div><div class="ix mono t">${String(k + 1).padStart(2, '0')}</div>` + (DATA.names[k] ? `<div class="nm hd hd-s a t">${DATA.names[k]}</div>` : '');
+ field.appendChild(b);
+ blocks.push({ el: b, cx: x + bw / 2, cy: y + bh / 2 });
+ }
+ const chips = [];
+ for (let i = 0; i < N; i++) {
+ const c = document.createElement('div');
+ c.className = 'chip';
+ const x = x0 + (i % cols) * (cw + g), y = top + Math.floor(i / cols) * (ch + g) + (bottom - top - rows * ch - (rows - 1) * g) / 2;
+ Object.assign(c.style, { left: x + 'px', top: y + 'px', width: cw + 'px', height: ch + 'px' });
+ field.appendChild(c);
+ // 归到最近的大块
+ let best = 0, bd = 1e9;
+ blocks.forEach((b, k) => { const d = Math.hypot(b.cx - (x + cw / 2), b.cy - (y + ch / 2)); if (d < bd) { bd = d; best = k; } });
+ chips.push({ el: c, dx: blocks[best].cx - (x + cw / 2), dy: blocks[best].cy - (y + ch / 2), k: best });
+ }
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.print(fn, .05, { dur: .55 });
+ C.rise(fc, .2);
+ // 小卡逐张落下(随机顺序,铺满约 1 秒)
+ const order = chips.map((_, i) => i).sort(() => C.rand() - .5);
+ order.forEach((i, j) => {
+ const t = .35 + j * (1.0 / N);
+ C.tl.fromTo(chips[i].el, { scale: 0, rotation: (C.rand() - .5) * 30 }, { scale: 1, rotation: (C.rand() - .5) * 4, duration: .32, ease: 'back.out(2)', immediateRender: true }, t);
+ });
+ // 收敛:小卡飞进各自的大块并缩没;大块同时网点显影
+ const tm = 1.75;
+ C.draw('#ap', tm - .2, { dur: .55 });
+ chips.forEach((c, i) => {
+ const d = (c.k * .07) + C.rand() * .12;
+ C.tl.to(c.el, { x: c.dx, y: c.dy, scale: .2, rotation: 0, duration: .55, ease: 'power3.in' }, tm + d);
+ C.tl.to(c.el, { autoAlpha: 0, duration: .08, ease: 'none' }, tm + d + .5);
+ });
+ C.tl.fromTo(blocks.map(b => b.el), { scale: .86, autoAlpha: 0 }, { scale: 1, autoAlpha: 1, duration: .4, stagger: .07, ease: 'back.out(1.8)', immediateRender: true }, tm + .3);
+ C.print(blocks.map(b => b.el.querySelector('.tone')), tm + .4, { dur: .6, stagger: .07, to: 3.4 });
+ C.register(tm + .9);
+ const land = C.stamp(to.querySelector('#tn'), tm + 1.0, { rot: 8 });
+ C.rise(tc, land + .15);
+});
+</script>
+</body></html>
diff --git a/templates/focus.html b/templates/focus.html
new file mode 100644
index 0000000..04397af
--- /dev/null
+++ b/templates/focus.html
@@ -0,0 +1,110 @@
+<!doctype html>
+<!-- 模板 · focus · 多选一 / 卡点
+ 用于:几个并列项里有一个是重点(四组色本里最常用的那组;五个候选里推荐一个)。
+ 画面:并列项是一张张印好的纸条(A 墨线框)依次滑入 → 落选项“退网”成 45% 平网(还读得出,但退后了)→
+ 选中项压上 B 墨色块、往前一步 → 底部结论(数字盖章 + 一句话)。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #title { left:var(--gutter); top:292px }
+ #holder { inset:0 }
+ .slip { position:absolute; left:var(--gutter); right:var(--gutter); --td:9px }
+ .slip .frame{ position:absolute; inset:0; border:4px solid var(--a); border-radius:4px }
+ .slip .bg { position:absolute; inset:0; transform-origin:left center; border-radius:4px }
+ .slip .ix { position:absolute; left:34px; top:50% }
+ .slip .nm { position:absolute; left:170px; top:50% }
+ #vn { left:58px; font-size:250px }
+ #vt { left:var(--gutter) }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="title" class="hd hd-m a t"></div>
+ <div id="holder"></div>
+ <div id="vn" class="num b t" data-overprint></div>
+ <div id="vt" class="hd hd-m a t"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['07 · 色本', '07 / 10'],
+ title: '四组色本',
+ items: ['墨蓝配荧光粉', '深青配橙', '藏青配朱红', '墨黑配明黄'], // 2–5 项,每项 ≤ 7 字
+ pick: 0, // 重点项下标
+ verdict: { n: '70%', text: '的视频都用它' }, // 结论;没有数字时 n 留空字符串
+ duration: 9.5,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 77 }, C => {
+ // ── 版面 ──
+ Riso.text(title, DATA.title);
+ const n = DATA.items.length;
+ const top = Riso.box(title).bottom + 64;
+ const vH = DATA.verdict ? 250 : 0;
+ const h = Math.min(156, (1290 - vH - top - 24 * (n - 1)) / n);
+ const slips = DATA.items.map((s, i) => {
+ const d = document.createElement('div');
+ d.className = 'slip';
+ Object.assign(d.style, { top: top + i * (h + 24) + 'px', height: h + 'px' });
+ d.innerHTML = `<div class="bg fill-b"></div><div class="frame"></div>
+ <div class="ix mono a t">${String(i + 1).padStart(2, '0')}</div><div class="nm hd a t"></div>`;
+ holder.appendChild(d);
+ const nm = d.querySelector('.nm'), ix = d.querySelector('.ix');
+ Riso.text(nm, s);
+ Riso.fit(nm, { width: 700, max: Math.min(84, h * .56), min: 56 });
+ nm.style.marginTop = -nm.offsetHeight / 2 + 'px';
+ ix.style.marginTop = -ix.offsetHeight / 2 + 'px';
+ if (i !== DATA.pick) d.querySelector('.bg').style.display = 'none';
+ return d;
+ });
+ if (DATA.verdict && DATA.verdict.n) {
+ vn.textContent = DATA.verdict.n;
+ Riso.text(vt, DATA.verdict.text);
+ const last = Riso.box(slips[n - 1]).bottom;
+ // 数字和结论排在同一行,行尾停在 x 920(避开右侧按钮栏)。放不下时先把数字从 250 缩到 160,仍放不下再交给 QA
+ for (let size = 250; ; size -= 10) {
+ vn.style.fontSize = size + 'px';
+ vn.style.top = '0px';
+ vn.style.top = (last + 70 - Riso.inkBox(vn).top) + 'px';
+ const vi = Riso.inkBox(vn);
+ delete vt.dataset.overflow;
+ Riso.fit(vt, { width: 920 - vi.right - 28, max: 88, min: 56 });
+ vt.style.left = vi.right + 28 + 'px';
+ vt.style.top = vi.bottom - vt.offsetHeight * .92 + 'px';
+ if (!vt.dataset.overflow || size <= 160) break;
+ }
+ } else if (DATA.verdict) {
+ vn.style.display = 'none';
+ Riso.text(vt, DATA.verdict.text);
+ vt.style.top = Riso.box(slips[n - 1]).bottom + 70 + 'px';
+ } else { vn.style.display = 'none'; vt.style.display = 'none'; }
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.rise(title, .05);
+ slips.forEach((s, i) => {
+ C.slide(s, .45 + i * .18, { x: -1100, dur: .55, ease: 'expo.out' });
+ });
+ const tf = .45 + n * .18 + .6;
+ // 落选项退网:油墨被抽掉一半,变成平网(仍可读)
+ const others = slips.filter((_, i) => i !== DATA.pick);
+ others.forEach(s => s.classList.add('tint'));
+ C.tl.fromTo(others, { '--td': '9px' }, { '--td': '4.4px', duration: .6, ease: 'power2.inOut', immediateRender: false }, tf);
+ // 选中项:B 色块从左刷满,往前一步
+ const pk = slips[DATA.pick];
+ C.bar(pk.querySelector('.bg'), tf + .15, { dur: .5 });
+ C.tl.to(pk, { scale: 1.02, duration: .45, ease: 'back.out(2)' }, tf + .2);
+ C.register(tf + .45);
+ if (DATA.verdict) {
+ const land = DATA.verdict.n ? C.stamp(vn, tf + .7, { rot: -6 }) : tf + .7;
+ C.rise(vt, land + .1);
+ }
+});
+</script>
+</body></html>
diff --git a/templates/network.html b/templates/network.html
new file mode 100644
index 0000000..626abd2
--- /dev/null
+++ b/templates/network.html
@@ -0,0 +1,107 @@
+<!doctype html>
+<!-- 模板 · network · 连接 / 密度 / 规模
+ 用于:关系、链接、网络效应、“越连越密”(1800 条画面连成一个系列;300 个节点互相引用)。
+ 画面:大数字 + 单位叠印 → 一句论点 → 下方一张网从中心向外长出:节点弹出、连线逐条画出,
+ 数字和连线同步爬升到目标值。网是示意(节点数固定 ~40),不代表真实数量,所以不标节点数。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #num { left:58px; top:262px }
+ #unit { right:var(--gutter) }
+ #say { left:var(--gutter) }
+ #net { left:0; top:0; width:1080px; height:1920px; overflow:visible }
+ #net line { stroke:var(--a); stroke-width:2.2; mix-blend-mode:multiply }
+ #mark { transform-origin:left center }
+ #net circle.n { fill:var(--a) }
+ #net circle.h { fill:var(--b); mix-blend-mode:multiply; translate:var(--rx) var(--ry) }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="num" class="num b t" data-overprint></div>
+ <div id="unit" class="hd a t" data-overprint></div>
+ <div id="mark" class="fill-b"></div>
+ <div id="say" class="hd hd-m a t"></div>
+ <svg id="net"></svg>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['06 · 系列感', '06 / 10'],
+ number: 1800,
+ comma: false,
+ unit: '条画面',
+ say: '放在一起[是一个系列]', // 一行 ≤ 10 字;[ ] = 荧光压条
+ nodes: 58, // 网的节点数(示意)
+ duration: 7,
+};
+
+Riso.setup(DATA);
+const fmt = v => DATA.comma ? Math.round(v).toLocaleString('en-US') : String(Math.round(v));
+
+Riso.comp({ duration: DATA.duration, seed: 55 }, C => {
+ // ── 版面 ──
+ num.textContent = fmt(DATA.number);
+ Riso.fit(num, { width: 964, max: 420, min: 220 });
+ num.style.top = num.offsetTop + (300 - Riso.inkBox(num).top) + 'px';
+ const ni = Riso.inkBox(num);
+ unit.textContent = DATA.unit;
+ Riso.fit(unit, { width: 520, max: 118, min: 80 });
+ let u = Riso.inkBox(unit);
+ unit.style.top = unit.offsetTop + (ni.bottom - (u.bottom - u.top) * .4 - u.top) + 'px';
+ u = Riso.inkBox(unit);
+ Riso.text(say, DATA.say);
+ Riso.fit(say, { width: 936, max: 88, min: 60 });
+ say.style.top = (u.bottom + 56) + 'px';
+ const hasMark = Riso.markUnder(mark, say);
+
+ // ── 网:在 say 下方到 1290 之间撒点(最小间距),每点连最近的 2–3 个 + 少量远链 ──
+ const top = Riso.box(say).bottom + 70, bot = 1290, L = 96, R = 984, cx = 540, cy = (top + bot) / 2;
+ const P = [];
+ for (let tries = 0; P.length < DATA.nodes && tries < 5000; tries++) {
+ const x = L + C.rand() * (R - L), y = top + C.rand() * (bot - top);
+ if (P.every(p => Math.hypot(p.x - x, p.y - y) > 58)) P.push({ x, y, d: Math.hypot((x - cx) * .8, y - cy) });
+ }
+ P.sort((a, b) => a.d - b.d); // 从中心向外长
+ const E = [], key = (i, j) => i < j ? i + ':' + j : j + ':' + i, has = new Set();
+ P.forEach((p, i) => {
+ const near = P.map((q, j) => [j, Math.hypot(p.x - q.x, p.y - q.y)]).filter(([j]) => j !== i).sort((a, b) => a[1] - b[1]);
+ for (const [j] of near.slice(0, 2 + (C.rand() < .5 ? 1 : 0))) if (!has.has(key(i, j))) { has.add(key(i, j)); E.push([i, j]); }
+ const far = near.find(([, d]) => d > 150 && d < 270);
+ if (far && C.rand() < .1 && !has.has(key(i, far[0]))) { has.add(key(i, far[0])); E.push([i, far[0]]); }
+ });
+ E.sort((a, b) => Math.max(a[0], a[1]) - Math.max(b[0], b[1]));
+ const NS = 'http://www.w3.org/2000/svg';
+ const lines = E.map(([i, j]) => {
+ const l = document.createElementNS(NS, 'line');
+ l.setAttribute('x1', P[i].x); l.setAttribute('y1', P[i].y); l.setAttribute('x2', P[j].x); l.setAttribute('y2', P[j].y);
+ net.appendChild(l); return l;
+ });
+ const deg = P.map((_, i) => E.filter(e => e.includes(i)).length);
+ const hubs = new Set(deg.map((d, i) => [d, i]).sort((a, b) => b[0] - a[0]).slice(0, 4).map(x => x[1]));
+ const dots = P.map((p, i) => {
+ const c = document.createElementNS(NS, 'circle');
+ c.setAttribute('cx', p.x); c.setAttribute('cy', p.y); c.setAttribute('r', hubs.has(i) ? 22 : 9);
+ c.setAttribute('class', hubs.has(i) ? 'h' : 'n');
+ c.style.transformOrigin = `${p.x}px ${p.y}px`;
+ net.appendChild(c); return c;
+ });
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ const t0 = .55, span = 2.2;
+ C.print(num, t0 - .05, { dur: .6 }); // 和计数同时出现,不先摆一个“0”
+ C.count(num, t0, { to: DATA.number, dur: span + .3, ease: 'power2.in', fmt });
+ C.register(.75);
+ C.stamp(unit, .85, { rot: -6 });
+ const said = C.rise(say, 1.25);
+ if (hasMark) C.bar(mark, said + .1, { dur: .45 });
+ dots.forEach((d, i) => C.tl.fromTo(d, { scale: 0 }, { scale: 1, duration: .35, ease: 'back.out(2.4)', immediateRender: true }, t0 + .2 + span * (i / P.length) * .8));
+ C.draw(lines, t0 + .35, { dur: .32, stagger: span / lines.length });
+});
+</script>
+</body></html>
diff --git a/templates/number.html b/templates/number.html
new file mode 100644
index 0000000..b973533
--- /dev/null
+++ b/templates/number.html
@@ -0,0 +1,71 @@
+<!doctype html>
+<!-- 模板 · number · 数字冲击
+ 用于:台词里有一个能扛住整帧的数字(12 处、90%、3 年)。
+ 画面:超大数字(B 墨,网点显影 + 计数)→ 单位盖章叠印在数字脚上 → 一到两行论点升起 → 重点词荧光压条。
+ 只改 DATA;版面会按字数自动缩放。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #num { left:58px; top:262px; }
+ #unit { right:var(--gutter); }
+ #say { left:var(--gutter); }
+ #mark { transform-origin:left center; }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="num" class="num b t" data-overprint></div>
+ <div id="mark" class="fill-b"></div>
+ <div id="unit" class="hd a t" data-overprint></div>
+ <div id="say" class="hd a t"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['03 · 信息量', '03 / 10'], // 左:段号 · 主题词;右:序号
+ number: 12, // 只用逐字稿里出现的数字
+ prefix: '', suffix: '', // 比如 suffix: '%'
+ comma: false, // ≥10000 时建议 true
+ unit: '处信息', // ≤ 4 字
+ say: '值得配[画面]', // ≤ 2 行,每行 ≤ 8 字;[ ] = 荧光压条
+ duration: 5.5,
+};
+
+Riso.setup(DATA);
+const fmt = v => DATA.prefix + (DATA.comma ? Math.round(v).toLocaleString('en-US') : Math.round(v)) + DATA.suffix;
+
+Riso.comp({ duration: DATA.duration, seed: 11 }, C => {
+ // ── 版面 ──
+ num.textContent = fmt(DATA.number);
+ Riso.fit(num, { width: 964, max: 640, min: 300 });
+ num.style.top = num.offsetTop + (300 - Riso.inkBox(num).top) + 'px'; // 数字墨迹顶 = 300
+ const numInk = Riso.inkBox(num);
+
+ unit.textContent = DATA.unit;
+ Riso.fit(unit, { width: 520, max: 132, min: 88 });
+ let u = Riso.inkBox(unit);
+ unit.style.top = unit.offsetTop + (numInk.bottom - (u.bottom - u.top) * .42 - u.top) + 'px'; // 单位压住数字脚 → 叠印出第三色
+ u = Riso.inkBox(unit);
+ if (u.bottom > 880) { unit.style.right = '160px'; u = Riso.inkBox(unit); } // 数字很高时单位会落进右侧按钮栏(y>880),收到 x 920 以内
+
+ Riso.text(say, DATA.say);
+ Riso.fit(say, { width: 936, max: 112, min: 72 });
+ say.style.top = (u.bottom + 84) + 'px';
+
+ const hasMark = Riso.markUnder(mark, say, { pad: 10 });
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.print(num, .05, { dur: .66 });
+ C.count(num, .05, { to: DATA.number, dur: 1.05, fmt });
+ C.register(.72);
+ const land = C.stamp(unit, 1.02, { rot: -6 });
+ const said = C.rise(say, land + .28);
+ if (hasMark) C.bar(mark, said + .12, { dur: .5 });
+});
+</script>
+</body></html>
diff --git a/templates/quote.html b/templates/quote.html
new file mode 100644
index 0000000..0a258aa
--- /dev/null
+++ b/templates/quote.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<!-- 模板 · quote · 金句 / 结论 / 钩子
+ 用于:整段视频的论点落地那一句(钩子、反转、结论)。全片最多 2 条,用来制造明暗节奏。
+ 画面:满版 A 墨(深底),纸色宋体大字逐字升起;[ ] 内的关键词用 B 墨网点显影 + 套印归位;
+ 右下一轮 B 墨网点“太阳”出画,压住字幕床。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #lead { left:var(--gutter); top:330px; opacity:.72 }
+ #q { left:var(--gutter) }
+ #q .em { color:var(--b) }
+ #qm { left:0; top:0; font-size:900px; line-height:1; color:var(--b) }
+ #sun { left:430px; top:1180px; width:900px; height:900px }
+</style></head>
+<body>
+<div id="frame" class="flood"><div id="stage">
+ <div id="qm" class="hd tint">“</div>
+ <canvas id="sun" class="tone b"></canvas>
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="lead" class="lb a t"></div>
+ <div id="q" class="hd a t"></div>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-red',
+ mast: ['10 · 结论', '10 / 10'],
+ lead: '所以,别再从一张白纸开始了', // 引子:可空字符串;≤ 16 字
+ quote: '画面要跟着\n[你说的话]走', // 2–4 行,每行 ≤ 7 字;[ ] = B 墨关键词
+ duration: 6,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 66 }, C => {
+ // ── 版面 ──
+ if (DATA.lead) Riso.text(lead, DATA.lead); else lead.style.display = 'none';
+ Riso.text(q, DATA.quote);
+ Riso.fit(q, { width: 936, max: 150, min: 96 });
+ const qTop = DATA.lead ? Riso.box(lead).bottom + 70 : 360;
+ q.style.top = qTop + 'px';
+ const ems = [...q.querySelectorAll('.em')];
+ const qi = Riso.inkBox(qm); // 大引号:墨迹右缘贴 1040、顶 = 260,垫在字后面
+ qm.style.left = (1040 - qi.right) + 'px'; qm.style.top = (260 - qi.top) + 'px';
+ ems.forEach(e => e.classList.add('b')); // 关键词归 B 版:跟着套印一起错位
+
+ // ── 时间轴 ── 第 0 帧就是满版墨底 + 太阳的一半网点:从口播硬切进来不会“空一下”
+ C.camera({ push: .04 }).boil();
+ const sun = Riso.halftone('#sun', { cell: 22, density: (u, v, t) => {
+ const r = Math.hypot(u - .5, v - .5) * 2; // 0 中心 → 1 边缘
+ const grow = .55 + .45 * Math.min(1, t / 1.6);
+ return r > grow ? 0 : Math.pow(1 - r / grow, .55) * .95;
+ }});
+ C.at(sun);
+ C.print('#qm', 0, { dur: 1.1, to: 2.4 });
+ C.roll('.mast', 0, { dur: .5 });
+ let t = .15;
+ if (DATA.lead) t = C.rise(lead, .15, { stagger: .022 }) + .05;
+ const plain = [...q.querySelectorAll('.ch:not(.em)')];
+ C.tl.from(plain, { yPercent: 108, duration: .62, stagger: .045, ease: 'expo.out' }, t);
+ const qEnd = t + .62 * .6 + .045 * plain.length;
+ if (ems.length) {
+ C.tl.from(ems, { yPercent: 108, duration: .5, stagger: .06, ease: 'expo.out' }, qEnd - .1);
+ C.print(ems, qEnd - .1, { dur: .55, stagger: .06 });
+ C.register(qEnd + .3, { dx: 26, dy: -16 });
+ }
+});
+</script>
+</body></html>
diff --git a/templates/shot.html b/templates/shot.html
new file mode 100644
index 0000000..957d9a5
--- /dev/null
+++ b/templates/shot.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<!-- 模板 · shot · 截图锚点(真实界面 / 原文 / 数据来源)
+ 用于:观众需要“看见原件”才信的那一句(分镜表、后台数据、原帖截图)。
+ 画面:裁切标记先画出版位 → 截图从上往下刷入,以 A 墨双色调 + 网点显影印出来 →
+ (只有真截图才有)一处 B 墨批注框盖章 → 下方一句说明升起。
+ 没有截图时:版位里只放“待替换”占位(虚线框 + 标注),绝不画假界面、不加批注框。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #plate { left:var(--gutter); top:300px; width:936px }
+ #plate > *{ position:absolute; inset:0 }
+ .shot { mix-blend-mode:multiply }
+ #crops { inset:0 }
+ .crop { position:absolute; background:var(--a) }
+ #note { position:absolute }
+ #cap { left:var(--gutter) }
+ #src { left:var(--gutter) }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="plate"></div>
+ <div id="crops"></div>
+ <div id="cap" class="hd hd-m a t"></div>
+ <div id="src" class="mono a t"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['09 · 分镜', '09 / 10'],
+ img: '', // 项目内路径,如 '../assets/shots/storyboard.png';空 = 占位
+ slot: '分镜表截图', // 占位时写清楚这里要放什么截图
+ note: null, // 批注框(仅真截图):{ x:.52, y:.30, w:.30, h:.22 },相对版位的比例
+ height: 780, // 版位高度 px(宽固定 936)
+ caption: '上周的分镜表', // ≤ 10 字
+ source: '', // 可空:来源 / 日期,如 '截图 · 2026-10'
+ duration: 5.5,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 101 }, C => {
+ // ── 版面 ──
+ const H = DATA.height, X = 72, Y = 300, W = 936, L = 46, G = 20;
+ plate.style.height = H + 'px';
+ if (DATA.img) plate.innerHTML = `<div class="shot"><img src="${DATA.img}"></div>`;
+ else plate.innerHTML = `<div class="slot a"><span class="t">截图 · ${DATA.slot} · 待替换</span></div>`;
+ // 四角裁切标记(印刷厂的对位线),画在版位外 20px
+ const crop = (x, y, w, h) => { const d = document.createElement('div'); d.className = 'crop';
+ Object.assign(d.style, { left: x + 'px', top: y + 'px', width: w + 'px', height: h + 'px' }); crops.appendChild(d); return d; };
+ const marks = [
+ crop(X - G - L, Y - 2, L, 4), crop(X - 2, Y - G - L, 4, L),
+ crop(X + W + G, Y - 2, L, 4), crop(X + W - 2, Y - G - L, 4, L),
+ crop(X - G - L, Y + H - 2, L, 4), crop(X - 2, Y + H + G, 4, L),
+ crop(X + W + G, Y + H - 2, L, 4), crop(X + W - 2, Y + H + G, 4, L),
+ ];
+ let note = null;
+ if (DATA.img && DATA.note) {
+ note = document.createElement('div');
+ note.id = 'note'; note.className = 'seal';
+ Object.assign(note.style, { left: DATA.note.x * W + 'px', top: DATA.note.y * H + 'px', width: DATA.note.w * W + 'px', height: DATA.note.h * H + 'px' });
+ plate.appendChild(note);
+ }
+ Riso.text(cap, DATA.caption);
+ cap.style.top = Y + H + 84 + 'px';
+ if (DATA.source) { src.textContent = DATA.source; src.style.top = Riso.box(cap).bottom + 18 + 'px'; }
+ else src.style.display = 'none';
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.tl.fromTo(marks, { scale: 0 }, { scale: 1, duration: .35, stagger: .03, ease: 'back.out(2)', immediateRender: true }, .05);
+ C.roll(plate, .25, { dur: .7, dir: 'down' });
+ if (DATA.img) C.print(plate.querySelector('.shot'), .3, { dur: .9 });
+ if (note) C.stamp(note, 1.35, { from: 1.25, rot: 0, shake: 3 });
+ C.rise(cap, note ? 1.75 : 1.2);
+ if (DATA.source) C.roll(src, note ? 2.1 : 1.6, { dur: .45 });
+});
+</script>
+</body></html>
diff --git a/templates/steps.html b/templates/steps.html
new file mode 100644
index 0000000..1ee3409
--- /dev/null
+++ b/templates/steps.html
@@ -0,0 +1,95 @@
+<!doctype html>
+<!-- 模板 · steps · 流程拆解
+ 用于:台词给出了 2–6 个有顺序的步骤(先…再…然后…最后…)。
+ 画面:标题里的步数是 B 墨大数字 → 一行一步,像排印好的目录表:细线刷出 → 序号网点显影 → 步骤名升起,一步接一步。
+ 最后一步(或 DATA.key 指定的那步)落 B 墨压条,作为这一段的落点。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #title { left:var(--gutter); display:flex; align-items:baseline; gap:.12em }
+ #title .num { font-size:1.9em; line-height:.7 }
+ #rows { inset:0 }
+ #ghost { right:-40px; font-size:1180px; line-height:.74 }
+ .row { position:absolute; left:var(--gutter); right:var(--gutter); height:var(--rowh) }
+ .row .rule { position:absolute; left:0; right:0; top:0; height:4px; transform-origin:left center }
+ .row .ix { position:absolute; left:0; font-size:150px }
+ .row .name { position:absolute; left:220px }
+ .row .mark { position:absolute; transform-origin:left center }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="title" class="t"></div>
+ <div id="ghost" class="num b tint"></div>
+ <div id="rows"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ mast: ['08 · 流程', '08 / 10'],
+ title: ['只有', 3, '步'], // [前半句, 数字, 后半句],数字 = 步数
+ steps: ['选段', '出样帧', '渲成片'], // 2–6 步,每步 ≤ 5 字,只用原话里的动词名词
+ key: -1, // 落点那一步(-1 = 最后一步)
+ duration: 4.5,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 22 }, C => {
+ // ── 版面 ──
+ const n = DATA.steps.length, key = DATA.key < 0 ? n + DATA.key : DATA.key;
+ title.innerHTML = `<span class="hd a t" id="t1"></span><span class="num b t" id="tn" data-overprint></span><span class="hd a t" id="t2"></span>`;
+ Riso.text(t1, DATA.title[0]); tn.textContent = DATA.title[1]; Riso.text(t2, DATA.title[2]); // 拆成单字,rise() 才有东西可升
+ title.style.fontSize = '118px'; t1.classList.add('hd-l'); t2.classList.add('hd-l');
+ title.style.top = '300px';
+ const top0 = title.offsetTop + title.offsetHeight + 70, avail = 1300 - top0;
+ const rowh = Math.min(200, Math.floor(avail / n));
+ document.documentElement.style.setProperty('--rowh', rowh + 'px');
+ const nameSize = Math.min(96, rowh * .52);
+
+ DATA.steps.forEach((s, i) => {
+ const r = document.createElement('div');
+ r.className = 'row';
+ r.style.top = top0 + i * rowh + 'px';
+ r.innerHTML = `<div class="rule fill-a"></div><div class="mark fill-b"></div>
+ <div class="ix num b t" data-overprint>${String(i + 1).padStart(2, '0')}</div><div class="name hd a t"></div>`;
+ rows.appendChild(r);
+ const ix = r.querySelector('.ix'), nm = r.querySelector('.name');
+ ix.style.fontSize = Math.min(150, rowh * .78) + 'px';
+ Riso.text(nm, i === key ? `[${s}]` : s);
+ Riso.fit(nm, { width: 716, max: nameSize, min: 56 });
+ const mid = rowh / 2 + 6;
+ const ib = Riso.inkBox(ix);
+ ix.style.top = ix.offsetTop + (top0 + i * rowh + mid - (ib.top + ib.bottom) / 2) + 'px';
+ nm.style.top = mid - nm.offsetHeight / 2 + 'px';
+ const mk = r.querySelector('.mark');
+ if (i === key) Object.assign(mk.style, { left: '206px', width: nm.offsetWidth + 28 + 'px', top: mid + 2 + 'px', height: nm.offsetHeight * .36 + 'px' });
+ else mk.style.display = 'none';
+ });
+
+ ghost.textContent = DATA.title[1];
+ ghost.style.top = ghost.offsetTop + (top0 - 30 - Riso.inkBox(ghost).top) + 'px'; // 网点淡印的大数字,垫在目录表右侧
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.rise('#t1, #t2', .1);
+ C.print('#tn', .25, { dur: .55 });
+ C.register(.62);
+ C.print('#ghost', .3, { dur: 1.2, to: 3.1 });
+ const each = Math.min(.42, 2.3 / n);
+ let t = 1.0;
+ [...document.querySelectorAll('.row')].forEach((r, i) => {
+ C.bar(r.querySelector('.rule'), t, { dur: .5 });
+ C.print(r.querySelector('.ix'), t + .08, { dur: .34 });
+ C.rise(r.querySelector('.name'), t + .1, { stagger: .028, dur: .5 });
+ t += each;
+ });
+ const km = document.querySelectorAll('.row')[key].querySelector('.mark');
+ C.bar(km, t + .25, { dur: .5 });
+});
+</script>
+</body></html>
diff --git a/templates/title.html b/templates/title.html
new file mode 100644
index 0000000..0dda7a1
--- /dev/null
+++ b/templates/title.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<!-- 模板 · title · 章节卡 / 系列标题
+ 用于:第一个…第二个…第三个…的章节口;一条视频的开场标题。同一模板换 index / 色本派生整套。
+ 画面:一个占满画面的 B 墨序号从下往上“印”出来 → 套印归位 → 小标签刷出 → 宋体标题叠印压住序号的脚。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ #ix { left:0; top:0; font-size:1180px }
+ #kick { left:var(--gutter) }
+ #ttl { left:var(--gutter) }
+ #sub { left:var(--gutter) }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="ix" class="num b t" data-overprint></div>
+ <div id="kick" class="lb a t"></div>
+ <div id="ttl" class="hd a t" data-overprint></div>
+ <div id="sub" class="lb a t"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-blue',
+ flood: true, // true = 满版墨底(系列里交替使用制造明暗节奏)
+ mast: ['02 · 章节', '02 / 10'],
+ index: '01', // 1–2 位
+ kicker: '第一部分', // ≤ 6 字,可空
+ title: '先看效果', // ≤ 6 字(一行)
+ sub: '', // 可空;≤ 14 字
+ duration: 3,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 99 }, C => {
+ // ── 版面:序号墨迹左缘贴 56、顶 = 300;标题压住序号下 1/5 ──
+ ix.textContent = DATA.index;
+ Riso.fit(ix, { width: 860, max: 1320, min: 600 }); // 右缘停在 x≈916,避开右侧按钮栏
+ let k = Riso.inkBox(ix);
+ ix.style.left = (56 - k.left) + 'px'; ix.style.top = (300 - k.top) + 'px';
+ k = Riso.inkBox(ix);
+ Riso.text(ttl, DATA.title);
+ Riso.fit(ttl, { width: 936, max: 190, min: 110 });
+ ttl.style.top = Math.min(k.bottom - ttl.offsetHeight * .55, 1290 - ttl.offsetHeight - (DATA.sub ? 70 : 0)) + 'px';
+ if (DATA.kicker) { Riso.text(kick, DATA.kicker); kick.style.top = Riso.box(ttl).top - kick.offsetHeight - 8 + 'px'; }
+ else kick.style.display = 'none';
+ if (DATA.sub) { Riso.text(sub, DATA.sub); sub.style.top = Riso.box(ttl).bottom + 18 + 'px'; }
+ else sub.style.display = 'none';
+
+ // ── 时间轴 ──
+ C.camera({ push: .045 }).boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.roll(ix, 0, { dur: .7, dir: 'up' });
+ C.print(ix, 0, { dur: .8, from: 2 });
+ C.register(.6);
+ if (DATA.kicker) C.roll(kick, .75, { dur: .4 });
+ const end = C.rise(ttl, .85, { stagger: .05, dur: .7 });
+ if (DATA.sub) C.rise(sub, end, { stagger: .02 });
+});
+</script>
+</body></html>
diff --git a/templates/versus.html b/templates/versus.html
new file mode 100644
index 0000000..ddafaea
--- /dev/null
+++ b/templates/versus.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<!-- 模板 · versus · 误区 vs 真相 / 以前 vs 现在(观点翻转)
+ 用于:台词先立一个常见认知,再推翻它(很多人以为…其实…)。
+ 画面:上半“以为”的那句先印出来 → 一笔 A 墨划掉 → 整块退网成平网;
+ 中线刷开 → 下半“其实”的那句升起,关键词落 B 墨压条,套印“咔”一下归位。 -->
+<html lang="zh-CN"><head><meta charset="utf-8">
+<link rel="stylesheet" href="../assets/riso.css">
+<script src="../assets/gsap.min.js"></script>
+<script src="../assets/riso.js"></script>
+<style>
+ .chip { position:absolute; left:var(--gutter); padding:10px 18px 12px; font:600 40px/1 var(--sans); letter-spacing:.06em }
+ #ta { border:4px solid var(--a) }
+ #tb { color:var(--a) }
+ #tbb { left:var(--gutter); transform-origin:left center }
+ #blockA{ inset:0; --td:9px }
+ #sa, #sb { position:absolute; left:var(--gutter) }
+ .strike{ position:absolute; height:12px; transform-origin:left center }
+ #mid { left:var(--gutter); right:var(--gutter); height:4px; transform-origin:left center }
+ #mark { transform-origin:left center }
+</style></head>
+<body>
+<div id="frame"><div id="stage">
+ <div class="mast t"><span class="tag" id="m1"></span><span id="m2"></span></div>
+ <div id="blockA" class="tint">
+ <div id="ta" class="chip a t"></div>
+ <div id="sa" class="hd a t"></div>
+ </div>
+ <div id="mid" class="fill-a"></div>
+ <div id="tbb" class="fill-b"></div>
+ <div id="tb" class="chip a t"></div>
+ <div id="mark" class="fill-b"></div>
+ <div id="sb" class="hd a t"></div>
+ <canvas id="floor" class="tone b"></canvas>
+</div></div>
+<script>
+const DATA = {
+ palette: 'pal-red',
+ mast: ['01 · 误区', '01 / 10'],
+ before: { tag: '以为', text: '好看的动效\n得请人来做' }, // 常见认知(原话)
+ after: { tag: '其实', text: '一份逐字稿\n就[够了]' }, // 推翻它的那句(原话);[ ] = 压条
+ duration: 6.5,
+};
+
+Riso.setup(DATA);
+
+Riso.comp({ duration: DATA.duration, seed: 88 }, C => {
+ // ── 版面:上下两半,各自一个标签 + 一段宋体 ──
+ ta.textContent = DATA.before.tag; tb.textContent = DATA.after.tag;
+ ta.style.top = '300px';
+ Riso.text(sa, DATA.before.text); Riso.fit(sa, { width: 936, max: 104, min: 68 });
+ sa.style.top = Riso.box(ta).bottom + 30 + 'px';
+ const strikes = [...sa.querySelectorAll('.ln')].map(l => {
+ const a = Riso.box(l.firstElementChild), b = Riso.box(l.lastElementChild);
+ const s = document.createElement('div');
+ s.className = 'strike fill-a';
+ Object.assign(s.style, { left: a.left - 10 + 'px', width: b.right - a.left + 20 + 'px', top: (a.top + a.bottom) / 2 + 4 + 'px' });
+ blockA.appendChild(s); return s;
+ });
+ const midY = Riso.box(sa).bottom + 64;
+ mid.style.top = midY + 'px';
+ tb.style.top = midY + 64 + 'px';
+ Object.assign(tbb.style, { top: tb.style.top, width: tb.offsetWidth + 'px', height: tb.offsetHeight + 'px' });
+ Riso.text(sb, DATA.after.text); Riso.fit(sb, { width: 936, max: 132, min: 80 });
+ sb.style.top = Riso.box(tb).bottom + 30 + 'px';
+ const hasMark = Riso.markUnder(mark, sb);
+
+ // ── 时间轴 ──
+ C.camera().boil().floor('#floor');
+ C.roll('.mast', 0, { dur: .5 });
+ C.roll(ta, .05, { dur: .4 });
+ const saEnd = C.rise(sa, .2, { stagger: .03 });
+ C.bar(strikes, saEnd + .15, { dur: .32, stagger: .14, ease: 'power3.in' });
+ const tOut = saEnd + .15 + .32 + .14 * (strikes.length - 1) + .2;
+ C.tl.fromTo(blockA, { '--td': '9px' }, { '--td': '4.2px', duration: .55, ease: 'power2.inOut', immediateRender: false }, tOut);
+ C.bar(mid, tOut + .3, { dur: .5 });
+ C.bar(tbb, tOut + .55, { dur: .3 });
+ C.roll(tb, tOut + .62, { dur: .3 });
+ const sbEnd = C.rise(sb, tOut + .75, { stagger: .04 });
+ if (hasMark) C.bar(mark, sbEnd + .1, { dur: .45 });
+ C.register(sbEnd + .7);
+});
+</script>
+</body></html>
diff --git a/tests/smoke.mjs b/tests/smoke.mjs
new file mode 100644
index 0000000..8292281
--- /dev/null
+++ b/tests/smoke.mjs
@@ -0,0 +1,75 @@
+#!/usr/bin/env node
+// 一键自测:把 templates/ 里的全部模板放进一个临时项目,按真实流程跑一遍
+// 样帧(--still)→ 成片(mp4)→ 质检(版面 + 成片时长 / 尺寸)→ 时长脚本(估算 + SRT)
+// 任何一步失败,退出码 1。产物留在输出目录里,可以直接打开看。
+//
+// node tests/smoke.mjs → 快速版(成片用 --draft)
+// node tests/smoke.mjs --full → 成片用正式码率(看效果用这个)
+// node tests/smoke.mjs --alpha → 另外渲一条透明底 ProRes(体积大,默认不跑)
+// node tests/smoke.mjs --out <目录> → 指定输出目录(默认在系统临时目录)
+// node tests/smoke.mjs number quote → 只测指定模板
+import { spawnSync } from 'node:child_process';
+import { readdirSync, readFileSync, writeFileSync, mkdtempSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+import { cli } from '../scripts/lib/args.mjs';
+import { SKILL_ROOT as ROOT, createProject, addTemplate } from '../scripts/lib/project.mjs';
+
+const a = cli();
+const FULL = a.has('--full'), ALPHA = a.has('--alpha');
+const OUT = resolve(a.val('--out') || mkdtempSync(join(tmpdir(), 'riso-smoke-')));
+const args = a.rest;
+
+const all = readdirSync(join(ROOT, 'templates')).filter(f => f.endsWith('.html')).map(f => f.slice(0, -5)).sort();
+const names = args.length ? args : all;
+const unknown = names.filter(n => !all.includes(n));
+if (unknown.length) { console.error('没有这些模板:' + unknown.join(', ') + '\n可选:' + all.join(' ')); process.exit(2); }
+// 和 new_project.mjs 一样的项目结构
+try { createProject(OUT); } catch (e) { console.error(e.message + '(换一个 --out)'); process.exit(2); }
+const comps = names.map(n => addTemplate(OUT, n));
+
+const S = join(ROOT, 'scripts');
+
+// shot 模板默认是“待替换”占位。再派生一条带真截图的 shot-image,才看得到截图的双色调效果;
+// 截图就用另一个模板的末帧(仓库里不放任何外来图片)
+if (names.includes('shot')) {
+ const src = all.find(n => n !== 'shot'), shots = join(OUT, 'assets', 'shots');
+ const r = spawnSync(process.execPath, [join(S, 'render.mjs'), join(ROOT, 'templates', src + '.html'), '--still', '-o', join(shots, 'sample.png')], { stdio: 'inherit' });
+ if (r.status !== 0) process.exit(1);
+ const html = readFileSync(join(ROOT, 'templates', 'shot.html'), 'utf8')
+ .replace(/img:\s*'',/, "img: '../assets/shots/sample.png',")
+ .replace(/note:\s*null,/, 'note: { x: .08, y: .14, w: .62, h: .2 },')
+ .replace(/source:\s*'',/, "source: '截图 · 示例',");
+ if (!html.includes('sample.png') || !html.includes('note: {')) { console.error('shot.html 的 DATA 格式变了,自测没法派生 shot-image'); process.exit(1); }
+ const f = join(OUT, 'compositions', 'shot-image.html');
+ writeFileSync(f, html);
+ comps.push(f);
+}
+
+const steps = [];
+function step(title, script, a) {
+ console.log(`\n━━ ${title}`);
+ const t0 = Date.now();
+ const r = spawnSync(process.execPath, [join(S, script), ...a], { stdio: 'inherit' });
+ const ok = r.status === 0;
+ steps.push([ok, title, ((Date.now() - t0) / 1000).toFixed(1)]);
+ return ok;
+}
+
+step('样帧(末帧海报 + contact sheet)', 'render.mjs', [...comps, '--still']);
+step(`成片 mp4${FULL ? '' : '(--draft)'}`, 'render.mjs', [...comps, ...(FULL ? [] : ['--draft'])]);
+step('质检:版面 + 成片时长 / 尺寸', 'qa.mjs', comps);
+if (ALPHA) step('透明底 ProRes(' + names[0] + ')', 'render.mjs', [comps[0], '--alpha']);
+
+// 时长脚本:语速估算 + 在一份 SRT 里定位句子
+const srt = join(OUT, 'smoke.srt');
+writeFileSync(srt, '1\n00:00:01,000 --> 00:00:03,000\n第一句字幕用来测试\n\n2\n00:00:03,000 --> 00:00:06,000\n做一张信息图,以前要 40 分钟,现在 2 分钟\n');
+step('时长:语速估算', 'timing.mjs', ['做一张信息图,以前要 40 分钟,现在 2 分钟']);
+step('时长:SRT 定位', 'timing.mjs', ['--srt', srt, '以前要40分钟,现在2分钟']);
+
+const failed = steps.filter(s => !s[0]).length;
+console.log('\n━━ 结果');
+for (const [ok, title, sec] of steps) console.log(` ${ok ? '✅' : '❌'} ${title} ${sec}s`);
+console.log(`\n${names.length} 个模板 · ${failed ? failed + ' 步失败' : '全部通过'}`);
+console.log(`产物:${OUT}\n plates/sheet.jpg 末帧一览 · renders/*.mp4 成片 · qa/*-audit.png 质检叠层`);
+process.exit(failed ? 1 : 0);
diff --git a/tools/build_demo.mjs b/tools/build_demo.mjs
new file mode 100644
index 0000000..46df8c9
--- /dev/null
+++ b/tools/build_demo.mjs
@@ -0,0 +1,41 @@
+#!/usr/bin/env node
+// 重新生成 demo/(README 里的图):按示例逐字稿的顺序渲 10 个模板 → 末帧总览 + 几条 GIF
+// node tools/build_demo.mjs
+// 模板的默认 DATA 就是 examples/demo-script.md 的分镜,所以 demo 直接从 templates/ 渲。
+import { spawnSync } from 'node:child_process';
+import { mkdirSync, mkdtempSync, rmSync, readdirSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, dirname } from 'node:path';
+import { SKILL_ROOT as ROOT, createProject, addTemplate } from '../scripts/lib/project.mjs';
+import { contactSheet } from '../scripts/lib/media.mjs';
+
+const ORDER = ['versus', 'title', 'number', 'compare', 'converge', 'network', 'focus', 'steps', 'shot', 'quote']; // 逐字稿顺序
+const GIFS = ['number', 'converge', 'compare', 'quote']; // README 顶部那一排
+const DEMO = join(ROOT, 'demo'), TMP = join(mkdtempSync(join(tmpdir(), 'riso-demo-')), 'project');
+
+const run = (cmd, args) => {
+ const r = spawnSync(cmd, args, { stdio: ['ignore', 'inherit', 'inherit'] });
+ if (r.status !== 0) { console.error('失败:' + cmd + ' ' + args.join(' ')); process.exit(1); }
+};
+
+createProject(TMP);
+const id = n => `${String(ORDER.indexOf(n) + 1).padStart(2, '0')}-${n}`;
+const comp = n => join(TMP, 'compositions', id(n) + '.html');
+for (const n of ORDER) addTemplate(TMP, n, id(n));
+
+// 1. 10 张末帧 → 5 列 × 2 行总览
+run(process.execPath, [join(ROOT, 'scripts/render.mjs'), ...ORDER.map(comp), '--still']);
+mkdirSync(DEMO, { recursive: true });
+for (const f of readdirSync(DEMO)) if (/\.(gif|jpg|png)$/.test(f)) rmSync(join(DEMO, f));
+await contactSheet(ORDER.map(n => join(TMP, 'plates', id(n) + '.png')), join(DEMO, 'sheet.jpg'), { cols: 5, w: 360, h: 640 });
+
+// 2. 选几条渲成片 → 压成 GIF(15fps、360 宽、两遍调色板,只重画变化的区域)
+run(process.execPath, [join(ROOT, 'scripts/render.mjs'), ...GIFS.map(comp), '--calm']); // 纸纹不动、不推镜:GIF 小一个数量级
+for (const n of GIFS) {
+ const mp4 = join(TMP, 'renders', id(n) + '.mp4');
+ run('ffmpeg', ['-v', 'error', '-y', '-i', mp4, '-filter_complex',
+ 'fps=15,scale=360:-1:flags=lanczos,split[a][b];[a]palettegen=max_colors=48:stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=4:diff_mode=rectangle',
+ join(DEMO, n + '.gif')]);
+}
+rmSync(dirname(TMP), { recursive: true, force: true });
+console.log('✓ demo/ 已更新:sheet.jpg + ' + GIFS.map(n => n + '.gif').join(' '));
diff --git a/tools/build_fonts.py b/tools/build_fonts.py
new file mode 100644
index 0000000..887a418
--- /dev/null
+++ b/tools/build_fonts.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python3
+"""从上游开源字体生成 assets/fonts/ 里的 woff2(维护者用;使用 skill 不需要跑)。
+
+ pip install fonttools brotli
+ python3 tools/build_fonts.py <上游字体目录>
+
+上游字体全部来自 https://github.com/google/fonts/tree/main/ofl (SIL OFL 1.1):
+ notoserifsc/NotoSerifSC[wght].ttf notosanssc/NotoSansSC[wght].ttf
+ oswald/Oswald[wght].ttf jetbrainsmono/JetBrainsMono[wght].ttf
+把这几个文件按原名(去掉 [wght],如 NotoSerifSC.ttf)放进 <上游字体目录>。
+
+做了三件事:可变字体固定到用到的字重 → 裁剪字符集 → 输出 woff2。
+裁剪改动了字体,按 OFL 要求改了字体内部名称(Riso Serif 等),避免和原版混淆。
+中文字符集 = GB2312 全部 6763 个汉字 + 全角符号;不在里面的生僻字会回退到系统字体。
+"""
+import sys
+from pathlib import Path
+
+from fontTools.ttLib import TTFont
+from fontTools.varLib import instancer
+from fontTools import subset
+
+OUT = Path(__file__).resolve().parent.parent / 'assets' / 'fonts'
+
+# 输出文件名、上游文件、字重、字符集、内部名称
+FONTS = [
+ ('riso-serif.woff2', 'NotoSerifSC.ttf', 900, 'cjk', 'Riso Serif'), # 标题(替代宋体 Black)
+ ('riso-sans.woff2', 'NotoSansSC.ttf', 600, 'cjk', 'Riso Sans'), # 标签、引子(替代苹方 Semibold)
+ ('riso-num.woff2', 'Oswald.ttf', 700, 'latin', 'Riso Num'), # 数字(替代 DIN Condensed)
+ ('riso-mono.woff2', 'JetBrainsMono.ttf', 500, 'latin', 'Riso Mono'), # 编号、版头(替代 Menlo)
+]
+
+
+def charset(kind):
+ cs = set(range(0x20, 0x7F)) | set(range(0xA0, 0x180)) # ASCII + 拉丁补充
+ cs |= set(range(0x2010, 0x2070)) | {0x20AC, 0x2116, 0x2122, 0x2190, 0x2192, 0x2191, 0x2193, 0x00D7, 0x00F7}
+ if kind == 'cjk':
+ for b1 in range(0xA1, 0xF8): # GB2312 全表(符号区 + 一二级汉字)
+ for b2 in range(0xA1, 0xFF):
+ try:
+ cs.add(ord(bytes([b1, b2]).decode('gb2312')))
+ except UnicodeDecodeError:
+ pass
+ cs |= set(range(0x3000, 0x3040)) | set(range(0xFF01, 0xFF5F)) # CJK 标点 + 全角
+ return cs
+
+
+def rename(font, family):
+ name = font['name']
+ ps = family.replace(' ', '')
+ for rec in list(name.names):
+ if rec.nameID in (1, 4, 16, 21):
+ rec.string = family
+ elif rec.nameID == 6:
+ rec.string = ps
+ elif rec.nameID == 3:
+ rec.string = ps + '-subset'
+ elif rec.nameID in (2, 17, 22):
+ rec.string = 'Regular'
+ name.names = [r for r in name.names if r.nameID not in (16, 17, 21, 22, 25)]
+
+
+def build(src_dir):
+ OUT.mkdir(parents=True, exist_ok=True)
+ for out, src, weight, kind, family in FONTS:
+ font = TTFont(Path(src_dir) / src)
+ if 'fvar' in font:
+ font = instancer.instantiateVariableFont(font, {'wght': weight})
+ opts = subset.Options()
+ opts.layout_features = ['*']
+ opts.hinting = False
+ opts.name_IDs = ['*']
+ opts.name_languages = ['*']
+ opts.flavor = 'woff2'
+ sub = subset.Subsetter(opts)
+ sub.populate(unicodes=charset(kind))
+ sub.subset(font)
+ rename(font, family)
+ font.flavor = 'woff2'
+ font.save(OUT / out)
+ print(f'{out:20s} {(OUT / out).stat().st_size / 1e6:5.2f} MB ← {src} @ {weight}')
+
+
+if __name__ == '__main__':
+ if len(sys.argv) != 2:
+ sys.exit(__doc__)
+ build(sys.argv[1])