/**
 * Sidebar 侧边栏公共样式
 * 包含：大神排行榜、热榜组件
 * 可在首页、分类页、详情页等多个页面复用
 */

/* 侧边栏容器 */
.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* ========================================
   排行榜组件 (rank-widget)
   ======================================== */
.rank-widget {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f3f5;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-left: 12px;
}

.widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(135deg, #FF6A00 0%, #FF6FA5 100%);
}

.more-link {
    font-size: 13px;
    color: #9ca3af;
    transition: color 0.2s;
}

.more-link:hover {
    color: #FF6A00;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fafbfc;
    border-radius: 10px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.rank-item:hover {
    background: #fff5ec;
    border-color: #ffd1a8;
    transform: translateX(4px);
}

.rank-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    flex-shrink: 0;
}

.rank-num.rank-top {
    background: linear-gradient(135deg, #FF6A00 0%, #FF6FA5 100%);
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(255, 106, 0, 0.25);
}

.rank-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rank-name {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 排行榜用户名链接样式 */
.rank-name-link {
    flex: 1;
    min-width: 0;
}

.rank-name-link:hover .rank-name {
    color: #FF6A00;
}

/* 排行榜空状态 */
.rank-empty {
    padding: 20px 0;
    text-align: center;
}

.rank-empty p {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.rank-empty small {
    font-size: 12px;
    color: #bbb;
}

.rank-level {
    background: #fff5ec;
    color: #FF6A00;
    border: 1px solid #ffe0c7;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.rank-score {
    font-size: 13px;
    color: #FF6A00;
    font-weight: 600;
    flex-shrink: 0;
}

.rank-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* ========================================
   热榜组件 (hot-widget)
   ======================================== */
.hot-widget {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.widget-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.widget-tab {
    font-size: 15px;
    color: var(--text-gray);
    font-weight: 500;
    padding-bottom: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.widget-tab:hover {
    color: var(--primary-color);
}

.widget-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.hot-content {
    display: none;
}

.hot-content.active {
    display: block;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.hot-item:hover {
    background: #f0f2f5;
}

.hot-num {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-gray);
    flex-shrink: 0;
}

.hot-title {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* ========================================
   响应式设计
   ======================================== */

/* 平板设备 (1024px 以下) */
@media (max-width: 1024px) {
    .sidebar-area {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* 移动设备 (768px 以下) */
@media (max-width: 768px) {
    .sidebar-area {
        grid-template-columns: 1fr;
    }
}
