/* 右侧边栏 - 基础样式 */
.right-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 40px;
    align-self: flex-start;
}

/* WebKit浏览器隐藏滚动条 */
.right-sidebar::-webkit-scrollbar {
    display: none;
}

/* 侧边栏卡片 */
.sidebar-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-body {
    padding: 15px;
}

/* 公告列表 */
.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice-item {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    text-decoration: none;
}

.notice-link i {
    color: var(--primary);
}

/* 热门下载排行 */
.hot-rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-rank-item {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.hot-rank-item:last-child {
    border-bottom: none;
}

.hot-rank-link {
    display: flex;
    align-items: center;
    color: var(--dark);
    font-size: 12px;
    text-decoration: none;
}

.hot-rank-num {
    width: 24px;
    height: 24px;
    background: #f0f3f7;
    color: var(--gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.hot-rank-info {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.hot-rank-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

/* 热门排行前三名样式 */
.hot-rank-num.top {
    background: linear-gradient(to right, var(--primary), #6e8ffa);
    color: white;
}

/* 为不同名次设置不同颜色 */
.hot-rank-item:first-child .hot-rank-num.top {
    background: linear-gradient(to right, #FF6B6B, #FF8E8E);
}

.hot-rank-item:nth-child(2) .hot-rank-num.top {
    background: linear-gradient(to right, #FF9F43, #FFBC7D);
}

.hot-rank-item:nth-child(3) .hot-rank-num.top {
    background: linear-gradient(to right, #54A0FF, #6ABEFF);
}

/* 下载排行鼠标悬停效果 */
.hot-rank-item:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* 悬停时标题颜色变化 */
.hot-rank-link:hover .hot-rank-name {
    color: var(--primary);
}

/* 帖子排行榜样式 */
.post-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-ranking-item {
    position: relative;
    padding: 12px 0;
}

.post-ranking-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.post-ranking-link {
    display: flex;
    text-decoration: none;
    color: var(--dark);
}

.rank-badge {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* 排名不同颜色 */
.rank-1 {
    background: linear-gradient(135deg, #FF6B6B, #FF0000);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
}

.rank-2 {
    background: linear-gradient(135deg, #5C7CFA, #339AF0);
    color: white;
    box-shadow: 0 2px 4px rgba(51, 154, 240, 0.2);
}

.rank-3 {
    background: linear-gradient(135deg, #20C997, #38D9A9);
    color: white;
    box-shadow: 0 2px 4px rgba(32, 201, 151, 0.2);
}

.rank-4, .rank-5, .rank-6 {
    background: #f0f0f0;
    color: #777;
}

.post-ranking-content {
    flex: 1;
    overflow: hidden;
}

.post-ranking-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    transition: color 0.2s;
}

.post-ranking-link:hover .post-ranking-title {
    color: var(--primary);
}

.post-ranking-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.post-ranking-plate {
    color: var(--primary);
    padding: 2px 6px;
    background-color: rgba(25, 152, 255, 0.08);
    border-radius: 3px;
    white-space: nowrap;
}

.post-ranking-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
}

.post-ranking-stats span {
    display: flex;
    align-items: center;
}

.post-ranking-stats i {
    margin-right: 3px;
    font-size: 11px;
}

/* 鼠标悬停效果 */
.post-ranking-item:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* 友情链接样式 */
.friend-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.friend-link-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
    background: #f8f9fa;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.friend-link-item:hover {
    background: #eef2ff;
    transform: translateY(-2px);
}

.friend-link-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 8px;
    object-fit: cover;
}

.friend-link-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.empty-links {
    grid-column: span 2;
    text-align: center;
    padding: 15px;
    color: #888;
    font-size: 13px;
}

/* 活跃用户排行榜样式 - 带前缀防冲突 */
.right-active-users-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.right-active-user-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.right-active-user-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.right-active-user-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.right-active-user-link:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.right-active-user-rank {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.right-active-user-rank.rank-1 {
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

.right-active-user-rank.rank-2 {
    background: linear-gradient(45deg, #C0C0C0, #A0A0A0);
}

.right-active-user-rank.rank-3 {
    background: linear-gradient(45deg, #CD7F32, #B8860B);
}

.right-active-user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
}

.right-active-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.right-active-user-info {
    flex: 1;
    min-width: 0;
}

.right-active-user-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap; /* 只允许标签换行 */
}

/* 用户名部分 - 不允许换行，超出显示省略号 */
.right-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px; /* 根据需要调整最大宽度 */
    flex-shrink: 1; /* 允许收缩 */
}

/* 标签容器 */
.right-user-badges {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    flex-shrink: 0; /* 标签不收缩 */
}

.right-active-user-time {
    font-size: 11px;
    color: #666;
}

.right-active-user-time i {
    color: #6c757d;
}

.right-admin-tag {
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.right-vip-tag {
    background: linear-gradient(45deg, #ffc107, #ffb300);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.right-online-tag {
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* 在线状态指示器 */
.right-online-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #28a745;
    border: 2px solid #fff;
    border-radius: 50%;
}

/* 在线指示器动画 */
.right-online-indicator {
    font-size: 12px;
    color: #28a745;
    margin-left: auto;
}

.right-online-dot {
    color: #28a745;
    animation: right-pulse 2s infinite;
}

@keyframes right-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 实时统计样式 */
.right-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.right-stat-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.right-stat-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: white;
}

.right-stat-icon.online {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.right-stat-icon.new {
    background: linear-gradient(45deg, #007bff, #6610f2);
}

.right-stat-icon.active {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
}

.right-stat-info {
    flex: 1;
}

.right-stat-number {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.right-stat-label {
    font-size: 12px;
    color: #666;
}


/* 响应式设计 */
@media (max-width: 992px) {
    .right-sidebar {
        width: 100%;
        position: static;
    }
}

/* 移动端隐藏右侧边栏 */
@media (max-width: 768px) {
    .right-sidebar {
        display: none;
    }
}