/**
 * 侧边栏样式
 */

/* 主应用布局 */
#app {
  min-height: 100vh;
}

/* 内容区域偏移 */
#app > .content {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 - 升级毛玻璃效果 */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 36px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-menu {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-menu:hover { color: var(--primary); }

.page-container {
  flex: 1;
  padding: 36px 40px;
  overflow-y: auto;
}

.sidebar {
  width: 240px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: linear-gradient(175deg, #0f172a 0%, #162032 60%, #1e293b 100%);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

/* Logo 区域 */
.sidebar-logo {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

/* Logo 区下方主色渐隐装饰线 */
.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), rgba(15, 118, 110, 0.3), transparent);
  border-radius: 1px;
}

.sidebar-logo .logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-white);
}

/* 导航区域 */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-sidebar);
  font-size: 13.5px;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-light);
  border-radius: 0 3px 3px 0;
  transition: height var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-white);
}

.nav-item:hover::before {
  height: 60%;
}

/* hover 态图标微缩放 */
.nav-item:hover i,
.nav-item:hover .icon {
  transform: scale(1.05);
}

.nav-item i,
.nav-item .icon {
  transition: transform 0.2s ease, color var(--transition-fast);
}

.nav-item.active {
  background: rgba(15, 118, 110, 0.3);
  color: var(--text-white);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.35);
}

.nav-item.active::before {
  height: 65%;
  background: var(--primary-light);
  box-shadow: 0 0 6px rgba(94, 234, 212, 0.4);
}

.nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

/* 子导航 */
.nav-sub-item {
  padding-left: 40px;
  font-size: 13px;
}

/* 导航组 */
.nav-group {
  margin-bottom: 4px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-sidebar);
  font-size: 13.5px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-group-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transition: height var(--transition-fast);
}

.nav-group-header:hover {
  color: var(--text-white);
  background: var(--bg-sidebar-hover);
}

.nav-group-header:hover::before {
  height: 50%;
}

/* hover 态 nav-group-header 图标微缩放 */
.nav-group-header:hover i:first-child {
  transform: scale(1.05);
}

.nav-group-header i:first-child {
  font-size: 18px;
  width: 22px;
  text-align: center;
  transition: transform 0.2s ease;
}

.nav-group-arrow {
  margin-left: auto;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.nav-group.open > .nav-group-header .nav-group-arrow {
  transform: rotate(90deg);
}

.nav-group-items {
  padding-left: 8px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.nav-group.open > .nav-group-items {
  max-height: 500px;
}

/* 分隔线 - 增强视觉分组 */
.nav-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  margin: 12px 12px;
  position: relative;
}

.nav-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: rgba(15, 118, 110, 0.3);
  border-radius: 50%;
}

/* 底部用户信息 */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  padding: 10px 12px;
  background: rgba(15, 118, 110, 0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 118, 110, 0.1);
}

.role-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(15, 118, 110, 0.2);
  border-radius: var(--radius-full);
  color: #5eead4;
  font-weight: 500;
}

.btn-logout {
  width: 100%;
  padding: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  color: var(--text-sidebar-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.2);
}

/* 侧边栏滚动条 */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* 侧边栏 overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

.sidebar-overlay.show {
  display: block;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .btn-menu {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .page-container {
    padding: var(--spacing-lg);
  }
}
