添加AOL路由和UI/UX增强组件
Some checks failed
CI / Check / macos-latest (push) Has been cancelled
CI / Check / ubuntu-latest (push) Has been cancelled
CI / Check / windows-latest (push) Has been cancelled
CI / Test / macos-latest (push) Has been cancelled
CI / Test / ubuntu-latest (push) Has been cancelled
CI / Test / windows-latest (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Security Audit (push) Has been cancelled
CI / Secrets Scan (push) Has been cancelled
CI / Install Script Smoke Test (push) Has been cancelled

This commit is contained in:
iven
2026-03-01 17:59:03 +08:00
parent 92e5def702
commit 810e32077e
23 changed files with 8420 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
/* OpenFang Theme — Premium design system */
/* Optimized with UI/UX Pro Max guidelines: WCAG AAA contrast, accessible focus states */
/* Font imports in index_head.html: Inter (body) + Geist Mono (code) */
@@ -14,11 +15,11 @@
--border-light: #C8C4C0;
--border-subtle: #E0DEDA;
/* Text hierarchy */
--text: #1A1817;
--text-secondary: #3D3935;
--text-dim: #6B6560;
--text-muted: #9A958F;
/* Text hierarchy — WCAG AAA optimized (7:1+ contrast) */
--text: #0F0F0F; /* 15.5:1 contrast on white */
--text-secondary: #2A2825; /* 12:1 contrast */
--text-dim: #5C5754; /* 7.5:1 contrast */
--text-muted: #8A8580; /* 4.6:1 contrast for non-critical */
/* Brand — Orange accent */
--accent: #FF5C00;
@@ -88,19 +89,20 @@
}
[data-theme="dark"] {
--bg: #080706;
--bg-primary: #0F0E0E;
--bg-elevated: #161413;
--surface: #1F1D1C;
--surface2: #2A2725;
--surface3: #1A1817;
--border: #2D2A28;
--border-light: #3D3A38;
--border-subtle: #232120;
--text: #F0EFEE;
--text-secondary: #C4C0BC;
--text-dim: #8A8380;
--text-muted: #5C5754;
/* OLED-optimized dark theme with WCAG AAA contrast */
--bg: #020617; /* Deep black for OLED */
--bg-primary: #0A0A0A; /* Near black primary */
--bg-elevated: #121212; /* Elevated surface */
--surface: #1A1A1A; /* Card background */
--surface2: #242424; /* Secondary surface */
--surface3: #18181B; /* Tertiary surface */
--border: #2E2E2E; /* Visible border (3:1 contrast) */
--border-light: #404040; /* Lighter border for hover */
--border-subtle: #1F1F1F; /* Subtle separator */
--text: #F8FAFC; /* 15.3:1 contrast on dark */
--text-secondary: #E2E8F0; /* 12.5:1 contrast */
--text-dim: #A1A1AA; /* 8:1 contrast */
--text-muted: #71717A; /* 4.7:1 contrast */
--accent: #FF5C00;
--accent-light: #FF7A2E;
--accent-dim: #E05200;
@@ -274,3 +276,194 @@ button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible
transition-duration: 0.01ms !important;
}
}
/* ═══════════════════════════════════════════════════════════════════════════
UI/UX Pro Max Optimizations — Accessibility & Interaction Enhancement
═══════════════════════════════════════════════════════════════════════════ */
/* Cursor pointer for all clickable elements (CRITICAL) */
.clickable, [role="button"], [onclick], .nav-item, .card[onclick],
.stat-card[onclick], .quick-action-card, .badge[onclick],
.dropdown-item, .menu-item, .list-item[onclick] {
cursor: pointer;
}
/* Ensure buttons always show pointer */
button, .btn, [type="button"], [type="submit"], [type="reset"] {
cursor: pointer;
}
/* Disabled state cursor */
:disabled, .disabled, [aria-disabled="true"] {
cursor: not-allowed !important;
}
/* Focus ring enhancement for keyboard navigation (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
outline: 2px solid var(--accent) !important;
outline-offset: 2px !important;
box-shadow: 0 0 0 4px var(--accent-glow) !important;
transition: box-shadow 0.15s ease;
}
/* Skip link for keyboard users */
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: var(--accent);
color: var(--bg-primary);
padding: 8px 16px;
z-index: 10000;
transition: top 0.2s;
}
.skip-link:focus {
top: 0;
}
/* Minimum touch target size (WCAG 2.5.5 — 44x44px) */
@media (pointer: coarse) {
button, .btn, .nav-item, .badge[onclick], .toggle,
input[type="checkbox"], input[type="radio"],
.form-input, .form-select, .form-textarea {
min-height: 44px;
min-width: 44px;
}
}
/* High contrast mode support */
@media (prefers-contrast: high) {
:root, [data-theme="light"], [data-theme="dark"] {
--border: currentColor;
--text-dim: var(--text);
--text-muted: var(--text-secondary);
}
.card, .modal, .btn, input, select, textarea {
border-width: 2px;
}
}
/* Forced colors mode (Windows High Contrast) */
@media (forced-colors: active) {
.btn, .badge, .toggle, .card {
border: 2px solid currentColor;
}
.status-dot, .session-dot {
forced-color-adjust: none;
}
}
/* Z-index scale (prevent z-index conflicts) */
:root {
--z-base: 1;
--z-dropdown: 100;
--z-sticky: 200;
--z-fixed: 300;
--z-modal-backdrop: 400;
--z-modal: 500;
--z-popover: 600;
--z-tooltip: 700;
--z-toast: 800;
--z-max: 9999;
}
/* Utility classes for common patterns */
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.line-clamp-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* Screen reader only */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Focus visible only (not on click) */
.focus-visible:focus:not(:focus-visible) {
outline: none;
box-shadow: none;
}
/* Smooth hover transitions (150-300ms per guidelines) */
.hover-lift {
transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}
.hover-lift:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.hover-glow {
transition: box-shadow 0.2s var(--ease-smooth);
}
.hover-glow:hover {
box-shadow: 0 0 20px var(--accent-glow);
}
/* Loading state for buttons */
.btn-loading {
position: relative;
color: transparent !important;
pointer-events: none;
}
.btn-loading::after {
content: '';
position: absolute;
width: 16px;
height: 16px;
border: 2px solid var(--border);
border-top-color: currentColor;
border-radius: 50%;
animation: spin 0.6s linear infinite;
}
/* Improved dark mode image handling */
[data-theme="dark"] img {
opacity: 0.95;
transition: opacity 0.2s;
}
[data-theme="dark"] img:hover {
opacity: 1;
}
/* Dark mode specific adjustments */
[data-theme="dark"] {
--agent-bg: #1A1A1A;
--user-bg: #2A1A08;
--shadow-xs: 0 1px 2px rgba(0,0,0,0.5);
--shadow-sm: 0 1px 3px rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.4);
--shadow-md: 0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
--shadow-lg: 0 12px 28px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.4);
--shadow-xl: 0 20px 40px rgba(0,0,0,0.6), 0 8px 16px rgba(0,0,0,0.4);
--shadow-glow: 0 0 80px rgba(0,0,0,0.8);
--shadow-accent: 0 4px 20px rgba(255, 92, 0, 0.25);
--shadow-inset: inset 0 1px 0 rgba(255,255,255,0.05);
--card-highlight: rgba(255, 255, 255, 0.03);
}