feat: 侧边栏分组图标与导航样式优化

- 分组支持 icon 字段,可按名称自动匹配或手动选择
- 左侧导航与总览卡片显示彩色 SVG 图标
- 优化侧栏链接圆角与选中态样式

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-05-30 18:06:42 +08:00
parent 11129cc3a0
commit f7ce6f1058
8 changed files with 250 additions and 24 deletions
+125 -19
View File
@@ -170,37 +170,130 @@ a:hover {
}
.sidebar-section {
margin-bottom: 1rem;
margin-bottom: 0.35rem;
padding: 0 0.55rem;
}
.sidebar-section h2 {
margin: 0 0 0.35rem;
padding: 0 1rem;
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--muted);
.sidebar-group-title {
display: flex;
align-items: center;
gap: 0.55rem;
margin: 0.85rem 0 0.45rem;
padding: 0.35rem 0.5rem;
font-size: 0.78rem;
font-weight: 600;
letter-spacing: 0.02em;
color: var(--text);
text-transform: none;
}
.sidebar-group-name {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar-group-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: 8px;
flex-shrink: 0;
}
.sidebar-group-icon svg {
width: 1rem;
height: 1rem;
}
.sidebar-group-icon--order {
background: rgba(59, 130, 246, 0.16);
color: #60a5fa;
}
.sidebar-group-icon--trade {
background: rgba(16, 185, 129, 0.16);
color: #34d399;
}
.sidebar-group-icon--review {
background: rgba(168, 85, 247, 0.16);
color: #c084fc;
}
.sidebar-group-icon--api {
background: rgba(245, 158, 11, 0.16);
color: #fbbf24;
}
.sidebar-group-icon--gate {
background: rgba(236, 72, 153, 0.16);
color: #f472b6;
}
.sidebar-group-icon--chart {
background: rgba(45, 212, 191, 0.16);
color: #2dd4bf;
}
.sidebar-group-icon--server {
background: rgba(99, 102, 241, 0.16);
color: #818cf8;
}
.sidebar-group-icon--folder {
background: rgba(148, 163, 184, 0.14);
color: #94a3b8;
}
.sidebar-links {
display: flex;
flex-direction: column;
gap: 0.12rem;
}
.sidebar-empty {
padding: 0.35rem 0.65rem 0.5rem;
font-size: 0.82rem;
}
.nav-link {
display: block;
padding: 0.45rem 1rem;
display: flex;
align-items: center;
margin: 0;
padding: 0.52rem 0.7rem 0.52rem 0.85rem;
color: var(--text);
cursor: pointer;
border-left: 3px solid transparent;
font-size: 0.9rem;
border-left: none;
border-radius: 8px;
font-size: 0.88rem;
text-decoration: none;
transition:
background 0.15s ease,
color 0.15s ease,
box-shadow 0.15s ease;
}
.nav-link-text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.nav-link:hover {
background: rgba(61, 139, 253, 0.08);
background: rgba(61, 139, 253, 0.1);
text-decoration: none;
}
.nav-link.active {
background: rgba(61, 139, 253, 0.15);
border-left-color: var(--accent);
background: rgba(61, 139, 253, 0.18);
box-shadow: inset 3px 0 0 var(--accent);
text-decoration: none;
}
@@ -232,12 +325,25 @@ a:hover {
}
.dash-section-title {
display: flex;
align-items: center;
gap: 0.55rem;
margin: 0 0 0.85rem;
font-size: 0.72rem;
font-size: 0.95rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--muted);
letter-spacing: 0.02em;
color: var(--text);
text-transform: none;
}
.dash-section-title .sidebar-group-icon {
width: 2rem;
height: 2rem;
}
.dash-section-title .sidebar-group-icon svg {
width: 1.05rem;
height: 1.05rem;
}
.service-card-grid {