/* ============================================================
 * 赞助榜侧边栏小工具样式 (sponsor-widget.css)
 * 紧凑卡片式榜单，适配任意侧边栏宽度
 * ============================================================ */

.widget-sponsor-leaderboard { overflow: hidden; }

.spw-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef1f5;
}

/* 榜单切换标签 */
.spw-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: #f1f3f7;
    padding: 4px;
    border-radius: 10px;
}
.spw-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 0;
    border-radius: 7px;
    cursor: pointer;
    transition: all .2s ease;
}
.spw-tab:hover { color: #4338ca; }
.spw-tab.active {
    background: #fff;
    color: #4338ca;
    box-shadow: 0 1px 4px rgba(67, 56, 202, 0.15);
}

/* 榜单列表 */
.spw-list { display: flex; flex-direction: column; gap: 6px; }

.spw-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    transition: background .2s ease;
}
.spw-item:hover { background: #f8f9fc; }

.spw-item .spw-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* 访问官网按钮（仅网站主显示） */
.spw-visit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25);
}
.spw-visit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.4);
}

/* 排名序号 */
.spw-rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #eef1f5;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.spw-rank-1 .spw-rank { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.spw-rank-2 .spw-rank { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.spw-rank-3 .spw-rank { background: linear-gradient(135deg, #f0a27a, #d97706); color: #fff; }

/* 头像 */
.spw-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.spw-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.spw-avatar-ph {
    font-size: 16px;
    line-height: 1;
}

/* 信息 */
.spw-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.spw-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spw-amount {
    font-size: 12px;
    font-weight: 700;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}

/* 空状态 */
.spw-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 24px 8px;
    line-height: 1.6;
}

/* 去赞助按钮 */
.spw-cta {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    cursor: pointer;
    text-align: center;
    margin-top: 12px;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none !important;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.3);
}
.spw-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.4);
}

/* 加载中状态 */
.spw-list.loading { opacity: .5; pointer-events: none; }

/* 深色模式适配（若父主题启用） */
body.dark .spw-wrap,
.dark .spw-wrap {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
body.dark .spw-tabs,
.dark .spw-tabs { background: #0f172a; }
body.dark .spw-tab,
.dark .spw-tab { color: #94a3b8; }
body.dark .spw-tab.active,
.dark .spw-tab.active {
    background: #334155;
    color: #a5b4fc;
}
body.dark .spw-item:hover,
.dark .spw-item:hover { background: #334155; }
body.dark .spw-rank,
.dark .spw-rank { background: #334155; color: #94a3b8; }
body.dark .spw-avatar,
.dark .spw-avatar { background: #334155; }
body.dark .spw-name,
.dark .spw-name { color: #e2e8f0; }
body.dark .spw-empty,
.dark .spw-empty { color: #64748b; }