/* 导航栏已登录用户信息按钮 */
.user-info-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.75rem 0 0.5rem;
  border-radius: 2rem;
  border: 1px solid rgba(111,127,95,0.25);
  background: rgba(111,127,95,0.06);
  color: var(--text-foreground);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  max-width: 220px;
}

.user-info-btn:hover {
  background: rgba(111,127,95,0.12);
  border-color: rgba(111,127,95,0.4);
}

/* 头像圆圈 */
.user-info-btn .avatar-circle {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: rgba(111,127,95,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6F7F5F;
}

.user-info-btn .avatar-circle svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* 用户名 + 角色徽章 */
.user-info-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}

.nav-username {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-foreground);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-role-badge {
  font-size: 0.5625rem;
  font-weight: 500;
  color: #6F7F5F;
  letter-spacing: 0.02em;
}

.nav-role-badge.vip {
  color: #b45309;
}

.nav-role-badge.admin {
  color: #dc2626;
}

/* 下拉箭头 */
.chevron-icon {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.user-menu-wrapper.open .chevron-icon {
  transform: rotate(180deg);
}

/* 移动端隐藏用户名，只显示头像 */
@media (max-width: 480px) {
  .user-info-text,
  .chevron-icon {
    display: none;
  }
  .user-info-btn {
    padding: 0;
    width: 2.25rem;
    justify-content: center;
    border-radius: 50%;
  }
}

/* ========================================
   接着读板块跟随页面滚动（无独立滚动条）
   ======================================== */
@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 64px;
    height: fit-content;
  }
}

/* ========================================
   左侧统计卡片改为横向一行（桌面端）
   ======================================== */
@media (min-width: 768px) {
  .stats-grid {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
  }
  .stats-grid .stat-card {
    flex: 1;
  }
  /* 隐藏统计卡片里的图标 */
  .stats-grid .stat-icon {
    display: none;
  }
}

/* 滚动条样式（Webkit 内核浏览器）— 仅 sidebar 使用 */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(111, 127, 95, 0.3);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 127, 95, 0.5);
}

/* 深色模式适配 */
body.dark .sidebar::-webkit-scrollbar-thumb {
  background: rgba(111, 127, 95, 0.4);
}

body.dark .sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 127, 95, 0.6);
}
