PRINTFILM: AI short-video marketing and AI short-drama creation platform
Add admin console, token billing, and related studio updates.
yidc235b9b524f
diff --git a/.cursor/skills/kepu-batch-opensource/reference.md b/.cursor/skills/kepu-batch-opensource/reference.mdindex 98051c7..bed2a3a 100644--- a/.cursor/skills/kepu-batch-opensource/reference.md+++ b/.cursor/skills/kepu-batch-opensource/reference.md@@ -21,9 +21,9 @@ Create body 关键字段:`template_id`, `title`, `source_type`, `source_text`,## Templates(`backend/app/services/templates_seed.py`)-多样打散优先非重复;开源向可用 `opensource_showcase`,也可混用风格模板:+多样打散优先非重复;开源向优先 `opensource_live_work`(真人工作场景),也可混用:-`opensource_showcase`, `portrait_story`, `live_cinematic`, `live_person`, `photo_realism`, `film_cinematic`, `noir_thriller`, `vox_papercut`, `docu_warm`, `kids_flat`, `soft_anime`, `chalk_whiteboard`, `cyber_neon`, `epic_fantasy`, `magazine_collage`, `brand_clean`, `pixel_retro`, `retro_vhs`, `ink_guofeng`+`opensource_live_work`, `opensource_showcase`, `live_product_desk`, `live_street_interview`, `live_cinematic`, `live_person`, `photo_realism`, `portrait_story`, `film_cinematic`, `noir_thriller`, `vox_papercut`, `docu_warm`, `kids_flat`, `soft_anime`, `chalk_whiteboard`, `cyber_neon`, `epic_fantasy`, `magazine_collage`, `brand_clean`, `pixel_retro`, `retro_vhs`, `ink_guofeng`## Voices(`backend/app/services/voices.py`)diff --git a/README.md b/README.mdindex 5383027..5868ce4 100644--- a/README.md+++ b/README.md@@ -47,6 +47,21 @@ npm installnpm run dev```+### 管理后台++独立前端(shadcn/ui),开发端口 **5174**。管理员复用同一套登录,需 `User.role=admin`。++```bash+# backend/.env 增加(将已有邮箱提权,重启后端生效)++cd admin+npm install+npm run dev+```++浏览器打开 `http://localhost:5174`,用管理员账号登录。+### 真模型配置`backend/.env`:@@ -65,7 +80,8 @@ npm run dev- FastAPI + PostgreSQL(Docker)/ 本地可 SQLite- Redis(Docker):Celery broker + 进度- Celery worker / `autoscale`:宿主机进程-- 前端:React + TS + Vite+- 前端:React + TS + Vite(用户端)+- 管理后台:`admin/` React + shadcn/ui(端口 5174)## 目录@@ -73,5 +89,6 @@ npm run devbackend/app/ API、模型、流水线、方舟适配backend/static/ 模板封面与 mock 素材frontend/src/ 首页模板墙 + 创作工作台+admin/src/ 运营管理后台(用户/订单/项目/作品/模板)deploy/ 仅 Postgres + Redis 的 compose```diff --git a/admin/.gitignore b/admin/.gitignorenew file mode 100644index 0000000..a547bf3--- /dev/null+++ b/admin/.gitignore@@ -0,0 +1,24 @@+# Logs+logs+*.log+npm-debug.log*+yarn-debug.log*+yarn-error.log*+pnpm-debug.log*+lerna-debug.log*++node_modules+dist+dist-ssr+*.local++# Editor directories and files+.vscode/*+!.vscode/extensions.json+.idea+.DS_Store+*.suo+*.ntvs*+*.njsproj+*.sln+*.sw?diff --git a/admin/.oxlintrc.json b/admin/.oxlintrc.jsonnew file mode 100644index 0000000..6fa991d--- /dev/null+++ b/admin/.oxlintrc.json@@ -0,0 +1,8 @@+{+ "$schema": "./node_modules/oxlint/configuration_schema.json",+ "plugins": ["react", "typescript", "oxc"],+ "rules": {+ "react/rules-of-hooks": "error",+ "react/only-export-components": ["warn", { "allowConstantExport": true }]+ }+}diff --git a/admin/README.md b/admin/README.mdnew file mode 100644index 0000000..d6af7e3--- /dev/null+++ b/admin/README.md@@ -0,0 +1,32 @@+# React + TypeScript + Vite++This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.++Currently, two official plugins are available:++- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)+- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)++## React Compiler++The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).++## Expanding the Oxlint configuration++If you are developing a production application, we recommend enabling type-aware lint rules by installing `oxlint-tsgolint` and editing `.oxlintrc.json`:++```json+{+ "$schema": "./node_modules/oxlint/configuration_schema.json",+ "plugins": ["react", "typescript", "oxc"],+ "options": {+ "typeAware": true+ },+ "rules": {+ "react/rules-of-hooks": "error",+ "react/only-export-components": ["warn", { "allowConstantExport": true }]+ }+}+```++See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories.diff --git a/admin/components.json b/admin/components.jsonnew file mode 100644index 0000000..37e56c3--- /dev/null+++ b/admin/components.json@@ -0,0 +1,20 @@+{+ "$schema": "https://ui.shadcn.com/schema.json",+ "style": "new-york",+ "rsc": false,+ "tsx": true,+ "tailwind": {+ "config": "",+ "css": "src/index.css",+ "baseColor": "neutral",+ "cssVariables": true+ },+ "aliases": {+ "components": "@/components",+ "utils": "@/lib/utils",+ "ui": "@/components/ui",+ "lib": "@/lib",+ "hooks": "@/hooks"+ },+ "iconLibrary": "lucide"+}diff --git a/admin/index.html b/admin/index.htmlnew file mode 100644index 0000000..8e4ccb5--- /dev/null+++ b/admin/index.html@@ -0,0 +1,19 @@+<!doctype html>+<html lang="zh-CN">+ <head>+ <meta charset="UTF-8" />+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>PRINTFILM 管理后台</title>+ <link rel="preconnect" href="https://fonts.googleapis.com" />+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />+ <link+ href="https://fonts.googleapis.com/css2?family=Anybody:wght@500;700;800&family=Figtree:wght@400;500;600&display=swap"+ rel="stylesheet"+ />+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="/src/main.tsx"></script>+ </body>+</html>diff --git a/admin/package-lock.json b/admin/package-lock.jsonnew file mode 100644index 0000000..e342d1a--- /dev/null+++ b/admin/package-lock.json@@ -0,0 +1,3069 @@+{+ "name": "admin",+ "version": "0.0.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "admin",+ "version": "0.0.0",+ "dependencies": {+ "@radix-ui/react-dialog": "^1.1.23",+ "@radix-ui/react-dropdown-menu": "^2.1.24",+ "@radix-ui/react-label": "^2.1.15",+ "@radix-ui/react-select": "^2.3.7",+ "@radix-ui/react-separator": "^1.1.15",+ "@radix-ui/react-slot": "^1.3.3",+ "@radix-ui/react-switch": "^1.3.7",+ "@radix-ui/react-tabs": "^1.1.21",+ "class-variance-authority": "^0.7.1",+ "clsx": "^2.1.1",+ "lucide-react": "^1.31.0",+ "react": "^19.2.8",+ "react-dom": "^19.2.8",+ "react-router-dom": "^7.18.2",+ "sonner": "^2.0.8",+ "tailwind-merge": "^3.6.0"+ },+ "devDependencies": {+ "@tailwindcss/vite": "^4.3.3",+ "@types/node": "^24.13.3",+ "@types/react": "^19.2.17",+ "@types/react-dom": "^19.2.3",+ "@vitejs/plugin-react": "^6.0.4",+ "oxlint": "^1.75.0",+ "tailwindcss": "^4.3.3",+ "typescript": "~6.0.2",+ "vite": "^8.2.0"+ }+ },+ "node_modules/@floating-ui/core": {+ "version": "1.8.0",+ "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.8.0.tgz",+ "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",+ "license": "MIT",+ "dependencies": {+ "@floating-ui/utils": "^0.2.12"+ }+ },+ "node_modules/@floating-ui/dom": {+ "version": "1.8.0",+ "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.8.0.tgz",+ "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",+ "license": "MIT",+ "dependencies": {+ "@floating-ui/core": "^1.8.0",+ "@floating-ui/utils": "^0.2.12"+ }+ },+ "node_modules/@floating-ui/react-dom": {+ "version": "2.1.9",+ "resolved": "https://registry.npmmirror.com/@floating-ui/react-dom/-/react-dom-2.1.9.tgz",+ "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==",+ "license": "MIT",+ "dependencies": {+ "@floating-ui/dom": "^1.8.0"+ },+ "peerDependencies": {+ "react": ">=16.8.0",+ "react-dom": ">=16.8.0"+ }+ },+ "node_modules/@floating-ui/utils": {+ "version": "0.2.12",+ "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.12.tgz",+ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",+ "license": "MIT"+ },+ "node_modules/@jridgewell/gen-mapping": {+ "version": "0.3.13",+ "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.0",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/remapping": {+ "version": "2.3.5",+ "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz",+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@oxc-project/types": {+ "version": "0.143.0",+ "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.143.0.tgz",+ "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/Boshen"+ }+ },+ "node_modules/@oxlint/binding-android-arm-eabi": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.78.0.tgz",+ "integrity": "sha512-Bu819lmAfZMUHErrpe0cEWj3iaefuUODHSU8+UbXy67V/r7/7f4K3FL0NmbD85E+wiFLDYuhP8Zlv0XnVeXshw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-android-arm64": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-android-arm64/-/binding-android-arm64-1.78.0.tgz",+ "integrity": "sha512-CDfxZgB61B7buRdY2FJoAYYPPXCZ1EoC1LKscnC5dg3kjobdxiconvAvvN1BmHyW4PyFT3jRLDag/BY/roSNBQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-darwin-arm64": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.78.0.tgz",+ "integrity": "sha512-2Y2U9Ahrz+OO0Ej88f9SJYq51/jUBp1Mc7iZu0ukrbeeZ3gpRGfzIFnoqfHDY96xr0GEfNrPUBFEy0nN5aD7HA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-darwin-x64": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.78.0.tgz",+ "integrity": "sha512-rpych6eJq6m9jDRypTEaPD1xysaEW5h9+xuxhGK/QhOg+/xaqPZrCrTNoIl/f3nEjuJeCEmstNDlrE9rJi/3/g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-freebsd-x64": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.78.0.tgz",+ "integrity": "sha512-IcMGrQT3QizkOESUJd5et+rOhVqSkNDfNik1cvrKDqIbzqx9KMtRswpFgkCuNTSwylCFLKhGUu8KmqY1ZnC0Dg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-arm-gnueabihf": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.78.0.tgz",+ "integrity": "sha512-/uLdoJ0IXE6vo/0f0LKjinQAp+re+VMaCWaNT8ENIv2EOCkSsc8SGaflXAuW0Jua2dq5+GLVWm1NQK7P3UFSNQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-arm-musleabihf": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.78.0.tgz",+ "integrity": "sha512-7xi4Wb/O8NRJhLoUXmDJMUVpNYvB5kefdhFU1Jb8rtae4QoXlTiLwI14X4YvAXVZLNZChP8m5qO9SQAlWQTbkQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-arm64-gnu": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.78.0.tgz",+ "integrity": "sha512-4hFW0+fVXa3OIh1Y4A5SPkmvI4wuuBSrCVKzOyE7PTjhc7yEqZ1pmvEEeS5Lj/MaqvegFxXyF33N+6jkehxdyg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-arm64-musl": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.78.0.tgz",+ "integrity": "sha512-oC0mvsgBJjlMijSDEhx9KuvR9zYeHXceA9MjbuXB1F8NSR78Yj2unOBrstEvTVaq+pko+kuue6DajC00eqvTdg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-ppc64-gnu": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.78.0.tgz",+ "integrity": "sha512-XAllT5SUZS+ohjuZ3/5S0cwe0r7eboiuigeStCZ5DXRYx/2KVM2UvQXvAfyzXEimtQjAB7cDQ2YxDe2Zl2WNQQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-riscv64-gnu": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.78.0.tgz",+ "integrity": "sha512-trucMER/0QtecoXvc1y/UVqE3kwJipDwrx4oHfj+nNm3dq2zjP44WT0CfHNDPM3G1DXIkx/gY6lAD21NSCZVhA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-riscv64-musl": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.78.0.tgz",+ "integrity": "sha512-cm3O4F/HQbdzOUX5mKHqG5KDL6E5w0pnlZ+fbBy2rmLryPOowkuLagFHTopQsEIpjcaZoPOrL+BmmAytAG9HFg==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-s390x-gnu": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.78.0.tgz",+ "integrity": "sha512-33wRf6HqGNsybJ3qX4cGaQN2ODPxNmc1rMa0mrTmx3eFq1VzOnvQooi9bIGVYakW8a/wmqVx1mgsUm8R2xfTiw==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-x64-gnu": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.78.0.tgz",+ "integrity": "sha512-rRdISSYegj6VganMZ9tjRjijowfHJ09IZU01i0toBAqr6n5LEtwHq2IeS4FjW2RoskOHlb6efB26H5izYb3GEQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-linux-x64-musl": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.78.0.tgz",+ "integrity": "sha512-GmsP4rW0xTL6u5CVdcDsaN5Fbc7hBc382Wmar1kttbnwSEviM+rSINKOMQ+UQ6iH+AGwC+8gaAiwu134Tgh6Lg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-openharmony-arm64": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.78.0.tgz",+ "integrity": "sha512-sy9yeYuADc8a+n4TLBayzMCZiHPW78DcIFVpOXTmdKHWQeM9xe5uzkqIIZmi326D5hY9XVwacipEB1p7tQjPAg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-win32-arm64-msvc": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.78.0.tgz",+ "integrity": "sha512-rjc2hF1KfMi8fZj1X/m3AmnHbdsF3rL0v6KQg0Uc880Yb2khjz+3U14sfdZ7jWTpRnN1m1NQa/TT7uU9lJWPrA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-win32-ia32-msvc": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.78.0.tgz",+ "integrity": "sha512-zcuXFVrEFHIafRfkCQT8w/Xe41o07ozl/vwHq7p94vB29xVzsB0sZGYORU1jhcYKv3Lr0J3HbJ2T4fHH5rWmvA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@oxlint/binding-win32-x64-msvc": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.78.0.tgz",+ "integrity": "sha512-Sb5ocmLSuYeOuXd+CFOToGKp/gjXUEWDnvIGwhnh8aq8wY4TMmEnKnvbogSW7RdMZv77JSARduS7/gv+khYEjA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@radix-ui/number": {+ "version": "1.1.3",+ "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz",+ "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==",+ "license": "MIT"+ },+ "node_modules/@radix-ui/primitive": {+ "version": "1.1.7",+ "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.1.7.tgz",+ "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",+ "license": "MIT"+ },+ "node_modules/@radix-ui/react-arrow": {+ "version": "1.1.15",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.15.tgz",+ "integrity": "sha512-v4zggRcjadnI+ClKDuijlQEW4tw3NoaeHc/PwpKnLoLLKNUG4InLegkstooLcRIUWCs+8L22dGURCVuFfOKfnA==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-primitive": "2.1.10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-collection": {+ "version": "1.1.15",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-collection/-/react-collection-1.1.15.tgz",+ "integrity": "sha512-9W+B9NPF0NaaPh/1NJd3+KqsnlLqU9H7T2rvww+fp+T/evVXdNAyYcnfRQZFOjkR1ajQp3yORlqnI8soawLvNA==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-slot": "1.3.3"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-compose-refs": {+ "version": "1.1.5",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",+ "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-context": {+ "version": "1.2.2",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-context/-/react-context-1.2.2.tgz",+ "integrity": "sha512-RHCUGwKHDr0hDGg4X7ma4JG4/+12qxw8rkh5QKdDldlCvtja6nUx1Ef/8HVrJze81lEsgLQlqjzjGNHantgnQA==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-dialog": {+ "version": "1.1.23",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-dialog/-/react-dialog-1.1.23.tgz",+ "integrity": "sha512-Ksw4WeROkO4rC9k/onilX/Ao2Cr1ku1unMNH+XSCcP4jSXYu7HDsg9n4ojMjVb22XpYjAQ9qfrFlVbru1vXDUA==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-dismissable-layer": "1.1.19",+ "@radix-ui/react-focus-guards": "1.1.6",+ "@radix-ui/react-focus-scope": "1.1.16",+ "@radix-ui/react-id": "1.1.4",+ "@radix-ui/react-portal": "1.1.17",+ "@radix-ui/react-presence": "1.1.10",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-slot": "1.3.3",+ "@radix-ui/react-use-controllable-state": "1.2.6",+ "@radix-ui/react-use-layout-effect": "1.1.4",+ "aria-hidden": "^1.2.4",+ "react-remove-scroll": "^2.7.2"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-direction": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-direction/-/react-direction-1.1.4.tgz",+ "integrity": "sha512-5pzg4FGQNpExhnhT2zlrP1wZFaYCd1K0nYWoFAdcYoYK868IEigqMX3B3f8yIoRlAhAeDWciLI6ZdCKHF9P4Vg==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-dismissable-layer": {+ "version": "1.1.19",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.19.tgz",+ "integrity": "sha512-8g4pfOL9HoKKLWGiypT+dphVqjFfmcXO5GBnhsG6zI+lxAx/8feQpr+1LSN8Re3hiZ+XkLNS4O9ztK11/LzQ6w==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-callback-ref": "1.1.4",+ "@radix-ui/react-use-effect-event": "0.0.5"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-dropdown-menu": {+ "version": "2.1.24",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.24.tgz",+ "integrity": "sha512-geq8l2rJkxvkXsT9RMgtUE3P8pITFpTsvYpbySi1IH4fZEABD/Gp85myayFgxk0ktljGMJnCbeFkyTusvSvv7g==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-id": "1.1.4",+ "@radix-ui/react-menu": "2.1.24",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-controllable-state": "1.2.6"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-focus-guards": {+ "version": "1.1.6",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.6.tgz",+ "integrity": "sha512-RNOJjfZMTyBM6xYmV3IVGXkPjIhcBAuv48POevAXwrGJhkWZ9p1rFoIS1JFooPuT193AZmRsCPhpoVJxx6OPoQ==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-focus-scope": {+ "version": "1.1.16",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.16.tgz",+ "integrity": "sha512-wmRZ2WWLvmt6KHy2rNPOdPUjwq5xOHY02+m+udwJTn0aNIox/rkskAvJTyTLGhPK6KgrUjlJUJpgmx/+wFiFIQ==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-callback-ref": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-id": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-id/-/react-id-1.1.4.tgz",+ "integrity": "sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-label": {+ "version": "2.1.15",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-label/-/react-label-2.1.15.tgz",+ "integrity": "sha512-o/rdYEwZTTo5tjknnPeyQFU45kUC4i/XyeDPP+HGyi6XqpOP6Zf5Ya5vh/Yfe9Id5JiuWnnAx2XqIeD3UYZt0g==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-primitive": "2.1.10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-menu": {+ "version": "2.1.24",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-menu/-/react-menu-2.1.24.tgz",+ "integrity": "sha512-uW7RVuU6Lp/ZtfeY4b3kL32zccgEWvPv1+cf17ubYzHa9cL8AHokmk36cG/XEiH/smbQvumnieXX9j/e9RqJWA==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-collection": "1.1.15",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-direction": "1.1.4",+ "@radix-ui/react-dismissable-layer": "1.1.19",+ "@radix-ui/react-focus-guards": "1.1.6",+ "@radix-ui/react-focus-scope": "1.1.16",+ "@radix-ui/react-id": "1.1.4",+ "@radix-ui/react-popper": "1.3.7",+ "@radix-ui/react-portal": "1.1.17",+ "@radix-ui/react-presence": "1.1.10",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-roving-focus": "1.1.19",+ "@radix-ui/react-slot": "1.3.3",+ "@radix-ui/react-use-callback-ref": "1.1.4",+ "aria-hidden": "^1.2.4",+ "react-remove-scroll": "^2.7.2"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-popper": {+ "version": "1.3.7",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-popper/-/react-popper-1.3.7.tgz",+ "integrity": "sha512-UsJrrd7w4wuKKTdvd/DNERVlwSlUcyXzjhyDwBk+3aPOsCjOY6ZSbxuw8E6lZTjjfP8Cpd0J8VVkrYUWyGYXyg==",+ "license": "MIT",+ "dependencies": {+ "@floating-ui/react-dom": "^2.0.0",+ "@radix-ui/react-arrow": "1.1.15",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-callback-ref": "1.1.4",+ "@radix-ui/react-use-layout-effect": "1.1.4",+ "@radix-ui/react-use-rect": "1.1.4",+ "@radix-ui/react-use-size": "1.1.4",+ "@radix-ui/rect": "1.1.3"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-portal": {+ "version": "1.1.17",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-portal/-/react-portal-1.1.17.tgz",+ "integrity": "sha512-vKQLcWypUnwZVvfV7UkGahH2g6ySe8M8R+zYBwPrv5byZ9QAW6cQVvNKo7GgmD+p8aYb6D9JBuvy8/WhOno2wQ==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-presence": {+ "version": "1.1.10",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-presence/-/react-presence-1.1.10.tgz",+ "integrity": "sha512-3wyzCQ6+ubRA+D4uv9m95JYLXxmOHp05qjrkjeA7uKHHtjpPggQzc6DAb0URl7j67oR0K2foO4ip27TiX037Bw==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-primitive": {+ "version": "2.1.10",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",+ "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-slot": "1.3.3"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-roving-focus": {+ "version": "1.1.19",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.19.tgz",+ "integrity": "sha512-V9jI6hDjT7l3jsCQD9bLNvDLM3tH/gdbOTp7Tefp3hbbgCGQoK7tUvrWiRlcoBHIZ809ElXwNQwVo0B98LuTXQ==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-collection": "1.1.15",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-direction": "1.1.4",+ "@radix-ui/react-id": "1.1.4",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-callback-ref": "1.1.4",+ "@radix-ui/react-use-controllable-state": "1.2.6",+ "@radix-ui/react-use-is-hydrated": "0.1.3",+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-select": {+ "version": "2.3.7",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-select/-/react-select-2.3.7.tgz",+ "integrity": "sha512-WFGImkmbzcfxeIwq/+4HvRN0pizBwbwQUED4I13ezQsDdfl38ZntN6TmR8XaSzPBqoCToe8rF75j6NPNDSzhbg==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/number": "1.1.3",+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-collection": "1.1.15",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-direction": "1.1.4",+ "@radix-ui/react-dismissable-layer": "1.1.19",+ "@radix-ui/react-focus-guards": "1.1.6",+ "@radix-ui/react-focus-scope": "1.1.16",+ "@radix-ui/react-id": "1.1.4",+ "@radix-ui/react-popper": "1.3.7",+ "@radix-ui/react-portal": "1.1.17",+ "@radix-ui/react-presence": "1.1.10",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-slot": "1.3.3",+ "@radix-ui/react-use-callback-ref": "1.1.4",+ "@radix-ui/react-use-controllable-state": "1.2.6",+ "@radix-ui/react-use-layout-effect": "1.1.4",+ "@radix-ui/react-use-previous": "1.1.4",+ "@radix-ui/react-visually-hidden": "1.2.11",+ "aria-hidden": "^1.2.4",+ "react-remove-scroll": "^2.7.2"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-separator": {+ "version": "1.1.15",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-separator/-/react-separator-1.1.15.tgz",+ "integrity": "sha512-jOLO4lssEzWpoDu7G+Ze4VjwMRUBt291pnZD0gmalREZipnTX3wadQo7Fy48GCTfe14/YRN6rw/rOJqrE85Wxw==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-primitive": "2.1.10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-slot": {+ "version": "1.3.3",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",+ "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-compose-refs": "1.1.5"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-switch": {+ "version": "1.3.7",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-switch/-/react-switch-1.3.7.tgz",+ "integrity": "sha512-48tB/4dn2UVLBCYhTu9AuR63IHl73l/qLbLgxd86noTUor4/K4LFDAcYjK+isP5313qxaFpjPVogE7+Y0/V3Kw==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-compose-refs": "1.1.5",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-use-controllable-state": "1.2.6",+ "@radix-ui/react-use-size": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-tabs": {+ "version": "1.1.21",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-tabs/-/react-tabs-1.1.21.tgz",+ "integrity": "sha512-UKxJlZid7FVtsk/WTxj4i4uSEgj2Au+KBbS7SQyTlzMhhn+86Cz3tISZdTa87bfEfcuvZezf2ZsxD4xuEKtkog==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-context": "1.2.2",+ "@radix-ui/react-direction": "1.1.4",+ "@radix-ui/react-id": "1.1.4",+ "@radix-ui/react-presence": "1.1.10",+ "@radix-ui/react-primitive": "2.1.10",+ "@radix-ui/react-roving-focus": "1.1.19",+ "@radix-ui/react-use-controllable-state": "1.2.6"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-callback-ref": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.4.tgz",+ "integrity": "sha512-R6OUY2e2fA6Yn6s+VSx5KBV6Nx8LQEhu+cz7LCej18rQ1HLyg9PSC9jP/ZNx0o6FAIK9c0F1kHylzSxKsdlkrQ==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-controllable-state": {+ "version": "1.2.6",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",+ "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/primitive": "1.1.7",+ "@radix-ui/react-use-effect-event": "0.0.5",+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-effect-event": {+ "version": "0.0.5",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",+ "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-is-hydrated": {+ "version": "0.1.3",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.3.tgz",+ "integrity": "sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-layout-effect": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",+ "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-previous": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-previous/-/react-use-previous-1.1.4.tgz",+ "integrity": "sha512-XoSLhbRbqxFtgJoi2fNHA3C6pDlY34x508vUpUGoFZfvePfHXHbE1lC4FYFMnJWgiCRroSTw6fOsXQoVS9RwZg==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-rect": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-rect/-/react-use-rect-1.1.4.tgz",+ "integrity": "sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/rect": "1.1.3"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-use-size": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-size/-/react-use-size-1.1.4.tgz",+ "integrity": "sha512-D3anSY15EJoxrihpsXI6SMrmmonnQtR2ni7arO+Lfdg3O95b9hNXxONk8jA5C8ANdF/h5HMAxejgs8PWJ6rlhw==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-use-layout-effect": "1.1.4"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/react-visually-hidden": {+ "version": "1.2.11",+ "resolved": "https://registry.npmmirror.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.11.tgz",+ "integrity": "sha512-NFS86RYYZb4/exihaESBGOpMJFz8MGLAfu3mOBSGByVnVPC9JPASfYubxd/8KbkQK0sYAv8lVQDEQukDX/qXvQ==",+ "license": "MIT",+ "dependencies": {+ "@radix-ui/react-primitive": "2.1.10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/@radix-ui/rect": {+ "version": "1.1.3",+ "resolved": "https://registry.npmmirror.com/@radix-ui/rect/-/rect-1.1.3.tgz",+ "integrity": "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==",+ "license": "MIT"+ },+ "node_modules/@rolldown/binding-android-arm64": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.3.tgz",+ "integrity": "sha512-zrJtHDcaZJ1Fp7xf4hNl+7seH9Cn/N5TwLYkhgXREtBwAd/jaqW3uqeHxpDugJLVICWg4eW44kOQEGJ1r6jCGw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-arm64": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.3.tgz",+ "integrity": "sha512-ieIiibVCp0tX7TLu2cafoNPv8wJyYi01ekXpbf8q2j7F4rGAhhXb/eQh7ge9DRBY78GwmRQtvjZDux7EDbA8kA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-x64": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.3.tgz",+ "integrity": "sha512-Zh9tCon19eDXJoihx0rqKhMUlMYqzwj3aPsSuHmI4RWZh62dWUL+DJN4C5YQya5TcQBJU/Fe8+rY0jhXTQITqA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-freebsd-x64": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.3.tgz",+ "integrity": "sha512-nGbJWewA1wrXXZiQhjAT5rhibGfns5ZNkDVqxsO6zJ3f3YvpoDNNmGMSbbhLuXKjNScaBJVOAboztAWVespQMg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.3.tgz",+ "integrity": "sha512-QNniJr5Kml0kDEB98jiDOJjXNroxIIi0IXIbdYzY26Xt1pVbeP62+KnoIZLwirOymX/0jDk/2gI/bNUv7A7OIw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-gnu": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.3.tgz",+ "integrity": "sha512-TkqEAcmmvH3I/q4114NB4RVt6241Dao48pF45uLcFGrwAaIn0iITgTAKP/dLjbN0R4buJjGb91+UHSoFmpgIWw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-musl": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.3.tgz",+ "integrity": "sha512-NHqjnxpsndf4MPymxteFAWHHfkTL8HjWh1KB7z23ofZ6QO2euONuxDXjat69dKZRALnGypg8k8SsK8vZJoXv1Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.3.tgz",+ "integrity": "sha512-6tbrbwfz5GB9DQ4Jwo6hy9v+vR31xZlvzZ6n5Xut6Hhx5PvrA9q/HsK8KMaYQp063iqZGXwNvZtYNLD7EM/x0w==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-s390x-gnu": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.3.tgz",+ "integrity": "sha512-oyuXxXmoZHjXC917IAPFAAv4wWAa0cM9afk8nx1+9/jNNOX1uPf8yDA6p7G0RypOfw/X0PQt5IfoquY1um+zSg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-gnu": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.3.tgz",+ "integrity": "sha512-TytMwF2KVGqP2tgd0I1OY0PAv78dZRAYcF5ssDzjM34SUXCED3uXvSd5+lHoC0bTD6eEdFz7LdQNCO1y0oVk9w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-musl": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.3.tgz",+ "integrity": "sha512-/E9m3qstrJFVPoULV25mVQblSNExY2+kBsYe4sy0Tn0yOOgJ8wZbZt3KnRbF/XeU2Gl1STKUQnDNTqhIE5MD4A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-openharmony-arm64": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.3.tgz",+ "integrity": "sha512-Kr0OcsoQI816i6HOl3vFHpd1K0eZyh76zgfj4c1nTyaTsd5r2Mj1lwM4R90y/qaCfmTn9eHy0SKwi98eitRxug==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-arm64-msvc": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.3.tgz",+ "integrity": "sha512-hOtMwTqnME+/gJcH/PCZ0wn0zPUjiWOgkHpxbSJpfGKMezHltx1S7/k1SitzVa7Ww2cqrDDaFbZEhcJZO8o+Jw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-x64-msvc": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.3.tgz",+ "integrity": "sha512-ekcqMMkI2PlhYnfzQnB/cEdYUVVJViWvoUyLrbzgDoi3Snfc1mVBwdnc306ufA5ejy8JSPjT2RlW1nQSjW7efg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.1",+ "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@tailwindcss/node": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/node/-/node-4.3.3.tgz",+ "integrity": "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/remapping": "^2.3.5",+ "enhanced-resolve": "^5.24.1",+ "jiti": "^2.7.0",+ "lightningcss": "1.32.0",+ "magic-string": "^0.30.21",+ "source-map-js": "^1.2.1",+ "tailwindcss": "4.3.3"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss/-/lightningcss-1.32.0.tgz",+ "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.32.0",+ "lightningcss-darwin-arm64": "1.32.0",+ "lightningcss-darwin-x64": "1.32.0",+ "lightningcss-freebsd-x64": "1.32.0",+ "lightningcss-linux-arm-gnueabihf": "1.32.0",+ "lightningcss-linux-arm64-gnu": "1.32.0",+ "lightningcss-linux-arm64-musl": "1.32.0",+ "lightningcss-linux-x64-gnu": "1.32.0",+ "lightningcss-linux-x64-musl": "1.32.0",+ "lightningcss-win32-arm64-msvc": "1.32.0",+ "lightningcss-win32-x64-msvc": "1.32.0"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-android-arm64": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz",+ "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-darwin-arm64": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz",+ "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-darwin-x64": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz",+ "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-freebsd-x64": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz",+ "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz",+ "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz",+ "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz",+ "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz",+ "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-musl": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz",+ "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz",+ "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.32.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz",+ "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/@tailwindcss/oxide": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide/-/oxide-4.3.3.tgz",+ "integrity": "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 20"+ },+ "optionalDependencies": {+ "@tailwindcss/oxide-android-arm64": "4.3.3",+ "@tailwindcss/oxide-darwin-arm64": "4.3.3",+ "@tailwindcss/oxide-darwin-x64": "4.3.3",+ "@tailwindcss/oxide-freebsd-x64": "4.3.3",+ "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3",+ "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3",+ "@tailwindcss/oxide-linux-arm64-musl": "4.3.3",+ "@tailwindcss/oxide-linux-x64-gnu": "4.3.3",+ "@tailwindcss/oxide-linux-x64-musl": "4.3.3",+ "@tailwindcss/oxide-wasm32-wasi": "4.3.3",+ "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3",+ "@tailwindcss/oxide-win32-x64-msvc": "4.3.3"+ }+ },+ "node_modules/@tailwindcss/oxide-android-arm64": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.3.tgz",+ "integrity": "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-darwin-arm64": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.3.tgz",+ "integrity": "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-darwin-x64": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.3.tgz",+ "integrity": "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-freebsd-x64": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.3.tgz",+ "integrity": "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.3.tgz",+ "integrity": "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-arm64-gnu": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.3.tgz",+ "integrity": "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-arm64-musl": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.3.tgz",+ "integrity": "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-x64-gnu": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.3.tgz",+ "integrity": "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-x64-musl": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.3.tgz",+ "integrity": "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-wasm32-wasi": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.3.tgz",+ "integrity": "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==",+ "bundleDependencies": [+ "@napi-rs/wasm-runtime",+ "@emnapi/core",+ "@emnapi/runtime",+ "@tybys/wasm-util",+ "@emnapi/wasi-threads",+ "tslib"+ ],+ "cpu": [+ "wasm32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/core": "^1.11.1",+ "@emnapi/runtime": "^1.11.1",+ "@emnapi/wasi-threads": "^1.2.2",+ "@napi-rs/wasm-runtime": "^1.1.4",+ "@tybys/wasm-util": "^0.10.2",+ "tslib": "^2.8.1"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.3.tgz",+ "integrity": "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/oxide-win32-x64-msvc": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.3.tgz",+ "integrity": "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/@tailwindcss/vite": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.3.tgz",+ "integrity": "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@tailwindcss/node": "4.3.3",+ "@tailwindcss/oxide": "4.3.3",+ "tailwindcss": "4.3.3"+ },+ "peerDependencies": {+ "vite": "^5.2.0 || ^6 || ^7 || ^8"+ }+ },+ "node_modules/@types/node": {+ "version": "24.13.3",+ "resolved": "https://registry.npmmirror.com/@types/node/-/node-24.13.3.tgz",+ "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~7.18.0"+ }+ },+ "node_modules/@types/react": {+ "version": "19.2.18",+ "resolved": "https://registry.npmmirror.com/@types/react/-/react-19.2.18.tgz",+ "integrity": "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "csstype": "^3.2.2"+ }+ },+ "node_modules/@types/react-dom": {+ "version": "19.2.4",+ "resolved": "https://registry.npmmirror.com/@types/react-dom/-/react-dom-19.2.4.tgz",+ "integrity": "sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw==",+ "devOptional": true,+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "^19.2.0"+ }+ },+ "node_modules/@vitejs/plugin-react": {+ "version": "6.0.5",+ "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-6.0.5.tgz",+ "integrity": "sha512-BOVzne/NL162sMdResB25mUv+vWMF5NoAjNf09TeGlE7ZpszZWSD3winycicLJw72yeVsoCn/2kOhEuCvEShMA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@rolldown/pluginutils": "^1.0.1"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "peerDependencies": {+ "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0",+ "babel-plugin-react-compiler": "^1.0.0",+ "vite": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "@rolldown/plugin-babel": {+ "optional": true+ },+ "babel-plugin-react-compiler": {+ "optional": true+ }+ }+ },+ "node_modules/aria-hidden": {+ "version": "1.2.6",+ "resolved": "https://registry.npmmirror.com/aria-hidden/-/aria-hidden-1.2.6.tgz",+ "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==",+ "license": "MIT",+ "dependencies": {+ "tslib": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/class-variance-authority": {+ "version": "0.7.1",+ "resolved": "https://registry.npmmirror.com/class-variance-authority/-/class-variance-authority-0.7.1.tgz",+ "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==",+ "license": "Apache-2.0",+ "dependencies": {+ "clsx": "^2.1.1"+ },+ "funding": {+ "url": "https://polar.sh/cva"+ }+ },+ "node_modules/clsx": {+ "version": "2.1.1",+ "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz",+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/cookie": {+ "version": "1.1.1",+ "resolved": "https://registry.npmmirror.com/cookie/-/cookie-1.1.1.tgz",+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/csstype": {+ "version": "3.2.3",+ "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz",+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/detect-node-es": {+ "version": "1.1.0",+ "resolved": "https://registry.npmmirror.com/detect-node-es/-/detect-node-es-1.1.0.tgz",+ "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==",+ "license": "MIT"+ },+ "node_modules/enhanced-resolve": {+ "version": "5.24.5",+ "resolved": "https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.24.5.tgz",+ "integrity": "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "graceful-fs": "^4.2.4",+ "tapable": "^2.3.3"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/get-nonce": {+ "version": "1.0.1",+ "resolved": "https://registry.npmmirror.com/get-nonce/-/get-nonce-1.0.1.tgz",+ "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/graceful-fs": {+ "version": "4.2.11",+ "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/jiti": {+ "version": "2.7.0",+ "resolved": "https://registry.npmmirror.com/jiti/-/jiti-2.7.0.tgz",+ "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "jiti": "lib/jiti-cli.mjs"+ }+ },+ "node_modules/lightningcss": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss/-/lightningcss-1.33.0.tgz",+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.33.0",+ "lightningcss-darwin-arm64": "1.33.0",+ "lightningcss-darwin-x64": "1.33.0",+ "lightningcss-freebsd-x64": "1.33.0",+ "lightningcss-linux-arm-gnueabihf": "1.33.0",+ "lightningcss-linux-arm64-gnu": "1.33.0",+ "lightningcss-linux-arm64-musl": "1.33.0",+ "lightningcss-linux-x64-gnu": "1.33.0",+ "lightningcss-linux-x64-musl": "1.33.0",+ "lightningcss-win32-arm64-msvc": "1.33.0",+ "lightningcss-win32-x64-msvc": "1.33.0"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmmirror.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lucide-react": {+ "version": "1.31.0",+ "resolved": "https://registry.npmmirror.com/lucide-react/-/lucide-react-1.31.0.tgz",+ "integrity": "sha512-G8u2eEtoHUnUa9f8lbvqDhCiORMnYLdUEo06EEG9MQvHQrInKcX3Pa2TH39MM5qyzRcWETxB0+aOwAPI1g1kEg==",+ "license": "ISC",+ "peerDependencies": {+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"+ }+ },+ "node_modules/magic-string": {+ "version": "0.30.21",+ "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz",+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.5"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.18",+ "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.18.tgz",+ "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/oxlint": {+ "version": "1.78.0",+ "resolved": "https://registry.npmmirror.com/oxlint/-/oxlint-1.78.0.tgz",+ "integrity": "sha512-QgQePuxIqKOzo1KSjG2EnITEeWvWnKAm77eq8nrMtf6AGoA+zyGc4PFYtDNJSD25g/ibOwfQ851hZ4/SPkMVoA==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "oxlint": "bin/oxlint"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/Boshen"+ },+ "optionalDependencies": {+ "@oxlint/binding-android-arm-eabi": "1.78.0",+ "@oxlint/binding-android-arm64": "1.78.0",+ "@oxlint/binding-darwin-arm64": "1.78.0",+ "@oxlint/binding-darwin-x64": "1.78.0",+ "@oxlint/binding-freebsd-x64": "1.78.0",+ "@oxlint/binding-linux-arm-gnueabihf": "1.78.0",+ "@oxlint/binding-linux-arm-musleabihf": "1.78.0",+ "@oxlint/binding-linux-arm64-gnu": "1.78.0",+ "@oxlint/binding-linux-arm64-musl": "1.78.0",+ "@oxlint/binding-linux-ppc64-gnu": "1.78.0",+ "@oxlint/binding-linux-riscv64-gnu": "1.78.0",+ "@oxlint/binding-linux-riscv64-musl": "1.78.0",+ "@oxlint/binding-linux-s390x-gnu": "1.78.0",+ "@oxlint/binding-linux-x64-gnu": "1.78.0",+ "@oxlint/binding-linux-x64-musl": "1.78.0",+ "@oxlint/binding-openharmony-arm64": "1.78.0",+ "@oxlint/binding-win32-arm64-msvc": "1.78.0",+ "@oxlint/binding-win32-ia32-msvc": "1.78.0",+ "@oxlint/binding-win32-x64-msvc": "1.78.0"+ },+ "peerDependencies": {+ "oxlint-tsgolint": ">=7.0.2001",+ "vite-plus": "*"+ },+ "peerDependenciesMeta": {+ "oxlint-tsgolint": {+ "optional": true+ },+ "vite-plus": {+ "optional": true+ }+ }+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.5",+ "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.5.tgz",+ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.26",+ "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.26.tgz",+ "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.17",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/react": {+ "version": "19.2.8",+ "resolved": "https://registry.npmmirror.com/react/-/react-19.2.8.tgz",+ "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-dom": {+ "version": "19.2.8",+ "resolved": "https://registry.npmmirror.com/react-dom/-/react-dom-19.2.8.tgz",+ "integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==",+ "license": "MIT",+ "dependencies": {+ "scheduler": "^0.27.0"+ },+ "peerDependencies": {+ "react": "^19.2.8"+ }+ },+ "node_modules/react-remove-scroll": {+ "version": "2.7.2",+ "resolved": "https://registry.npmmirror.com/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz",+ "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==",+ "license": "MIT",+ "dependencies": {+ "react-remove-scroll-bar": "^2.3.7",+ "react-style-singleton": "^2.2.3",+ "tslib": "^2.1.0",+ "use-callback-ref": "^1.3.3",+ "use-sidecar": "^1.1.3"+ },+ "engines": {+ "node": ">=10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/react-remove-scroll-bar": {+ "version": "2.3.8",+ "resolved": "https://registry.npmmirror.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz",+ "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==",+ "license": "MIT",+ "dependencies": {+ "react-style-singleton": "^2.2.2",+ "tslib": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/react-router": {+ "version": "7.18.2",+ "resolved": "https://registry.npmmirror.com/react-router/-/react-router-7.18.2.tgz",+ "integrity": "sha512-aUVMjFm3GAPTTZL7oYr5E7ETiqfQCHRLH+B+5afnICvf0r7kkK4eR6SMuwbSTJw/7t+12khT/Kahij49fqOCIg==",+ "license": "MIT",+ "dependencies": {+ "cookie": "^1.0.1",+ "set-cookie-parser": "^2.6.0"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "react": ">=18",+ "react-dom": ">=18"+ },+ "peerDependenciesMeta": {+ "react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/react-router-dom": {+ "version": "7.18.2",+ "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-7.18.2.tgz",+ "integrity": "sha512-AIKJ/jgGlFb3EbfCXk5Gzshiwt+l3mqbCrNjmEWMMjqQxNJ3svBa6bgzFyCC2Sw3RA0VWF1kg3uQf2OFhxb8hw==",+ "license": "MIT",+ "dependencies": {+ "react-router": "7.18.2"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "react": ">=18",+ "react-dom": ">=18"+ }+ },+ "node_modules/react-style-singleton": {+ "version": "2.2.3",+ "resolved": "https://registry.npmmirror.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz",+ "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==",+ "license": "MIT",+ "dependencies": {+ "get-nonce": "^1.0.0",+ "tslib": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/rolldown": {+ "version": "1.2.3",+ "resolved": "https://registry.npmmirror.com/rolldown/-/rolldown-1.2.3.tgz",+ "integrity": "sha512-rn9wpmxplLf7NLNyCk9FyWh3FM43DbY8jOzCdEPzH7uflhTftRbCEpqi6Ly2osgoU8OwObtmavMbWLaWy4LX7A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@oxc-project/types": "=0.143.0",+ "@rolldown/pluginutils": "^1.0.0"+ },+ "bin": {+ "rolldown": "bin/cli.mjs"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "optionalDependencies": {+ "@rolldown/binding-android-arm64": "1.2.3",+ "@rolldown/binding-darwin-arm64": "1.2.3",+ "@rolldown/binding-darwin-x64": "1.2.3",+ "@rolldown/binding-freebsd-x64": "1.2.3",+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.3",+ "@rolldown/binding-linux-arm64-gnu": "1.2.3",+ "@rolldown/binding-linux-arm64-musl": "1.2.3",+ "@rolldown/binding-linux-ppc64-gnu": "1.2.3",+ "@rolldown/binding-linux-s390x-gnu": "1.2.3",+ "@rolldown/binding-linux-x64-gnu": "1.2.3",+ "@rolldown/binding-linux-x64-musl": "1.2.3",+ "@rolldown/binding-openharmony-arm64": "1.2.3",+ "@rolldown/binding-win32-arm64-msvc": "1.2.3",+ "@rolldown/binding-win32-x64-msvc": "1.2.3"+ }+ },+ "node_modules/scheduler": {+ "version": "0.27.0",+ "resolved": "https://registry.npmmirror.com/scheduler/-/scheduler-0.27.0.tgz",+ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",+ "license": "MIT"+ },+ "node_modules/set-cookie-parser": {+ "version": "2.7.2",+ "resolved": "https://registry.npmmirror.com/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",+ "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",+ "license": "MIT"+ },+ "node_modules/sonner": {+ "version": "2.0.8",+ "resolved": "https://registry.npmmirror.com/sonner/-/sonner-2.0.8.tgz",+ "integrity": "sha512-UM/ByIoFra8yzV75n1o0Puu0bw5U/9UNnDacrJNspekBewIfsQ3D6ez1nvlWpt7aTsO6rujQtifBpycwIivqlg==",+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "^18.0.0 || ^19.0.0",+ "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",+ "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/tailwind-merge": {+ "version": "3.6.0",+ "resolved": "https://registry.npmmirror.com/tailwind-merge/-/tailwind-merge-3.6.0.tgz",+ "integrity": "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/dcastil"+ }+ },+ "node_modules/tailwindcss": {+ "version": "4.3.3",+ "resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-4.3.3.tgz",+ "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/tapable": {+ "version": "2.3.3",+ "resolved": "https://registry.npmmirror.com/tapable/-/tapable-2.3.3.tgz",+ "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.17",+ "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz",+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "license": "0BSD"+ },+ "node_modules/typescript": {+ "version": "6.0.3",+ "resolved": "https://registry.npmmirror.com/typescript/-/typescript-6.0.3.tgz",+ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/undici-types": {+ "version": "7.18.2",+ "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-7.18.2.tgz",+ "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/use-callback-ref": {+ "version": "1.3.3",+ "resolved": "https://registry.npmmirror.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz",+ "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==",+ "license": "MIT",+ "dependencies": {+ "tslib": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/use-sidecar": {+ "version": "1.1.3",+ "resolved": "https://registry.npmmirror.com/use-sidecar/-/use-sidecar-1.1.3.tgz",+ "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==",+ "license": "MIT",+ "dependencies": {+ "detect-node-es": "^1.1.0",+ "tslib": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "peerDependencies": {+ "@types/react": "*",+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ }+ }+ },+ "node_modules/vite": {+ "version": "8.2.1",+ "resolved": "https://registry.npmmirror.com/vite/-/vite-8.2.1.tgz",+ "integrity": "sha512-EU/eS7BH3XROHh2YnBefjM6DBKA6ZeMZEYQbj7NLWg5wHYlhB8B/Mayd5XsgWq+NFYccDOTemRpdETWR6Ka/lw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "lightningcss": "^1.33.0",+ "picomatch": "^4.0.5",+ "postcss": "^8.5.25",+ "rolldown": "~1.2.1",+ "tinyglobby": "^0.2.17"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^20.19.0 || >=22.12.0",+ "@vitejs/devtools": "^0.4.0",+ "esbuild": "^0.27.0 || ^0.28.0",+ "jiti": ">=1.21.0",+ "less": "^4.0.0",+ "sass": "^1.70.0",+ "sass-embedded": "^1.70.0",+ "stylus": ">=0.54.8",+ "sugarss": "^5.0.0",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "@vitejs/devtools": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ }+ }+}diff --git a/admin/package.json b/admin/package.jsonnew file mode 100644index 0000000..9c98c8e--- /dev/null+++ b/admin/package.json@@ -0,0 +1,41 @@+{+ "name": "admin",+ "private": true,+ "version": "0.0.0",+ "type": "module",+ "scripts": {+ "dev": "vite",+ "build": "tsc -b && vite build",+ "lint": "oxlint",+ "preview": "vite preview"+ },+ "dependencies": {+ "@radix-ui/react-dialog": "^1.1.23",+ "@radix-ui/react-dropdown-menu": "^2.1.24",+ "@radix-ui/react-label": "^2.1.15",+ "@radix-ui/react-select": "^2.3.7",+ "@radix-ui/react-separator": "^1.1.15",+ "@radix-ui/react-slot": "^1.3.3",+ "@radix-ui/react-switch": "^1.3.7",+ "@radix-ui/react-tabs": "^1.1.21",+ "class-variance-authority": "^0.7.1",+ "clsx": "^2.1.1",+ "lucide-react": "^1.31.0",+ "react": "^19.2.8",+ "react-dom": "^19.2.8",+ "react-router-dom": "^7.18.2",+ "sonner": "^2.0.8",+ "tailwind-merge": "^3.6.0"+ },+ "devDependencies": {+ "@tailwindcss/vite": "^4.3.3",+ "@types/node": "^24.13.3",+ "@types/react": "^19.2.17",+ "@types/react-dom": "^19.2.3",+ "@vitejs/plugin-react": "^6.0.4",+ "oxlint": "^1.75.0",+ "tailwindcss": "^4.3.3",+ "typescript": "~6.0.2",+ "vite": "^8.2.0"+ }+}diff --git a/admin/public/favicon.svg b/admin/public/favicon.svgnew file mode 100644index 0000000..6893eb1--- /dev/null+++ b/admin/public/favicon.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>\ No newline at end of filediff --git a/admin/public/icons.svg b/admin/public/icons.svgnew file mode 100644index 0000000..e952219--- /dev/null+++ b/admin/public/icons.svg@@ -0,0 +1,24 @@+<svg xmlns="http://www.w3.org/2000/svg">+ <symbol id="bluesky-icon" viewBox="0 0 16 17">+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>+ </symbol>+ <symbol id="discord-icon" viewBox="0 0 20 19">+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>+ </symbol>+ <symbol id="documentation-icon" viewBox="0 0 21 20">+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>+ </symbol>+ <symbol id="github-icon" viewBox="0 0 19 19">+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>+ </symbol>+ <symbol id="social-icon" viewBox="0 0 20 20">+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>+ </symbol>+ <symbol id="x-icon" viewBox="0 0 19 19">+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>+ </symbol>+</svg>diff --git a/admin/src/App.tsx b/admin/src/App.tsxnew file mode 100644index 0000000..3a99166--- /dev/null+++ b/admin/src/App.tsx@@ -0,0 +1,40 @@+import { Navigate, Outlet, Route, Routes } from "react-router-dom";+import { AdminLayout } from "@/components/layout/AdminLayout";+import { getCachedUser, getToken, isAdminUser } from "@/lib/auth";+import { DashboardPage } from "@/pages/DashboardPage";+import { LoginPage } from "@/pages/LoginPage";+import { OrdersPage } from "@/pages/OrdersPage";+import { ProjectsPage } from "@/pages/ProjectsPage";+import { TemplatesPage } from "@/pages/TemplatesPage";+import { UsersPage } from "@/pages/UsersPage";+import { WorksPage } from "@/pages/WorksPage";++// Guard: require JWT + admin role+function RequireAdmin() {+ const token = getToken();+ const user = getCachedUser();+ if (!token || !isAdminUser(user)) {+ return <Navigate to="/login" replace />;+ }+ return <Outlet />;+}++// Admin app routes+export default function App() {+ return (+ <Routes>+ <Route path="/login" element={<LoginPage />} />+ <Route element={<RequireAdmin />}>+ <Route element={<AdminLayout />}>+ <Route index element={<DashboardPage />} />+ <Route path="users" element={<UsersPage />} />+ <Route path="orders" element={<OrdersPage />} />+ <Route path="projects" element={<ProjectsPage />} />+ <Route path="works" element={<WorksPage />} />+ <Route path="templates" element={<TemplatesPage />} />+ </Route>+ </Route>+ <Route path="*" element={<Navigate to="/" replace />} />+ </Routes>+ );+}diff --git a/admin/src/api/client.ts b/admin/src/api/client.tsnew file mode 100644index 0000000..dc68873--- /dev/null+++ b/admin/src/api/client.ts@@ -0,0 +1,167 @@+import { clearAuth, getToken, setCachedUser, setToken, type AdminUser } from "@/lib/auth";++export type PageMeta = {+ page: number;+ page_size: number;+ total: number;+};++type ApiError = {+ detail?: string | { msg?: string }[];+};++// Parse FastAPI error detail into a string+function errorMessage(data: ApiError, status: number): string {+ const detail = data?.detail;+ if (typeof detail === "string") return detail;+ if (Array.isArray(detail) && detail[0]?.msg) return detail[0].msg;+ return `请求失败 (${status})`;+}++// Authenticated JSON fetch against /api+export async function api<T>(+ path: string,+ options: RequestInit = {},+): Promise<T> {+ const headers = new Headers(options.headers);+ if (!headers.has("Content-Type") && options.body) {+ headers.set("Content-Type", "application/json");+ }+ const token = getToken();+ if (token) headers.set("Authorization", `Bearer ${token}`);++ const res = await fetch(path, { ...options, headers });+ if (res.status === 401) {+ clearAuth();+ if (!window.location.pathname.startsWith("/login")) {+ window.location.href = "/login";+ }+ throw new Error("未登录或登录已失效");+ }+ const text = await res.text();+ const data = text ? (JSON.parse(text) as ApiError & T) : ({} as T);+ if (!res.ok) {+ throw new Error(errorMessage(data as ApiError, res.status));+ }+ return data as T;+}++// Login then verify admin role via /auth/me+export async function loginAsAdmin(email: string, password: string): Promise<AdminUser> {+ const tokenRes = await api<{ access_token: string }>("/api/auth/login", {+ method: "POST",+ body: JSON.stringify({ email, password }),+ });+ setToken(tokenRes.access_token);+ const me = await api<AdminUser>("/api/auth/me");+ if (me.role !== "admin") {+ clearAuth();+ throw new Error("该账号没有管理员权限");+ }+ setCachedUser(me);+ return me;+}++export type AdminStats = {+ user_count: number;+ order_paid_total_fen: number;+ order_paid_today_fen: number;+ project_status_counts: Record<string, number>;+};++export type AdminUserRow = {+ id: number;+ email: string;+ nickname: string;+ quota_left: number;+ balance_fen: number;+ frozen_fen: number;+ plan: string;+ billing_unlimited: boolean;+ role: string;+ created_at?: string | null;+};++export type AdminOrder = {+ id: number;+ out_trade_no: string;+ user_id: number;+ user_email?: string | null;+ sku_id: string;+ amount_fen: number;+ credit_fen: number;+ pay_type: string;+ status: string;+ trade_no?: string | null;+ paid_at?: string | null;+ created_at: string;+};++export type AdminLedger = {+ id: number;+ user_id: number;+ user_email?: string | null;+ delta_fen: number;+ balance_after: number;+ kind: string;+ ref_type: string;+ ref_id: string;+ note: string;+ created_at: string;+};++export type AdminProject = {+ id: number;+ user_id: number;+ user_email?: string | null;+ template_id: string;+ title: string;+ status: string;+ progress: number;+ error_msg?: string | null;+ cover_url?: string | null;+ final_video_url?: string | null;+ pipeline_mode: string;+ created_at: string;+ updated_at: string;+ shot_count: number;+ source_type?: string;+ source_text?: string;+ resolution_mode?: string;+ output_ratio?: string;+ voice_id?: string;+};++export type AdminWork = {+ id: number;+ project_id: number;+ user_id: number;+ user_email?: string | null;+ title: string;+ cover_url?: string | null;+ video_url: string;+ visibility: string;+ audit_status: string;+ published_at: string;+};++export type AdminTemplate = {+ id: string;+ name: string;+ description: string;+ category: string[];+ preview_cover: string;+ style_prefix: string;+ negative_prompt: string;+ default_ratio: string;+ shot_duration_min: number;+ shot_duration_max: number;+ llm_system_addon: string;+ seedream_config: Record<string, unknown>;+ seedance_config: Record<string, unknown>;+ audio_config: Record<string, unknown>;+ subtitle_config: Record<string, unknown>;+ sort_order: number;+ is_active: boolean;+ is_premium: boolean;+};diff --git a/admin/src/assets/hero.png b/admin/src/assets/hero.pngnew file mode 100644index 0000000..02251f4Binary files /dev/null and b/admin/src/assets/hero.png differdiff --git a/admin/src/assets/react.svg b/admin/src/assets/react.svgnew file mode 100644index 0000000..6c87de9--- /dev/null+++ b/admin/src/assets/react.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>\ No newline at end of filediff --git a/admin/src/assets/vite.svg b/admin/src/assets/vite.svgnew file mode 100644index 0000000..5101b67--- /dev/null+++ b/admin/src/assets/vite.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>diff --git a/admin/src/components/PaginationBar.tsx b/admin/src/components/PaginationBar.tsxnew file mode 100644index 0000000..9d12910--- /dev/null+++ b/admin/src/components/PaginationBar.tsx@@ -0,0 +1,33 @@+import { Button } from "@/components/ui/button";++type Props = {+ page: number;+ pageSize: number;+ total: number;+ onPageChange: (page: number) => void;+};++// Simple prev/next pagination+export function PaginationBar({ page, pageSize, total, onPageChange }: Props) {+ const totalPages = Math.max(1, Math.ceil(total / pageSize));+ return (+ <div className="flex items-center justify-between gap-3 pt-4 text-sm text-muted-foreground">+ <span>+ 共 {total} 条 · 第 {page}/{totalPages} 页+ </span>+ <div className="flex gap-2">+ <Button variant="outline" size="sm" disabled={page <= 1} onClick={() => onPageChange(page - 1)}>+ 上一页+ </Button>+ <Button+ variant="outline"+ size="sm"+ disabled={page >= totalPages}+ onClick={() => onPageChange(page + 1)}+ >+ 下一页+ </Button>+ </div>+ </div>+ );+}diff --git a/admin/src/components/layout/AdminLayout.tsx b/admin/src/components/layout/AdminLayout.tsxnew file mode 100644index 0000000..40d7d6a--- /dev/null+++ b/admin/src/components/layout/AdminLayout.tsx@@ -0,0 +1,73 @@+import { NavLink, Outlet, useNavigate } from "react-router-dom";+import {+ Clapperboard,+ FileVideo,+ LayoutDashboard,+ LogOut,+ Receipt,+ Shapes,+ Users,+} from "lucide-react";+import { clearAuth, getCachedUser } from "@/lib/auth";+import { Button } from "@/components/ui/button";+import { cn } from "@/lib/utils";++const navItems = [+ { to: "/", label: "仪表盘", icon: LayoutDashboard, end: true },+ { to: "/users", label: "用户管理", icon: Users },+ { to: "/orders", label: "订单流水", icon: Receipt },+ { to: "/projects", label: "项目管理", icon: Clapperboard },+ { to: "/works", label: "作品审核", icon: FileVideo },+ { to: "/templates", label: "模板管理", icon: Shapes },+];++// Admin shell with sidebar navigation+export function AdminLayout() {+ const navigate = useNavigate();+ const user = getCachedUser();++ // Logout and return to login+ function handleLogout() {+ clearAuth();+ navigate("/login");+ }++ return (+ <div className="flex min-h-screen bg-muted/30">+ <aside className="flex w-56 flex-col border-r bg-background">+ <div className="border-b px-4 py-5">+ <div className="text-xs font-medium uppercase tracking-wide text-muted-foreground">PRINTFILM</div>+ <div className="text-lg font-semibold">管理后台</div>+ </div>+ <nav className="flex flex-1 flex-col gap-1 p-3">+ {navItems.map((item) => (+ <NavLink+ key={item.to}+ to={item.to}+ end={item.end}+ className={({ isActive }) =>+ cn(+ "flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",+ isActive ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground",+ )+ }+ >+ <item.icon className="h-4 w-4" />+ {item.label}+ </NavLink>+ ))}+ </nav>+ <div className="border-t p-3">+ <div className="mb-2 truncate px-1 text-xs text-muted-foreground">{user?.email}</div>+ <Button variant="outline" size="sm" className="w-full" onClick={handleLogout}>+ <LogOut className="h-4 w-4" />+ 退出登录+ </Button>+ </div>+ </aside>+ <main className="flex-1 overflow-auto p-6">+ <Outlet />+ </main>+ </div>+ );+}diff --git a/admin/src/components/ui/badge.tsx b/admin/src/components/ui/badge.tsxnew file mode 100644index 0000000..8f7f0a9--- /dev/null+++ b/admin/src/components/ui/badge.tsx@@ -0,0 +1,26 @@+import * as React from "react";+import { cn } from "@/lib/utils";++// Status / tag badge+export function Badge({+ className,+ variant = "default",+ ...props+}: React.ComponentProps<"span"> & { variant?: "default" | "secondary" | "outline" | "destructive" }) {+ const variants = {+ default: "border-transparent bg-primary text-primary-foreground",+ secondary: "border-transparent bg-secondary text-secondary-foreground",+ outline: "text-foreground",+ destructive: "border-transparent bg-destructive text-white",+ };+ return (+ <span+ className={cn(+ "inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold",+ variants[variant],+ className,+ )}+ {...props}+ />+ );+}diff --git a/admin/src/components/ui/button.tsx b/admin/src/components/ui/button.tsxnew file mode 100644index 0000000..3ec645a--- /dev/null+++ b/admin/src/components/ui/button.tsx@@ -0,0 +1,41 @@+import * as React from "react";+import { Slot } from "@radix-ui/react-slot";+import { cva, type VariantProps } from "class-variance-authority";+import { cn } from "@/lib/utils";++const buttonVariants = cva(+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",+ {+ variants: {+ variant: {+ default: "bg-primary text-primary-foreground hover:bg-primary/90",+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",+ ghost: "hover:bg-accent hover:text-accent-foreground",+ destructive: "bg-destructive text-white hover:bg-destructive/90",+ },+ size: {+ default: "h-9 px-4 py-2",+ sm: "h-8 rounded-md px-3 text-xs",+ lg: "h-10 rounded-md px-8",+ icon: "h-9 w-9",+ },+ },+ defaultVariants: {+ variant: "default",+ size: "default",+ },+ },+);++export interface ButtonProps+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,+ VariantProps<typeof buttonVariants> {+ asChild?: boolean;+}++// shadcn-style button+export function Button({ className, variant, size, asChild = false, ...props }: ButtonProps) {+ const Comp = asChild ? Slot : "button";+ return <Comp className={cn(buttonVariants({ variant, size, className }))} {...props} />;+}diff --git a/admin/src/components/ui/card.tsx b/admin/src/components/ui/card.tsxnew file mode 100644index 0000000..1d8e7e6--- /dev/null+++ b/admin/src/components/ui/card.tsx@@ -0,0 +1,23 @@+import * as React from "react";+import { cn } from "@/lib/utils";++// Card container+export function Card({ className, ...props }: React.ComponentProps<"div">) {+ return <div className={cn("rounded-xl border bg-card text-card-foreground shadow-sm", className)} {...props} />;+}++export function CardHeader({ className, ...props }: React.ComponentProps<"div">) {+ return <div className={cn("flex flex-col gap-1.5 p-6", className)} {...props} />;+}++export function CardTitle({ className, ...props }: React.ComponentProps<"h3">) {+ return <h3 className={cn("font-semibold leading-none tracking-tight", className)} {...props} />;+}++export function CardDescription({ className, ...props }: React.ComponentProps<"p">) {+ return <p className={cn("text-sm text-muted-foreground", className)} {...props} />;+}++export function CardContent({ className, ...props }: React.ComponentProps<"div">) {+ return <div className={cn("p-6 pt-0", className)} {...props} />;+}diff --git a/admin/src/components/ui/dialog.tsx b/admin/src/components/ui/dialog.tsxnew file mode 100644index 0000000..2fed243--- /dev/null+++ b/admin/src/components/ui/dialog.tsx@@ -0,0 +1,47 @@+import * as React from "react";+import * as DialogPrimitive from "@radix-ui/react-dialog";+import { X } from "lucide-react";+import { cn } from "@/lib/utils";++export const Dialog = DialogPrimitive.Root;+export const DialogTrigger = DialogPrimitive.Trigger;+export const DialogClose = DialogPrimitive.Close;++export function DialogContent({+ className,+ children,+ ...props+}: React.ComponentProps<typeof DialogPrimitive.Content>) {+ return (+ <DialogPrimitive.Portal>+ <DialogPrimitive.Overlay className="fixed inset-0 z-50 bg-black/50" />+ <DialogPrimitive.Content+ className={cn(+ "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg sm:rounded-lg",+ className,+ )}+ {...props}+ >+ {children}+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100">+ <X className="h-4 w-4" />+ </DialogPrimitive.Close>+ </DialogPrimitive.Content>+ </DialogPrimitive.Portal>+ );+}++export function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {+ return <div className={cn("flex flex-col gap-1.5 text-center sm:text-left", className)} {...props} />;+}++export function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {+ return <DialogPrimitive.Title className={cn("text-lg font-semibold", className)} {...props} />;+}++export function DialogDescription({+ className,+ ...props+}: React.ComponentProps<typeof DialogPrimitive.Description>) {+ return <DialogPrimitive.Description className={cn("text-sm text-muted-foreground", className)} {...props} />;+}diff --git a/admin/src/components/ui/input.tsx b/admin/src/components/ui/input.tsxnew file mode 100644index 0000000..2b6fe46--- /dev/null+++ b/admin/src/components/ui/input.tsx@@ -0,0 +1,16 @@+import * as React from "react";+import { cn } from "@/lib/utils";++// Text input+export function Input({ className, type, ...props }: React.ComponentProps<"input">) {+ return (+ <input+ type={type}+ className={cn(+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",+ className,+ )}+ {...props}+ />+ );+}diff --git a/admin/src/components/ui/label.tsx b/admin/src/components/ui/label.tsxnew file mode 100644index 0000000..87caa75--- /dev/null+++ b/admin/src/components/ui/label.tsx@@ -0,0 +1,13 @@+import * as React from "react";+import * as LabelPrimitive from "@radix-ui/react-label";+import { cn } from "@/lib/utils";++// Form label+export function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {+ return (+ <LabelPrimitive.Root+ className={cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className)}+ {...props}+ />+ );+}diff --git a/admin/src/components/ui/select.tsx b/admin/src/components/ui/select.tsxnew file mode 100644index 0000000..5f82d5a--- /dev/null+++ b/admin/src/components/ui/select.tsx@@ -0,0 +1,28 @@+import * as React from "react";+import { cn } from "@/lib/utils";++// Native select styled like shadcn+export function Select({ className, ...props }: React.ComponentProps<"select">) {+ return (+ <select+ className={cn(+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",+ className,+ )}+ {...props}+ />+ );+}++// Multi-line text area+export function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {+ return (+ <textarea+ className={cn(+ "flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",+ className,+ )}+ {...props}+ />+ );+}diff --git a/admin/src/components/ui/switch.tsx b/admin/src/components/ui/switch.tsxnew file mode 100644index 0000000..62554a7--- /dev/null+++ b/admin/src/components/ui/switch.tsx@@ -0,0 +1,18 @@+import * as React from "react";+import * as SwitchPrimitive from "@radix-ui/react-switch";+import { cn } from "@/lib/utils";++// Toggle switch+export function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {+ return (+ <SwitchPrimitive.Root+ className={cn(+ "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-colors data-[state=checked]:bg-primary",+ className,+ )}+ {...props}+ >+ <SwitchPrimitive.Thumb className="pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0" />+ </SwitchPrimitive.Root>+ );+}diff --git a/admin/src/components/ui/table.tsx b/admin/src/components/ui/table.tsxnew file mode 100644index 0000000..d5c9249--- /dev/null+++ b/admin/src/components/ui/table.tsx@@ -0,0 +1,36 @@+import * as React from "react";+import { cn } from "@/lib/utils";++// Table primitives+export function Table({ className, ...props }: React.ComponentProps<"table">) {+ return (+ <div className="relative w-full overflow-auto">+ <table className={cn("w-full caption-bottom text-sm", className)} {...props} />+ </div>+ );+}++export function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {+ return <thead className={cn("[&_tr]:border-b", className)} {...props} />;+}++export function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {+ return <tbody className={cn("[&_tr:last-child]:border-0", className)} {...props} />;+}++export function TableRow({ className, ...props }: React.ComponentProps<"tr">) {+ return <tr className={cn("border-b transition-colors hover:bg-muted/50", className)} {...props} />;+}++export function TableHead({ className, ...props }: React.ComponentProps<"th">) {+ return (+ <th+ className={cn("h-10 px-3 text-left align-middle font-medium text-muted-foreground", className)}+ {...props}+ />+ );+}++export function TableCell({ className, ...props }: React.ComponentProps<"td">) {+ return <td className={cn("p-3 align-middle", className)} {...props} />;+}diff --git a/admin/src/components/ui/tabs.tsx b/admin/src/components/ui/tabs.tsxnew file mode 100644index 0000000..3b760b2--- /dev/null+++ b/admin/src/components/ui/tabs.tsx@@ -0,0 +1,30 @@+import * as React from "react";+import * as TabsPrimitive from "@radix-ui/react-tabs";+import { cn } from "@/lib/utils";++export const Tabs = TabsPrimitive.Root;++export function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {+ return (+ <TabsPrimitive.List+ className={cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground", className)}+ {...props}+ />+ );+}++export function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {+ return (+ <TabsPrimitive.Trigger+ className={cn(+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",+ className,+ )}+ {...props}+ />+ );+}++export function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {+ return <TabsPrimitive.Content className={cn("mt-4 focus-visible:outline-none", className)} {...props} />;+}diff --git a/admin/src/index.css b/admin/src/index.cssnew file mode 100644index 0000000..a6f40e0--- /dev/null+++ b/admin/src/index.css@@ -0,0 +1,288 @@+@import "tailwindcss";++@theme inline {+ --color-background: oklch(1 0 0);+ --color-foreground: oklch(0.145 0 0);+ --color-card: oklch(1 0 0);+ --color-card-foreground: oklch(0.145 0 0);+ --color-popover: oklch(1 0 0);+ --color-popover-foreground: oklch(0.145 0 0);+ --color-primary: oklch(0.205 0 0);+ --color-primary-foreground: oklch(0.985 0 0);+ --color-secondary: oklch(0.97 0 0);+ --color-secondary-foreground: oklch(0.205 0 0);+ --color-muted: oklch(0.97 0 0);+ --color-muted-foreground: oklch(0.556 0 0);+ --color-accent: oklch(0.97 0 0);+ --color-accent-foreground: oklch(0.205 0 0);+ --color-destructive: oklch(0.577 0.245 27.325);+ --color-border: oklch(0.922 0 0);+ --color-input: oklch(0.922 0 0);+ --color-ring: oklch(0.708 0 0);+ --radius-sm: 0.25rem;+ --radius-md: 0.375rem;+ --radius-lg: 0.5rem;+ --radius-xl: 0.75rem;+ --font-display: "Anybody", ui-sans-serif, system-ui, sans-serif;+ --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;+}++@layer base {+ * {+ @apply border-border;+ }+ body {+ @apply bg-background text-foreground antialiased;+ margin: 0;+ min-height: 100vh;+ font-family: var(--font-sans);+ }+}++/* Login page atmosphere */+.login-shell {+ --ink: #141814;+ --paper: #f0eee8;+ --panel: #faf9f6;+ --forest: #1f5c48;+ --forest-deep: #163f33;+ position: relative;+ min-height: 100vh;+ display: grid;+ grid-template-columns: 1.1fr 0.9fr;+ background: var(--paper);+ color: var(--ink);+ overflow: hidden;+}++.login-brand {+ position: relative;+ display: flex;+ flex-direction: column;+ justify-content: flex-end;+ padding: clamp(2rem, 5vw, 4.5rem);+ background:+ radial-gradient(ellipse 80% 60% at 20% 20%, rgba(31, 92, 72, 0.18), transparent 55%),+ radial-gradient(ellipse 50% 40% at 90% 80%, rgba(184, 160, 120, 0.22), transparent 50%),+ linear-gradient(155deg, #1a2e26 0%, #24352e 42%, #2c3f36 100%);+ color: #f4f1ea;+ isolation: isolate;+}++.login-brand::before {+ content: "";+ position: absolute;+ inset: 0;+ z-index: -1;+ opacity: 0.35;+ background-image:+ linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),+ linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);+ background-size: 48px 48px;+ mask-image: linear-gradient(180deg, #000 20%, transparent 95%);+ animation: login-grid-drift 28s linear infinite;+}++.login-brand::after {+ content: "";+ position: absolute;+ inset: 0;+ z-index: -1;+ pointer-events: none;+ background:+ repeating-linear-gradient(+ 90deg,+ transparent 0,+ transparent 22px,+ rgba(0, 0, 0, 0.18) 22px,+ rgba(0, 0, 0, 0.18) 28px+ );+ opacity: 0.2;+ mix-blend-mode: multiply;+}++.login-sprocket {+ position: absolute;+ top: 12%;+ right: -2rem;+ width: 7rem;+ height: 70%;+ border-left: 2px solid rgba(244, 241, 234, 0.18);+ border-right: 2px solid rgba(244, 241, 234, 0.18);+ opacity: 0.55;+}++.login-sprocket span {+ position: absolute;+ left: 50%;+ width: 1.15rem;+ height: 1.15rem;+ border-radius: 2px;+ background: rgba(244, 241, 234, 0.2);+ transform: translateX(-50%);+}++.login-eyebrow {+ font-family: var(--font-sans);+ font-size: 0.75rem;+ letter-spacing: 0.28em;+ text-transform: uppercase;+ color: rgba(244, 241, 234, 0.62);+ margin-bottom: 1.25rem;+ animation: login-rise 0.7s ease-out both;+}++.login-title {+ font-family: var(--font-display);+ font-weight: 800;+ font-size: clamp(3.2rem, 8vw, 6.5rem);+ line-height: 0.92;+ letter-spacing: -0.03em;+ margin: 0;+ animation: login-rise 0.8s ease-out 0.08s both;+}++.login-sub {+ margin-top: 1.5rem;+ max-width: 22rem;+ font-size: 1.05rem;+ line-height: 1.55;+ color: rgba(244, 241, 234, 0.72);+ animation: login-rise 0.8s ease-out 0.16s both;+}++.login-panel {+ display: flex;+ align-items: center;+ justify-content: center;+ padding: clamp(1.5rem, 4vw, 3rem);+ background:+ radial-gradient(circle at 80% 10%, rgba(31, 92, 72, 0.06), transparent 40%),+ var(--panel);+}++.login-form-wrap {+ width: 100%;+ max-width: 24rem;+ animation: login-rise 0.75s ease-out 0.2s both;+}++.login-form-wrap h2 {+ font-family: var(--font-display);+ font-weight: 700;+ font-size: 2rem;+ letter-spacing: -0.02em;+ margin: 0 0 0.4rem;+}++.login-form-wrap p {+ margin: 0 0 2rem;+ color: #5c635c;+ font-size: 0.95rem;+}++.login-field {+ display: flex;+ flex-direction: column;+ gap: 0.45rem;+ margin-bottom: 1.1rem;+}++.login-field label {+ font-size: 0.8rem;+ font-weight: 600;+ letter-spacing: 0.04em;+ text-transform: uppercase;+ color: #4a524c;+}++.login-field input {+ height: 2.75rem;+ border-radius: 0.4rem;+ border: 1px solid #cfd4ce;+ background: #fff;+ padding: 0 0.9rem;+ font-size: 0.95rem;+ transition: border-color 0.2s, box-shadow 0.2s;+}++.login-field input:focus {+ outline: none;+ border-color: var(--forest);+ box-shadow: 0 0 0 3px rgba(31, 92, 72, 0.15);+}++.login-submit {+ margin-top: 0.5rem;+ width: 100%;+ height: 2.85rem;+ border: 0;+ border-radius: 0.4rem;+ background: var(--forest);+ color: #f7f5f0;+ font-family: var(--font-sans);+ font-size: 0.95rem;+ font-weight: 600;+ letter-spacing: 0.02em;+ cursor: pointer;+ transition: background 0.2s, transform 0.15s;+}++.login-submit:hover:not(:disabled) {+ background: var(--forest-deep);+}++.login-submit:active:not(:disabled) {+ transform: translateY(1px);+}++.login-submit:disabled {+ opacity: 0.65;+ cursor: not-allowed;+}++.login-hint {+ margin-top: 1.5rem;+ font-size: 0.8rem;+ color: #7a827a;+}++@keyframes login-rise {+ from {+ opacity: 0;+ transform: translateY(14px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }+}++@keyframes login-grid-drift {+ from {+ background-position: 0 0;+ }+ to {+ background-position: 0 48px;+ }+}++@media (max-width: 860px) {+ .login-shell {+ grid-template-columns: 1fr;+ }++ .login-brand {+ min-height: 42vh;+ justify-content: flex-end;+ padding-bottom: 2rem;+ }++ .login-sprocket {+ display: none;+ }++ .login-title {+ font-size: clamp(2.6rem, 12vw, 4rem);+ }+}diff --git a/admin/src/lib/auth.ts b/admin/src/lib/auth.tsnew file mode 100644index 0000000..0abb05c--- /dev/null+++ b/admin/src/lib/auth.ts@@ -0,0 +1,53 @@+/*+ * TOKEN_KEY localStorage key for JWT+ * USER_KEY cached admin profile+ */+const TOKEN_KEY = "admin_token";+const USER_KEY = "admin_user";++export type AdminUser = {+ id: number;+ email: string;+ nickname: string;+ role: string;+ plan: string;+ balance_fen: number;+ billing_unlimited: boolean;+};++// Read stored JWT+export function getToken(): string | null {+ return localStorage.getItem(TOKEN_KEY);+}++// Persist JWT+export function setToken(token: string): void {+ localStorage.setItem(TOKEN_KEY, token);+}++// Clear auth state+export function clearAuth(): void {+ localStorage.removeItem(TOKEN_KEY);+ localStorage.removeItem(USER_KEY);+}++// Read cached user profile+export function getCachedUser(): AdminUser | null {+ const raw = localStorage.getItem(USER_KEY);+ if (!raw) return null;+ try {+ return JSON.parse(raw) as AdminUser;+ } catch {+ return null;+ }+}++// Cache user profile+export function setCachedUser(user: AdminUser): void {+ localStorage.setItem(USER_KEY, JSON.stringify(user));+}++// Whether current cached user is admin+export function isAdminUser(user: AdminUser | null): boolean {+ return !!user && user.role === "admin";+}diff --git a/admin/src/lib/utils.ts b/admin/src/lib/utils.tsnew file mode 100644index 0000000..5d95dc9--- /dev/null+++ b/admin/src/lib/utils.ts@@ -0,0 +1,12 @@+import { clsx, type ClassValue } from "clsx";+import { twMerge } from "tailwind-merge";++// Merge Tailwind class names with conflict resolution+export function cn(...inputs: ClassValue[]) {+ return twMerge(clsx(inputs));+}++// Format fen to yuan display string+export function fenToYuan(fen: number): string {+ return (fen / 100).toFixed(2);+}diff --git a/admin/src/main.tsx b/admin/src/main.tsxnew file mode 100644index 0000000..9def58a--- /dev/null+++ b/admin/src/main.tsx@@ -0,0 +1,15 @@+import { StrictMode } from "react";+import { createRoot } from "react-dom/client";+import { BrowserRouter } from "react-router-dom";+import { Toaster } from "sonner";+import App from "./App";+import "./index.css";++createRoot(document.getElementById("root")!).render(+ <StrictMode>+ <BrowserRouter>+ <App />+ <Toaster richColors position="top-right" />+ </BrowserRouter>+ </StrictMode>,+);diff --git a/admin/src/pages/DashboardPage.tsx b/admin/src/pages/DashboardPage.tsxnew file mode 100644index 0000000..1686af6--- /dev/null+++ b/admin/src/pages/DashboardPage.tsx@@ -0,0 +1,71 @@+import { useEffect, useState } from "react";+import { toast } from "sonner";+import { api, type AdminStats } from "@/api/client";+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+import { fenToYuan } from "@/lib/utils";+import { Badge } from "@/components/ui/badge";++// Dashboard overview stats+export function DashboardPage() {+ const [stats, setStats] = useState<AdminStats | null>(null);++ useEffect(() => {+ api<AdminStats>("/api/admin/stats")+ .then(setStats)+ .catch((err) => toast.error(err instanceof Error ? err.message : "加载失败"));+ }, []);++ const statusEntries = Object.entries(stats?.project_status_counts ?? {}).sort(+ (a, b) => b[1] - a[1],+ );++ return (+ <div className="space-y-6">+ <div>+ <h1 className="text-2xl font-semibold">仪表盘</h1>+ <p className="text-sm text-muted-foreground">用户、订单与项目状态概览</p>+ </div>+ <div className="grid gap-4 md:grid-cols-3">+ <Card>+ <CardHeader>+ <CardTitle className="text-sm font-medium text-muted-foreground">用户总数</CardTitle>+ </CardHeader>+ <CardContent className="text-3xl font-semibold">{stats?.user_count ?? "—"}</CardContent>+ </Card>+ <Card>+ <CardHeader>+ <CardTitle className="text-sm font-medium text-muted-foreground">累计已付金额</CardTitle>+ </CardHeader>+ <CardContent className="text-3xl font-semibold">+ ¥{stats ? fenToYuan(stats.order_paid_total_fen) : "—"}+ </CardContent>+ </Card>+ <Card>+ <CardHeader>+ <CardTitle className="text-sm font-medium text-muted-foreground">今日已付金额</CardTitle>+ </CardHeader>+ <CardContent className="text-3xl font-semibold">+ ¥{stats ? fenToYuan(stats.order_paid_today_fen) : "—"}+ </CardContent>+ </Card>+ </div>+ <Card>+ <CardHeader>+ <CardTitle>项目状态分布</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-wrap gap-2">+ {statusEntries.length === 0 ? (+ <span className="text-sm text-muted-foreground">暂无数据</span>+ ) : (+ statusEntries.map(([status, count]) => (+ <Badge key={status} variant="secondary" className="gap-2 px-3 py-1 text-sm font-normal">+ <span className="font-medium">{status}</span>+ <span>{count}</span>+ </Badge>+ ))+ )}+ </CardContent>+ </Card>+ </div>+ );+}diff --git a/admin/src/pages/LoginPage.tsx b/admin/src/pages/LoginPage.tsxnew file mode 100644index 0000000..98cb83b--- /dev/null+++ b/admin/src/pages/LoginPage.tsx@@ -0,0 +1,89 @@+import { useState, type FormEvent } from "react";+import { useNavigate } from "react-router-dom";+import { toast } from "sonner";+import { loginAsAdmin } from "@/api/client";++// Admin login — film-lab ops aesthetic+export function LoginPage() {+ const navigate = useNavigate();+ /*+ * email login email+ * password login password+ * loading submit state+ */+ const [email, setEmail] = useState("[email protected]");+ const [password, setPassword] = useState("");+ const [loading, setLoading] = useState(false);++ // Submit credentials and enter dashboard+ async function onSubmit(e: FormEvent) {+ e.preventDefault();+ setLoading(true);+ try {+ await loginAsAdmin(email.trim(), password);+ toast.success("登录成功");+ navigate("/", { replace: true });+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "登录失败");+ } finally {+ setLoading(false);+ }+ }++ const sprocketOffsets = ["8%", "22%", "36%", "50%", "64%", "78%", "90%"];++ return (+ <div className="login-shell">+ <section className="login-brand" aria-label="品牌">+ <div className="login-sprocket" aria-hidden>+ {sprocketOffsets.map((top) => (+ <span key={top} style={{ top }} />+ ))}+ </div>+ <div className="login-eyebrow">Ops Console</div>+ <h1 className="login-title">+ <br />+ FILM+ </h1>+ <p className="login-sub">管理用户、订单、项目与模板。同一套账号体系,仅管理员可进入。</p>+ </section>++ <section className="login-panel">+ <div className="login-form-wrap">+ <h2>登录后台</h2>+ <p>使用已授权的管理员邮箱与密码</p>+ <form onSubmit={onSubmit}>+ <div className="login-field">+ <label htmlFor="email">邮箱</label>+ <input+ id="email"+ type="email"+ autoComplete="username"+ value={email}+ onChange={(e) => setEmail(e.target.value)}+ required+ />+ </div>+ <div className="login-field">+ <label htmlFor="password">密码</label>+ <input+ id="password"+ type="password"+ autoComplete="current-password"+ value={password}+ onChange={(e) => setPassword(e.target.value)}+ required+ placeholder="输入密码"+ />+ </div>+ <button className="login-submit" type="submit" disabled={loading}>+ {loading ? "验证中…" : "进入控制台"}+ </button>+ </form>+ <p className="login-hint">本地演示账号已预填邮箱,密码见 README / 团队约定。</p>+ </div>+ </section>+ </div>+ );+}diff --git a/admin/src/pages/OrdersPage.tsx b/admin/src/pages/OrdersPage.tsxnew file mode 100644index 0000000..14261b2--- /dev/null+++ b/admin/src/pages/OrdersPage.tsx@@ -0,0 +1,232 @@+import { useEffect, useState } from "react";+import { toast } from "sonner";+import { api, type AdminLedger, type AdminOrder, type PageMeta } from "@/api/client";+import { PaginationBar } from "@/components/PaginationBar";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { Select } from "@/components/ui/select";+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";+import { fenToYuan } from "@/lib/utils";++type OrderRes = { items: AdminOrder[]; meta: PageMeta };+type LedgerRes = { items: AdminLedger[]; meta: PageMeta };++// Orders and wallet ledger tabs+export function OrdersPage() {+ /*+ * tab active tab+ * orderStatus order filter+ * orderUserId user id filter for orders+ * ledgerKind ledger kind filter+ * ledgerUserId user id filter for ledger+ * orderPage orders page+ * ledgerPage ledger page+ * orders order list+ * ledger ledger list+ */+ const [tab, setTab] = useState("orders");+ const [orderStatus, setOrderStatus] = useState("");+ const [orderUserId, setOrderUserId] = useState("");+ const [ledgerKind, setLedgerKind] = useState("");+ const [ledgerUserId, setLedgerUserId] = useState("");+ const [orderPage, setOrderPage] = useState(1);+ const [ledgerPage, setLedgerPage] = useState(1);+ const [orders, setOrders] = useState<OrderRes | null>(null);+ const [ledger, setLedger] = useState<LedgerRes | null>(null);++ // Load recharge orders+ async function loadOrders(page = orderPage) {+ try {+ const params = new URLSearchParams({ page: String(page), page_size: "20" });+ if (orderStatus) params.set("status", orderStatus);+ if (orderUserId.trim()) params.set("user_id", orderUserId.trim());+ setOrders(await api<OrderRes>(`/api/admin/orders?${params}`));+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载订单失败");+ }+ }++ // Load wallet ledger+ async function loadLedger(page = ledgerPage) {+ try {+ const params = new URLSearchParams({ page: String(page), page_size: "20" });+ if (ledgerKind) params.set("kind", ledgerKind);+ if (ledgerUserId.trim()) params.set("user_id", ledgerUserId.trim());+ setLedger(await api<LedgerRes>(`/api/admin/ledger?${params}`));+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载流水失败");+ }+ }++ useEffect(() => {+ void loadOrders();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [orderPage]);++ useEffect(() => {+ void loadLedger();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [ledgerPage]);++ return (+ <div className="space-y-4">+ <div>+ <h1 className="text-2xl font-semibold">订单与流水</h1>+ <p className="text-sm text-muted-foreground">查看充值单与钱包流水</p>+ </div>+ <Tabs value={tab} onValueChange={setTab}>+ <TabsList>+ <TabsTrigger value="orders">充值订单</TabsTrigger>+ <TabsTrigger value="ledger">钱包流水</TabsTrigger>+ </TabsList>+ <TabsContent value="orders" className="space-y-4">+ <div className="flex flex-wrap gap-2">+ <Select+ className="w-40"+ value={orderStatus}+ onChange={(e) => setOrderStatus(e.target.value)}+ >+ <option value="">全部状态</option>+ <option value="pending">pending</option>+ <option value="paid">paid</option>+ <option value="closed">closed</option>+ </Select>+ <Input+ className="w-40"+ placeholder="用户 ID"+ value={orderUserId}+ onChange={(e) => setOrderUserId(e.target.value)}+ />+ <Button+ variant="secondary"+ onClick={() => {+ setOrderPage(1);+ void loadOrders(1);+ }}+ >+ 筛选+ </Button>+ </div>+ <div className="rounded-lg border bg-background">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>单号</TableHead>+ <TableHead>用户</TableHead>+ <TableHead>SKU</TableHead>+ <TableHead>金额</TableHead>+ <TableHead>入账</TableHead>+ <TableHead>支付</TableHead>+ <TableHead>状态</TableHead>+ <TableHead>创建时间</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {(orders?.items ?? []).map((o) => (+ <TableRow key={o.id}>+ <TableCell className="font-mono text-xs">{o.out_trade_no}</TableCell>+ <TableCell>+ <div className="text-sm">{o.user_email ?? o.user_id}</div>+ </TableCell>+ <TableCell>{o.sku_id}</TableCell>+ <TableCell>¥{fenToYuan(o.amount_fen)}</TableCell>+ <TableCell>¥{fenToYuan(o.credit_fen)}</TableCell>+ <TableCell>{o.pay_type}</TableCell>+ <TableCell>+ <Badge variant={o.status === "paid" ? "default" : "secondary"}>{o.status}</Badge>+ </TableCell>+ <TableCell className="text-xs text-muted-foreground">+ {new Date(o.created_at).toLocaleString()}+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </div>+ {orders && (+ <PaginationBar+ page={orders.meta.page}+ pageSize={orders.meta.page_size}+ total={orders.meta.total}+ onPageChange={setOrderPage}+ />+ )}+ </TabsContent>+ <TabsContent value="ledger" className="space-y-4">+ <div className="flex flex-wrap gap-2">+ <Select className="w-40" value={ledgerKind} onChange={(e) => setLedgerKind(e.target.value)}>+ <option value="">全部类型</option>+ <option value="topup">topup</option>+ <option value="grant">grant</option>+ <option value="adjust">adjust</option>+ <option value="freeze">freeze</option>+ <option value="unfreeze">unfreeze</option>+ <option value="settle">settle</option>+ <option value="refund">refund</option>+ </Select>+ <Input+ className="w-40"+ placeholder="用户 ID"+ value={ledgerUserId}+ onChange={(e) => setLedgerUserId(e.target.value)}+ />+ <Button+ variant="secondary"+ onClick={() => {+ setLedgerPage(1);+ void loadLedger(1);+ }}+ >+ 筛选+ </Button>+ </div>+ <div className="rounded-lg border bg-background">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>ID</TableHead>+ <TableHead>用户</TableHead>+ <TableHead>变动</TableHead>+ <TableHead>余额后</TableHead>+ <TableHead>类型</TableHead>+ <TableHead>备注</TableHead>+ <TableHead>时间</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {(ledger?.items ?? []).map((e) => (+ <TableRow key={e.id}>+ <TableCell>{e.id}</TableCell>+ <TableCell>{e.user_email ?? e.user_id}</TableCell>+ <TableCell className={e.delta_fen >= 0 ? "text-emerald-700" : "text-red-600"}>+ {e.delta_fen >= 0 ? "+" : ""}+ ¥{fenToYuan(e.delta_fen)}+ </TableCell>+ <TableCell>¥{fenToYuan(e.balance_after)}</TableCell>+ <TableCell>+ <Badge variant="secondary">{e.kind}</Badge>+ </TableCell>+ <TableCell className="max-w-[200px] truncate">{e.note}</TableCell>+ <TableCell className="text-xs text-muted-foreground">+ {new Date(e.created_at).toLocaleString()}+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </div>+ {ledger && (+ <PaginationBar+ page={ledger.meta.page}+ pageSize={ledger.meta.page_size}+ total={ledger.meta.total}+ onPageChange={setLedgerPage}+ />+ )}+ </TabsContent>+ </Tabs>+ </div>+ );+}diff --git a/admin/src/pages/ProjectsPage.tsx b/admin/src/pages/ProjectsPage.tsxnew file mode 100644index 0000000..4e16e06--- /dev/null+++ b/admin/src/pages/ProjectsPage.tsx@@ -0,0 +1,173 @@+import { useEffect, useState } from "react";+import { toast } from "sonner";+import { api, type AdminProject, type PageMeta } from "@/api/client";+import { PaginationBar } from "@/components/PaginationBar";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";+import { Input } from "@/components/ui/input";+import { Select } from "@/components/ui/select";+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";++type ListRes = { items: AdminProject[]; meta: PageMeta };++const STATUS_OPTIONS = [+ "",+ "DRAFT",+ "SCRIPTING",+ "FAILED",+ "DONE",+ "CANCELLED",+ "VIDEOING",+ "COMPOSING",+];++// Project list and failure detail+export function ProjectsPage() {+ /*+ * q title/error search+ * status status filter+ * page current page+ * data list response+ * detail selected project detail+ */+ const [q, setQ] = useState("");+ const [status, setStatus] = useState("");+ const [page, setPage] = useState(1);+ const [data, setData] = useState<ListRes | null>(null);+ const [detail, setDetail] = useState<AdminProject | null>(null);++ // Load projects+ async function load(nextPage = page) {+ try {+ const params = new URLSearchParams({ page: String(nextPage), page_size: "20" });+ if (status) params.set("status", status);+ if (q.trim()) params.set("q", q.trim());+ setData(await api<ListRes>(`/api/admin/projects?${params}`));+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载失败");+ }+ }++ useEffect(() => {+ void load();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [page]);++ // Fetch project detail for triage+ async function openDetail(id: number) {+ try {+ setDetail(await api<AdminProject>(`/api/admin/projects/${id}`));+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载详情失败");+ }+ }++ return (+ <div className="space-y-4">+ <div>+ <h1 className="text-2xl font-semibold">项目管理</h1>+ <p className="text-sm text-muted-foreground">按状态筛选,查看失败原因与进度</p>+ </div>+ <div className="flex flex-wrap gap-2">+ <Select className="w-44" value={status} onChange={(e) => setStatus(e.target.value)}>+ {STATUS_OPTIONS.map((s) => (+ <option key={s || "all"} value={s}>+ {s || "全部状态"}+ </option>+ ))}+ </Select>+ <Input+ className="max-w-xs"+ placeholder="标题 / 错误信息"+ value={q}+ onChange={(e) => setQ(e.target.value)}+ />+ <Button+ variant="secondary"+ onClick={() => {+ setPage(1);+ void load(1);+ }}+ >+ 筛选+ </Button>+ </div>+ <div className="rounded-lg border bg-background">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>ID</TableHead>+ <TableHead>标题</TableHead>+ <TableHead>用户</TableHead>+ <TableHead>状态</TableHead>+ <TableHead>进度</TableHead>+ <TableHead>镜头</TableHead>+ <TableHead>错误</TableHead>+ <TableHead></TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {(data?.items ?? []).map((p) => (+ <TableRow key={p.id}>+ <TableCell>{p.id}</TableCell>+ <TableCell className="max-w-[180px] truncate">{p.title}</TableCell>+ <TableCell className="text-sm">{p.user_email ?? p.user_id}</TableCell>+ <TableCell>+ <Badge variant={p.status === "FAILED" ? "destructive" : "secondary"}>{p.status}</Badge>+ </TableCell>+ <TableCell>{p.progress}%</TableCell>+ <TableCell>{p.shot_count}</TableCell>+ <TableCell className="max-w-[220px] truncate text-xs text-red-600">+ {p.error_msg || "—"}+ </TableCell>+ <TableCell>+ <Button size="sm" variant="outline" onClick={() => void openDetail(p.id)}>+ 详情+ </Button>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </div>+ {data && (+ <PaginationBar+ page={data.meta.page}+ pageSize={data.meta.page_size}+ total={data.meta.total}+ onPageChange={setPage}+ />+ )}++ <Dialog open={!!detail} onOpenChange={(open) => !open && setDetail(null)}>+ <DialogContent className="max-w-2xl">+ <DialogHeader>+ <DialogTitle>+ 项目 #{detail?.id} · {detail?.title}+ </DialogTitle>+ </DialogHeader>+ {detail && (+ <div className="space-y-2 text-sm">+ <div>用户:{detail.user_email ?? detail.user_id}</div>+ <div>+ 状态:{detail.status} · 进度 {detail.progress}% · 镜头 {detail.shot_count}+ </div>+ <div>模板:{detail.template_id}</div>+ <div>管线:{detail.pipeline_mode}</div>+ <div>成片:{detail.final_video_url || "—"}</div>+ <div className="rounded-md bg-muted p-3 text-xs whitespace-pre-wrap">+ {detail.error_msg || "无错误信息"}+ </div>+ {detail.source_text && (+ <div className="max-h-40 overflow-auto rounded-md border p-3 text-xs whitespace-pre-wrap">+ {detail.source_text}+ </div>+ )}+ </div>+ )}+ </DialogContent>+ </Dialog>+ </div>+ );+}diff --git a/admin/src/pages/TemplatesPage.tsx b/admin/src/pages/TemplatesPage.tsxnew file mode 100644index 0000000..dc67642--- /dev/null+++ b/admin/src/pages/TemplatesPage.tsx@@ -0,0 +1,351 @@+import { useEffect, useState } from "react";+import { toast } from "sonner";+import { api, type AdminTemplate, type PageMeta } from "@/api/client";+import { PaginationBar } from "@/components/PaginationBar";+import { Button } from "@/components/ui/button";+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import { Switch } from "@/components/ui/switch";+import { Textarea } from "@/components/ui/select";+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";++type ListRes = { items: AdminTemplate[]; meta: PageMeta };++type FormState = {+ id: string;+ name: string;+ description: string;+ category: string;+ preview_cover: string;+ style_prefix: string;+ negative_prompt: string;+ default_ratio: string;+ shot_duration_min: number;+ shot_duration_max: number;+ llm_system_addon: string;+ sort_order: number;+ is_active: boolean;+ is_premium: boolean;+};++const emptyForm = (): FormState => ({+ id: "",+ name: "",+ description: "",+ category: "",+ preview_cover: "",+ style_prefix: "",+ negative_prompt: "",+ default_ratio: "16:9",+ shot_duration_min: 3,+ shot_duration_max: 8,+ llm_system_addon: "",+ sort_order: 0,+ is_active: true,+ is_premium: false,+});++// Template CRUD with active / premium toggles+export function TemplatesPage() {+ /*+ * page current page+ * data list response+ * open dialog visibility+ * editing existing template or null for create+ * form form fields+ * saving request in flight+ */+ const [page, setPage] = useState(1);+ const [data, setData] = useState<ListRes | null>(null);+ const [open, setOpen] = useState(false);+ const [editing, setEditing] = useState<AdminTemplate | null>(null);+ const [form, setForm] = useState<FormState>(emptyForm());+ const [saving, setSaving] = useState(false);++ // Load templates+ async function load(nextPage = page) {+ try {+ const params = new URLSearchParams({ page: String(nextPage), page_size: "50" });+ setData(await api<ListRes>(`/api/admin/templates?${params}`));+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载失败");+ }+ }++ useEffect(() => {+ void load();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [page]);++ // Open create dialog+ function openCreate() {+ setEditing(null);+ setForm(emptyForm());+ setOpen(true);+ }++ // Open edit dialog+ function openEdit(tpl: AdminTemplate) {+ setEditing(tpl);+ setForm({+ id: tpl.id,+ name: tpl.name,+ description: tpl.description,+ category: (tpl.category || []).join(","),+ preview_cover: tpl.preview_cover,+ style_prefix: tpl.style_prefix,+ negative_prompt: tpl.negative_prompt,+ default_ratio: tpl.default_ratio,+ shot_duration_min: tpl.shot_duration_min,+ shot_duration_max: tpl.shot_duration_max,+ llm_system_addon: tpl.llm_system_addon,+ sort_order: tpl.sort_order,+ is_active: tpl.is_active,+ is_premium: tpl.is_premium,+ });+ setOpen(true);+ }++ // Create or update template+ async function save() {+ setSaving(true);+ try {+ const category = form.category+ .split(",")+ .map((s) => s.trim())+ .filter(Boolean);+ if (editing) {+ await api(`/api/admin/templates/${editing.id}`, {+ method: "PATCH",+ body: JSON.stringify({+ name: form.name,+ description: form.description,+ category,+ preview_cover: form.preview_cover,+ style_prefix: form.style_prefix,+ negative_prompt: form.negative_prompt,+ default_ratio: form.default_ratio,+ shot_duration_min: form.shot_duration_min,+ shot_duration_max: form.shot_duration_max,+ llm_system_addon: form.llm_system_addon,+ sort_order: form.sort_order,+ is_active: form.is_active,+ is_premium: form.is_premium,+ }),+ });+ } else {+ if (!form.id.trim()) throw new Error("请填写模板 ID");+ await api(`/api/admin/templates`, {+ method: "POST",+ body: JSON.stringify({+ ...form,+ id: form.id.trim(),+ category,+ seedream_config: {},+ seedance_config: {},+ audio_config: {},+ subtitle_config: {},+ }),+ });+ }+ toast.success("已保存");+ setOpen(false);+ await load();+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "保存失败");+ } finally {+ setSaving(false);+ }+ }++ // Toggle active / premium quickly+ async function quickPatch(id: string, body: Partial<AdminTemplate>) {+ try {+ await api(`/api/admin/templates/${id}`, { method: "PATCH", body: JSON.stringify(body) });+ await load();+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "更新失败");+ }+ }++ // Delete template if unused+ async function remove(id: string) {+ if (!window.confirm(`确认删除模板 ${id}?`)) return;+ try {+ await api(`/api/admin/templates/${id}`, { method: "DELETE" });+ toast.success("已删除");+ await load();+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "删除失败");+ }+ }++ return (+ <div className="space-y-4">+ <div className="flex items-start justify-between gap-3">+ <div>+ <h1 className="text-2xl font-semibold">模板管理</h1>+ <p className="text-sm text-muted-foreground">增删改、上下架与 premium</p>+ </div>+ <Button onClick={openCreate}>新建模板</Button>+ </div>+ <div className="rounded-lg border bg-background">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>ID</TableHead>+ <TableHead>名称</TableHead>+ <TableHead>排序</TableHead>+ <TableHead>上架</TableHead>+ <TableHead>Premium</TableHead>+ <TableHead></TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {(data?.items ?? []).map((t) => (+ <TableRow key={t.id}>+ <TableCell className="font-mono text-xs">{t.id}</TableCell>+ <TableCell>{t.name}</TableCell>+ <TableCell>{t.sort_order}</TableCell>+ <TableCell>+ <Switch+ checked={t.is_active}+ onCheckedChange={(v) => void quickPatch(t.id, { is_active: v })}+ />+ </TableCell>+ <TableCell>+ <Switch+ checked={t.is_premium}+ onCheckedChange={(v) => void quickPatch(t.id, { is_premium: v })}+ />+ </TableCell>+ <TableCell>+ <div className="flex gap-1">+ <Button size="sm" variant="outline" onClick={() => openEdit(t)}>+ 编辑+ </Button>+ <Button size="sm" variant="ghost" onClick={() => void remove(t.id)}>+ 删除+ </Button>+ </div>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </div>+ {data && (+ <PaginationBar+ page={data.meta.page}+ pageSize={data.meta.page_size}+ total={data.meta.total}+ onPageChange={setPage}+ />+ )}++ <Dialog open={open} onOpenChange={setOpen}>+ <DialogContent className="max-h-[90vh] max-w-2xl overflow-y-auto">+ <DialogHeader>+ <DialogTitle>{editing ? `编辑模板 · ${editing.id}` : "新建模板"}</DialogTitle>+ </DialogHeader>+ <div className="grid gap-3 sm:grid-cols-2">+ {!editing && (+ <div className="space-y-2 sm:col-span-2">+ <Label>ID</Label>+ <Input value={form.id} onChange={(e) => setForm((f) => ({ ...f, id: e.target.value }))} />+ </div>+ )}+ <div className="space-y-2 sm:col-span-2">+ <Label>名称</Label>+ <Input value={form.name} onChange={(e) => setForm((f) => ({ ...f, name: e.target.value }))} />+ </div>+ <div className="space-y-2 sm:col-span-2">+ <Label>描述</Label>+ <Textarea+ value={form.description}+ onChange={(e) => setForm((f) => ({ ...f, description: e.target.value }))}+ />+ </div>+ <div className="space-y-2">+ <Label>分类(逗号分隔)</Label>+ <Input+ value={form.category}+ onChange={(e) => setForm((f) => ({ ...f, category: e.target.value }))}+ />+ </div>+ <div className="space-y-2">+ <Label>封面 URL</Label>+ <Input+ value={form.preview_cover}+ onChange={(e) => setForm((f) => ({ ...f, preview_cover: e.target.value }))}+ />+ </div>+ <div className="space-y-2 sm:col-span-2">+ <Label>style_prefix</Label>+ <Textarea+ value={form.style_prefix}+ onChange={(e) => setForm((f) => ({ ...f, style_prefix: e.target.value }))}+ />+ </div>+ <div className="space-y-2 sm:col-span-2">+ <Label>negative_prompt</Label>+ <Textarea+ value={form.negative_prompt}+ onChange={(e) => setForm((f) => ({ ...f, negative_prompt: e.target.value }))}+ />+ </div>+ <div className="space-y-2">+ <Label>画幅</Label>+ <Input+ value={form.default_ratio}+ onChange={(e) => setForm((f) => ({ ...f, default_ratio: e.target.value }))}+ />+ </div>+ <div className="space-y-2">+ <Label>排序</Label>+ <Input+ type="number"+ value={form.sort_order}+ onChange={(e) => setForm((f) => ({ ...f, sort_order: Number(e.target.value) }))}+ />+ </div>+ <div className="space-y-2">+ <Label>时长 min</Label>+ <Input+ type="number"+ value={form.shot_duration_min}+ onChange={(e) => setForm((f) => ({ ...f, shot_duration_min: Number(e.target.value) }))}+ />+ </div>+ <div className="space-y-2">+ <Label>时长 max</Label>+ <Input+ type="number"+ value={form.shot_duration_max}+ onChange={(e) => setForm((f) => ({ ...f, shot_duration_max: Number(e.target.value) }))}+ />+ </div>+ <div className="flex items-center justify-between sm:col-span-1">+ <Label>上架</Label>+ <Switch+ checked={form.is_active}+ onCheckedChange={(v) => setForm((f) => ({ ...f, is_active: v }))}+ />+ </div>+ <div className="flex items-center justify-between sm:col-span-1">+ <Label>Premium</Label>+ <Switch+ checked={form.is_premium}+ onCheckedChange={(v) => setForm((f) => ({ ...f, is_premium: v }))}+ />+ </div>+ </div>+ <Button className="mt-2 w-full" disabled={saving} onClick={() => void save()}>+ {saving ? "保存中…" : "保存"}+ </Button>+ </DialogContent>+ </Dialog>+ </div>+ );+}diff --git a/admin/src/pages/UsersPage.tsx b/admin/src/pages/UsersPage.tsxnew file mode 100644index 0000000..b3f3d02--- /dev/null+++ b/admin/src/pages/UsersPage.tsx@@ -0,0 +1,236 @@+import { useEffect, useState } from "react";+import { toast } from "sonner";+import { api, type AdminUserRow, type PageMeta } from "@/api/client";+import { PaginationBar } from "@/components/PaginationBar";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import { Select } from "@/components/ui/select";+import { Switch } from "@/components/ui/switch";+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";+import { fenToYuan } from "@/lib/utils";++type ListRes = { items: AdminUserRow[]; meta: PageMeta };++// User management: search, plan, balance, unlimited+export function UsersPage() {+ /*+ * q search query+ * page current page+ * data list response+ * loading fetch state+ * editing user being edited+ * form edit form state+ * saving patch in flight+ */+ const [q, setQ] = useState("");+ const [page, setPage] = useState(1);+ const [data, setData] = useState<ListRes | null>(null);+ const [loading, setLoading] = useState(false);+ const [editing, setEditing] = useState<AdminUserRow | null>(null);+ const [form, setForm] = useState({+ plan: "free",+ billing_unlimited: false,+ role: "user",+ balance_yuan: "0",+ balance_note: "",+ });+ const [saving, setSaving] = useState(false);++ // Load paginated users+ async function load(nextPage = page, nextQ = q) {+ setLoading(true);+ try {+ const params = new URLSearchParams({+ page: String(nextPage),+ page_size: "20",+ });+ if (nextQ.trim()) params.set("q", nextQ.trim());+ const res = await api<ListRes>(`/api/admin/users?${params}`);+ setData(res);+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载失败");+ } finally {+ setLoading(false);+ }+ }++ useEffect(() => {+ void load();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [page]);++ // Open edit dialog for a user+ function openEdit(user: AdminUserRow) {+ setEditing(user);+ setForm({+ plan: user.plan || "free",+ billing_unlimited: !!user.billing_unlimited,+ role: user.role || "user",+ balance_yuan: fenToYuan(user.balance_fen),+ balance_note: "",+ });+ }++ // Save user patch+ async function saveEdit() {+ if (!editing) return;+ setSaving(true);+ try {+ const balanceFen = Math.round(parseFloat(form.balance_yuan || "0") * 100);+ if (Number.isNaN(balanceFen)) throw new Error("余额格式无效");+ await api(`/api/admin/users/${editing.id}`, {+ method: "PATCH",+ body: JSON.stringify({+ plan: form.plan,+ billing_unlimited: form.billing_unlimited,+ role: form.role,+ balance_fen: balanceFen,+ balance_note: form.balance_note || undefined,+ }),+ });+ toast.success("已保存");+ setEditing(null);+ await load();+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "保存失败");+ } finally {+ setSaving(false);+ }+ }++ return (+ <div className="space-y-4">+ <div>+ <h1 className="text-2xl font-semibold">用户管理</h1>+ <p className="text-sm text-muted-foreground">搜索用户,调整套餐、余额与无限额度</p>+ </div>+ <div className="flex flex-wrap gap-2">+ <Input+ className="max-w-xs"+ placeholder="搜索邮箱 / 昵称"+ value={q}+ onChange={(e) => setQ(e.target.value)}+ onKeyDown={(e) => {+ if (e.key === "Enter") {+ setPage(1);+ void load(1, q);+ }+ }}+ />+ <Button+ variant="secondary"+ onClick={() => {+ setPage(1);+ void load(1, q);+ }}+ >+ 搜索+ </Button>+ </div>+ <div className="rounded-lg border bg-background">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>ID</TableHead>+ <TableHead>邮箱</TableHead>+ <TableHead>昵称</TableHead>+ <TableHead>套餐</TableHead>+ <TableHead>余额</TableHead>+ <TableHead>角色</TableHead>+ <TableHead>无限</TableHead>+ <TableHead></TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {(data?.items ?? []).map((u) => (+ <TableRow key={u.id}>+ <TableCell>{u.id}</TableCell>+ <TableCell>{u.email}</TableCell>+ <TableCell>{u.nickname}</TableCell>+ <TableCell>{u.plan}</TableCell>+ <TableCell>¥{fenToYuan(u.balance_fen)}</TableCell>+ <TableCell>+ <Badge variant={u.role === "admin" ? "default" : "secondary"}>{u.role}</Badge>+ </TableCell>+ <TableCell>{u.billing_unlimited ? "是" : "否"}</TableCell>+ <TableCell>+ <Button size="sm" variant="outline" onClick={() => openEdit(u)}>+ 编辑+ </Button>+ </TableCell>+ </TableRow>+ ))}+ {!loading && (data?.items.length ?? 0) === 0 && (+ <TableRow>+ <TableCell colSpan={8} className="text-center text-muted-foreground">+ 暂无用户+ </TableCell>+ </TableRow>+ )}+ </TableBody>+ </Table>+ </div>+ {data && (+ <PaginationBar+ page={data.meta.page}+ pageSize={data.meta.page_size}+ total={data.meta.total}+ onPageChange={setPage}+ />+ )}++ <Dialog open={!!editing} onOpenChange={(open) => !open && setEditing(null)}>+ <DialogContent>+ <DialogHeader>+ <DialogTitle>编辑用户 · {editing?.email}</DialogTitle>+ </DialogHeader>+ <div className="space-y-4">+ <div className="space-y-2">+ <Label>套餐</Label>+ <Select value={form.plan} onChange={(e) => setForm((f) => ({ ...f, plan: e.target.value }))}>+ <option value="free">free</option>+ <option value="pro">pro</option>+ <option value="team">team</option>+ </Select>+ </div>+ <div className="space-y-2">+ <Label>角色</Label>+ <Select value={form.role} onChange={(e) => setForm((f) => ({ ...f, role: e.target.value }))}>+ <option value="user">user</option>+ <option value="admin">admin</option>+ </Select>+ </div>+ <div className="space-y-2">+ <Label>余额(元)</Label>+ <Input+ value={form.balance_yuan}+ onChange={(e) => setForm((f) => ({ ...f, balance_yuan: e.target.value }))}+ />+ </div>+ <div className="space-y-2">+ <Label>调账备注</Label>+ <Input+ value={form.balance_note}+ onChange={(e) => setForm((f) => ({ ...f, balance_note: e.target.value }))}+ placeholder="可选"+ />+ </div>+ <div className="flex items-center justify-between">+ <Label>billing_unlimited</Label>+ <Switch+ checked={form.billing_unlimited}+ onCheckedChange={(v) => setForm((f) => ({ ...f, billing_unlimited: v }))}+ />+ </div>+ <Button className="w-full" disabled={saving} onClick={() => void saveEdit()}>+ {saving ? "保存中…" : "保存"}+ </Button>+ </div>+ </DialogContent>+ </Dialog>+ </div>+ );+}diff --git a/admin/src/pages/WorksPage.tsx b/admin/src/pages/WorksPage.tsxnew file mode 100644index 0000000..c922d2d--- /dev/null+++ b/admin/src/pages/WorksPage.tsx@@ -0,0 +1,152 @@+import { useEffect, useState } from "react";+import { toast } from "sonner";+import { api, type AdminWork, type PageMeta } from "@/api/client";+import { PaginationBar } from "@/components/PaginationBar";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { Select } from "@/components/ui/select";+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";++type ListRes = { items: AdminWork[]; meta: PageMeta };++// Work audit: visibility + audit_status+export function WorksPage() {+ /*+ * auditStatus filter+ * visibility filter+ * page current page+ * data list response+ */+ const [auditStatus, setAuditStatus] = useState("");+ const [visibility, setVisibility] = useState("");+ const [page, setPage] = useState(1);+ const [data, setData] = useState<ListRes | null>(null);++ // Load works+ async function load(nextPage = page) {+ try {+ const params = new URLSearchParams({ page: String(nextPage), page_size: "20" });+ if (auditStatus) params.set("audit_status", auditStatus);+ if (visibility) params.set("visibility", visibility);+ setData(await api<ListRes>(`/api/admin/works?${params}`));+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "加载失败");+ }+ }++ useEffect(() => {+ void load();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [page]);++ // Patch a work field+ async function patchWork(id: number, body: { visibility?: string; audit_status?: string }) {+ try {+ await api(`/api/admin/works/${id}`, { method: "PATCH", body: JSON.stringify(body) });+ toast.success("已更新");+ await load();+ } catch (err) {+ toast.error(err instanceof Error ? err.message : "更新失败");+ }+ }++ return (+ <div className="space-y-4">+ <div>+ <h1 className="text-2xl font-semibold">作品审核</h1>+ <p className="text-sm text-muted-foreground">调整可见性与审核状态</p>+ </div>+ <div className="flex flex-wrap gap-2">+ <Select className="w-40" value={auditStatus} onChange={(e) => setAuditStatus(e.target.value)}>+ <option value="">全部审核</option>+ <option value="pending">pending</option>+ <option value="passed">passed</option>+ <option value="rejected">rejected</option>+ </Select>+ <Select className="w-40" value={visibility} onChange={(e) => setVisibility(e.target.value)}>+ <option value="">全部可见性</option>+ <option value="public">public</option>+ <option value="private">private</option>+ <option value="unlisted">unlisted</option>+ </Select>+ <Button+ variant="secondary"+ onClick={() => {+ setPage(1);+ void load(1);+ }}+ >+ 筛选+ </Button>+ </div>+ <div className="rounded-lg border bg-background">+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>ID</TableHead>+ <TableHead>标题</TableHead>+ <TableHead>用户</TableHead>+ <TableHead>可见性</TableHead>+ <TableHead>审核</TableHead>+ <TableHead>发布时间</TableHead>+ <TableHead>操作</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {(data?.items ?? []).map((w) => (+ <TableRow key={w.id}>+ <TableCell>{w.id}</TableCell>+ <TableCell className="max-w-[200px] truncate">{w.title}</TableCell>+ <TableCell>{w.user_email ?? w.user_id}</TableCell>+ <TableCell>+ <Badge variant="secondary">{w.visibility}</Badge>+ </TableCell>+ <TableCell>+ <Badge variant={w.audit_status === "rejected" ? "destructive" : "secondary"}>+ {w.audit_status}+ </Badge>+ </TableCell>+ <TableCell className="text-xs text-muted-foreground">+ {new Date(w.published_at).toLocaleString()}+ </TableCell>+ <TableCell>+ <div className="flex flex-wrap gap-1">+ <Button size="sm" variant="outline" onClick={() => void patchWork(w.id, { audit_status: "passed" })}>+ 通过+ </Button>+ <Button+ size="sm"+ variant="outline"+ onClick={() => void patchWork(w.id, { audit_status: "rejected" })}+ >+ 拒绝+ </Button>+ <Button+ size="sm"+ variant="ghost"+ onClick={() =>+ void patchWork(w.id, {+ visibility: w.visibility === "public" ? "private" : "public",+ })+ }+ >+ {w.visibility === "public" ? "设私密" : "设公开"}+ </Button>+ </div>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </div>+ {data && (+ <PaginationBar+ page={data.meta.page}+ pageSize={data.meta.page_size}+ total={data.meta.total}+ onPageChange={setPage}+ />+ )}+ </div>+ );+}diff --git a/admin/tsconfig.app.json b/admin/tsconfig.app.jsonnew file mode 100644index 0000000..3a5a076--- /dev/null+++ b/admin/tsconfig.app.json@@ -0,0 +1,27 @@+{+ "compilerOptions": {+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",+ "target": "es2023",+ "lib": ["ES2023", "DOM"],+ "module": "esnext",+ "types": ["vite/client"],+ "allowArbitraryExtensions": true,+ "skipLibCheck": true,+ "ignoreDeprecations": "6.0",+ "baseUrl": ".",+ "paths": {+ "@/*": ["./src/*"]+ },+ "moduleResolution": "bundler",+ "allowImportingTsExtensions": true,+ "verbatimModuleSyntax": true,+ "moduleDetection": "force",+ "noEmit": true,+ "jsx": "react-jsx",+ "noUnusedLocals": true,+ "noUnusedParameters": true,+ "erasableSyntaxOnly": true,+ "noFallthroughCasesInSwitch": true+ },+ "include": ["src"]+}diff --git a/admin/tsconfig.json b/admin/tsconfig.jsonnew file mode 100644index 0000000..1ffef60--- /dev/null+++ b/admin/tsconfig.json@@ -0,0 +1,7 @@+{+ "files": [],+ "references": [+ { "path": "./tsconfig.app.json" },+ { "path": "./tsconfig.node.json" }+ ]+}diff --git a/admin/tsconfig.node.json b/admin/tsconfig.node.jsonnew file mode 100644index 0000000..8455dcb--- /dev/null+++ b/admin/tsconfig.node.json@@ -0,0 +1,23 @@+{+ "compilerOptions": {+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",+ "target": "es2023",+ "lib": ["ES2023"],+ "types": ["node"],+ "skipLibCheck": true,++ /* Bundler mode */+ "module": "nodenext",+ "allowImportingTsExtensions": true,+ "verbatimModuleSyntax": true,+ "moduleDetection": "force",+ "noEmit": true,++ /* Linting */+ "noUnusedLocals": true,+ "noUnusedParameters": true,+ "erasableSyntaxOnly": true,+ "noFallthroughCasesInSwitch": true+ },+ "include": ["vite.config.ts"]+}diff --git a/admin/vite.config.ts b/admin/vite.config.tsnew file mode 100644index 0000000..0688943--- /dev/null+++ b/admin/vite.config.ts@@ -0,0 +1,30 @@+import path from "node:path";+import { fileURLToPath } from "node:url";+import { defineConfig } from "vite";+import react from "@vitejs/plugin-react";+import tailwindcss from "@tailwindcss/vite";++const rootDir = path.dirname(fileURLToPath(import.meta.url));++// Vite config: React + Tailwind, admin on 5174 with /api proxy+export default defineConfig({+ plugins: [react(), tailwindcss()],+ resolve: {+ alias: {+ "@": path.resolve(rootDir, "./src"),+ },+ },+ server: {+ port: 5174,+ proxy: {+ "/api": {+ target: "http://127.0.0.1:8000",+ changeOrigin: true,+ },+ "/static": {+ target: "http://127.0.0.1:8000",+ changeOrigin: true,+ },+ },+ },+});diff --git a/backend/.env.example b/backend/.env.exampleindex 1042b39..c49c43b 100644--- a/backend/.env.example+++ b/backend/.env.example@@ -5,14 +5,28 @@ SECRET_KEY=dev-secret-change-meDATABASE_URL=sqlite+aiosqlite:///./ai_movie.dbDATABASE_URL_SYNC=sqlite:///./ai_movie.dbREDIS_URL=redis://127.0.0.1:6379/0-CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173,http://192.168.110.88:5173+CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173,http://localhost:5174,http://127.0.0.1:5174,http://192.168.110.88:5173PUBLIC_BASE_URL=http://192.168.110.88:8000+# 启动时将已有账号提升为 admin(逗号分隔邮箱,不造号)+ARK_MOCK=falseARK_API_KEY=replace-meUSE_CELERY=trueQUOTA_ENABLED=false+# Token 计费(用户价 = 成本 × markup)+BILLING_ENABLED=false+BILLING_MARKUP=1.5+BILLING_SIGNUP_GRANT_FEN=500+# 易支付 pay.gitcc.com(密钥勿提交)+EPAY_API_URL=https://pay.gitcc.com+EPAY_PID=+EPAY_KEY=+# EPAY_NOTIFY_URL=https://kepu.printfilm.com/api/billing/epay/notify+# EPAY_RETURN_URL=https://kepu.printfilm.com/pricing?paid=1+# Celery 动态扩缩容(python -m app.workers.autoscale)# Windows 下每个 worker 为 solo×1,按队列积压自动加减进程数CELERY_AUTOSCALE_MIN=1@@ -29,7 +43,9 @@ CELERY_STALE_PROJECT_SEC=900# 旗舰模型(需在方舟控制台开通;若账号仅支持接入点,可改为 ep-xxxxxxxx)MODEL_LLM=doubao-seed-2-0-pro-260215MODEL_IMAGE=doubao-seedream-5-0-260128-MODEL_VIDEO=doubao-seedance-2-0-260128+MODEL_VIDEO=doubao-seedance-2-5-260628+SEEDANCE_DURATION_MIN=4+SEEDANCE_DURATION_MAX=30MODEL_AUDIO=seed-tts-2.0# 豆包语音合成(openspeech,与方舟 Key 不同)。不配则自动用 edge-tts 兜底@@ -54,5 +70,5 @@ OSS_REGION=cn-hangzhouOSS_BUCKET=your-bucketOSS_FOLDER=kepuOSS_ACCESS_KEY_ID=replace-me-OSS_ACCESS_KEY_SECRET=replace-me+OSS_ACCESS_KEY_SECRET=replace-me# OSS_PUBLIC_BASE=https://cdn.example.comdiff --git a/backend/app/api/admin/__init__.py b/backend/app/api/admin/__init__.pynew file mode 100644index 0000000..ddc2f69--- /dev/null+++ b/backend/app/api/admin/__init__.py@@ -0,0 +1,13 @@+# Admin API router aggregation+from fastapi import APIRouter++from app.api.admin import dashboard, ledger, orders, projects, templates, users, works++router = APIRouter(prefix="/admin", tags=["admin"])+router.include_router(dashboard.router)+router.include_router(users.router)+router.include_router(orders.router)+router.include_router(ledger.router)+router.include_router(projects.router)+router.include_router(works.router)+router.include_router(templates.router)diff --git a/backend/app/api/admin/dashboard.py b/backend/app/api/admin/dashboard.pynew file mode 100644index 0000000..480920f--- /dev/null+++ b/backend/app/api/admin/dashboard.py@@ -0,0 +1,57 @@+# Dashboard stats for admin console+from datetime import datetime, timezone++from fastapi import APIRouter, Depends+from sqlalchemy import func, select+from sqlalchemy.ext.asyncio import AsyncSession++from app.database import get_db+from app.deps import get_current_admin+from app.models import Order, Project, User+from app.schemas import AdminStatsOut++router = APIRouter()++[email protected]("/stats", response_model=AdminStatsOut)+async def admin_stats(+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminStatsOut:+ # Aggregate users, paid order amounts, project status histogram+ user_count = int((await db.execute(select(func.count()).select_from(User))).scalar_one() or 0)++ paid_total = int(+ (+ await db.execute(+ select(func.coalesce(func.sum(Order.amount_fen), 0)).where(Order.status == "paid")+ )+ ).scalar_one()+ or 0+ )++ today_start = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)+ paid_today = int(+ (+ await db.execute(+ select(func.coalesce(func.sum(Order.amount_fen), 0)).where(+ Order.status == "paid",+ Order.paid_at.is_not(None),+ Order.paid_at >= today_start,+ )+ )+ ).scalar_one()+ or 0+ )++ status_rows = (+ await db.execute(select(Project.status, func.count()).group_by(Project.status))+ ).all()+ project_status_counts = {str(status): int(cnt) for status, cnt in status_rows}++ return AdminStatsOut(+ user_count=user_count,+ order_paid_total_fen=paid_total,+ order_paid_today_fen=paid_today,+ project_status_counts=project_status_counts,+ )diff --git a/backend/app/api/admin/ledger.py b/backend/app/api/admin/ledger.pynew file mode 100644index 0000000..d2216f3--- /dev/null+++ b/backend/app/api/admin/ledger.py@@ -0,0 +1,53 @@+# Admin wallet ledger list+from fastapi import APIRouter, Depends, Query+from sqlalchemy import func, select+from sqlalchemy.ext.asyncio import AsyncSession+from sqlalchemy.orm import aliased++from app.database import get_db+from app.deps import get_current_admin+from app.models import User, WalletLedger+from app.schemas import AdminLedgerListOut, AdminLedgerOut, PageMeta++router = APIRouter()++[email protected]("/ledger", response_model=AdminLedgerListOut)+async def list_ledger(+ user_id: int | None = None,+ kind: str | None = None,+ page: int = Query(1, ge=1),+ page_size: int = Query(20, ge=1, le=100),+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminLedgerListOut:+ # Paginated wallet ledger with owner email+ owner = aliased(User)+ stmt = select(WalletLedger, owner.email).outerjoin(owner, owner.id == WalletLedger.user_id)+ count_stmt = select(func.count()).select_from(WalletLedger)++ if user_id is not None:+ stmt = stmt.where(WalletLedger.user_id == user_id)+ count_stmt = count_stmt.where(WalletLedger.user_id == user_id)+ if kind and kind.strip():+ stmt = stmt.where(WalletLedger.kind == kind.strip())+ count_stmt = count_stmt.where(WalletLedger.kind == kind.strip())++ total = int((await db.execute(count_stmt)).scalar_one() or 0)+ rows = (+ await db.execute(+ stmt.order_by(WalletLedger.id.desc())+ .offset((page - 1) * page_size)+ .limit(page_size)+ )+ ).all()++ items: list[AdminLedgerOut] = []+ for entry, email in rows:+ data = AdminLedgerOut.model_validate(entry)+ data.user_email = email+ items.append(data)++ return AdminLedgerListOut(+ items=items, meta=PageMeta(page=page, page_size=page_size, total=total)+ )diff --git a/backend/app/api/admin/orders.py b/backend/app/api/admin/orders.pynew file mode 100644index 0000000..94b6341--- /dev/null+++ b/backend/app/api/admin/orders.py@@ -0,0 +1,49 @@+# Admin order list+from fastapi import APIRouter, Depends, Query+from sqlalchemy import func, select+from sqlalchemy.ext.asyncio import AsyncSession+from sqlalchemy.orm import aliased++from app.database import get_db+from app.deps import get_current_admin+from app.models import Order, User+from app.schemas import AdminOrderListOut, AdminOrderOut, PageMeta++router = APIRouter()++[email protected]("/orders", response_model=AdminOrderListOut)+async def list_orders(+ status: str | None = None,+ user_id: int | None = None,+ page: int = Query(1, ge=1),+ page_size: int = Query(20, ge=1, le=100),+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminOrderListOut:+ # Paginated recharge orders with owner email+ owner = aliased(User)+ stmt = select(Order, owner.email).outerjoin(owner, owner.id == Order.user_id)+ count_stmt = select(func.count()).select_from(Order)++ if status and status.strip():+ stmt = stmt.where(Order.status == status.strip())+ count_stmt = count_stmt.where(Order.status == status.strip())+ if user_id is not None:+ stmt = stmt.where(Order.user_id == user_id)+ count_stmt = count_stmt.where(Order.user_id == user_id)++ total = int((await db.execute(count_stmt)).scalar_one() or 0)+ rows = (+ await db.execute(+ stmt.order_by(Order.id.desc()).offset((page - 1) * page_size).limit(page_size)+ )+ ).all()++ items: list[AdminOrderOut] = []+ for order, email in rows:+ data = AdminOrderOut.model_validate(order)+ data.user_email = email+ items.append(data)++ return AdminOrderListOut(items=items, meta=PageMeta(page=page, page_size=page_size, total=total))diff --git a/backend/app/api/admin/projects.py b/backend/app/api/admin/projects.pynew file mode 100644index 0000000..cb466e4--- /dev/null+++ b/backend/app/api/admin/projects.py@@ -0,0 +1,88 @@+# Admin project list and detail for failure triage+from fastapi import APIRouter, Depends, HTTPException, Query+from sqlalchemy import func, or_, select+from sqlalchemy.ext.asyncio import AsyncSession+from sqlalchemy.orm import aliased++from app.database import get_db+from app.deps import get_current_admin+from app.models import Project, Shot, User+from app.schemas import AdminProjectDetailOut, AdminProjectListOut, AdminProjectOut, PageMeta++router = APIRouter()++[email protected]("/projects", response_model=AdminProjectListOut)+async def list_projects(+ status: str | None = None,+ q: str | None = None,+ user_id: int | None = None,+ page: int = Query(1, ge=1),+ page_size: int = Query(20, ge=1, le=100),+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminProjectListOut:+ # Paginated projects with owner email and shot count+ owner = aliased(User)+ shot_count = (+ select(func.count(Shot.id)).where(Shot.project_id == Project.id).correlate(Project).scalar_subquery()+ )+ stmt = select(Project, owner.email, shot_count).outerjoin(owner, owner.id == Project.user_id)+ count_stmt = select(func.count()).select_from(Project)++ if status and status.strip():+ stmt = stmt.where(Project.status == status.strip())+ count_stmt = count_stmt.where(Project.status == status.strip())+ if user_id is not None:+ stmt = stmt.where(Project.user_id == user_id)+ count_stmt = count_stmt.where(Project.user_id == user_id)+ if q and q.strip():+ like = f"%{q.strip()}%"+ filt = or_(Project.title.ilike(like), Project.error_msg.ilike(like))+ stmt = stmt.where(filt)+ count_stmt = count_stmt.where(filt)++ total = int((await db.execute(count_stmt)).scalar_one() or 0)+ rows = (+ await db.execute(+ stmt.order_by(Project.id.desc()).offset((page - 1) * page_size).limit(page_size)+ )+ ).all()++ items: list[AdminProjectOut] = []+ for project, email, scount in rows:+ data = AdminProjectOut.model_validate(project)+ data.user_email = email+ data.shot_count = int(scount or 0)+ items.append(data)++ return AdminProjectListOut(+ items=items, meta=PageMeta(page=page, page_size=page_size, total=total)+ )++[email protected]("/projects/{project_id}", response_model=AdminProjectDetailOut)+async def get_project(+ project_id: int,+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminProjectDetailOut:+ # Project detail for ops triage+ owner = aliased(User)+ shot_count = (+ select(func.count(Shot.id)).where(Shot.project_id == Project.id).correlate(Project).scalar_subquery()+ )+ row = (+ await db.execute(+ select(Project, owner.email, shot_count)+ .outerjoin(owner, owner.id == Project.user_id)+ .where(Project.id == project_id)+ )+ ).first()+ if not row:+ raise HTTPException(status_code=404, detail="项目不存在")+ project, email, scount = row+ data = AdminProjectDetailOut.model_validate(project)+ data.user_email = email+ data.shot_count = int(scount or 0)+ return datadiff --git a/backend/app/api/admin/templates.py b/backend/app/api/admin/templates.pynew file mode 100644index 0000000..b477cfd--- /dev/null+++ b/backend/app/api/admin/templates.py@@ -0,0 +1,111 @@+# Admin template CRUD+from fastapi import APIRouter, Depends, HTTPException, Query+from sqlalchemy import func, select+from sqlalchemy.ext.asyncio import AsyncSession++from app.database import get_db+from app.deps import get_current_admin+from app.models import Project, Template, User+from app.schemas import (+ AdminTemplateCreate,+ AdminTemplateListOut,+ AdminTemplateOut,+ AdminTemplatePatch,+ PageMeta,+)++router = APIRouter()++[email protected]("/templates", response_model=AdminTemplateListOut)+async def list_templates(+ page: int = Query(1, ge=1),+ page_size: int = Query(50, ge=1, le=100),+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminTemplateListOut:+ # All templates including inactive+ total = int((await db.execute(select(func.count()).select_from(Template))).scalar_one() or 0)+ result = await db.execute(+ select(Template)+ .order_by(Template.sort_order, Template.id)+ .offset((page - 1) * page_size)+ .limit(page_size)+ )+ items = [AdminTemplateOut.model_validate(t) for t in result.scalars().all()]+ return AdminTemplateListOut(+ items=items, meta=PageMeta(page=page, page_size=page_size, total=total)+ )++[email protected]("/templates/{template_id}", response_model=AdminTemplateOut)+async def get_template(+ template_id: str,+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminTemplateOut:+ tpl = await db.get(Template, template_id)+ if not tpl:+ raise HTTPException(status_code=404, detail="模板不存在")+ return AdminTemplateOut.model_validate(tpl)++[email protected]("/templates", response_model=AdminTemplateOut)+async def create_template(+ body: AdminTemplateCreate,+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminTemplateOut:+ # Create a new template row+ existing = await db.get(Template, body.id)+ if existing:+ raise HTTPException(status_code=400, detail="模板 ID 已存在")+ tpl = Template(**body.model_dump())+ db.add(tpl)+ await db.commit()+ await db.refresh(tpl)+ return AdminTemplateOut.model_validate(tpl)++[email protected]("/templates/{template_id}", response_model=AdminTemplateOut)+async def patch_template(+ template_id: str,+ body: AdminTemplatePatch,+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminTemplateOut:+ # Partial update including is_active / is_premium+ tpl = await db.get(Template, template_id)+ if not tpl:+ raise HTTPException(status_code=404, detail="模板不存在")+ data = body.model_dump(exclude_unset=True)+ for key, value in data.items():+ setattr(tpl, key, value)+ await db.commit()+ await db.refresh(tpl)+ return AdminTemplateOut.model_validate(tpl)++[email protected]("/templates/{template_id}")+async def delete_template(+ template_id: str,+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> dict:+ # Refuse delete when projects still reference the template+ tpl = await db.get(Template, template_id)+ if not tpl:+ raise HTTPException(status_code=404, detail="模板不存在")+ used = int(+ (+ await db.execute(+ select(func.count()).select_from(Project).where(Project.template_id == template_id)+ )+ ).scalar_one()+ or 0+ )+ if used > 0:+ raise HTTPException(status_code=400, detail=f"模板仍被 {used} 个项目引用,无法删除")+ await db.delete(tpl)+ await db.commit()+ return {"ok": True}diff --git a/backend/app/api/admin/users.py b/backend/app/api/admin/users.pynew file mode 100644index 0000000..e4d30bb--- /dev/null+++ b/backend/app/api/admin/users.py@@ -0,0 +1,90 @@+# Admin user list and wallet/plan patch+from fastapi import APIRouter, Depends, HTTPException, Query+from sqlalchemy import func, or_, select+from sqlalchemy.ext.asyncio import AsyncSession++from app.database import get_db+from app.deps import get_current_admin+from app.models import User, WalletLedger+from app.schemas import AdminUserListOut, AdminUserOut, AdminUserPatch, PageMeta++router = APIRouter()++[email protected]("/users", response_model=AdminUserListOut)+async def list_users(+ q: str | None = None,+ page: int = Query(1, ge=1),+ page_size: int = Query(20, ge=1, le=100),+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminUserListOut:+ # Paginated user search by email / nickname+ stmt = select(User)+ count_stmt = select(func.count()).select_from(User)+ if q and q.strip():+ like = f"%{q.strip()}%"+ filt = or_(User.email.ilike(like), User.nickname.ilike(like))+ stmt = stmt.where(filt)+ count_stmt = count_stmt.where(filt)++ total = int((await db.execute(count_stmt)).scalar_one() or 0)+ result = await db.execute(+ stmt.order_by(User.id.desc()).offset((page - 1) * page_size).limit(page_size)+ )+ items = list(result.scalars().all())+ return AdminUserListOut(+ items=[AdminUserOut.model_validate(u) for u in items],+ meta=PageMeta(page=page, page_size=page_size, total=total),+ )++[email protected]("/users/{user_id}", response_model=AdminUserOut)+async def patch_user(+ user_id: int,+ body: AdminUserPatch,+ admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminUserOut:+ # Update plan / unlimited / role; balance changes write WalletLedger+ user = await db.get(User, user_id)+ if not user:+ raise HTTPException(status_code=404, detail="用户不存在")++ if body.plan is not None:+ user.plan = body.plan.strip() or "free"++ if body.billing_unlimited is not None:+ user.billing_unlimited = bool(body.billing_unlimited)++ if body.role is not None:+ role = body.role.strip()+ if role not in ("user", "admin"):+ raise HTTPException(status_code=400, detail="role 仅支持 user 或 admin")+ if user.id == admin.id and role != "admin":+ raise HTTPException(status_code=400, detail="不能降低自己的管理员权限")+ user.role = role++ if body.balance_fen is not None:+ target = int(body.balance_fen)+ if target < 0:+ raise HTTPException(status_code=400, detail="余额不能为负")+ current = int(user.balance_fen or 0)+ delta = target - current+ if delta != 0:+ user.balance_fen = target+ db.add(+ WalletLedger(+ user_id=user.id,+ delta_fen=delta,+ balance_after=target,+ kind="adjust" if delta < 0 else "grant",+ ref_type="admin",+ ref_id=str(admin.id),+ note=(body.balance_note or "").strip() or "admin_adjust",+ )+ )++ await db.commit()+ await db.refresh(user)+ return AdminUserOut.model_validate(user)diff --git a/backend/app/api/admin/works.py b/backend/app/api/admin/works.pynew file mode 100644index 0000000..c9eb092--- /dev/null+++ b/backend/app/api/admin/works.py@@ -0,0 +1,82 @@+# Admin work audit (visibility / audit_status)+from fastapi import APIRouter, Depends, HTTPException, Query+from sqlalchemy import func, select+from sqlalchemy.ext.asyncio import AsyncSession+from sqlalchemy.orm import aliased++from app.database import get_db+from app.deps import get_current_admin+from app.models import User, Work+from app.schemas import AdminWorkListOut, AdminWorkOut, AdminWorkPatch, PageMeta++router = APIRouter()++[email protected]("/works", response_model=AdminWorkListOut)+async def list_works(+ audit_status: str | None = None,+ visibility: str | None = None,+ page: int = Query(1, ge=1),+ page_size: int = Query(20, ge=1, le=100),+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminWorkListOut:+ # Paginated published works+ owner = aliased(User)+ stmt = select(Work, owner.email).outerjoin(owner, owner.id == Work.user_id)+ count_stmt = select(func.count()).select_from(Work)++ if audit_status and audit_status.strip():+ stmt = stmt.where(Work.audit_status == audit_status.strip())+ count_stmt = count_stmt.where(Work.audit_status == audit_status.strip())+ if visibility and visibility.strip():+ stmt = stmt.where(Work.visibility == visibility.strip())+ count_stmt = count_stmt.where(Work.visibility == visibility.strip())++ total = int((await db.execute(count_stmt)).scalar_one() or 0)+ rows = (+ await db.execute(+ stmt.order_by(Work.id.desc()).offset((page - 1) * page_size).limit(page_size)+ )+ ).all()++ items: list[AdminWorkOut] = []+ for work, email in rows:+ data = AdminWorkOut.model_validate(work)+ data.user_email = email+ items.append(data)++ return AdminWorkListOut(items=items, meta=PageMeta(page=page, page_size=page_size, total=total))++[email protected]("/works/{work_id}", response_model=AdminWorkOut)+async def patch_work(+ work_id: int,+ body: AdminWorkPatch,+ _admin: User = Depends(get_current_admin),+ db: AsyncSession = Depends(get_db),+) -> AdminWorkOut:+ # Update visibility / audit_status+ work = await db.get(Work, work_id)+ if not work:+ raise HTTPException(status_code=404, detail="作品不存在")++ if body.visibility is not None:+ vis = body.visibility.strip()+ if vis not in ("public", "private", "unlisted"):+ raise HTTPException(status_code=400, detail="visibility 无效")+ work.visibility = vis++ if body.audit_status is not None:+ audit = body.audit_status.strip()+ if audit not in ("pending", "passed", "rejected"):+ raise HTTPException(status_code=400, detail="audit_status 无效")+ work.audit_status = audit++ await db.commit()+ await db.refresh(work)++ owner = await db.get(User, work.user_id)+ data = AdminWorkOut.model_validate(work)+ data.user_email = owner.email if owner else None+ return datadiff --git a/backend/app/api/auth.py b/backend/app/api/auth.pyindex 0e04737..b7fcbd8 100644--- a/backend/app/api/auth.py+++ b/backend/app/api/auth.py@@ -4,7 +4,7 @@ from sqlalchemy.ext.asyncio import AsyncSessionfrom app.config import get_settingsfrom app.database import get_dbfrom app.deps import get_current_user-from app.models import User+from app.models import User, WalletLedgerfrom app.schemas import LoginRequest, RegisterRequest, TokenResponse, UserOutfrom app.services.auth import (create_access_token,@@ -22,13 +22,29 @@ async def register(body: RegisterRequest, db: AsyncSession = Depends(get_db)) ->existing = await get_user_by_email(db, body.email)if existing:raise HTTPException(status_code=400, detail="邮箱已注册")+ grant = int(settings.billing_signup_grant_fen or 0)user = User(email=body.email.lower(),nickname=body.nickname,hashed_password=hash_password(body.password),quota_left=settings.new_user_quota,+ balance_fen=grant,+ plan="free",)db.add(user)+ await db.flush()+ if grant > 0:+ db.add(+ WalletLedger(+ user_id=user.id,+ delta_fen=grant,+ balance_after=grant,+ kind="grant",+ ref_type="signup",+ ref_id=str(user.id),+ note="signup_grant",+ )+ )await db.commit()await db.refresh(user)return TokenResponse(access_token=create_access_token(str(user.id)))diff --git a/backend/app/api/billing.py b/backend/app/api/billing.pynew file mode 100644index 0000000..70f002c--- /dev/null+++ b/backend/app/api/billing.py@@ -0,0 +1,287 @@+# -*- coding: utf-8 -*-+"""Billing wallet + epay top-up APIs."""+from __future__ import annotations++import logging+import time+import uuid+from datetime import datetime, timezone++from typing import Literal++from fastapi import APIRouter, Depends, HTTPException, Query, Request+from fastapi.responses import PlainTextResponse+from pydantic import BaseModel+from sqlalchemy import func, select+from sqlalchemy.ext.asyncio import AsyncSession++from app.config import get_settings+from app.database import get_db+from app.deps import get_current_user+from app.models import Order, UsageEvent, User+from app.services import billing, epay++logger = logging.getLogger(__name__)+router = APIRouter(prefix="/billing", tags=["billing"])+settings = get_settings()+++class CreateOrderBody(BaseModel):+ sku_id: str+ pay_type: Literal["alipay", "wxpay"]++[email protected]("/wallet")+async def wallet(user: User = Depends(get_current_user)) -> dict:+ return {+ "balance_fen": int(user.balance_fen or 0),+ "frozen_fen": int(user.frozen_fen or 0),+ "balance_yuan": round(int(user.balance_fen or 0) / 100, 2),+ "frozen_yuan": round(int(user.frozen_fen or 0) / 100, 2),+ "plan": user.plan or "free",+ "billing_enabled": settings.billing_enabled,+ "billing_unlimited": bool(user.billing_unlimited),+ "markup": settings.billing_markup,+ }++[email protected]("/skus")+async def list_skus() -> dict:+ return {+ "skus": billing.SKUS,+ "pay_types": ["alipay", "wxpay"],+ "markup": settings.billing_markup,+ }+++def _client_ip(request: Request) -> str:+ """Prefer proxy headers, fall back to direct peer address."""+ forwarded = (request.headers.get("x-forwarded-for") or "").split(",")[0].strip()+ if forwarded:+ return forwarded+ real = (request.headers.get("x-real-ip") or "").strip()+ if real:+ return real+ if request.client and request.client.host:+ return request.client.host+ return "127.0.0.1"++[email protected]("/orders")+async def create_order(+ body: CreateOrderBody,+ request: Request,+ db: AsyncSession = Depends(get_db),+ user: User = Depends(get_current_user),+) -> dict:+ sku = billing.sku_by_id(body.sku_id)+ if not sku:+ raise HTTPException(status_code=400, detail="未知充值包")+ out_trade_no = f"PF{int(time.time())}{user.id:04d}{uuid.uuid4().hex[:8]}"+ order = Order(+ out_trade_no=out_trade_no,+ user_id=user.id,+ sku_id=sku["id"],+ amount_fen=int(sku["amount_fen"]),+ credit_fen=int(sku["credit_fen"]),+ pay_type=body.pay_type,+ status="pending",+ )+ db.add(order)+ await db.commit()+ money_yuan = epay.money_yuan_from_fen(int(sku["amount_fen"]))+ try:+ mapi = await epay.create_mapi_payment(+ out_trade_no=out_trade_no,+ name=str(sku["name"]),+ money_yuan=money_yuan,+ pay_type=body.pay_type,+ clientip=_client_ip(request),+ )+ fields = epay.build_submit_fields(+ out_trade_no=out_trade_no,+ name=str(sku["name"]),+ money_yuan=money_yuan,+ pay_type=body.pay_type,+ clientip=_client_ip(request),+ )+ except ValueError as exc:+ raise HTTPException(status_code=503, detail=str(exc)) from exc+ return {+ "out_trade_no": out_trade_no,+ "sku_id": sku["id"],+ "sku_name": str(sku["name"]),+ "pay_type": body.pay_type,+ "amount_fen": order.amount_fen,+ "credit_fen": order.credit_fen,+ "trade_no": mapi.get("trade_no") or "",+ "qrcode": mapi.get("qrcode") or "",+ "payurl": mapi.get("payurl") or "",+ "img": mapi.get("img") or "",+ "qr_payload": mapi.get("qr_payload") or "",+ "expire_seconds": 300,+ "submit_url": epay.submit_url(fields),+ }++[email protected]("/usage/summary")+async def usage_summary(+ db: AsyncSession = Depends(get_db),+ user: User = Depends(get_current_user),+) -> dict:+ """本月 token / 费用汇总,供历史页侧栏展示。"""+ now = datetime.now(timezone.utc)+ month_start = now.replace(day=1, hour=0, minute=0, second=0, microsecond=0)+ result = await db.execute(+ select(+ func.coalesce(func.sum(UsageEvent.total_tokens), 0),+ func.coalesce(func.sum(UsageEvent.charge_fen), 0),+ func.coalesce(func.sum(UsageEvent.cost_fen), 0),+ func.count(UsageEvent.id),+ ).where(+ UsageEvent.user_id == user.id,+ UsageEvent.created_at >= month_start,+ )+ )+ tokens, charge_fen, cost_fen, calls = result.one()+ return {+ "period": month_start.strftime("%Y-%m"),+ "tokens": int(tokens or 0),+ "charge_fen": int(charge_fen or 0),+ "charge_yuan": round(int(charge_fen or 0) / 100, 2),+ "cost_fen": int(cost_fen or 0),+ "calls": int(calls or 0),+ "balance_fen": int(user.balance_fen or 0),+ "balance_yuan": round(int(user.balance_fen or 0) / 100, 2),+ "frozen_fen": int(user.frozen_fen or 0),+ "frozen_yuan": round(int(user.frozen_fen or 0) / 100, 2),+ }++[email protected]("/orders")+async def list_orders(+ db: AsyncSession = Depends(get_db),+ user: User = Depends(get_current_user),+ limit: int = Query(50, ge=1, le=100),+) -> dict:+ """充值订单列表(新→旧)。"""+ result = await db.execute(+ select(Order)+ .where(Order.user_id == user.id)+ .order_by(Order.created_at.desc())+ .limit(limit)+ )+ rows = result.scalars().all()+ items = []+ for o in rows:+ sku = billing.sku_by_id(o.sku_id) or {}+ items.append(+ {+ "out_trade_no": o.out_trade_no,+ "sku_id": o.sku_id,+ "sku_name": str(sku.get("name") or o.sku_id),+ "amount_fen": o.amount_fen,+ "credit_fen": o.credit_fen,+ "pay_type": o.pay_type,+ "status": o.status,+ "trade_no": o.trade_no,+ "paid_at": o.paid_at.isoformat() if o.paid_at else None,+ "created_at": o.created_at.isoformat() if o.created_at else None,+ }+ )+ return {"orders": items}++[email protected]("/orders/{out_trade_no}")+async def get_order(+ out_trade_no: str,+ db: AsyncSession = Depends(get_db),+ user: User = Depends(get_current_user),+) -> dict:+ result = await db.execute(select(Order).where(Order.out_trade_no == out_trade_no))+ order = result.scalar_one_or_none()+ if not order or order.user_id != user.id:+ raise HTTPException(status_code=404, detail="订单不存在")+ return {+ "out_trade_no": order.out_trade_no,+ "status": order.status,+ "amount_fen": order.amount_fen,+ "credit_fen": order.credit_fen,+ "pay_type": order.pay_type,+ "paid_at": order.paid_at.isoformat() if order.paid_at else None,+ }+++def _notify_success(params: dict) -> bool:+ status = str(params.get("trade_status") or params.get("status") or "")+ if status.upper() in {"TRADE_SUCCESS", "SUCCESS", "1"}:+ return True+ # some epay variants use trade_status only when paid+ if str(params.get("trade_status") or "") == "TRADE_SUCCESS":+ return True+ return status == "TRADE_SUCCESS"++[email protected]_route("/epay/notify", methods=["GET", "POST"])+async def epay_notify(request: Request, db: AsyncSession = Depends(get_db)) -> PlainTextResponse:+ if request.method == "POST":+ form = await request.form()+ params = {k: str(v) for k, v in form.items()}+ else:+ params = {k: str(v) for k, v in request.query_params.items()}++ if not epay.verify(params):+ logger.warning("epay notify bad sign: %s", params)+ return PlainTextResponse("fail", status_code=400)++ if not _notify_success(params):+ return PlainTextResponse("success")++ out_trade_no = str(params.get("out_trade_no") or "")+ trade_no = str(params.get("trade_no") or params.get("transaction_id") or "")+ money = str(params.get("money") or "")+ if not out_trade_no:+ return PlainTextResponse("fail", status_code=400)++ result = await db.execute(select(Order).where(Order.out_trade_no == out_trade_no))+ order = result.scalar_one_or_none()+ if not order:+ logger.warning("epay notify unknown order %s", out_trade_no)+ return PlainTextResponse("fail", status_code=404)++ # amount check+ try:+ paid_fen = int(round(float(money) * 100))+ except ValueError:+ paid_fen = order.amount_fen+ if paid_fen != int(order.amount_fen):+ logger.error(+ "epay amount mismatch order=%s expect=%s got=%s",+ out_trade_no,+ order.amount_fen,+ paid_fen,+ )+ return PlainTextResponse("fail", status_code=400)++ if order.status == "paid":+ return PlainTextResponse("success")++ user = await db.get(User, order.user_id)+ if not user:+ return PlainTextResponse("fail", status_code=404)++ order.status = "paid"+ order.trade_no = trade_no or None+ order.paid_at = datetime.now(timezone.utc)+ await billing.credit_topup(+ db,+ user,+ int(order.credit_fen),+ ref_type="order",+ ref_id=order.out_trade_no,+ note=f"epay:{order.pay_type}",+ )+ await db.commit()+ logger.info("epay paid order=%s user=%s credit=%s", out_trade_no, user.id, order.credit_fen)+ return PlainTextResponse("success")+diff --git a/backend/app/api/projects.py b/backend/app/api/projects.pyindex a9a469e..83d9542 100644--- a/backend/app/api/projects.py+++ b/backend/app/api/projects.py@@ -351,6 +351,14 @@ async def generate_project(project.error_msg = Noneproject.final_video_url = Noneshots = list(project.shots or [])+ phase = "script" if (restart or not shots) else "produce"+ try:+ from app.services import billing as billing_svc++ await billing_svc.freeze_for_project(db, user, project, phase)+ except ValueError as exc:+ raise HTTPException(status_code=402, detail=str(exc)) from exc+if restart or not shots:# First run / restart — actually splitting storyboardproject.status = ProjectStatus.SCRIPTING@@ -479,6 +487,18 @@ async def update_shot(if not shot:raise HTTPException(status_code=404, detail="分镜不存在")data = body.model_dump(exclude_unset=True)+ if "segment_script" in data and data["segment_script"] is not None:+ from app.services.seedance_segments import apply_segment_script_edit++ bgm = (getattr(project, "bgm_lock", None) or shot.bgm_mood or "").strip()+ normalized = apply_segment_script_edit(str(data["segment_script"]), bgm_mood=bgm)+ data["segment_script"] = normalized["segment_script"]+ data["duration"] = normalized["duration"]+ data["video_prompt"] = normalized["video_prompt"]+ if normalized.get("narration"):+ data["narration"] = normalized["narration"]+ if normalized.get("img_prompt") and "img_prompt" not in data:+ data["img_prompt"] = normalized["img_prompt"]if "duration" in data and data["duration"] is not None:tpl = await db.get(Template, project.template_id)data["duration"] = clamp_shot_duration(@@ -495,7 +515,12 @@ async def update_shot(shot.video_url = Noneshot.status = "PENDING"project.final_video_url = None- elif "video_prompt" in data or "duration" in data or "camera" in data:+ elif (+ "video_prompt" in data+ or "segment_script" in data+ or "duration" in data+ or "camera" in data+ ):shot.video_url = Noneproject.final_video_url = Noneshot.version += 1@@ -677,5 +702,10 @@ async def quota(user: User = Depends(get_current_user)) -> dict:return {"quota_left": user.quota_left,"quota_enabled": settings.quota_enabled,- "unlimited": not settings.quota_enabled,+ "unlimited": (not settings.billing_enabled) or bool(user.billing_unlimited),+ "billing_enabled": settings.billing_enabled,+ "balance_fen": int(getattr(user, "balance_fen", 0) or 0),+ "frozen_fen": int(getattr(user, "frozen_fen", 0) or 0),+ "balance_yuan": round(int(getattr(user, "balance_fen", 0) or 0) / 100, 2),+ "markup": settings.billing_markup,}diff --git a/backend/app/config.py b/backend/app/config.pyindex 848b9bf..f26e64d 100644--- a/backend/app/config.py+++ b/backend/app/config.py@@ -19,7 +19,9 @@ class Settings(BaseSettings):ark_base_url: str = "https://ark.cn-beijing.volces.com/api/v3"model_llm: str = "doubao-seed-2-0-pro-260215"model_image: str = "doubao-seedream-5-0-260128"- model_video: str = "doubao-seedance-2-0-260128"+ model_video: str = "doubao-seedance-2-5-260628"+ seedance_duration_min: int = 4+ seedance_duration_max: int = 30model_audio: str = "seed-tts-2.0"# 豆包语音(openspeech)— 与方舟 ARK_API_KEY 不同产品线volc_tts_app_id: str = ""@@ -57,9 +59,34 @@ class Settings(BaseSettings):max_shot_duration: int = 30default_preview_resolution: str = "480p"new_user_quota: int = 5- # MVP: set false to skip quota check/deduction+ # Legacy flag; prefer billing_enabledquota_enabled: bool = False+ # Token billing (charge = provider_cost * markup)+ billing_enabled: bool = False+ billing_markup: float = 1.5+ billing_estimate_buffer: float = 1.2+ # Yuan per million tokens (provider cost)+ billing_seedance_video0: float = 46.0+ billing_seedance_video1: float = 28.0+ billing_llm_per_m: float = 5.0+ billing_seedream_per_m: float = 8.0+ billing_tts_per_m: float = 2.0+ # Fallback tokens when API omits usage+ billing_est_llm_tokens: int = 80_000+ billing_est_seedream_tokens: int = 20_000+ billing_est_tts_tokens: int = 5_000+ billing_est_seedance_tokens_per_sec: int = 20_000+ # Signup grant (fen)+ billing_signup_grant_fen: int = 500++ # Epay (pay.gitcc.com)+ epay_api_url: str = "https://pay.gitcc.com"+ epay_pid: str = ""+ epay_key: str = ""+ epay_notify_url: str = ""+ epay_return_url: str = ""+public_base_url: str = "http://127.0.0.1:8000"ffmpeg_path: str = "ffmpeg"ffprobe_path: str = "ffprobe"@@ -84,7 +111,12 @@ class Settings(BaseSettings):oss_upload_async: bool = Trueoss_upload_queue: str = "oss"- cors_origins: str = "http://localhost:5173,http://127.0.0.1:5173"+ cors_origins: str = (+ "http://localhost:5173,http://127.0.0.1:5173,"+ "http://localhost:5174,http://127.0.0.1:5174"+ )+ # Comma-separated emails promoted to admin on startup (existing users only)+ admin_bootstrap_emails: str = ""@lru_cachediff --git a/backend/app/deps.py b/backend/app/deps.pyindex e737fbe..65092fd 100644--- a/backend/app/deps.py+++ b/backend/app/deps.py@@ -22,3 +22,10 @@ async def get_current_user(if not user:raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="用户不存在")return user+++async def get_current_admin(user: User = Depends(get_current_user)) -> User:+ # Require role=admin for /api/admin routes+ if (user.role or "user") != "admin":+ raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="需要管理员权限")+ return userdiff --git a/backend/app/main.py b/backend/app/main.pyindex 28ec8ef..c32bd5f 100644--- a/backend/app/main.py+++ b/backend/app/main.py@@ -5,10 +5,11 @@ from fastapi.middleware.cors import CORSMiddlewarefrom fastapi.staticfiles import StaticFilesfrom sqlalchemy import select, text-from app.api import auth, projects, templates+from app.api import auth, billing, projects, templates+from app.api.admin import router as admin_routerfrom app.config import get_settingsfrom app.database import AsyncSessionLocal, engine, init_db-from app.models import Template+from app.models import Template, Userfrom app.services.templates_seed import TEMPLATESsettings = get_settings()@@ -43,6 +44,8 @@ app.mount("/static", StaticFiles(directory=str(static_dir)), name="static")app.include_router(auth.router, prefix="/api")app.include_router(templates.router, prefix="/api")app.include_router(projects.router, prefix="/api")+app.include_router(billing.router, prefix="/api")+app.include_router(admin_router, prefix="/api")@app.on_event("startup")@@ -50,6 +53,7 @@ async def on_startup() -> None:await init_db()await _migrate_sqlite()await seed_templates()+ await bootstrap_admins()try:from app.services import oss as oss_svc@@ -71,10 +75,22 @@ async def _migrate_sqlite() -> None:await conn.execute(text("ALTER TABLE shots ADD COLUMN overlay_title VARCHAR(128) DEFAULT ''"))if "overlay_subtitle" not in cols:await conn.execute(text("ALTER TABLE shots ADD COLUMN overlay_subtitle VARCHAR(256) DEFAULT ''"))+ if "segment_script" not in cols:+ await conn.execute(text("ALTER TABLE shots ADD COLUMN segment_script TEXT DEFAULT ''"))result = await conn.execute(text("PRAGMA table_info(projects)"))pcols = {row[1] for row in result.fetchall()}else:+ result = await conn.execute(+ text(+ "SELECT column_name FROM information_schema.columns "+ "WHERE table_name = 'shots'"+ )+ )+ scols = {row[0] for row in result.fetchall()}+ if "segment_script" not in scols:+ await conn.execute(text("ALTER TABLE shots ADD COLUMN segment_script TEXT DEFAULT ''"))+result = await conn.execute(text("SELECT column_name FROM information_schema.columns "@@ -91,6 +107,8 @@ async def _migrate_sqlite() -> None:await conn.execute(text("ALTER TABLE projects ADD COLUMN voice_id VARCHAR(128) DEFAULT ''"))if "character_bible" not in pcols:await conn.execute(text("ALTER TABLE projects ADD COLUMN character_bible TEXT DEFAULT ''"))+ if "bgm_lock" not in pcols:+ await conn.execute(text("ALTER TABLE projects ADD COLUMN bgm_lock TEXT DEFAULT ''"))if "style_prompt" not in pcols:await conn.execute(text("ALTER TABLE projects ADD COLUMN style_prompt TEXT DEFAULT ''"))if "character_prompt" not in pcols:@@ -98,6 +116,51 @@ async def _migrate_sqlite() -> None:if "extra_prompt" not in pcols:await conn.execute(text("ALTER TABLE projects ADD COLUMN extra_prompt TEXT DEFAULT ''"))+ # User billing columns+ if is_sqlite:+ result = await conn.execute(text("PRAGMA table_info(users)"))+ ucols = {row[1] for row in result.fetchall()}+ else:+ result = await conn.execute(+ text(+ "SELECT column_name FROM information_schema.columns "+ "WHERE table_name = 'users'"+ )+ )+ ucols = {row[0] for row in result.fetchall()}+ if "balance_fen" not in ucols:+ await conn.execute(text("ALTER TABLE users ADD COLUMN balance_fen INTEGER DEFAULT 0"))+ if "frozen_fen" not in ucols:+ await conn.execute(text("ALTER TABLE users ADD COLUMN frozen_fen INTEGER DEFAULT 0"))+ if "plan" not in ucols:+ await conn.execute(text("ALTER TABLE users ADD COLUMN plan VARCHAR(32) DEFAULT 'free'"))+ if "billing_unlimited" not in ucols:+ await conn.execute(+ text("ALTER TABLE users ADD COLUMN billing_unlimited BOOLEAN DEFAULT FALSE")+ )+ if "role" not in ucols:+ await conn.execute(text("ALTER TABLE users ADD COLUMN role VARCHAR(16) DEFAULT 'user'"))+++async def bootstrap_admins() -> None:+ # Promote matching emails to admin (does not create users)+ raw = (settings.admin_bootstrap_emails or "").strip()+ if not raw:+ return+ emails = [e.strip().lower() for e in raw.split(",") if e.strip()]+ if not emails:+ return+ async with AsyncSessionLocal() as db:+ result = await db.execute(select(User).where(User.email.in_(emails)))+ users = list(result.scalars().all())+ changed = False+ for user in users:+ if (user.role or "user") != "admin":+ user.role = "admin"+ changed = True+ if changed:+ await db.commit()+async def seed_templates() -> None:"""Upsert built-in templates; publish cover images to OSS when enabled."""diff --git a/backend/app/models.py b/backend/app/models.pyindex 7a36828..8e566b7 100644--- a/backend/app/models.py+++ b/backend/app/models.py@@ -39,7 +39,14 @@ class User(Base):email: Mapped[str] = mapped_column(String(255), unique=True, index=True)nickname: Mapped[str] = mapped_column(String(64), default="创作者")hashed_password: Mapped[str] = mapped_column(String(255))+ # Legacy field; prefer balance_fen for billingquota_left: Mapped[int] = mapped_column(Integer, default=5)+ balance_fen: Mapped[int] = mapped_column(Integer, default=0)+ frozen_fen: Mapped[int] = mapped_column(Integer, default=0)+ plan: Mapped[str] = mapped_column(String(32), default="free")+ billing_unlimited: Mapped[bool] = mapped_column(Boolean, default=False)+ # user | admin+ role: Mapped[str] = mapped_column(String(16), default="user")created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())projects: Mapped[list["Project"]] = relationship(back_populates="owner")@@ -92,6 +99,8 @@ class Project(Base):voice_id: Mapped[str] = mapped_column(String(128), default="")# Canonical cast/look description for Seedream consistency across shotscharacter_bible: Mapped[str] = mapped_column(Text, default="")+ # Project-level BGM mood lock (same across shots)+ bgm_lock: Mapped[str] = mapped_column(Text, default="")# User overrides from studio (optional)style_prompt: Mapped[str] = mapped_column(Text, default="")character_prompt: Mapped[str] = mapped_column(Text, default="")@@ -120,6 +129,8 @@ class Shot(Base):overlay_subtitle: Mapped[str] = mapped_column(String(256), default="") # 图文顶部副标题(叠字)img_prompt: Mapped[str] = mapped_column(Text, default="")video_prompt: Mapped[str] = mapped_column(Text, default="")+ # Manju-style timed segment script (@duration + production cues)+ segment_script: Mapped[str] = mapped_column(Text, default="")camera: Mapped[str] = mapped_column(String(64), default="slow pan")bgm_mood: Mapped[str] = mapped_column(String(64), default="neutral")image_url: Mapped[str | None] = mapped_column(String(1024), nullable=True)@@ -160,3 +171,56 @@ class Work(Base):visibility: Mapped[str] = mapped_column(String(16), default="public")audit_status: Mapped[str] = mapped_column(String(16), default="passed")published_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())+++class UsageEvent(Base):+ """One upstream model/TTS call for token billing."""++ __tablename__ = "usage_events"++ id: Mapped[int] = mapped_column(Integer, primary_key=True)+ user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), index=True)+ project_id: Mapped[int | None] = mapped_column(ForeignKey("projects.id"), nullable=True, index=True)+ shot_id: Mapped[int | None] = mapped_column(Integer, nullable=True)+ provider: Mapped[str] = mapped_column(String(32), default="ark")+ billing_key: Mapped[str] = mapped_column(String(64), index=True)+ model: Mapped[str] = mapped_column(String(128), default="")+ prompt_tokens: Mapped[int] = mapped_column(Integer, default=0)+ completion_tokens: Mapped[int] = mapped_column(Integer, default=0)+ total_tokens: Mapped[int] = mapped_column(Integer, default=0)+ cost_fen: Mapped[int] = mapped_column(Integer, default=0)+ charge_fen: Mapped[int] = mapped_column(Integer, default=0)+ estimated: Mapped[bool] = mapped_column(Boolean, default=False)+ settled: Mapped[bool] = mapped_column(Boolean, default=False)+ raw_usage_json: Mapped[str | None] = mapped_column(Text, nullable=True)+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())+++class WalletLedger(Base):+ __tablename__ = "wallet_ledger"++ id: Mapped[int] = mapped_column(Integer, primary_key=True)+ user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), index=True)+ delta_fen: Mapped[int] = mapped_column(Integer)+ balance_after: Mapped[int] = mapped_column(Integer, default=0)+ kind: Mapped[str] = mapped_column(String(32)) # topup|grant|freeze|unfreeze|settle|refund+ ref_type: Mapped[str] = mapped_column(String(32), default="")+ ref_id: Mapped[str] = mapped_column(String(64), default="")+ note: Mapped[str] = mapped_column(String(255), default="")+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())+++class Order(Base):+ __tablename__ = "orders"++ id: Mapped[int] = mapped_column(Integer, primary_key=True)+ out_trade_no: Mapped[str] = mapped_column(String(64), unique=True, index=True)+ user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), index=True)+ sku_id: Mapped[str] = mapped_column(String(64))+ amount_fen: Mapped[int] = mapped_column(Integer)+ credit_fen: Mapped[int] = mapped_column(Integer)+ pay_type: Mapped[str] = mapped_column(String(16)) # alipay | wxpay+ status: Mapped[str] = mapped_column(String(16), default="pending") # pending|paid|closed+ trade_no: Mapped[str | None] = mapped_column(String(128), nullable=True)+ paid_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())diff --git a/backend/app/schemas.py b/backend/app/schemas.pyindex 123ecbf..df4a1cf 100644--- a/backend/app/schemas.py+++ b/backend/app/schemas.py@@ -25,6 +25,11 @@ class UserOut(BaseModel):email: EmailStrnickname: strquota_left: int+ balance_fen: int = 0+ frozen_fen: int = 0+ plan: str = "free"+ billing_unlimited: bool = False+ role: str = "user"model_config = {"from_attributes": True}@@ -65,6 +70,7 @@ class ShotOut(BaseModel):overlay_subtitle: str = ""img_prompt: strvideo_prompt: str+ segment_script: str = ""camera: strbgm_mood: strimage_url: str | None@@ -82,6 +88,7 @@ class ShotUpdate(BaseModel):overlay_subtitle: str | None = Noneimg_prompt: str | None = Nonevideo_prompt: str | None = None+ segment_script: str | None = Noneduration: float | None = Field(default=None, ge=1, le=30)camera: str | None = Nonebgm_mood: str | None = None@@ -142,6 +149,7 @@ class ProjectOut(BaseModel):output_ratio: str = ""voice_id: str = ""character_bible: str = ""+ bgm_lock: str = ""style_prompt: str = ""character_prompt: str = ""extra_prompt: str = ""@@ -216,3 +224,214 @@ class ProgressEvent(BaseModel):video_url: str | None = Noneretryable: bool | None = Nonecode: str | None = None+++# ---- Admin ----+class PageMeta(BaseModel):+ page: int+ page_size: int+ total: int+++class AdminStatsOut(BaseModel):+ user_count: int+ order_paid_total_fen: int+ order_paid_today_fen: int+ project_status_counts: dict[str, int]+++class AdminUserOut(BaseModel):+ id: int+ email: EmailStr+ nickname: str+ quota_left: int+ balance_fen: int+ frozen_fen: int+ plan: str+ billing_unlimited: bool+ role: str+ created_at: datetime | None = None++ model_config = {"from_attributes": True}+++class AdminUserListOut(BaseModel):+ items: list[AdminUserOut]+ meta: PageMeta+++class AdminUserPatch(BaseModel):+ plan: str | None = None+ billing_unlimited: bool | None = None+ role: str | None = None+ # Absolute target balance in fen; when set, write ledger delta+ balance_fen: int | None = None+ balance_note: str | None = None+++class AdminOrderOut(BaseModel):+ id: int+ out_trade_no: str+ user_id: int+ user_email: str | None = None+ sku_id: str+ amount_fen: int+ credit_fen: int+ pay_type: str+ status: str+ trade_no: str | None+ paid_at: datetime | None+ created_at: datetime++ model_config = {"from_attributes": True}+++class AdminOrderListOut(BaseModel):+ items: list[AdminOrderOut]+ meta: PageMeta+++class AdminLedgerOut(BaseModel):+ id: int+ user_id: int+ user_email: str | None = None+ delta_fen: int+ balance_after: int+ kind: str+ ref_type: str+ ref_id: str+ note: str+ created_at: datetime++ model_config = {"from_attributes": True}+++class AdminLedgerListOut(BaseModel):+ items: list[AdminLedgerOut]+ meta: PageMeta+++class AdminProjectOut(BaseModel):+ id: int+ user_id: int+ user_email: str | None = None+ template_id: str+ title: str+ status: str+ progress: int+ error_msg: str | None+ cover_url: str | None+ final_video_url: str | None+ pipeline_mode: str+ created_at: datetime+ updated_at: datetime+ shot_count: int = 0++ model_config = {"from_attributes": True}+++class AdminProjectListOut(BaseModel):+ items: list[AdminProjectOut]+ meta: PageMeta+++class AdminProjectDetailOut(AdminProjectOut):+ source_type: str+ source_text: str+ resolution_mode: str+ output_ratio: str+ voice_id: str+++class AdminWorkOut(BaseModel):+ id: int+ project_id: int+ user_id: int+ user_email: str | None = None+ title: str+ cover_url: str | None+ video_url: str+ visibility: str+ audit_status: str+ published_at: datetime++ model_config = {"from_attributes": True}+++class AdminWorkListOut(BaseModel):+ items: list[AdminWorkOut]+ meta: PageMeta+++class AdminWorkPatch(BaseModel):+ visibility: str | None = None+ audit_status: str | None = None+++class AdminTemplateOut(BaseModel):+ id: str+ name: str+ description: str+ category: list+ preview_cover: str+ style_prefix: str+ negative_prompt: str+ default_ratio: str+ shot_duration_min: int+ shot_duration_max: int+ llm_system_addon: str+ seedream_config: dict+ seedance_config: dict+ audio_config: dict+ subtitle_config: dict+ sort_order: int+ is_active: bool+ is_premium: bool++ model_config = {"from_attributes": True}+++class AdminTemplateListOut(BaseModel):+ items: list[AdminTemplateOut]+ meta: PageMeta+++class AdminTemplateCreate(BaseModel):+ id: str = Field(min_length=1, max_length=64)+ name: str = Field(min_length=1, max_length=128)+ description: str = ""+ category: list[str] = Field(default_factory=list)+ preview_cover: str = ""+ style_prefix: str = ""+ negative_prompt: str = ""+ default_ratio: str = "16:9"+ shot_duration_min: int = 3+ shot_duration_max: int = 8+ llm_system_addon: str = ""+ seedream_config: dict = Field(default_factory=dict)+ seedance_config: dict = Field(default_factory=dict)+ audio_config: dict = Field(default_factory=dict)+ subtitle_config: dict = Field(default_factory=dict)+ sort_order: int = 0+ is_active: bool = True+ is_premium: bool = False+++class AdminTemplatePatch(BaseModel):+ name: str | None = None+ description: str | None = None+ category: list[str] | None = None+ preview_cover: str | None = None+ style_prefix: str | None = None+ negative_prompt: str | None = None+ default_ratio: str | None = None+ shot_duration_min: int | None = None+ shot_duration_max: int | None = None+ llm_system_addon: str | None = None+ seedream_config: dict | None = None+ seedance_config: dict | None = None+ audio_config: dict | None = None+ subtitle_config: dict | None = None+ sort_order: int | None = None+ is_active: bool | None = None+ is_premium: bool | None = Nonediff --git a/backend/app/services/ark.py b/backend/app/services/ark.pyindex ceb398e..a7f6abb 100644--- a/backend/app/services/ark.py+++ b/backend/app/services/ark.py@@ -19,6 +19,7 @@ import httpxfrom app.config import Settings, get_settingsfrom app.services import storagefrom app.services.ffmpeg_compose import is_near_silent_audio+from app.services import seedance_segments as segplanlogger = logging.getLogger(__name__)@@ -126,12 +127,14 @@ class ShotPlan:bgm: stroverlay_title: str = ""overlay_subtitle: str = ""+ segment_script: str = ""@dataclassclass StoryboardResult:shots: list[ShotPlan]character_bible: str = ""+ bgm_lock: str = ""@dataclass@@ -269,20 +272,23 @@ class ArkGateway:"必须是总结提炼,禁止从 text 截取前几个字,禁止截断专有名词如 ERP→ER)、""subtitle(对本镜卖点/要点的一句概括,8-22字,同样禁止原文截取前缀)、""text(旁白台词,口语化,约匹配该镜时长,可供 TTS 朗读,一般 20-60 字)、"+ "segments(数组,精确到每一段:每项含 duration 秒、kind=visual|narration、text;"+ "visual 写景别与画面动作,narration 写口播;单段 3-12 秒,合计约等于本镜 duration)、"f"img_prompt({orient} {ratio} 构图画面提示词,留出边缘给文字叠层,主体居中,""禁止要求画面内写字;禁止出现真实商标/公司名/人名,用泛称)、"- "video_prompt(可留空或写轻微推拉)、camera(如:缓慢推近/轻拉远)、bgm(情绪)。"+ "video_prompt(可留空或写轻微推拉)、camera(如:缓慢推近/轻拉远)、bgm(情绪,全片尽量同一氛围)。"+ "另输出顶层 bgm_lock(全片统一 BGM 氛围一句)。"f"{diversity_note}")else:diversity_note = (- "拆成 4-10 个分镜;各镜场景随内容变化,禁止雷同空镜。"+ "拆成 4-6 个分镜;各镜场景随内容变化,禁止雷同空镜。"if mode != "character"- else "画风与人物必须全片一致。"+ else "画风与人物必须全片一致;倾向 4-6 镜。")system = ("你是短视频分镜编剧。所有字段必须使用简体中文"- "(包括 title、text、img_prompt、video_prompt、camera、bgm)。"+ "(包括 title、text、img_prompt、video_prompt、camera、bgm、segments)。"f"{consistency}{llm_system_addon}"f"每镜 duration 在 {duration_min}-{min(duration_max, max_shot_duration)} 秒。""shots 字段说明:"@@ -291,16 +297,22 @@ class ArkGateway:"必须是总结提炼,禁止从 text 截取前缀,禁止截断专有名词如 ERP→ER)、""subtitle(可选,一句要点概括 8-22字)、""text(旁白台词)、"- "img_prompt(画面生成中文提示词,含具体景物与构图;"+ "segments(必填数组,精确到每一段:每项 duration、kind=visual|narration|action、text;"+ "先画面后旁白或交替;visual/action 写清景别、主体动作、场景/界面类型;"+ "narration 为可朗读口播;单段 3-12 秒,按约 3 字/秒估旁白时长;"+ "镜内各段 duration 之和应约等于本镜 duration,且不超过 "+ f"{min(duration_max, max_shot_duration)} 秒)、"+ "img_prompt(首段画面中文提示词,含具体景物与构图;""禁止真实商标/公司名/人名,改用泛称)、"- "video_prompt(镜头运动与动态的中文提示词)、"- "camera(运镜,如:缓慢上摇/轻推/横移)、bgm(情绪,如:紧张平缓)。"+ "video_prompt(可与 segments 画面摘要一致)、"+ "camera(运镜,如:缓慢上摇/轻推/横移)、bgm(情绪,全片同一氛围)。"+ "顶层另输出 bgm_lock(全片统一 BGM 氛围一句,与各镜 bgm 一致)。""img_prompt 与 video_prompt 禁止英文句子,专有名词可保留原文。"f"{diversity_note}")user = (- f"输入类型:{source_type}。请先理解内容与应用场景,再拆成 4-10 个分镜:\n"- f"{source_text}"+ f"输入类型:{source_type}。请先理解内容与应用场景,再拆成精确到每一段的分镜"+ f"(4-6 镜为佳,完整模式):\n{source_text}")payload = {"model": self.settings.model_llm,@@ -489,8 +501,10 @@ class ArkGateway:@staticmethoddef _seedance_duration(duration: int | float) -> int:- # Seedance 2.0 common range is 4–12s (some accounts reject <4)- return int(max(4, min(int(round(float(duration))), 12)))+ s = get_settings()+ lo = int(getattr(s, "seedance_duration_min", 4) or 4)+ hi = int(getattr(s, "seedance_duration_max", 30) or 30)+ return int(max(lo, min(int(round(float(duration))), hi)))async def gen_video_i2v(self,@@ -502,6 +516,7 @@ class ArkGateway:resolution: str = "480p",ratio: str | None = None,prompt_as_json: bool = True,+ return_last_frame: bool = True,) -> str:if self.mock:digest = hashlib.md5(f"{image_url}:{prompt}".encode()).hexdigest()[:10]@@ -509,9 +524,13 @@ class ArkGateway:# Seedance needs a publicly reachable https image (data URI often rejected / odd errors)image_ref = await self._resolve_image_ref(image_url, prefer_https=True)- text = self._seedance_prompt_text(prompt) if prompt_as_json else (- (prompt or "").strip() or "画面轻微动态,保持主体外形稳定"- )+ # Prefer plain timed script for Seedance 2.5; JSON caption kept as fallback+ plain = (prompt or "").strip() or "画面轻微动态,保持主体外形稳定"+ text = plain if not prompt_as_json else self._seedance_prompt_text(prompt)+ # If prompt looks like manju-style script, always send plain text+ if "@duration:" in plain or "00:" in plain or plain.startswith("【"):+ text = plain+ prompt_as_json = Falsecontent: list[dict[str, Any]] = [{"type": "text", "text": text},{@@ -528,6 +547,7 @@ class ArkGateway:"resolution": resolution,"watermark": False,"generate_audio": False,+ "return_last_frame": bool(return_last_frame),}# Do not send character_consistency — unknown fields have caused BodyFormat failures@@ -539,7 +559,7 @@ class ArkGateway:)if resp.status_code >= 400 and prompt_as_json:# Fallback: plain text prompt- body["content"][0]["text"] = (prompt or "").strip() or "画面轻微动态"+ body["content"][0]["text"] = plainresp = await client.post(self._url("/contents/generations/tasks"),headers=self._headers(),@@ -947,6 +967,7 @@ class ArkGateway:f"统一角色:与「{source_text.strip()[:24]}」相关的核心人物,""中等身材,简洁服饰配色固定,五官清晰可辨,全片外形不变")+ bgm_lock = segplan.infer_bgm_mood(source_text, style_prefix)plans: list[ShotPlan] = []for i, text in enumerate(chunks, start=1):# Mock: invent short summary titles, do not slice narration mid-token@@ -955,20 +976,32 @@ class ArkGateway:if ":" in text or ":" in text:title = text.split(":", 1)[0].split(":", 1)[0][-6:] or titlesubtitle = _fallback_overlay_subtitle(text)+ img = f"{style_prefix},{bible},画面表现:{text[:80]},竖屏构图,顶部留白,画面无文字"+ beats = [+ segplan.SegmentBeat(duration=segplan.estimate_visual_duration(img), kind="visual", text=img),+ segplan.SegmentBeat(+ duration=segplan.estimate_narration_duration(text),+ kind="narration",+ text=text[:120],+ ),+ ]+ script = segplan.build_segment_script(beats, bgm_mood=bgm_lock, max_total=min(duration_max, 30))+ dur = float(segplan.resolve_api_duration(script, fallback=mid, lo=duration_min, hi=duration_max))plans.append(ShotPlan(shot=i,- duration=float(mid),+ duration=dur,text=text[:120],overlay_title=_normalize_overlay_title(title, text, i),overlay_subtitle=_normalize_overlay_subtitle(subtitle, text),- img_prompt=f"{style_prefix},{bible},画面表现:{text[:80]},竖屏构图,顶部留白,画面无文字",- video_prompt=f"轻微动态,{style_prefix},场景:{text[:60]}",+ img_prompt=img,+ video_prompt=script,+ segment_script=script,camera="缓慢推近" if i % 2 else "轻拉远",- bgm="好奇引入" if i == 1 else "平稳推进",+ bgm=bgm_lock,))- return StoryboardResult(shots=plans, character_bible=bible)+ return StoryboardResult(shots=plans, character_bible=bible, bgm_lock=bgm_lock)def _parse_storyboard(self,@@ -984,42 +1017,64 @@ class ArkGateway:raw = re.sub(r"\s*```$", "", raw)data = json.loads(raw)character_bible = ""+ bgm_lock = ""items = dataif isinstance(data, dict):character_bible = str(data.get("character_bible") or data.get("characters") or data.get("cast") or "").strip()+ bgm_lock = str(data.get("bgm_lock") or data.get("bgm") or "").strip()items = data.get("shots") or data.get("storyboard") or data.get("scenes") or []if not isinstance(items, list):raise RuntimeError("LLM storyboard JSON 格式无效:需要 shots 数组")+ hi = min(duration_max, max_shot_duration)plans: list[ShotPlan] = []for i, item in enumerate(items, start=1):if not isinstance(item, dict):continue- dur = float(item.get("duration", (duration_min + duration_max) / 2))- dur = max(duration_min, min(dur, duration_max, max_shot_duration))text = str(item.get("text") or item.get("audio_text") or f"镜头{i}")title = str(item.get("title") or item.get("overlay_title") or "").strip()subtitle = str(item.get("subtitle") or item.get("overlay_subtitle") or "").strip()title = _normalize_overlay_title(title, text, i)subtitle = _normalize_overlay_subtitle(subtitle, text)img = str(item.get("img_prompt") or f"{text}")- # Keep raw scene text; style/character applied later at image gen- video = str(item.get("video_prompt") or f"轻微动态,{text}")+ camera = str(item.get("camera", "缓慢横移"))+ bgm = str(item.get("bgm") or item.get("bgm_mood") or bgm_lock or "平稳")+ if not bgm_lock:+ bgm_lock = bgm+ beats = segplan.parse_beats_from_llm_shot(item, narration_fallback=text)+ script = segplan.build_segment_script(beats, bgm_mood=bgm_lock or bgm, max_total=hi)+ narr = segplan.narration_from_script(script) or text+ visual = segplan.first_visual_prompt(script) or img+ dur = float(+ segplan.resolve_api_duration(+ script,+ fallback=float(item.get("duration", (duration_min + duration_max) / 2)),+ lo=duration_min,+ hi=hi,+ )+ )plans.append(ShotPlan(shot=int(item.get("shot", i)),duration=dur,- text=text,+ text=narr,overlay_title=title,overlay_subtitle=subtitle,- img_prompt=img,- video_prompt=video,- camera=str(item.get("camera", "缓慢横移")),- bgm=str(item.get("bgm") or item.get("bgm_mood") or "平稳"),+ img_prompt=visual,+ video_prompt=script,+ segment_script=script,+ camera=camera,+ bgm=bgm_lock or bgm,))- return StoryboardResult(shots=plans, character_bible=character_bible)+ if not bgm_lock and plans:+ bgm_lock = plans[0].bgm+ return StoryboardResult(+ shots=plans,+ character_bible=character_bible,+ bgm_lock=bgm_lock or segplan.infer_bgm_mood(style_prefix),+ )async def expand_content(self, topic: str, mode: str = "theme") -> dict[str, str]:"""Expand a short topic into title + theme brief or full narration script."""diff --git a/backend/app/services/bgm.py b/backend/app/services/bgm.pynew file mode 100644index 0000000..cc9e2d1--- /dev/null+++ b/backend/app/services/bgm.py@@ -0,0 +1,50 @@+"""Project-level BGM resolution for FFmpeg compose."""++from __future__ import annotations++import logging+import re+from pathlib import Path++logger = logging.getLogger(__name__)++_STATIC_ROOT = Path(__file__).resolve().parents[2] / "static"++# Map mood keywords → filename stems under static/bgm/+_BGM_FILES: list[tuple[re.Pattern[str], str]] = [+ (re.compile(r"紧张|悬疑|压迫"), "tense"),+ (re.compile(r"温暖|人文|故事"), "warm"),+ (re.compile(r"赛博|电子|科技"), "tech"),+ (re.compile(r"史诗|宏大|奇幻"), "epic"),+ (re.compile(r"轻快|专业|开源|产品|工作"), "upbeat"),+ (re.compile(r"冷静|纪实"), "calm"),+]+++def resolve_bgm_path(mood: str | None) -> Path | None:+ """Return a local BGM file if present; otherwise None (compose skips)."""+ root = _STATIC_ROOT / "bgm"+ if not root.is_dir():+ return None+ blob = (mood or "").strip()+ stem = "default"+ for pattern, name in _BGM_FILES:+ if pattern.search(blob):+ stem = name+ break+ for candidate in (+ root / f"{stem}.mp3",+ root / f"{stem}.m4a",+ root / f"{stem}.wav",+ root / "default.mp3",+ root / "default.m4a",+ root / "default.wav",+ ):+ if candidate.is_file():+ return candidate+ for ext in ("*.mp3", "*.m4a", "*.wav", "*.aac"):+ found = sorted(root.glob(ext))+ if found:+ return found[0]+ logger.debug("No BGM file under %s for mood=%s", root, mood)+ return Nonediff --git a/backend/app/services/billing.py b/backend/app/services/billing.pynew file mode 100644index 0000000..9092eac--- /dev/null+++ b/backend/app/services/billing.py@@ -0,0 +1,302 @@+# -*- coding: utf-8 -*-+"""Token-based billing: estimate, freeze, record usage, settle."""+from __future__ import annotations++import json+import logging+import math+from typing import Any++from sqlalchemy import select+from sqlalchemy.ext.asyncio import AsyncSession++from app.config import Settings, get_settings+from app.models import Project, UsageEvent, User, WalletLedger++logger = logging.getLogger(__name__)++SKUS: list[dict[str, Any]] = [+ {"id": "topup_10", "name": "体验充值", "amount_fen": 1000, "credit_fen": 1000},+ {"id": "topup_49", "name": "基础充值", "amount_fen": 4900, "credit_fen": 4900},+ {"id": "topup_99", "name": "进阶充值", "amount_fen": 9900, "credit_fen": 10400, "recommended": True},+ {"id": "topup_199", "name": "专业充值", "amount_fen": 19900, "credit_fen": 22000},+]+++def provider_yuan_per_m(billing_key: str, settings: Settings | None = None) -> float:+ s = settings or get_settings()+ table = {+ "seedance2:video0": s.billing_seedance_video0,+ "seedance2:video1": s.billing_seedance_video1,+ "llm_chat": s.billing_llm_per_m,+ "seedream": s.billing_seedream_per_m,+ "tts": s.billing_tts_per_m,+ }+ return float(table.get(billing_key, s.billing_llm_per_m))+++def charge_fen_for_tokens(+ tokens: int,+ billing_key: str,+ *,+ settings: Settings | None = None,+) -> tuple[int, int]:+ """Return (cost_fen, charge_fen) with markup."""+ s = settings or get_settings()+ t = max(0, int(tokens))+ yuan_per_m = provider_yuan_per_m(billing_key, s)+ cost = math.ceil(t / 1_000_000 * yuan_per_m * 100) if t else 0+ charge = math.ceil(cost * float(s.billing_markup)) if cost else 0+ if t > 0 and charge < 1:+ charge = 1+ cost = max(cost, 1)+ return cost, charge+++def parse_usage_dict(data: dict[str, Any] | None) -> dict[str, int]:+ if not data:+ return {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}+ usage = data.get("usage") if isinstance(data.get("usage"), dict) else data+ if not isinstance(usage, dict):+ return {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}+ prompt = int(usage.get("prompt_tokens") or usage.get("input_tokens") or 0)+ completion = int(+ usage.get("completion_tokens")+ or usage.get("output_tokens")+ or usage.get("generated_tokens")+ or 0+ )+ total = int(usage.get("total_tokens") or (prompt + completion) or 0)+ return {"prompt_tokens": prompt, "completion_tokens": completion, "total_tokens": total}+++def billing_active(user: User | None = None, settings: Settings | None = None) -> bool:+ s = settings or get_settings()+ if not s.billing_enabled:+ return False+ if user is not None and getattr(user, "billing_unlimited", False):+ return False+ return True+++def estimate_phase_fen(project: Project, phase: str, settings: Settings | None = None) -> int:+ """phase: script | produce"""+ s = settings or get_settings()+ buf = float(s.billing_estimate_buffer or 1.2)+ if phase == "script":+ cost, charge = charge_fen_for_tokens(s.billing_est_llm_tokens, "llm_chat", settings=s)+ return max(1, math.ceil(charge * buf))++ shots = list(project.shots or [])+ n = max(len(shots), 1)+ total = 0+ # images + tts+ for _ in range(n):+ _, c_img = charge_fen_for_tokens(s.billing_est_seedream_tokens, "seedream", settings=s)+ _, c_tts = charge_fen_for_tokens(s.billing_est_tts_tokens, "tts", settings=s)+ total += c_img + c_tts+ if (project.pipeline_mode or "full") != "image_text":+ secs = sum(max(float(sh.duration or 4), 2.0) for sh in shots) or (n * 5.0)+ tok = int(secs * s.billing_est_seedance_tokens_per_sec)+ _, c_vid = charge_fen_for_tokens(tok, "seedance2:video0", settings=s)+ total += c_vid+ # compose negligible — 1 fen min bump+ total = max(total, 1)+ return math.ceil(total * buf)+++async def _ledger(+ db: AsyncSession,+ user: User,+ delta_fen: int,+ kind: str,+ *,+ ref_type: str = "",+ ref_id: str = "",+ note: str = "",+) -> None:+ user.balance_fen = int(user.balance_fen or 0) + int(delta_fen)+ db.add(+ WalletLedger(+ user_id=user.id,+ delta_fen=int(delta_fen),+ balance_after=int(user.balance_fen),+ kind=kind,+ ref_type=ref_type,+ ref_id=ref_id,+ note=note[:255],+ )+ )+++async def freeze_for_project(+ db: AsyncSession,+ user: User,+ project: Project,+ phase: str,+) -> int:+ """Freeze estimate; raise ValueError if insufficient."""+ if not billing_active(user):+ return 0+ need = estimate_phase_fen(project, phase)+ available = int(user.balance_fen or 0)+ if available < need:+ raise ValueError(f"余额不足:需要 ¥{need/100:.2f},当前 ¥{available/100:.2f},请先充值")+ user.balance_fen = available - need+ user.frozen_fen = int(user.frozen_fen or 0) + need+ db.add(+ WalletLedger(+ user_id=user.id,+ delta_fen=-need,+ balance_after=int(user.balance_fen),+ kind="freeze",+ ref_type="project",+ ref_id=str(project.id),+ note=f"freeze:{phase}",+ )+ )+ await db.flush()+ return need+++async def record_usage(+ db: AsyncSession,+ *,+ user_id: int,+ project_id: int | None,+ billing_key: str,+ model: str = "",+ tokens: int = 0,+ prompt_tokens: int = 0,+ completion_tokens: int = 0,+ estimated: bool = False,+ raw: dict | None = None,+ shot_id: int | None = None,+ provider: str = "ark",+) -> UsageEvent:+ s = get_settings()+ total = int(tokens) or (int(prompt_tokens) + int(completion_tokens))+ if total <= 0:+ # fallbacks by key+ if billing_key == "llm_chat":+ total = s.billing_est_llm_tokens+ estimated = True+ elif billing_key == "seedream":+ total = s.billing_est_seedream_tokens+ estimated = True+ elif billing_key == "tts":+ total = s.billing_est_tts_tokens+ estimated = True+ elif billing_key.startswith("seedance"):+ total = s.billing_est_seedance_tokens_per_sec * 5+ estimated = True+ cost, charge = charge_fen_for_tokens(total, billing_key, settings=s)+ ev = UsageEvent(+ user_id=user_id,+ project_id=project_id,+ shot_id=shot_id,+ provider=provider,+ billing_key=billing_key,+ model=model or "",+ prompt_tokens=int(prompt_tokens),+ completion_tokens=int(completion_tokens),+ total_tokens=total,+ cost_fen=cost,+ charge_fen=charge,+ estimated=estimated,+ settled=False,+ raw_usage_json=json.dumps(raw, ensure_ascii=False)[:4000] if raw else None,+ )+ db.add(ev)+ await db.flush()+ return ev+++async def settle_project(db: AsyncSession, project_id: int) -> dict[str, int]:+ """Apply unsettled usage: consume freeze first, refund unused freeze."""+ project = await db.get(Project, project_id)+ if not project:+ return {"charged": 0, "refunded": 0}+ user = await db.get(User, project.user_id)+ result = await db.execute(+ select(UsageEvent).where(+ UsageEvent.project_id == project_id,+ UsageEvent.settled.is_(False),+ )+ )+ events = list(result.scalars().all())+ charged = sum(int(e.charge_fen or 0) for e in events)+ for e in events:+ e.settled = True++ if not user or not billing_active(user):+ await db.flush()+ return {"charged": 0, "refunded": 0}++ frozen_before = int(user.frozen_fen or 0)+ from_freeze = min(frozen_before, charged)+ extra = charged - from_freeze+ refund = max(0, frozen_before - charged)+ user.frozen_fen = 0++ if extra > 0:+ logger.warning(+ "settle overage user=%s project=%s extra_fen=%s balance=%s",+ user.id,+ project_id,+ extra,+ user.balance_fen,+ )+ await _ledger(+ db,+ user,+ -extra,+ "settle",+ ref_type="project",+ ref_id=str(project_id),+ note="settle_overage",+ )+ if refund > 0:+ await _ledger(+ db,+ user,+ refund,+ "unfreeze",+ ref_type="project",+ ref_id=str(project_id),+ note="refund_unused_freeze",+ )++ db.add(+ WalletLedger(+ user_id=user.id,+ delta_fen=0,+ balance_after=int(user.balance_fen or 0),+ kind="settle",+ ref_type="project",+ ref_id=str(project_id),+ note=f"charged={charged} freeze={from_freeze} refund={refund}",+ )+ )+ await db.flush()+ return {"charged": charged, "refunded": refund}+++async def credit_topup(+ db: AsyncSession,+ user: User,+ credit_fen: int,+ *,+ ref_type: str,+ ref_id: str,+ note: str = "",+) -> None:+ await _ledger(db, user, int(credit_fen), "topup", ref_type=ref_type, ref_id=ref_id, note=note)+ await db.flush()+++def sku_by_id(sku_id: str) -> dict[str, Any] | None:+ for s in SKUS:+ if s["id"] == sku_id:+ return s+ return Nonediff --git a/backend/app/services/epay.py b/backend/app/services/epay.pynew file mode 100644index 0000000..c9795d5--- /dev/null+++ b/backend/app/services/epay.py@@ -0,0 +1,137 @@+# -*- coding: utf-8 -*-+"""Epay (易支付) client for pay.gitcc.com — alipay / wxpay."""+from __future__ import annotations++import hashlib+import logging+from typing import Any+from urllib.parse import urlencode++import httpx++from app.config import get_settings++logger = logging.getLogger(__name__)+++def _sign_pairs(params: dict[str, Any], key: str) -> str:+ items = []+ for k in sorted(params.keys()):+ if k in {"sign", "sign_type"}:+ continue+ v = params[k]+ if v is None or v == "":+ continue+ items.append(f"{k}={v}")+ raw = "&".join(items) + str(key)+ return hashlib.md5(raw.encode("utf-8")).hexdigest().lower()+++def sign(params: dict[str, Any]) -> str:+ s = get_settings()+ return _sign_pairs(params, s.epay_key)+++def verify(params: dict[str, Any]) -> bool:+ got = str(params.get("sign") or "").lower()+ if not got:+ return False+ expect = sign({k: v for k, v in params.items() if k != "sign"})+ return got == expect+++def build_submit_fields(+ *,+ out_trade_no: str,+ name: str,+ money_yuan: str,+ pay_type: str,+ notify_url: str | None = None,+ return_url: str | None = None,+ clientip: str | None = None,+) -> dict[str, str]:+ s = get_settings()+ if pay_type not in {"alipay", "wxpay"}:+ raise ValueError("pay_type must be alipay or wxpay")+ if not s.epay_pid or not s.epay_key:+ raise ValueError("易支付未配置 EPAY_PID / EPAY_KEY")+ notify = (notify_url or s.epay_notify_url or "").strip()+ ret = (return_url or s.epay_return_url or "").strip()+ if not notify:+ notify = f"{s.public_base_url.rstrip('/')}/api/billing/epay/notify"+ if not ret:+ ret = f"{s.public_base_url.rstrip('/')}/pricing?paid=1"+ fields: dict[str, str] = {+ "pid": str(s.epay_pid),+ "type": pay_type,+ "out_trade_no": out_trade_no,+ "notify_url": notify,+ "return_url": ret,+ "name": name[:100],+ "money": money_yuan,+ }+ if clientip:+ fields["clientip"] = clientip+ fields["sign"] = sign(fields)+ fields["sign_type"] = "MD5"+ return fields+++def submit_url(fields: dict[str, str]) -> str:+ s = get_settings()+ base = s.epay_api_url.rstrip("/") + "/submit.php"+ return f"{base}?{urlencode(fields)}"+++def money_yuan_from_fen(fen: int) -> str:+ return f"{fen / 100:.2f}"+++async def create_mapi_payment(+ *,+ out_trade_no: str,+ name: str,+ money_yuan: str,+ pay_type: str,+ clientip: str,+ notify_url: str | None = None,+ return_url: str | None = None,+) -> dict[str, Any]:+ """+ Call epay /mapi.php for QR / native pay payload.+ Returns dict with keys: trade_no, qrcode, payurl, img (any may be empty).+ """+ fields = build_submit_fields(+ out_trade_no=out_trade_no,+ name=name,+ money_yuan=money_yuan,+ pay_type=pay_type,+ notify_url=notify_url,+ return_url=return_url,+ clientip=clientip or "127.0.0.1",+ )+ s = get_settings()+ url = s.epay_api_url.rstrip("/") + "/mapi.php"+ async with httpx.AsyncClient(timeout=30.0) as client:+ resp = await client.post(url, data=fields)+ try:+ data = resp.json()+ except Exception as exc:+ logger.error("epay mapi non-json status=%s body=%s", resp.status_code, resp.text[:400])+ raise ValueError("易支付返回异常") from exc+ if int(data.get("code") or 0) != 1:+ msg = str(data.get("msg") or data.get("message") or "下单失败")+ raise ValueError(msg)+ qrcode = str(data.get("qrcode") or "").strip()+ payurl = str(data.get("payurl") or "").strip()+ img = str(data.get("img") or data.get("code_url") or "").strip()+ # Prefer content that can be rendered as a QR image payload+ qr_payload = qrcode or payurl or img+ return {+ "trade_no": str(data.get("trade_no") or ""),+ "qrcode": qrcode,+ "payurl": payurl,+ "img": img,+ "qr_payload": qr_payload,+ "raw": data,+ }diff --git a/backend/app/services/ffmpeg_compose.py b/backend/app/services/ffmpeg_compose.pyindex 79c7b39..0dea4de 100644--- a/backend/app/services/ffmpeg_compose.py+++ b/backend/app/services/ffmpeg_compose.py@@ -55,6 +55,9 @@ class ComposeOptions:title_scale: float = 1.35sub_scale: float = 1.3caption_scale: float = 1.25+ # Optional continuous BGM under narration+ bgm_path: Path | None = None+ bgm_volume: float = 0.22def allocate_durations_by_narration(@@ -641,13 +644,35 @@ def _burn_captions_on_video(h: int,font: str | None,caption_scale: float = 1.25,+ title: str = "",+ subtitle: str = "",+ subtitle_layout: str = "top",+ title_scale: float = 1.35,+ sub_scale: float = 1.3,) -> None:- """Burn timed bottom captions onto an existing video clip (full mode)."""- captions = _bottom_caption_drawtext(- narration, duration=duration, w=w, h=h, font=font, scale=caption_scale+ """Burn title/subtitle + timed bottom captions onto an existing video clip (full mode)."""+ parts: list[str] = []+ overlay = _overlay_drawtext(+ w,+ h,+ title,+ subtitle,+ font,+ layout=subtitle_layout,+ title_scale=title_scale,+ sub_scale=sub_scale,)+ if overlay:+ parts.append(overlay)+ # split 布局底部已是副标题,不再叠旁白滚动字幕以免抢戏+ if subtitle_layout != "split":+ captions = _bottom_caption_drawtext(+ narration, duration=duration, w=w, h=h, font=font, scale=caption_scale+ )+ if captions:+ parts.append(captions)ffmpeg = _which("ffmpeg")- if not captions:+ if not parts:_run([ffmpeg, "-y", "-i", str(video_in), "-c", "copy", str(video_out)])return_run(@@ -657,7 +682,7 @@ def _burn_captions_on_video("-i",str(video_in),"-vf",- captions,+ ",".join(parts),"-c:v","libx264","-pix_fmt",@@ -904,6 +929,11 @@ def compose_project(h=h,font=font,caption_scale=opts.caption_scale,+ title=shot.overlay_title or "",+ subtitle=shot.overlay_subtitle or "",+ subtitle_layout=opts.subtitle_layout or "top",+ title_scale=opts.title_scale,+ sub_scale=opts.sub_scale,)elif shot.image_path and shot.image_path.exists():_image_to_video(shot.image_path, shot.duration, video, w=w, h=h)@@ -917,6 +947,11 @@ def compose_project(h=h,font=font,caption_scale=opts.caption_scale,+ title=shot.overlay_title or "",+ subtitle=shot.overlay_subtitle or "",+ subtitle_layout=opts.subtitle_layout or "top",+ title_scale=opts.title_scale,+ sub_scale=opts.sub_scale,)video = cappedelse:@@ -965,7 +1000,35 @@ def compose_project(# Replace silent concat audio with one continuous narration trackvoiced = tmp_path / "voiced.mp4"_mux_continuous_narration(merged, opts.full_audio_path, voiced)- shutil.copy2(voiced, output)+ staged = voiced+ else:+ staged = merged++ if opts.bgm_path and Path(opts.bgm_path).is_file():+ mixed = tmp_path / "with_bgm.mp4"+ try:+ _mix_bgm(staged, Path(opts.bgm_path), mixed, volume=float(opts.bgm_volume or 0.22))+ shutil.copy2(mixed, output)+ except Exception: # noqa: BLE001+ logger.exception("BGM mix failed; exporting without BGM")+ if staged == merged and not continuous:+ _run(+ [+ ffmpeg,+ "-y",+ "-i",+ str(merged),+ "-c",+ "copy",+ "-movflags",+ "+faststart",+ str(output),+ ]+ )+ else:+ shutil.copy2(staged, output)+ elif continuous and opts.full_audio_path:+ shutil.copy2(staged, output)else:# Captions already burned per-shot via drawtext — remux only._run(@@ -983,3 +1046,36 @@ def compose_project()return output+++def _mix_bgm(video: Path, bgm: Path, output: Path, *, volume: float = 0.22) -> None:+ """Loop/trim BGM under existing audio; duck volume below narration."""+ ffmpeg = _which("ffmpeg")+ vol = max(0.05, min(float(volume), 0.5))+ # amix: original audio + quieter looped BGM, duration = first (video)+ _run(+ [+ ffmpeg,+ "-y",+ "-i",+ str(video),+ "-stream_loop",+ "-1",+ "-i",+ str(bgm),+ "-filter_complex",+ f"[1:a]volume={vol:.3f}[bg];[0:a][bg]amix=inputs=2:duration=first:dropout_transition=2[a]",+ "-map",+ "0:v:0",+ "-map",+ "[a]",+ "-c:v",+ "copy",+ "-c:a",+ "aac",+ "-shortest",+ "-movflags",+ "+faststart",+ str(output),+ ]+ )diff --git a/backend/app/services/pipeline.py b/backend/app/services/pipeline.pyindex f106a1b..b10a401 100644--- a/backend/app/services/pipeline.py+++ b/backend/app/services/pipeline.py@@ -33,11 +33,53 @@ from app.services.style_lock import (template_is_photoreal,)from app.services.voices import resolve_speaker+from app.services import seedance_segments as segplan+from app.services.bgm import resolve_bgm_pathlogger = logging.getLogger(__name__)_running: dict[int, asyncio.Task] = {}_cancelled: set[int] = set()+++async def _settle_billing(project_id: int) -> None:+ try:+ from app.services import billing as billing_svc++ async with AsyncSessionLocal() as db:+ await billing_svc.settle_project(db, project_id)+ await db.commit()+ except Exception: # noqa: BLE001+ logger.exception("billing settle failed project=%s", project_id)+++async def _record_usage_est(+ project_id: int,+ billing_key: str,+ *,+ tokens: int = 0,+ model: str = "",+ estimated: bool = True,+) -> None:+ try:+ from app.services import billing as billing_svc++ async with AsyncSessionLocal() as db:+ project = await db.get(Project, project_id)+ if not project:+ return+ await billing_svc.record_usage(+ db,+ user_id=project.user_id,+ project_id=project_id,+ billing_key=billing_key,+ model=model,+ tokens=tokens,+ estimated=estimated,+ )+ await db.commit()+ except Exception: # noqa: BLE001+ logger.exception("billing record failed project=%s key=%s", project_id, billing_key)_celery_task_ids: dict[int, str] = {}# Seedream min pixels ~3686400; portrait 9:16 ≈ 1440x2560@@ -230,6 +272,13 @@ async def _synthesize_continuous_audio(shot_no=0,duration_hint=hint,)+ s = get_settings()+ await _record_usage_est(+ project_id,+ "tts",+ tokens=s.billing_est_tts_tokens * max(len(shot_rows), 1),+ model=s.model_audio,+ )src = storage.local_path_from_url(audio_url or "")if not src or not src.exists():raise RuntimeError("整片配音生成失败")@@ -310,6 +359,7 @@ async def run_pipeline(project_id: int) -> None:"message": "分镜已生成,请确认修改后手动继续",},)+ await _settle_billing(project_id)logger.info("pipeline paused after script project=%s", project_id)return@@ -391,6 +441,7 @@ async def run_pipeline(project_id: int) -> None:project.status = ProjectStatus.CANCELLEDproject.error_msg = "用户取消"await db.commit()+ await _settle_billing(project_id)await publish_progress(project_id,{@@ -410,6 +461,7 @@ async def run_pipeline(project_id: int) -> None:project.status = ProjectStatus.CANCELLEDproject.error_msg = "用户取消"await db.commit()+ await _settle_billing(project_id)await publish_progress(project_id,{@@ -428,6 +480,7 @@ async def run_pipeline(project_id: int) -> None:project.status = ProjectStatus.FAILEDproject.error_msg = str(exc)[:2000]await db.commit()+ await _settle_billing(project_id)await publish_progress(project_id,{@@ -512,6 +565,15 @@ async def _script_stage(project_id: int) -> None:project.character_bible = _effective_character_bible(project, plans_result.character_bible)else:project.character_bible = "无固定人物,各镜独立场景"+ tpl_bgm = ""+ if tpl and isinstance(tpl.audio_config, dict):+ tpl_bgm = str(tpl.audio_config.get("bgm_mood") or "").strip()+ project.bgm_lock = (+ (plans_result.bgm_lock or "").strip()+ or tpl_bgm+ or (plans[0].bgm if plans else "")+ or "轻快专业"+ )for shot in list(project.shots):await db.delete(shot)await db.flush()@@ -532,6 +594,7 @@ async def _script_stage(project_id: int) -> None:scene = scene.replace(bible, "", 1)scene = strip_lock_blocks(scene)img_prompt = ark._sanitize_seedream_prompt(scene)+ segment_script = (plan.segment_script or plan.video_prompt or "").strip()db.add(Shot(project_id=project.id,@@ -541,15 +604,23 @@ async def _script_stage(project_id: int) -> None:overlay_title=plan.overlay_title or "",overlay_subtitle=plan.overlay_subtitle or "",img_prompt=img_prompt,- video_prompt=plan.video_prompt,+ video_prompt=segment_script or plan.video_prompt,+ segment_script=segment_script,camera=plan.camera,- bgm_mood=plan.bgm,+ bgm_mood=project.bgm_lock or plan.bgm,status=ShotStatus.PENDING,))project.status = ProjectStatus.SCRIPT_READYproject.progress = 15await db.commit()+ s = get_settings()+ await _record_usage_est(+ project_id,+ "llm_chat",+ tokens=s.billing_est_llm_tokens,+ model=s.model_llm,+ )await publish_progress(project_id, {"event": "progress", "stage": "SCRIPT_READY", "percent": 15})@@ -768,6 +839,13 @@ async def _parallel_image_and_audio(project_id: int) -> None:shot_no=meta["shot_no"],size=image_size,)+ s = get_settings()+ await _record_usage_est(+ project_id,+ "seedream",+ tokens=s.billing_est_seedream_tokens,+ model=s.model_image,+ )await persist_image(meta, img)return img.remote_url or img.local_url@@ -911,12 +989,14 @@ async def _parallel_videos(project_id: int) -> None:"shot_no": s.shot_no,"duration": float(s.duration),"video_prompt": s.video_prompt,+ "segment_script": getattr(s, "segment_script", "") or s.video_prompt or "","camera": s.camera,"image_ref": s.image_ark_url or s.image_url or "","has_video": bool(s.video_url),}for s in sorted(project.shots, key=lambda s: s.shot_no)]+ style_prefix = _effective_style(project)total = len(shot_meta)if not shot_meta:@@ -946,12 +1026,24 @@ async def _parallel_videos(project_id: int) -> None:returnasync with sem:await _ensure_not_cancelled(project_id)- prompt = f"{meta['video_prompt']}。运镜:{meta['camera']}。{motion}"+ script = (meta.get("segment_script") or meta.get("video_prompt") or "").strip()+ prompt = segplan.build_seedance_prompt(+ script,+ style_prefix=style_prefix,+ motion_bias=motion,+ camera=str(meta.get("camera") or ""),+ )+ dur = segplan.resolve_api_duration(+ script,+ fallback=meta["duration"],+ lo=cfg.seedance_duration_min,+ hi=cfg.seedance_duration_max,+ )try:local_video = await ark.gen_and_wait_video(meta["image_ref"],prompt,- int(meta["duration"]),+ int(dur),project_id=project_id,shot_no=meta["shot_no"],character_consistency=consistency,@@ -991,6 +1083,14 @@ async def _parallel_videos(project_id: int) -> None:)returnraise+ s = get_settings()+ dur = max(float(dur), 2.0)+ await _record_usage_est(+ project_id,+ "seedance2:video0",+ tokens=int(dur * s.billing_est_seedance_tokens_per_sec),+ model=s.model_video,+ )async with _db_write_lock():async with AsyncSessionLocal() as db:shot = await db.get(Shot, meta["id"])@@ -1137,14 +1237,27 @@ async def _video_stage(project_id: int) -> None:if project.resolution_mode == "hd" and resolution == "480p":resolution = "720p"ratio = _project_output_ratio(project) or cfg.ark_video_ratio+ style_prefix = _effective_style(project)for idx, shot in enumerate(sorted(project.shots, key=lambda s: s.shot_no)):await _ensure_not_cancelled(project_id)- prompt = f"{shot.video_prompt}。运镜:{shot.camera}。{motion}"+ script = (getattr(shot, "segment_script", "") or shot.video_prompt or "").strip()+ prompt = segplan.build_seedance_prompt(+ script,+ style_prefix=style_prefix,+ motion_bias=motion,+ camera=shot.camera or "",+ )+ dur = segplan.resolve_api_duration(+ script,+ fallback=shot.duration,+ lo=cfg.seedance_duration_min,+ hi=cfg.seedance_duration_max,+ )image_ref = shot.image_ark_url or shot.image_url or ""local_video = await ark.gen_and_wait_video(image_ref,prompt,- int(shot.duration),+ int(dur),project_id=project_id,shot_no=shot.shot_no,character_consistency=consistency,@@ -1256,6 +1369,13 @@ async def _compose_stage(project_id: int) -> None:except (TypeError, ValueError):return default+ bgm_mood = (getattr(project, "bgm_lock", None) or "").strip()+ if not bgm_mood and project.shots:+ bgm_mood = (project.shots[0].bgm_mood or "").strip()+ if not bgm_mood and project.template and isinstance(project.template.audio_config, dict):+ bgm_mood = str(project.template.audio_config.get("bgm_mood") or "").strip()+ bgm_path = resolve_bgm_path(bgm_mood)+out = storage.project_dir(project_id) / "final.mp4"await asyncio.to_thread(compose_project,@@ -1270,6 +1390,8 @@ async def _compose_stage(project_id: int) -> None:title_scale=_f("title_scale", 1.35),sub_scale=_f("sub_scale", 1.3),caption_scale=_f("caption_scale", 1.25),+ bgm_path=bgm_path,+ bgm_volume=0.22,),)project.final_video_url = storage.publish_local(out)@@ -1284,9 +1406,7 @@ async def _compose_stage(project_id: int) -> None:project.status = ProjectStatus.DONEproject.progress = 100await db.commit()---async def regen_shot_image(project_id: int, shot_id: int) -> None:+ await _settle_billing(project_id)ark = get_ark()async with AsyncSessionLocal() as db:result = await db.execute(@@ -1347,12 +1467,24 @@ async def regen_shot_video(project_id: int, shot_id: int) -> None:resolution = cfg.ark_video_resolutionif project.resolution_mode == "hd" and resolution == "480p":resolution = "720p"- prompt = f"{shot.video_prompt}。运镜:{shot.camera}。{motion}"+ script = (getattr(shot, "segment_script", "") or shot.video_prompt or "").strip()+ prompt = segplan.build_seedance_prompt(+ script,+ style_prefix=_effective_style(project),+ motion_bias=motion,+ camera=shot.camera or "",+ )+ dur = segplan.resolve_api_duration(+ script,+ fallback=shot.duration,+ lo=cfg.seedance_duration_min,+ hi=cfg.seedance_duration_max,+ )image_ref = shot.image_ark_url or shot.image_url or ""local_video = await ark.gen_and_wait_video(image_ref,prompt,- int(shot.duration),+ int(dur),project_id=project_id,shot_no=shot.shot_no,character_consistency=consistency,diff --git a/backend/app/services/seedance_segments.py b/backend/app/services/seedance_segments.pynew file mode 100644index 0000000..63caa24--- /dev/null+++ b/backend/app/services/seedance_segments.py@@ -0,0 +1,326 @@+"""Manju-style segment planning for Seedance 2.5 multi-shot pipeline.++Each shot stores a ``segment_script`` with production cues and ``@duration`` beats.+Before calling Seedance, durations are expanded to time ranges (00:00-00:04, …).+"""++from __future__ import annotations++import re+from dataclasses import dataclass+from typing import Any++SEGMENT_DURATION_MIN = 3+SEGMENT_DURATION_MAX = 12+SHOT_DURATION_MIN = 4+SHOT_DURATION_MAX = 30++DURATION_TOKEN_RE = re.compile(r"@duration:(\d+)")+NARRATION_PREFIX = "【旁白·慢速清晰·同步字幕】"+SUBTITLE_CUE = "【字幕:全程简体中文字幕,旁白逐句同步烧录】"+DEFAULT_BGM_MOOD = "贴合内容的轻量配乐,情绪平稳,不抢旁白"++BGM_MOOD_KEYWORDS: list[tuple[re.Pattern[str], str]] = [+ (re.compile(r"紧张|危机|压迫|悬疑"), "低沉紧张、鼓点渐强,烘托压迫感,音量低于人声"),+ (re.compile(r"温暖|人文|故事|情感"), "温暖人文、钢琴弦乐铺底,音量低于人声"),+ (re.compile(r"赛博|科技|未来|霓虹"), "轻电子氛围,克制不抢戏,音量低于人声"),+ (re.compile(r"开源|产品|工作|工位|配置|部署"), "轻快专业、干净电子铺底,音量低于人声"),+ (re.compile(r"史诗|奇幻|宏大"), "史诗弦乐铺底,气势克制,音量低于人声"),+]+++@dataclass+class SegmentBeat:+ duration: int+ kind: str # visual | narration | action+ text: str+++def clamp_segment_duration(seconds: float | int) -> int:+ return int(max(SEGMENT_DURATION_MIN, min(int(round(float(seconds))), SEGMENT_DURATION_MAX)))+++def clamp_shot_total(+ seconds: float | int, *, lo: int = SHOT_DURATION_MIN, hi: int = SHOT_DURATION_MAX+) -> int:+ return int(max(lo, min(int(round(float(seconds))), hi)))+++def estimate_narration_duration(text: str) -> int:+ """~3 Chinese chars per second for slow clear VO; clamp to segment range."""+ clean = re.sub(r"\s+", "", (text or "").strip())+ clean = re.sub(r"^【[^】]*】", "", clean).strip()+ if not clean:+ return SEGMENT_DURATION_MIN+ secs = max(SEGMENT_DURATION_MIN, int((len(clean) + 2) // 3) + 1)+ return clamp_segment_duration(secs)+++def estimate_visual_duration(text: str) -> int:+ clean = (text or "").strip()+ if not clean:+ return SEGMENT_DURATION_MIN+ if len(clean) < 20:+ return SEGMENT_DURATION_MIN+ if len(clean) < 50:+ return 4+ return clamp_segment_duration(6)+++def infer_bgm_mood(*hints: str) -> str:+ blob = "\n".join(h for h in hints if h).strip()+ if not blob:+ return DEFAULT_BGM_MOOD+ for pattern, mood in BGM_MOOD_KEYWORDS:+ if pattern.search(blob):+ return mood+ return DEFAULT_BGM_MOOD+++def build_production_cues(bgm_mood: str) -> list[str]:+ mood = (bgm_mood or "").strip() or DEFAULT_BGM_MOOD+ if "音量低于人声" not in mood:+ mood = f"{mood},音量低于人声"+ return [SUBTITLE_CUE, f"【BGM:{mood}】"]+++def format_segment_line(kind: str, text: str) -> str:+ clean = (text or "").strip()+ if not clean:+ return ""+ if clean.startswith("【"):+ return clean+ k = (kind or "visual").strip().lower()+ if k in {"narration", "vo", "旁白"}:+ return f"{NARRATION_PREFIX}{clean}"+ return clean+++def extract_durations(content: str) -> list[int]:+ out: list[int] = []+ for match in DURATION_TOKEN_RE.finditer(content or ""):+ secs = int(match.group(1))+ if secs > 0:+ out.append(secs)+ return out+++def sum_duration(content: str) -> int:+ return sum(extract_durations(content))+++def replace_duration_with_time_ranges(content: str) -> str:+ elapsed = 0++ def _repl(match: re.Match[str]) -> str:+ nonlocal elapsed+ secs = int(match.group(1))+ if secs <= 0:+ return " "+ start = elapsed+ end = elapsed + secs+ elapsed = end+ return f"{_fmt_ts(start)}-{_fmt_ts(end)}"++ return DURATION_TOKEN_RE.sub(_repl, content or "")+++def _fmt_ts(seconds: int) -> str:+ minutes = seconds // 60+ secs = seconds % 60+ return f"{minutes:02d}:{secs:02d}"+++def narration_from_script(content: str) -> str:+ lines: list[str] = []+ for raw in (content or "").replace("\r\n", "\n").split("\n"):+ line = raw.strip()+ if (+ not line+ or line.startswith("@duration:")+ or line.startswith("【字幕")+ or line.startswith("【BGM")+ ):+ continue+ if NARRATION_PREFIX in line or "旁白" in line[:20]:+ text = re.sub(r"^【[^】]*】", "", line).strip()+ if text:+ lines.append(text)+ return "".join(lines) if lines else ""+++def first_visual_prompt(content: str) -> str:+ for raw in (content or "").replace("\r\n", "\n").split("\n"):+ line = raw.strip()+ if (+ not line+ or line.startswith("@duration:")+ or line.startswith("【字幕")+ or line.startswith("【BGM")+ ):+ continue+ if NARRATION_PREFIX in line or line.startswith("【旁白"):+ continue+ cleaned = re.sub(r"^【[^】]*】", "", line).strip()+ if cleaned:+ return cleaned+ for raw in (content or "").replace("\r\n", "\n").split("\n"):+ line = raw.strip()+ if line and not line.startswith("@") and not line.startswith("【字幕") and not line.startswith("【BGM"):+ return re.sub(r"^【[^】]*】", "", line).strip()+ return ""+++def build_segment_script(+ beats: list[SegmentBeat],+ *,+ bgm_mood: str,+ max_total: int = SHOT_DURATION_MAX,+) -> str:+ lines = build_production_cues(bgm_mood)+ used = 0+ for beat in beats:+ text = format_segment_line(beat.kind, beat.text)+ if not text:+ continue+ if beat.kind in {"narration", "vo", "旁白"}:+ dur = clamp_segment_duration(beat.duration or estimate_narration_duration(beat.text))+ else:+ dur = clamp_segment_duration(beat.duration or estimate_visual_duration(beat.text))+ if used + dur > max_total:+ dur = max_total - used+ if dur < SEGMENT_DURATION_MIN:+ break+ lines.append(f"@duration:{dur}")+ lines.append(text)+ used += dur+ if used >= max_total:+ break+ if used == 0:+ lines.append(f"@duration:{SEGMENT_DURATION_MIN}")+ lines.append("画面轻微动态,保持主体稳定")+ return "\n".join(lines).strip()+++def parse_beats_from_llm_shot(item: dict[str, Any], narration_fallback: str = "") -> list[SegmentBeat]:+ """Accept either segments[] or legacy flat text/img_prompt/video_prompt."""+ beats: list[SegmentBeat] = []+ segs = item.get("segments")+ if isinstance(segs, list) and segs:+ for seg in segs:+ if not isinstance(seg, dict):+ continue+ kind = str(seg.get("kind") or seg.get("type") or "visual").strip().lower()+ text = str(seg.get("text") or seg.get("content") or "").strip()+ if not text:+ continue+ raw_dur = seg.get("duration")+ if kind in {"narration", "vo", "旁白"}:+ dur = int(raw_dur) if raw_dur else estimate_narration_duration(text)+ else:+ dur = int(raw_dur) if raw_dur else estimate_visual_duration(text)+ beats.append(SegmentBeat(duration=dur, kind=kind, text=text))+ return beats++ img = str(item.get("img_prompt") or item.get("visual") or "").strip()+ video = str(item.get("video_prompt") or "").strip()+ text = str(item.get("text") or item.get("audio_text") or narration_fallback or "").strip()+ camera = str(item.get("camera") or "").strip()++ if img:+ beats.append(SegmentBeat(duration=estimate_visual_duration(img), kind="visual", text=img))+ elif video:+ visual = video if not camera else f"{video},运镜:{camera}"+ beats.append(SegmentBeat(duration=estimate_visual_duration(visual), kind="visual", text=visual))+ if text:+ beats.append(+ SegmentBeat(duration=estimate_narration_duration(text), kind="narration", text=text)+ )+ if not beats and video:+ beats.append(SegmentBeat(duration=4, kind="action", text=video))+ return beats+++def build_seedance_prompt(+ segment_script: str,+ *,+ style_prefix: str = "",+ motion_bias: str = "",+ camera: str = "",+) -> str:+ """Assemble final Seedance text: style lock + production note + timed body."""+ parts: list[str] = []+ style = (style_prefix or "").strip()+ if style:+ parts.append(+ "【强制约束:视频画面风格】全片画面必须严格遵循以下风格描述,"+ f"严禁偏离或混用其他画风:{style}"+ )+ parts.append(+ "【强制约束:节奏与叠字】严格按时间轴段落演绎画面;"+ "旁白由后期配音,视频内不要自行添加嘈杂对白;"+ "保持主体外形与首帧一致,动作自然。"+ )+ if motion_bias or camera:+ bits = [b for b in (motion_bias.strip(), camera.strip()) if b]+ parts.append("【运镜】" + ";".join(bits))+ body = replace_duration_with_time_ranges(segment_script or "")+ parts.append(body.strip())+ return "\n".join(p for p in parts if p).strip()+++def resolve_api_duration(+ segment_script: str,+ *,+ fallback: float | int = 8,+ lo: int = SHOT_DURATION_MIN,+ hi: int = SHOT_DURATION_MAX,+) -> int:+ total = sum_duration(segment_script)+ if total <= 0:+ total = int(round(float(fallback)))+ return clamp_shot_total(total, lo=lo, hi=hi)+++def apply_segment_script_edit(script: str, *, bgm_mood: str | None = None) -> dict[str, Any]:+ """Normalize an edited script: ensure cues, recompute duration/narration/img."""+ content = (script or "").strip()+ if not content:+ content = build_segment_script(+ [SegmentBeat(duration=4, kind="visual", text="画面轻微动态,保持主体稳定")],+ bgm_mood=bgm_mood or DEFAULT_BGM_MOOD,+ )+ else:+ has_sub = any(line.strip().startswith("【字幕") for line in content.splitlines())+ has_bgm = any(line.strip().startswith("【BGM") for line in content.splitlines())+ if not has_sub or not has_bgm:+ cues = build_production_cues(bgm_mood or infer_bgm_mood(content))+ body_lines = [+ ln+ for ln in content.splitlines()+ if not ln.strip().startswith("【字幕") and not ln.strip().startswith("【BGM")+ ]+ content = "\n".join(cues + body_lines).strip()+ if not extract_durations(content):+ body = "\n".join(+ ln+ for ln in content.splitlines()+ if not ln.strip().startswith("【字幕") and not ln.strip().startswith("【BGM")+ ).strip()+ content = build_segment_script(+ [+ SegmentBeat(+ duration=estimate_narration_duration(body),+ kind="narration",+ text=body or "平稳推进",+ )+ ],+ bgm_mood=bgm_mood or infer_bgm_mood(content),+ )+ return {+ "segment_script": content,+ "duration": float(resolve_api_duration(content)),+ "narration": narration_from_script(content),+ "img_prompt": first_visual_prompt(content),+ "video_prompt": content,+ }diff --git a/backend/app/services/templates_seed.py b/backend/app/services/templates_seed.pyindex e3ef3c0..272859b 100644--- a/backend/app/services/templates_seed.py+++ b/backend/app/services/templates_seed.py@@ -34,14 +34,15 @@ TEMPLATES: list[dict] = ["空界面无操作者,纯抽象色块"),"default_ratio": "9:16",- "shot_duration_min": 4,- "shot_duration_max": 10,+ "shot_duration_min": 5,+ "shot_duration_max": 16,"llm_system_addon": ("这是开源/产品展示片。先【分析】用户文案:项目类型、核心能力、典型用户与使用路径,""再规划分镜与视觉,不要套固定蓝光大屏。""【画面硬性要求】每镜必须出现「人在操作系统」:""操作员坐在工位前使用电脑/笔记本/平板,点击界面、填写配置、查看看板、""演示核心流程、部署发布或阅读文档;可辅以屏幕特写,但禁止整片只有空 UI 无人。"+ "【逐段】每镜输出 segments:visual 与 narration 交替;单段 3-12 秒,镜合计适配口播。""【视觉】色板与界面气质跟内容走(浅色后台、IDE、文档站、终端等),禁止默认霓虹蓝。""【分镜】每镜对应不同能力或操作场景,构图必须明显不同,禁止待办清单/人物剧情戏。""title=模块短名(2-8字),subtitle=能力卖点(10-22字),text=口播;"@@ -64,6 +65,7 @@ TEMPLATES: list[dict] = ["seedance_config": {"motion_bias": "手部轻微点击与屏幕内容切换,缓慢推近工位","character_consistency": False,+ "generate_audio": False,},"audio_config": {"voice_preset": "urban_editorial", "bgm_mood": "轻快专业"},"subtitle_config": {@@ -77,6 +79,142 @@ TEMPLATES: list[dict] = ["is_active": True,"is_premium": False,},+ {+ "id": "opensource_live_work",+ "name": "真人工作场景",+ "description": "真人写实工位操作:侧脸/过肩操作系统,适合开源工具与产品工作流科普。",+ "category": ["开源", "真人感", "写实感"],+ "preview_cover": "/static/templates/covers/opensource_live_work.png",+ "style_prefix": (+ "真人写实摄影,真实办公室工位,侧脸或过肩视角操作笔记本电脑/双屏,"+ "手部点击与屏幕界面清晰,自然窗光与显示器补光,商务休闲着装,"+ "皮肤与材质真实,非卡通非动漫,干净留白便于叠字"+ ),+ "negative_prompt": (+ "卡通,动漫,赛璐璐,二次元,美颜过度磨皮,CGI假人,"+ "霓虹蓝赛博大屏,任务清单堆叠,空界面无操作者,画面文字水印,模糊"+ ),+ "default_ratio": "16:9",+ "shot_duration_min": 6,+ "shot_duration_max": 20,+ "llm_system_addon": (+ "这是开源「真人工作场景」片。先分析项目能力与使用路径,再拆 4-6 镜。"+ "【硬性】每镜必须出现真人在工位操作系统(侧脸/过肩/手部焦点,少正脸特写)。"+ "【逐段】每镜必须输出 segments 数组:交替 visual(景别+动作+界面类型)与 narration(口播);"+ "单段 duration 3-12 秒,镜内合计不超过 20 秒;旁白按约 3 字/秒估时长。"+ "【节拍】痛点工位→接入配置→核心工作台→流程结果→协作/部署;构图与操作动作禁止雷同。"+ "title=模块短名,subtitle=卖点句,bgm 全片统一为轻快专业。"+ ),+ "seedream_config": {+ "ref_images": [],+ "strength": 0.72,+ "photoreal": True,+ "consistency_mode": "diverse",+ "character_prompt": (+ "写实产品演示操作员:侧脸或过肩,坐在工位前操作笔记本或双屏,"+ "商务休闲着装,手部与屏幕为视觉重点,五官不抢戏,气质全片统一"+ ),+ "extra_prompt": (+ "真人写实工位,手部点击可读,界面类型随内容变化;"+ "禁止正脸大特写与霓虹赛博大屏;画面内不要出现文字"+ ),+ },+ "seedance_config": {+ "motion_bias": "手部轻微点击与屏幕内容切换,缓慢推近工位",+ "character_consistency": False,+ "generate_audio": False,+ },+ "audio_config": {"voice_preset": "urban_editorial", "bgm_mood": "轻快专业"},+ "subtitle_config": {+ "font": "SourceHanSans",+ "position": "split",+ "title_scale": 1.6,+ "sub_scale": 1.45,+ "caption_scale": 1.25,+ },+ "sort_order": 2,+ "is_active": True,+ "is_premium": False,+ },+ {+ "id": "live_street_interview",+ "name": "真人街访口播",+ "description": "街头/通勤场景的真人出镜口播感,适合观点、体验与轻访谈科普。",+ "category": ["真人感", "纪录片"],+ "preview_cover": "/static/templates/covers/live_street_interview.png",+ "style_prefix": (+ "真人纪实街访摄影,自然光与轻微手持感,城市街道或通勤场景,"+ "真实皮肤与环境噪音感克制,非棚拍浓妆,非卡通非动漫"+ ),+ "negative_prompt": "卡通,动漫,赛璐璐,二次元,棚拍浓妆,CGI假人,霓虹赛博,画面文字水印",+ "default_ratio": "9:16",+ "shot_duration_min": 5,+ "shot_duration_max": 18,+ "llm_system_addon": (+ "真人街访/口播节奏。每镜输出 segments:建立环境 visual → narration 口播 → 反应/细节 visual。"+ "人物外形全片一致;少正脸极端特写。title 短、subtitle 观点句。"+ ),+ "seedream_config": {+ "ref_images": [],+ "strength": 0.72,+ "photoreal": True,+ "character_prompt": "真人街访主角:年龄气质、发型服装日常感固定,自然表情,全片同一人",+ "extra_prompt": "自然光街景或通勤场景,竖屏主体清晰,顶部可留白叠字",+ },+ "seedance_config": {+ "motion_bias": "轻微手持感,缓慢推近",+ "character_consistency": True,+ "generate_audio": False,+ },+ "audio_config": {"voice_preset": "warm_storyteller", "bgm_mood": "温暖人文"},+ "subtitle_config": {"font": "SourceHanSans", "position": "top", "caption_scale": 1.3},+ "sort_order": 3,+ "is_active": True,+ "is_premium": False,+ },+ {+ "id": "live_product_desk",+ "name": "真人桌面演示",+ "description": "桌面俯拍/斜俯写实:真人双手演示产品或笔记本流程,适合工具评测与教程。",+ "category": ["真人感", "写实感", "商业"],+ "preview_cover": "/static/templates/covers/live_product_desk.png",+ "style_prefix": (+ "真人桌面产品演示摄影,斜俯或过肩,木质/浅色桌面,笔记本与手部清晰,"+ "柔和棚灯或窗光,材质真实,非卡通非插画"+ ),+ "negative_prompt": "卡通,动漫,赛璐璐,二次元,空桌无手,霓虹赛博,画面乱码文字水印",+ "default_ratio": "16:9",+ "shot_duration_min": 5,+ "shot_duration_max": 18,+ "llm_system_addon": (+ "桌面演示片。每镜 segments 必须含手部操作 visual + narration;"+ "景别在全桌建立、手部特写、屏幕内容之间切换,禁止各镜雷同。"+ ),+ "seedream_config": {+ "ref_images": [],+ "strength": 0.7,+ "photoreal": True,+ "consistency_mode": "diverse",+ "character_prompt": "写实双手与小臂为主,可露侧脸;着装简洁,全片气质统一",+ "extra_prompt": "桌面斜俯,手部与产品/屏幕清晰,画面内无文字",+ },+ "seedance_config": {+ "motion_bias": "手部点击滑动,轻微推近屏幕",+ "character_consistency": False,+ "generate_audio": False,+ },+ "audio_config": {"voice_preset": "narrator_calm", "bgm_mood": "冷静纪实"},+ "subtitle_config": {+ "font": "SourceHanSans",+ "position": "split",+ "title_scale": 1.5,+ "sub_scale": 1.4,+ "caption_scale": 1.25,+ },+ "sort_order": 4,+ "is_active": True,+ "is_premium": False,+ },{"id": "portrait_story","name": "竖屏图文故事",diff --git a/backend/static/templates/covers/live_product_desk.png b/backend/static/templates/covers/live_product_desk.pngnew file mode 100644index 0000000..3fc0e8bBinary files /dev/null and b/backend/static/templates/covers/live_product_desk.png differdiff --git a/backend/static/templates/covers/live_street_interview.png b/backend/static/templates/covers/live_street_interview.pngnew file mode 100644index 0000000..5d4556aBinary files /dev/null and b/backend/static/templates/covers/live_street_interview.png differdiff --git a/backend/static/templates/covers/opensource_live_work.png b/backend/static/templates/covers/opensource_live_work.pngnew file mode 100644index 0000000..0ea4ba6Binary files /dev/null and b/backend/static/templates/covers/opensource_live_work.png differdiff --git a/backend/tests/test_seedance_segments.py b/backend/tests/test_seedance_segments.pynew file mode 100644index 0000000..1f8b734--- /dev/null+++ b/backend/tests/test_seedance_segments.py@@ -0,0 +1,55 @@+"""Unit tests for manju-style segment planning."""++from app.services.seedance_segments import (+ SegmentBeat,+ apply_segment_script_edit,+ build_segment_script,+ build_seedance_prompt,+ narration_from_script,+ replace_duration_with_time_ranges,+ resolve_api_duration,+ sum_duration,+)+++def test_build_segment_script_and_time_ranges():+ script = build_segment_script(+ [+ SegmentBeat(duration=4, kind="visual", text="过肩工位打开工作台"),+ SegmentBeat(duration=8, kind="narration", text="很多人找开源工具却卡在接入"),+ ],+ bgm_mood="轻快专业",+ )+ assert "【字幕:" in script+ assert "【BGM:" in script+ assert "@duration:4" in script+ assert "@duration:8" in script+ assert "【旁白·慢速清晰·同步字幕】" in script+ assert sum_duration(script) == 12+ timed = replace_duration_with_time_ranges(script)+ assert "00:00-00:04" in timed+ assert "00:04-00:12" in timed+ assert resolve_api_duration(script) == 12+ assert "很多人找开源工具" in narration_from_script(script)+++def test_build_seedance_prompt_includes_style():+ script = build_segment_script(+ [SegmentBeat(duration=5, kind="visual", text="手部点击配置")],+ bgm_mood="轻快专业",+ )+ prompt = build_seedance_prompt(script, style_prefix="真人写实工位", motion_bias="轻推", camera="缓慢推近")+ assert "强制约束:视频画面风格" in prompt+ assert "真人写实工位" in prompt+ assert "00:00-00:05" in prompt+++def test_apply_segment_script_edit_fills_cues():+ out = apply_segment_script_edit(+ "@duration:6\n过肩演示产品\n@duration:6\n【旁白·慢速清晰·同步字幕】一句话介绍能力",+ bgm_mood="冷静纪实",+ )+ assert out["duration"] == 12.0+ assert "【字幕:" in out["segment_script"]+ assert "【BGM:" in out["segment_script"]+ assert out["narration"]diff --git a/deploy/.env.prod.example b/deploy/.env.prod.exampleindex e65d0d2..5e26e11 100644--- a/deploy/.env.prod.example+++ b/deploy/.env.prod.example@@ -12,11 +12,21 @@ REDIS_URL=redis://127.0.0.1:16379/0PUBLIC_BASE_URL=https://kepu.printfilm.comCORS_ORIGINS=https://kepu.printfilm.comARK_MOCK=falseARK_API_KEY=your-ark-api-keyUSE_CELERY=trueQUOTA_ENABLED=false+BILLING_ENABLED=true+BILLING_MARKUP=1.5+BILLING_SIGNUP_GRANT_FEN=500+EPAY_API_URL=https://pay.gitcc.com+EPAY_PID=+EPAY_KEY=+EPAY_NOTIFY_URL=https://kepu.printfilm.com/api/billing/epay/notify+EPAY_RETURN_URL=https://kepu.printfilm.com/pricing?paid=1+CELERY_AUTOSCALE_MIN=1CELERY_AUTOSCALE_MAX=3diff --git a/docs/BILLING.md b/docs/BILLING.mdnew file mode 100644index 0000000..c61438f--- /dev/null+++ b/docs/BILLING.md@@ -0,0 +1,60 @@+# PRINTFILM 计费说明++## 原则++- 按上游 **真实 token 用量**(或无法拿到 usage 时的保守估价)计费。+- 用户支付价 = 上游成本 × **1.5**(`BILLING_MARKUP`)。+- 钱包单位:**分(fen)**。+- 充值:易支付 [pay.gitcc.com](https://pay.gitcc.com/),支付宝 `alipay` / 微信 `wxpay`。++## 公式++```+charge_fen = ceil(tokens / 1e6 * provider_yuan_per_m * markup * 100)+```++默认成本价(元/百万 tokens,可环境覆盖):++| billing_key | 成本 |+|-------------|------|+| seedance2:video0 | 46 |+| seedance2:video1 | 28 |+| llm_chat | 5 |+| seedream | 8(按次折合约;有 usage 则用 usage) |+| tts | 2(按次估价) |++## 预扣 / 结算++1. `POST /generate`:按阶段估算并 `freeze`(含约 20% buffer)。+2. 流水线写入 `UsageEvent`。+3. 阶段结束(`SCRIPT_READY` / `DONE` / `FAILED` / `CANCELLED`):按本项目未结算 usage `settle`,多退少补冻结额。++## 易支付++环境变量(密钥勿提交仓库):++```+BILLING_ENABLED=true+BILLING_MARKUP=1.5+EPAY_API_URL=https://pay.gitcc.com+EPAY_PID=+EPAY_KEY=***+EPAY_NOTIFY_URL=https://kepu.printfilm.com/api/billing/epay/notify+EPAY_RETURN_URL=https://kepu.printfilm.com/pricing?paid=1+```++下单:服务端 `POST {EPAY_API_URL}/mapi.php`(扫码),MD5 签名(参数 ASCII 排序,排除 sign/sign_type,末尾拼 KEY)。返回 `qrcode` / `payurl` 供前端弹窗展示二维码。++异步 notify 验签成功且支付成功 → 订单入账(幂等)。++## API++| 方法 | 路径 | 说明 |+|------|------|------|+| GET | `/api/billing/usage/summary` | 本月 token / 费用 / 余额 |+| GET | `/api/billing/orders` | 充值订单列表 |+| POST | `/api/billing/orders` | `{sku_id, pay_type}` → 扫码支付载荷(含 `qr_payload`) |+| POST | `/api/billing/epay/notify` | 易支付回调 |+| GET | `/api/billing/orders/{out_trade_no}` | 订单状态 |++Demo 账号可设 `billing_unlimited=true` 跳过扣费。diff --git a/docs/PLACEHOLDER_BACKLOG.md b/docs/PLACEHOLDER_BACKLOG.mdindex 95d8216..022d723 100644--- a/docs/PLACEHOLDER_BACKLOG.md+++ b/docs/PLACEHOLDER_BACKLOG.md@@ -121,9 +121,9 @@| ID | 功能 | 现状 | 优先级 | 备注 ||----|------|------|--------|------|-| P-01 | 套餐 SKU 展示 | 待开发 | P1 | 整页 ComingSoon |-| P-02 | 支付与订单 | 待开发 | P1 | |-| P-03 | 额度扣减与高清导出权限 | 待开发 | P1 | |+| P-01 | 套餐 SKU 展示 | 已完成 | P1 | 定价页充值包 |+| P-02 | 支付与订单 | 已完成 | P1 | 易支付 alipay/wxpay,见 docs/BILLING.md |+| P-03 | 额度扣减与高清导出权限 | 部分完成 | P1 | token×1.5 预扣结算;hd 门禁可后续 || P-04 | 团队空间 | 待开发 | P3 | |---diff --git a/frontend/package-lock.json b/frontend/package-lock.jsonindex fc21352..982f5ce 100644--- a/frontend/package-lock.json+++ b/frontend/package-lock.json@@ -9,6 +9,7 @@"version": "0.0.0","dependencies": {"jszip": "^3.10.1",+ "qrcode": "^1.5.4","react": "^19.2.8","react-dom": "^19.2.8","react-router-dom": "^7.18.2"@@ -16,6 +17,7 @@"devDependencies": {"@types/jszip": "^3.4.0","@types/node": "^24.13.3",+ "@types/qrcode": "^1.5.6","@types/react": "^19.2.17","@types/react-dom": "^19.2.3","@vitejs/plugin-react": "^6.0.4",@@ -664,6 +666,16 @@"undici-types": "~7.18.0"}},+ "node_modules/@types/qrcode": {+ "version": "1.5.6",+ "resolved": "https://registry.npmmirror.com/@types/qrcode/-/qrcode-1.5.6.tgz",+ "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },"node_modules/@types/react": {"version": "19.2.18","resolved": "https://registry.npmmirror.com/@types/react/-/react-19.2.18.tgz",@@ -710,6 +722,68 @@}}},+ "node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/camelcase": {+ "version": "5.3.1",+ "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz",+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/cliui": {+ "version": "6.0.0",+ "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",+ "license": "ISC",+ "dependencies": {+ "string-width": "^4.2.0",+ "strip-ansi": "^6.0.0",+ "wrap-ansi": "^6.2.0"+ }+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "license": "MIT"+ },"node_modules/cookie": {"version": "1.1.1","resolved": "https://registry.npmmirror.com/cookie/-/cookie-1.1.1.tgz",@@ -736,6 +810,15 @@"dev": true,"license": "MIT"},+ "node_modules/decamelize": {+ "version": "1.2.0",+ "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz",+ "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/detect-libc": {"version": "2.1.2","resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz",@@ -746,6 +829,18 @@"node": ">=8"}},+ "node_modules/dijkstrajs": {+ "version": "1.0.3",+ "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz",+ "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",+ "license": "MIT"+ },+ "node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "license": "MIT"+ },"node_modules/fdir": {"version": "6.5.0","resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz",@@ -764,6 +859,19 @@}}},+ "node_modules/find-up": {+ "version": "4.1.0",+ "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz",+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",+ "license": "MIT",+ "dependencies": {+ "locate-path": "^5.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },"node_modules/fsevents": {"version": "2.3.3","resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",@@ -779,6 +887,15 @@"node": "^8.16.0 || ^10.6.0 || >=11.0.0"}},+ "node_modules/get-caller-file": {+ "version": "2.0.5",+ "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",+ "license": "ISC",+ "engines": {+ "node": "6.* || 8.* || >= 10.*"+ }+ },"node_modules/immediate": {"version": "3.0.6","resolved": "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz",@@ -791,6 +908,15 @@"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==","license": "ISC"},+ "node_modules/is-fullwidth-code-point": {+ "version": "3.0.0",+ "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },"node_modules/isarray": {"version": "1.0.0","resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz",@@ -1091,6 +1217,18 @@"url": "https://opencollective.com/parcel"}},+ "node_modules/locate-path": {+ "version": "5.0.0",+ "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz",+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",+ "license": "MIT",+ "dependencies": {+ "p-locate": "^4.1.0"+ },+ "engines": {+ "node": ">=8"+ }+ },"node_modules/nanoid": {"version": "3.3.17","resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.17.tgz",@@ -1159,12 +1297,57 @@}}},+ "node_modules/p-limit": {+ "version": "2.3.0",+ "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz",+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",+ "license": "MIT",+ "dependencies": {+ "p-try": "^2.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-locate": {+ "version": "4.1.0",+ "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz",+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",+ "license": "MIT",+ "dependencies": {+ "p-limit": "^2.2.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/p-try": {+ "version": "2.2.0",+ "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz",+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/pako": {"version": "1.0.11","resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz","integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==","license": "(MIT AND Zlib)"},+ "node_modules/path-exists": {+ "version": "4.0.0",+ "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz",+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },"node_modules/picocolors": {"version": "1.1.1","resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz",@@ -1185,6 +1368,15 @@"url": "https://github.com/sponsors/jonschlinkert"}},+ "node_modules/pngjs": {+ "version": "5.0.0",+ "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz",+ "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",+ "license": "MIT",+ "engines": {+ "node": ">=10.13.0"+ }+ },"node_modules/postcss": {"version": "8.5.25","resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.25.tgz",@@ -1220,6 +1412,23 @@"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==","license": "MIT"},+ "node_modules/qrcode": {+ "version": "1.5.4",+ "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.4.tgz",+ "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",+ "license": "MIT",+ "dependencies": {+ "dijkstrajs": "^1.0.1",+ "pngjs": "^5.0.0",+ "yargs": "^15.3.1"+ },+ "bin": {+ "qrcode": "bin/qrcode"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },"node_modules/react": {"version": "19.2.8","resolved": "https://registry.npmmirror.com/react/-/react-19.2.8.tgz",@@ -1294,6 +1503,21 @@"util-deprecate": "~1.0.1"}},+ "node_modules/require-directory": {+ "version": "2.1.1",+ "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz",+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/require-main-filename": {+ "version": "2.0.0",+ "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz",+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",+ "license": "ISC"+ },"node_modules/rolldown": {"version": "1.2.2","resolved": "https://registry.npmmirror.com/rolldown/-/rolldown-1.2.2.tgz",@@ -1339,6 +1563,12 @@"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==","license": "MIT"},+ "node_modules/set-blocking": {+ "version": "2.0.0",+ "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz",+ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",+ "license": "ISC"+ },"node_modules/set-cookie-parser": {"version": "2.7.2","resolved": "https://registry.npmmirror.com/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",@@ -1370,6 +1600,32 @@"safe-buffer": "~5.1.0"}},+ "node_modules/string-width": {+ "version": "4.2.3",+ "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },"node_modules/tinyglobby": {"version": "0.2.17","resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz",@@ -1491,6 +1747,67 @@"optional": true}}+ },+ "node_modules/which-module": {+ "version": "2.0.1",+ "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz",+ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",+ "license": "ISC"+ },+ "node_modules/wrap-ansi": {+ "version": "6.2.0",+ "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/y18n": {+ "version": "4.0.3",+ "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz",+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",+ "license": "ISC"+ },+ "node_modules/yargs": {+ "version": "15.4.1",+ "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz",+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",+ "license": "MIT",+ "dependencies": {+ "cliui": "^6.0.0",+ "decamelize": "^1.2.0",+ "find-up": "^4.1.0",+ "get-caller-file": "^2.0.1",+ "require-directory": "^2.1.1",+ "require-main-filename": "^2.0.0",+ "set-blocking": "^2.0.0",+ "string-width": "^4.2.0",+ "which-module": "^2.0.0",+ "y18n": "^4.0.0",+ "yargs-parser": "^18.1.2"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/yargs-parser": {+ "version": "18.1.3",+ "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz",+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",+ "license": "ISC",+ "dependencies": {+ "camelcase": "^5.0.0",+ "decamelize": "^1.2.0"+ },+ "engines": {+ "node": ">=6"+ }}}}diff --git a/frontend/package.json b/frontend/package.jsonindex 731d256..bff90eb 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -11,6 +11,7 @@},"dependencies": {"jszip": "^3.10.1",+ "qrcode": "^1.5.4","react": "^19.2.8","react-dom": "^19.2.8","react-router-dom": "^7.18.2"@@ -18,6 +19,7 @@"devDependencies": {"@types/jszip": "^3.4.0","@types/node": "^24.13.3",+ "@types/qrcode": "^1.5.6","@types/react": "^19.2.17","@types/react-dom": "^19.2.3","@vitejs/plugin-react": "^6.0.4",diff --git a/frontend/src/api.ts b/frontend/src/api.tsindex 498661f..e69b117 100644--- a/frontend/src/api.ts+++ b/frontend/src/api.ts@@ -107,6 +107,7 @@ export type Shot = {overlay_subtitle?: stringimg_prompt: stringvideo_prompt: string+ segment_script?: stringcamera: stringbgm_mood: stringimage_url: string | null@@ -139,6 +140,7 @@ export type Project = {output_ratio?: stringvoice_id?: stringcharacter_bible?: string+ bgm_lock?: stringstyle_prompt?: stringcharacter_prompt?: stringextra_prompt?: string@@ -153,6 +155,55 @@ export type User = {email: stringnickname: stringquota_left: number+ balance_fen?: number+ frozen_fen?: number+ plan?: string+ billing_unlimited?: boolean+}++export type BillingSku = {+ id: string+ name: string+ amount_fen: number+ credit_fen: number+ recommended?: boolean+}++export type BillingOrder = {+ out_trade_no: string+ sku_id: string+ sku_name: string+ amount_fen: number+ credit_fen: number+ pay_type: string+ status: string+ trade_no?: string | null+ paid_at?: string | null+ created_at?: string | null+}++export type UsageSummary = {+ period: string+ tokens: number+ charge_fen: number+ charge_yuan: number+ cost_fen: number+ calls: number+ balance_fen: number+ balance_yuan: number+ frozen_fen: number+ frozen_yuan: number+}++export type Wallet = {+ balance_fen: number+ frozen_fen: number+ balance_yuan: number+ frozen_yuan: number+ plan: string+ billing_enabled: boolean+ billing_unlimited: boolean+ markup: number}export type Work = {@@ -353,6 +404,46 @@ export const api = {works() {return request<Work[]>('/api/works')},+ wallet() {+ return request<Wallet>('/api/billing/wallet')+ },+ billingSkus() {+ return request<{ skus: BillingSku[]; pay_types: string[]; markup: number }>('/api/billing/skus')+ },+ createBillingOrder(sku_id: string, pay_type: 'alipay' | 'wxpay') {+ return request<{+ out_trade_no: string+ sku_id: string+ sku_name: string+ submit_url: string+ amount_fen: number+ credit_fen: number+ pay_type: string+ trade_no?: string+ qrcode?: string+ payurl?: string+ img?: string+ qr_payload?: string+ expire_seconds?: number+ }>('/api/billing/orders', {+ method: 'POST',+ body: JSON.stringify({ sku_id, pay_type }),+ })+ },+ getBillingOrder(outTradeNo: string) {+ return request<{+ out_trade_no: string+ status: string+ amount_fen: number+ credit_fen: number+ }>(`/api/billing/orders/${encodeURIComponent(outTradeNo)}`)+ },+ listBillingOrders(limit = 50) {+ return request<{ orders: BillingOrder[] }>(`/api/billing/orders?limit=${limit}`)+ },+ usageSummary() {+ return request<UsageSummary>('/api/billing/usage/summary')+ },eventsUrl(projectId: number) {return `${API_BASE}/api/projects/${projectId}/events`},diff --git a/frontend/src/components/billing/PaymentModal.tsx b/frontend/src/components/billing/PaymentModal.tsxnew file mode 100644index 0000000..7acfaf2--- /dev/null+++ b/frontend/src/components/billing/PaymentModal.tsx@@ -0,0 +1,229 @@+import { useEffect, useEffectEvent, useState } from 'react'+import QRCode from 'qrcode'+import Modal from '../ui/Modal'+import { api } from '../../api'++export type PayCheckout = {+ out_trade_no: string+ sku_id: string+ sku_name: string+ pay_type: 'alipay' | 'wxpay' | string+ amount_fen: number+ credit_fen: number+ qr_payload: string+ img?: string+ expire_seconds?: number+}++type Props = {+ open: boolean+ checkout: PayCheckout | null+ onClose: () => void+ onPaid: () => void+}++function yuan(fen: number) {+ return (fen / 100).toFixed(2)+}++function formatRemain(sec: number) {+ const m = Math.floor(sec / 60)+ const s = sec % 60+ return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`+}++/** 扫码支付弹窗:展示二维码、倒计时,并轮询订单状态 */+export default function PaymentModal({ open, checkout, onClose, onPaid }: Props) {+ /*+ * qrDataUrl 二维码 data URL+ * remain 剩余秒数+ * status 当前状态文案+ * checking 手动确认中+ * expired 是否已过期+ */+ const [qrDataUrl, setQrDataUrl] = useState('')+ const [remain, setRemain] = useState(300)+ const [status, setStatus] = useState<'waiting' | 'paid' | 'expired'>('waiting')+ const [checking, setChecking] = useState(false)+ const [error, setError] = useState('')++ const handlePaid = useEffectEvent(() => {+ onPaid()+ })++ useEffect(() => {+ if (!open || !checkout) return+ /*+ * expiredAt 过期时间戳+ * payload 需编码为二维码的内容+ */+ const expiredAt = Date.now() + (checkout.expire_seconds ?? 300) * 1000+ setRemain(checkout.expire_seconds ?? 300)+ setStatus('waiting')+ setError('')+ setChecking(false)++ const payload = checkout.qr_payload || checkout.img || ''+ let cancelled = false++ async function paintQr() {+ if (!payload) {+ setQrDataUrl('')+ setError('未获取到支付二维码,请稍后重试')+ return+ }+ // 若网关直接返回图片 URL,优先使用+ if (/^https?:\/\//i.test(payload) && /\.(png|jpe?g|gif|webp)(\?|$)/i.test(payload)) {+ if (!cancelled) setQrDataUrl(payload)+ return+ }+ try {+ const url = await QRCode.toDataURL(payload, {+ width: 220,+ margin: 2,+ color: { dark: '#111318', light: '#ffffff' },+ errorCorrectionLevel: 'M',+ })+ if (!cancelled) setQrDataUrl(url)+ } catch {+ if (!cancelled) setError('二维码生成失败')+ }+ }++ void paintQr()++ const tick = window.setInterval(() => {+ const left = Math.max(0, Math.ceil((expiredAt - Date.now()) / 1000))+ setRemain(left)+ if (left <= 0) {+ setStatus('expired')+ window.clearInterval(tick)+ }+ }, 250)++ const poll = window.setInterval(async () => {+ if (!checkout.out_trade_no) return+ try {+ const order = await api.getBillingOrder(checkout.out_trade_no)+ if (order.status === 'paid') {+ setStatus('paid')+ window.clearInterval(poll)+ window.clearInterval(tick)+ handlePaid()+ }+ } catch {+ /* ignore transient poll errors */+ }+ }, 2000)++ return () => {+ cancelled = true+ window.clearInterval(tick)+ window.clearInterval(poll)+ }+ }, [open, checkout])++ async function confirmPaid() {+ if (!checkout) return+ setChecking(true)+ setError('')+ try {+ const order = await api.getBillingOrder(checkout.out_trade_no)+ if (order.status === 'paid') {+ setStatus('paid')+ handlePaid()+ } else {+ setError('尚未检测到支付结果,请稍后再试或继续扫码')+ }+ } catch (e) {+ setError(e instanceof Error ? e.message : '查询失败')+ } finally {+ setChecking(false)+ }+ }++ if (!checkout) return null++ const isAlipay = checkout.pay_type === 'alipay'+ const title = isAlipay ? '支付宝扫码支付' : '微信扫码支付'+ const tip = isAlipay ? '请使用支付宝扫码完成支付' : '请使用微信扫码完成支付'++ return (+ <Modal+ open={open}+ onClose={onClose}+ dismissible={status !== 'waiting'}+ className="pf-pay-modal"+ size="md"+ >+ <div className="pf-pay-sheet">+ <header className="pf-pay-sheet-head">+ <div className="pf-pay-sheet-title">+ <span className={`pf-pay-logo ${isAlipay ? 'alipay' : 'wxpay'}`} aria-hidden />+ <strong>{title}</strong>+ </div>+ <button type="button" className="pf-pay-sheet-close" onClick={onClose} aria-label="关闭">+ ×+ </button>+ </header>++ <div className="pf-pay-sku-box">+ <strong>{checkout.sku_name}</strong>+ <span>到账 ¥{yuan(checkout.credit_fen)}</span>+ </div>++ <div className="pf-pay-amount">+ <span>支付金额</span>+ <em>¥{yuan(checkout.amount_fen)}</em>+ </div>++ <div className="pf-pay-qr-wrap">+ {qrDataUrl ? (+ <div className="pf-pay-qr">+ <img src={qrDataUrl} alt="支付二维码" width={220} height={220} />+ <span className={`pf-pay-qr-badge ${isAlipay ? 'alipay' : 'wxpay'}`} aria-hidden />+ </div>+ ) : (+ <div className="pf-pay-qr is-empty">{error || '二维码加载中…'}</div>+ )}+ <p className="pf-pay-tip">{tip}</p>+ <p className={`pf-pay-expire${status === 'expired' ? ' is-expired' : ''}`}>+ <span className="pf-pay-clock" aria-hidden />+ {status === 'expired'+ ? '二维码已失效,请关闭后重新下单'+ : `二维码将在 ${formatRemain(remain)} 后失效`}+ </p>+ <p className={`pf-pay-wait${status === 'paid' ? ' is-paid' : ''}`}>+ <span className="pf-pay-dot" aria-hidden />+ {status === 'paid'+ ? '支付成功,余额即将更新'+ : status === 'expired'+ ? '订单已超时'+ : '等待支付结果,请勿关闭页面'}+ </p>+ </div>++ {error ? <p className="pf-error pf-pay-error">{error}</p> : null}++ <div className="pf-pay-actions">+ <button type="button" className="pf-pay-btn ghost" onClick={onClose}>+ 取消支付+ </button>+ <button+ type="button"+ className="pf-pay-btn primary"+ disabled={checking || status === 'paid' || status === 'expired'}+ onClick={() => void confirmPaid()}+ >+ {checking ? '确认中…' : status === 'paid' ? '已到账' : '我已完成支付'}+ </button>+ </div>++ <p className="pf-pay-secure-line">+ <span className="pf-pay-shield" aria-hidden />+ 支付由易支付安全提供,到账以系统通知为准+ </p>+ </div>+ </Modal>+ )+}diff --git a/frontend/src/components/billing/TopupHistoryModal.tsx b/frontend/src/components/billing/TopupHistoryModal.tsxnew file mode 100644index 0000000..8d1becd--- /dev/null+++ b/frontend/src/components/billing/TopupHistoryModal.tsx@@ -0,0 +1,95 @@+import { useEffect, useState } from 'react'+import Modal from '../ui/Modal'+import { api, type BillingOrder } from '../../api'++type Props = {+ open: boolean+ onClose: () => void+}++const SKU_LABELS: Record<string, string> = {+ topup_10: '体验充值',+ topup_49: '基础充值',+ topup_99: '进阶充值',+ topup_199: '专业充值',+}++const STATUS_CN: Record<string, string> = {+ pending: '待支付',+ paid: '已到账',+ closed: '已关闭',+}++function yuan(fen: number) {+ return (fen / 100).toFixed(2)+}++function formatTime(iso?: string | null) {+ if (!iso) return '—'+ const d = new Date(iso)+ if (Number.isNaN(d.getTime())) return iso+ const pad = (n: number) => String(n).padStart(2, '0')+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`+}++/** 充值记录弹窗:列出近期订单与到账状态 */+export default function TopupHistoryModal({ open, onClose }: Props) {+ /*+ * orders 订单列表+ * loading 加载中+ * error 错误信息+ */+ const [orders, setOrders] = useState<BillingOrder[]>([])+ const [loading, setLoading] = useState(false)+ const [error, setError] = useState('')++ useEffect(() => {+ if (!open) return+ let cancelled = false+ setLoading(true)+ setError('')+ api+ .listBillingOrders(50)+ .then((r) => {+ if (!cancelled) setOrders(r.orders || [])+ })+ .catch((e) => {+ if (!cancelled) setError(e instanceof Error ? e.message : '加载失败')+ })+ .finally(() => {+ if (!cancelled) setLoading(false)+ })+ return () => {+ cancelled = true+ }+ }, [open])++ return (+ <Modal open={open} onClose={onClose} title="充值记录" size="lg" className="pf-topup-history-modal">+ {loading ? <p className="pf-muted">加载中…</p> : null}+ {error ? <p className="pf-error">{error}</p> : null}+ {!loading && !error && orders.length === 0 ? (+ <p className="pf-muted">暂无充值记录</p>+ ) : null}+ {!loading && orders.length > 0 ? (+ <ul className="pf-topup-list">+ {orders.map((o) => (+ <li key={o.out_trade_no} className="pf-topup-item">+ <div className="pf-topup-main">+ <strong>{SKU_LABELS[o.sku_id] || o.sku_name}</strong>+ <span className="pf-muted">{formatTime(o.paid_at || o.created_at)}</span>+ </div>+ <div className="pf-topup-meta">+ <em>¥{yuan(o.amount_fen)}</em>+ <span className="pf-muted">到账 ¥{yuan(o.credit_fen)}</span>+ <span className={`pf-topup-status is-${o.status}`}>+ {STATUS_CN[o.status] || o.status}+ </span>+ </div>+ </li>+ ))}+ </ul>+ ) : null}+ </Modal>+ )+}diff --git a/frontend/src/lib/billingError.ts b/frontend/src/lib/billingError.tsnew file mode 100644index 0000000..a833e29--- /dev/null+++ b/frontend/src/lib/billingError.ts@@ -0,0 +1,27 @@+import { dialog } from './dialog'++/** 是否为余额不足 / 计费拦截类错误 */+export function isBillingError(message: string) {+ return /余额不足|请先充值|402/.test(message)+}++/**+ * 弹出余额不足提示;若用户选择去充值则跳转定价页。+ * @returns 是否已按计费错误处理+ */+export async function handleBillingError(+ err: unknown,+ navigate?: (path: string) => void,+): Promise<boolean> {+ const message = err instanceof Error ? err.message : String(err || '')+ if (!isBillingError(message)) return false+ const go = await dialog.confirm({+ title: '余额不足',+ message: message || '当前余额不足以开始生成,请先充值。',+ confirmText: '去充值',+ cancelText: '知道了',+ tone: 'danger',+ })+ if (go && navigate) navigate('/pricing')+ return true+}diff --git a/frontend/src/pages/HistoryPage.tsx b/frontend/src/pages/HistoryPage.tsxindex 9c85ebc..5eb381d 100644--- a/frontend/src/pages/HistoryPage.tsx+++ b/frontend/src/pages/HistoryPage.tsx@@ -1,22 +1,18 @@import { useEffect, useMemo, useState } from 'react'-import { useNavigate } from 'react-router-dom'-import { api } from '../api'+import { Link, useNavigate } from 'react-router-dom'+import { api, type UsageSummary } from '../api'import type { Project } from '../api'import AppShell from '../components/layout/AppShell'import PillTabs from '../components/ui/PillTabs'import StatCard from '../components/ui/StatCard'-import ComingSoon from '../components/ui/ComingSoon'import {IconClapper,IconClock,- IconCode,IconCopy,IconDownload,IconEdit,IconEye,- IconLink,IconPlus,- IconQr,IconRefresh,IconSearch,IconSend,@@ -33,13 +29,13 @@ import { isRunning, STATUS_CN, statusTone } from '../lib/status'type HistoryItem = Omit<Project, 'shots'>const PAGE_SIZE = 8-const PLATFORMS = [- { name: 'YouTube', mark: 'YT' },- { name: '抖音', mark: '抖' },- { name: 'Bilibili', mark: 'B' },- { name: '小红书', mark: '红' },- { name: '视频号', mark: '视' },-]++/** 格式化 token 数量,过大时用 k/M 缩写 */+function formatTokens(n: number) {+ if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n >= 10_000_000 ? 0 : 1)}M`+ if (n >= 10_000) return `${(n / 1000).toFixed(n >= 100_000 ? 0 : 1)}k`+ return n.toLocaleString('zh-CN')+}function canDownload(p: HistoryItem) {return p.status === 'DONE' && Boolean(p.final_video_url)@@ -67,6 +63,7 @@ export default function HistoryPage() {const [tab, setTab] = useState('全部')const [q, setQ] = useState('')const [page, setPage] = useState(1)+ const [usage, setUsage] = useState<UsageSummary | null>(null)const [preview, setPreview] = useState<{url: stringtitle: string@@ -105,6 +102,10 @@ export default function HistoryPage() {for (const t of list) map[t.id] = t.namesetTemplates(map)})+ api+ .usageSummary()+ .then(setUsage)+ .catch(() => setUsage(null))}, [nav])useEffect(() => {@@ -329,7 +330,6 @@ export default function HistoryPage() {? `打包中 ${packProgress}…`: `打包下载 (${selectedDownloadable.length})`}</button>- <span>勾选已完成项目后,浏览器依次下载并打成 ZIP(不经服务器)</span></div>{error ? <p className="pf-error">{error}</p> : null}@@ -475,68 +475,51 @@ export default function HistoryPage() {</section><aside className="pf-history-side">- <div className="pf-side-box">- <h3>快速发布</h3>- <p className="pf-side-desc">将作品发布到平台或分享给更多人</p>- <div className="pf-quick-grid">- <button type="button" className="pf-quick-tile" disabled>- <IconLink size={20} />- <span>复制链接</span>- <ComingSoon />- </button>- <button type="button" className="pf-quick-tile" disabled>- <IconQr size={20} />- <span>二维码</span>- <ComingSoon />- </button>- <button type="button" className="pf-quick-tile" disabled>- <IconCode size={20} />- <span>嵌入网页</span>- <ComingSoon />- </button>- </div>- </div>-- <div className="pf-side-box">- <h3>平台导出</h3>- <p className="pf-side-desc">一键导出到各大平台</p>- <ul className="pf-platform-list">- {PLATFORMS.map((p) => (- <li key={p.name}>- <span className="pf-platform-mark">{p.mark}</span>- <span className="pf-platform-name">{p.name}</span>- <button type="button" className="pf-btn pf-btn-ghost pf-btn-sm" disabled>- 导出- </button>- </li>- ))}- </ul>- <button type="button" className="pf-link pf-side-foot" disabled>- 查看发布记录 → <ComingSoon />- </button>- </div>-<div className="pf-side-box"><h3>本月使用情况</h3>+ <p className="pf-side-desc">按上游 token 实际用量计费</p>+<div className="pf-usage-row">- <span>时长额度</span>- <span className="pf-muted">— / 30h</span>+ <span>Token 用量</span>+ <span className="pf-usage-val">{formatTokens(usage?.tokens ?? 0)}</span></div><div className="pf-meter">- <i style={{ width: '0%' }} />+ <i+ style={{+ width: `${Math.min(100, Math.log10((usage?.tokens || 0) + 1) * 18)}%`,+ }}+ /></div>+<div className="pf-usage-row">- <span>生成次数</span>- <span className="pf-muted">- {stats.total} / 200- </span>+ <span>本月费用</span>+ <span className="pf-usage-val">¥{(usage?.charge_yuan ?? 0).toFixed(2)}</span></div><div className="pf-meter">- <i style={{ width: `${Math.min(100, stats.total * 2)}%` }} />+ <i+ style={{+ width: `${Math.min(100, (usage?.charge_fen || 0) / 20)}%`,+ }}+ />+ </div>++ <div className="pf-usage-row">+ <span>可用余额</span>+ <span className="pf-usage-val">¥{(usage?.balance_yuan ?? 0).toFixed(2)}</span>+ </div>+ {(usage?.frozen_fen ?? 0) > 0 ? (+ <div className="pf-usage-row">+ <span>冻结中</span>+ <span className="pf-muted">¥{(usage?.frozen_yuan ?? 0).toFixed(2)}</span>+ </div>+ ) : null}++ <div className="pf-usage-foot">+ <span className="pf-muted">调用 {usage?.calls ?? 0} 次</span>+ <Link to="/pricing" className="pf-link">+ 去充值 →+ </Link></div>- <p className="pf-muted" style={{ fontSize: '0.75rem', margin: '0.5rem 0 0' }}>- 额度统计即将推出- </p></div></aside></div>diff --git a/frontend/src/pages/PricingPage.tsx b/frontend/src/pages/PricingPage.tsxindex 89e59c2..bcc8b6d 100644--- a/frontend/src/pages/PricingPage.tsx+++ b/frontend/src/pages/PricingPage.tsx@@ -1,26 +1,261 @@+import { useEffect, useMemo, useState } from 'react'+import { Link, useSearchParams } from 'react-router-dom'import AppShell from '../components/layout/AppShell'-import ComingSoon from '../components/ui/ComingSoon'+import PaymentModal, { type PayCheckout } from '../components/billing/PaymentModal'+import TopupHistoryModal from '../components/billing/TopupHistoryModal'+import { api, type BillingSku, type Wallet } from '../api'++type PayType = 'alipay' | 'wxpay'++type SkuView = BillingSku & { recommended?: boolean }++function yuan(fen: number) {+ return (fen / 100).toFixed(2)+}++function yuanShort(fen: number) {+ const v = fen / 100+ return Number.isInteger(v) ? String(v) : v.toFixed(2)+}++/** Prefer design labels even if API still returns legacy names. */+const SKU_LABELS: Record<string, string> = {+ topup_10: '体验充值',+ topup_49: '基础充值',+ topup_99: '进阶充值',+ topup_199: '专业充值',+}++function planLabel(wallet: Wallet | null) {+ if (!wallet) return 'Free'+ if (wallet.billing_unlimited) return 'Unlimited'+ const p = (wallet.plan || 'free').toLowerCase()+ if (p === 'free') return 'Free'+ if (p === 'pro') return 'Pro'+ return wallet.plan+}export default function PricingPage() {+ const [params] = useSearchParams()+ const [wallet, setWallet] = useState<Wallet | null>(null)+ const [skus, setSkus] = useState<SkuView[]>([])+ const [payType, setPayType] = useState<PayType>('alipay')+ const [busy, setBusy] = useState<string | null>(null)+ const [error, setError] = useState('')+ const [hint, setHint] = useState('')+ const [checkout, setCheckout] = useState<PayCheckout | null>(null)+ const [historyOpen, setHistoryOpen] = useState(false)+ const loggedIn = Boolean(localStorage.getItem('token'))++ const displaySkus = useMemo(() => {+ return skus.map((s) => ({+ ...s,+ recommended: s.id === 'topup_99' || Boolean((s as SkuView).recommended),+ }))+ }, [skus])++ async function refresh() {+ if (!loggedIn) {+ setWallet(null)+ return+ }+ try {+ setWallet(await api.wallet())+ } catch {+ /* ignore */+ }+ }++ useEffect(() => {+ api.billingSkus().then((r) => setSkus((r.skus || []) as SkuView[]))+ refresh()+ if (params.get('paid') === '1') {+ setHint('支付完成。若余额未更新,请稍候刷新本页。')+ const t = window.setInterval(() => refresh(), 2500)+ return () => window.clearInterval(t)+ }+ }, [])++ async function pay(sku: BillingSku) {+ if (!loggedIn) {+ setError('请先登录后再充值')+ return+ }+ setBusy(sku.id)+ setError('')+ try {+ const order = await api.createBillingOrder(sku.id, payType)+ const label = SKU_LABELS[sku.id] || order.sku_name || sku.name+ setCheckout({+ out_trade_no: order.out_trade_no,+ sku_id: order.sku_id || sku.id,+ sku_name: label,+ pay_type: order.pay_type,+ amount_fen: order.amount_fen,+ credit_fen: order.credit_fen,+ qr_payload: order.qr_payload || order.qrcode || order.payurl || order.img || '',+ img: order.img,+ expire_seconds: order.expire_seconds ?? 300,+ })+ } catch (e) {+ setError(e instanceof Error ? e.message : '下单失败')+ } finally {+ setBusy(null)+ }+ }++ function closeCheckout() {+ setCheckout(null)+ }++ async function onPaid() {+ setHint('支付成功,余额已更新')+ setCheckout(null)+ await refresh()+ }++ const balanceYuan = wallet?.balance_yuan ?? 0+ const frozenYuan = wallet?.frozen_yuan ?? 0+return (<AppShell active="pricing">- <div className="pf-pricing">- <h1 style={{ margin: 0, fontSize: '2rem' }}>定价</h1>- <p className="pf-muted">套餐与额度体系规划中,当前创作额度不限。</p>- <div className="pf-card">- <ComingSoon label="定价方案即将推出" />- <h2 style={{ margin: '1rem 0 0.5rem' }}>Free · 体验版</h2>- <p className="pf-muted">免费使用基础模板与预览分辨率生成。</p>- <ul style={{ textAlign: 'left', color: 'var(--pf-muted)', lineHeight: 1.8 }}>- <li>知识科普模板</li>- <li>分镜 / 配图 / 配音流水线</li>- <li>成片下载(预览画质)</li>- <li>- 高清导出、团队空间、平台一键分发 <ComingSoon />- </li>- </ul>- </div>+ <div className="pf-pricing-page">+ <section className="pf-pricing-hero">+ <div className="pf-pricing-hero-copy">+ <span className="pf-pricing-pill">简单透明 · 按量计费</span>+ <h1>按需充值,用多少算多少</h1>+ <p>按上游模型 token 实际用量计费,余额永久有效,无订阅、无隐藏费用。</p>+ </div>++ <div className="pf-pricing-balance-card">+ <div className="pf-pricing-balance-main">+ <span className="pf-pricing-balance-label">可用余额</span>+ <strong>¥{balanceYuan.toFixed(2)}</strong>+ </div>+ <div className="pf-pricing-balance-side">+ <span className="pf-pricing-balance-label">冻结中</span>+ <em>¥{frozenYuan.toFixed(2)}</em>+ </div>+ <div className="pf-pricing-balance-side">+ <span className="pf-pricing-balance-label">当前套餐</span>+ <em>{planLabel(wallet)}</em>+ </div>+ <button+ type="button"+ className="pf-pricing-history-btn"+ disabled={!loggedIn}+ title={loggedIn ? '查看充值记录' : '请先登录'}+ onClick={() => setHistoryOpen(true)}+ >+ 充值记录+ </button>+ </div>+ </section>++ {hint ? <p className="pf-pricing-hint">{hint}</p> : null}+ {error ? <p className="pf-error pf-pricing-error">{error}</p> : null}++ <section className="pf-pricing-skus">+ <header className="pf-pricing-section-head">+ <h2>选择充值金额</h2>+ <p>充值即时到账,赠送金额自动计入余额</p>+ </header>++ <div className="pf-pricing-sku-grid">+ {displaySkus.map((sku) => {+ const bonus = sku.credit_fen - sku.amount_fen+ const recommended = Boolean(sku.recommended)+ return (+ <article+ key={sku.id}+ className={`pf-pricing-sku-card${recommended ? ' is-recommended' : ''}`}+ >+ {recommended ? <span className="pf-pricing-rec-badge">推荐</span> : null}+ <h3>{SKU_LABELS[sku.id] || sku.name}</h3>+ <div className="pf-pricing-sku-price">+ <span className="yen">¥</span>+ <strong>{(sku.amount_fen / 100).toFixed(0)}</strong>+ </div>+ <p className="pf-pricing-sku-credit">到账 ¥{yuan(sku.credit_fen)}</p>+ {bonus > 0 ? (+ <p className="pf-pricing-sku-bonus">额外赠送 ¥{yuanShort(bonus)}</p>+ ) : (+ <p className="pf-pricing-sku-bonus is-empty"> </p>+ )}+ <button+ type="button"+ className={`pf-pricing-sku-cta${recommended ? ' is-primary' : ''}`}+ disabled={Boolean(busy)}+ onClick={() => pay(sku)}+ >+ {busy === sku.id ? '下单中…' : '立即充值'}+ </button>+ </article>+ )+ })}+ </div>+ </section>++ <section className="pf-pricing-paybar">+ <div className="pf-pricing-pay-left">+ <span className="pf-pricing-pay-label">支付方式</span>+ <button+ type="button"+ className={`pf-pricing-pay-opt${payType === 'alipay' ? ' is-active' : ''}`}+ onClick={() => setPayType('alipay')}+ >+ <span className="pf-pay-logo alipay" aria-hidden />+ 支付宝+ {payType === 'alipay' ? <span className="pf-pay-check" aria-hidden>✓</span> : null}+ </button>+ <button+ type="button"+ className={`pf-pricing-pay-opt${payType === 'wxpay' ? ' is-active' : ''}`}+ onClick={() => setPayType('wxpay')}+ >+ <span className="pf-pay-logo wxpay" aria-hidden />+ 微信支付+ {payType === 'wxpay' ? <span className="pf-pay-check" aria-hidden>✓</span> : null}+ </button>+ </div>+ <div className="pf-pricing-pay-secure">+ <span className="pf-pay-shield" aria-hidden />+ 支付安全保障+ </div>+ </section>++ <section className="pf-pricing-info">+ <div>+ <h3>计费说明</h3>+ <ul>+ <li>拆分镜、出图、配音、AI 视频分别按上游 token 用量计费</li>+ <li>开始生成时预扣估算金额,结束后按实际用量结算(多退少补)</li>+ <li>图文模式成本更低;开启 AI 动态视频时消耗更高</li>+ </ul>+ </div>+ <div>+ <h3>为什么按量计费</h3>+ <ul className="pf-pricing-checks">+ <li>无需订阅,用多少充多少</li>+ <li>余额永久有效,不设过期</li>+ <li>账单清晰可查,每次调用可追溯</li>+ </ul>+ </div>+ </section>++ <p className="pf-pricing-foot">+ <Link to="/">PRINTFILM</Link>+ <span> · AI 知识视频创作伙伴</span>+ </p></div>++ <PaymentModal+ open={Boolean(checkout)}+ checkout={checkout}+ onClose={closeCheckout}+ onPaid={() => void onPaid()}+ />+ <TopupHistoryModal open={historyOpen} onClose={() => setHistoryOpen(false)} /></AppShell>)}diff --git a/frontend/src/pages/studio/StoryboardPage.tsx b/frontend/src/pages/studio/StoryboardPage.tsxindex e22ff15..456eb90 100644--- a/frontend/src/pages/studio/StoryboardPage.tsx+++ b/frontend/src/pages/studio/StoryboardPage.tsx@@ -18,6 +18,7 @@ import {} from '../../components/ui/Icons'import { scenePromptForDisplay } from '../../promptDisplay'import { dialog } from '../../lib/dialog'+import { handleBillingError } from '../../lib/billingError'import {BOARD_STEPS,effectiveStatus,@@ -28,6 +29,40 @@ import {statusLabel,} from '../../lib/status'+type SegmentBeatView = { duration: number; text: string; isCue?: boolean }++function parseSegmentScript(script: string | undefined | null): {+ cues: string[]+ beats: SegmentBeatView[]+} {+ const cues: string[] = []+ const beats: SegmentBeatView[] = []+ const lines = String(script || '')+ .replace(/\r\n/g, '\n')+ .split('\n')+ .map((l) => l.trim())+ .filter(Boolean)+ let pendingDur = 0+ for (const line of lines) {+ if (line.startsWith('【字幕') || line.startsWith('【BGM')) {+ cues.push(line)+ continue+ }+ const m = line.match(/^@duration:(\d+)/)+ if (m) {+ pendingDur = Number(m[1]) || 0+ continue+ }+ if (pendingDur > 0 || beats.length === 0) {+ beats.push({ duration: pendingDur || 0, text: line })+ pendingDur = 0+ } else {+ beats.push({ duration: 0, text: line })+ }+ }+ return { cues, beats }+}+function csvEscape(value: string | number | null | undefined) {const s = String(value ?? '')if (/[",\n\r]/.test(s)) return `"${s.replace(/"/g, '""')}"`@@ -288,7 +323,9 @@ export default function StoryboardPage() {try {setProject(await api.generate(project.id))} catch (err) {- setError(err instanceof Error ? err.message : '继续生成失败')+ const msg = err instanceof Error ? err.message : '继续生成失败'+ setError(msg)+ await handleBillingError(err, nav)} finally {setBusy(false)}@@ -309,7 +346,9 @@ export default function StoryboardPage() {try {setProject(await api.generate(project.id, { restart: true }))} catch (err) {- setError(err instanceof Error ? err.message : '重做失败')+ const msg = err instanceof Error ? err.message : '重做失败'+ setError(msg)+ await handleBillingError(err, nav)} finally {setBusy(false)}@@ -494,6 +533,7 @@ export default function StoryboardPage() {overlay_subtitle: editing.overlay_subtitle,img_prompt: editing.img_prompt,video_prompt: editing.video_prompt,+ segment_script: editing.segment_script,duration: Number(editing.duration) || 4,camera: editing.camera,})@@ -870,7 +910,7 @@ export default function StoryboardPage() {<th>场景</th><th>画面</th><th>旁白/台词</th>- <th>画面描述</th>+ <th>逐段分镜</th><th>时长</th><th>状态</th><th>操作</th>@@ -886,6 +926,8 @@ export default function StoryboardPage() {const sceneTitle =shot.overlay_title?.trim() || `场景 ${String(shot.shot_no).padStart(2, '0')}`const narration = (shot.narration || '').trim()+ const script = shot.segment_script || shot.video_prompt || ''+ const { cues, beats } = parseSegmentScript(script)const desc = scenePromptForDisplay(shot.img_prompt).trim()return (<tr key={shot.id}>@@ -935,10 +977,50 @@ export default function StoryboardPage() {type="button"className="pf-shot-desc pf-shot-editable"disabled={busy || running}- title="点击查看/修改画面提示词"- onClick={() => openShotEdit(shot, 'img_prompt')}+ title="点击编辑逐段分镜脚本"+ onClick={() => openShotEdit(shot, 'segment_script')}+ style={{ textAlign: 'left', width: '100%' }}>- {desc || '(点击填写画面提示词)'}+ {cues.length > 0 ? (+ <span className="pf-muted" style={{ display: 'block', fontSize: '0.75rem' }}>+ {cues[0]?.replace(/^【|】$/g, '').slice(0, 28)}+ {cues[1]+ ? ` · ${cues[1].replace(/^【BGM:|】$/g, '').slice(0, 16)}`+ : ''}+ </span>+ ) : null}+ {beats.length > 0 ? (+ <div style={{ display: 'flex', flexDirection: 'column', gap: 4, marginTop: 4 }}>+ {beats.slice(0, 4).map((b, i) => (+ <span key={i} style={{ display: 'flex', gap: 6, alignItems: 'flex-start' }}>+ {b.duration > 0 ? (+ <span+ style={{+ flex: '0 0 auto',+ fontSize: '0.72rem',+ background: '#111',+ color: '#fff',+ borderRadius: 4,+ padding: '1px 5px',+ }}+ >+ {b.duration}s+ </span>+ ) : null}+ <span style={{ fontSize: '0.82rem' }}>+ {b.text.length > 42 ? `${b.text.slice(0, 42)}…` : b.text}+ </span>+ </span>+ ))}+ {beats.length > 4 ? (+ <span className="pf-muted" style={{ fontSize: '0.75rem' }}>+ 另有 {beats.length - 4} 段…+ </span>+ ) : null}+ </div>+ ) : (+ desc || '(点击填写逐段分镜)'+ )}</button></td><td className="col-dur">{formatMmSs(shot.duration)}</td>@@ -1208,38 +1290,48 @@ export default function StoryboardPage() {/></label><label>- 画面提示词+ 画面提示词(首帧)<textarea- autoFocus={editFocus === 'img_prompt' || editFocus === ''}+ autoFocus={editFocus === 'img_prompt'}value={editing.img_prompt}onChange={(e) => setEditing({ ...editing, img_prompt: e.target.value })}- rows={4}+ rows={3}/></label><label>- 视频提示词+ 逐段分镜脚本(@duration + 字幕/BGM)<textarea- value={editing.video_prompt || ''}- onChange={(e) => setEditing({ ...editing, video_prompt: e.target.value })}- rows={2}+ autoFocus={editFocus === 'segment_script' || editFocus === ''}+ value={editing.segment_script || editing.video_prompt || ''}+ onChange={(e) =>+ setEditing({+ ...editing,+ segment_script: e.target.value,+ video_prompt: e.target.value,+ })+ }+ rows={10}+ placeholder={+ '【字幕:全程简体中文字幕,旁白逐句同步烧录】\n【BGM:轻快专业,音量低于人声】\n@duration:4\n过肩工位操作画面…\n@duration:8\n【旁白·慢速清晰·同步字幕】口播内容…'+ }+ />+ </label>+ <label>+ 运镜备注+ <input+ value={editing.camera || ''}+ onChange={(e) => setEditing({ ...editing, camera: e.target.value })}/></label><div className="pf-prompt-modal-row"><label>- 时长(秒)+ 时长(秒,保存脚本后会按 @duration 重算)<inputtype="number"value={editing.duration}onChange={(e) => setEditing({ ...editing, duration: Number(e.target.value) })}/></label>- <label>- 运镜- <input- value={editing.camera || ''}- onChange={(e) => setEditing({ ...editing, camera: e.target.value })}- />- </label></div><div style={{ display: 'flex', gap: '0.5rem' }}><button type="button" className="pf-btn pf-btn-lime" disabled={busy} onClick={saveShot}>diff --git a/frontend/src/pages/studio/StyleConfigPage.tsx b/frontend/src/pages/studio/StyleConfigPage.tsxindex 9d00f4c..5e91d4d 100644--- a/frontend/src/pages/studio/StyleConfigPage.tsx+++ b/frontend/src/pages/studio/StyleConfigPage.tsx@@ -6,6 +6,7 @@ import AppShell from '../../components/layout/AppShell'import Stepper from '../../components/ui/Stepper'import ComingSoon from '../../components/ui/ComingSoon'import { IconChevronLeft, IconPlay } from '../../components/ui/Icons'+import { handleBillingError } from '../../lib/billingError'import { CREATE_STEPS } from '../../lib/status'const CHAR_PRESETS = [@@ -226,7 +227,9 @@ export default function StyleConfigPage() {const started = await api.generate(project.id)nav(`/studio/${started.id}`)} catch (err) {- setError(err instanceof Error ? err.message : '生成失败')+ const msg = err instanceof Error ? err.message : '生成失败'+ setError(msg)+ await handleBillingError(err, nav)} finally {setBusy(false)}@@ -485,7 +488,6 @@ export default function StyleConfigPage() {))}</div></div>- {error ? <p className="pf-error">{error}</p> : null}</section><aside className="pf-create-col">@@ -537,6 +539,7 @@ export default function StyleConfigPage() {: `试听「${selectedVoice.label}」`}</button>) : null}+ {error ? <p className="pf-error" style={{ marginTop: '0.75rem' }}>{error}</p> : null}<buttontype="button"className="pf-btn pf-btn-lime pf-btn-block pf-btn-lg pf-btn-icon"diff --git a/frontend/src/styles/printfilm.css b/frontend/src/styles/printfilm.cssindex 2b7ec36..4580ac3 100644--- a/frontend/src/styles/printfilm.css+++ b/frontend/src/styles/printfilm.css@@ -2116,11 +2116,28 @@ button.pf-shot-editable:disabled {.pf-usage-row {display: flex;justify-content: space-between;- align-items: center;- font-size: 0.85rem;+ align-items: baseline;+ gap: 0.75rem;+ font-size: 0.88rem;margin-bottom: 0.25rem;}+.pf-usage-val {+ font-weight: 700;+ letter-spacing: -0.02em;+}++.pf-usage-foot {+ display: flex;+ justify-content: space-between;+ align-items: center;+ gap: 0.75rem;+ margin-top: 0.35rem;+ padding-top: 0.75rem;+ border-top: 1px solid var(--pf-line);+ font-size: 0.82rem;+}+.pf-meter {height: 8px;background: #eceff3;@@ -2135,15 +2152,769 @@ button.pf-shot-editable:disabled {background: var(--pf-lime);}-.pf-pricing {- max-width: 720px;- margin: 3rem auto;- text-align: center;+.pf-topup-list {+ list-style: none;+ margin: 0;+ padding: 0;+ display: flex;+ flex-direction: column;+ gap: 0.65rem;+ max-height: min(60vh, 480px);+ overflow: auto;+}++.pf-topup-item {+ display: flex;+ justify-content: space-between;+ gap: 1rem;+ align-items: center;+ padding: 0.85rem 1rem;+ border: 1px solid var(--pf-line);+ border-radius: 12px;+ background: #fff;+}++.pf-topup-main {+ display: flex;+ flex-direction: column;+ gap: 0.2rem;+ text-align: left;+}++.pf-topup-main strong {+ font-size: 0.95rem;+}++.pf-topup-meta {+ display: flex;+ flex-direction: column;+ align-items: flex-end;+ gap: 0.15rem;+ font-size: 0.82rem;+}++.pf-topup-meta em {+ font-style: normal;+ font-size: 1.05rem;+ font-weight: 800;+}++.pf-topup-status {+ font-weight: 600;+}++.pf-topup-status.is-paid {+ color: #3d4a12;+}++.pf-topup-status.is-pending {+ color: #8a6d1d;+}++.pf-topup-status.is-closed {+ color: var(--pf-muted);+}++/* —— Pricing / top-up page —— */+.pf-pricing-page {+ width: min(1080px, 100%);+ margin: 0 auto;+ padding: 1.75rem 0 3rem;+}++.pf-pricing-hero {+ display: grid;+ grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);+ gap: 1.5rem;+ align-items: stretch;+ margin-bottom: 2rem;+}++.pf-pricing-hero-copy {+ text-align: left;+ padding-top: 0.35rem;+}++.pf-pricing-pill {+ display: inline-flex;+ align-items: center;+ padding: 0.28rem 0.7rem;+ border-radius: 999px;+ background: color-mix(in srgb, var(--pf-lime) 28%, #fff);+ color: #3d4a12;+ font-size: 0.78rem;+ font-weight: 600;+ letter-spacing: 0.02em;+}++.pf-pricing-hero-copy h1 {+ margin: 0.85rem 0 0.55rem;+ font-size: clamp(1.85rem, 3.2vw, 2.35rem);+ line-height: 1.2;+ letter-spacing: -0.02em;+ font-weight: 800;+}++.pf-pricing-hero-copy p {+ margin: 0;+ max-width: 34rem;+ color: var(--pf-muted);+ font-size: 0.95rem;+ line-height: 1.7;+}++.pf-pricing-balance-card {+ display: grid;+ grid-template-columns: 1.35fr 0.85fr 0.85fr auto;+ gap: 1rem;+ align-items: center;+ background: var(--pf-card);+ border: 1px solid var(--pf-line);+ border-radius: 16px;+ box-shadow: var(--pf-shadow);+ padding: 1.15rem 1.2rem;+}++.pf-pricing-balance-main {+ position: relative;+ padding-left: 0.85rem;+}++.pf-pricing-balance-main::before {+ content: '';+ position: absolute;+ left: 0;+ top: 0.15rem;+ bottom: 0.15rem;+ width: 4px;+ border-radius: 999px;+ background: var(--pf-lime);+}++.pf-pricing-balance-label {+ display: block;+ color: var(--pf-muted);+ font-size: 0.78rem;+ margin-bottom: 0.25rem;+}++.pf-pricing-balance-main strong {+ font-size: 1.85rem;+ font-weight: 800;+ letter-spacing: -0.03em;+ line-height: 1.1;+}++.pf-pricing-balance-side em {+ font-style: normal;+ font-size: 1.05rem;+ font-weight: 700;+}++.pf-pricing-history-btn {+ appearance: none;+ border: 1px solid var(--pf-line);+ background: #fff;+ color: var(--pf-ink);+ border-radius: 999px;+ padding: 0.45rem 0.9rem;+ font-size: 0.82rem;+ font-weight: 600;+ cursor: pointer;+ white-space: nowrap;+}++.pf-pricing-history-btn:hover:not(:disabled) {+ background: #f4f5f7;+}++.pf-pricing-history-btn:disabled {+ cursor: not-allowed;+ opacity: 0.55;+}++.pf-pricing-hint,+.pf-pricing-error {+ text-align: left;+ margin: -0.5rem 0 1.25rem;+}++.pf-pricing-section-head {+ text-align: left;+ margin-bottom: 1rem;+}++.pf-pricing-section-head h2 {+ margin: 0 0 0.35rem;+ font-size: 1.25rem;+ font-weight: 800;+}++.pf-pricing-section-head p {+ margin: 0;+ color: var(--pf-muted);+ font-size: 0.9rem;+}++.pf-pricing-sku-grid {+ display: grid;+ grid-template-columns: repeat(4, minmax(0, 1fr));+ gap: 0.9rem;+}++.pf-pricing-sku-card {+ position: relative;+ text-align: left;+ background: var(--pf-card);+ border: 1px solid var(--pf-line);+ border-radius: 16px;+ padding: 1.25rem 1.1rem 1.15rem;+ box-shadow: 0 6px 20px rgba(17, 19, 24, 0.04);+ display: flex;+ flex-direction: column;+ min-height: 250px;+}++.pf-pricing-sku-card.is-recommended {+ border-color: var(--pf-lime);+ box-shadow: 0 10px 28px color-mix(in srgb, var(--pf-lime) 28%, transparent);+}++.pf-pricing-rec-badge {+ position: absolute;+ top: 0.75rem;+ right: 0.75rem;+ background: var(--pf-lime);+ color: var(--pf-ink);+ font-size: 0.72rem;+ font-weight: 800;+ padding: 0.18rem 0.45rem;+ border-radius: 999px;+}++.pf-pricing-sku-card h3 {+ margin: 0 0 0.85rem;+ font-size: 0.95rem;+ font-weight: 700;+}++.pf-pricing-sku-price {+ display: flex;+ align-items: baseline;+ gap: 0.1rem;+ margin-bottom: 0.35rem;+}++.pf-pricing-sku-price .yen {+ font-size: 1.1rem;+ font-weight: 700;+}++.pf-pricing-sku-price strong {+ font-size: 2.35rem;+ font-weight: 800;+ letter-spacing: -0.04em;+ line-height: 1;+}++.pf-pricing-sku-credit {+ margin: 0;+ color: var(--pf-muted);+ font-size: 0.88rem;+}++.pf-pricing-sku-bonus {+ margin: 0.35rem 0 0;+ color: #5f7a12;+ font-size: 0.82rem;+ font-weight: 600;+ min-height: 1.2em;+}++.pf-pricing-sku-bonus.is-empty {+ visibility: hidden;+}++.pf-pricing-sku-cta {+ margin-top: auto;+ width: 100%;+ appearance: none;+ border: 1.5px solid var(--pf-ink);+ background: #fff;+ color: var(--pf-ink);+ border-radius: 999px;+ padding: 0.65rem 1rem;+ font-size: 0.92rem;+ font-weight: 700;+ cursor: pointer;+ transition: background 0.15s ease, border-color 0.15s ease;+}++.pf-pricing-sku-cta:hover:not(:disabled) {+ background: #f4f5f7;+}++.pf-pricing-sku-cta.is-primary {+ background: var(--pf-lime);+ border-color: var(--pf-lime);+}++.pf-pricing-sku-cta.is-primary:hover:not(:disabled) {+ filter: brightness(0.97);+}++.pf-pricing-sku-cta:disabled {+ opacity: 0.65;+ cursor: wait;+}++.pf-pricing-paybar {+ margin-top: 1.35rem;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1rem;+ flex-wrap: wrap;+ background: #eef0f3;+ border: none;+ border-radius: 14px;+ padding: 0.85rem 1.1rem;+}++.pf-pricing-pay-left {+ display: flex;+ align-items: center;+ gap: 0.65rem;+ flex-wrap: wrap;+}++.pf-pricing-pay-label {+ color: var(--pf-muted);+ font-size: 0.88rem;+ font-weight: 600;+ margin-right: 0.25rem;}-.pf-pricing .pf-card {- padding: 2rem;- margin-top: 1.5rem;+.pf-pricing-pay-opt {+ appearance: none;+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ border: 1px solid var(--pf-line);+ background: #fff;+ color: var(--pf-ink);+ border-radius: 999px;+ padding: 0.45rem 0.85rem;+ font-size: 0.88rem;+ font-weight: 600;+ cursor: pointer;+}++.pf-pricing-pay-opt.is-active {+ background: var(--pf-ink);+ border-color: var(--pf-ink);+ color: #fff;+}++.pf-pay-logo {+ width: 1.05rem;+ height: 1.05rem;+ border-radius: 0.25rem;+ display: inline-block;+ background: center / contain no-repeat;+}++.pf-pay-logo.alipay {+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='4' fill='%231677FF'/%3E%3Cpath fill='%23fff' d='M5.2 14.2c1.7 1.1 3.8 2 6.2 2.4.4-1 .8-2.2 1.1-3.4H8.2V11h5.1c.1-.5.2-1 .2-1.4H8.2V8h6.8v1.1c0 .6-.1 1.4-.3 2.2H18v1.5h-2.7c-.3 1.2-.7 2.4-1.2 3.5 2.1-.1 4-.7 5.5-1.5v1.8c-1.9 1.1-4.3 1.8-7 1.8-3.4 0-6.4-1.1-8.4-2.6l1-.6z'/%3E%3C/svg%3E");+}++.pf-pay-logo.wxpay {+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='4' fill='%2307C160'/%3E%3Cpath fill='%23fff' d='M9.4 7.2c-2.9 0-5.2 1.9-5.2 4.2 0 1.3.7 2.5 1.9 3.3l-.5 1.5 1.7-.9c.6.2 1.2.3 1.9.3.2 0 .4 0 .6-.1-.3-.5-.4-1.1-.4-1.7 0-2.3 2.2-4.2 4.9-4.2.2 0 .5 0 .7.1C14.3 8.4 12 7.2 9.4 7.2zm-2 2.5a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4zm3.4 0a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4zm4.1.8c-2.4 0-4.3 1.6-4.3 3.6 0 .7.3 1.4.7 1.9l-.4 1.2 1.4-.7c.5.2 1 .3 1.5.3 2.4 0 4.3-1.6 4.3-3.6s-1.9-2.7-4.3-2.7zm-1.5 2a.55.55 0 1 1 0 1.1.55.55 0 0 1 0-1.1zm2.9 0a.55.55 0 1 1 0 1.1.55.55 0 0 1 0-1.1z'/%3E%3C/svg%3E");+}++.pf-pay-check {+ display: inline-grid;+ place-items: center;+ width: 1rem;+ height: 1rem;+ border-radius: 50%;+ background: #fff;+ color: var(--pf-ink);+ font-size: 0.65rem;+ font-weight: 800;+ line-height: 1;+}++.pf-pricing-pay-secure {+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ color: var(--pf-muted);+ font-size: 0.86rem;+ font-weight: 600;+}++.pf-pay-shield {+ width: 0.95rem;+ height: 0.95rem;+ background: center / contain no-repeat+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111318' stroke-width='2'%3E%3Cpath d='M12 3l7 3v5c0 5-3.5 8.5-7 10-3.5-1.5-7-5-7-10V6l7-3z'/%3E%3Cpath d='M9.5 12.2l1.8 1.8 3.4-3.6'/%3E%3C/svg%3E");+}++.pf-pricing-info {+ margin-top: 1.35rem;+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 2rem;+ background: #eef0f3;+ border-radius: 16px;+ padding: 1.35rem 1.5rem;+ text-align: left;+}++.pf-pricing-info h3 {+ margin: 0 0 0.7rem;+ font-size: 1rem;+ font-weight: 800;+}++.pf-pricing-info ul {+ margin: 0;+ padding-left: 1.1rem;+ color: var(--pf-muted);+ line-height: 1.85;+ font-size: 0.9rem;+}++.pf-pricing-checks {+ list-style: none;+ padding-left: 0 !important;+}++.pf-pricing-checks li {+ position: relative;+ padding-left: 1.35rem;+}++.pf-pricing-checks li::before {+ content: '';+ position: absolute;+ left: 0;+ top: 0.45rem;+ width: 0.85rem;+ height: 0.85rem;+ border-radius: 50%;+ background: var(--pf-lime)+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23111318' d='M6.4 11.2 3.2 8l1.1-1.1 2.1 2.1 5-5L12.5 5z'/%3E%3C/svg%3E")+ center / 0.7rem no-repeat;+}++.pf-pricing-foot {+ margin: 2rem 0 0;+ text-align: center;+ color: var(--pf-muted);+ font-size: 0.85rem;+}++.pf-pricing-foot a {+ color: inherit;+ text-decoration: none;+ font-weight: 700;+}++@media (max-width: 960px) {+ .pf-pricing-hero {+ grid-template-columns: 1fr;+ }++ .pf-pricing-balance-card {+ grid-template-columns: 1fr 1fr;+ }++ .pf-pricing-history-btn {+ grid-column: 1 / -1;+ justify-self: start;+ }++ .pf-pricing-sku-grid {+ grid-template-columns: repeat(2, minmax(0, 1fr));+ }+}++@media (max-width: 640px) {+ .pf-pricing-sku-grid,+ .pf-pricing-info {+ grid-template-columns: 1fr;+ }++ .pf-pricing-balance-card {+ grid-template-columns: 1fr;+ }+}++/* —— Payment QR modal —— */+.pf-modal-panel.pf-pay-modal {+ width: min(400px, 94vw);+ background: #fff;+ border-radius: 16px;+ padding: 0;+}++.pf-pay-modal .pf-modal-body {+ padding: 0;+ overflow: visible;+}++.pf-pay-sheet {+ padding: 1.15rem 1.25rem 1.1rem;+ text-align: center;+}++.pf-pay-sheet-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ margin-bottom: 1rem;+}++.pf-pay-sheet-title {+ display: inline-flex;+ align-items: center;+ gap: 0.45rem;+ font-size: 0.98rem;+}++.pf-pay-sheet-title strong {+ font-weight: 700;+}++.pf-pay-sheet-close {+ appearance: none;+ border: none;+ background: transparent;+ color: #8b9099;+ font-size: 1.45rem;+ line-height: 1;+ cursor: pointer;+ padding: 0.1rem 0.35rem;+}++.pf-pay-sheet-close:hover {+ color: var(--pf-ink);+}++.pf-pay-sku-box {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ gap: 0.75rem;+ background: #f3f4f6;+ border-radius: 12px;+ padding: 0.85rem 1rem;+ text-align: left;+ margin-bottom: 1.1rem;+}++.pf-pay-sku-box strong {+ font-size: 0.95rem;+ font-weight: 700;+}++.pf-pay-sku-box span {+ color: var(--pf-muted);+ font-size: 0.88rem;+ white-space: nowrap;+}++.pf-pay-amount {+ margin-bottom: 1rem;+}++.pf-pay-amount span {+ display: block;+ color: var(--pf-muted);+ font-size: 0.82rem;+ margin-bottom: 0.25rem;+}++.pf-pay-amount em {+ font-style: normal;+ font-size: 2rem;+ font-weight: 800;+ letter-spacing: -0.03em;+}++.pf-pay-qr-wrap {+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 0.55rem;+ margin-bottom: 1.1rem;+}++.pf-pay-qr {+ position: relative;+ width: 220px;+ height: 220px;+ display: grid;+ place-items: center;+ background: #fff;+ border: 1px solid var(--pf-line);+ border-radius: 12px;+ overflow: hidden;+}++.pf-pay-qr img {+ display: block;+ width: 220px;+ height: 220px;+}++.pf-pay-qr.is-empty {+ color: var(--pf-muted);+ font-size: 0.88rem;+}++.pf-pay-qr-badge {+ position: absolute;+ left: 50%;+ top: 50%;+ width: 2rem;+ height: 2rem;+ transform: translate(-50%, -50%);+ border-radius: 0.4rem;+ box-shadow: 0 0 0 3px #fff;+ background: center / contain no-repeat;+}++.pf-pay-qr-badge.alipay {+ background-color: #1677ff;+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M5.2 14.2c1.7 1.1 3.8 2 6.2 2.4.4-1 .8-2.2 1.1-3.4H8.2V11h5.1c.1-.5.2-1 .2-1.4H8.2V8h6.8v1.1c0 .6-.1 1.4-.3 2.2H18v1.5h-2.7c-.3 1.2-.7 2.4-1.2 3.5 2.1-.1 4-.7 5.5-1.5v1.8c-1.9 1.1-4.3 1.8-7 1.8-3.4 0-6.4-1.1-8.4-2.6l1-.6z'/%3E%3C/svg%3E");+}++.pf-pay-qr-badge.wxpay {+ background-color: #07c160;+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9.4 7.2c-2.9 0-5.2 1.9-5.2 4.2 0 1.3.7 2.5 1.9 3.3l-.5 1.5 1.7-.9c.6.2 1.2.3 1.9.3.2 0 .4 0 .6-.1-.3-.5-.4-1.1-.4-1.7 0-2.3 2.2-4.2 4.9-4.2.2 0 .5 0 .7.1C14.3 8.4 12 7.2 9.4 7.2zm-2 2.5a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4zm3.4 0a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4zm4.1.8c-2.4 0-4.3 1.6-4.3 3.6 0 .7.3 1.4.7 1.9l-.4 1.2 1.4-.7c.5.2 1 .3 1.5.3 2.4 0 4.3-1.6 4.3-3.6s-1.9-2.7-4.3-2.7zm-1.5 2a.55.55 0 1 1 0 1.1.55.55 0 0 1 0-1.1zm2.9 0a.55.55 0 1 1 0 1.1.55.55 0 0 1 0-1.1z'/%3E%3C/svg%3E");+}++.pf-pay-tip {+ margin: 0.15rem 0 0;+ font-size: 0.9rem;+ font-weight: 600;+}++.pf-pay-expire {+ margin: 0;+ display: inline-flex;+ align-items: center;+ gap: 0.35rem;+ color: var(--pf-muted);+ font-size: 0.82rem;+}++.pf-pay-expire.is-expired {+ color: #c43c2e;+}++.pf-pay-clock {+ width: 0.9rem;+ height: 0.9rem;+ background: center / contain no-repeat+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9099' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");+}++.pf-pay-wait {+ margin: 0.15rem 0 0;+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ color: var(--pf-muted);+ font-size: 0.84rem;+}++.pf-pay-wait.is-paid {+ color: #3d4a12;+}++.pf-pay-dot {+ width: 0.55rem;+ height: 0.55rem;+ border-radius: 50%;+ background: var(--pf-lime);+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--pf-lime) 55%, transparent);+ animation: pf-pay-pulse 1.4s ease-out infinite;+}++.pf-pay-wait.is-paid .pf-pay-dot {+ animation: none;+}++@keyframes pf-pay-pulse {+ 0% {+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--pf-lime) 55%, transparent);+ }+ 70% {+ box-shadow: 0 0 0 8px transparent;+ }+ 100% {+ box-shadow: 0 0 0 0 transparent;+ }+}++.pf-pay-error {+ margin: 0 0 0.75rem;+ font-size: 0.85rem;+}++.pf-pay-actions {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 0.65rem;+ margin-bottom: 0.85rem;+}++.pf-pay-btn {+ appearance: none;+ border-radius: 999px;+ padding: 0.7rem 1rem;+ font-size: 0.92rem;+ font-weight: 700;+ cursor: pointer;+}++.pf-pay-btn.ghost {+ border: 1px solid var(--pf-line);+ background: #fff;+ color: var(--pf-ink);+}++.pf-pay-btn.ghost:hover {+ background: #f4f5f7;+}++.pf-pay-btn.primary {+ border: 1px solid var(--pf-lime);+ background: var(--pf-lime);+ color: var(--pf-ink);+}++.pf-pay-btn.primary:hover:not(:disabled) {+ filter: brightness(0.97);+}++.pf-pay-btn:disabled {+ opacity: 0.65;+ cursor: not-allowed;+}++.pf-pay-secure-line {+ margin: 0;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.35rem;+ color: var(--pf-muted);+ font-size: 0.76rem;}/* —— Global dialog / modal system —— */