384 lines
6.3 KiB
CSS
384 lines
6.3 KiB
CSS
/* 侧边栏样式 */
|
|
.sidebar {
|
|
background: var(--bg-primary);
|
|
border-right: 1px solid var(--border-light);
|
|
overflow-y: auto;
|
|
position: relative;
|
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100vh;
|
|
}
|
|
|
|
/* 侧边栏头部 */
|
|
.sidebar-header {
|
|
padding: 16px 20px;
|
|
border-bottom: 1px solid var(--border-light);
|
|
background: var(--bg-primary);
|
|
position: relative;
|
|
}
|
|
|
|
.brand {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.brand-icon {
|
|
color: var(--accent-600);
|
|
flex-shrink: 0;
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.brand-text {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.brand-title {
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
color: var(--text-primary);
|
|
margin: 0;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.brand-subtitle {
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
margin: 0;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
/* 主题切换按钮 */
|
|
.theme-toggle {
|
|
position: absolute;
|
|
top: 16px;
|
|
right: 16px;
|
|
background: none;
|
|
border: none;
|
|
padding: 8px;
|
|
border-radius: var(--radius-md);
|
|
color: var(--text-secondary);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.theme-toggle:hover {
|
|
background: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.theme-toggle:focus-visible {
|
|
outline: 2px solid var(--accent-600);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.theme-toggle .moon-icon {
|
|
display: none;
|
|
}
|
|
|
|
[data-theme="dark"] .theme-toggle .sun-icon {
|
|
display: none;
|
|
}
|
|
|
|
[data-theme="dark"] .theme-toggle .moon-icon {
|
|
display: block;
|
|
}
|
|
|
|
/* 搜索框 */
|
|
.sidebar-search {
|
|
padding: 12px 16px;
|
|
border-bottom: 1px solid var(--border-light);
|
|
}
|
|
|
|
.search-container {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.search-icon {
|
|
position: absolute;
|
|
left: 12px;
|
|
color: var(--text-muted);
|
|
pointer-events: none;
|
|
z-index: 1;
|
|
}
|
|
|
|
.sidebar-search-input {
|
|
width: 100%;
|
|
padding: 8px 12px 8px 36px;
|
|
border: 1px solid var(--border-medium);
|
|
border-radius: var(--radius-md);
|
|
font-size: 14px;
|
|
background: var(--bg-secondary);
|
|
color: var(--text-primary);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.sidebar-search-input:focus {
|
|
outline: none;
|
|
border-color: var(--accent-500);
|
|
box-shadow: 0 0 0 3px var(--accent-100);
|
|
}
|
|
|
|
.sidebar-search-input::placeholder {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
/* 导航区域 */
|
|
.sidebar-nav {
|
|
padding: 8px 0;
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.nav-section-title {
|
|
padding: 12px 20px 8px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
color: var(--text-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
margin: 0;
|
|
}
|
|
|
|
.nav-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
.nav-item {
|
|
margin: 2px 8px;
|
|
}
|
|
|
|
.nav-link {
|
|
display: block;
|
|
padding: 8px 12px;
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
border-radius: var(--radius-md);
|
|
transition: all 0.2s ease;
|
|
position: relative;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
background: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.nav-link:focus-visible {
|
|
outline: 2px solid var(--accent-600);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.nav-link.active {
|
|
background: var(--accent-50);
|
|
color: var(--accent-700);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.nav-link.active .nav-icon {
|
|
color: var(--accent-600);
|
|
}
|
|
|
|
.nav-link-content {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
position: relative;
|
|
}
|
|
|
|
.nav-icon {
|
|
color: var(--text-muted);
|
|
flex-shrink: 0;
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.nav-text-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.nav-title {
|
|
display: block;
|
|
font-size: 14px;
|
|
line-height: 1.3;
|
|
font-weight: 500;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.nav-description {
|
|
display: block;
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
margin-top: 1px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.nav-indicator {
|
|
position: absolute;
|
|
right: -12px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
width: 3px;
|
|
height: 20px;
|
|
background: var(--accent-600);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
/* 系统信息 */
|
|
.sidebar-footer {
|
|
padding: 16px 20px;
|
|
border-top: 1px solid var(--border-light);
|
|
background: var(--bg-tertiary);
|
|
margin-top: auto;
|
|
}
|
|
|
|
.system-info {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.info-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.info-label {
|
|
font-weight: 500;
|
|
}
|
|
|
|
.info-value {
|
|
color: var(--text-primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.settings-button {
|
|
width: 100%;
|
|
padding: 8px 12px;
|
|
background: none;
|
|
border: 1px solid var(--border-medium);
|
|
border-radius: var(--radius-md);
|
|
color: var(--text-secondary);
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.settings-button:hover {
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
border-color: var(--border-dark);
|
|
}
|
|
|
|
.settings-button:focus-visible {
|
|
outline: 2px solid var(--accent-600);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
/* 移动端侧边栏 */
|
|
.sidebar-backdrop {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 999;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transition: all 0.3s ease;
|
|
display: none;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.sidebar {
|
|
position: fixed;
|
|
top: 0;
|
|
left: -260px;
|
|
height: 100vh;
|
|
z-index: 1000;
|
|
transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.sidebar.open {
|
|
left: 0;
|
|
}
|
|
|
|
.sidebar-backdrop {
|
|
display: block;
|
|
}
|
|
|
|
.sidebar.open + .sidebar-backdrop {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
}
|
|
}
|
|
|
|
/* 滚动条优化 */
|
|
.sidebar::-webkit-scrollbar {
|
|
width: 4px;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-thumb {
|
|
background: var(--border-medium);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-thumb:hover {
|
|
background: var(--border-dark);
|
|
}
|
|
|
|
/* 动画效果 */
|
|
.nav-link,
|
|
.settings-button {
|
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
|
|
/* 无障碍支持 */
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.sidebar,
|
|
.nav-link,
|
|
.settings-button {
|
|
transition: none;
|
|
}
|
|
}
|
|
|
|
/* 高对比度模式 */
|
|
@media (prefers-contrast: high) {
|
|
.nav-link {
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.nav-link.active {
|
|
border-color: var(--accent-600);
|
|
}
|
|
|
|
.nav-indicator {
|
|
width: 4px;
|
|
}
|
|
} |