Files
NebulaShell/website/css/dock.css
2026-04-06 17:03:11 +08:00

196 lines
4.4 KiB
CSS

/* ===== Dock 侧边栏 - 苹果液态玻璃 ===== */
#dock {
position: fixed;
right: 20px;
top: 50%;
transform: translateY(-50%);
z-index: 1000;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 14px 10px;
/* 苹果液态玻璃 */
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.18) 0%,
rgba(255, 255, 255, 0.08) 100%
);
backdrop-filter: blur(50px) saturate(200%);
-webkit-backdrop-filter: blur(50px) saturate(200%);
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 22px;
box-shadow:
0 12px 40px rgba(0, 0, 0, 0.15),
0 4px 12px rgba(0, 0, 0, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.6),
inset 0 -1px 0 rgba(255, 255, 255, 0.15);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#dock:hover {
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.22) 0%,
rgba(255, 255, 255, 0.12) 100%
);
border-color: rgba(255, 255, 255, 0.35);
box-shadow:
0 16px 48px rgba(0, 0, 0, 0.18),
0 6px 16px rgba(0, 0, 0, 0.12),
inset 0 1px 0 rgba(255, 255, 255, 0.7),
inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}
.dock-item {
display: flex;
align-items: center;
justify-content: center;
width: 38px;
height: 38px;
border-radius: 12px;
color: var(--text-secondary);
text-decoration: none;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}
.dock-item:hover, .dock-item.active {
color: #fff;
/* 苹果风格高光滑 */
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.3) 0%,
rgba(255, 255, 255, 0.15) 100%
);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.4);
transform: scale(1.2);
box-shadow:
0 6px 16px rgba(0, 0, 0, 0.15),
0 2px 6px rgba(0, 0, 0, 0.1),
inset 0 1px 0 rgba(255, 255, 255, 0.8),
inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}
.dock-item svg {
width: 18px;
height: 18px;
}
.dock-separator {
width: 20px;
height: 1px;
background: var(--border);
margin: 4px 0;
}
/* 用户头像样式 */
.dock-user-avatar {
position: relative;
cursor: pointer;
flex-direction: column;
gap: 4px;
}
.dock-user-avatar svg {
color: var(--cyan);
}
.dock-user-avatar:hover {
color: var(--cyan-light);
background: rgba(6, 182, 212, 0.15);
transform: scale(1.15);
}
/* 称号徽章 */
.user-title-badge {
position: absolute;
bottom: -18px;
left: 50%;
transform: translateX(-50%);
font-size: 9px;
font-weight: 600;
padding: 1px 4px;
border-radius: 4px;
background: linear-gradient(135deg, #f59e0b, #f97316);
color: #fff;
white-space: nowrap;
max-width: 80px;
overflow: hidden;
text-overflow: ellipsis;
box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
pointer-events: none;
}
/* 用户菜单按钮样式 */
.dock-user-menu-btn {
position: relative;
cursor: pointer;
}
.dock-user-menu-btn svg {
color: var(--text-secondary);
}
.dock-user-menu-btn:hover {
color: var(--cyan-light);
background: rgba(6, 182, 212, 0.15);
transform: scale(1.15);
}
/* Tooltip */
.dock-item::before {
content: attr(data-tooltip);
position: absolute;
right: calc(100% + 10px);
top: 50%;
transform: translateY(-50%) scale(0.9);
padding: 4px 8px;
border-radius: 4px;
background: #1f2937;
border: 1px solid var(--border);
color: #fff;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: all 0.2s ease;
}
.dock-item:hover::before {
opacity: 1;
transform: translateY(-50%) scale(1);
}
/* 响应式 */
@media (max-width: 768px) {
#dock {
right: auto;
left: 50%;
top: auto;
bottom: 12px;
transform: translateX(-50%);
flex-direction: row;
gap: 4px;
padding: 8px 12px;
}
.dock-separator {
width: 1px;
height: 20px;
margin: 0 4px;
}
.dock-item::before {
right: auto;
top: auto;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%) scale(0.9);
}
.dock-item:hover::before {
transform: translateX(-50%) scale(1);
}
}