feat(frontend): 切换苹果风格默认主题

This commit is contained in:
yinjianm
2026-04-21 04:34:03 +08:00
parent 6253b90151
commit 6503d2bb39
8 changed files with 482 additions and 111 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"permissions": {
"allow": [
"mcp__ace-tool__search_context"
]
}
}
+2 -1
View File
@@ -158,4 +158,5 @@ dist-scripts/
/packages/backend/data
electron-app/node_modules/
electron-app/dist_electron/
electron-app/dist_electron/
.ace-tool/
@@ -1 +1,13 @@
{"status":"completed","completed":5,"failed":0,"pending":0,"total":5,"done":5,"percent":100,"current":"文件管理删除、上传和菜单稳定性修复已完成","updated_at":"2026-03-26 04:14:00"}
{
"status": "completed",
"completed": 6,
"failed": 0,
"skipped": 0,
"pending": 0,
"uncertain": 0,
"total": 6,
"done": 6,
"percent": 100,
"current": "-",
"updated_at": "2026-04-21 04:28:38"
}
@@ -39,11 +39,10 @@
## 执行日志
| 时间 | 任务 | 状态 | 备注 |
|------|------|------|------|
| 2026-03-26 03:24 | 1.1 | 完成 | 创建 implementation 方案包,范围锁定为文件管理删除、上传和菜单稳定性修复 |
| 2026-03-26 04:03 | 2.1 | 完成 | `FileManagerContextMenu.vue` 桌面端子菜单补点击展开,避免“终端 / 上传 / 压缩”点击无反应 |
| 时间 | 事件 | 详情 |
|------|------|------|
| 2026-03-26 04:05 | 2.2 | 完成 | 拖拽上传前新增目标目录确认,并在当前可见目录上传完成后主动刷新 |
| 2026-03-26 04:08 | 3.1 | 完成 | 目录删除改为“仅删空目录 / 强制递归删除”双确认,后端 `sftp:rmdir` 接收 `recursive` 标志 |
| 2026-03-26 04:10 | 3.2 | 完成 | 删除目录后若当前/待加载路径失效,前端自动回退父目录,终止持续 `No such file` 重试 |
| 2026-03-26 04:14 | 4.1 | 完成 | `npm run build --workspace @nexus-terminal/frontend``@nexus-terminal/backend` 均通过 |
| 2026-04-21 04:28:38 | 进度快照(自动) | 完成:6 失败:0 跳过:0 待做:0 (100%) |
+313
View File
@@ -0,0 +1,313 @@
# Design System Inspired by Apple
## 1. Visual Theme & Atmosphere
Apple's website is a masterclass in controlled drama — vast expanses of pure black and near-white serve as cinematic backdrops for products that are photographed as if they were sculptures in a gallery. The design philosophy is reductive to its core: every pixel exists in service of the product, and the interface itself retreats until it becomes invisible. This is not minimalism as aesthetic preference; it is minimalism as reverence for the object.
The typography anchors everything. San Francisco (SF Pro Display for large sizes, SF Pro Text for body) is Apple's proprietary typeface, engineered with optical sizing that automatically adjusts letterforms depending on point size. At display sizes (56px), weight 600 with a tight line-height of 1.07 and subtle negative letter-spacing (-0.28px) creates headlines that feel machined rather than typeset — precise, confident, and unapologetically direct. At body sizes (17px), the tracking loosens slightly (-0.374px) and line-height opens to 1.47, creating a reading rhythm that is comfortable without ever feeling slack.
The color story is starkly binary. Product sections alternate between pure black (`#000000`) backgrounds with white text and light gray (`#f5f5f7`) backgrounds with near-black text (`#1d1d1f`). This creates a cinematic pacing — dark sections feel immersive and premium, light sections feel open and informational. The only chromatic accent is Apple Blue (`#0071e3`), reserved exclusively for interactive elements: links, buttons, and focus states. This singular accent color in a sea of neutrals gives every clickable element unmistakable visibility.
**Key Characteristics:**
- SF Pro Display/Text with optical sizing — letterforms adapt automatically to size context
- Binary light/dark section rhythm: black (`#000000`) alternating with light gray (`#f5f5f7`)
- Single accent color: Apple Blue (`#0071e3`) reserved exclusively for interactive elements
- Product-as-hero photography on solid color fields — no gradients, no textures, no distractions
- Extremely tight headline line-heights (1.07-1.14) creating compressed, billboard-like impact
- Full-width section layout with centered content — the viewport IS the canvas
- Pill-shaped CTAs (980px radius) creating soft, approachable action buttons
- Generous whitespace between sections allowing each product moment to breathe
## 2. Color Palette & Roles
### Primary
- **Pure Black** (`#000000`): Hero section backgrounds, immersive product showcases. The darkest canvas for the brightest products.
- **Light Gray** (`#f5f5f7`): Alternate section backgrounds, informational areas. Not white — the slight blue-gray tint prevents sterility.
- **Near Black** (`#1d1d1f`): Primary text on light backgrounds, dark button fills. Slightly warmer than pure black for comfortable reading.
### Interactive
- **Apple Blue** (`#0071e3`): `--sk-focus-color`, primary CTA backgrounds, focus rings. The ONLY chromatic color in the interface.
- **Link Blue** (`#0066cc`): `--sk-body-link-color`, inline text links. Slightly darker than Apple Blue for text-level readability.
- **Bright Blue** (`#2997ff`): Links on dark backgrounds. Higher luminance for contrast on black sections.
### Text
- **White** (`#ffffff`): Text on dark backgrounds, button text on blue/dark CTAs.
- **Near Black** (`#1d1d1f`): Primary body text on light backgrounds.
- **Black 80%** (`rgba(0, 0, 0, 0.8)`): Secondary text, nav items on light backgrounds. Slightly softened.
- **Black 48%** (`rgba(0, 0, 0, 0.48)`): Tertiary text, disabled states, carousel controls.
### Surface & Dark Variants
- **Dark Surface 1** (`#272729`): Card backgrounds in dark sections.
- **Dark Surface 2** (`#262628`): Subtle surface variation in dark contexts.
- **Dark Surface 3** (`#28282a`): Elevated cards on dark backgrounds.
- **Dark Surface 4** (`#2a2a2d`): Highest dark surface elevation.
- **Dark Surface 5** (`#242426`): Deepest dark surface tone.
### Button States
- **Button Active** (`#ededf2`): Active/pressed state for light buttons.
- **Button Default Light** (`#fafafc`): Search/filter button backgrounds.
- **Overlay** (`rgba(210, 210, 215, 0.64)`): Media control scrims, overlays.
- **White 32%** (`rgba(255, 255, 255, 0.32)`): Hover state on dark modal close buttons.
### Shadows
- **Card Shadow** (`rgba(0, 0, 0, 0.22) 3px 5px 30px 0px`): Soft, diffused elevation for product cards. Offset and wide blur create a natural, photographic shadow.
## 3. Typography Rules
### Font Family
- **Display**: `SF Pro Display`, with fallbacks: `SF Pro Icons, Helvetica Neue, Helvetica, Arial, sans-serif`
- **Body**: `SF Pro Text`, with fallbacks: `SF Pro Icons, Helvetica Neue, Helvetica, Arial, sans-serif`
- SF Pro Display is used at 20px and above; SF Pro Text is optimized for 19px and below.
### Hierarchy
| Role | Font | Size | Weight | Line Height | Letter Spacing | Notes |
|------|------|------|--------|-------------|----------------|-------|
| Display Hero | SF Pro Display | 56px (3.50rem) | 600 | 1.07 (tight) | -0.28px | Product launch headlines, maximum impact |
| Section Heading | SF Pro Display | 40px (2.50rem) | 600 | 1.10 (tight) | normal | Feature section titles |
| Tile Heading | SF Pro Display | 28px (1.75rem) | 400 | 1.14 (tight) | 0.196px | Product tile headlines |
| Card Title | SF Pro Display | 21px (1.31rem) | 700 | 1.19 (tight) | 0.231px | Bold card headings |
| Sub-heading | SF Pro Display | 21px (1.31rem) | 400 | 1.19 (tight) | 0.231px | Regular card headings |
| Nav Heading | SF Pro Text | 34px (2.13rem) | 600 | 1.47 | -0.374px | Large navigation headings |
| Sub-nav | SF Pro Text | 24px (1.50rem) | 300 | 1.50 | normal | Light sub-navigation text |
| Body | SF Pro Text | 17px (1.06rem) | 400 | 1.47 | -0.374px | Standard reading text |
| Body Emphasis | SF Pro Text | 17px (1.06rem) | 600 | 1.24 (tight) | -0.374px | Emphasized body text, labels |
| Button Large | SF Pro Text | 18px (1.13rem) | 300 | 1.00 (tight) | normal | Large button text, light weight |
| Button | SF Pro Text | 17px (1.06rem) | 400 | 2.41 (relaxed) | normal | Standard button text |
| Link | SF Pro Text | 14px (0.88rem) | 400 | 1.43 | -0.224px | Body links, "Learn more" |
| Caption | SF Pro Text | 14px (0.88rem) | 400 | 1.29 (tight) | -0.224px | Secondary text, descriptions |
| Caption Bold | SF Pro Text | 14px (0.88rem) | 600 | 1.29 (tight) | -0.224px | Emphasized captions |
| Micro | SF Pro Text | 12px (0.75rem) | 400 | 1.33 | -0.12px | Fine print, footnotes |
| Micro Bold | SF Pro Text | 12px (0.75rem) | 600 | 1.33 | -0.12px | Bold fine print |
| Nano | SF Pro Text | 10px (0.63rem) | 400 | 1.47 | -0.08px | Legal text, smallest size |
### Principles
- **Optical sizing as philosophy**: SF Pro automatically switches between Display and Text optical sizes. Display versions have wider letter spacing and thinner strokes optimized for large sizes; Text versions are tighter and sturdier for small sizes. This means the font literally changes its DNA based on context.
- **Weight restraint**: The scale spans 300 (light) to 700 (bold) but most text lives at 400 (regular) and 600 (semibold). Weight 300 appears only on large decorative text. Weight 700 is rare, used only for bold card titles.
- **Negative tracking at all sizes**: Unlike most systems that only track headlines, Apple applies subtle negative letter-spacing even at body sizes (-0.374px at 17px, -0.224px at 14px, -0.12px at 12px). This creates universally tight, efficient text.
- **Extreme line-height range**: Headlines compress to 1.07 while body text opens to 1.47, and some button contexts stretch to 2.41. This dramatic range creates clear visual hierarchy through rhythm alone.
## 4. Component Stylings
### Buttons
**Primary Blue (CTA)**
- Background: `#0071e3` (Apple Blue)
- Text: `#ffffff`
- Padding: 8px 15px
- Radius: 8px
- Border: 1px solid transparent
- Font: SF Pro Text, 17px, weight 400
- Hover: background brightens slightly
- Active: `#ededf2` background shift
- Focus: `2px solid var(--sk-focus-color, #0071E3)` outline
- Use: Primary call-to-action ("Buy", "Shop iPhone")
**Primary Dark**
- Background: `#1d1d1f`
- Text: `#ffffff`
- Padding: 8px 15px
- Radius: 8px
- Font: SF Pro Text, 17px, weight 400
- Use: Secondary CTA, dark variant
**Pill Link (Learn More / Shop)**
- Background: transparent
- Text: `#0066cc` (light bg) or `#2997ff` (dark bg)
- Radius: 980px (full pill)
- Border: 1px solid `#0066cc`
- Font: SF Pro Text, 14px-17px
- Hover: underline decoration
- Use: "Learn more" and "Shop" links — the signature Apple inline CTA
**Filter / Search Button**
- Background: `#fafafc`
- Text: `rgba(0, 0, 0, 0.8)`
- Padding: 0px 14px
- Radius: 11px
- Border: 3px solid `rgba(0, 0, 0, 0.04)`
- Focus: `2px solid var(--sk-focus-color, #0071E3)` outline
- Use: Search bars, filter controls
**Media Control**
- Background: `rgba(210, 210, 215, 0.64)`
- Text: `rgba(0, 0, 0, 0.48)`
- Radius: 50% (circular)
- Active: scale(0.9), background shifts
- Focus: `2px solid var(--sk-focus-color, #0071e3)` outline, white bg, black text
- Use: Play/pause, carousel arrows
### Cards & Containers
- Background: `#f5f5f7` (light) or `#272729`-`#2a2a2d` (dark)
- Border: none (borders are rare in Apple's system)
- Radius: 5px-8px
- Shadow: `rgba(0, 0, 0, 0.22) 3px 5px 30px 0px` for elevated product cards
- Content: centered, generous padding
- Hover: no standard hover state — cards are static, links within them are interactive
### Navigation
- Background: `rgba(0, 0, 0, 0.8)` (translucent dark) with `backdrop-filter: saturate(180%) blur(20px)`
- Height: 48px (compact)
- Text: `#ffffff` at 12px, weight 400
- Active: underline on hover
- Logo: Apple logomark (SVG) centered or left-aligned, 17x48px viewport
- Mobile: collapses to hamburger with full-screen overlay menu
- The nav floats above content, maintaining its dark translucent glass regardless of section background
### Image Treatment
- Products on solid-color fields (black or white) — no backgrounds, no context, just the object
- Full-bleed section images that span the entire viewport width
- Product photography at extremely high resolution with subtle shadows
- Lifestyle images confined to rounded-corner containers (12px+ radius)
### Distinctive Components
**Product Hero Module**
- Full-viewport-width section with solid background (black or `#f5f5f7`)
- Product name as the primary headline (SF Pro Display, 56px, weight 600)
- One-line descriptor below in lighter weight
- Two pill CTAs side by side: "Learn more" (outline) and "Buy" / "Shop" (filled)
**Product Grid Tile**
- Square or near-square card on contrasting background
- Product image dominating 60-70% of the tile
- Product name + one-line description below
- "Learn more" and "Shop" link pair at bottom
**Feature Comparison Strip**
- Horizontal scroll of product variants
- Each variant as a vertical card with image, name, and key specs
- Minimal chrome — the products speak for themselves
## 5. Layout Principles
### Spacing System
- Base unit: 8px
- Scale: 2px, 4px, 5px, 6px, 7px, 8px, 9px, 10px, 11px, 14px, 15px, 17px, 20px, 24px
- Notable characteristic: the scale is dense at small sizes (2-11px) with granular 1px increments, then jumps in larger steps. This allows precise micro-adjustments for typography and icon alignment.
### Grid & Container
- Max content width: approximately 980px (the recurring "980px radius" in pill buttons echoes this width)
- Hero: full-viewport-width sections with centered content block
- Product grids: 2-3 column layouts within centered container
- Single-column for hero moments — one product, one message, full attention
- No visible grid lines or gutters — spacing creates implied structure
### Whitespace Philosophy
- **Cinematic breathing room**: Each product section occupies a full viewport height (or close to it). The whitespace between products is not empty — it is the pause between scenes in a film.
- **Vertical rhythm through color blocks**: Rather than using spacing alone to separate sections, Apple uses alternating background colors (black, `#f5f5f7`, white). Each color change signals a new "scene."
- **Compression within, expansion between**: Text blocks are tightly set (negative letter-spacing, tight line-heights) while the space surrounding them is vast. This creates a tension between density and openness.
### Border Radius Scale
- Micro (5px): Small containers, link tags
- Standard (8px): Buttons, product cards, image containers
- Comfortable (11px): Search inputs, filter buttons
- Large (12px): Feature panels, lifestyle image containers
- Full Pill (980px): CTA links ("Learn more", "Shop"), navigation pills
- Circle (50%): Media controls (play/pause, arrows)
## 6. Depth & Elevation
| Level | Treatment | Use |
|-------|-----------|-----|
| Flat (Level 0) | No shadow, solid background | Standard content sections, text blocks |
| Navigation Glass | `backdrop-filter: saturate(180%) blur(20px)` on `rgba(0,0,0,0.8)` | Sticky navigation bar — the glass effect |
| Subtle Lift (Level 1) | `rgba(0, 0, 0, 0.22) 3px 5px 30px 0px` | Product cards, floating elements |
| Media Control | `rgba(210, 210, 215, 0.64)` background with scale transforms | Play/pause buttons, carousel controls |
| Focus (Accessibility) | `2px solid #0071e3` outline | Keyboard focus on all interactive elements |
**Shadow Philosophy**: Apple uses shadow extremely sparingly. The primary shadow (`3px 5px 30px` with 0.22 opacity) is soft, wide, and offset — mimicking a diffused studio light casting a natural shadow beneath a physical object. This reinforces the "product as physical sculpture" metaphor. Most elements have NO shadow at all; elevation comes from background color contrast (dark card on darker background, or light card on slightly different gray).
### Decorative Depth
- Navigation glass: the translucent, blurred navigation bar is the most recognizable depth element, creating a sense of floating UI above scrolling content
- Section color transitions: depth is implied by the alternation between black and light gray sections rather than by shadows
- Product photography shadows: the products themselves cast shadows in their photography, so the UI doesn't need to add synthetic ones
## 7. Do's and Don'ts
### Do
- Use SF Pro Display at 20px+ and SF Pro Text below 20px — respect the optical sizing boundary
- Apply negative letter-spacing at all text sizes (not just headlines) — Apple tracks tight universally
- Use Apple Blue (`#0071e3`) ONLY for interactive elements — it must be the singular accent
- Alternate between black and light gray (`#f5f5f7`) section backgrounds for cinematic rhythm
- Use 980px pill radius for CTA links — the signature Apple link shape
- Keep product imagery on solid-color fields with no competing visual elements
- Use the translucent dark glass (`rgba(0,0,0,0.8)` + blur) for sticky navigation
- Compress headline line-heights to 1.07-1.14 — Apple headlines are famously tight
### Don't
- Don't introduce additional accent colors — the entire chromatic budget is spent on blue
- Don't use heavy shadows or multiple shadow layers — Apple's shadow system is one soft diffused shadow or nothing
- Don't use borders on cards or containers — Apple almost never uses visible borders (except on specific buttons)
- Don't apply wide letter-spacing to SF Pro — it is designed to run tight at every size
- Don't use weight 800 or 900 — the maximum is 700 (bold), and even that is rare
- Don't add textures, patterns, or gradients to backgrounds — solid colors only
- Don't make the navigation opaque — the glass blur effect is essential to the Apple UI identity
- Don't center-align body text — Apple body copy is left-aligned; only headlines center
- Don't use rounded corners larger than 12px on rectangular elements (980px is for pills only)
## 8. Responsive Behavior
### Breakpoints
| Name | Width | Key Changes |
|------|-------|-------------|
| Small Mobile | <360px | Minimum supported, single column |
| Mobile | 360-480px | Standard mobile layout |
| Mobile Large | 480-640px | Wider single column, larger images |
| Tablet Small | 640-834px | 2-column product grids begin |
| Tablet | 834-1024px | Full tablet layout, expanded nav |
| Desktop Small | 1024-1070px | Standard desktop layout begins |
| Desktop | 1070-1440px | Full layout, max content width |
| Large Desktop | >1440px | Centered with generous margins |
### Touch Targets
- Primary CTAs: 8px 15px padding creating ~44px touch height
- Navigation links: 48px height with adequate spacing
- Media controls: 50% radius circular buttons, minimum 44x44px
- "Learn more" pills: generous padding for comfortable tapping
### Collapsing Strategy
- Hero headlines: 56px Display → 40px → 28px on mobile, maintaining tight line-height proportionally
- Product grids: 3-column → 2-column → single column stacked
- Navigation: full horizontal nav → compact mobile menu (hamburger)
- Product hero modules: full-bleed maintained at all sizes, text scales down
- Section backgrounds: maintain full-width color blocks at all breakpoints — the cinematic rhythm never breaks
- Image sizing: products scale proportionally, never crop — the product silhouette is sacred
### Image Behavior
- Product photography maintains aspect ratio at all breakpoints
- Hero product images scale down but stay centered
- Full-bleed section backgrounds persist at every size
- Lifestyle images may crop on mobile but maintain their rounded corners
- Lazy loading for below-fold product images
## 9. Agent Prompt Guide
### Quick Color Reference
- Primary CTA: Apple Blue (`#0071e3`)
- Page background (light): `#f5f5f7`
- Page background (dark): `#000000`
- Heading text (light): `#1d1d1f`
- Heading text (dark): `#ffffff`
- Body text: `rgba(0, 0, 0, 0.8)` on light, `#ffffff` on dark
- Link (light bg): `#0066cc`
- Link (dark bg): `#2997ff`
- Focus ring: `#0071e3`
- Card shadow: `rgba(0, 0, 0, 0.22) 3px 5px 30px 0px`
### Example Component Prompts
- "Create a hero section on black background. Headline at 56px SF Pro Display weight 600, line-height 1.07, letter-spacing -0.28px, color white. One-line subtitle at 21px SF Pro Display weight 400, line-height 1.19, color white. Two pill CTAs: 'Learn more' (transparent bg, white text, 1px solid white border, 980px radius) and 'Buy' (Apple Blue #0071e3 bg, white text, 8px radius, 8px 15px padding)."
- "Design a product card: #f5f5f7 background, 8px border-radius, no border, no shadow. Product image top 60% of card on solid background. Title at 28px SF Pro Display weight 400, letter-spacing 0.196px, line-height 1.14. Description at 14px SF Pro Text weight 400, color rgba(0,0,0,0.8). 'Learn more' and 'Shop' links in #0066cc at 14px."
- "Build the Apple navigation: sticky, 48px height, background rgba(0,0,0,0.8) with backdrop-filter: saturate(180%) blur(20px). Links at 12px SF Pro Text weight 400, white text. Apple logo left, links centered, search and bag icons right."
- "Create an alternating section layout: first section black bg with white text and centered product image, second section #f5f5f7 bg with #1d1d1f text. Each section near full-viewport height with 56px headline and two pill CTAs below."
- "Design a 'Learn more' link: text #0066cc on light bg or #2997ff on dark bg, 14px SF Pro Text, underline on hover. After the text, include a right-arrow chevron character (>). Wrap in a container with 980px border-radius for pill shape when used as a standalone CTA."
### Iteration Guide
1. Every interactive element gets Apple Blue (`#0071e3`) — no other accent colors
2. Section backgrounds alternate: black for immersive moments, `#f5f5f7` for informational moments
3. Typography optical sizing: SF Pro Display at 20px+, SF Pro Text below — never mix
4. Negative letter-spacing at all sizes: -0.28px at 56px, -0.374px at 17px, -0.224px at 14px, -0.12px at 12px
5. The navigation glass effect (translucent dark + blur) is non-negotiable — it defines the Apple web experience
6. Products always appear on solid color fields — never on gradients, textures, or lifestyle backgrounds in hero modules
7. Shadow is rare and always soft: `3px 5px 30px 0.22 opacity` or nothing at all
8. Pill CTAs use 980px radius — this creates the signature Apple rounded-rectangle-that-looks-like-a-capsule shape
+31 -22
View File
@@ -25,31 +25,40 @@ export const defaultXtermTheme: ITheme = {
brightWhite: '#f3fff0'
};
// 默认 UI 主题 (CSS 变量)
// (与 backend/src/config/default-themes.ts 中的定义保持一致)
// 默认 UI 主题 (CSS 变量) — Apple Design System Light
// (与 frontend/src/features/appearance/config/default-themes.ts 保持一致)
export const defaultUiTheme: Record<string, string> = {
'--app-bg-color': '#ffffff',
'--text-color': '#333333',
'--text-color-secondary': '#666666',
'--border-color': '#cccccc',
'--link-color': '#8E44AD',
'--link-hover-color': '#B180E0',
'--link-active-color': '#A06CD5',
'--link-active-bg-color': '#F3EBFB',
'--app-bg-color': '#f5f5f7', // Apple Light Gray
'--text-color': '#1d1d1f', // Near Black
'--text-color-secondary': 'rgba(0, 0, 0, 0.8)', // Black 80%
'--text-color-tertiary': 'rgba(0, 0, 0, 0.48)', // Black 48%
'--border-color': 'rgba(0, 0, 0, 0.08)', // Ultra-subtle border
'--link-color': '#0066cc', // Link Blue
'--link-hover-color': '#0071e3', // Apple Blue
'--link-active-color': '#0071e3', // Apple Blue
'--link-active-bg-color': 'rgba(0, 113, 227, 0.08)', // Blue 8%
'--nav-item-active-bg-color': 'var(--link-active-bg-color)',
'--header-bg-color': '#f0f0f0',
'--footer-bg-color': '#f0f0f0',
'--button-bg-color': '#A06CD5',
'--header-bg-color': '#e8e8ed',
'--footer-bg-color': '#f5f5f7',
'--card-bg-color': '#ffffff',
'--button-bg-color': '#0071e3', // Apple Blue CTA
'--button-text-color': '#ffffff',
'--button-hover-bg-color': '#8E44AD',
'--icon-color': 'var(--text-color-secondary)',
'--icon-hover-color': 'var(--link-hover-color)',
'--split-line-color': 'var(--border-color)',
'--split-line-hover-color': 'var(--border-color)',
'--input-focus-border-color': 'var(--link-active-color)',
'--input-focus-glow': 'var(--link-active-color)',
'--overlay-bg-color': 'rgba(0, 0, 0, 0.6)',
'--font-family-sans-serif': 'sans-serif',
'--button-hover-bg-color': '#0077ed',
'--button-secondary-bg-color': '#e8e8ed',
'--icon-color': 'rgba(0, 0, 0, 0.48)',
'--icon-hover-color': '#0071e3',
'--split-line-color': 'rgba(0, 0, 0, 0.08)',
'--split-line-hover-color': 'rgba(0, 0, 0, 0.16)',
'--input-focus-border-color': '#0071e3',
'--input-focus-glow': '#0071e3',
'--overlay-bg-color': 'rgba(0, 0, 0, 0.4)',
'--color-success': '#30d158',
'--color-error': '#ff453a',
'--color-warning': '#ff9f0a',
'--color-success-text': '#ffffff',
'--color-error-text': '#ffffff',
'--color-warning-text': '#1d1d1f',
'--font-family-sans-serif': "-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif",
'--base-padding': '1rem',
'--base-margin': '0.5rem',
};
@@ -25,31 +25,40 @@ export const defaultXtermTheme: ITheme = {
brightWhite: '#f3fff0'
};
// 默认 UI 主题 (CSS 变量)
// 默认 UI 主题 (CSS 变量) — Apple Design System Light
// (与 backend/src/config/default-themes.ts 中的定义保持一致)
export const defaultUiTheme: Record<string, string> = {
'--app-bg-color': '#ffffff',
'--text-color': '#333333',
'--text-color-secondary': '#666666',
'--border-color': '#cccccc',
'--link-color': '#8E44AD', // 现代紫色 (Amethyst 变种)
'--link-hover-color': '#B180E0', // 现代紫色 - 悬停 (更亮)
'--link-active-color': '#A06CD5', // 现代紫色 - 激活 (基础)
'--link-active-bg-color': '#F3EBFB', /* 现代紫色 - 激活背景 (非常浅) */
'--nav-item-active-bg-color': 'var(--link-active-bg-color)', /* Added */
'--header-bg-color': '#f0f0f0',
'--footer-bg-color': '#f0f0f0',
'--button-bg-color': '#A06CD5', // 现代紫色 - 激活 (基础)
'--app-bg-color': '#f5f5f7', // Apple Light Gray
'--text-color': '#1d1d1f', // Near Black
'--text-color-secondary': 'rgba(0, 0, 0, 0.8)', // Black 80%
'--text-color-tertiary': 'rgba(0, 0, 0, 0.48)', // Black 48%
'--border-color': 'rgba(0, 0, 0, 0.08)', // Ultra-subtle border
'--link-color': '#0066cc', // Link Blue
'--link-hover-color': '#0071e3', // Apple Blue
'--link-active-color': '#0071e3', // Apple Blue
'--link-active-bg-color': 'rgba(0, 113, 227, 0.08)', // Blue 8%
'--nav-item-active-bg-color': 'var(--link-active-bg-color)',
'--header-bg-color': '#e8e8ed',
'--footer-bg-color': '#f5f5f7',
'--card-bg-color': '#ffffff',
'--button-bg-color': '#0071e3', // Apple Blue CTA
'--button-text-color': '#ffffff',
'--button-hover-bg-color': '#8E44AD', // 现代紫色 - 悬停 (稍暗)
'--icon-color': 'var(--text-color-secondary)', // 图标颜色
'--icon-hover-color': 'var(--link-hover-color)', // 图标悬停颜色 (自动更新)
'--split-line-color': 'var(--border-color)', /* 分割线颜色 */
'--split-line-hover-color': 'var(--border-color)', /* 分割线悬停颜色 */
'--input-focus-border-color': 'var(--link-active-color)', /* 输入框聚焦边框颜色 (自动更新) */
'--input-focus-glow': 'var(--link-active-color)', /* 输入框聚焦光晕值 (自动更新) */
'--overlay-bg-color': 'rgba(0, 0, 0, 0.6)', /* Added Overlay Background - 恢复 rgba 以支持透明度 */
'--font-family-sans-serif': 'sans-serif',
'--button-hover-bg-color': '#0077ed',
'--button-secondary-bg-color': '#e8e8ed',
'--icon-color': 'rgba(0, 0, 0, 0.48)',
'--icon-hover-color': '#0071e3',
'--split-line-color': 'rgba(0, 0, 0, 0.08)',
'--split-line-hover-color': 'rgba(0, 0, 0, 0.16)',
'--input-focus-border-color': '#0071e3',
'--input-focus-glow': '#0071e3',
'--overlay-bg-color': 'rgba(0, 0, 0, 0.4)',
'--color-success': '#30d158',
'--color-error': '#ff453a',
'--color-warning': '#ff9f0a',
'--color-success-text': '#ffffff',
'--color-error-text': '#ffffff',
'--color-warning-text': '#1d1d1f',
'--font-family-sans-serif': "-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif",
'--base-padding': '1rem',
'--base-margin': '0.5rem',
};
+82 -61
View File
@@ -1,28 +1,31 @@
@import "tailwindcss";
/* Tailwind Theme Variables Mapping */
/* Tailwind Theme Variables Mapping — Apple Design System */
@theme inline {
/* Base Colors */
--color-background: var(--app-bg-color); /* More generic name */
--color-foreground: var(--text-color); /* More generic name */
--color-app: var(--app-bg-color); /* Keep specific if needed */
--color-text-default: var(--text-color); /* Keep specific if needed */
--color-background: var(--app-bg-color);
--color-foreground: var(--text-color);
--color-app: var(--app-bg-color);
--color-text-default: var(--text-color);
--color-text-secondary: var(--text-color-secondary);
--color-border: var(--border-color); /* Simplified name */
--color-border-default: var(--border-color); /* Keep specific if needed */
--color-text-tertiary: var(--text-color-tertiary);
--color-border: var(--border-color);
--color-border-default: var(--border-color);
--color-link: var(--link-color);
--color-link-hover: var(--link-hover-color);
--color-link-active: var(--link-active-color); /* Also used as primary/theme color */
--color-primary: var(--link-active-color); /* Map primary to active link color */
--color-link-active-bg: var(--link-active-bg-color); /* Map active link background */
--color-nav-active-bg: var(--nav-item-active-bg-color); /* Map specific nav active background */
--color-link-active: var(--link-active-color);
--color-primary: var(--link-active-color);
--color-link-active-bg: var(--link-active-bg-color);
--color-nav-active-bg: var(--nav-item-active-bg-color);
/* Component Colors */
--color-header: var(--header-bg-color);
--color-footer: var(--footer-bg-color);
--color-card: var(--card-bg-color);
--color-button: var(--button-bg-color);
--color-button-text: var(--button-text-color);
--color-button-hover: var(--button-hover-bg-color);
--color-button-secondary: var(--button-secondary-bg-color);
--color-icon: var(--icon-color);
--color-icon-hover: var(--icon-hover-color);
--color-split-line: var(--split-line-color);
@@ -35,58 +38,77 @@
--color-success-text: var(--color-success-text);
--color-warning-text: var(--color-warning-text);
--color-error-text: var(--color-error-text);
/* Radius Scale (Apple) */
--radius-micro: 5px;
--radius-standard: 8px;
--radius-comfortable: 11px;
--radius-large: 12px;
--radius-pill: 980px;
/* Shadow (Apple) */
--shadow-card: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;
--shadow-subtle: rgba(0, 0, 0, 0.04) 0px 1px 3px 0px;
}
/* 全局样式和 CSS 变量定义 */
/* ─────────────────────────────────────────────
Apple Design System — Light Theme Variables
───────────────────────────────────────────── */
:root {
/* 基础颜色 */
--app-bg-color: #ffffff; /* 应用背景色 */
--text-color: #333333; /* 主要文字颜色 */
--text-color-secondary: #666666; /* 次要文字颜色 */
--border-color: #cccccc; /* 边框颜色 */
--link-color: #333; /* 链接颜色 */
--link-hover-color: #0056b3; /* 链接悬停颜色 */
--link-active-color: #007bff; /* 激活链接/主题色 */
--link-active-bg-color: #e0e0ff; /* 激活链接背景色 (类似 indigo-50) */
--nav-item-active-bg-color: var(--link-active-bg-color); /* 导航选中项背景色, 默认同激活链接背景 */
/* Base Colors (Apple Light) */
--app-bg-color: #f5f5f7; /* Apple Light Gray — main canvas */
--text-color: #1d1d1f; /* Near Black — primary text */
--text-color-secondary: rgba(0, 0, 0, 0.8); /* Black 80% — secondary text */
--text-color-tertiary: rgba(0, 0, 0, 0.48); /* Black 48% — tertiary, disabled */
--border-color: rgba(0, 0, 0, 0.08); /* Ultra-subtle border */
--link-color: #0066cc; /* Link Blue on light bg */
--link-hover-color: #0071e3; /* Apple Blue — hover */
--link-active-color: #0071e3; /* Apple Blue — primary accent */
--link-active-bg-color: rgba(0, 113, 227, 0.08); /* Blue 8% — active bg */
--nav-item-active-bg-color: var(--link-active-bg-color);
/* 组件颜色 */
--header-bg-color: #f0f0f0; /* 头部背景色 */
--footer-bg-color: #f0f0f0; /* 底部背景色 */
--button-bg-color: #007bff; /* 按钮背景色 */
--button-text-color: #ffffff; /* 按钮文字颜色 */
--button-hover-bg-color: #0056b3;/* 按钮悬停背景色 */
--icon-color: var(--text-color-secondary); /* 图标颜色 */
--icon-hover-color: var(--link-hover-color); /* 图标悬停颜色 */
--split-line-color: var(--border-color); /* 分割线颜色 */
--split-line-hover-color: var(--border-color); /* 分割线悬停颜色 */
--input-focus-border-color: var(--link-active-color); /* 输入框聚焦边框颜色 */
--input-focus-glow: var(--link-active-color); /* 输入框聚焦光晕值 */
--overlay-bg-color: rgba(0, 0, 0, 0.6); /* Added Overlay Background Color */
/* Component Colors (Apple Light) */
--header-bg-color: #e8e8ed; /* Slightly darker than canvas */
--footer-bg-color: #f5f5f7;
--card-bg-color: #ffffff; /* White cards on gray canvas */
--button-bg-color: #0071e3; /* Apple Blue CTA */
--button-text-color: #ffffff;
--button-hover-bg-color: #0077ed; /* Brighter Blue on hover */
--button-secondary-bg-color: #e8e8ed; /* Light secondary button */
--icon-color: rgba(0, 0, 0, 0.48); /* Tertiary icons */
--icon-hover-color: #0071e3; /* Apple Blue on hover */
--split-line-color: rgba(0, 0, 0, 0.08);
--split-line-hover-color: rgba(0, 0, 0, 0.16);
--input-focus-border-color: #0071e3; /* Apple Blue focus ring */
--input-focus-glow: #0071e3;
--overlay-bg-color: rgba(0, 0, 0, 0.4); /* Lighter overlay for light theme */
/* Status Colors */
--color-success: #28a745; /* Green */
--color-warning: #ffc107; /* Yellow */
--color-error: #dc3545; /* Red */
--color-success-text: #ffffff; /* White text for green bg */
--color-warning-text: #212529; /* Dark text for yellow bg */
--color-error-text: #ffffff; /* White text for red bg */
/* Status Colors (Apple-inspired) */
--color-success: #30d158; /* Apple Green */
--color-warning: #ff9f0a; /* Apple Orange */
--color-error: #ff453a; /* Apple Red */
--color-success-text: #ffffff;
--color-warning-text: #1d1d1f;
--color-error-text: #ffffff;
/* 字体 */
--font-family-sans-serif: sans-serif; /* 默认字体 */
/* Typography (Apple SF Pro System Stack) */
--font-family-sans-serif: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
/* 其他 */
--base-padding: 1rem; /* 基础内边距 */
--base-margin: 0.5rem; /* 基础外边距 */
/* Spacing */
--base-padding: 1rem;
--base-margin: 0.5rem;
}
/* 应用基础样式 */
body {
margin: 0; /* 移除默认 body margin */
margin: 0;
font-family: var(--font-family-sans-serif);
background-color: var(--app-bg-color);
color: var(--text-color);
line-height: 1.6; /* 改善可读性 */
line-height: 1.47; /* Apple body line-height */
letter-spacing: -0.022em; /* Apple body tracking */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* 全局链接样式 */
@@ -165,32 +187,31 @@ hr {
border-bottom: 1px solid var(--border-color);
}
/* Style scrollbars */
/* Style scrollbars — Apple minimal */
::-webkit-scrollbar {
width: 8px; /* Width of vertical scrollbar */
height: 8px; /* Height of horizontal scrollbar */
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: var(--app-bg-color); /* Scrollbar track background */
border-radius: 4px;
background: transparent;
border-radius: 3px;
}
::-webkit-scrollbar-thumb {
background-color: var(--border-color); /* Scrollbar handle color */
border-radius: 4px;
border: 2px solid var(--app-bg-color); /* Creates padding around thumb */
background-color: rgba(0, 0, 0, 0.15);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--text-color-secondary); /* Scrollbar handle hover color */
background-color: rgba(0, 0, 0, 0.3);
}
/* Input focus styles */
/* Input focus styles — Apple Blue ring */
input:focus, textarea:focus, select:focus {
border-color: var(--input-focus-border-color) !important; /* Use new variable, !important might be needed depending on specificity */
border-color: var(--input-focus-border-color) !important;
outline: 0;
box-shadow: 0 0 0 3px rgba(var(--input-focus-glow-rgb), 0.2) !important; /* Use new variable, !important might be needed */
box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2) !important;
}
/* Ensure icons inside primary buttons are white */