/* 链接访问统计样式 - 统计按钮在左下角，避免与"↑/↓"按钮遮挡 */

#stats-panel {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 统计按钮 */
.stats-toggle {
    width: 50px;
    height: 50px;
    background-color: #4a90e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.stats-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.5);
}

.stats-toggle i {
    color: #fff;
    font-size: 22px;
}

.stats-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 统计面板内容 */
.stats-content {
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 320px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.stats-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.stats-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.stats-close:hover {
    color: #333;
}

/* Tab 切换 */
.stats-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.stats-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.stats-tab:hover {
    background-color: #f8f9fa;
}

.stats-tab.active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
    font-weight: 500;
}

/* 统计列表 */
.stats-body {
    max-height: 300px;
    overflow-y: auto;
}

.stats-tab-content {
    padding: 10px 0;
}

.stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stats-list li {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
}

.stats-list li:hover {
    background-color: #f8f9fa;
}

.stats-list li:last-child {
    border-bottom: none;
}

.stats-rank {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background-color: #f0f0f0;
    border-radius: 50%;
    font-size: 12px;
    color: #666;
    margin-right: 10px;
    flex-shrink: 0;
}

.stats-list li:nth-child(1) .stats-rank {
    background-color: #ffd700;
    color: #333;
}

.stats-list li:nth-child(2) .stats-rank {
    background-color: #c0c0c0;
    color: #333;
}

.stats-list li:nth-child(3) .stats-rank {
    background-color: #cd7f32;
    color: #fff;
}

.stats-link {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-link:hover {
    color: #4a90e2;
}

.stats-count {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
    flex-shrink: 0;
}

.stats-time {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
    flex-shrink: 0;
}

.stats-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* 底部 */
.stats-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 12px;
}

.stats-clear {
    color: #e74c3c;
    cursor: pointer;
}

.stats-clear:hover {
    text-decoration: underline;
}

.stats-total {
    color: #666;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #stats-panel {
        bottom: 70px;
        left: 15px;
    }
    
    .stats-toggle {
        width: 45px;
        height: 45px;
    }
    
    .stats-toggle i {
        font-size: 20px;
    }
    
    .stats-content {
        width: 280px;
        left: 0;
    }
    
    .stats-body {
        max-height: 250px;
    }
}
