Compare commits

...

16 Commits

Author SHA1 Message Date
puro ci
829f101100 docs: tick local acceptance items [CI SKIP]
Some checks failed
CI / test (pull_request) Has been cancelled
CI / golangci-lint (pull_request) Has been cancelled
Security Scan / backend-security (pull_request) Has been cancelled
Security Scan / frontend-security (pull_request) Has been cancelled
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled
11/12 checklist items verified via pnpm build + preview + curl.
Remaining: CI deploy + prod verification (Task 13).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:56:50 +08:00
mini
0fceb100e0 chore(i18n): consolidate PURO auth heading keys into zh.ts
Login and Register heading strings moved from hardcoded Chinese to
auth.puroLoginTitle / puroLoginSub / puroRegisterTitle / puroRegisterSub.

Landing (LandingView) and Docs (DocsView) intentionally keep hardcoded
Chinese this cycle (see spec §6 note 5 — English version deferred).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:54:49 +08:00
mini
7dc8062988 feat(docs): public DocsView with Codex/Claude Code/curl quickstart
Route /docs (no auth). Six sections: get key, codex CLI, claude code,
curl, supported models, feedback. Uses puro.css design system.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:42:08 +08:00
mini
f17a88c171 feat(auth): RegisterView with PURO narrative split layout
Same split layout as LoginView: left narrative, right form.
Heading: '创建账户' + '5 分钟开始用 PURO AI'.
All form logic preserved (OAuth, Turnstile, email verify code, password fields).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:29:08 +08:00
mini
91b9ae7e21 feat(auth): LoginView with PURO narrative split layout
- Left: ⬢ PURO AI brand + '5→1' headline + three-line value props
- Right: existing form (OAuth, Turnstile, 2FA all preserved unchanged)
- Heading changed from t('auth.welcomeBack') to '登录' — i18n key consolidation in Task 11

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:27:23 +08:00
mini
9ee99d17fd refactor(auth): AuthLayout supports optional narrative slot
New slot 'narrative' enables split-screen layout (50/50 desktop, collapses
to single column on mobile <900px).

Backward compatibility:
- Pages that don't pass a narrative slot still render the original
  centered-card layout with siteName + logo + copyright
- ForgotPassword, ResetPassword, EmailVerify unaffected

To be used in Tasks 8 and 9 (LoginView, RegisterView).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:25:01 +08:00
mini
284b5129ac feat(router): mount Landing at / with auth-aware redirect
- / (anonymous) → LandingView
- / (authenticated) → redirects to /dashboard via new meta.redirectIfAuth
- Remove temporary /landing-preview route (Task 2 helper)
- RouteMeta TS augmentation for redirectIfAuth
- LandingView brand link uses router-link (was <a href>, causing SPA reload)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:14:12 +08:00
mini
4832534232 fix(landing): Polish items from code review
- Add noreferrer to all external rel attributes (4 anchors)
- Change 更新日志 link from /releases (may 404) to /commits/branch/main
- Remove dead CSS overridden by puro.css: .nav z-index:10, .nav-links gap:20px
- Document puro.css global dependency at top of scoped style block

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:11:13 +08:00
mini
4e675d70c1 feat(landing): Footer + sticky Nav styles
- 4-column footer (brand/产品/资源/联系), responsive 2-col on mobile
- Nav sticky with blur background, border-bottom
- nav-links hidden on mobile (<640px)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:01:10 +08:00
mini
c099cd5d97 feat(landing): add Code Demo + Dashboard mockup sections
Dashboard mockup is pure static (SVG chart + stats grid + log table).
No backend dependency. Reuses puro.css .log-table / .provider / .status-*
(scoped to .puro-page). Only adds component-local styles for .code-demo,
.dash-mock, .stat-row, .chart-card and friends.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:29:14 +08:00
mini
158f2a8d53 fix(landing): resolve Task 3 CSS specificity issues
Code review flagged:
- .feature.card caused padding/background specificity race;
  .feature already defines all card properties, so drop .card
- model-card flex row misaligned name/meta (should stack in column);
  wrap in div to get dot | [name/meta] layout
- .container and .section-* scoped rules silently shadow puro.css defaults;
  add comment explaining intentional override

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:26:50 +08:00
mini
cfcdd988db feat(landing): add Models wall + Features sections
- Added Models section (② 模型墙) with 5 platform cards (Claude, GPT, Codex, Gemini, More)
- Added Features section (③ 三特性) with 3 feature cards (unified key, account pool failover, analytics dashboard)
- Implemented responsive grid layouts with scoped CSS rules
- Used existing design tokens and brand colors from puro.css

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:18:56 +08:00
mini
9dae8724e3 feat(landing): LandingView scaffold with Nav + Hero
Temporary route /landing-preview added for dev iteration. Will flip /
to this view once all 6 sections are in place (Task 6).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:11:06 +08:00
mini
064a4b7614 fix(design): scope .bg-glow::before selector to .puro-page
One missed prefix from the automated transform. Aligns with the
scoping contract established in 41664efe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:06:21 +08:00
mini
41664efede fix(design): scope puro.css to .puro-page container
Code review flagged two critical issues with the initial scaffold:
- html/body bg + universal reset applied globally, overriding admin Tailwind styles
- Shared class names (.btn, .card, .input, .badge, .divider) collided with style.css,
  breaking 25+ admin views

Fix: all non-:root rules now scoped under .puro-page descendant selector.
@keyframes and global box-sizing preserved. html/body props merged into .puro-page root.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:03:22 +08:00
mini
1d7e75b82e feat(design): scaffold PURO AI design system
- Add puro.css (tokens + primitives) as global stylesheet
- Load Inter + JetBrains Mono via Google Fonts
- Extend tailwind.config with puro.* color namespace (no conflict with legacy primary/accent palettes)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 19:11:24 +08:00
13 changed files with 1729 additions and 75 deletions

View File

@@ -409,14 +409,17 @@ CTA[立即开始 →][查看文档]
## 7. 验收标准
- [ ] `puro.css` 已引入为全局样式CSS 变量在 DevTools :root 可见
- [ ] 未登录访问 https://ai.puro.im/ → 看到 PURO AI Landing 页
- [ ] 已登录访问 https://ai.puro.im/ → 跳到 /dashboard保持现有行为
- [ ] Landing 6 个 section 内容全部呈现,移动端可堆叠
- [ ] Landing 的 ⑤ Dashboard mockup 是静态 HTML 渲染,不依赖真实数据
- [ ] /login 是左右分栏布局,文案与 spec 一致
- [ ] /register 同上
- [ ] /docs 可公开访问,包含 curl 示例、Codex CLI 配置、Claude Code 配置
- [ ] 所有现有 auth 功能OAuth、Turnstile、2FA、密码重置仍可用
- [ ] 后台所有页面dashboard、账号管理、API key 等)外观不变
- [ ] CI 构建通过,部署后 ai.puro.im 加载正常
本地 previewhttp://127.0.0.1:4173已过
- [x] `puro.css` 已引入为全局样式,`--cyan: #22d3ee` 等变量在 DevTools :root 可见
- [x] 未登录访问 / → LandingView 呈现route meta.redirectIfAuth=/dashboard 生效分支)
- [x] 已登录访问 / → guard 跳 /dashboard
- [x] Landing 6 个 section 内容全部呈现Nav + Hero + Models + Features + Code Demo + Dashboard mockup + Footer移动端可堆叠
- [x] Landing ⑤ Dashboard mockup 为静态 HTML + 内嵌 SVG无后端依赖
- [x] /login 左右分栏布局narrative "5→1" 文案 + 登录表单 / heading "登录"
- [x] /register 左右分栏heading "创建账户" / "5 分钟开始用 PURO AI"
- [x] /docs 公开访问,含 curl / Codex config.toml / Claude Code settings.json 示例
- [x] 所有现有 auth 功能代码未改动OAuth section / Turnstile / 2FA modal / password toggle 均在原位)
- [x] 后台 /dashboard 等页面使用 style.css 的 .btn/.input/.cardpuro.css 已 scoped 到 .puro-page不污染
- [x] `pnpm run typecheck` 0 error`pnpm run build` 成功
- [ ] CI 构建通过,部署后 ai.puro.im 加载正常Task 13 完成)

