From 116875fc4c1a5c0d3a4fe0f97f898dd8e6644b6c Mon Sep 17 00:00:00 2001 From: hacksynth Date: Thu, 3 Dec 2026 15:53:47 +0800 Subject: [PATCH 1/4] refactor: redesign UI per DESIGN.md and rename track to System Analyst --- DESIGN.md | 505 ++++++++++++++++++ README.md | 13 +- README_CN.md | 13 +- public/manifest.webmanifest | 4 +- src-tauri/tauri.conf.json | 6 +- src/app/(auth)/login/page.tsx | 11 +- src/app/(auth)/register/page.tsx | 9 +- .../(auth)/reset-password/[token]/page.tsx | 14 +- src/app/(auth)/reset-password/page.tsx | 8 +- src/app/(main)/analysis/page.tsx | 126 +++-- src/app/(main)/dashboard/page.tsx | 418 +++++++++------ .../(main)/exam/[attemptId]/result/page.tsx | 108 ++-- src/app/(main)/exam/history/page.tsx | 76 +-- src/app/(main)/exam/page.tsx | 104 ++-- src/app/(main)/knowledge/[id]/page.tsx | 88 +-- src/app/(main)/knowledge/page.tsx | 48 +- src/app/(main)/layout.tsx | 18 +- src/app/(main)/loading.tsx | 14 +- src/app/(main)/plan/[id]/page.tsx | 53 +- src/app/(main)/plan/page.tsx | 58 +- src/app/(main)/practice/case/page.tsx | 55 +- src/app/(main)/practice/page.tsx | 147 ++--- src/app/(main)/practice/topic/[id]/page.tsx | 59 +- src/app/(main)/profile/page.tsx | 136 ++--- src/app/api/plan/generate/route.ts | 94 +++- src/app/globals.css | 129 +++-- src/app/layout.tsx | 25 +- src/app/not-found.tsx | 14 +- src/app/page.tsx | 412 +++++++------- src/components/ai-assistant-loader.tsx | 4 +- src/components/ai-assistant.tsx | 62 ++- src/components/ai-diagnosis-button.tsx | 4 +- src/components/ai-explain-button.tsx | 19 +- src/components/ai-generate-client.tsx | 118 ++-- src/components/ai-grade-case-button.tsx | 45 +- src/components/ai-settings-card.tsx | 174 +++--- src/components/ai-task-queue-client.tsx | 198 +++---- .../ai-wrong-note-explanation-button.tsx | 33 +- src/components/ai-wrong-note-image-button.tsx | 31 +- src/components/case-answer-client.tsx | 150 +++--- src/components/case-figures.tsx | 71 ++- src/components/case-methodology-button.tsx | 16 +- src/components/continue-ai-chat-button.tsx | 9 +- src/components/decorative-background.tsx | 14 +- src/components/exam-actions.tsx | 12 +- src/components/exam-attempt-client.tsx | 97 ++-- src/components/landing-actions.tsx | 13 +- src/components/login-form.tsx | 119 +++-- src/components/main-nav.tsx | 145 +++-- src/components/markdown-renderer.tsx | 2 +- src/components/ose-date-picker.tsx | 21 +- src/components/ose-select.tsx | 10 +- .../password-reset-confirm-form.tsx | 111 ++-- .../password-reset-request-form.tsx | 101 ++-- src/components/plan-day-toggle.tsx | 29 +- src/components/plan-delete-button.tsx | 49 +- src/components/plan-generate-form.tsx | 25 +- src/components/practice-filter-cards.tsx | 54 +- src/components/practice-session.tsx | 139 ++--- src/components/profile-forms.tsx | 20 +- src/components/register-form.tsx | 140 +++-- src/components/start-practice-button.tsx | 4 +- .../today-plan-diagnosis-button.tsx | 11 +- src/components/ui/avatar.tsx | 39 +- src/components/ui/button.tsx | 25 +- src/components/ui/card.tsx | 39 +- src/components/ui/dropdown-menu.tsx | 64 ++- src/components/ui/input.tsx | 19 +- src/components/ui/label.tsx | 21 +- src/components/ui/toast.tsx | 9 +- src/components/variant-questions.tsx | 47 +- src/components/wrong-notes-client.tsx | 198 ++++--- src/lib/ai/prompts.ts | 32 +- src/prisma/knowledge-tree.ts | 2 +- src/prisma/seed.ts | 2 +- tailwind.config.ts | 106 +++- 76 files changed, 3361 insertions(+), 2057 deletions(-) create mode 100644 DESIGN.md diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..5c8be79 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,505 @@ +--- +version: alpha +name: Vercel Analysis +description: An analysis of Vercel's design language — the Geist system, a stark black-on-near-white developer-platform aesthetic where a single ink tone carries every heading, CTA, and border, and the only color the page allows itself is a multi-stop mesh gradient (cyan / blue / violet / magenta / amber) confined to the hero. Geist Sans drives tightly-tracked display type, Geist Mono labels the technical eyebrows, and pill-shaped black buttons mark the marketing CTAs while 6px square buttons handle app and nav chrome. + +colors: + primary: '#171717' + on-primary: '#ffffff' + ink: '#171717' + body: '#4d4d4d' + mute: '#8f8f8f' + faint: '#a1a1a1' + hairline: '#ebebeb' + hairline-soft: '#f2f2f2' + canvas: '#fafafa' + canvas-elevated: '#ffffff' + link: '#0070f3' + link-deep: '#0761d1' + link-soft: '#d3e5ff' + error: '#ee0000' + error-deep: '#c50000' + warning: '#f5a623' + warning-soft: '#ffefcf' + warning-deep: '#ab570a' + violet: '#7928ca' + violet-soft: '#d8ccf1' + cyan: '#50e3c2' + cyan-soft: '#aaffec' + pink: '#ff0080' + magenta: '#eb367f' + gradient-develop-start: '#007cf0' + gradient-develop-end: '#00dfd8' + gradient-preview-start: '#7928ca' + gradient-preview-end: '#ff0080' + gradient-ship-start: '#ff4d4d' + gradient-ship-end: '#f9cb28' + +typography: + display-xl: + fontFamily: Geist, Arial, sans-serif + fontSize: 48px + fontWeight: 600 + lineHeight: 48px + letterSpacing: -2.4px + heading-lg: + fontFamily: Geist, Arial, sans-serif + fontSize: 32px + fontWeight: 600 + lineHeight: 40px + letterSpacing: -1.28px + heading-md: + fontFamily: Geist, Arial, sans-serif + fontSize: 20px + fontWeight: 600 + lineHeight: 28px + letterSpacing: -0.4px + label-sm: + fontFamily: Geist, Arial, sans-serif + fontSize: 14px + fontWeight: 500 + lineHeight: 20px + letterSpacing: -0.28px + mono-eyebrow: + fontFamily: Geist Mono, ui-monospace, SFMono-Regular, Menlo, monospace + fontSize: 12px + fontWeight: 500 + lineHeight: 16px + letterSpacing: 0 + body-lg: + fontFamily: Geist, Arial, sans-serif + fontSize: 16px + fontWeight: 400 + lineHeight: 24px + letterSpacing: 0 + body-md: + fontFamily: Geist, Arial, sans-serif + fontSize: 14px + fontWeight: 400 + lineHeight: 20px + letterSpacing: 0 + body-sm: + fontFamily: Geist, Arial, sans-serif + fontSize: 12px + fontWeight: 400 + lineHeight: 16px + letterSpacing: 0 + button-lg: + fontFamily: Geist, Arial, sans-serif + fontSize: 16px + fontWeight: 500 + lineHeight: 20px + letterSpacing: 0 + button-md: + fontFamily: Geist, Arial, sans-serif + fontSize: 14px + fontWeight: 500 + lineHeight: 20px + letterSpacing: 0 + code: + fontFamily: Geist Mono, ui-monospace, SFMono-Regular, Menlo, monospace + fontSize: 14px + fontWeight: 400 + lineHeight: 20px + letterSpacing: 0 + +rounded: + none: 0px + sm: 6px + md: 12px + lg: 16px + pill-category: 64px + pill: 100px + full: 9999px + +spacing: + xxs: 4px + xs: 8px + sm: 12px + md: 16px + lg: 24px + xl: 32px + 2xl: 40px + 3xl: 64px + 4xl: 96px + section: 128px + +components: + nav-bar: + backgroundColor: '{colors.canvas}' + textColor: '{colors.body}' + typography: '{typography.body-md}' + borderColor: '{colors.hairline}' + padding: '{spacing.sm} {spacing.lg}' + nav-link: + textColor: '{colors.body}' + typography: '{typography.body-md}' + rounded: '{rounded.full}' + padding: '{spacing.xs} {spacing.sm}' + button-primary: + backgroundColor: '{colors.primary}' + textColor: '{colors.on-primary}' + typography: '{typography.button-lg}' + rounded: '{rounded.pill}' + padding: '0px 14px' + button-secondary: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + typography: '{typography.button-lg}' + rounded: '{rounded.pill}' + padding: '0px 14px' + button-primary-sm: + backgroundColor: '{colors.primary}' + textColor: '{colors.on-primary}' + typography: '{typography.button-md}' + rounded: '{rounded.sm}' + padding: '0px 6px' + button-ghost-sm: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.button-md}' + rounded: '{rounded.sm}' + padding: '0px 6px' + button-category-pill: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + typography: '{typography.button-md}' + rounded: '{rounded.pill-category}' + padding: '0px 16px' + button-icon-circular: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.body-lg}' + rounded: '{rounded.full}' + padding: '0px' + text-input: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.body-md}' + rounded: '{rounded.sm}' + padding: '{spacing.xs} {spacing.sm}' + feature-card: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.body-md}' + rounded: '{rounded.md}' + padding: '{spacing.lg}' + feature-card-elevated: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.body-md}' + rounded: '{rounded.md}' + padding: '{spacing.lg}' + pricing-card: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.body-md}' + rounded: '{rounded.lg}' + padding: '{spacing.xl}' + code-block: + backgroundColor: '{colors.canvas-elevated}' + textColor: '{colors.ink}' + borderColor: '{colors.hairline}' + typography: '{typography.code}' + rounded: '{rounded.md}' + padding: '{spacing.md}' + logo-strip: + backgroundColor: '{colors.canvas}' + textColor: '{colors.mute}' + typography: '{typography.body-md}' + padding: '{spacing.xl} {spacing.lg}' + hero-band: + backgroundColor: '{colors.canvas}' + textColor: '{colors.ink}' + typography: '{typography.display-xl}' + padding: '{spacing.section} {spacing.lg}' + cta-band: + backgroundColor: '{colors.canvas}' + textColor: '{colors.ink}' + typography: '{typography.display-xl}' + padding: '{spacing.4xl} {spacing.lg}' + footer: + backgroundColor: '{colors.canvas}' + textColor: '{colors.body}' + typography: '{typography.body-md}' + borderColor: '{colors.hairline}' + padding: '{spacing.3xl} {spacing.lg}' +--- + +## Overview + +Vercel's Geist system is an exercise in subtraction. The page is a near-white sheet (`{colors.canvas}` — #fafafa) carrying near-black ink (`{colors.ink}` — #171717), and almost nothing else competes. Headings, body copy, primary buttons, and the thin 1px borders that define every card all draw from the same ink-and-grey ladder. The one place color is allowed to exist is the hero, where a soft multi-stop **mesh gradient** — cyan, blue, violet, magenta, amber — blooms behind or beside the headline as the brand's entire decorative system. Everywhere else, restraint. + +Typography does the heavy lifting. **Geist Sans** sets the display headline in tightly-tracked weight-600 (the hero h1 runs -2.4px letter-spacing), and **Geist Mono** appears as small uppercase eyebrows labeling sections like a technical spec sheet. Buttons split into two shapes by context: the marketing CTAs are fully rounded black **pills** (`{rounded.pill}` — 100px, "Start Deploying" / "Get a Demo"), while nav and in-app controls use a tight 6px square (`{rounded.sm}`, "Sign Up" / "Log In"). The contrast between the rounded marketing pill and the square app button is itself a deliberate signal of which surface you're on. + +Surfaces barely lift. Cards are white (`{colors.canvas-elevated}`) on the #fafafa canvas, separated by a 1px hairline (`{colors.hairline}` — #ebebeb) and, at most, a whisper-soft layered shadow. Feature sections are built from precise grids of these hairline cards, often holding thin node-graph or code-editor illustrations rendered in the same ink-on-white palette. The page reads like documentation that happens to be selling something — engineered, exact, and confident enough to let a single gradient be the only flourish. + +**Key Characteristics:** + +- A single near-black ink (`{colors.ink}`) carries headings, body, primary CTAs, and borders on a near-white canvas (`{colors.canvas}`) — near-zero chromatic chrome. +- The multi-stop mesh gradient (cyan → blue → violet → magenta → amber) is the entire decorative system, confined to the hero. +- Two button shapes by context: rounded black **pills** (`{rounded.pill}`) for marketing CTAs, tight 6px squares (`{rounded.sm}`) for nav/app controls. +- Geist Sans for tightly-tracked display type (`{typography.display-xl}` at -2.4px), Geist Mono for uppercase technical eyebrows (`{typography.mono-eyebrow}`). +- Hairline-bordered white cards (`{colors.hairline}` on `{colors.canvas-elevated}`) in precise grids; depth via 1px border + whisper shadow, never heavy elevation. +- The classic Vercel gradient trio (develop/preview/ship) survives as a named accent system: `{colors.gradient-develop-start}`→end, preview, ship. +- Color-block page rhythm: white hero with mesh gradient → logo strip → hairline feature-card grid → code-editor band → template cards → black-text CTA band → grey footer. + +## Colors + +> Source pages analyzed: the home page, the AI Gateway page, the customers page, and the pricing page. The ink/canvas/hairline trio recurs on every page; the accent blue (`{colors.link}`) surfaces on pricing, and the mesh-gradient stops live in the hero. + +### Brand & Accent + +- **Ink** (`{colors.primary}` / `{colors.ink}` — #171717): the brand's defining near-black. Headings, primary CTA fill, logo, and the darkest text tier. Paired with `{colors.on-primary}` (white). +- **Vercel Blue** (`{colors.link}` — #0070f3): the link and accent blue — inline links, pricing highlights, focus signals. Darker press tone `{colors.link-deep}` (#0761d1), pale wash `{colors.link-soft}` (#d3e5ff). +- **Violet** (`{colors.violet}` — #7928ca), **Cyan** (`{colors.cyan}` — #50e3c2), **Pink** (`{colors.pink}` — #ff0080), **Magenta** (`{colors.magenta}` — #eb367f): the chromatic accent family, used sparingly for illustration accents and as mesh-gradient stops, never as chrome fills. + +### Surface + +- **Canvas** (`{colors.canvas}` — #fafafa): the default page background — the near-white sheet everything sits on. +- **Elevated** (`{colors.canvas-elevated}` — #ffffff): pure white for cards, buttons, inputs, and code blocks lifted off the canvas. +- **Hairline-Soft Surface** (`{colors.hairline-soft}` — #f2f2f2): the faintest grey fill for subtle alternating panels and inset wells. + +### Text + +- **Ink** (`{colors.ink}` — #171717): primary headings and high-emphasis text. +- **Body** (`{colors.body}` — #4d4d4d): standard paragraph and secondary copy, nav links. +- **Mute** (`{colors.mute}` — #8f8f8f): lower-emphasis captions, logo-strip labels, metadata. +- **Faint** (`{colors.faint}` — #a1a1a1): the lowest tier — placeholders, disabled labels. + +### Borders + +- **Hairline** (`{colors.hairline}` — #ebebeb): the 1px border on every card, input, and divider — the structural workhorse of the system. + +### Semantic + +- **Error** (`{colors.error}` — #ee0000): validation / destructive, with a deep press tier `{colors.error-deep}` (#c50000). +- **Warning** (`{colors.warning}` — #f5a623): caution states, with soft `{colors.warning-soft}` and deep `{colors.warning-deep}` tiers. +- **Success** maps to `{colors.link}` (#0070f3) — the blue doubles as the positive/active signal. + +### Brand Gradient + +Three named two-stop gradients form the legacy Vercel gradient identity, surviving as illustration and accent washes: + +- **Develop**: `{colors.gradient-develop-start}` (#007cf0) → `{colors.gradient-develop-end}` (#00dfd8) — blue to cyan. +- **Preview**: `{colors.gradient-preview-start}` (#7928ca) → `{colors.gradient-preview-end}` (#ff0080) — violet to pink. +- **Ship**: `{colors.gradient-ship-start}` (#ff4d4d) → `{colors.gradient-ship-end}` (#f9cb28) — red to amber. + These, blended together, form the hero's multi-stop mesh. + +## Typography + +### Font Family + +The system runs entirely on **Geist** — Vercel's own type family. **Geist Sans** (with an `Arial` system fallback) sets all UI and prose; **Geist Mono** sets code, inline technical tokens, and the small uppercase section eyebrows. There is no third face. Geist Sans is a clean geometric-humanist sans; substitute **Inter** if Geist is unavailable, and **JetBrains Mono** or **IBM Plex Mono** for Geist Mono. + +### Hierarchy + +| Token | Size | Weight | Line Height | Letter Spacing | Use | +| --------------------------- | ---- | ------ | ----------- | -------------- | ------------------------------------- | +| `{typography.display-xl}` | 48px | 600 | 48px | -2.4px | Hero headline | +| `{typography.heading-lg}` | 32px | 600 | 40px | -1.28px | Major section headings | +| `{typography.heading-md}` | 20px | 600 | 28px | -0.4px | Sub-section / card headings | +| `{typography.label-sm}` | 14px | 500 | 20px | -0.28px | Strong labels, nav emphasis | +| `{typography.mono-eyebrow}` | 12px | 500 | 16px | 0 | Uppercase Geist Mono section eyebrows | +| `{typography.body-lg}` | 16px | 400 | 24px | 0 | Lead paragraphs, large body | +| `{typography.body-md}` | 14px | 400 | 20px | 0 | Default body, nav links, table cells | +| `{typography.body-sm}` | 12px | 400 | 16px | 0 | Captions, footnotes, metadata | +| `{typography.button-lg}` | 16px | 500 | 20px | 0 | Marketing pill button labels | +| `{typography.button-md}` | 14px | 500 | 20px | 0 | Nav / app button labels | +| `{typography.code}` | 14px | 400 | 20px | 0 | Code blocks, inline code (Geist Mono) | + +### Principles + +- Display type is defined by tight negative tracking — the larger the heading, the tighter (-2.4px at hero scale, -1.28px at section scale). Body type sits at neutral spacing. +- Weight is binary: 600 for headings and 500 for buttons/labels; everything else is 400. There is no light or black weight, and no italic. +- Geist Mono is reserved for two roles only — code, and the small uppercase eyebrow labels that introduce sections like spec-sheet headers. + +### Note on Font Substitutes + +Geist Sans and Geist Mono are freely available (open-source, via Vercel / Google Fonts). If unavailable, **Inter** (sans) and **JetBrains Mono** (mono) are the closest open substitutes; keep heading weight at 600 and preserve the negative display tracking. + +## Layout + +### Spacing System + +- **Base unit**: 4px. The scale steps 4 → 8 → 12 → 16 → 24 → 32 → 40 → 64 → 96 → 128px. +- **Tokens**: `{spacing.xxs}` 4px · `{spacing.xs}` 8px · `{spacing.sm}` 12px · `{spacing.md}` 16px · `{spacing.lg}` 24px · `{spacing.xl}` 32px · `{spacing.2xl}` 40px · `{spacing.3xl}` 64px · `{spacing.4xl}` 96px · `{spacing.section}` 128px. +- **Card interiors** sit at `{spacing.lg}`–`{spacing.xl}` (24–32px); **section bands** run `{spacing.4xl}`–`{spacing.section}` (96–128px) of vertical rhythm. +- **Button padding** is horizontal-only — marketing pills run `0px 14px`, nav buttons `0px 6px` — with height set by line-height rather than vertical padding. + +### Grid & Container + +- Centered max-width container (~1200px) with comfortable gutters; the hero and CTA bands center their content. +- Feature sections use 2-up, 3-up, and 4-up hairline-card grids that collapse toward 1-up on narrow widths. +- The pricing page uses a multi-column tier grid; the customers page a logo / case-study grid. + +### Whitespace Philosophy + +Whitespace is structural. The near-white canvas and generous section padding do the separating work; cards are grouped by thin hairlines rather than heavy backgrounds. The page breathes — large vertical gaps between bands, tight internal rhythm inside cards. + +### Responsive Strategy + +#### Breakpoints + +| Name | Width | Key Changes | +| ------- | ------- | ---------------------------------------------------------------------------------------- | +| Mobile | ≤ 640px | Single-column stacks; nav → menu trigger; hero type scales down; pill CTAs go full-width | +| Tablet | 768px | 2-up card grids; condensed nav | +| Laptop | 1024px | 3–4-up grids; full nav row | +| Desktop | 1200px+ | Centered max-width container, full multi-column grids | + +#### Touch Targets + +Marketing pill CTAs (`{components.button-primary}`) and nav buttons clear the 44px WCAG-AAA target via line-height-driven height. Circular icon buttons (`{components.button-icon-circular}`) keep adequate hit area. + +#### Collapsing Strategy + +The nav row collapses behind a menu trigger; multi-column hairline-card grids reflow to a single column; code-editor and node-graph illustrations scale or scroll rather than shrink illegibly; the pricing tier grid stacks vertically. + +#### Image Behavior + +The hero mesh gradient is a CSS/SVG composition that scales fluidly. Feature illustrations (node graphs, code editors) are vector/HTML, ink-on-white, scaling crisply. Customer logos sit in a greyscale strip. No heavy raster photography. + +## Elevation & Depth + +| Level | Treatment | Use | +| ------------ | ------------------------------------------------------------------------------------------ | --------------------------------------------------- | +| 0 — Flat | 1px hairline (`{colors.hairline}`), no shadow | Default feature cards, inputs, dividers, the canvas | +| 1 — Whisper | Border + `0px 1px 1px rgba(0,0,0,0.04)` micro-shadow | Lightly-raised cards | +| 2 — Floating | Layered soft shadow (`0px 2px 2px` + `0px 8px 16px -4px` low-alpha black) + inset hairline | Menus, modals, tooltips | + +Depth is deliberately minimal. The system prefers a crisp 1px hairline plus the near-white-on-white surface step to a shadow; when a surface floats, it uses a finely-layered, very-low-alpha shadow stack rather than a single heavy drop. + +### Decorative Depth + +The hero **mesh gradient** is the only atmospheric element — a soft multi-stop bloom of the brand accent colors against the white canvas. Feature illustrations (ink node-graphs, code editors) add a sense of product depth without color. No glows, no heavy gradients elsewhere. + +## Shapes + +### Border Radius Scale + +| Token | Value | Use | +| ------------------------- | ------ | ----------------------------------------------- | +| `{rounded.none}` | 0px | Full-bleed bands, dividers | +| `{rounded.sm}` | 6px | Nav / app buttons, inputs | +| `{rounded.md}` | 12px | Feature cards, code blocks | +| `{rounded.lg}` | 16px | Pricing cards, larger panels | +| `{rounded.pill-category}` | 64px | Category-tab pills (AI Apps / Web Apps) | +| `{rounded.pill}` | 100px | Marketing CTA pills | +| `{rounded.full}` | 9999px | Circular icon buttons, avatars, nav ghost links | + +The radius language is bimodal: tight 6px squares for functional chrome, full pills for marketing CTAs and category tabs, with 12–16px on content cards in between. + +### Geometry + +Cards are rectangles at 12–16px radius; marketing buttons and category tabs are full pills; icon buttons and avatars are circular. Illustrations are line-weight vector graphics in ink on white. + +## Components + +> No hover states are documented. Each spec covers Default and (where extracted) pressed/active states. Variants live as separate `components:` entries. + +### Navigation + +**`nav-bar`** — top navigation + +- Background `{colors.canvas}`, bottom hairline `{colors.hairline}`, text `{colors.body}`, type `{typography.body-md}`, padding `{spacing.sm} {spacing.lg}`. Holds the black wordmark, ghost nav links, and the Sign Up / Log In buttons at right. + +**`nav-link`** — individual nav item + +- Body-grey text `{colors.body}`, type `{typography.body-md}`, fully rounded hit area `{rounded.full}`, padding `{spacing.xs} {spacing.sm}`. Transparent until interacted. + +### Buttons + +**`button-primary`** — the black marketing pill ("Start Deploying", "Deploy") + +- Background `{colors.primary}`, text `{colors.on-primary}`, type `{typography.button-lg}`, fully rounded `{rounded.pill}` (100px), padding `0px 14px`. + +**`button-secondary`** — the white marketing pill ("Get a Demo") + +- Background `{colors.canvas-elevated}`, text `{colors.ink}`, type `{typography.button-lg}`, rounded `{rounded.pill}`, padding `0px 14px`. Same pill shape as primary, inverted fill. + +**`button-primary-sm`** — the compact black nav CTA ("Sign Up") + +- Background `{colors.primary}`, text `{colors.on-primary}`, type `{typography.button-md}`, tight square `{rounded.sm}` (6px), padding `0px 6px`. + +**`button-ghost-sm`** — the white nav/app button ("Log In", "Ask AI") + +- Background `{colors.canvas-elevated}`, text `{colors.ink}`, 1px hairline `{colors.hairline}`, type `{typography.button-md}`, rounded `{rounded.sm}`, padding `0px 6px`. + +**`button-category-pill`** — the category-tab pill ("AI Apps", "Web Apps", "Ecommerce") + +- Background `{colors.canvas-elevated}`, text `{colors.ink}`, type `{typography.button-md}`, rounded `{rounded.pill-category}` (64px), padding `0px 16px`. + +**`button-icon-circular`** — circular icon / carousel control + +- Background `{colors.canvas-elevated}`, text `{colors.ink}`, 1px hairline `{colors.hairline}`, type `{typography.body-lg}`, rounded `{rounded.full}`, no padding. + +### Inputs & Forms + +**`text-input`** — default form field + +- Background `{colors.canvas-elevated}`, ink text `{colors.ink}`, 1px hairline `{colors.hairline}`, type `{typography.body-md}`, rounded `{rounded.sm}`, padding `{spacing.xs} {spacing.sm}`. + +### Cards & Containers + +**`feature-card`** — flat hairline content card + +- Background `{colors.canvas-elevated}`, 1px hairline `{colors.hairline}`, ink text `{colors.ink}`, type `{typography.body-md}`, rounded `{rounded.md}`, padding `{spacing.lg}`. The workhorse grid tile, often holding a node-graph or code illustration. + +**`feature-card-elevated`** — lifted card variant + +- Same chrome as `feature-card` with the Level-2 floating shadow for menus / featured tiles. + +**`pricing-card`** — pricing tier card + +- Background `{colors.canvas-elevated}`, 1px hairline `{colors.hairline}`, ink text `{colors.ink}`, type `{typography.body-md}`, rounded `{rounded.lg}`, padding `{spacing.xl}`. + +**`code-block`** — code / terminal surface + +- Background `{colors.canvas-elevated}`, ink text `{colors.ink}`, 1px hairline `{colors.hairline}`, monospace `{typography.code}`, rounded `{rounded.md}`, padding `{spacing.md}`. Syntax rendered in the ink-and-accent palette. + +### Bands + +**`logo-strip`** — customer logo band + +- Background `{colors.canvas}`, mute text `{colors.mute}`, type `{typography.body-md}`, padding `{spacing.xl} {spacing.lg}`. A greyscale row of customer wordmarks. + +**`hero-band`** — full-width hero section + +- Background `{colors.canvas}` with the mesh gradient, ink text `{colors.ink}`, display type `{typography.display-xl}`, padding `{spacing.section} {spacing.lg}`. + +**`cta-band`** — end-of-page call-to-action band ("Start Deploying") + +- Background `{colors.canvas}`, ink text `{colors.ink}`, display type `{typography.display-xl}`, padding `{spacing.4xl} {spacing.lg}`, with a `{components.button-primary}` pill. + +### Footer + +**`footer`** — site footer + +- Background `{colors.canvas}`, top hairline `{colors.hairline}`, body-grey text `{colors.body}`, type `{typography.body-md}`, padding `{spacing.3xl} {spacing.lg}`. Multi-column link groups under the wordmark. + +## Do's and Don'ts + +### Do + +- Keep the canvas near-white (`{colors.canvas}`) and let near-black ink (`{colors.ink}`) carry headings, CTAs, and borders — the system is a black-and-white duet. +- Confine color to the hero mesh gradient and small illustration accents; reserve `{colors.link}` for links and focus. +- Use the two button shapes by context: black pill (`{components.button-primary}`) for marketing CTAs, 6px square (`{components.button-primary-sm}`) for nav/app. +- Define cards and inputs with a 1px hairline (`{colors.hairline}`) before any shadow — flat is the default. +- Set display headings in Geist Sans 600 with tight negative tracking; label sections with uppercase Geist Mono eyebrows (`{typography.mono-eyebrow}`). +- Step the grey text ladder deliberately: `{colors.ink}` → `{colors.body}` → `{colors.mute}` → `{colors.faint}`. + +### Don't + +- Don't fill large surfaces with the accent colors — violet/cyan/pink/blue live in the gradient and illustrations, not as chrome. +- Don't mix the button shapes within one context — marketing CTAs stay pills, app/nav controls stay 6px squares. +- Don't pile on shadows — depth is a 1px hairline plus, at most, a finely-layered low-alpha shadow stack. +- Don't set body copy in pure black (`#000000`) — the brand's ink is #171717 and body steps to `{colors.body}`. +- Don't add a second decorative system — the mesh gradient is the only flourish; everything else is ink on white. +- Don't loosen the display tracking — large Geist headings carry tight negative letter-spacing by design. diff --git a/README.md b/README.md index 2b6b334..04ffd63 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,18 @@ Open Software Exam ``` -Open-source AI-powered exam preparation platform for China's Software Professional Qualification Exam +Open-source AI-powered exam preparation platform for China's Software Professional Qualification Exam (**System Analyst / 系统分析师**) [![GitHub Stars](https://img.shields.io/github/stars/hacksynth/ose?style=social)](https://github.com/hacksynth/ose/stargazers) [![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![CI](https://github.com/hacksynth/ose/actions/workflows/ci.yml/badge.svg)](https://github.com/hacksynth/ose/actions/workflows/ci.yml) -[中文文档](README_CN.md) - -Screenshots coming soon +[中文文档](README_CN.md) · [Design System](DESIGN.md) ## What is OSE? -OSE (Open Software Exam) is an open-source exam preparation platform built for China's Software Professional Qualification Exam, starting with the Software Designer track. It combines structured question practice, case analysis, mock exams, learning analytics, and AI assistance into one self-hostable learning workspace. +OSE (Open Software Exam) is an open-source exam preparation platform built for China's Software Professional Qualification Exam, focused on the **System Analyst (系统分析师)** track. It combines structured question practice, case analysis, mock exams, wrong-note review, learning analytics, and AI assistance into one self-hostable learning workspace. OSE is designed for candidates who want a repeatable study system, teachers who need transparent question banks, and teams that want a private AI-enabled training platform. The project focuses on practical exam workflows: learn a knowledge point, practice questions, review mistakes, run a mock exam, and adjust the plan based on data. @@ -31,10 +29,11 @@ The core promise is simple: **AI-Powered**, **Open Source**, and **Self-hostable ## Features - 📚 **Built-in question bank**: 41 历年真题 (2014–2025) — 1579 questions total: 1483 multiple-choice questions and 96 case-analysis questions, with the case-analysis questions further split into 263 sub-questions; AI-classified into a 56-node knowledge tree, baked into the seed so a fresh `db:seed` immediately produces a usable study workspace. -- 🤖 **AI assistance**: Claude, OpenAI, Gemini, and custom endpoints for explanations, grading, question generation, diagnosis, and study plans. +- 🤖 **AI assistance**: Claude, OpenAI, Gemini, and custom endpoints for deep explanations, case grading, question generation, learning diagnosis, wrong-note study cards, and personalized study plans. - 📊 **Learning analytics**: mastery heatmaps, weak-area diagnosis, predicted scores, and pass probability evaluation. - 📝 **Mock exams**: realistic exam sessions with countdown timers, answer sheets, and result reports. - 🧭 **Smart study plans**: AI-generated personalized preparation plans based on target date and current progress. +- ✨ **Minimalist Geist-inspired UI**: clean ink-on-canvas interface powered by Geist Sans & Geist Mono, 1px hairline cards, and high-contrast typography (see [DESIGN.md](DESIGN.md)). - 🖥️ **Multi-platform**: Web app, Tauri desktop installer (Windows/Linux/macOS), and Android-ready PWA. - 🔌 **Multi-provider AI**: Claude, OpenAI, Gemini, and OpenAI-compatible custom APIs. @@ -43,6 +42,7 @@ The core promise is simple: **AI-Powered**, **Open Source**, and **Self-hostable ![Next.js](https://img.shields.io/badge/Next.js-15-black?logo=nextdotjs) ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white) ![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-3-38B2AC?logo=tailwindcss&logoColor=white) +![Geist](https://img.shields.io/badge/Geist-Typography-171717) ![Prisma](https://img.shields.io/badge/Prisma-6-2D3748?logo=prisma&logoColor=white) ![SQLite](https://img.shields.io/badge/SQLite-built--in-003B57?logo=sqlite&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-roadmap-4169E1?logo=postgresql&logoColor=white) @@ -95,6 +95,7 @@ node scripts/capture-screenshots.mjs - [x] Phase 1: 选择题题库 + 练习 + 错题本 - [x] Phase 2: 案例分析题 + 模拟考试 + 知识点体系 - [x] Phase 3: AI 辅助(讲解/批改/出题/诊断/学习计划) +- [x] Geist 风格 UI 重构与系统分析师备考定位 - [x] Tauri 桌面版(支持 BUNDLE_NODE=1 自包含 Node.js) - [ ] 更多软考科目支持(信息系统项目管理师等) - [x] 历年真题内置(2014–2025,41 套,1579 题:1483 选择题 + 96 案例题 / 263 小问) diff --git a/README_CN.md b/README_CN.md index e956c25..0850d47 100644 --- a/README_CN.md +++ b/README_CN.md @@ -9,18 +9,18 @@ Open Software Exam ``` -面向中国软考的软件设计师考试的开源 AI 备考平台。 +面向中国软考**系统分析师**考试的开源 AI 备考平台。 [![GitHub Stars](https://img.shields.io/github/stars/hacksynth/ose?style=social)](https://github.com/hacksynth/ose/stargazers) [![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![CI](https://github.com/hacksynth/ose/actions/workflows/ci.yml/badge.svg)](https://github.com/hacksynth/ose/actions/workflows/ci.yml) -Screenshots coming soon +[English](README.md) · [设计规范](DESIGN.md) ## OSE 是什么? -OSE(Open Software Exam)是一个专为中国软考软件设计师考试打造的开源备考平台。它把题库练习、案例分析、模拟考试、错题本、学情分析和 AI 辅助整合到一个可自部署的学习工作台中。 +OSE(Open Software Exam)是一个专为中国软考**系统分析师**考试打造的开源备考平台。它把题库练习、案例分析、模拟考试、错题本、学情分析和 AI 辅助整合到一个可自部署的学习工作台中。 OSE 面向正在备考的考生、需要透明题库和学习数据的老师,以及希望搭建私有化 AI 培训系统的团队。系统围绕真实备考流程设计:学习知识点、刷题、复盘错题、参加模拟考试,再根据数据调整学习计划。 @@ -28,11 +28,12 @@ OSE 的核心卖点是:**AI 驱动**、**开源共建**、**可自部署**。 ## 功能特性 -- 📚 **内置题库**:2014–2025 年 41 套软考软件设计师历年真题 — 共 1579 道题:1483 道选择题 + 96 道案例题,案例题再细分为 263 道小问;已通过 AI 自动归类到 56 个叶子知识点;自部署跑一遍 `db:seed` 即可直接刷题。 -- 🤖 **AI 辅助**:支持 Claude、OpenAI、Gemini、自定义端点,提供 AI 讲解、批改、出题、诊断和学习计划。 +- 📚 **内置题库**:2014–2025 年 41 套软考系统分析师历年真题 — 共 1579 道题:1483 道选择题 + 96 道案例题,案例题再细分为 263 道小问;已通过 AI 自动归类到 56 个叶子知识点;自部署跑一遍 `db:seed` 即可直接刷题。 +- 🤖 **AI 辅助**:支持 Claude、OpenAI、Gemini、自定义端点,提供 AI 深度讲解、案例批改、智能出题、薄弱诊断、错题讲解图与个性化学习计划。 - 📊 **学情分析**:知识点掌握度热力图、薄弱诊断、预测得分、通过概率评估。 - 📝 **模拟考试**:真实考试模拟,倒计时、答题卡、成绩报告。 - 🧭 **智能学习计划**:根据目标考试日期和当前基础生成个性化备考计划。 +- ✨ **Geist 极简设计系统**:基于 Geist Sans 与 Geist Mono 字体、近白画布与 1px 细线卡片的高对比度工作台界面(详见 [DESIGN.md](DESIGN.md))。 - 🖥️ **多平台**:Web、Tauri 桌面端(Win/Linux/macOS)、Android PWA。 - 🔌 **多 AI 供应商**:Claude、OpenAI、Gemini、自定义 OpenAI 兼容接口。 @@ -41,6 +42,7 @@ OSE 的核心卖点是:**AI 驱动**、**开源共建**、**可自部署**。 ![Next.js](https://img.shields.io/badge/Next.js-15-black?logo=nextdotjs) ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white) ![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-3-38B2AC?logo=tailwindcss&logoColor=white) +![Geist](https://img.shields.io/badge/Geist-Typography-171717) ![Prisma](https://img.shields.io/badge/Prisma-6-2D3748?logo=prisma&logoColor=white) ![SQLite](https://img.shields.io/badge/SQLite-built--in-003B57?logo=sqlite&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-roadmap-4169E1?logo=postgresql&logoColor=white) @@ -93,6 +95,7 @@ node scripts/capture-screenshots.mjs - [x] Phase 1: 选择题题库 + 练习 + 错题本 - [x] Phase 2: 案例分析题 + 模拟考试 + 知识点体系 - [x] Phase 3: AI 辅助(讲解/批改/出题/诊断/学习计划) +- [x] Geist 风格 UI 重构与系统分析师备考定位 - [x] Tauri 桌面版(支持 BUNDLE_NODE=1 自包含 Node.js 运行时) - [ ] 更多软考科目支持(信息系统项目管理师等) - [x] 历年真题内置(2014–2025,41 套,1579 题:1483 选择题 + 96 道案例题 / 263 小问) diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index 4dd61b0..71c73d6 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -7,8 +7,8 @@ "scope": "/", "display": "standalone", "orientation": "portrait", - "background_color": "#f8fafc", - "theme_color": "#f97316", + "background_color": "#fafafa", + "theme_color": "#171717", "categories": ["education", "productivity"], "icons": [ { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 4ed8e61..adf0873 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -13,7 +13,7 @@ "windows": [ { "label": "main", - "title": "OSE 软考备考 - 软件设计师智能备考平台", + "title": "OSE 软考备考 - 系统分析师智能备考平台", "width": 1280, "height": 800, "minWidth": 900, @@ -37,8 +37,6 @@ "icons/icon.icns", "icons/icon.ico" ], - "resources": [ - "binaries/standalone/**/*" - ] + "resources": ["binaries/standalone/**/*"] } } diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx index c4b740e..ba8479d 100644 --- a/src/app/(auth)/login/page.tsx +++ b/src/app/(auth)/login/page.tsx @@ -1,12 +1,10 @@ -import { Suspense } from "react"; -import { DecorativeBackground } from "@/components/decorative-background"; -import { LoginForm } from "@/components/login-form"; +import { Suspense } from 'react'; +import { LoginForm } from '@/components/login-form'; export default function LoginPage() { return ( -
- -
+
+
@@ -14,4 +12,3 @@ export default function LoginPage() {
); } - diff --git a/src/app/(auth)/register/page.tsx b/src/app/(auth)/register/page.tsx index ae8efa7..0f88c91 100644 --- a/src/app/(auth)/register/page.tsx +++ b/src/app/(auth)/register/page.tsx @@ -1,14 +1,11 @@ -import { DecorativeBackground } from "@/components/decorative-background"; -import { RegisterForm } from "@/components/register-form"; +import { RegisterForm } from '@/components/register-form'; export default function RegisterPage() { return ( -
- -
+
+
); } - diff --git a/src/app/(auth)/reset-password/[token]/page.tsx b/src/app/(auth)/reset-password/[token]/page.tsx index dd9b8a3..fc3ce70 100644 --- a/src/app/(auth)/reset-password/[token]/page.tsx +++ b/src/app/(auth)/reset-password/[token]/page.tsx @@ -1,12 +1,14 @@ -import { DecorativeBackground } from "@/components/decorative-background"; -import { PasswordResetConfirmForm } from "@/components/password-reset-confirm-form"; +import { PasswordResetConfirmForm } from '@/components/password-reset-confirm-form'; -export default async function ResetPasswordConfirmPage({ params }: { params: Promise<{ token: string }> }) { +export default async function ResetPasswordConfirmPage({ + params, +}: { + params: Promise<{ token: string }>; +}) { const { token } = await params; return ( -
- -
+
+
diff --git a/src/app/(auth)/reset-password/page.tsx b/src/app/(auth)/reset-password/page.tsx index 68b2681..39ccd4e 100644 --- a/src/app/(auth)/reset-password/page.tsx +++ b/src/app/(auth)/reset-password/page.tsx @@ -1,11 +1,9 @@ -import { DecorativeBackground } from "@/components/decorative-background"; -import { PasswordResetRequestForm } from "@/components/password-reset-request-form"; +import { PasswordResetRequestForm } from '@/components/password-reset-request-form'; export default function ResetPasswordRequestPage() { return ( -
- -
+
+
diff --git a/src/app/(main)/analysis/page.tsx b/src/app/(main)/analysis/page.tsx index 84c2e08..6dcbc93 100644 --- a/src/app/(main)/analysis/page.tsx +++ b/src/app/(main)/analysis/page.tsx @@ -8,70 +8,84 @@ import { Button } from '@/components/ui/button'; import { AIDiagnosisButton } from '@/components/ai-diagnosis-button'; function heat(status: string) { - if (status === '危险') return 'bg-red-200 text-red-800'; - if (status === '薄弱') return 'bg-orange-200 text-orange-800'; - if (status === '一般') return 'bg-softYellow text-navy'; - if (status === '良好') return 'bg-softGreen text-green-800'; - return 'bg-gray-100 text-muted'; + if (status === '危险') return 'border-error/30 bg-error-soft text-error-deep'; + if (status === '薄弱') return 'border-warning/35 bg-warning-soft/60 text-warning-deep'; + if (status === '一般') return 'border-hairline bg-hairline-soft/80 text-ink'; + if (status === '良好') return 'border-link/25 bg-link-soft/45 text-link-deep'; + return 'border-hairline bg-canvas text-mute'; } export default async function AnalysisPage() { const session = await auth(); if (!session?.user?.id) redirect('/login'); const userId = session.user.id; - const pageUser = await prisma.user.findUnique({ where: { id: userId }, select: { targetExamDate: true } }); + const pageUser = await prisma.user.findUnique({ + where: { id: userId }, + select: { targetExamDate: true }, + }); const data = await getUserAnalysis(userId, pageUser?.targetExamDate); const maxCount = Math.max(1, ...data.trend.map((day) => day.count)); return ( -
-
-

Learning Analysis

-

学情诊断

-

- 用做题数据定位薄弱环节,生成更精准的复习策略。 -

+
+
+

LEARNING ANALYSIS

+

学情诊断

+

用做题数据定位薄弱环节,生成更精准的复习策略。

+
- -

综合掌握度

-

+ +

OVERALL MASTERY

+

{data.overview.overallMastery}%

+

综合掌握度

- -

预测上午分

-

+ +

PREDICTED SCORE

+

{data.overview.predictedAMScore} - /75 + /75

+

预测上午分

- -

已学习知识点

-

+ +

TOPICS COVERED

+

{data.overview.studiedKnowledgePoints} - /{data.overview.totalKnowledgePoints} + + /{data.overview.totalKnowledgePoints} +

+

已学习知识点

- -

通过概率

-

+ +

PASS PROBABILITY

+

{data.overview.passProbability}

+

通过概率

-
- -

知识点掌握热力图

-
+ +
+ +

HEATMAP

+

知识点掌握热力图

+
{data.knowledgePoints.map((kp) => ( -
- - {kp.name} · {kp.mastery}% +
+ + {kp.name} · {kp.mastery}% -
+
{kp.children?.map((child) => ( -
- {child.name}:{child.mastery}% · {child.status} +
+ {child.name}:{child.mastery}% ·{' '} + {child.status}
))}
@@ -79,22 +93,24 @@ export default async function AnalysisPage() { ))}
- -

薄弱环节 Top 5

-
+ + +

PRIORITY FOCUS

+

薄弱环节 Top 5

+
{data.weakPoints.map((kp) => (
-

{kp.name}

-

+

{kp.name}

+

掌握度 {kp.mastery}% · 做题 {kp.count} · 正确率 {kp.accuracy}% · 错题{' '} {kp.wrongCount}

-
@@ -102,26 +118,30 @@ export default async function AnalysisPage() {
- -

最近 30 天趋势

-
+ + +

30-DAY ACTIVITY

+

最近 30 天趋势

+
{data.trend.map((day) => ( -
+
- {day.date.slice(8)} + {day.date.slice(8)}
))}
- -

AI 诊断分析

+ + +

AI DIAGNOSIS

+

AI 诊断分析

diff --git a/src/app/(main)/dashboard/page.tsx b/src/app/(main)/dashboard/page.tsx index df32755..64ff031 100644 --- a/src/app/(main)/dashboard/page.tsx +++ b/src/app/(main)/dashboard/page.tsx @@ -1,6 +1,7 @@ import Link from 'next/link'; import { redirect } from 'next/navigation'; import { + ArrowUpRight, BookOpenCheck, Brain, CalendarCheck, @@ -202,26 +203,32 @@ export default async function DashboardPage() { const stats = [ { + eyebrow: 'TOTAL ANSWERED', label: '做题总数', value: totalAnswers, unit: '题', icon: FileQuestion, - className: 'bg-softYellow', }, - { label: '正确率', value: accuracy, unit: '%', icon: Target, className: 'bg-softBlue' }, { + eyebrow: 'ACCURACY', + label: '综合正确率', + value: accuracy, + unit: '%', + icon: Target, + }, + { + eyebrow: 'STREAK', label: '连续学习', value: streakDays, unit: '天', icon: TrendingUp, - className: 'bg-softGreen', }, { + eyebrow: aiQuestionCount ? 'AI QUESTIONS' : 'TODAY', label: aiQuestionCount ? 'AI 出题' : '今日做题', value: aiQuestionCount || todayChoiceAnswers + todayCaseAnswers, unit: '题', icon: aiQuestionCount ? Sparkles : CalendarCheck, - className: 'bg-softRose', }, ]; @@ -235,176 +242,282 @@ export default async function DashboardPage() { Array.isArray(todayPlanDay?.tasks) ? (todayPlanDay.tasks as string[]) : [] ).slice(0, 4); + const shortcuts = [ + { + href: '/practice/ai-generate', + icon: Sparkles, + eyebrow: 'AI STUDIO', + title: 'AI 出题', + description: '按薄弱知识点定制选择题与案例题。', + }, + { + href: '/practice', + icon: BookOpenCheck, + eyebrow: 'PRACTICE', + title: '开始练习', + description: '按知识点模块刷题,定位薄弱环节。', + }, + { + href: '/wrong-notes', + icon: ClipboardCheck, + eyebrow: 'REVIEW', + title: '查看错题', + description: `当前未掌握错题 ${unmasteredWrong} 道。`, + }, + { + href: '/analysis', + icon: Brain, + eyebrow: 'DIAGNOSIS', + title: '学情诊断', + description: '分析薄弱知识点与预计通过概率。', + }, + { + href: '/plan', + icon: CalendarCheck, + eyebrow: 'SCHEDULE', + title: '学习计划', + description: '按倒计时生成每日备考任务。', + }, + { + href: '/exam', + icon: ScrollText, + eyebrow: 'MOCK EXAM', + title: '模拟考试', + description: '限时完成整套全真模拟卷。', + }, + { + href: '/practice/case', + icon: ClipboardPenLine, + eyebrow: 'CASE STUDY', + title: '案例分析', + description: '训练系统分析师下午题。', + }, + { + href: '/profile', + icon: UserRound, + eyebrow: 'SETTINGS', + title: '个人中心', + description: '查看学习热力图与 AI 模型配置。', + }, + ]; + return ( -
-
-
-

- 今天也很适合进步一点点 -

-

- 欢迎回来,{session.user.name || '学习伙伴'} -

-

- {formatChinaDate(new Date())} ·{' '} - {exam.custom ? '你的目标考试时间是' : '最近一次软考约在'} {formatChinaDate(exam.date)} - ,还有 {exam.days} 天 +

+
+ +

DASHBOARD · SYSTEM ANALYST

+

欢迎回来,{session.user.name || '学习伙伴'}

+

+ {formatChinaDate(new Date())} · {exam.custom ? '目标考试时间' : '最近一次软考约在'}{' '} + {formatChinaDate(exam.date)} + ,剩余 {exam.days} 天

-
- - -
-
- + + +
-

考试倒计时

-

+
+

COUNTDOWN

+ +
+

{exam.days} - 天 -

+ 天 +

+

距离目标考试日期

-
- -

保持每天 20 题,错题复盘比盲目刷题更重要。

+
+

保持每日 20 题,错题复盘比盲目刷题更有效。

-
+
{stats.map((stat) => { const Icon = stat.icon; return ( - +
-

{stat.label}

- - - +

{stat.eyebrow}

+
-

+

{stat.value} - {stat.unit} + {stat.unit}

+

{stat.label}

); })}
{activePlan ? ( - -

今日任务

-

来自学习计划:{activePlan.title}

-
    + +
    +
    +

    TODAY'S PLAN

    +

    今日任务

    +

    来自学习计划:{activePlan.title}

    +
    +
    + + {todayPlanDay ? ( + + ) : null} +
    +
    +
      {todayTasks.map((task, index) => ( -
    • {task}
    • +
    • + + {task} +
    • ))}
    -
    - - {todayPlanDay ? ( - - ) : null} -
    ) : null} - -

    综合掌握度

    -

    {accuracy}%

    - -
    - - {recentExam ? ( - -

    最近考试成绩

    -

    {recentExam.exam.title}

    -

    - {recentExam.totalScore} - /{recentExam.exam.totalScore} -

    - +
    + +
    +

    MASTERY

    +

    综合掌握度

    +

    + {accuracy}% +

    +
    +
    + +
    - ) : null} -
    - -

    最近做题记录

    + {recentExam ? ( + +
    +

    LATEST MOCK EXAM

    +

    最近考试成绩

    +

    {recentExam.exam.title}

    +

    + {recentExam.totalScore} + /{recentExam.exam.totalScore} +

    +
    +
    + +
    +
    + ) : ( + +
    +

    MOCK EXAM

    +

    模拟考试

    +

    + 还没有已完成的模拟考试,按真实考场计时检验阶段复习成果。 +

    +
    +
    + +
    +
    + )} +
    + +
    + +

    RECENT ACTIVITY

    +

    最近做题记录

    {recentAnswers.length ? ( -
    +
    {recentAnswers.map((answer) => (
    -
    -

    +

    +

    {answer.question.knowledgePoint.parent?.name ?? answer.question.knowledgePoint.name}{' '} · {answer.question.knowledgePoint.name}

    -

    +

    {formatShortTime(answer.createdAt)}

    {answer.isCorrect ? ( - + ) : ( - + )}
    ))}
    ) : ( -

    还没有做题记录,先开始第一组练习吧。

    +

    还没有做题记录,先开始第一组练习。

    )} - -

    - - 薄弱知识点 Top 5 -

    + + +
    +

    WEAK TOPICS

    + +
    +

    薄弱知识点 Top 5

    {weakTopics.length ? (
    {weakTopics.map((topic) => (
    -
    - - {topic.name} · {topic.total} 题 +
    + + {topic.name}{' '} + + {topic.total} 题 + + + + {topic.accuracy}% - {topic.accuracy}%
    @@ -420,77 +533,64 @@ export default async function DashboardPage() { ))}
    ) : ( -

    完成一些练习后会显示薄弱知识点。

    +

    完成一些练习后会显示薄弱知识点。

    )} - -

    7 天学习趋势

    -
    + + +

    7-DAY TREND

    +

    7 天学习趋势

    +
    {trend.map((item) => (
    - {item.date} + {item.date}
    ))}
    -

    - 柱高表示做题量,深色高度表示正确率。 -

    +

    柱高表示做题量,深色高度表示正确率。

    -
    - - -

    AI 出题

    -

    让 AI 为你量身生成练习题。

    - - - -

    开始练习

    -

    按知识点刷题,快速定位薄弱环节。

    - - - -

    查看错题

    -

    当前未掌握错题 {unmasteredWrong} 道。

    - - - -

    学情诊断

    -

    定位薄弱知识点和通过概率。

    - - - -

    学习计划

    -

    生成每日备考任务。

    - - - -

    模拟考试

    -

    限时完成整套模拟卷。

    - - - -

    案例分析

    -

    训练软件设计师下午题。

    - - - -

    个人中心

    -

    查看学习热力图和知识点掌握情况。

    - +
    +
    +

    QUICK ACCESS

    +

    工作台入口

    +
    +
    + {shortcuts.map((item) => { + const Icon = item.icon; + return ( + +
    +
    + {item.eyebrow} + +
    +
    + +

    + {item.title} +

    +
    +

    {item.description}

    +
    + + ); + })} +
); diff --git a/src/app/(main)/exam/[attemptId]/result/page.tsx b/src/app/(main)/exam/[attemptId]/result/page.tsx index 9c4458b..2a65fd8 100644 --- a/src/app/(main)/exam/[attemptId]/result/page.tsx +++ b/src/app/(main)/exam/[attemptId]/result/page.tsx @@ -68,38 +68,52 @@ export default async function ExamResultPage({ ]) ); return ( -
- -

成绩报告

-

{attempt.exam.title}

+
+ +

EXAM REPORT

+

{attempt.exam.title}

-
-

总分

-

+

+

TOTAL SCORE

+

{attempt.totalScore ?? 0} - /{attempt.exam.totalScore} + /{attempt.exam.totalScore}

+

总分

-
-

状态

-

{pass ? '通过' : '未通过'}

-

及格线 {passScore} 分

+
+

STATUS

+

+ {pass ? '通过' : '未通过'} +

+

及格线 {passScore} 分

-
-

选择题

-

{attempt.choiceScore ?? 0}

+
+

CHOICE

+

+ {attempt.choiceScore ?? 0} +

+

选择题得分

-
-

案例题

-

{attempt.caseScore ?? 0}

+
+

CASE STUDY

+

+ {attempt.caseScore ?? 0} +

+

案例题得分

{diff !== null ? ( -

- 比上次{diff >= 0 ? '提高' : '降低'}了 {Math.abs(diff)} 分 +

+ 较上次{diff >= 0 ? '提高' : '降低'}了{' '} + {Math.abs(diff)} 分

) : null} -
+
@@ -108,7 +122,8 @@ export default async function ExamResultPage({
-
+ +
{attempt.exam.questions.map((examQuestion) => { const answer = attempt.answers.find( (item) => item.questionId === examQuestion.questionId @@ -118,54 +133,63 @@ export default async function ExamResultPage({ return (
-

- 第 {examQuestion.orderNumber} 题 · {q.content} +

+ + #{examQuestion.orderNumber} + + {q.content}

{q.type === 'CHOICE' ? ( answer?.isCorrect ? ( - + ) : ( - + ) ) : ( - + {answer?.score ?? 0} 分 )}
{q.type === 'CHOICE' ? ( -
-

+

+

你的答案: - {q.options.find((o) => o.id === answer?.selectedOptionId)?.label ?? '未答'} + + {q.options.find((o) => o.id === answer?.selectedOptionId)?.label ?? '未答'} +

-

+

正确答案:{correctOption?.label}. {correctOption?.content}

-

解析:{q.explanation}

+

解析:{q.explanation}

) : ( -
+
{q.caseScenario?.subQuestions.map((sub) => { const caseMap = (answer?.caseAnswers ?? {}) as Record; const grade = caseGradeBySubId.get(sub.id); const subScore = grade?.score ?? 0; return ( -
-

- ({sub.subNumber}){sub.content} · {subScore}/{sub.score}分 -

-

- 你的答案:{caseMap[sub.id] || '未答'} +

+

+ ({sub.subNumber}){sub.content}{' '} + + · {subScore}/{sub.score}分 +

-

+

你的答案:{caseMap[sub.id] || '未答'}

+

参考答案:{sub.referenceAnswer}

{grade?.feedback ? ( -

批改:{grade.feedback}

+

批改:{grade.feedback}

) : null} -

解析:{sub.explanation}

+

解析:{sub.explanation}

); })} diff --git a/src/app/(main)/exam/history/page.tsx b/src/app/(main)/exam/history/page.tsx index 77d0610..8c19a68 100644 --- a/src/app/(main)/exam/history/page.tsx +++ b/src/app/(main)/exam/history/page.tsx @@ -3,6 +3,7 @@ import { redirect } from 'next/navigation'; import { auth } from '@/lib/auth'; import { prisma } from '@/lib/prisma'; import { Card } from '@/components/ui/card'; +import { Button } from '@/components/ui/button'; import { HISTORY_PAGE_SIZE } from '@/lib/constants'; export default async function ExamHistoryPage({ @@ -41,43 +42,50 @@ export default async function ExamHistoryPage({ const maxScore = Math.max(1, ...trendPool.map((a) => a.totalScore ?? 0)); return ( -
-
-

Exam History

-

考试历史

-

复盘每一次模拟考试,观察成绩变化趋势。

+
+
+

EXAM HISTORY

+

考试历史

+

复盘每一次模拟考试,观察成绩变化趋势。

- -

成绩趋势

-
- {trendPool.map((attempt) => ( -
-
- {attempt.totalScore} -
- ))} -
+ +

SCORE TREND

+

成绩趋势

+ {trendPool.length ? ( +
+ {trendPool.map((attempt) => ( +
+
+ {attempt.totalScore} +
+ ))} +
+ ) : ( +

暂无已完成的模拟考试记录。

+ )} -
+
{attempts.map((attempt) => (
-

{attempt.exam.title}

-

+

{attempt.exam.title}

+

{new Intl.DateTimeFormat('zh-CN', { dateStyle: 'medium', timeStyle: 'short', }).format(attempt.startedAt)}

- + {attempt.status === 'COMPLETED' ? `${attempt.totalScore}/${attempt.exam.totalScore}` : '未完成'} @@ -86,25 +94,19 @@ export default async function ExamHistoryPage({ ))}
{totalPages > 1 ? ( -