feat(nav): 侧栏高对比度 + 顶栏已打开页面标签 + 折叠态只留日夜切换 + 换明月图标
1) 侧边栏对比度
- 新增 --sb-* 专属色板(固定深色底,不随日夜主题翻转),文字 #c3d7e3、
hover 纯白、选中纯白 + 品牌色强调条 + 内描边,参考 GoodJob 的 Command Deck
- 原过渡曲线(--transition-fast/base)保持不变
- luxury.css 里把侧栏刷回浅底的覆盖一并改为同一套色板
2) 顶栏「已打开页面」标签
- 新增 src/navigation.js:NAV_GROUPS 与 PAGE_LABELS 单点维护,App 与顶栏共用
- GlobalHeader 用 useLocation 自动登记访问过的页面,工作台恒定置顶且不可关闭,
其余按最近使用排序,可单独关闭,最多 10 个,落 localStorage(happy.openTabs)
- 关掉当前标签会退到剩下的最近一个,没有则回工作台
3) 折叠态页脚
- .sidebar.collapsed .settings-btn 隐藏,76px 宽度下只留一个日夜切换按钮
4) 明月图标
- MoonIcon → MoonStarsIcon,造型取自 igoutu.cn/icon/101343/moon-and-stars,
重绘为矢量(月牙 = 两段圆弧相减,两枚凹边圆角四角星),走 currentColor 随主题变色
- 源图存 design-refs/(已忽略,不入库)
5) 顶栏排布修正
- 标签条加入后头部变挤,收窄品牌区/搜索框,按钮加 nowrap 防止文字折行
- ≤1280px 隐藏标签条
This commit is contained in:
+3
-42
@@ -14,55 +14,16 @@ import Settings from './components/Settings'
|
||||
import GlobalHeader from './components/GlobalHeader'
|
||||
import AIAssistant from './components/AIAssistant'
|
||||
import { readPreference } from './preferences'
|
||||
import { NAV_GROUPS } from './navigation'
|
||||
import {
|
||||
DashboardIcon,
|
||||
FactoryIcon,
|
||||
PackageIcon,
|
||||
UsersIcon,
|
||||
TargetIcon,
|
||||
ClipboardIcon,
|
||||
DownloadIcon,
|
||||
QuoteIcon,
|
||||
ContractIcon,
|
||||
PurchaseIcon,
|
||||
ChevronDownIcon,
|
||||
TuneIcon,
|
||||
SunIcon,
|
||||
MoonIcon,
|
||||
MoonStarsIcon,
|
||||
SidebarLayoutIcon
|
||||
} from './components/Icons'
|
||||
|
||||
/* 侧边栏分组配置:工作台独立置顶,不归属任何分组 */
|
||||
const NAV_GROUPS = [
|
||||
{
|
||||
id: 'business',
|
||||
title: '业务管理',
|
||||
items: [
|
||||
{ to: '/quotes', label: '客户报价单管理', icon: QuoteIcon },
|
||||
{ to: '/pi-contracts', label: 'PI合同管理', icon: ContractIcon },
|
||||
{ to: '/purchase-orders', label: '采购单管理', icon: PurchaseIcon }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'customer',
|
||||
title: '客户管理',
|
||||
items: [
|
||||
{ to: '/customers', label: '客户管理', icon: UsersIcon },
|
||||
{ to: '/prospects', label: '新客开发', icon: TargetIcon },
|
||||
{ to: '/orders', label: '订单管理', icon: ClipboardIcon }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'procurement',
|
||||
title: '采购管理',
|
||||
items: [
|
||||
{ to: '/products', label: '产品管理', icon: PackageIcon },
|
||||
{ to: '/suppliers', label: '供应商管理', icon: FactoryIcon },
|
||||
{ to: '/procurement/import', label: '合同导入', icon: DownloadIcon }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
function App() {
|
||||
const [collapsed, setCollapsed] = React.useState(false)
|
||||
const [collapsedGroups, setCollapsedGroups] = React.useState([])
|
||||
@@ -161,7 +122,7 @@ function App() {
|
||||
title={theme === 'light' ? '切换至夜间模式' : '切换至日间模式'}
|
||||
aria-label={theme === 'light' ? '切换至夜间模式' : '切换至日间模式'}
|
||||
>
|
||||
{theme === 'light' ? <MoonIcon size={18} /> : <SunIcon size={18} />}
|
||||
{theme === 'light' ? <MoonStarsIcon size={20} /> : <SunIcon size={20} />}
|
||||
</button>
|
||||
<button className="settings-btn" onClick={() => setSettingsOpen(true)} title="设置" aria-label="设置">
|
||||
<TuneIcon size={18} />
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import axios from 'axios'
|
||||
import { BotIcon, ClockIcon, CloudDbIcon, PlusCircleIcon, SearchIcon } from './Icons'
|
||||
import { HOME_PATH, PAGE_LABELS } from '../navigation'
|
||||
|
||||
const TABS_STORAGE_KEY = 'happy.openTabs'
|
||||
const MAX_TABS = 10
|
||||
|
||||
/* 从本地缓存读取上次打开的页面(只保留仍然存在的路由,工作台恒定在首位) */
|
||||
function readStoredTabs() {
|
||||
try {
|
||||
const raw = JSON.parse(localStorage.getItem(TABS_STORAGE_KEY) || '[]')
|
||||
const list = Array.isArray(raw) ? raw.filter(path => PAGE_LABELS[path]) : []
|
||||
return [HOME_PATH, ...list.filter(path => path !== HOME_PATH)]
|
||||
} catch { return [HOME_PATH] }
|
||||
}
|
||||
|
||||
function GlobalHeader({ onOpenAssistant }) {
|
||||
const [now, setNow] = useState(new Date())
|
||||
@@ -9,14 +22,44 @@ function GlobalHeader({ onOpenAssistant }) {
|
||||
const [query, setQuery] = useState('')
|
||||
const [results, setResults] = useState([])
|
||||
const [searching, setSearching] = useState(false)
|
||||
const [openTabs, setOpenTabs] = useState(readStoredTabs)
|
||||
const searchRef = useRef(null)
|
||||
const tabsRef = useRef(null)
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
|
||||
useEffect(() => {
|
||||
const timer = window.setInterval(() => setNow(new Date()), 1000)
|
||||
return () => window.clearInterval(timer)
|
||||
}, [])
|
||||
|
||||
/* 访问过的页面自动登记成标签:工作台恒在首位,其余按最近使用排序,新页插在第二位 */
|
||||
useEffect(() => {
|
||||
const path = location.pathname
|
||||
if (!PAGE_LABELS[path]) return
|
||||
setOpenTabs(current => {
|
||||
if (current[0] === path) return current
|
||||
if (current[1] === path) return current
|
||||
const rest = current.filter(item => item !== path && item !== HOME_PATH)
|
||||
return [HOME_PATH, path, ...rest].slice(0, MAX_TABS)
|
||||
})
|
||||
}, [location.pathname])
|
||||
|
||||
useEffect(() => {
|
||||
try { localStorage.setItem(TABS_STORAGE_KEY, JSON.stringify(openTabs)) } catch { /* 存储不可用时仅本次会话有效 */ }
|
||||
const active = tabsRef.current?.querySelector('.page-tab.active')
|
||||
active?.scrollIntoView({ block: 'nearest', inline: 'nearest' })
|
||||
}, [openTabs, location.pathname])
|
||||
|
||||
/* 关闭标签:关掉的若是当前页,就退到剩下的最近一个,没有则回工作台 */
|
||||
const closeTab = (event, path) => {
|
||||
event.stopPropagation()
|
||||
const next = openTabs.filter(item => item !== path)
|
||||
const result = next.length ? next : [HOME_PATH]
|
||||
setOpenTabs(result)
|
||||
if (path === location.pathname) navigate(result[0])
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const keyword = query.trim()
|
||||
if (!keyword) { setResults([]); setSearching(false); return }
|
||||
@@ -59,6 +102,20 @@ function GlobalHeader({ onOpenAssistant }) {
|
||||
<div className="global-search-footnote">已检索客户、供应商、产品、订单、商机、待办和活动记录</div>
|
||||
</div>}
|
||||
</div>
|
||||
{/* 已打开页面:搜索框后的快速跳转标签,工作台常驻且不可关闭 */}
|
||||
<nav className="page-tabs" ref={tabsRef} aria-label="已打开页面">
|
||||
{openTabs.map(path => {
|
||||
const label = PAGE_LABELS[path] || path
|
||||
const isHome = path === HOME_PATH
|
||||
const active = location.pathname === path
|
||||
return (
|
||||
<div key={path} className={`page-tab${active ? ' active' : ''}`}>
|
||||
<button type="button" className="page-tab-label" title={label} aria-current={active ? 'page' : undefined} onClick={() => navigate(path)}>{label}</button>
|
||||
{!isHome && <button type="button" className="page-tab-close" aria-label={`关闭${label}`} title={`关闭${label}`} onClick={event => closeTab(event, path)}>×</button>}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</nav>
|
||||
<div className="global-header-actions"><div className="header-clock"><ClockIcon size={16} /><span>{dateLabel}</span><b>{timeLabel}</b></div><button className="quick-create-btn" title="快速新建"><PlusCircleIcon size={19} /><span>快速新建</span></button><button className="ai-entry-btn" onClick={onOpenAssistant} title="打开 AI 助手"><BotIcon size={19} /><span>AI 助手</span><i>β</i></button><button className="header-avatar" title="当前用户">W</button><button className="mobile-search-btn" onClick={() => { setSearchOpen(v => !v); window.setTimeout(() => searchRef.current?.focus(), 0) }} title="搜索"><SearchIcon size={18} /></button></div>
|
||||
</header>
|
||||
)
|
||||
|
||||
@@ -148,9 +148,17 @@ export const SunIcon = ({ size = 20, className = '' }) => (
|
||||
</svg>
|
||||
)
|
||||
|
||||
export const MoonIcon = ({ size = 20, className = '' }) => (
|
||||
/* 明月(含两颗四角星)——夜间模式切换图标
|
||||
造型取自 https://igoutu.cn/icon/101343/moon-and-stars(Icons8 iOS Glyph 风格「明月」),
|
||||
按原图重绘为矢量:月牙 = 大圆挖掉一枚偏向右上的圆(两段圆弧相减),
|
||||
两枚四角星 = 凹边圆角菱形。全部走 currentColor,可跟随日夜主题换色。 */
|
||||
export const MoonStarsIcon = ({ size = 20, className = '' }) => (
|
||||
<svg width={size} height={size} viewBox="0 0 24 24" className={className} aria-hidden="true">
|
||||
<path d="M12 2.5C6.7 2.5 2.5 6.8 2.5 12s4.2 9.5 9.5 9.5c-3.4-2-5.6-5.6-5.6-9.5S8.6 4.5 12 2.5Z" fill="currentColor" />
|
||||
<g fill="currentColor" stroke="currentColor" strokeWidth="1.2" strokeLinejoin="round" strokeLinecap="round">
|
||||
<path d="M9.63 3.09A10 10 0 1 0 20.61 15.77A9.5 9.5 0 0 1 9.63 3.09Z" />
|
||||
<path d="M14.85 1.1C14.85 1.805 16.495 3.45 17.2 3.45C16.495 3.45 14.85 5.095 14.85 5.8C14.85 5.095 13.205 3.45 12.5 3.45C13.205 3.45 14.85 1.805 14.85 1.1Z" />
|
||||
<path d="M19.95 5.9C19.95 6.86 22.19 9.1 23.15 9.1C22.19 9.1 19.95 11.34 19.95 12.3C19.95 11.34 17.71 9.1 16.75 9.1C17.71 9.1 19.95 6.86 19.95 5.9Z" />
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect, useRef } from 'react'
|
||||
import axios from 'axios'
|
||||
import { MoonIcon, SunIcon, TuneIcon, CheckIcon, CloseIcon, ExchangeIcon, SparkIcon, RefreshIcon } from './Icons'
|
||||
import { MoonStarsIcon, SunIcon, TuneIcon, CheckIcon, CloseIcon, ExchangeIcon, SparkIcon, RefreshIcon } from './Icons'
|
||||
|
||||
function Settings({ isOpen, onClose, theme, onThemeChange, reducedMotion, onReducedMotionChange }) {
|
||||
const [activeCategory, setActiveCategory] = useState('appearance')
|
||||
@@ -85,7 +85,7 @@ function AppearanceSettings({ theme, onThemeChange, reducedMotion, onReducedMoti
|
||||
|
||||
<div className="theme-selector" role="group" aria-label="界面主题">
|
||||
<button className={`theme-option ${theme === 'dark' ? 'active' : ''}`} aria-pressed={theme === 'dark'} onClick={() => onThemeChange('dark')}>
|
||||
<span className="theme-preview theme-preview-dark" aria-hidden="true"><span className="mini-sidebar"><i /><i /><i /></span><span className="mini-workspace"><MoonIcon size={18} /><span className="mini-stats"><i /><i /><i /></span><span className="mini-table"><i /><i /><i /></span></span></span>
|
||||
<span className="theme-preview theme-preview-dark" aria-hidden="true"><span className="mini-sidebar"><i /><i /><i /></span><span className="mini-workspace"><MoonStarsIcon size={18} /><span className="mini-stats"><i /><i /><i /></span><span className="mini-table"><i /><i /><i /></span></span></span>
|
||||
<span><strong>夜间控制台</strong><small>深色 · 低光环境</small></span>
|
||||
<span className="theme-check" aria-hidden="true">{theme === 'dark' && <CheckIcon size={14} />}</span>
|
||||
</button>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
FactoryIcon,
|
||||
PackageIcon,
|
||||
UsersIcon,
|
||||
TargetIcon,
|
||||
ClipboardIcon,
|
||||
DownloadIcon,
|
||||
QuoteIcon,
|
||||
ContractIcon,
|
||||
PurchaseIcon
|
||||
} from './components/Icons'
|
||||
|
||||
/* 工作台独立置顶,不属于任何分组 */
|
||||
export const HOME_PATH = '/'
|
||||
export const HOME_LABEL = '工作台'
|
||||
|
||||
/* 侧边栏分组配置 */
|
||||
export const NAV_GROUPS = [
|
||||
{
|
||||
id: 'business',
|
||||
title: '业务管理',
|
||||
items: [
|
||||
{ to: '/quotes', label: '客户报价单管理', icon: QuoteIcon },
|
||||
{ to: '/pi-contracts', label: 'PI合同管理', icon: ContractIcon },
|
||||
{ to: '/purchase-orders', label: '采购单管理', icon: PurchaseIcon }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'customer',
|
||||
title: '客户管理',
|
||||
items: [
|
||||
{ to: '/customers', label: '客户管理', icon: UsersIcon },
|
||||
{ to: '/prospects', label: '新客开发', icon: TargetIcon },
|
||||
{ to: '/orders', label: '订单管理', icon: ClipboardIcon }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'procurement',
|
||||
title: '采购管理',
|
||||
items: [
|
||||
{ to: '/products', label: '产品管理', icon: PackageIcon },
|
||||
{ to: '/suppliers', label: '供应商管理', icon: FactoryIcon },
|
||||
{ to: '/procurement/import', label: '合同导入', icon: DownloadIcon }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
/* 路由 → 页面名(顶栏「已打开页面」标签用),由分组自动派生,避免两处维护 */
|
||||
export const PAGE_LABELS = {
|
||||
[HOME_PATH]: HOME_LABEL,
|
||||
...NAV_GROUPS.reduce((acc, group) => {
|
||||
group.items.forEach(item => { acc[item.to] = item.label })
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
@@ -7,8 +7,22 @@
|
||||
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
|
||||
.app-body { display: flex; flex: 1 1 auto; min-height: 0; }
|
||||
|
||||
/* 侧边栏:仪表板式工业控制台 */
|
||||
/* 侧边栏:仪表板式工业控制台
|
||||
对比度策略参考 GoodJob 的 Command Deck —— 底色固定深色、不随日夜主题反转,
|
||||
文字亮度拉高,hover 近白、选中近白 + 品牌色强调条,两种主题下都清晰。 */
|
||||
.sidebar {
|
||||
/* 侧栏专属色板:不引用随主题翻转的变量,日夜两套主题共用同一份深色底 */
|
||||
--sb-bg-top: #0a1d2b;
|
||||
--sb-bg-bottom: #05101a;
|
||||
--sb-border: rgba(126, 215, 245, 0.16);
|
||||
--sb-text: #c3d7e3;
|
||||
--sb-text-dim: #86a3b4;
|
||||
--sb-text-strong: #ffffff;
|
||||
--sb-icon: #8fb4c7;
|
||||
--sb-hover-bg: #16323f;
|
||||
--sb-active-bg: rgba(126, 215, 245, 0.16);
|
||||
--sb-active-ring: rgba(126, 215, 245, 0.38);
|
||||
--sb-accent: #7ed7f5;
|
||||
position: sticky;
|
||||
top: var(--header-height);
|
||||
width: var(--sidebar-width);
|
||||
@@ -16,48 +30,51 @@
|
||||
flex: 0 0 var(--sidebar-width);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: linear-gradient(180deg, #0d2539 0%, #091a2a 100%);
|
||||
border-right: 1px solid var(--border);
|
||||
box-shadow: 10px 0 28px rgba(0, 0, 0, 0.2);
|
||||
background: linear-gradient(180deg, var(--sb-bg-top) 0%, var(--sb-bg-bottom) 100%);
|
||||
border-right: 1px solid var(--sb-border);
|
||||
box-shadow: 10px 0 28px rgba(0, 0, 0, 0.28);
|
||||
transition: width var(--transition-base), flex-basis var(--transition-base);
|
||||
z-index: 10;
|
||||
}
|
||||
.sidebar::before { content: ""; height: 3px; flex: 0 0 3px; background: linear-gradient(90deg, var(--primary-dark), var(--primary-light)); }
|
||||
.sidebar.collapsed { width: var(--sidebar-collapsed-width); flex-basis: var(--sidebar-collapsed-width); }
|
||||
/* 首行:工作台(左)+ 展开/收起导航按钮(右) */
|
||||
.sidebar-top { display: flex; align-items: center; gap: 8px; min-height: 62px; padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
|
||||
.sidebar-top { display: flex; align-items: center; gap: 8px; min-height: 62px; padding: 8px 12px; border-bottom: 1px solid var(--sb-border); }
|
||||
.sidebar-top .nav-item-home { flex: 1 1 auto; min-width: 0; margin: 0; }
|
||||
.sidebar-top .collapse-btn { flex: 0 0 auto; }
|
||||
.sidebar-top .collapse-btn svg { transition: transform var(--transition-base); }
|
||||
.sidebar.collapsed .sidebar-top { flex-direction: column; gap: 8px; padding: 8px; }
|
||||
.sidebar.collapsed .sidebar-top .nav-item-home { width: 100%; flex: 0 0 auto; }
|
||||
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }
|
||||
.collapse-btn { flex: 0 0 30px; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-deep); color: var(--primary-light); cursor: pointer; font-size: 16px; transition: all var(--transition-fast); }
|
||||
.collapse-btn:hover { background: var(--primary); color: #041522; border-color: var(--primary); }
|
||||
.collapse-btn { flex: 0 0 30px; width: 30px; height: 30px; border: 1px solid var(--sb-border); border-radius: var(--radius-sm); background: transparent; color: var(--sb-text); cursor: pointer; font-size: 16px; transition: all var(--transition-fast); }
|
||||
.collapse-btn:hover { background: var(--sb-accent); color: #04131c; border-color: var(--sb-accent); }
|
||||
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 10px 14px; }
|
||||
/* 分组标题行:标题 + 右侧折叠按钮 */
|
||||
.nav-group { display: block; }
|
||||
.nav-group:first-of-type .nav-group-header { margin-top: 6px; padding-top: 0; }
|
||||
.nav-group-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 16px 4px 6px; padding: 0 6px; }
|
||||
.nav-group-title { flex: 1; margin: 0; color: var(--text-tertiary); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
|
||||
.nav-group-toggle { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-tertiary); cursor: pointer; transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast); }
|
||||
.nav-group-toggle:hover { color: var(--primary-light); background: var(--surface-hover); border-color: var(--border-light); }
|
||||
.nav-group-title { flex: 1; margin: 0; color: var(--sb-text-dim); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
|
||||
.nav-group-toggle { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--sb-text-dim); cursor: pointer; transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast); }
|
||||
.nav-group-toggle:hover { color: var(--sb-text-strong); background: var(--sb-hover-bg); border-color: var(--sb-border); }
|
||||
.nav-group-toggle svg { transition: transform var(--transition-base); }
|
||||
.nav-group-toggle:not(.open) svg { transform: rotate(-90deg); }
|
||||
.sidebar.collapsed .nav-group-header { display: none; }
|
||||
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 3px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 600; transition: all var(--transition-fast); }
|
||||
.nav-item:hover { background: var(--surface-hover); border-color: var(--border-light); color: var(--text-primary); }
|
||||
.nav-item.active { background: linear-gradient(90deg, rgba(42, 167, 220, 0.22), rgba(42, 167, 220, 0.06)); border-color: var(--primary-border); color: var(--text-primary); box-shadow: var(--shadow-inset); }
|
||||
.nav-item.active::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--primary-light); }
|
||||
.nav-item .icon { display: flex; align-items: center; justify-content: center; min-width: 20px; color: var(--primary-light); }
|
||||
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 3px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--sb-text); text-decoration: none; font-size: 14px; font-weight: 600; transition: all var(--transition-fast); }
|
||||
.nav-item:hover { background: var(--sb-hover-bg); border-color: transparent; color: var(--sb-text-strong); }
|
||||
.nav-item.active { background: var(--sb-active-bg); border-color: transparent; color: var(--sb-text-strong); box-shadow: inset 0 0 0 1px var(--sb-active-ring); }
|
||||
.nav-item.active::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--sb-accent); box-shadow: 0 0 10px rgba(126, 215, 245, 0.55); }
|
||||
.nav-item .icon { display: flex; align-items: center; justify-content: center; min-width: 20px; color: var(--sb-icon); transition: color var(--transition-fast); }
|
||||
.nav-item:hover .icon, .nav-item.active .icon { color: var(--sb-accent); }
|
||||
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
|
||||
.sidebar.collapsed .nav-item span:not(.icon) { display: none; }
|
||||
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-top: 1px solid var(--border-light); }
|
||||
.sidebar-footer .user-info { flex: 1; overflow: hidden; color: var(--text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; }
|
||||
.settings-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-tertiary); cursor: pointer; transition: all var(--transition-fast); }
|
||||
.settings-btn:hover { color: var(--primary-light); border-color: var(--primary-border); background: var(--primary-bg); }
|
||||
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-top: 1px solid var(--sb-border); }
|
||||
.sidebar-footer .user-info { flex: 1; overflow: hidden; color: var(--sb-text); font-size: 12px; font-weight: 600; white-space: nowrap; }
|
||||
.settings-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--sb-border); border-radius: var(--radius-sm); background: transparent; color: var(--sb-text); cursor: pointer; transition: all var(--transition-fast); }
|
||||
.settings-btn:hover { color: var(--sb-accent); border-color: var(--sb-active-ring); background: var(--sb-hover-bg); }
|
||||
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 15px 10px; }
|
||||
.sidebar.collapsed .user-info { display: none; }
|
||||
/* 收起后侧栏只有 76px 宽,两个 40px 圆形按钮并排会互相挤压变形 —— 只留日夜切换 */
|
||||
.sidebar.collapsed .settings-btn { display: none; }
|
||||
|
||||
/* 主内容 */
|
||||
.main-content { min-width: 0; flex: 1; overflow-y: auto; padding: 34px clamp(20px, 4vw, 52px) 52px; background-color: var(--bg-primary); background-image: linear-gradient(rgba(126, 190, 221, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(126, 190, 221, 0.035) 1px, transparent 1px); background-size: 28px 28px; }
|
||||
@@ -147,7 +164,7 @@
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
@media (max-width: 1180px) { .stats-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); } }
|
||||
@media (max-width: 900px) { .sidebar { width: var(--sidebar-collapsed-width); flex-basis: var(--sidebar-collapsed-width); } .sidebar-top { flex-direction: column; gap: 8px; padding: 8px; } .sidebar-top .nav-item-home { width: 100%; flex: 0 0 auto; } .sidebar-top .collapse-btn svg { transform: rotate(180deg); } .sidebar-nav { padding-inline: 9px; } .nav-group-header, .nav-item span:not(.icon), .user-info { display: none; } .nav-item { justify-content: center; padding-inline: 10px; } .sidebar-footer { justify-content: center; padding-inline: 10px; } .dashboard-grid { grid-template-columns: 1fr; } }
|
||||
@media (max-width: 900px) { .sidebar { width: var(--sidebar-collapsed-width); flex-basis: var(--sidebar-collapsed-width); } .sidebar-top { flex-direction: column; gap: 8px; padding: 8px; } .sidebar-top .nav-item-home { width: 100%; flex: 0 0 auto; } .sidebar-top .collapse-btn svg { transform: rotate(180deg); } .sidebar-nav { padding-inline: 9px; } .nav-group-header, .nav-item span:not(.icon), .user-info, .settings-btn { display: none; } .nav-item { justify-content: center; padding-inline: 10px; } .sidebar-footer { justify-content: center; padding-inline: 10px; } .dashboard-grid { grid-template-columns: 1fr; } }
|
||||
@media (max-width: 620px) { .main-content { padding: 24px 14px 36px; } .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat-card { min-height: 88px; padding: 13px; } .stat-icon { flex-basis: 30px; } .stat-value { font-size: 22px; } .dashboard-grid { display: block; } .form-row { grid-template-columns: 1fr; } .settings-modal { height: calc(100vh - 20px); width: calc(100vw - 20px); flex-direction: column; } .settings-sidebar { width: auto; flex-basis: auto; } .settings-header { padding: 14px 18px; } .settings-nav { display: flex; gap: 8px; overflow-x: auto; } .settings-nav-item { width: auto; white-space: nowrap; margin: 0; } .settings-content { padding: 20px 18px; } }
|
||||
|
||||
/* 产品页使用的原生 table 同样复用工业表格视觉 */
|
||||
|
||||
@@ -78,15 +78,15 @@ body::before {
|
||||
background-size: 128px;
|
||||
}
|
||||
body { font-size: 14px; }
|
||||
.sidebar { background: var(--bg-secondary); box-shadow: none; border-color: var(--border-light); }
|
||||
/* 侧栏固定深色(不随主题翻转),颜色全部取自 index.css 里的 --sb-* 色板 */
|
||||
.sidebar { background: linear-gradient(180deg, var(--sb-bg-top) 0%, var(--sb-bg-bottom) 100%); box-shadow: 10px 0 28px rgba(0, 0, 0, 0.28); border-right-color: var(--sb-border); }
|
||||
.sidebar::before { background: transparent; }
|
||||
.sidebar-top { min-height: 62px; }
|
||||
.nav-item { min-height: 46px; font-weight: 600; }
|
||||
.nav-item.active { border-color: transparent; background: var(--primary-bg); box-shadow: inset 0 1px 0 var(--panel-highlight); }
|
||||
.nav-item.active::before { display: none; }
|
||||
.nav-item .icon { color: var(--text-tertiary); }
|
||||
.nav-item.active .icon { color: var(--primary-light); }
|
||||
.collapse-btn { border: 0; background: transparent; border-radius: 50%; color: var(--text-secondary); }
|
||||
.nav-item.active { border-color: transparent; background: var(--sb-active-bg); box-shadow: inset 0 0 0 1px var(--sb-active-ring); }
|
||||
.nav-item .icon { color: var(--sb-icon); }
|
||||
.nav-item.active .icon { color: var(--sb-accent); }
|
||||
.collapse-btn { border: 0; background: transparent; border-radius: 50%; color: var(--sb-text); }
|
||||
.main-content { background: radial-gradient(ellipse at 50% 100%, var(--ambient), transparent 65%), var(--bg-primary); background-size: auto; }
|
||||
.page-title { font-size: clamp(24px, 2.5vw, 32px); font-weight: 700; }
|
||||
.page-title::after { display: none; }
|
||||
@@ -98,9 +98,9 @@ body { font-size: 14px; }
|
||||
.table-container, .table-wrap { border-color: var(--border-light); background: var(--surface); border-radius: 14px; box-shadow: var(--panel-shadow); }
|
||||
.table-wrap table, .data-table { min-width: 680px; }
|
||||
.data-table td.empty-state { padding: 48px 20px; text-align: center; }
|
||||
.settings-btn { width: 40px; height: 40px; border-radius: 50%; border-color: var(--border-light); background: var(--surface); color: var(--text-secondary); box-shadow: inset 0 1px 0 var(--panel-highlight); }
|
||||
.settings-btn { width: 40px; height: 40px; border-radius: 50%; border-color: var(--sb-border); background: transparent; color: var(--sb-text); box-shadow: none; }
|
||||
.settings-btn svg { width: 20px; height: 20px; }
|
||||
.settings-btn:hover { background: var(--primary-bg); color: var(--primary-light); border-color: var(--primary-border); }
|
||||
.settings-btn:hover { background: var(--sb-hover-bg); color: var(--sb-accent); border-color: var(--sb-active-ring); }
|
||||
/* Include standalone legacy buttons as well as .btn components. */
|
||||
.btn, .btn-primary, .btn-secondary {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
|
||||
@@ -221,20 +221,33 @@ input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px
|
||||
.main-content { min-height: 0; overflow: hidden; padding: 0; }
|
||||
.route-content { min-height: calc(100vh - var(--header-height)); overflow-y: auto; padding: 32px clamp(18px, 3.6vw, 52px) 56px; }
|
||||
.global-header { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 22px; min-height: var(--header-height); padding: 0 clamp(18px, 3.6vw, 52px); background: color-mix(in srgb, var(--bg-primary) 90%, transparent); border-bottom: 1px solid var(--border-light); backdrop-filter: blur(18px) saturate(1.25); }
|
||||
.global-header-brand { display: flex; align-items: center; gap: 13px; min-width: 272px; }
|
||||
.global-header-brand { display: flex; align-items: center; gap: 13px; min-width: 240px; }
|
||||
.global-header-brand strong, .global-header-brand span { display: block; }
|
||||
.global-header-brand strong { font-size: 19px; letter-spacing: .01em; line-height: 1.2; }
|
||||
.global-header-brand span:not(.header-status-dot):not(.brand-mark) { color: var(--text-tertiary); font: 10px var(--font-mono); letter-spacing: .14em; margin-top: 2px; }
|
||||
.header-status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }
|
||||
.global-search { display: flex; align-items: center; gap: 9px; width: min(420px, 35vw); min-height: 38px; padding: 0 11px; color: var(--text-tertiary); background: var(--surface-deep); border: 1px solid var(--border-light); border-radius: 11px; transition: border-color 150ms, box-shadow 150ms; }
|
||||
.global-search { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; width: min(360px, 30vw); min-height: 38px; padding: 0 11px; color: var(--text-tertiary); background: var(--surface-deep); border: 1px solid var(--border-light); border-radius: 11px; transition: border-color 150ms, box-shadow 150ms; }
|
||||
.global-search:focus-within { border-color: var(--primary-border); box-shadow: 0 0 0 3px var(--accent-glow); }
|
||||
.global-search input { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--text-primary); }
|
||||
.global-search input:focus { box-shadow: none; }
|
||||
.global-search kbd { margin-left: auto; padding: 2px 5px; color: var(--text-tertiary); background: var(--surface); border: 1px solid var(--border-light); border-radius: 5px; font: 10px var(--font-mono); }
|
||||
.global-header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
|
||||
/* ---- 已打开页面标签:搜索框后的快速跳转(参考 GoodJob 的顶部标签条) ---- */
|
||||
.page-tabs { display: flex; align-items: center; gap: 3px; flex: 0 1 auto; min-width: 0; max-width: min(520px, 30vw); padding: 4px; border: 1px solid var(--border-light); border-radius: 11px; background: var(--surface-deep); overflow-x: auto; scrollbar-width: none; }
|
||||
.page-tabs::-webkit-scrollbar { display: none; }
|
||||
.page-tab { display: inline-flex; align-items: center; flex: 0 0 auto; max-width: 176px; height: 30px; border-radius: 8px; background: transparent; transition: background 150ms, box-shadow 150ms; }
|
||||
.page-tab:hover { background: var(--surface-hover); }
|
||||
.page-tab.active { background: var(--surface); box-shadow: inset 0 1px 0 var(--panel-highlight), inset 0 0 0 1px var(--primary-border); }
|
||||
.page-tab-label { max-width: 132px; height: 100%; padding: 0 6px 0 10px; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 150ms; }
|
||||
.page-tab:hover .page-tab-label { color: var(--text-primary); }
|
||||
.page-tab.active .page-tab-label { color: var(--text-primary); }
|
||||
.page-tab-close { display: grid; place-items: center; width: 17px; height: 17px; margin-right: 4px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 13px; line-height: 1; transition: background 150ms, color 150ms; }
|
||||
.page-tab-close:hover { background: var(--danger-bg); color: var(--danger); }
|
||||
.page-tab.active .page-tab-close { color: var(--text-secondary); }
|
||||
.page-tab.active .page-tab-close:hover { color: var(--danger); }
|
||||
.global-header-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; margin-left: auto; }
|
||||
.header-clock { display: flex; align-items: center; gap: 8px; margin-right: 8px; color: var(--text-tertiary); font: 11px var(--font-mono); white-space: nowrap; }
|
||||
.header-clock b { color: var(--text-primary); font-size: 13px; font-weight: 500; }
|
||||
.quick-create-btn, .ai-entry-btn, .mobile-search-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 12px; transition: background 150ms, border-color 150ms, color 150ms; }
|
||||
.quick-create-btn, .ai-entry-btn, .mobile-search-btn { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 36px; padding: 8px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 12px; white-space: nowrap; transition: background 150ms, border-color 150ms, color 150ms; }
|
||||
.quick-create-btn:hover, .mobile-search-btn:hover { color: var(--text-primary); background: var(--surface-hover); border-color: var(--border-light); }
|
||||
.ai-entry-btn { color: var(--primary-light); background: var(--primary-bg); border-color: var(--primary-border); box-shadow: 0 0 18px var(--accent-glow); }
|
||||
.ai-entry-btn:hover { color: var(--text-primary); background: var(--surface-hover); }
|
||||
@@ -316,16 +329,17 @@ input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px
|
||||
.ai-message-list { display: grid; gap: 13px; margin-top: 14px; }.ai-message { display: flex; align-items: flex-start; gap: 8px; }.ai-message.user { flex-direction: row-reverse; }.ai-message-avatar { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 9px; background: var(--surface-deep); color: var(--primary-light); font-size: 10px; font-weight: 800; }.ai-message.user .ai-message-avatar { color: var(--surface-deep); background: var(--primary); }.ai-message-content { max-width: 82%; padding: 9px 11px; border-radius: 4px 13px 13px 13px; background: var(--surface-deep); }.ai-message.user .ai-message-content { border-radius: 13px 4px 13px 13px; background: var(--primary-bg); }.ai-message-content p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.7; }.ai-message-content small { display: block; margin-top: 5px; color: var(--text-tertiary); font: 9px var(--font-mono); }.ai-thinking { display: flex; gap: 4px; align-items: center; min-height: 34px; }.ai-thinking span { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); animation: ai-bounce 1s infinite ease-in-out; }.ai-thinking span:nth-child(2) { animation-delay: .15s; }.ai-thinking span:nth-child(3) { animation-delay: .3s; }@keyframes ai-bounce { 0%,80%,100% { transform: translateY(0); opacity:.45; } 40% { transform: translateY(-4px); opacity:1; } }
|
||||
.ai-suggestion-row { display: flex; gap: 7px; padding: 8px 20px; overflow-x: auto; }.ai-suggestion-row button { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--border-light); border-radius: 99px; background: var(--surface-deep); color: var(--text-secondary); cursor: pointer; font-size: 10px; }.ai-suggestion-row button:hover { color: var(--primary-light); border-color: var(--primary-border); }
|
||||
.ai-input-row { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border-light); }.ai-input-row input { min-height: 40px; background: var(--surface-deep); }.ai-input-row button { display: grid; place-items: center; width: 40px; min-width: 40px; border: 0; border-radius: 11px; background: var(--primary); color: var(--surface-deep); cursor: pointer; }.ai-input-row button:disabled { cursor: not-allowed; opacity: .4; }.ai-panel-footer { padding: 8px 20px 13px; color: var(--text-tertiary); font-size: 10px; text-align: center; }
|
||||
@media (max-width: 1280px) { .page-tabs { display: none; } }
|
||||
@media (max-width: 980px) { .global-header-brand { min-width: auto; }.global-header-brand div { display: none; }.global-search { width: min(360px, 40vw); }.header-clock span { display: none; }.dashboard-content-grid { grid-template-columns: 1fr; }.dashboard-secondary-column { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }.dashboard-secondary-column .dashboard-panel { margin-bottom: 0; } }
|
||||
@media (max-width: 680px) { :root { --header-height: 62px; }.global-header { gap: 8px; padding: 0 12px; }.global-search { display: none; }.global-search.is-open { position: absolute; left: 12px; right: 12px; top: 65px; display: flex; width: auto; background: var(--surface); }.mobile-search-btn { display: inline-flex; }.quick-create-btn span, .ai-entry-btn span, .header-clock { display: none; }.ai-entry-btn { padding: 8px; }.route-content { min-height: calc(100vh - var(--header-height)); padding: 22px 12px 42px; }.dashboard-welcome { align-items: flex-start; flex-direction: column; }.dashboard-date-chip { text-align: left; }.calendar-day { min-height: 68px; padding: 5px 4px; }.calendar-week-row > div { padding: 8px 4px; }.calendar-event { font-size: 8px; }.calendar-day-number { font-size: 10px; }.dashboard-secondary-column { display: block; }.dashboard-secondary-column .dashboard-panel { margin-bottom: 18px; }.ai-assistant-panel { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); } }
|
||||
|
||||
/* Requested compact navigation controls. */
|
||||
.collapse-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-deep); color: var(--text-secondary); box-shadow: inset 0 1px 0 var(--panel-highlight); }
|
||||
.collapse-btn:hover { color: var(--primary-light); border-color: var(--primary-border); background: var(--primary-bg); }
|
||||
.collapse-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--sb-border); border-radius: 8px; background: transparent; color: var(--sb-text); box-shadow: none; }
|
||||
.collapse-btn:hover { color: #04131c; border-color: var(--sb-accent); background: var(--sb-accent); }
|
||||
.collapse-btn svg { width: 19px; height: 19px; }
|
||||
.sidebar-footer { gap: 8px; }
|
||||
.theme-toggle-btn { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; padding: 0; border: 1px solid var(--border-light); border-radius: 50%; background: var(--surface); color: var(--primary-light); box-shadow: inset 0 1px 0 var(--panel-highlight); cursor: pointer; transition: background 150ms, border-color 150ms, transform 150ms; }
|
||||
.theme-toggle-btn:hover { border-color: var(--primary-border); background: var(--primary-bg); transform: translateY(-1px); }
|
||||
.theme-toggle-btn { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; padding: 0; border: 1px solid var(--sb-border); border-radius: 50%; background: transparent; color: var(--sb-accent); box-shadow: none; cursor: pointer; transition: background 150ms, border-color 150ms, transform 150ms; }
|
||||
.theme-toggle-btn:hover { border-color: var(--sb-active-ring); background: var(--sb-hover-bg); transform: translateY(-1px); }
|
||||
.sidebar.collapsed .theme-toggle-btn { margin-left: 0; }
|
||||
|
||||
/* Search everything: results are scoped to ordinary business data only. */
|
||||
|
||||
Reference in New Issue
Block a user