View File

@@ -4,6 +4,9 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<title>Sub2API - AI API Gateway</title>
</head>
<body>

View File

@@ -0,0 +1,729 @@
/* ==========================================================================
PURO AI — Design System
Shared tokens + primitive styles used across every page.
--------------------------------------------------------------------------
Usage: <link rel="stylesheet" href="puro.css">
========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
.puro-page, .puro-page *, .puro-page *::before, .puro-page *::after { margin: 0; padding: 0; }
:root {
/* Surfaces */
--bg-0: #0a0e1a; /* page */
--bg-1: #0f172a; /* raised */
--bg-2: #111827; /* card alt */
--bg-code: #020617; /* code canvas */
/* Borders */
--border: #1e293b;
--border-2: #334155;
--border-3: #475569;
/* Text */
--text-0: #f8fafc; /* primary */
--text-1: #cbd5e1; /* body */
--text-2: #94a3b8; /* muted */
--text-3: #64748b; /* hint */
/* Accents */
--cyan: #22d3ee;
--cyan-2: #67e8f9;
--cyan-dim: #0891b2;
--purple: #a855f7;
--amber: #fbbf24;
--green: #34d399;
--red: #f87171;
--orange: #fb923c;
/* Provider brand dots */
--p-claude: #d97757;
--p-gpt: #10a37f;
--p-gemini: #4285f4;
--p-codex: #f0a030;
/* Radius */
--r-sm: 6px;
--r-md: 8px;
--r-lg: 12px;
--r-xl: 16px;
/* Shadow */
--shadow-lg: 0 30px 60px -30px rgba(0,0,0,0.6);
--shadow-xl: 0 40px 80px -40px rgba(0,0,0,0.8);
/* Typography */
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Merged from original html/body rules — applied to .puro-page container root */
.puro-page {
background: var(--bg-0);
color: var(--text-0);
font-family: var(--font-sans);
font-feature-settings: "cv11", "ss01", "ss03";
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
line-height: 1.5;
overflow-x: hidden;
}
.puro-page a { color: inherit; text-decoration: none; }
.puro-page button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
/* scrollbar — subtle */
.puro-page::-webkit-scrollbar { width: 10px; height: 10px; }
.puro-page::-webkit-scrollbar-track { background: transparent; }
.puro-page::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
.puro-page::-webkit-scrollbar-thumb:hover { background: var(--border-3); }
.puro-page .mono { font-family: var(--font-mono); }
/* ==========================================================================
BACKGROUND EFFECTS
========================================================================== */
.puro-page .bg-glow {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 0;
overflow: hidden;
}
.puro-page .bg-glow::before,
.puro-page .bg-glow::after {
content: "";
position: absolute;
width: 900px;
height: 900px;
border-radius: 50%;
filter: blur(120px);
opacity: 0.35;
}
.puro-page .bg-glow::before {
background: radial-gradient(circle, #22d3ee 0%, transparent 60%);
top: -300px;
left: -200px;
}
.puro-page .bg-glow::after {
background: radial-gradient(circle, #a855f7 0%, transparent 60%);
top: 200px;
right: -300px;
opacity: 0.25;
}
.puro-page .bg-glow.soft::before, .puro-page .bg-glow.soft::after { opacity: 0.15; }
.puro-page .grain {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 1;
opacity: 0.4;
mix-blend-mode: overlay;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
}
.puro-page .container {
max-width: 1100px;
margin: 0 auto;
padding: 0 32px;
position: relative;
z-index: 2;
}
.puro-page .container-wide { max-width: 1280px; }
.puro-page .container-narrow { max-width: 860px; }
/* ==========================================================================
NAV
========================================================================== */
.puro-page .nav {
position: sticky;
top: 0;
z-index: 50;
backdrop-filter: blur(16px);
background: rgba(10, 14, 26, 0.72);
border-bottom: 1px solid var(--border);
}
.puro-page .nav-inner {
display: flex;
align-items: center;
height: 64px;
gap: 48px;
}
.puro-page .brand {
display: flex;
align-items: center;
gap: 10px;
font-weight: 700;
font-size: 15px;
letter-spacing: 0.02em;
}
.puro-page .hex {
width: 22px;
height: 22px;
color: var(--cyan);
}
.puro-page .nav-links {
display: flex;
gap: 28px;
font-size: 14px;
color: var(--text-2);
}
.puro-page .nav-links a { transition: color .15s; }
.puro-page .nav-links a:hover, .puro-page .nav-links a.active { color: var(--text-0); }
.puro-page .nav-links .disabled { color: var(--text-3); cursor: not-allowed; display: inline-flex; align-items: center; gap: 6px; }
.puro-page .nav-links .disabled::after {
content: "即将推出";
font-size: 10px;
padding: 2px 6px;
border: 1px solid var(--border-2);
border-radius: 4px;
color: var(--text-3);
}
.puro-page .nav-cta {
margin-left: auto;
display: flex;
gap: 10px;
align-items: center;
}
/* ==========================================================================
BUTTONS
========================================================================== */
.puro-page .btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 8px 14px;
font-size: 13px;
font-weight: 500;
border-radius: var(--r-md);
transition: all .15s;
white-space: nowrap;
border: 1px solid transparent;
}
.puro-page .btn-primary {
background: var(--cyan);
color: #042f2e;
font-weight: 600;
}
.puro-page .btn-primary:hover { background: var(--cyan-2); }
.puro-page .btn-primary:active { transform: translateY(1px); }
.puro-page .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.puro-page .btn-ghost {
border-color: var(--border-2);
color: var(--text-1);
}
.puro-page .btn-ghost:hover { border-color: var(--border-3); color: var(--text-0); background: rgba(255,255,255,0.02); }
.puro-page .btn-subtle {
background: rgba(255,255,255,0.04);
color: var(--text-1);
border-color: transparent;
}
.puro-page .btn-subtle:hover { background: rgba(255,255,255,0.08); color: var(--text-0); }
.puro-page .btn-danger {
background: rgba(248, 113, 113, 0.1);
color: var(--red);
border-color: rgba(248, 113, 113, 0.25);
}
.puro-page .btn-danger:hover { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.4); }
.puro-page .btn-lg { padding: 12px 20px; font-size: 14px; }
.puro-page .btn-sm { padding: 5px 10px; font-size: 12px; }
.puro-page .btn-icon { padding: 7px; aspect-ratio: 1; }
.puro-page .btn .spinner {
width: 14px; height: 14px;
border: 2px solid rgba(0,0,0,0.2);
border-top-color: currentColor;
border-radius: 50%;
animation: spin .7s linear infinite;
display: none;
}
.puro-page .btn.loading .spinner { display: inline-block; }
.puro-page .btn.loading .label { opacity: 0.5; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ==========================================================================
BADGES / PILLS / CHIPS
========================================================================== */
.puro-page .badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
border-radius: 100px;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.02em;
background: rgba(34, 211, 238, 0.1);
color: var(--cyan);
}
.puro-page .badge.amber { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.puro-page .badge.purple { background: rgba(168, 85, 247, 0.12); color: var(--purple); }
.puro-page .badge.green { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.puro-page .badge.red { background: rgba(248, 113, 113, 0.12); color: var(--red); }
.puro-page .badge.muted { background: rgba(255, 255, 255, 0.04); color: var(--text-2); border: 1px solid var(--border); }
.puro-page .pill {
display: inline-block;
padding: 2px 8px;
border-radius: var(--r-sm);
background: rgba(255,255,255,0.04);
border: 1px solid var(--border);
font-family: var(--font-mono);
font-size: 12px;
color: var(--text-0);
}
.puro-page .chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: 100px;
background: rgba(15, 23, 42, 0.6);
border: 1px solid var(--border);
font-size: 12px;
color: var(--text-1);
font-family: var(--font-mono);
}
.puro-page .chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.puro-page .chip.claude .dot { background: var(--p-claude); }
.puro-page .chip.gpt .dot { background: var(--p-gpt); }
.puro-page .chip.gemini .dot { background: var(--p-gemini); }
.puro-page .chip.codex .dot { background: var(--p-codex); }
.puro-page .dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); display: inline-block; }
/* status chip (tiny dot absolute-positioned) */
.puro-page .status-chip {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--green);
box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
display: inline-block;
}
.puro-page .status-chip.dim { background: var(--text-3); box-shadow: none; }
.puro-page .status-chip.amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15); }
.puro-page .status-chip.red { background: var(--red); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15); }
/* ==========================================================================
CARDS / SURFACES
========================================================================== */
.puro-page .card {
background: rgba(15, 23, 42, 0.6);
border: 1px solid var(--border);
border-radius: var(--r-lg);
padding: 24px;
}
.puro-page .card-raised {
background: var(--bg-1);
border: 1px solid var(--border);
border-radius: var(--r-lg);
}
.puro-page .card-interactive {
transition: all .2s;
cursor: pointer;
}
.puro-page .card-interactive:hover {
border-color: var(--border-2);
background: rgba(15, 23, 42, 0.85);
transform: translateY(-2px);
}
.puro-page .divider { height: 1px; background: var(--border); margin: 24px 0; border: 0; }
.puro-page .divider-dashed { border: 0; border-top: 1px dashed var(--border); margin: 20px 0; }
/* ==========================================================================
FORMS
========================================================================== */
.puro-page .field { margin-bottom: 18px; }
.puro-page .field-label {
display: block;
font-size: 12px;
font-weight: 500;
color: var(--text-1);
margin-bottom: 8px;
}
.puro-page .field-hint {
font-size: 12px;
color: var(--text-3);
margin-top: 6px;
}
.puro-page .field-error {
font-size: 12px;
color: var(--red);
margin-top: 6px;
}
.puro-page .input-wrap { position: relative; }
.puro-page .input-wrap .icon {
position: absolute;
left: 14px;
top: 50%;
transform: translateY(-50%);
color: var(--text-3);
pointer-events: none;
display: inline-flex;
}
.puro-page .input {
width: 100%;
height: 42px;
padding: 0 14px;
background: rgba(15, 23, 42, 0.6);
border: 1px solid var(--border-2);
border-radius: var(--r-md);
color: var(--text-0);
font-size: 14px;
font-family: inherit;
outline: none;
transition: all .15s;
}
.puro-page .input.with-icon { padding-left: 40px; }
.puro-page .input::placeholder { color: var(--text-3); }
.puro-page .input:hover { border-color: var(--border-3); }
.puro-page .input:focus {
border-color: var(--cyan);
box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
background: rgba(15, 23, 42, 0.9);
}
.puro-page .input.ok { border-color: rgba(52, 211, 153, 0.4); }
.puro-page .input.ok:focus { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.puro-page .input.error { border-color: var(--red); }
.puro-page .input.error:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12); }
.puro-page textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.puro-page select.input {
appearance: none;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
background-repeat: no-repeat;
background-position: right 14px center;
padding-right: 36px;
}
/* checkbox */
.puro-page .check {
display: inline-flex;
align-items: center;
gap: 10px;
cursor: pointer;
user-select: none;
font-size: 13px;
color: var(--text-1);
}
.puro-page .check input { display: none; }
.puro-page .check .box {
width: 16px; height: 16px;
border: 1px solid var(--border-2);
border-radius: 4px;
background: var(--bg-1);
display: inline-flex;
align-items: center;
justify-content: center;
transition: all .15s;
flex-shrink: 0;
}
.puro-page .check input:checked + .box {
background: var(--cyan);
border-color: var(--cyan);
}
.puro-page .check input:checked + .box::after {
content: "✓";
color: #042f2e;
font-size: 11px;
font-weight: 700;
}
/* ==========================================================================
SECTION HEADINGS
========================================================================== */
.puro-page .section-kicker {
font-family: var(--font-mono);
font-size: 12px;
color: var(--cyan);
letter-spacing: 0.15em;
text-transform: uppercase;
margin-bottom: 12px;
}
.puro-page .section-title {
font-size: clamp(28px, 3.5vw, 40px);
font-weight: 700;
letter-spacing: -0.02em;
line-height: 1.15;
margin-bottom: 16px;
}
.puro-page .section-sub {
color: var(--text-2);
font-size: 16px;
line-height: 1.6;
}
/* ==========================================================================
TABLES
========================================================================== */
.puro-page .tbl {
width: 100%;
font-size: 13px;
border-collapse: collapse;
}
.puro-page .tbl th {
text-align: left;
color: var(--text-3);
font-weight: 500;
padding: 12px 14px;
border-bottom: 1px solid var(--border);
text-transform: uppercase;
font-size: 10px;
letter-spacing: 0.1em;
}
.puro-page .tbl td {
padding: 14px;
border-bottom: 1px solid rgba(30, 41, 59, 0.5);
color: var(--text-1);
}
.puro-page .tbl tr:last-child td { border-bottom: none; }
.puro-page .tbl tr:hover td { background: rgba(15, 23, 42, 0.4); }
.puro-page .tbl td.mono, .puro-page .tbl th.mono { font-family: var(--font-mono); }
/* ==========================================================================
CODE BLOCKS
========================================================================== */
.puro-page .code-frame {
background: var(--bg-code);
border: 1px solid var(--border);
border-radius: var(--r-lg);
overflow: hidden;
box-shadow: var(--shadow-lg);
}
.puro-page .code-head {
display: flex;
align-items: center;
height: 40px;
padding: 0 16px;
border-bottom: 1px solid var(--border);
background: rgba(15, 23, 42, 0.8);
gap: 10px;
}
.puro-page .traffic {
display: flex;
gap: 6px;
}
.puro-page .traffic span {
width: 10px;
height: 10px;
border-radius: 50%;
background: #475569;
}
.puro-page .code-body {
padding: 22px 26px;
font-family: var(--font-mono);
font-size: 13px;
line-height: 1.75;
color: var(--text-1);
overflow-x: auto;
}
.puro-page .code-body .line { display: flex; gap: 20px; }
.puro-page .ln { color: var(--text-3); user-select: none; min-width: 16px; text-align: right; opacity: 0.5; }
/* syntax */
.puro-page .kw { color: #c084fc; }
.puro-page .str { color: #86efac; }
.puro-page .num { color: #fbbf24; }
.puro-page .com { color: #64748b; font-style: italic; }
.puro-page .fn { color: #22d3ee; }
.puro-page .prop { color: #f0abfc; }
.puro-page .var-v { color: #f8fafc; }
.puro-page .flag { color: #fb923c; }
.puro-page .bash-prompt { color: var(--cyan); user-select: none; }
/* ==========================================================================
PROVIDER-BRAND HELPERS
========================================================================== */
.puro-page .provider {
display: inline-flex;
align-items: center;
gap: 6px;
font-family: var(--font-mono);
font-size: 12px;
}
.puro-page .provider .dot { width: 6px; height: 6px; border-radius: 50%; }
.puro-page .provider.claude .dot { background: var(--p-claude); }
.puro-page .provider.gpt .dot { background: var(--p-gpt); }
.puro-page .provider.gemini .dot { background: var(--p-gemini); }
.puro-page .provider.codex .dot { background: var(--p-codex); }
/* ==========================================================================
UTILITIES
========================================================================== */
.puro-page .stack-xs { display: flex; flex-direction: column; gap: 8px; }
.puro-page .stack-sm { display: flex; flex-direction: column; gap: 12px; }
.puro-page .stack-md { display: flex; flex-direction: column; gap: 20px; }
.puro-page .stack-lg { display: flex; flex-direction: column; gap: 32px; }
.puro-page .row { display: flex; align-items: center; gap: 12px; }
.puro-page .row-sm { gap: 8px; }
.puro-page .row-lg { gap: 20px; }
.puro-page .row-between { justify-content: space-between; }
.puro-page .row-center { justify-content: center; }
.puro-page .row-wrap { flex-wrap: wrap; }
.puro-page .flex-1 { flex: 1; }
.puro-page .ml-auto { margin-left: auto; }
.puro-page .mt-auto { margin-top: auto; }
.puro-page .text-0 { color: var(--text-0); }
.puro-page .text-1 { color: var(--text-1); }
.puro-page .text-2 { color: var(--text-2); }
.puro-page .text-3 { color: var(--text-3); }
.puro-page .text-cyan { color: var(--cyan); }
.puro-page .text-purple { color: var(--purple); }
.puro-page .text-amber { color: var(--amber); }
.puro-page .text-green { color: var(--green); }
.puro-page .text-red { color: var(--red); }
.puro-page .text-xs { font-size: 11px; }
.puro-page .text-sm { font-size: 13px; }
.puro-page .text-md { font-size: 14px; }
.puro-page .text-lg { font-size: 16px; }
.puro-page .text-xl { font-size: 20px; }
.puro-page .text-2xl { font-size: 28px; }
.puro-page .text-3xl { font-size: 36px; }
.puro-page .fw-400 { font-weight: 400; }
.puro-page .fw-500 { font-weight: 500; }
.puro-page .fw-600 { font-weight: 600; }
.puro-page .fw-700 { font-weight: 700; }
.puro-page .fw-800 { font-weight: 800; }
.puro-page .tabular { font-variant-numeric: tabular-nums; }
.puro-page .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ==========================================================================
APP SHELL (for dashboard-style pages)
========================================================================== */
.puro-page .app-shell {
display: grid;
grid-template-columns: 240px 1fr;
min-height: 100vh;
position: relative;
z-index: 2;
}
.puro-page .app-side {
border-right: 1px solid var(--border);
background: rgba(2, 6, 23, 0.6);
padding: 20px 14px;
display: flex;
flex-direction: column;
gap: 28px;
position: sticky;
top: 0;
height: 100vh;
overflow-y: auto;
}
.puro-page .app-side .brand { padding: 6px 10px 14px; }
.puro-page .side-group { display: flex; flex-direction: column; gap: 2px; }
.puro-page .side-label {
font-size: 10px;
color: var(--text-3);
text-transform: uppercase;
letter-spacing: 0.12em;
padding: 0 10px 8px;
font-family: var(--font-mono);
}
.puro-page .side-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 10px;
border-radius: var(--r-sm);
font-size: 13px;
color: var(--text-2);
cursor: pointer;
transition: all .12s;
}
.puro-page .side-item:hover { color: var(--text-0); background: rgba(255,255,255,0.03); }
.puro-page .side-item.active { background: rgba(34, 211, 238, 0.08); color: var(--cyan); }
.puro-page .side-item .ico {
width: 16px; height: 16px; opacity: 0.8;
display: inline-flex; align-items: center; justify-content: center;
flex-shrink: 0;
}
.puro-page .side-item .count {
margin-left: auto;
font-size: 11px;
color: var(--text-3);
font-family: var(--font-mono);
}
.puro-page .side-item.active .count { color: var(--cyan); }
.puro-page .app-main {
min-width: 0; /* allow grid children to shrink */
display: flex;
flex-direction: column;
}
.puro-page .app-topbar {
height: 60px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
padding: 0 32px;
gap: 16px;
position: sticky;
top: 0;
z-index: 10;
background: rgba(10, 14, 26, 0.75);
backdrop-filter: blur(12px);
}
.puro-page .app-topbar h1 {
font-size: 18px;
font-weight: 600;
letter-spacing: -0.01em;
}
.puro-page .app-content {
padding: 32px;
flex: 1;
}
/* user avatar pill */
.puro-page .avatar {
width: 28px; height: 28px;
border-radius: 50%;
background: linear-gradient(135deg, #22d3ee, #a855f7);
display: inline-flex;
align-items: center;
justify-content: center;
color: #042f2e;
font-weight: 700;
font-size: 12px;
flex-shrink: 0;
}
/* ==========================================================================
KBD
========================================================================== */
.puro-page kbd {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 20px;
height: 20px;
padding: 0 6px;
font-family: var(--font-mono);
font-size: 11px;
font-weight: 500;
color: var(--text-1);
background: var(--bg-1);
border: 1px solid var(--border-2);
border-bottom-width: 2px;
border-radius: 4px;
line-height: 1;
}

View File

@@ -1,69 +1,45 @@
<template>
<div class="relative flex min-h-screen items-center justify-center overflow-hidden p-4">
<!-- Background -->
<div
class="absolute inset-0 bg-gradient-to-br from-gray-50 via-primary-50/30 to-gray-100 dark:from-dark-950 dark:via-dark-900 dark:to-dark-950"
></div>
<div class="auth-shell" :class="{ 'auth-shell-split': hasNarrative }">
<div class="bg-glow soft"></div>
<!-- Decorative Elements -->
<div class="pointer-events-none absolute inset-0 overflow-hidden">
<!-- Gradient Orbs -->
<div
class="absolute -right-40 -top-40 h-80 w-80 rounded-full bg-primary-400/20 blur-3xl"
></div>
<div
class="absolute -bottom-40 -left-40 h-80 w-80 rounded-full bg-primary-500/15 blur-3xl"
></div>
<div
class="absolute left-1/2 top-1/2 h-96 w-96 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-300/10 blur-3xl"
></div>
<!-- LEFT: Narrative (split mode only, hidden on mobile) -->
<aside v-if="hasNarrative" class="auth-narrative">
<slot name="narrative"></slot>
</aside>
<!-- Grid Pattern -->
<div
class="absolute inset-0 bg-[linear-gradient(rgba(20,184,166,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(20,184,166,0.03)_1px,transparent_1px)] bg-[size:64px_64px]"
></div>
</div>
<!-- Content Container -->
<div class="relative z-10 w-full max-w-md">
<!-- Logo/Brand -->
<div class="mb-8 text-center">
<!-- Custom Logo or Default Logo -->
<template v-if="settingsLoaded">
<!-- RIGHT: Form -->
<main class="auth-main">
<div class="auth-main-inner">
<!-- Legacy centered-card header (only when no narrative slot) -->
<div class="mb-8 text-center" v-if="!hasNarrative && settingsLoaded">
<div
class="mb-4 inline-flex h-16 w-16 items-center justify-center overflow-hidden rounded-2xl shadow-lg shadow-primary-500/30"
class="mb-4 inline-flex h-14 w-14 items-center justify-center overflow-hidden rounded-2xl"
>
<img :src="siteLogo || '/logo.png'" alt="Logo" class="h-full w-full object-contain" />
</div>
<h1 class="text-gradient mb-2 text-3xl font-bold">
{{ siteName }}
</h1>
<p class="text-sm text-gray-500 dark:text-dark-400">
{{ siteSubtitle }}
</p>
</template>
</div>
<h1 class="text-2xl font-bold">{{ siteName }}</h1>
<p class="text-sm text-gray-500 dark:text-dark-400" v-if="siteSubtitle">{{ siteSubtitle }}</p>
</div>
<!-- Card Container -->
<div class="card-glass rounded-2xl p-8 shadow-glass">
<!-- Form content -->
<slot />
</div>
<!-- Footer Links -->
<div class="mt-6 text-center text-sm">
<slot name="footer" />
</div>
<!-- Footer link slot (e.g., "没有账户?注册") -->
<div class="mt-6 text-center text-sm">
<slot name="footer" />
</div>
<!-- Copyright -->
<div class="mt-8 text-center text-xs text-gray-400 dark:text-dark-500">
&copy; {{ currentYear }} {{ siteName }}. All rights reserved.
<!-- Copyright (legacy mode only) -->
<div class="mt-8 text-center text-xs text-gray-400 dark:text-dark-500" v-if="!hasNarrative">
&copy; {{ currentYear }} {{ siteName }}. All rights reserved.
</div>
</div>
</div>
</main>
</div>
</template>
<script setup lang="ts">
import { computed, onMounted } from 'vue'
import { computed, onMounted, useSlots } from 'vue'
import { useAppStore } from '@/stores'
import { sanitizeUrl } from '@/utils/url'
@@ -76,6 +52,9 @@ const settingsLoaded = computed(() => appStore.publicSettingsLoaded)
const currentYear = computed(() => new Date().getFullYear())
const slots = useSlots()
const hasNarrative = computed(() => !!slots.narrative)
onMounted(() => {
appStore.fetchPublicSettings()
})
@@ -85,4 +64,57 @@ onMounted(() => {
.text-gradient {
@apply bg-gradient-to-r from-primary-600 to-primary-500 bg-clip-text text-transparent;
}
.auth-shell {
min-height: 100vh;
position: relative;
overflow: hidden;
}
.auth-shell-split {
display: grid;
grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
.auth-shell-split {
grid-template-columns: 1fr;
}
.auth-narrative {
display: none;
}
}
.auth-narrative {
position: relative;
padding: 48px 56px;
background: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 100%);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
justify-content: space-between;
color: var(--text-0);
font-family: var(--font-sans);
}
.auth-main {
display: flex;
align-items: center;
justify-content: center;
padding: 40px 24px;
position: relative;
z-index: 2;
}
.auth-main-inner {
width: 100%;
max-width: 420px;
}
/* Legacy-mode (no narrative slot) background — keep existing gradient decorative look */
.auth-shell:not(.auth-shell-split) {
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
background: linear-gradient(to bottom right, #f9fafb, rgba(240,253,250,0.3), #f3f4f6);
}
:global(.dark) .auth-shell:not(.auth-shell-split) {
background: linear-gradient(to bottom right, #020617, #0f172a, #020617);
}
</style>

View File

@@ -498,7 +498,12 @@ export default {
invalidResetLink: '无效的重置链接',
invalidResetLinkHint: '此密码重置链接无效或已过期。请重新请求一个新链接。',
requestNewResetLink: '请求新的重置链接',
invalidOrExpiredToken: '密码重置链接无效或已过期。请重新请求一个新链接。'
invalidOrExpiredToken: '密码重置链接无效或已过期。请重新请求一个新链接。',
// PURO AI redesign
puroLoginTitle: '登录',
puroLoginSub: '用你的 PURO AI 账户继续',
puroRegisterTitle: '创建账户',
puroRegisterSub: '5 分钟开始用 PURO AI',
},
// Dashboard

View File

@@ -5,6 +5,7 @@ import router from './router'
import i18n, { initI18n } from './i18n'
import { useAppStore } from '@/stores/app'
import './style.css'
import './assets/puro.css'
function initThemeClass() {
const savedTheme = localStorage.getItem('theme')

View File

@@ -120,11 +120,26 @@ const routes: RouteRecordRaw[] = [
title: 'Key Usage',
}
},
{
path: '/docs',
name: 'Docs',
component: () => import('@/views/docs/DocsView.vue'),
meta: {
requiresAuth: false,
title: 'PURO AI · 文档'
}
},
// ==================== User Routes ====================
{
path: '/',
redirect: '/home'
name: 'Landing',
component: () => import('@/views/landing/LandingView.vue'),
meta: {
requiresAuth: false,
title: 'PURO AI — 你的 AI 订阅,已经付过钱了',
redirectIfAuth: '/dashboard'
}
},
{
path: '/dashboard',
@@ -533,6 +548,13 @@ router.beforeEach((to, _from, next) => {
authInitialized = true
}
// Auth-aware redirect for public pages that should bounce authenticated users elsewhere
// (e.g., Landing / at `/` redirects to /dashboard if user is logged in)
const redirectIfAuth = to.meta.redirectIfAuth
if (redirectIfAuth && authStore.isAuthenticated) {
return next(redirectIfAuth)
}
// Set page title
const appStore = useAppStore()
// For custom pages, use menu item label as document title

View File

@@ -7,6 +7,12 @@ import 'vue-router'
declare module 'vue-router' {
interface RouteMeta {
/**
* If set, authenticated users visiting this route are redirected to this path.
* Used for public pages (e.g., Landing `/`) that should bounce logged-in users to the app.
*/
redirectIfAuth?: string
/**
* Whether this route requires authentication
* @default true

View File

@@ -1,14 +1,28 @@
<template>
<AuthLayout>
<template #narrative>
<div class="auth-narrative-inner">
<div class="brand"><span class="hex"></span><span>PURO AI</span></div>
<div class="auth-narrative-hero">
<div class="auth-narrative-headline">
<span class="num-5">5</span> 个订阅<br>
<span class="num-1">1</span> key
</div>
<p class="auth-narrative-sub">
省去切换账号的繁琐<br>
省去为多个高昂订阅重复买单<br>
<span class="auth-narrative-tagline">PURO纯粹 AI 调用回归本质</span>
</p>
</div>
<div class="auth-narrative-foot">Claude · ChatGPT · Codex · Gemini</div>
</div>
</template>
<div class="space-y-6">
<!-- Title -->
<div class="text-center">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">
{{ t('auth.welcomeBack') }}
</h2>
<p class="mt-2 text-sm text-gray-500 dark:text-dark-400">
{{ t('auth.signInToAccount') }}
</p>
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">{{ t('auth.puroLoginTitle') }}</h2>
<p class="mt-2 text-sm text-gray-500 dark:text-dark-400">{{ t('auth.puroLoginSub') }}</p>
</div>
<div v-if="!backendModeEnabled && (linuxdoOAuthEnabled || oidcOAuthEnabled)" class="space-y-4">
@@ -439,4 +453,51 @@ function handle2FACancel(): void {
opacity: 0;
transform: translateY(-8px);
}
.auth-narrative-inner {
position: relative;
z-index: 2;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
color: var(--text-0);
}
.brand {
display: flex;
align-items: center;
gap: 8px;
font-weight: 700;
font-size: 18px;
}
.brand .hex {
color: var(--cyan);
font-size: 24px;
}
.auth-narrative-headline {
font-size: clamp(40px, 5vw, 64px);
font-weight: 800;
line-height: 1.05;
letter-spacing: -0.03em;
margin-bottom: 24px;
}
.auth-narrative-headline .num-5 { color: var(--amber); }
.auth-narrative-headline .num-1 { color: var(--cyan); }
.auth-narrative-sub {
font-size: 15px;
line-height: 1.7;
color: var(--text-1);
}
.auth-narrative-tagline {
display: block;
margin-top: 12px;
font-size: 12px;
color: var(--text-3);
}
.auth-narrative-foot {
font-size: 12px;
color: var(--text-3);
font-family: var(--font-mono);
}
</style>

View File

@@ -1,14 +1,28 @@
<template>
<AuthLayout>
<template #narrative>
<div class="auth-narrative-inner">
<div class="brand"><span class="hex"></span><span>PURO AI</span></div>
<div class="auth-narrative-hero">
<div class="auth-narrative-headline">
<span class="num-5">5</span> 个订阅<br>
<span class="num-1">1</span> key
</div>
<p class="auth-narrative-sub">
省去切换账号的繁琐<br>
省去为多个高昂订阅重复买单<br>
<span class="auth-narrative-tagline">PURO纯粹 AI 调用回归本质</span>
</p>
</div>
<div class="auth-narrative-foot">Claude · ChatGPT · Codex · Gemini</div>
</div>
</template>
<div class="space-y-6">
<!-- Title -->
<div class="text-center">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">
{{ t('auth.createAccount') }}
</h2>
<p class="mt-2 text-sm text-gray-500 dark:text-dark-400">
{{ t('auth.signUpToStart', { siteName }) }}
</p>
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">{{ t('auth.puroRegisterTitle') }}</h2>
<p class="mt-2 text-sm text-gray-500 dark:text-dark-400">{{ t('auth.puroRegisterSub') }}</p>
</div>
<div v-if="linuxdoOAuthEnabled || oidcOAuthEnabled" class="space-y-4">
@@ -767,4 +781,51 @@ async function handleRegister(): Promise<void> {
opacity: 0;
transform: translateY(-8px);
}
.auth-narrative-inner {
position: relative;
z-index: 2;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
color: var(--text-0);
}
.brand {
display: flex;
align-items: center;
gap: 8px;
font-weight: 700;
font-size: 18px;
}
.brand .hex {
color: var(--cyan);
font-size: 24px;
}
.auth-narrative-headline {
font-size: clamp(40px, 5vw, 64px);
font-weight: 800;
line-height: 1.05;
letter-spacing: -0.03em;
margin-bottom: 24px;
}
.auth-narrative-headline .num-5 { color: var(--amber); }
.auth-narrative-headline .num-1 { color: var(--cyan); }
.auth-narrative-sub {
font-size: 15px;
line-height: 1.7;
color: var(--text-1);
}
.auth-narrative-tagline {
display: block;
margin-top: 12px;
font-size: 12px;
color: var(--text-3);
}
.auth-narrative-foot {
font-size: 12px;
color: var(--text-3);
font-family: var(--font-mono);
}
</style>

View File

@@ -0,0 +1,213 @@
<template>
<div class="puro-page">
<div class="bg-glow soft"></div>
<nav class="nav">
<div class="container nav-inner">
<router-link to="/" class="brand"><span class="hex"></span><span>PURO AI</span></router-link>
<div class="nav-links">
<router-link to="/">首页</router-link>
<a href="#codex">Codex</a>
<a href="#claude-code">Claude Code</a>
<a href="#curl">curl</a>
</div>
<div class="nav-cta">
<router-link to="/login" class="btn btn-primary">登录 </router-link>
</div>
</div>
</nav>
<section class="docs-hero container">
<h1>快速接入 PURO AI</h1>
<p class="subtitle">三步走 key base_url 发请求</p>
</section>
<div class="container docs-body">
<section id="get-key" class="docs-section">
<h2>1. 获取 API key</h2>
<p>当前 PURO AI 不开放自助注册付费联系管理员获取</p>
<div class="callout">
<a href="mailto:admin@puro.im">admin@puro.im</a>
</div>
<p class="note">未来通过 iShare 入口开放订阅购买</p>
</section>
<section id="codex" class="docs-section">
<h2>2. Codex CLI 接入</h2>
<p>修改 <code class="mono">~/.codex/config.toml</code></p>
<pre class="mono"><code>model_provider = <span class="str">"OpenAI"</span>
model = <span class="str">"gpt-5.4"</span>
wire_api = <span class="str">"responses"</span>
[model_providers.OpenAI]
name = <span class="str">"OpenAI"</span>
base_url = <span class="str">"https://ai.puro.im"</span>
wire_api = <span class="str">"responses"</span>
requires_openai_auth = <span class="kw">true</span></code></pre>
<p>然后 <code class="mono">~/.codex/auth.json</code></p>
<pre class="mono"><code>{
<span class="str">"OPENAI_API_KEY"</span>: <span class="str">"sk-xxxxxxxxxxxxxxxx"</span>
}</code></pre>
<p>验证</p>
<pre class="mono"><code><span class="cm">$</span> codex exec --sandbox read-only <span class="str">"say hi"</span></code></pre>
</section>
<section id="claude-code" class="docs-section">
<h2>3. Claude Code 接入</h2>
<p>修改 <code class="mono">~/.claude/settings.json</code></p>
<pre class="mono"><code>{
<span class="str">"base_url"</span>: <span class="str">"https://ai.puro.im"</span>,
<span class="str">"api_key"</span>: <span class="str">"sk-xxxxxxxxxxxxxxxx"</span>
}</code></pre>
<p class="note">Claude Code 通过 <code class="mono">/v1/messages</code> endpoint 调用 Anthropic 兼容 API</p>
</section>
<section id="curl" class="docs-section">
<h2>4. curl 直连测试</h2>
<p>OpenAI Responses API</p>
<pre class="mono"><code><span class="cm">$</span> curl https://ai.puro.im/responses \
-H <span class="str">"Authorization: Bearer sk-xxx"</span> \
-H <span class="str">"Content-Type: application/json"</span> \
-d <span class="str">'{"model":"gpt-5.4","input":"hello"}'</span></code></pre>
<p>Anthropic Messages API</p>
<pre class="mono"><code><span class="cm">$</span> curl https://ai.puro.im/v1/messages \
-H <span class="str">"Authorization: Bearer sk-xxx"</span> \
-H <span class="str">"Content-Type: application/json"</span> \
-H <span class="str">"anthropic-version: 2023-06-01"</span> \
-d <span class="str">'{"model":"claude-opus-4-7","max_tokens":100,"messages":[{"role":"user","content":"hi"}]}'</span></code></pre>
</section>
<section id="models" class="docs-section">
<h2>5. 支持的模型</h2>
<ul class="model-list">
<li><code class="mono">gpt-5.4</code> · OpenAIvia ChatGPT Plus / Codex OAuth</li>
<li><code class="mono">gpt-5.4-codex</code> · OpenAI Codex 专用</li>
<li><code class="mono">claude-opus-4-7</code> · Anthropicvia Claude Pro / Max OAuth</li>
<li><code class="mono">claude-sonnet-4-6</code> · Anthropic</li>
<li><code class="mono">gemini-2.5-pro</code> · Googlevia Code Assist OAuth</li>
<li><code class="mono">gemini-2.5-flash</code> · Google</li>
</ul>
<p class="note">后端 pricing 表实时跟进 <code class="mono">model-price-repo</code>完整清单登录后在 <router-link to="/dashboard">控制台</router-link> 查看</p>
</section>
<section id="feedback" class="docs-section">
<h2>6. 问题反馈</h2>
<p>遇到问题或希望补接某个平台</p>
<div class="callout">
<a href="mailto:admin@puro.im">admin@puro.im</a>
</div>
</section>
</div>
</div>
</template>
<script setup lang="ts">
// DocsView — public quickstart documentation
// Route: /docs (no auth required)
</script>
<style scoped>
/* =============================================================
* DocsView — component-local styles
* Globals from puro.css (scoped to .puro-page) provide:
* - .nav, .nav-inner, .brand, .hex, .nav-links, .nav-cta (nav base)
* - .mono, .btn, .btn-primary, .container (primitives)
* ============================================================= */
.puro-page {
min-height: 100vh;
position: relative;
}
.docs-hero {
padding: 80px 24px 40px;
text-align: center;
}
.docs-hero h1 {
font-size: clamp(32px, 4vw, 48px);
font-weight: 800;
letter-spacing: -0.03em;
margin-bottom: 12px;
}
.docs-hero .subtitle {
color: var(--text-2);
font-size: 16px;
}
.docs-body { padding-bottom: 80px; }
.docs-section {
margin: 48px 0;
scroll-margin-top: 80px;
}
.docs-section h2 {
font-size: 22px;
font-weight: 700;
margin-bottom: 14px;
color: var(--text-0);
border-bottom: 1px solid var(--border);
padding-bottom: 8px;
}
.docs-section p {
color: var(--text-1);
font-size: 14px;
line-height: 1.8;
margin: 12px 0;
}
.docs-section .note {
color: var(--text-3);
font-size: 13px;
}
.docs-section code.mono {
background: var(--bg-1);
padding: 2px 6px;
border-radius: var(--r-sm);
font-size: 13px;
color: var(--cyan);
}
.docs-section pre.mono {
background: var(--bg-code);
border: 1px solid var(--border);
border-radius: var(--r-md);
padding: 16px;
font-size: 13px;
line-height: 1.6;
color: var(--text-1);
overflow-x: auto;
margin: 12px 0;
}
.docs-section pre .str { color: var(--cyan); }
.docs-section pre .kw { color: var(--amber); }
.docs-section pre .cm { color: var(--text-3); }
.callout {
padding: 16px 20px;
background: var(--bg-1);
border: 1px solid var(--border-2);
border-left: 3px solid var(--cyan);
border-radius: var(--r-md);
margin: 12px 0;
}
.callout a {
color: var(--cyan);
font-family: var(--font-mono);
font-size: 14px;
}
.model-list { list-style: none; padding: 0; }
.model-list li {
padding: 8px 0;
color: var(--text-1);
font-size: 14px;
border-bottom: 1px dashed var(--border);
}
.model-list li:last-child { border-bottom: none; }
/* container override (puro.css has 1100px/32px; we want narrower for docs readability) */
.container {
max-width: 860px;
margin: 0 auto;
padding: 0 24px;
position: relative;
z-index: 2;
}
</style>

View File

@@ -0,0 +1,504 @@
<template>
<div class="puro-page">
<div class="bg-glow"></div>
<div class="grain"></div>
<!-- NAV -->
<nav class="nav">
<div class="container nav-inner">
<router-link to="/" class="brand">
<span class="hex"></span>
<span>PURO AI</span>
</router-link>
<div class="nav-links">
<a href="#features">产品</a>
<a href="/docs">文档</a>
</div>
<div class="nav-cta">
<router-link to="/login" class="btn btn-ghost">登录</router-link>
<router-link to="/register" class="btn btn-primary">免费试用 </router-link>
</div>
</div>
</nav>
<!-- HERO -->
<section class="hero container">
<div class="hero-eyebrow">
<span class="pill">ChatGPT Plus · Claude Pro · Codex · Gemini</span>
</div>
<h1 class="hero-title">
你的 AI 订阅<br>
<span class="text-puro-cyan">已经付过钱了</span>
</h1>
<p class="hero-sub">
Claude Pro · ChatGPT Plus · Codex · Gemini 订阅<br>
聚合成统一 API零改动接入 OpenAI / Anthropic SDK
</p>
<div class="hero-cta">
<router-link to="/login" class="btn btn-primary btn-lg">登录 </router-link>
<a href="mailto:admin@puro.im" class="btn btn-ghost btn-lg">联系咨询</a>
</div>
<div class="hero-micro">
已验证可用 Codex CLI · Claude Code · curl · 服务器出口新加坡
</div>
</section>
<!-- 模型墙 -->
<section class="block container" id="models">
<div class="section-header">
<div class="section-kicker">支持的 AI 平台</div>
<h2 class="section-title">通过 OAuth 直接复用你的订阅</h2>
<p class="section-sub">无需申请官方 API key也无需切换账号</p>
</div>
<div class="model-wall">
<div class="model-card">
<div class="model-dot" style="background: var(--p-claude)"></div>
<div>
<div class="model-name">Claude Pro / Max</div>
<div class="model-meta">Anthropic OAuth</div>
</div>
</div>
<div class="model-card">
<div class="model-dot" style="background: var(--p-gpt)"></div>
<div>
<div class="model-name">ChatGPT Plus / Pro</div>
<div class="model-meta">OpenAI OAuth</div>
</div>
</div>
<div class="model-card">
<div class="model-dot" style="background: var(--p-codex)"></div>
<div>
<div class="model-name">Codex CLI</div>
<div class="model-meta">OpenAI OAuth</div>
</div>
</div>
<div class="model-card">
<div class="model-dot" style="background: var(--p-gemini)"></div>
<div>
<div class="model-name">Gemini Code Assist</div>
<div class="model-meta">Google OAuth</div>
</div>
</div>
<div class="model-card is-muted">
<div class="model-dot" style="background: var(--text-3)"></div>
<div>
<div class="model-name">更多</div>
<div class="model-meta">规划中</div>
</div>
</div>
</div>
</section>
<!-- 三特性 -->
<section class="block container" id="features">
<div class="section-header">
<div class="section-kicker">核心特性</div>
<h2 class="section-title">一套 key三件武器</h2>
</div>
<div class="features">
<div class="feature">
<div class="feature-icon"></div>
<h3>一个 key 接所有模型</h3>
<p>不再为每个 provider 申请 API key配置 base_url统一 <code class="mono">sk-</code> Claude / GPT / Gemini model 自动路由到对应账号池</p>
</div>
<div class="feature">
<div class="feature-icon">🔄</div>
<h3>账号池高可用</h3>
<p>支持多账号自动调度与 failover某个上游触发限流 / 冷却时流量切到下一个健康账号token 刷新全自动</p>
</div>
<div class="feature">
<div class="feature-icon">📊</div>
<h3>用量看板</h3>
<p>每条请求的 tokens费用上游账号延迟全可视化模型分布饼图 + 趋势曲线 + Top 排行</p>
</div>
</div>
</section>
<!-- Code Demo -->
<section class="block container" id="code">
<div class="section-header">
<div class="section-kicker">快速接入</div>
<h2 class="section-title"> base_url 一改就能用</h2>
<p class="section-sub">兼容 OpenAI / Anthropic / Gemini SDK<span class="text-puro-cyan">零代码改动</span></p>
</div>
<div class="code-demo">
<div class="code-block">
<div class="code-title mono">~/.codex/config.toml</div>
<pre class="mono"><code><span class="cm">[model_providers.OpenAI]</span>
base_url = <span class="str">"https://ai.puro.im"</span>
wire_api = <span class="str">"responses"</span>
requires_openai_auth = <span class="kw">true</span></code></pre>
</div>
<div class="code-block">
<div class="code-title mono">curl</div>
<pre class="mono"><code><span class="cm">$</span> curl https://ai.puro.im/responses \
-H <span class="str">"Authorization: Bearer sk-xxx"</span> \
-d <span class="str">'{"model":"gpt-5.4","input":"hello"}'</span></code></pre>
</div>
</div>
<div class="code-foot">支持 OpenAI Responses API · Anthropic Messages API · Gemini generateContent · 流式 SSE &amp; WebSocket</div>
</section>
<!-- Dashboard mockup -->
<section class="block container" id="dashboard">
<div class="section-header">
<div class="section-kicker">用量透明</div>
<h2 class="section-title">每条请求都看得见</h2>
<p class="section-sub">不像第三方 API 池子那种"扣了多少不告诉你"扣哪个账号跑哪个模型用了多少 tokens上游响应几秒一目了然</p>
</div>
<div class="dash-mock">
<div class="dash-header">
<span class="dash-title">Dashboard · 预览</span>
<div class="dash-dots"><span></span><span></span><span></span></div>
</div>
<div class="dash-body">
<div class="stat-row">
<div class="stat"><div class="stat-label">今日请求</div><div class="stat-value">1,842</div><div class="stat-delta">+12.3%</div></div>
<div class="stat"><div class="stat-label">输入 Tokens</div><div class="stat-value">2.1M</div><div class="stat-delta">+8.1%</div></div>
<div class="stat"><div class="stat-label">输出 Tokens</div><div class="stat-value">485K</div><div class="stat-delta">+15.6%</div></div>
<div class="stat"><div class="stat-label">今日费用</div><div class="stat-value">$1.23</div><div class="stat-delta down">-4.2%</div></div>
</div>
<div class="chart-card">
<div class="chart-title"> 30 天用量趋势</div>
<svg viewBox="0 0 600 120" class="chart-svg">
<polyline points="0,90 40,80 80,70 120,65 160,60 200,50 240,55 280,45 320,40 360,35 400,30 440,25 480,20 520,25 560,15 600,10"
fill="none" stroke="#22d3ee" stroke-width="2"/>
<polyline points="0,100 40,95 80,90 120,88 160,85 200,82 240,80 280,78 320,75 360,73 400,70 440,68 480,65 520,63 560,60 600,58"
fill="none" stroke="#a855f7" stroke-width="2" stroke-dasharray="4 4"/>
</svg>
</div>
<table class="log-table mono">
<thead>
<tr><th>时间</th><th>模型</th><th>上游</th><th>状态</th><th>用量</th></tr>
</thead>
<tbody>
<tr><td>12:34:07</td><td>gpt-5.4</td><td><span class="provider gpt"><span class="dot"></span>ChatGPT #1</span></td><td class="status-200">200</td><td>2,341</td></tr>
<tr><td>12:34:02</td><td>claude-opus-4-7</td><td><span class="provider claude"><span class="dot"></span>Claude #2</span></td><td class="status-200">200</td><td>5,102</td></tr>
<tr><td>12:33:58</td><td>gemini-2.5-pro</td><td><span class="provider gemini"><span class="dot"></span>Gemini #1</span></td><td class="status-200">200</td><td>843</td></tr>
<tr><td>12:33:41</td><td>gpt-5.4</td><td><span class="provider gpt"><span class="dot"></span>ChatGPT #2</span></td><td class="status-429">429</td><td></td></tr>
</tbody>
</table>
</div>
</div>
</section>
<!-- Footer -->
<footer class="puro-footer">
<div class="container footer-grid">
<div class="footer-brand">
<div class="brand"><span class="hex"></span><span>PURO AI</span></div>
<p class="footer-tagline">Self-hosted on puro.im</p>
<p class="footer-meta">© 2026 puro.im · MIT License<br>fork of Wei-Shaw/sub2api</p>
</div>
<div class="footer-col">
<div class="footer-col-title">产品</div>
<a href="/docs">文档</a>
<a href="https://git.puro.im/purovps/sub2api/commits/branch/main" target="_blank" rel="noopener noreferrer">更新日志</a>
</div>
<div class="footer-col">
<div class="footer-col-title">资源</div>
<a href="https://git.puro.im/purovps/sub2api" target="_blank" rel="noopener noreferrer">GitHub</a>
<a href="/docs#codex">Codex 配置示例</a>
<a href="https://status.puro.im" target="_blank" rel="noopener noreferrer">API 状态</a>
</div>
<div class="footer-col">
<div class="footer-col-title">联系</div>
<a href="mailto:admin@puro.im">admin@puro.im</a>
<a href="https://git.puro.im" target="_blank" rel="noopener noreferrer">git.puro.im</a>
</div>
</div>
</footer>
</div>
</template>
<script setup lang="ts">
// LandingView — public marketing landing page for PURO AI
// Rendered at `/` when user is unauthenticated (see router/index.ts)
</script>
<style scoped>
/* =============================================================
* LandingView — component-local styles
* Globals from puro.css (scoped to .puro-page) also provide:
* - .log-table, .provider.{claude,gpt,gemini}, .status-200/429 (dashboard mockup)
* - .nav, .nav-inner, .brand, .hex, .nav-links, .nav-cta (nav base)
* - .mono, .container, .btn, .btn-primary, .btn-ghost, .btn-lg (primitives)
* ============================================================= */
.puro-page {
min-height: 100vh;
background: var(--bg-0);
color: var(--text-0);
font-family: var(--font-sans);
position: relative;
overflow-x: hidden;
}
.hero {
text-align: center;
padding: 100px 24px 80px;
position: relative;
z-index: 2;
}
.hero-eyebrow { margin-bottom: 24px; }
.hero-title {
font-size: clamp(36px, 5.5vw, 64px);
font-weight: 800;
line-height: 1.1;
letter-spacing: -0.03em;
margin-bottom: 20px;
}
.hero-sub {
font-size: 18px;
color: var(--text-2);
line-height: 1.6;
max-width: 640px;
margin: 0 auto 36px;
}
.hero-cta {
display: flex;
gap: 12px;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 20px;
}
.hero-micro {
font-size: 13px;
color: var(--text-3);
font-family: var(--font-mono);
}
/* Note: these rules (.container / .section-*) intentionally override
* puro.css defaults with landing-page-specific values.
* puro.css has global defaults of: container max-width 1100px/padding 32px,
* section-title margin-bottom 16px, section-kicker letter-spacing 0.15em.
* Source-order ensures the scoped values below win. */
.container {
max-width: 1120px;
margin: 0 auto;
padding: 0 24px;
position: relative;
z-index: 2;
}
.block { padding: 80px 24px; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-kicker {
font-size: 12px;
font-weight: 600;
color: var(--cyan);
text-transform: uppercase;
letter-spacing: 0.12em;
margin-bottom: 12px;
font-family: var(--font-mono);
}
.section-title {
font-size: clamp(28px, 3.5vw, 40px);
font-weight: 700;
letter-spacing: -0.02em;
margin-bottom: 12px;
}
.section-sub { color: var(--text-2); font-size: 15px; }
/* model wall */
.model-wall {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 12px;
}
.model-card {
padding: 20px;
border: 1px solid var(--border);
border-radius: var(--r-lg);
background: var(--bg-1);
display: flex;
align-items: center;
gap: 12px;
}
.model-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.model-name { font-weight: 600; font-size: 14px; }
.model-meta { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }
.model-card.is-muted { opacity: 0.5; }
.model-card.is-muted .model-name { color: var(--text-2); }
/* features */
.features {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 16px;
}
.feature {
padding: 28px 24px;
border: 1px solid var(--border);
border-radius: var(--r-lg);
background: var(--bg-1);
}
.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature p { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.feature code { color: var(--cyan); font-size: 13px; }
/* code demo */
.code-demo {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
@media (max-width: 820px) { .code-demo { grid-template-columns: 1fr; } }
.code-block {
border: 1px solid var(--border);
border-radius: var(--r-lg);
background: var(--bg-code);
overflow: hidden;
}
.code-title {
padding: 10px 16px;
background: var(--bg-1);
font-size: 11px;
color: var(--text-3);
border-bottom: 1px solid var(--border);
}
.code-block pre {
padding: 16px;
font-size: 13px;
line-height: 1.6;
color: var(--text-1);
overflow-x: auto;
}
.cm { color: var(--text-3); }
.str { color: var(--cyan); }
.kw { color: var(--amber); }
.code-foot {
margin-top: 20px;
text-align: center;
font-size: 12px;
color: var(--text-3);
font-family: var(--font-mono);
}
/* dash mockup */
.dash-mock {
border: 1px solid var(--border);
border-radius: var(--r-xl);
background: var(--bg-1);
overflow: hidden;
box-shadow: 0 40px 80px -40px rgba(0,0,0,0.8);
}
.dash-header {
padding: 12px 16px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}
.dash-title { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }
.dash-dots { display: flex; gap: 6px; }
.dash-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.dash-body { padding: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
padding: 14px;
border: 1px solid var(--border);
border-radius: var(--r-md);
background: rgba(15,23,42,0.6);
}
.stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-mono); }
.stat-delta { font-size: 11px; color: var(--green); margin-top: 4px; font-family: var(--font-mono); }
.stat-delta.down { color: var(--red); }
.chart-card {
border: 1px solid var(--border);
border-radius: var(--r-md);
background: rgba(15,23,42,0.6);
padding: 16px;
margin-bottom: 20px;
}
.chart-title { font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.chart-svg { width: 100%; height: 120px; display: block; }
/* Nav sticky + responsive tweaks (augments puro.css defaults)
* Note: puro.css defines .puro-page .nav (z-index 50, blur 16px, gap 28px)
* at higher specificity; rules here only add what puro.css lacks
* (our darker sticky bg + mobile hide-nav-links). */
.nav {
position: sticky;
top: 0;
background: rgba(10,14,26,0.75);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
}
.nav-inner {
display: flex;
align-items: center;
gap: 28px;
padding: 16px 24px;
max-width: 1120px;
margin: 0 auto;
}
.brand {
display: flex;
align-items: center;
gap: 8px;
font-weight: 700;
font-size: 16px;
}
.brand .hex {
color: var(--cyan);
font-size: 20px;
}
.nav-links {
display: flex;
font-size: 14px;
color: var(--text-2);
}
.nav-links a:hover { color: var(--text-0); }
.nav-cta {
display: flex;
gap: 10px;
margin-left: auto;
}
@media (max-width: 640px) {
.nav-links { display: none; }
}
/* Footer */
.puro-footer {
margin-top: 80px;
padding: 60px 24px 40px;
border-top: 1px solid var(--border);
}
.footer-grid {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr;
gap: 36px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 12px; }
.footer-tagline { color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.footer-meta { color: var(--text-3); font-size: 12px; line-height: 1.7; }
.footer-col-title {
color: var(--text-0);
font-size: 13px;
font-weight: 600;
margin-bottom: 12px;
}
.footer-col a {
display: block;
color: var(--text-2);
font-size: 13px;
padding: 4px 0;
}
.footer-col a:hover { color: var(--cyan); }
/* pill */
.pill {
display: inline-block;
padding: 6px 14px;
border: 1px solid var(--border-2);
border-radius: 999px;
font-size: 12px;
color: var(--text-2);
background: rgba(15,23,42,0.6);
}
</style>

View File

@@ -46,6 +46,20 @@ export default {
800: '#1e293b',
900: '#0f172a',
950: '#020617'
},
// PURO AI 设计系统色板(给新页面 Landing/Auth/Docs 用,不影响 admin
puro: {
cyan: '#22d3ee',
'cyan-2': '#67e8f9',
purple: '#a855f7',
amber: '#fbbf24',
green: '#34d399',
red: '#f87171',
// 平台品牌点色
claude: '#d97757',
gpt: '#10a37f',
gemini: '#4285f4',
codex: '#f0a030'
}
},
fontFamily: {